Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns only dogs that start with the search string
function filterByName(dogs, name) { return dogs.filter(function(dog) { return dog.name.toLowerCase().startsWith(name.toLowerCase()); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findWords(dogString,dogNames)\n{\n let dogName = dogString.split(\",\")[1].toLowerCase().split(\" \").splice(-1);\n for(let i=0; i <= dogNames.length; i++)\n {\n if(dogNames[i].toLowerCase() == dogName)\n {\n return \"Matched dog_name\";\n }\n continue;\n }\n return \"No matches\";\n}", "function displayNoDogs() {\r\n if (\r\n searchValue.toLowerCase() === 'dog' ||\r\n searchValue.toLowerCase() === 'dogs'\r\n ) {\r\n alert('Dogs?! 🙀 Oh the betrayal... ');\r\n }\r\n}", "function findMatches(wordToMatch, food) {\n return food.filter((place) => {\n const regex = new RegExp(wordToMatch, 'gi');\n return place.category.match(regex) || place.city.match(regex) || place.name.match(regex);\n });\n }", "function search (keyword) {\n searchArray = [];\n for (i=0;i<foodArray.length;i++) {\n if (foodArray[i].name.match(keyword)) {\n searchArray.push(foodArray[i]);\n }\n }\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 findDog() {\n\tfor (i = 0; i < animals.length; i++){\n\t\tif (animals[i].species == \"cat\"){\n\t\t\tcats.push(animals[i])\n\t\t}\n\t}\n}", "function filterByNameOrAdress(classNameOf) {\n const drinkNames = document.querySelectorAll(classNameOf);\n\n for (let index = 0; index < drinkNames.length; index++) {\n if (\n drinkNames[index].innerHTML\n .toLowerCase()\n .includes(searchTxt.value.toLowerCase())\n ) {\n drinkNames[index].style.display = \"block\";\n } else {\n drinkNames[index].style.display = \"none\";\n }\n }\n }", "findItem(query) {\n if (query === '') {\n return this.dataSearch.slice(0, 5);\n }\n const regex = new RegExp(`${query.trim()}`, 'i');\n return this.dataSearch.filter(film => film.name.search(regex) >= 0);\n }", "function searchingFor(term){\n return function(x){\n return x.post_content.toLowerCase().includes(term.toLowerCase()) || !term;\n }\n}", "function nameStartsWith(name, search) {\r\n if (search === '')\r\n return true;\r\n\r\n var Regex = /[ _-]+/;\r\n var names = name.split(Regex);\r\n\r\n //do any of the names in the array start with the search string\r\n return names.some(function (name) {\r\n return name.toLowerCase().indexOf(search.toLowerCase()) === 0;\r\n });\r\n }", "function beginsWithKeyword(str)\n{\n for(j = 0 ; j < keywords.length; j++)\n {\n if(str.indexOf(keywords[j]) == 0) return true;\n }\n return false;\n}", "function lordOfTheRingSeries() {\n seanBeanMovies.forEach(function(movie) {\n if (movie.toLowerCase().includes(\"the lord of the ring\")) {\n console.log(movie);\n }\n });\n}", "function matchStart(term, text) {\n var has = true;\n var words = term.toUpperCase().split(\" \");\n for (var i =0; i < words.length; i++){\n var word = words[i];\n has = has && (text.toUpperCase().indexOf(word) >= 0);\n }\n return has;\n}", "function findResults(search){\n // Just using String.prototype.includes() matches within words\n // Want to search for matches of whole words (so that e.g. \"cat\" doesn't match \"domestiCATed dog\")\n const searchTerm = search.toLowerCase().split('_'); // Space characters get passed in as underscores\n const results = data.filter(item => {\n const bodyTextWords = item.bodyText.toLowerCase();\n const findWords = searchTerm.map(term => {\n const regex = new RegExp(`\\\\b${escapeRegExp(term)}\\\\b`);\n const findWord = bodyTextWords.search(regex);\n return findWord; \n });\n const noWordsFound = findWords.includes(-1); // Gives true if no words were found\n return !noWordsFound\n });\n return results;\n}", "function searchPet() {\n var searchText = document.getElementById(\"search-text\").value\n\n document.getElementById(\"pets\").innerHTML=\"\";\n\n for (var i = 0; i < pets.length; i ++) {\n var pet = pets[i];\n\n if (\n pet.name.toLowerCase().includes(searchText.toLowerCase()) ||\n pet.owner.toLowerCase().includes(searchText.toLowerCase()) ||\n pet.phone.includes(searchText)\n \n ) {\n displayPet(pet);\n }\n }\n}", "function dictStartWith(word) {\n\tword = word.toLowerCase();\n\tconst checkList = [];\n\tObject.entries(dict).forEach(([originalEnglish, logograms]) => {\n\t\tif (!originalEnglish.startsWith(word)) return;\n\t\tcheckList.push(...logograms);\n\t});\n\treturn checkList;\n}", "function startsWithString(array,string){\n var list=[];\n for(var i=0;i<array.length;i++){\n if(array[i].name.startsWith(string))\n list.push(array[i]);\n }\n return list;\n\n}", "function search (array,string){// create a function search, parameters are array, for your animals, and string for what the animal is.\n for (var i = 0; i<= array.length-1; i++){ //Using a for loop to loop over our entire array, incrementing by 1 each loop. \n if(array[i].name === string){//Conditional check to then return a value for our search engine. \n return array[i];//return our animal object, with the information accessed from our for loop\n }\n }return null; //Before returning null, we are wanting our loop to fully be gone through. If our name is not in the entire loop, we will return null\n}", "function dictionary(searchTerm, arrayOfWords) {\n return arrayOfWords.filter((word) => word.startsWith(searchTerm));\n}", "function startsWith(src, searchString) {\n return src.substr(0, searchString.length) === searchString;\n}", "function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).css({display: 'block'})\n }\n else {\n $(items[i]).css({display: 'none'})\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}", "performSearch(searchTerm) {\n if (!searchTerm || searchTerm.trim() === '') {\n return [];\n }\n const isPrefix = this._isPrefix.bind(this, searchTerm);\n return this.suggestions.filter(isPrefix);\n }", "function searchPlayer(term) {\n return search(term, 'soccer player', true);\n}", "function findMatches(wordToMatch, names){\n\t\treturn names.filter(restaurants => {\n\t\t\tconst regex = new RegExp (wordToMatch, 'gi');\n\t\t\treturn restaurants.name.match(regex)\n\t\t});\n\t}", "function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}", "function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}", "function citySearch(keyword) {\n var regexp = RegExp(keyword, 'i');\n var result = cities.filter(function (city) {\n return city.match(regexp);\n });\n\n return result;\n}", "function citySearch(keyword) {\n var regexp = RegExp(keyword, 'i');\n var result = cities.filter(function (city) {\n return city.match(regexp);\n });\n\n return result;\n}", "function find(stg)\n{\n return sentence.includes(stg);\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 fuzzyMatch(drivers, string) {\n return drivers.filter(obj => {\n return obj.startsWith(string)\n })\n}", "function firstFruit(str){\n return str.replace(/\\b(apple|blueberry|cherry)\\b/i, 'danish')\n}", "startsWith(word) {\n let node = recursiveSearch(this.root, word);\n return node != null;\n }", "function search(searchTerm) {\n var search = new RegExp(searchTerm, 'i');\n \n return TITLES.filter(function(title) {\n return search.test(title);\n });\n}", "function filter(selector, query) {\n query = $.trim(query); //trim white space\n query = query.replace(/ /gi, '|'); //add OR for regex query\n \n $(selector).each(function() {\n if ($(this).text().search(new RegExp(query, \"i\")) < 0) {\n $(this).parent().stop(true,true).fadeOut(500);\n } else {\n $(this).parent().stop(true,true).fadeIn(500);\n }\n });\n\n }", "function startsWith(input){\n\t\treturn new RegExp('^' + input, 'g');\n\t}", "ingredientFilter(recipe) {\n const searchTerm = this.state.search;\n if (recipe.ingredients.length !== 0) {\n for (let i = 0; i < recipe.ingredients.length; i++) {\n if (recipe.ingredients[i].ingredient.toLowerCase().includes(searchTerm.toLowerCase())) {\n return recipe.ingredients[i].ingredient.toLowerCase().includes(searchTerm.toLowerCase());\n }\n }\n return false;\n } else {\n return false;\n }\n }", "function search (req, res) {\n var path = req.url.split('/')[1]\n var keyWord = req.query.s\n\n // Path can be buscar, that looks for regex match into the title, or it can\n // be categoria, that looks for the keyword in the tags array\n var condition = path === 'buscar' ? {'title': { \"$regex\": keyWord, \"$options\": \"i\" }}\n : {'tags': keyWord}\n\n Post.find(condition, function(err, results) {\n if (err) return console.log(err)\n return res.send(results)\n })\n}", "function search(nameSearch) {\n var result = repository.filter((word) => word.name === nameSearch);\n if (result.length > 0) {\n console.log('Here is your Pokemon:' + '<br>');\n return result;\n } else {\n return 'There is no Pokemon with that name in the repo';\n }\n }", "function find() {\n const searchInput = document\n .querySelector('#search-bar')\n .value.toUpperCase();\n const fullList = document.querySelectorAll('.pokedex-list__item');\n\n fullList.forEach(function (entry) {\n if (entry.innerText.toUpperCase().indexOf(searchInput) > -1) {\n entry.style.display = '';\n } else {\n entry.style.display = 'none';\n }\n });\n }", "function filteredShoes() {\n let searchTerm = \"shoe\";\n console.log(searchTerm);\n console.log(products);\n let searchedProducts = products.filter((product) => \n product.product_type.toLowerCase().includes(searchTerm.toLowerCase())\n \n );\n console.log(searchedProducts);\n make_products(searchedProducts);\n\n}", "searchFn (haystack, needle) { // search function\r\n return haystack.toLowerCase().indexOf(needle.toLowerCase()) < 0;\r\n }", "function filterBySearchTerm(){\n let inputName = document.querySelector('#input-pokemon-name').value;\n let pokemonNames = arrayOfPokemon.filter(pokemon => pokemon.name.startsWith(inputName));\n\n let inputType = document.querySelector('#input-pokemon-type').value;\n let pokemonTypes = arrayOfPokemon.filter(pokemon => pokemon.primary_type.startsWith(inputType));\n\n if (inputName !== \"\"){\n document.querySelector('#pokemon-list').innerText = '';\n displayList(pokemonNames);\n } else if (inputType !== \"\"){\n document.querySelector('#pokemon-list').innerText = '';\n displayList(pokemonTypes);\n } else if (inputName == \"\" && inputType == \"\"){\n let pokemonList = document.querySelector('#pokemon-list');\n pokemonList.innerHTML = \"\";\n displayList(arrayOfPokemon);\n };\n}", "function filter(keyword) {\n var filteredItems = [];\n for (var j = 0; j < items.length; j++) {\n var item = items[j];\n var cocok = item[1].toLowerCase().includes(keyword.toLowerCase()); // cocokan kata dengan function include dengan nilai default bolean || jika ada kata yang sesuai dengan yang sesuai dengan yang dicari tampilkna\n if (cocok) {\n // menampung sesuai di array pakai push \n filteredItems.push(item);\n\n }\n }\n return filteredItems;\n}", "function matchStart (term, text) {\n if (text.toUpperCase().indexOf(term.toUpperCase()) === 0) {\n return true;\n }\n\n return false;\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 findMatches(word, cities) {\n // set searched value as regular expression\n const regex = new RegExp(word, 'gi');\n // filter objects in cities array based on whether their name property (individual city) matches input value\n return cities.filter(obj => {\n\n /* if city name matches, obj.name.match(regex) will return array of hits, which is truthy, that's why whole city name will be included in result array. If it does not match match function will return null which is \n falsy and whole element will not be included in result array */ \n return obj.name.match(regex);\n })\n}", "function startsWith(input, value) {}", "function search(animals, name) {\n // param animals represents an Array of animals\n // param name represents a String, the name of an animal on which to perform search\n // loop through animals array\n // match animal's name property to name parameter\n for (let i = 0; i < animals.length; i++) {\n if (name.toLowerCase() === animals[i].name.toLowerCase()) {\n console.log(animals[i]);\n return animals[i];\n }\n }\n return null;\n}", "function loadFilteredFilmList(value) {\n axios.get('https://data.sfgov.org/resource/wwmu-gmzc.json').then(res => {\n var regex = new RegExp(value, \"gi\");\n var searchValue = res.data.filter(film => {\n return film.title.match(regex);\n });\n renderFilmList(searchValue);\n }).catch();\n}", "function searchFilter(searchStr, listRootId) {\n\t\tvar match;\n\t\tvar searchIndex;\n\t\tvar i, j;\n\t\tvar nodeJQ;\n\t\tvar visibleNodes = [];\n\n\t\t// show all\n\t\tif (!searchStr || searchStr === \"\") {\n\t\t\tjQuery(\"#\" + listRootId).find(\"li\").andSelf().show();\n\t\t}\n\n\t\tsearchStr = searchStr.toLowerCase();\n\n\n\t\t// hide all nodes while traversing\n\t\t// not to nice implemented ;)\n\t\tfor (i = autoComplete.dictionaryTags.length - 1; i >= 0; i--) {\n\t\t\tnodeJQ = jQuery(\"#\" + autoComplete.dictionaryTags[i].id);\n\t\t\t//console.log(autoComplete.dictionaryTags[i].tags[0])\n\t\t\tmatch = null;\n\t\t\tfor (j = 0; j < autoComplete.dictionaryTags[i].tags.length; j++) {\n\t\t\t\tsearchIndex = autoComplete.dictionaryTags[i].tags[j].toLowerCase().match(searchStr);\n\t\t\t\tif (searchIndex) {\n\t\t\t\t\tmatch = nodeJQ;\n\t\t\t\t\t//select node in tree to highlight\n\t\t\t\t\tif (searchIndex === 0 && autoComplete.dictionaryTags[i].tags[j].length === searchStr.length) {\n\t\t\t\t\t\tMYAPP.tree.select_node(jQuery(\"#\" + autoComplete.dictionaryTags[i].id));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnodeJQ.hide();\n\n\t\t\tif (match) {\n\t\t\t\tvisibleNodes.push(match);\n\t\t\t}\n\t\t}\n\n\t\t// show matching nodes and all their parents\n\t\t// !!! todo: the method parents gos up to the html root but it should stop at the top of the list\n\t\tfor (i = visibleNodes.length - 1; i >= 0; i--) {\n\t\t\tvisibleNodes[i].parents(\"#treeList li\").andSelf().show();\n\t\t}\n\t}", "function wordSearch($, word) {\n\tif(word.trim().length < 1) {\n\t\treturn false;\n\t}\n \tvar bodyText = $('html > body').text();\n \tif(bodyText.toLowerCase().indexOf(word.toLowerCase()) !== -1) {\n \treturn true;\n \t}\n \treturn false;\n}", "function searchingFor(term){\n return function(x){\n return x.first_name.toLowerCase().includes(term.toLowerCase()) || !term;\n };\n}", "function startswith (string, prefix)\n{\n\treturn string.indexOf(prefix) == 0;\n}", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "function includesDakota(elements) {\n return elements.filter(element => element.includes(\"Dakota\"));\n}", "function startWith(s3) {\n var startString = s3.startsWith(\"Skoda\");\n console.log(startString);\n}", "function searchTerms() {\n const searchField = document.querySelector(\".searchbar\");\n const searchTerm = searchField.value;\n const regex = new RegExp(searchTerm, \"gi\");\n const allTerms = Array.from(document.querySelectorAll(\".term\"));\n const termText = allTerms.map(term => term.textContent);\n const found = termText.filter(term => {\n return term.match(regex);\n });\n filterBySearch(allTerms, found);\n}", "function search_movies() {\n\tlet input = document.getElementById('searchbar').value\n\tinput=input.toLowerCase();\n\tlet x = document.getElementsByClassName('movies');\n\t\n\tfor (i = 0; i < x.length; i++) {\n\t\tif (!x[i].innerHTML.toLowerCase().includes(input)) {\n\t\t\tx[i].style.display=\"none\";\n\t\t}\n\t\telse {\n\t\t\tx[i].style.display=\"list-item\";\t\t\t\t\n\t\t}\n\t}\n}", "function findMatches(wordToMatch, products) {\n\treturn products.filter(product=>{\n\t\tconst regex = new RegExp(wordToMatch,'gi');\n\t\treturn product.title.match(regex) || product.filtertags.country.match(regex)\n\t})\n}", "function findMatches(wordToMatch, country) {\n return country.filter(c => {\n if (\n wordToMatch.toLowerCase() ==\n c.name.toLowerCase().substring(0, wordToMatch.length)\n ) {\n return c;\n }\n });\n}", "function findService(query) {\n const servicesFound = pharmacies.filter(pharm =>\n Object.values(pharm).find(val =>\n val.toLowerCase().includes(query.toLowerCase())\n )\n );\n return servicesFound;\n}", "function filter(dogs, inputs) {\n if (inputs.name) {\n dogs = filterByName(dogs, inputs.name);\n }\n if (inputs.breed) {\n dogs = filterByBreed(dogs, inputs.breed);\n }\n if (inputs.sizes && inputs.sizes.length > 0) {\n dogs = filterBySize(dogs, inputs.sizes);\n }\n return dogs;\n}", "function searchCoffees() {\n var searchRoast = searchBox.value.toUpperCase(); //can be upper or lower case so it can detect all words inserted\n var filteredCoffees = []; //has to create an empty array so it can push whatever the search value is\n coffees.forEach(function(coffee) {\n if (coffee.name.toUpperCase().includes(searchRoast)) {\n filteredCoffees.push(coffee);\n console.log(filteredCoffees);\n }\n });\n tbody.innerHTML = renderCoffees(filteredCoffees);\n}", "function matchPokemon(str){\n\tvar arr=[];\n\tfor(var i=0;i<allPokemon.length;i++){\n\t\tif(allPokemon[i].Name.includes(str) || allPokemon[i].Ndex.includes(str) || allPokemon[i].Kdex.includes(str)){\n\t\t\tarr.push(i);\n\t\t}\n\t}\n\treturn arr;\n}", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "function searchAndDivide(str){\r\n result = {\r\n match: [],\r\n unmatch: []\r\n }\r\n for(let i = 0; i < movies.length; i++){\r\n if (movies[i].Title.includes(str))\r\n result.match.push(movies[i])\r\n else\r\n result.unmatch.push(movies[i])\r\n }\r\n return result\r\n}", "function startsWith(ch)\n{\n return this.indexOf(ch) == 0;\n}", "function search(str) {\n\t\t\tif (str.length == 0) {\n\t\t\t\tbuild_list(items);\n\t\t\t} else {\n\t\t\t\tstr = str.split('\\\\').join('\\\\\\\\');\n\t\t\t\tmatches.length = 0;\n\t\t\t\tpattern = \"^\" + str;\n\t\t\t\tregex = new RegExp(pattern, 'i');\n\t\t\t\tvar len = items.length;\n\t\t\t\tfor (var x = 0; x < len; x++) {\n\t\t\t\t\tval = get_value(items[x]);\n\t\t\t\t\tif (val.match(regex)) {\n\t\t\t\t\t\tmatches.push(items[x]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbuild_list(matches);\n\t\t\t}\n\t\t}", "function pullSearchDogImages(dogSearch) {\n\t\tfetch(`https://dog.ceo/api/breed/${dogSearch}/images/random`)\n .then(response => {\n\t\t\tif (response.ok) {\n\t\t\t\treturn response.json();\n\t\t\t} else {\n\t\t\t\tthrow console.log(response.text());\n\t\t\t}\n\t\t}).then(responseJson => displaySearchResults(responseJson))\n .catch(error => displaySearchError(error));\n\t} //function__search", "filteredBirds() {\n return this.birds.filter(\n (bird) => {\n let filterBirdResult = true\n if (this.filterName !== \"\") {\n filterBirdResult = bird.name.includes(this.filterName)\n\n }\n return filterBirdResult\n\n }\n )\n\n }", "function strStartsWith ( input, match ) {\r\n\t\treturn input.substring(0, match.length) === match;\r\n\t}", "function strStartsWith ( input, match ) {\r\n\t\treturn input.substring(0, match.length) === match;\r\n\t}", "function filterBySearch(allRecipes) {\n return allRecipes.filter(checkForUser).filter(\n recipe =>\n recipe.name.toUpperCase().includes(search.toUpperCase()) ||\n recipe.categories\n .join()\n .toUpperCase()\n .includes(search.toUpperCase()) ||\n recipe._owner.username.toUpperCase().includes(search.toUpperCase())\n )\n }", "function findMatching(list, name) {\n return list.filter(function (dName){\n return dName.toLowerCase() === name.toLowerCase();\n });\n}", "function isStrInWord(string, word) {\n if (word.startsWith(string) == true) {\n console.log(true);\n } else {\n console.log(false);\n }\n}", "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "function allWithPro (arr,substr) {\n return arr.filter(function(element) { \n return element.toLowerCase().startsWith(substr);\n })\n}", "function searchPokemon() {\n // Declare variables\n let input, filter, poke_container, pokemon_items, a, i, txtValue;\n input = document.getElementById('search_input');\n filter = input.value.toUpperCase();\n poke_container = document.getElementById(\"poke_container\");\n pokemon_items = poke_container.querySelectorAll('.pokemon');\n \n // Loop through all pokemon and hide those who don't match the search query\n for (i = 0; i < pokemon_items.length; i++) {\n a = pokemon_items[i].getElementsByTagName(\"h3\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n pokemon_items[i].style.display = \"\";\n } else {\n pokemon_items[i].style.display = \"none\";\n }\n }\n}", "function findIt(stingArray, searchString) {\n return stingArray.filter(stringItem => stringItem.includes(searchString));\n}", "function fuzzyMatch(drivers, string) {\n return drivers.filter(driver => {\n return driver.startsWith(string)\n });\n}", "function findMatching(drivers, string) {\n return drivers.filter( n => { return n.toLowerCase() === string.toLowerCase()})\n}", "function findDeviceIds(wordToMatch, devices) {\n var deviceList = devices.filter(device => {\n\n const regex = new RegExp(wordToMatch.replace(/(\\S+\\s+\\S+)\\s/, \"$1|\"), 'gi');\n console.log(regex);\n if (regex.test('all')) {\n return device.deviceId;\n } else {\n return device.description.match(regex);\n }\n });\n return deviceList.map(deviceIds => {\n return deviceIds.deviceId;\n });\n}", "function filterGallery(keywords) {\n var filteredGallery;\n //CR : if(keyWords.length === 0 ) return buildGallery(gImgs)\n if (keywords.length === 0) {\n buildGallery(gImgs);\n return;\n }\n var keywordsArr = keywords.split(\" \");\n keywordsArr = keywordsArr.map(function (keyword) {\n return keyword.toLowerCase();\n });\n if (keywordsArr.length > 1) {\n filteredGallery = gImgs.filter(function (img) {\n var containsAllWords = false;\n for (var i = 0; i < keywordsArr.length; i++) {\n var word = keywordsArr[i];\n if (img.keywords.includes(word)) { //can make search better by searching for a words within an item inside img.keywords\n containsAllWords = true;\n } else {\n containsAllWords = false;\n break;\n }\n }\n if (containsAllWords) return img;\n });\n } else {\n filteredGallery = gImgs.filter(function (img) {\n // return (img.keywords.includes(keywordsArr[0]))\n if (img.keywords.includes(keywordsArr[0])) return img;\n });\n }\n buildGallery(filteredGallery);\n}", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "function startsWith(src, str) {\n return src.slice(0, str.length) === str\n }", "function filterStudents(searchString) {\n let newData = [];\n for (let i = 0; i < data.length; i++) {\n const name = `${data[i].name.first} ${data[i].name.last}`\n if (name.toLowerCase().includes(searchString.value.toLowerCase())) {\n newData.push(data[i]);\n }\n }\n return newData;\n}", "handleSearch(e) {\n const searchQuery = e.target.value.toLowerCase();\n\n const displayedHeroes = HEROES.filter(hero => {\n const searchString = hero.name.toLowerCase() + hero.firstAppearance.toLowerCase();\n\n return searchString.indexOf(searchQuery) !== -1;\n });\n\n this.setState({\n displayedHeroes,\n });\n }", "function containsAny (myStr, mySearchWords) {\r myStr = myStr.toLowerCase();\r var i;\r for (i=0; i < mySearchWords.length; i++) {\r if (myStr.search(mySearchWords[i].toLowerCase()) != -1) {\r return true;\r }\r }\r return false;\r }", "function searchPhotos() {\n let $val = $('#searchbar').val().toLowerCase();\n $photoGal.each(function(i, item) {\n if ($(item).attr('data-title').toLowerCase().indexOf($val) >-1) {\n $(item).parent().show(); \n } else { \n $(item).parent().hide();\n }\n});\n}", "function findMatching(source, sought) {\n return source.filter( possibleMatch =>\n possibleMatch.toLowerCase() === sought.toLowerCase()\n )\n}", "function find(items, text) {\n text = text.split(\" \")\n return items.filter(function(item) {\n return text.every(function(el) {\n return item.name.toLowerCase().indexOf(el) > -1\n })\n })\n }", "function startsWith(src, str) {\n return src.slice(0, str.length) === str\n}", "filteredBirds() {\n return vm.birds.filter(\n (bird) => {\n let filterBirdResult = true\n if (this.filterName !== \"\") {\n filterBirdResult = bird.name.includes(vm.filterName)\n\n }\n return filterBirdResult\n\n }\n )\n\n }", "function search(words, combined, caseSensitive){\n\tvar combined = combined || false;\n\tvar exp = '';\n\tvar query = '';\n\n\t//stringify object to make it search able\n\tif(_.isObject(words) && !_.isArray(words)){\n\t\twords = JSON.stringify(words);\n\t}\n\n\tif(_.isArray(words)){\n\t\tif(combined){\n\t\t\t_.forEach(words, function(word){\n\t\t\t\texp += '(?=.*\\\\b' + word + '\\\\b)';\n\t\t\t});\n\t\t} else {\n\t\t\t_.forEach(words, function(word, index){\n\t\t\t\tif(index == 0){\n\t\t\t\t\texp += '(\\\\b' + word + '\\\\b)';\n\t\t\t\t} else {\n\t\t\t\t\texp += '|(\\\\b' + word + '\\\\b)';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif(combined){\n\t\t\texp += '(?=.*\\\\b' + words + '\\\\b)';\n\t\t} else {\n\t\t\texp += '(\\\\b' + words + '\\\\b)';\n\t\t}\n\t}\n\n\tif(caseSensitive){\n\t\tif(combined){\n\t\t\tquery = new RegExp('^' + exp + '.*$');\n\t\t} else {\n\t\t\tquery = new RegExp(exp);\n\t\t}\n\t} else {\n\t\tif(combined){\n\t\t\tquery = new RegExp('^' + exp + '.*$', 'i');\n\t\t} else {\n\t\t\tquery = new RegExp(exp, 'i');\n\t\t}\n\t}\n\n\n\n\treturn query;\n}", "function createStartsWithFilter(startsWith) {\n // YOUR CODE BELOW HERE //\n // return a function that test if a string starts with the starts with char\n // need to add a parameter of string in return function\n return function(str){\n if(str[0].toLowerCase() === startsWith.toLowerCase()){\n return true;\n } else{\n return false;\n }\n }\n \n \n // YOUR CODE ABOVE HERE //\n}", "function antiSpam(input){\n let string = input\n console.log(string)\n if(string.toLowerCase().includes(\"spam\") || string.toLowerCase().includes(\"scam\")){\n return true\n }else{\n return false\n }\n}", "function filteredCharacters(arr) {\n return arr.filter(item => {\n if (!searchTerm) {\n return item\n }\n if (item.name.toLowerCase().includes(searchTerm)) {\n return item\n }\n })\n }", "function search(animals, name) {\n \n for (var i = 0; i < animals.length; i++){\n \n if (animals[i].name === name){\n return animals[i];\n } \n \n } return null;\n}" ]
[ "0.65473694", "0.6161114", "0.6121134", "0.60136485", "0.59895986", "0.5869747", "0.5784009", "0.57766646", "0.5769014", "0.5716776", "0.5659882", "0.5650109", "0.56455165", "0.5618156", "0.56046224", "0.5590966", "0.55878466", "0.5573191", "0.55503625", "0.55425304", "0.553477", "0.5518433", "0.55111086", "0.54939896", "0.54898846", "0.54898846", "0.5480379", "0.5480379", "0.5480135", "0.5475959", "0.5474894", "0.54686016", "0.54433274", "0.54174745", "0.54034066", "0.5384789", "0.5376668", "0.5371187", "0.53710437", "0.53699404", "0.5345476", "0.5330268", "0.53268725", "0.53267425", "0.53194886", "0.5318734", "0.5304446", "0.5301204", "0.5297063", "0.5285966", "0.5276656", "0.5276482", "0.52754766", "0.52690595", "0.523721", "0.52321494", "0.523021", "0.52269685", "0.5226308", "0.52253", "0.52200854", "0.52164507", "0.5215512", "0.521489", "0.5213029", "0.52016455", "0.5201497", "0.5190593", "0.5178264", "0.51765186", "0.51672435", "0.5166645", "0.5166645", "0.516488", "0.5162242", "0.5155057", "0.5154325", "0.5154325", "0.5147523", "0.51448774", "0.5139349", "0.51385266", "0.51351273", "0.5135097", "0.51325214", "0.5131714", "0.5131525", "0.5126504", "0.5121061", "0.51199746", "0.51160836", "0.51120865", "0.51107824", "0.51106715", "0.51074386", "0.5105336", "0.5094036", "0.50932014", "0.50869316", "0.50846976" ]
0.6567688
0
Returns only dogs that match the breed exactly
function filterByBreed(dogs, breed) { return dogs.filter(function(dog) { return dog.breed === breed; }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gooseFilter(birds){\n const geese = ['African', 'Roman Tufted', 'Toulouse', 'Pilgrim', 'Steinbacher'];\n return birds.filter(bird => !geese.includes(bird));\n}", "function fDogs(selected_species) {\n return selected_species.species == \"dog\"\n}", "function onlyDrama(movies){\n return movies.filter(function(movie){\n return movie.genre.includes(\"Drama\")===true;\n });\n}", "function findDog() {\n\tfor (i = 0; i < animals.length; i++){\n\t\tif (animals[i].species == \"cat\"){\n\t\t\tcats.push(animals[i])\n\t\t}\n\t}\n}", "function gooseFilter(birds) {\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"];\n var notgeese = birds.filter(function (bird) {\n return !geese.includes(bird);\n })\n\n\n return notgeese\n\n}", "function filter(dogs, inputs) {\n if (inputs.name) {\n dogs = filterByName(dogs, inputs.name);\n }\n if (inputs.breed) {\n dogs = filterByBreed(dogs, inputs.breed);\n }\n if (inputs.sizes && inputs.sizes.length > 0) {\n dogs = filterBySize(dogs, inputs.sizes);\n }\n return dogs;\n}", "static good() {\n return this.all().filter(doge => doge.isGoodDog)\n }", "function filterBySize(dogs, sizes) {\n return dogs.filter(function(dog) {\n return sizes.includes(dog.size);\n })\n}", "function filterBreeds(breeds){\n\n const dropDown = document.getElementById('breed-dropdown');\n dropDown.onchange = () => {\n let letter = dropDown.value;\n let filteredBreeds = breeds.filter(breed => breed[0] === letter);\n // console.log(filteredBreeds)\n const ul = document.getElementById(\"dog-breeds\");\n ul.innerHTML = '';\n addBreedToDom(filteredBreeds);\n \n };\n}", "function dramaOnly(movies) {\n var dramas = movies.filter(function(oneMovie) {\n return oneMovie.genre.includes(\"Drama\");\n });\n\n return dramas;\n}", "function gooseFilter(birds) {\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"]\n const newGeese = []\n for (let i = 0; i < birds.length; i++) {\n if (!geese.includes(birds[i])) {\n newGeese.push(birds[i])\n }\n }\n return newGeese\n}", "function gooseFilter (birds) {\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"];\n \n // return an array containing all of the strings in the input array except those that match strings in geese\n return birds.filter(function(element){\n return geese.indexOf(element) === -1 });\n}", "function filterBreeds(event) {\n //have access to event anyway, but if manipulating it should put as parameter\n const userSelection = event.target.value;\n // use filter to filter out breeds by letter\n // how to access breeds? get all elements on page that have breed\n // could add class name on creation to make easier, or use other selectors\n // if manipluating them elsewhere, would use class name to eliminate duplication\n // only works here because only lis\n const breedList = document.getElementsByTagName(\"li\");\n // debugger\n // to filter, could use filter, but the return value would be just list that match\n // would destroy all other ones and never be able to select other ones\n // instead loop through and hide ones that don't start with user selection so not removing!\n\n //forEach doesn't work, use for...of\n for (const breed of breedList) {\n //breed is html element, need to access innerText\n if (breed.innerText.startsWith(userSelection)) {\n // debugger\n breed.style.display = \"\";\n //shows any previosuly hidden breeds\n } else {\n breed.style.display = \"none\";\n }\n }\n}", "function gooseFilter (birds) {\r\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"];\r\n var jadinya=[]\r\n console.log(birds)\r\n for(i=0;i<birds.length;i++){\r\n if(!geese.includes(birds[i])){\r\n jadinya.push(birds[i])\r\n }\r\n }\r\n return jadinya\r\n }", "filteredBirds() {\n return this.birds.filter(\n (bird) => {\n let filterBirdResult = true\n if (this.filterName !== \"\") {\n filterBirdResult = bird.name.includes(this.filterName)\n\n }\n return filterBirdResult\n\n }\n )\n\n }", "function findWords(dogString,dogNames)\n{\n let dogName = dogString.split(\",\")[1].toLowerCase().split(\" \").splice(-1);\n for(let i=0; i <= dogNames.length; i++)\n {\n if(dogNames[i].toLowerCase() == dogName)\n {\n return \"Matched dog_name\";\n }\n continue;\n }\n return \"No matches\";\n}", "function verifyDog(dName)\n{\n if (dName == pPerro.name)\n {\n return pPerro;\n }\n else if (dName == sPerro.name)\n {\n return sPerro;\n }\n else if (dName == tPerro.name)\n {\n return tPerro;\n }\n else if (dName == cPerro.name)\n {\n return cPerro;\n } \n}", "function getDogs(filter){\n return fetch(breedUrl)\n .then(resp => resp.json())\n .then(json => {\n const breeds = Object.keys(json.message)\n listDogs(breeds, filter)\n })\n}", "function findMatches(wordToMatch, food) {\n return food.filter((place) => {\n const regex = new RegExp(wordToMatch, 'gi');\n return place.category.match(regex) || place.city.match(regex) || place.name.match(regex);\n });\n }", "function disableBreedInput() {\n const animalInput = this.value;\n if (animalInput != \"dog\") {\n $(\"#breed\").attr(\"disabled\", \"disabled\");\n } else if (animalInput == \"dog\") {\n $(\"#breed\").removeAttr(\"disabled\")\n }\n }", "isBreedSet () { return this.baseSet !== this }", "getWinningBreed(array) {\n return array.find(breed => {\n return breed.isWinner === true;\n });\n }", "function Dog(name, breed) {\n\t\tthis.name = name;\n\t\tthis.breed = breed;\n}", "filteredBirds() {\n return vm.birds.filter(\n (bird) => {\n let filterBirdResult = true\n if (this.filterName !== \"\") {\n filterBirdResult = bird.name.includes(vm.filterName)\n\n }\n return filterBirdResult\n\n }\n )\n\n }", "function displayDogBreeds(dogBreedData) {\n const breedData = dogBreedData.petfinder.breeds.breed\n let breedTypes = {};\n $.each(breedData, function (index, value) {\n breedTypes[breedData[index].$t] = null;\n });\n $('#breed').autocomplete({\n data: breedTypes,\n limit: 20,\n minLength: 1,\n });\n }", "function displayNoDogs() {\r\n if (\r\n searchValue.toLowerCase() === 'dog' ||\r\n searchValue.toLowerCase() === 'dogs'\r\n ) {\r\n alert('Dogs?! 🙀 Oh the betrayal... ');\r\n }\r\n}", "function showFilteredBreeds() {\n \"use strict\";\n // Get chosen hair type\n var hair_radio_buttons = document.querySelectorAll(\"input[name='hair_length']\");\n var selected_hair_type;\n var results_empty = true;\n\n for (var i = 0; i < hair_radio_buttons.length; i++) {\n if (hair_radio_buttons[i].checked) {\n selected_hair_type = hair_radio_buttons[i].value;\n }\n }\n // Save hair type to page storage\n sessionStorage.setItem(\"hair_type\", selected_hair_type);\n\n // Get list of selected traits\n var trait_checkboxes = document.querySelectorAll(\"input[name='traits']\");\n var selected_traits = [];\n var storageTraits = \"\";\n\n for (i = 0; i < trait_checkboxes.length; i++) {\n if (trait_checkboxes[i].checked) {\n selected_traits.push(trait_checkboxes[i].value);\n storageTraits += trait_checkboxes[i].value + \" \";\n }\n }\n // Remove trailing space\n storageTraits.trim();\n sessionStorage.setItem(\"traits\", storageTraits);\n\n // Unhide the breeds that match the hair type, and\n // have at least one of the desired traits\n var show_breed;\n for (i = 0; i < breeds.length; i++) {\n show_breed = false;\n // Check for hair type match\n if (breeds[i].getAttribute(\"hair\").indexOf(selected_hair_type) !== -1) {\n for (var j = 0; j < selected_traits.length; j++) {\n // Check for a matching trait\n if (breeds[i].getAttribute(\"traits\").indexOf(selected_traits[j]) !== -1) {\n show_breed = true;\n results_empty = false;\n break;\n }\n }\n }\n\n // Explicitly hide breeds that shouldn't be shown, so\n // subsequent searches don't accumulate incorrect results\n setBreedVisibility(breeds[i], show_breed);\n }\n\n // Ensure the breed list border is visible if a breed is shown\n var border_el = document.getElementById(\"breed_list\");\n if (results_empty === false) {\n border_el.style.display = \"inline-block\";\n } else {\n border_el.style.display = \"\";\n }\n}", "function filterMatchBreed(){\n const choices = document.getElementById(\"breed-dropdown\")\n choices.addEventListener(\"change\", function(e){\n \n let letterChosen = e.target.value;\n let chosenBreeds = breeds.filter(name => name[0]==letterChosen)\n breedUl.innerHTML =\"\"\n creatBreeds(chosenBreeds)\n \n })\n }", "function filterByName(dogs, name) {\n return dogs.filter(function(dog) {\n return dog.name.toLowerCase().startsWith(name.toLowerCase());\n })\n}", "function Dog (breed) {\n this.breed = breed;\n}", "function Dog (breed) {\n this.breed = breed;\n}", "function Dog (breed) {\n this.breed = breed;\n}", "function Dog (breed) {\n this.breed = breed;\n}", "function Dog (breed) {\n this.breed = breed;\n}", "function Dog(name, breed) {\n this.name = name;\n this.breed = breed;\n}", "function Dog(name, breed) {\n this.name = name;\n this.breed = breed;\n}", "function filtered(){\n const selectionField = document.getElementById('breed-dropdown')\n selectionField.addEventListener('change', function(event){\n const beginsWith = event.target.value\n const allBreedsListed = document.getElementById('dog-breeds')\n allBreedsListed.innerHTML = ''\n console.log(beginsWith)\n fetch(breedUrl)\n .then(resp => resp.json())\n .then(jsonData => {\n const breedObj = jsonData.message\n \n const filteredBreedObj = {}\n \n for (breed in breedObj ){\n if (breed[0] === beginsWith) {\n filteredBreedObj[breed] = breedObj[breed]\n }\n }\n \n addBreed(filteredBreedObj)\n \n })\n })\n}", "function dog(id, coat, nrg, eye, K_){\nthis.id = id;\nthis.color = coat;\nthis.nrg = nrg;\nthis.eyeColor = eye;\nthis.K = K_;\n}", "function showBreed(event){\n // Jquery\n $(document).ready(function(){\n // Hide breed list\n $(\".breedList\").hide();\n $(\"#pageInformation\").hide();\n\n // Loop Through dog breed and find a breed that matches the clicked breed\n for (i = 0; i < dogBreedArray.length; i++) {\n if (event.target.id == (dogBreedArray[i])){\n // Show single breed view\n document.querySelector(\"#singleBreedView\").removeAttribute(\"style\");\n\n // Create Image of the dog breed\n breedImage();\n // create back link\n goBack('breeds.html', \"Back to Breed List\");\n\n // Display dog name, description and characteristics\n breedName.textContent = (dogBreeds[dogBreedArray[i]].breed);\n breedDescription.textContent = (dogBreeds[dogBreedArray[i]].description);\n\n breedCharacteristics.textContent = (dogBreeds[dogBreedArray[i]].characteristics);\n breedType.textContent = (dogBreeds[dogBreedArray[i]].type);\n breedSize.textContent = (dogBreeds[dogBreedArray[i]].size);\n\n // Check if the dog breed is hypoallergenic or rare and display the results\n var rarity = dogBreeds[dogBreedArray[i]].rarity;\n rarityCheck('breedRarity', rarity);\n var hypoallergenic = dogBreeds[dogBreedArray[i]].hypoallergenic;\n hypoallergenicCheck('breedHypoallergenic', hypoallergenic);\n\n // Display information about the friendliness of the dog breed\n breedFriendliness.textContent = (dogBreeds[dogBreedArray[i]].friendliness);\n\n // Create Star ratings for breed friendliness\n var friendlinessWithFamily = dogBreeds[dogBreedArray[i]].friendliness_with_family;\n starBuilder('breedFamilyFriendliness', friendlinessWithFamily );\n var goodWithChildren = dogBreeds[dogBreedArray[i]].good_with_children;\n starBuilder('breedChildrenFriendliness', goodWithChildren);\n var friendlinessWithStrangers = dogBreeds[dogBreedArray[i]].friendliness_with_strangers;\n starBuilder('breedStrangerFriendliness', friendlinessWithStrangers);\n var friendlinessWithDogs = dogBreeds[dogBreedArray[i]].friendliness_with_dogs;\n starBuilder('breedDogFriendliness', friendlinessWithDogs);\n\n // Display information about the lifestyle of the dog breed\n breedLifestyle.textContent = (dogBreeds[dogBreedArray[i]].lifestyle);\n\n // Create Star ratings for breed lifestyle\n var energy = dogBreeds[dogBreedArray[i]].energy;\n starBuilder('breedEnergy', energy);\n var apartmentAdaptability = dogBreeds[dogBreedArray[i]].apartment_adaptability;\n starBuilder('breedAdaptability', apartmentAdaptability);\n var independence = dogBreeds[dogBreedArray[i]].independence;\n starBuilder('breedIndependence', independence);\n var grooming = dogBreeds[dogBreedArray[i]].grooming;\n starBuilder('breedGrooming', independence);\n\n // Display information about the trainability of the dog breed\n breedTrainability.textContent = (dogBreeds[dogBreedArray[i]].trainability);\n\n // Create Star ratings for breed intelligence\n var intelligence = dogBreeds[dogBreedArray[i]].intelligence;\n starBuilder('breedIntelligence', intelligence);\n var noisiness = dogBreeds[dogBreedArray[i]].noisiness;\n starBuilder('breedNoisiness', noisiness);\n var preyDrive = dogBreeds[dogBreedArray[i]].prey_drive;\n starBuilder('breedPreyDrive', preyDrive);\n var wanderlust = dogBreeds[dogBreedArray[i]].wanderlust;\n starBuilder('breedWanderlust', wanderlust);\n\n // Display information about the health of the dog breed\n breedHealth.textContent = (dogBreeds[dogBreedArray[i]].common_health_issues);\n breedWeight.textContent = (dogBreeds[dogBreedArray[i]].weight);\n breedHeight.textContent = (dogBreeds[dogBreedArray[i]].height);\n breedCoatLength.textContent = (dogBreeds[dogBreedArray[i]].coat_length);\n breedLifespan.textContent = (dogBreeds[dogBreedArray[i]].lifespan);\n }\n }\n // Scroll to the top of the page\n $('html,body').scrollTop(0);\n });\n}", "function dogLength6(dog){\n return dog.name.length <6 ;\n}", "function isDogtag(itemId) {\n return itemId === \"59f32bb586f774757e1e8442\" || itemId === \"59f32c3b86f77472a31742f0\" ? true : false;\n}", "function Dog(name, age, breed = 'Australian Shepard') {\n Mammal.call(this, name, age);\n this.breed = breed;\n}", "function Dog(name, breed, mood, hungry) {\n this.name = name;\n this.breed = breed;\n this.mood = mood;\n this.hungry = hungry;\n}", "function Dog(name, breed, mood, hungry) {\n this.name = name;\n this.breed = breed;\n this.mood = mood;\n this.hungry = hungry;\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 Dog(name, breed, mood, hungry){\n\tthis.name = name;\n\tthis.breed = breed;\n\tthis.mood = mood;\n\tthis.hungry = hungry;\n}", "function Dog(name, breed, mood, hungry){\n this.name = name;\n this.breed = breed;\n this.mood = mood;\n this.hungry = hungry;\n}", "function Dog (name, breed, mood, hungry) {\n this.name = name;\n this.breed = breed;\n this.mood = mood;\n this.hungry = hungry;\n}", "function onlyBabies(selected_age) {\n return selected_age.age < 3\n}", "function massHysteria(dogs, cats) {\n if (dogs.raining && cats.raining){\n console.log(\"DOGS AND CATS LIVING TOGETHER! MASS HYSTERIA!\")\n }\n}", "function Dog(name, breed, weight) {\n\tthis.name = name;\n\tthis.breed = breed;\n\tthis.weight = weight;\n}", "function Dog(name, breed, color) {\n this.name = name;\n this.breed = breed;\n this.color = color;\n}", "function findDog(name) {\n return dogs.find(dog => dog.name === name)\n}", "forEachBreed(f) {\n for(let breed in this.__data.breeds) {\n for(let subBreed in this.__data.breeds[breed]) {\n if(subBreed === 'main') {\n f(breed);\n } else {\n f(breed, subBreed);\n }\n }\n }\n }", "function userInputAnimalSearch(response) {\n\tvar dogImgID;\n\tvar dogImg;\n\tfor (var i = 0; i < response.data.length; i++) {\n\t\tdogImgID = response.data[i].relationships.pictures.data[0].id;\n\t\tfor (var j = 0; j < response.included.length; j++) {\n\t\t\tvar dogImgOptions = response.included[j].id;\n\t\t\tif (dogImgOptions === dogImgID) {\n\t\t\t\tdogImg = response.included[j].attributes.original.url;\n\t\t\t}\n\t\t}\n\t\tvar dogName = response.data[i].attributes.name;\n\t\tvar dogAgeGroup = response.data[i].attributes.ageGroup;\n\t\tvar dogGender = response.data[i].attributes.sex;\n\t\tvar dogPrimaryBreed = response.data[i].attributes.breedPrimary;\n\t\tvar dogSizeGroup = response.data[i].attributes.sizeGroup;\n\t\tvar dogDescription = response.data[i].attributes.descriptionText;\n\t\tvar cardContainer = $(\".dog-card-container\");\n\t\tvar profileCard = $(\"<div></div>\");\n\t\tvar highlightContainer = $(\"<div></div>\");\n\t\tvar descriptionContainer = $(\"<div></div>\");\n\t\tvar dogProfileImage = $(\"<div></div>\");\n\t\tvar dogProfileFacts = $(\"<div></div>\");\n\t\tvar dogImgEl = $(\"<img>\");\n\t\tvar dogNameEl = $(\"<h3></h3>\");\n\t\tvar dogAgeGroupEl = $(\"<h4></h4>\");\n\t\tvar dogGenderEl = $(\"<h4></h4>\");\n\t\tvar dogPrimaryBreedEl = $(\"<h4></h4>\");\n\t\tvar dogSizeGroupEl = $(\"<h4></h4>\");\n\t\tvar dogDescriptionEl = $(\"<p>\" + dogDescription + \"</p>\");\n\t\tprofileCard.addClass(\"dog-profile-card\");\n\t\thighlightContainer.addClass(\"highlight-container uk-card dark-background padding-20 uk-child-width-1-2 uk-grid uk-margin-remove\");\n\t\tdogProfileImage.addClass(\"dog-profile-image padding-0 uk-card-media-left uk-cover-container\");\n\t\tdogProfileFacts.addClass(\"dog-profile-facts padding-0 uk-card-body\");\n\t\tdescriptionContainer.addClass(\"description-container uk-card dark-background padding-20 uk-card-body\");\n\t\tdogImgEl.addClass(\"search-images uk-cover\");\n\t\tdogImgEl.attr(\"src\", dogImg);\n\t\tdogNameEl.text(\"Name: \" + dogName);\n\t\tdogAgeGroupEl.text(\"Age Group: \" + dogAgeGroup);\n\t\tdogGenderEl.text(\"Gender: \" + dogGender);\n\t\tdogPrimaryBreedEl.text(\"Primary Breed: \" + dogPrimaryBreed);\n\t\tdogSizeGroupEl.text(\"Size Group: \" + dogSizeGroup);\n\t\tcardContainer.append(profileCard);\n\t\tprofileCard.append(highlightContainer, descriptionContainer);\n\t\thighlightContainer.append(dogProfileImage, dogProfileFacts);\n\t\tdogProfileImage.append(dogImgEl);\n\t\tdogProfileFacts.append(dogNameEl, dogAgeGroupEl, dogGenderEl, dogPrimaryBreedEl, dogSizeGroupEl);\n\t\tdescriptionContainer.append(dogDescriptionEl);\n\t}\n\tclearLocalStorage();\n\tbreedAPICall();\n}", "function onlySpielbergMovies(movies){\n return movies.filter(function(movie){\n return movie.director===\"Steven Spielberg\";\n });\n}", "function checkIngredients(items){\n var veganMatches = [];\n var nonVeganMatches = [];\n var nonMatches = [];\n\n // using the /g flag means you keep track of something you've already matched and may not match the same item all the time\n // var regexVeganMilks = /\\s*(coconut|soy|soya)\\s*milk\\s*/g;\n var regexVeganMilks = /\\s*(coconut|soy|soya)\\s*milk\\s*/;\n var regexMilks = /\\s*(whole|semi-skimmed|semi-skim|skimmed|skim)\\s*milk/;\n var regexMilk = /^\\s*milk\\s*$/;\n\n $.each(items, function(index, item){\n\n\n // these must be inside the .each because .test behaves unusually otherwise!\n var matchVeganMilks = regexVeganMilks.test(item);\n var matchMilks = regexMilks.test(item);\n var matchMilk = regexMilk.test(item);\n\n switch (true){\n case matchVeganMilks:\n veganMatches.push(item);\n break;\n case matchMilks:\n nonVeganMatches.push(item);\n break;\n case matchMilk:\n nonVeganMatches.push(item);\n break;\n default:\n nonMatches.push(item);\n }\n\n });\n showItems(veganMatches, $(\".results ol\"));\n showItems(nonVeganMatches, $(\".non-vegan-results ol\"));\n showItems(nonMatches, $(\".non-match-results ol\"));\n}", "function getBreed(breed_id) {\n ajax_get('https://api.thedogapi.com/v1/images/search?include_breed=1&breed_id=' + breed_id, function(data) {\n displayData(data[0])\n });\n}", "showDogsBreed(){\r\n const elem = document.querySelector(\".dogsBreed\");\r\n elem.innerHTML = '';\r\n for (let i = 0; i<this.dogsBreed.length; i++){\r\n let li = document.createElement('li');\r\n li.innerHTML = this.dogsBreed[i];\r\n elem.appendChild(li);\r\n }\r\n }", "function findShaggysPet(pet) {\n return pet.ownerName == \"Shaggy\";\n}", "function Dog(name,breed,mood,hungry){\n this.name = name\n this.breed = breed\n this.mood = mood\n this.hungry = hungry\n}", "function shark_filter(shark) {\n return shark.species == \"white shark\";\n }", "function ingredientsCompare(ingredients, dietRestrictions) {\n for (var i = 0; i < ingredients.length(); i++) {\n for (var j = 0; j < ingredients.length(); j++) {\n if (ingredients[i] == dietRestrictions[j]) {\n return false;\n }\n }\n }\n return true;\n}", "function dramaMoviesCall(someArray) {\n return someArray.filter((movie) => movie.genre.indexOf('Drama') !== -1);\n}", "function joinDogFraternity(candidate) {\n return candidate.constructor === Dog ? true : false;\n}", "function Dog(age, name, breed){\n this.age = age;\n this.name = name;\n this.breed = breed;\n}", "function filterByQuery(query) {\n\tlet matchedBets = [];\n \tconsole.log(query);\n\t//loop through the bet\n\tfor (let bet in bets) {\n\t\tlet obj = bets[bet];\n\t\tlet lowerCaseQuery = query.toLowerCase();\n\t\t//if title, question, id or creators name includes query, or if id or uid is equal to query, push bet to mathchedBets\n\t\tif (obj.title.toLowerCase().includes(lowerCaseQuery) || obj.question.toLowerCase().includes(lowerCaseQuery) || obj.creator.name.toLowerCase().includes(lowerCaseQuery) || obj.id == query || obj.creator.uid == query) {\n\t\t\tmatchedBets.push(obj);\n\t\t};\n\t};\n \tshowBets(matchedBets);\n\tremoveActiveClassFromBtns();\n}", "function filterKnowledge(d) {\n return (d.name.indexOf(\"abstr_\") === -1) && ((d.type === \"sub-knowledge graph\") || (d.type === \"node\") || (d.type === \"root\"));\n}", "function Dog(age, breed, color) {\n this.age = age;\n this.breed = breed;\n this.color = color;\n}", "function Dog(name, color) {//To more easily create different Bird objects, you can design your Bird constructor to accept parameters:\n this.name = name;\n this.color = color;\n this.numLegs = 4;\n }", "function where_is_doge(){\n var doge_locs = []\n for(var i = 0; i < room_list.length; i++){\n for(var j= 0; j < room_list[0].length; j++){\n for(var r = 0; r < room_list[i][j].room_map.length; r++){\n for(var c = 0; c < room_list[i][j].room_map[0].length; c++){\n if(room_list[i][j].room_map[r][c].dog_present){\n doge_locs.push([i, j, room_list[i][j].room_map[r][c]])\n }\n }\n }\n }\n }\n return doge_locs;\n}", "function getDogImage(breed) {\n fetch(`https://dog.ceo/api/breed/${breed}/images/random`)\n .then(response => response.json())\n .then(responseJson => \n displayResults(responseJson))\n .catch(error => alert('Sorry, no luck! Try a different breed!'));\n}", "function fetchBreeds(selectedBreed = 'all') {\n const breedUrl = 'https://dog.ceo/api/breeds/list/all';\n fetch(breedUrl)\n .then(resp => resp.json())\n .then(results => insertBreeds(results))\n}", "function findTheCheese (foods) {\n\nlet cheese = [\"cheddar\", \"gouda\", \"camembert\"]\n\nfor (let i = 0; i < foods.length; i++)\n{\n for (let b = 0; b < cheese.length; b++) {\n if (foods[i] === cheese[b]){\n return(foods[i]);\n }\n }\n}\nreturn (\"no cheese!\");\n}", "constructor(name, breed) {\n this.name = name;\n this.breed = breed;\n this.cranky = false;\n this.crankyCount = 5;\n this.standing = true;\n this.layingDown = false;\n }", "function feast ( beast, dish) {\n const b1 = beast[0];\n const b2 = beast[beast. length - 1];\n const d1 = dish[0];\n const d2 = dish[dish.length - 1];\nreturn b1 === d1 && b2 === d2;\n}", "function find2G(fruit) {\n return fruit.G2_3G_4G === '2G' && fruit.Site_ID !== null && fruit.Site_ID !== \"\";\n }", "function BreedsDropDown() {\n /* The followin are hooks which start being an array or string getting the data to\n our API, this will allow us to update those hooks in accordance with the filter */\n const [loading, setLoading] = useState(true);\n const [items, setItems] = useState([\n { label: \"Loading ...\", value: \"\", type: \"\" },\n ]);\n const [breed, setBreed] = useState(\"\");\n const [data, setData] = useState([]);\n const [search, setSearch] = useState([]);\n // useEffect hook which allow us to wait for a response fetching our API\n useEffect(() => {\n let unmounted = false;\n async function getCharacters() {\n const response = await fetch(\"http://localhost:1235/pets/\");\n const body = await response.json();\n if (!unmounted) {\n setSearch(body);\n setData(body);\n setItems(\n body.map((pets) => ({\n label: pets.breed_name,\n value: pets.breed_name,\n type: pets.animal_type,\n }))\n );\n setLoading(false);\n }\n }\n getCharacters();\n return () => {\n unmounted = true;\n };\n }, []);\n /* useEffect hook which will allow us to render the data in order to obtain\n the value of the breed we want */\n useEffect(() => {\n const breedsRes = data.filter((pets) => pets.breed_name.includes(breed));\n setSearch(breedsRes);\n }, [data, breed]);\n\n let uniq = getUnique(items, \"value\");\n\n // After getting the unique values we decided here to sort them in Alphabetical order\n uniq = uniq.sort(function (a, b) {\n if (a.type > b.type) return -1;\n if (a.type < b.type) return 1;\n return 0;\n });\n // This will return us the view of pets section in accordance with the selection in the Form\n return (\n <div>\n <Form className=\"pad_bot\">\n <Form.Group controlId=\"exampleForm.SelectCustom\">\n <Form.Label column=\"lg\" className=\"filter_text\">\n Select a breed\n </Form.Label>\n <Form.Control\n as=\"select\"\n custom=\"true\"\n disabled={loading}\n value={breed}\n onChange={(e) => setBreed(e.currentTarget.value)}\n onBlur={(e) => setBreed(e.currentTarget.value)}\n >\n <option>All</option>\n {uniq.map(({ label, value, type }) => (\n <option key={label} value={value}>\n {type} - {value}\n </option>\n ))}\n </Form.Control>\n </Form.Group>\n </Form>\n {breed === \"All\" ? (\n <CardDeck>\n {data.map((pets) => (\n <Pets\n key={pets.id}\n id={pets.id}\n name={pets.name}\n picture={pets.picture}\n sex={pets.sex}\n breed={pets.breed_name}\n />\n ))}\n </CardDeck>\n ) : (\n <CardDeck>\n {search.map((pets) => (\n <Pets\n key={pets.id}\n id={pets.id}\n name={pets.name}\n picture={pets.picture}\n sex={pets.sex}\n breed={pets.breed_name}\n />\n ))}\n </CardDeck>\n )}\n </div>\n );\n}", "function countSpielbergDramaMovies (arraySpilb){\n const stevenArray = arraySpilb.filter((value) => {\n if(value.director === 'Steven Spielberg' && value.genre.includes(\"Drama\")) {\n return true;\n } else {\n return false;\n}\n });\n return stevenArray.length;\n}", "function containsWood(item){\n // 1. Seach the materials of the item\n // 2. If materials contains \"wood\" \n if(item.materials.indexOf('wood') !== -1){\n return true;\n } else {\n return false;\n }\n \n // 2a. return true\n \n\n // 2b. if the materials doesn't contain wood\n \n}", "getRandomDogImageByBreed(breedName) {\n return this.$resource('https://dog.ceo/api/breed/' + breedName + '/images/random').get().$promise;\n }", "function OneBirdAlive(birds) {\n for (var bird of birds) {\n if (bird.alive) return true;\n }\n return false;\n}", "function Dog(petName, petType, canBark){\n //Inherit instance properties\n Pets.call(this, petName, petType);\n this.canBark = canBark;\n this.petImage=\"dog.jpg\";\n}", "function findMatches(wordToMatch, names){\n\t\treturn names.filter(restaurants => {\n\t\t\tconst regex = new RegExp (wordToMatch, 'gi');\n\t\t\treturn restaurants.name.match(regex)\n\t\t});\n\t}", "function Dog(name, starSign, breed, loc, picture, quizResults, bio) {\n this.name = name;\n this.starSign = starSign;\n this.breed = breed;\n this.loc = loc;\n this.picture = picture;\n this.quizResults = quizResults;\n this.bio = bio;\n this.dogScore = 0;\n if (this.name != localStorage.dogName) {\n builtInDogs.push(this);\n }\n}", "function isDog(someObj) {\n return someObj.bark !== undefined;\n}", "getValidDeals(node) {\n const term = this.props.searchTerm\n const deals = node.deals\n\n if (!deals) {\n return 0;\n }\n\n const matches = deals.filter(deal => {\n const notFiltered = this.isNotFiltered(deal)\n return deal.description.toLowerCase().indexOf(term) !== -1 && notFiltered\n })\n return matches\n }", "function howManyMovies(myArry) {\n return myArry.filter(dramaMovies => {\n if (dramaMovies.director === \"Steven Spielberg\" && dramaMovies.genre.includes(\"Drama\")) {\n return true\n }\n }).length\n\n}", "function fetchBreed(){\n fetch(breedUrl)\n .then(resp => resp.json())\n .then(json => {\n breeds = Object.keys(json.message);\n // breeds.forEach(breed => {\n // addBreedToDom(breed);\n // })\n addBreedToDom(breeds);\n filterBreeds(breeds);\n })\n}", "function getAllBreedType() {\r\n return get('/breedtype/getall').then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "function showDog(name, breed, weight, handler) {\n // this.name = name;\n // this.breed = breed;\n // this.weight = weight;\n Dog.call(this, name, breed, weight);\n this.handler = handler;\n}", "function allFilters(dogs, ...checks) {\n return dogs\n .filter(dog => checks.every(check => check(dog)))\n .map(dog => dog.name);\n}", "function joinDogFraternity(candidate) {\n if(candidate.constructor === Dog) {\n return true;\n }\n else {\n return false;\n }\n}", "function countSpielbergDramaMovies(steve) {\n let moviesBySteven = steve.filter((movie) => {\n for (let i = 0; i < movie.genre.length; i++)\n if (movie.genre[i].toLowerCase() === 'drama'){\n return true\n }});\n\n const steveActual = moviesBySteven.filter((movie => movie.director === 'Steven Spielberg'));\n\n return steveActual.length;\n }", "function Dog(isGoodBoy, name) {\n this.isGoodBoy = isGoodBoy;\n this.name = name;\n }", "function grabDoll(dolls){\n var bag=[];\n \n for(var i = 0; i < dolls.length; i++) {\n \n if(dolls[i] === \"Hello Kitty\" || dolls[i] === \"Barbie doll\")\n bag.push(dolls[i]);\n else\n continue;\n \n if(bag.length === 3) break;\n }\n \n return bag;\n}", "function Dog(Breed, Age, Colour) {\r\n this.Dog_Breed = Breed;\r\n this.Dog_Age = Age;\r\n this.Dog_Colour = Colour;\r\n}", "function joinDogFraternity(candidate) {\n if (candidate.constructor === Dog) {\n return true;\n } else {\n return false;\n }\n}", "function getTwoDogs(minimum_count_diff, maximum_count_diff) {\n var dog1 = dogs[Math.floor(Math.random() * dogs.length)]\n\n var other_dogs = dogs.filter(function(dog) {\n // check for minimum difference\n if (!isNaN(parseInt(minimum_count_diff))) {\n if (Math.abs(dog.count - dog1.count) < parseInt(minimum_count_diff)) {\n return false\n }\n }\n\n // check for maximum difference\n if (!isNaN(parseInt(maximum_count_diff))) {\n if (Math.abs(dog.count - dog1.count) > parseInt(maximum_count_diff)) {\n return false\n }\n }\n\n // make sure they don't have the same count\n if (dog.count === dog1.count) return false\n\n return true\n })\n var dog2 = other_dogs[Math.floor(Math.random() * other_dogs.length)]\n\n /* Dog1 is almost guarateened to be the lowest score because\n the distribution strongly favors picking a very low-numbered name\n so let's randomize the order a bit\n */\n return Math.random() < 0.5 ? [ dog1, dog2 ] : [ dog2, dog1 ]\n}", "function findFlavor(myArray, flavor) {\n let i = 0\n let found = false\n while(i < myArray.length){\n if(myArray[i]==flavor){\n found = myArray[i]\n break\n }\n i++\n }\n return found\n}" ]
[ "0.6019023", "0.5976843", "0.59504163", "0.5857991", "0.5854265", "0.5829342", "0.58144844", "0.5748318", "0.56847286", "0.5640317", "0.5613768", "0.5601369", "0.5573348", "0.5565394", "0.5549305", "0.5539864", "0.5471456", "0.54704934", "0.54672444", "0.54671884", "0.54643947", "0.54640096", "0.5454415", "0.5451104", "0.54265714", "0.53872144", "0.53786016", "0.5368791", "0.532947", "0.53166527", "0.53166527", "0.53166527", "0.53166527", "0.5282293", "0.5271547", "0.5259932", "0.5240642", "0.51869607", "0.5171063", "0.51548004", "0.5153895", "0.5143407", "0.51331776", "0.51331776", "0.51296115", "0.51238936", "0.5120273", "0.5110897", "0.5105696", "0.510269", "0.5049781", "0.50411886", "0.5030747", "0.5016062", "0.5007577", "0.5004498", "0.497258", "0.49427336", "0.4939275", "0.4936909", "0.49342805", "0.4930106", "0.4929761", "0.49115446", "0.4908844", "0.49027723", "0.4881943", "0.487776", "0.4849949", "0.48470873", "0.48450342", "0.483929", "0.4834672", "0.4832", "0.48256", "0.48247468", "0.48029712", "0.47973865", "0.4794983", "0.47947207", "0.4793965", "0.47864512", "0.47815958", "0.47762132", "0.47760603", "0.47610784", "0.47606805", "0.47590417", "0.47533634", "0.47504634", "0.47358936", "0.47354814", "0.4731375", "0.4731116", "0.4727449", "0.47242296", "0.47181407", "0.47132206", "0.47130996", "0.47096804" ]
0.74894947
0
Returns only dogs that are included in the selected dog sizes
function filterBySize(dogs, sizes) { return dogs.filter(function(dog) { return sizes.includes(dog.size); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter(dogs, inputs) {\n if (inputs.name) {\n dogs = filterByName(dogs, inputs.name);\n }\n if (inputs.breed) {\n dogs = filterByBreed(dogs, inputs.breed);\n }\n if (inputs.sizes && inputs.sizes.length > 0) {\n dogs = filterBySize(dogs, inputs.sizes);\n }\n return dogs;\n}", "function fDogs(selected_species) {\n return selected_species.species == \"dog\"\n}", "function animalSize(size){\n if ( size < 1) { return \"Tiny\" }\n else if (num < 2) {return \"Small\"}\n else if (num < 5) {return \"Medium\"}\n else if (num <= 10) {return \"Large\"}\n else if (num >= 40) {return \"Huge\"}\n }", "function filterByBreed(dogs, breed) {\n return dogs.filter(function(dog) {\n return dog.breed === breed;\n })\n}", "function findCombosWithLeastTypesOfVialsUsed(vialCombos) {\n let leastUsedCombo = vialCombos[0];\n let leastUsedAmount;\n\n if (leastUsedCombo['sizes']) {\n leastUsedAmount = leastUsedCombo['sizes'].length;\n } else {\n leastUsedAmount = 1;\n }\n\n for (let i = 1; i < vialCombos.length; i++) {\n let currUsedAmount;\n if (vialCombos[i]['sizes']) { // if multiple sizes\n currUsedAmount = vialCombos[i]['sizes'].length; // set to number of sizes\n } else {\n currUsedAmount = 1; // else oly one size was used\n }\n\n if (currUsedAmount < leastUsedAmount) {\n leastUsedAmount = currUsedAmount;\n } // compare\n }\n return vialCombos.filter((vial) =>{\n if (vial['sizes']) {\n return vial['sizes'].length === leastUsedAmount;\n } else {\n return 1 === leastUsedAmount;\n }\n });\n}", "function filterSize(min, max){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n listings[i].visible = l.size >= min && l.size <= max && listings[i].visible;\r\n }\r\n}", "function findDog() {\n\tfor (i = 0; i < animals.length; i++){\n\t\tif (animals[i].species == \"cat\"){\n\t\t\tcats.push(animals[i])\n\t\t}\n\t}\n}", "function userInputAnimalSearch(response) {\n\tvar dogImgID;\n\tvar dogImg;\n\tfor (var i = 0; i < response.data.length; i++) {\n\t\tdogImgID = response.data[i].relationships.pictures.data[0].id;\n\t\tfor (var j = 0; j < response.included.length; j++) {\n\t\t\tvar dogImgOptions = response.included[j].id;\n\t\t\tif (dogImgOptions === dogImgID) {\n\t\t\t\tdogImg = response.included[j].attributes.original.url;\n\t\t\t}\n\t\t}\n\t\tvar dogName = response.data[i].attributes.name;\n\t\tvar dogAgeGroup = response.data[i].attributes.ageGroup;\n\t\tvar dogGender = response.data[i].attributes.sex;\n\t\tvar dogPrimaryBreed = response.data[i].attributes.breedPrimary;\n\t\tvar dogSizeGroup = response.data[i].attributes.sizeGroup;\n\t\tvar dogDescription = response.data[i].attributes.descriptionText;\n\t\tvar cardContainer = $(\".dog-card-container\");\n\t\tvar profileCard = $(\"<div></div>\");\n\t\tvar highlightContainer = $(\"<div></div>\");\n\t\tvar descriptionContainer = $(\"<div></div>\");\n\t\tvar dogProfileImage = $(\"<div></div>\");\n\t\tvar dogProfileFacts = $(\"<div></div>\");\n\t\tvar dogImgEl = $(\"<img>\");\n\t\tvar dogNameEl = $(\"<h3></h3>\");\n\t\tvar dogAgeGroupEl = $(\"<h4></h4>\");\n\t\tvar dogGenderEl = $(\"<h4></h4>\");\n\t\tvar dogPrimaryBreedEl = $(\"<h4></h4>\");\n\t\tvar dogSizeGroupEl = $(\"<h4></h4>\");\n\t\tvar dogDescriptionEl = $(\"<p>\" + dogDescription + \"</p>\");\n\t\tprofileCard.addClass(\"dog-profile-card\");\n\t\thighlightContainer.addClass(\"highlight-container uk-card dark-background padding-20 uk-child-width-1-2 uk-grid uk-margin-remove\");\n\t\tdogProfileImage.addClass(\"dog-profile-image padding-0 uk-card-media-left uk-cover-container\");\n\t\tdogProfileFacts.addClass(\"dog-profile-facts padding-0 uk-card-body\");\n\t\tdescriptionContainer.addClass(\"description-container uk-card dark-background padding-20 uk-card-body\");\n\t\tdogImgEl.addClass(\"search-images uk-cover\");\n\t\tdogImgEl.attr(\"src\", dogImg);\n\t\tdogNameEl.text(\"Name: \" + dogName);\n\t\tdogAgeGroupEl.text(\"Age Group: \" + dogAgeGroup);\n\t\tdogGenderEl.text(\"Gender: \" + dogGender);\n\t\tdogPrimaryBreedEl.text(\"Primary Breed: \" + dogPrimaryBreed);\n\t\tdogSizeGroupEl.text(\"Size Group: \" + dogSizeGroup);\n\t\tcardContainer.append(profileCard);\n\t\tprofileCard.append(highlightContainer, descriptionContainer);\n\t\thighlightContainer.append(dogProfileImage, dogProfileFacts);\n\t\tdogProfileImage.append(dogImgEl);\n\t\tdogProfileFacts.append(dogNameEl, dogAgeGroupEl, dogGenderEl, dogPrimaryBreedEl, dogSizeGroupEl);\n\t\tdescriptionContainer.append(dogDescriptionEl);\n\t}\n\tclearLocalStorage();\n\tbreedAPICall();\n}", "static findSize(olStyle, sizes, dflt) {\n const scale = olStyle.getScale();\n return sizes.find(size => scale === size.scale) || dflt || sizes[2];\n }", "function filterByDimensions(deviation, pixelCount, options) {\n if (typeof options === 'undefined') options = {\n minWidth: 0,\n minHeight: 0,\n remove: false,\n fadeOpacity: 0.25,\n };\n else {\n if (typeof options.minWidth === 'undefined')\n options.minWidth = 0;\n if (typeof options.minHeight === 'undefined')\n options.minHeight = 0;\n if (typeof options.remove === 'undefined')\n options.remove = false;\n if (typeof options.fadeOpacity === 'undefined')\n options.fadeOpacity = false;\n }\n //Codeh\n var image = getImageDimensions(deviation);\n if (image) {\n if (typeof pixelCount === 'string' && pixelCount.toLowerCase().indexOf(\"mpx\")) pixelCount = parseFloat(pixelCount) * 1e+6;\n if (pixelCount < 20) pixelCount *= 1e+6;\n if (image.total < pixelCount || image.width < options.minWidth || image.height < options.minHeight) {\n if (options.remove) {\n $(deviation).hide();\n }\n else {\n //TODO: Messages for min x/y dimensions\n var str = \"\";\n if (pixelCount > 1e+6)\n str += (pixelCount/1e+6).toLocaleString(\"en-US\", { maximumFractionDigits: 2 }) + \"&nbsp;MPx\";\n else\n str += (pixelCount/1e+6).toLocaleString(\"en-US\") + \" MPx\";\n overlayMessage(deviation, \"Below size threshold (\" + str + \")\", options.fadeOpacity);\n }\n }\n }\n}", "function compareWaste(vialSizes, targetDose) {\n let combos = generateCombinations(vialSizes, targetDose);\n let comboObjs = combos.map((combo) => {\n return createVialCombinationObject(vialSizes, combo, targetDose);\n });\n comboObjs = comboObjs.concat(vialSizes);\n\n let bestVials = findVialsWithMinWasteCost(comboObjs);\n bestVials = findVialsWithMinWaste(bestVials);\n bestVials = findCombosWithLeastVialsUsed(bestVials);\n bestVials = findCombosWithLeastTypesOfVialsUsed(bestVials);\n\n return [bestVials[0]]; // if there is still one left after this, then just return the 1st one\n}", "function dogLength6(dog){\n return dog.name.length <6 ;\n}", "allSizes() {\n return _.chain(this.poms).pluck('sizes').first().value();\n }", "function showFilteredBreeds() {\n \"use strict\";\n // Get chosen hair type\n var hair_radio_buttons = document.querySelectorAll(\"input[name='hair_length']\");\n var selected_hair_type;\n var results_empty = true;\n\n for (var i = 0; i < hair_radio_buttons.length; i++) {\n if (hair_radio_buttons[i].checked) {\n selected_hair_type = hair_radio_buttons[i].value;\n }\n }\n // Save hair type to page storage\n sessionStorage.setItem(\"hair_type\", selected_hair_type);\n\n // Get list of selected traits\n var trait_checkboxes = document.querySelectorAll(\"input[name='traits']\");\n var selected_traits = [];\n var storageTraits = \"\";\n\n for (i = 0; i < trait_checkboxes.length; i++) {\n if (trait_checkboxes[i].checked) {\n selected_traits.push(trait_checkboxes[i].value);\n storageTraits += trait_checkboxes[i].value + \" \";\n }\n }\n // Remove trailing space\n storageTraits.trim();\n sessionStorage.setItem(\"traits\", storageTraits);\n\n // Unhide the breeds that match the hair type, and\n // have at least one of the desired traits\n var show_breed;\n for (i = 0; i < breeds.length; i++) {\n show_breed = false;\n // Check for hair type match\n if (breeds[i].getAttribute(\"hair\").indexOf(selected_hair_type) !== -1) {\n for (var j = 0; j < selected_traits.length; j++) {\n // Check for a matching trait\n if (breeds[i].getAttribute(\"traits\").indexOf(selected_traits[j]) !== -1) {\n show_breed = true;\n results_empty = false;\n break;\n }\n }\n }\n\n // Explicitly hide breeds that shouldn't be shown, so\n // subsequent searches don't accumulate incorrect results\n setBreedVisibility(breeds[i], show_breed);\n }\n\n // Ensure the breed list border is visible if a breed is shown\n var border_el = document.getElementById(\"breed_list\");\n if (results_empty === false) {\n border_el.style.display = \"inline-block\";\n } else {\n border_el.style.display = \"\";\n }\n}", "function search(size){\n var q = _.map(size, function(d){ return Math.ceil(d / 10) * 10;});\n var result = _(grid).filter({'w':q[0], 'h':q[1]}).value();\n\n if(result.length){\n appendResult(result[0]);\n searchTry=0;\n }else if (searchTry < 100){\n // try a new search\n searchTry++;\n var newSize = [ Math.abs(size[0]) - 10, Math.abs(size[1] + 10)];\n search(newSize);\n }else{\n appendResult(_(grid).shuffle().first()); // get random part\n }\n }", "static good() {\n return this.all().filter(doge => doge.isGoodDog)\n }", "async getSizeOptions(root, args, { Size }) {\n return await Size.findAll({}).catch(errHandler);\n }", "function getSetLimits(size) {\n setLimits = []\n let boxSize = parseInt(Math.sqrt(size))\n let arr = []\n for (let i = 0; i < size; i++) {\n arr.push(i)\n if ((i + 1) % boxSize == 0 && i != 0) {\n setLimits.push(arr);\n arr = []\n }\n }\n return setLimits;\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 drawSetsBySize(){\n var subsetRows = usedSets.sort(function(a,b){\n return b.setSize - a.setSize;\n });\n\n var counts = getCountsForProgressbar(subsetRows);\n\n controlPanel.find(\"#ps-control-panel-sets\").remove();\n var setsPanel = controlPanel.append(\"<div id='ps-control-panel-sets'></div>\").find(\"#ps-control-panel-sets\");\n setsPanel.append(\"<h3>Sets by size\");\n\n setsPanel.append(\"<div class='elm-by-sets-scale control-panel-header'><span>0</span><span>\" + counts.overallSize + \"</span></div>\");\n setsPanel.append(\"<div id='elm-by-sets-rows' class='control-panel-rows'></div>\");\n var rows = d3.select(\"#elm-by-sets-rows\").selectAll(\"div.row\").data(subsetRows);\n\n rows.enter()\n .append(\"div\")\n .classed({\n \"row\": true\n })\n .html(function(d, idx) {\n //init selectedSets\n if(typeof(selectedSets[idx]) == \"undefined\"){\n selectedSets[idx] = {active:false, baseSet: d};\n }\n\n var checked = selectedSets[idx].active ? \"checked='checked'\" : \"\";\n\n var str = \"<input type='checkbox' \" + checked + \" value='\" + idx + \"' class='chk-set-size' id='chk-set-size-\" + idx + \"' data-basesetid='\" + d.id + \"'>\";\n str += \"<span>\" + d.elementName + \"</span>\";\n var titleText = d.elementName + \" - \" + d.setSize + \" (\" + (d.setSize / counts.totalSize * 100).toFixed(1) + \" %)\";\n str += \"<progress title='\" + titleText + \"' value='\" + (d.setSize / counts.overallSize * 100) + \"' max='100'></progress>\";\n return str;\n });\n rows.exit().remove();\n\n $(\"input.chk-set-size\").on(\"change\",function(){\n selectedItems = [];\n\n var idx = $(this).val();\n var baseSetId = $(this).data(\"basesetid\");\n var baseSet = setIdToSet[baseSetId];\n console.log(\"change: \",selectedSets[idx].active,\" => \", !selectedSets[idx].active);\n selectedSets[idx].active = !selectedSets[idx].active;\n selectedSets[idx].baseSet = baseSet;\n that.draw();\n\n\n createSelection(getSelectedItems());\n });\n\n }", "function PartySize() {\r\n var checkBox = document.getElementById(\"sizeCheck\");\r\n var smalls = document.getElementsByClassName(\"small\");\r\n if (checkBox.checked == true) {\r\n console.log(\"smalls\");\r\n console.log(smalls);\r\n for (let sizing = 0; sizing < smalls.length; sizing++) {\r\n console.log(smalls[sizing]);\r\n smalls[sizing].classList.add(\"hidden\");\r\n }\r\n }\r\n if (checkBox.checked == false) {\r\n console.log(smalls);\r\n for (let sizing = 0; sizing < smalls.length; sizing++) {\r\n smalls[sizing].classList.remove(\"hidden\");\r\n }\r\n }\r\n}", "function show_trees(media_size) {\n\t\tif (media_size.matches) {\n\t\t$(\"#trees\").css(\"visibility\", \"visible\");\n\t}\n\t}", "function filtered(){\n const selectionField = document.getElementById('breed-dropdown')\n selectionField.addEventListener('change', function(event){\n const beginsWith = event.target.value\n const allBreedsListed = document.getElementById('dog-breeds')\n allBreedsListed.innerHTML = ''\n console.log(beginsWith)\n fetch(breedUrl)\n .then(resp => resp.json())\n .then(jsonData => {\n const breedObj = jsonData.message\n \n const filteredBreedObj = {}\n \n for (breed in breedObj ){\n if (breed[0] === beginsWith) {\n filteredBreedObj[breed] = breedObj[breed]\n }\n }\n \n addBreed(filteredBreedObj)\n \n })\n })\n}", "function checkSize(product, size) {\n return (product.availableSizes.includes(size) ? \"We have that size.\" : \"We do not have that size.\");\n}", "function getDogs(filter){\n return fetch(breedUrl)\n .then(resp => resp.json())\n .then(json => {\n const breeds = Object.keys(json.message)\n listDogs(breeds, filter)\n })\n}", "function mouthSize(animal) {\n return animal.toLowerCase() === \"alligator\" ? \"small\" : \"wide\";\n\n}", "function findCheapFlavors(flavors, threshold) {\n var cheapFlavs = [];\n flavors.forEach(function(flavor) {\n \tvar price = parseFloat(flavor.price.replace('$', ''));\n\tif( price < threshold )\n \t{\n \t var toAdd = flavor.name + \" costs \" + flavor.price;\n\t cheapFlavs[cheapFlavs.length] = toAdd;\n\t} \n });\n return cheapFlavs;\n }", "function pullSearchDogImages(dogSearch) {\n\t\tfetch(`https://dog.ceo/api/breed/${dogSearch}/images/random`)\n .then(response => {\n\t\t\tif (response.ok) {\n\t\t\t\treturn response.json();\n\t\t\t} else {\n\t\t\t\tthrow console.log(response.text());\n\t\t\t}\n\t\t}).then(responseJson => displaySearchResults(responseJson))\n .catch(error => displaySearchError(error));\n\t} //function__search", "function filterBreeds(breeds){\n\n const dropDown = document.getElementById('breed-dropdown');\n dropDown.onchange = () => {\n let letter = dropDown.value;\n let filteredBreeds = breeds.filter(breed => breed[0] === letter);\n // console.log(filteredBreeds)\n const ul = document.getElementById(\"dog-breeds\");\n ul.innerHTML = '';\n addBreedToDom(filteredBreeds);\n \n };\n}", "function getBigParties(){\n btnFeedback('big')\n resultParties = [];\n resultParties = parties.filter(party => {\n return party.size >= bigParty;\n })\n}", "function mouthSize(animal) {\n return animal.toLowerCase() === 'alligator' ? 'small' : 'wide';\n}", "function filterDogs(event){\n let goodDogs = []\n if (event.target.innerText == \"Filter good dogs: OFF\") {\n event.target.innerText = \"Filter good dogs: ON\"\n allDogs.forEach(dog => {\n if (dog.isGoodDog)\n goodDogs.push(dog)})\n clearDiv(getNavBar())\n iterateAllDogs(goodDogs) \n }\n else if (event.target.innerText = \"Filter good dogs: ON\"){\n event.target.innerText = \"Filter good dogs: OFF\"\n clearDiv(getNavBar())\n iterateAllDogs()\n }\n}", "size(a, b) {\n console.warn('[collectionFilters] - sortingFunctions.size - This method hasn\\'t been implemented yet.');\n // Implement this so sizes show up how we expect them to? small, med, large..\n }", "function displayDogs(count) {\n $('#dogs').empty();\n for(var i=0; i<count; i++) {\n $('#dogs').append(\"<img src='\" + dog(i) + \"' />\");\n }\n}", "function displayDogBreeds(dogBreedData) {\n const breedData = dogBreedData.petfinder.breeds.breed\n let breedTypes = {};\n $.each(breedData, function (index, value) {\n breedTypes[breedData[index].$t] = null;\n });\n $('#breed').autocomplete({\n data: breedTypes,\n limit: 20,\n minLength: 1,\n });\n }", "function getSize (sizes, containerSize) {\n var size = sizes[sizes.length - 1]\n\n var maxResize = 1.1\n\n var cW = containerSize[0]\n var cH = containerSize[1]\n for (var i = 0; i < sizes.length; i++) {\n var sW = sizes[i][0]\n var sH = sizes[i][1]\n\n if (sW * maxResize >= cW && sH * maxResize >= cH) {\n size = sizes[i]\n break\n }\n }\n\n return size\n}", "function sampleSize(collection, size = 1) {\n let indx;\n let randomArray = [];\n let counter = 0;\n if (collection instanceof Array) {\n while (counter !== size) {\n if (counter === collection.length) break;\n indx = Math.floor(Math.random() * collection.length);\n if (!randomArray.includes(collection[indx])) {\n randomArray.push(collection[indx]);\n counter++;\n }\n }\n return randomArray\n }\n\n let k = Object.keys(collection);\n while (counter !== size) {\n if (counter === k.length) break;\n indx = Math.floor(Math.random() * k.length);\n if (!randomArray.includes(collection[k[indx]])) {\n randomArray.push(collection[k[indx]]);\n counter++;\n }\n }\n\n return randomArray\n}", "function getNumberOfQualifiedDogs(breed, postalCode, gender, age) {\n $.ajax({\n url: `https://api.petfinder.com/pet.find?callback=?&key=831e7bdec6900fcd456fd38ddb8ba34d`,\n data: {\n key: `831e7bdec6900fcd456fd38ddb8ba34d`,\n animal: `dog`,\n breed: breed,\n location: postalCode,\n format: `json`,\n offset: state.trackOffset,\n age: dogAge,\n sex: dogGender,\n count: 500\n },\n type: \"GET\",\n dataType: \"json\"\n }).done(function (data) {\n state.totalNumberOfQualifiedDogs = data.petfinder.pets.pet.length;\n renderNumberOfPages();\n });\n }", "function check_variations() {\n $('form input[name=variation_id]').val('');\n $('.single_variation').text('');\n $('.variations_button, .single_variation').slideUp();\n\n $('.product_meta .sku').remove();\n $('.shop_attributes').find('.weight').remove();\n $('.shop_attributes').find('.length').remove();\n $('.shop_attributes').find('.width').remove();\n $('.shop_attributes').find('.height').remove();\n\n var all_set = true;\n var current_attributes = {};\n\n $('.variations select').each( function() {\n if ( $(this).val().length == 0 ) {\n all_set = false;\n }\n\n current_attributes[$(this).attr('name')] = $(this).val();\n });\n var matching_variations = find_matching_variations(current_attributes);\n\n if ( all_set ) {\n var variation = matching_variations.pop();\n\n $('form input[name=variation_id]').val(variation.variation_id);\n show_variation(variation);\n } else {\n update_variation_values(matching_variations);\n }\n }", "function choices(guests, size) {\n\n let choices = {};\n for (let key in guests) {\n j = 1;\n if (guests[key].length <= size && key != i) {\n choices[key] = guests[key];\n }\n }\n return choices;\n\n}", "function addMoreInSize() {\n if (typeof utag_data.product_attribute !== undefined) {\n if (\n utag_data.product_attribute == \"bed\" ||\n utag_data.product_attribute == \"bedroom set\"\n ) {\n var size = utag_data.size;\n var productAttribute = titleCase(utag_data.product_attribute);\n var colorFamily = utag_data.colorfamily;\n var queryUrl =\n \"https://brm-core-0.brsrvr.com/api/v1/core/?account_id=5221&auth_key=o5xlkgn7my5fmr5c&domain_key=livingspaces_com&request_id=fd8d6a02a5764b7995c600e766a38bda&url=%2fbr-checker&_br_uid_2=uid%253D4961390647524%253Av%253D11.8%253Ats%253D1463613117510%253Ahc%253D3145&ptype=other&request_type=search&q=%22\" +\n size +\n \"%22&start=0&rows=13&search_type=keyword&fl=title,pid,url,price,sale_price,reviews,reviews_count,thumb_image&fq=product_attribute%3A%22\" +\n productAttribute +\n \"%22&fq=color_groups%3A%22\" +\n colorFamily;\n var appendTarget = $(\"#moreLikeThis\").parent();\n constructRecSlider(\n queryUrl,\n \"moreSize\",\n \"More In This Size\",\n appendTarget,\n true\n );\n }\n }\n}", "function volumeOfBox(sizes) {\n return sizes.length * sizes.width * sizes.height;\n }", "function allDogs() {\n\t// Displays the dogs name on the left in a 'jumbotron'\n\tdocument.getElementById('dogsContainer').innerHTML += '<h3 class=\"jumbotron col-md-4 bg-dark text-center\">' + dogs[i].name + '</h3>';\n\t// Displays an image of the dog itself\n\tdocument.getElementById('dogsContainer').innerHTML += '<img id=\"d' + id.toString() + '\" class=\"img-thumbnail col-md-4 my-dogs\" src=\"' + dogs[i].photo + '\"alt=\"Dog\">'; // ID is incremented automatically\n\t// Displays the remaining information about the dog taken from the array function\n\tdocument.getElementById('dogsContainer').innerHTML += '<ul class=\"jumbotron col-md-4 bg-custom\">' +\n\t'<li><b>ID#:</b> D' + id++ + '</li>' + \n\t'<li><b>Breed:</b> ' + dogs[i].breed + '</li>' + \n\t'<li><b>Colour:</b> ' + dogs[i].color + '</li>' + \n\t'<li><b>Height (cm):</b> ' + dogs[i].height + '</li>' +\n\t'<li><b>Age(Years): </b>' + dogs[i].age + '</li>' + \n\t'<li><b>Job: </b>' + dogs[i].job + '</li>' +\n\t'</ul>';\n}", "function where_is_doge(){\n var doge_locs = []\n for(var i = 0; i < room_list.length; i++){\n for(var j= 0; j < room_list[0].length; j++){\n for(var r = 0; r < room_list[i][j].room_map.length; r++){\n for(var c = 0; c < room_list[i][j].room_map[0].length; c++){\n if(room_list[i][j].room_map[r][c].dog_present){\n doge_locs.push([i, j, room_list[i][j].room_map[r][c]])\n }\n }\n }\n }\n }\n return doge_locs;\n}", "function getIntervalSpecies(size) {\n if (size === 1 || size === 4 || size === 5) {\n return 'P';\n } else {\n return 'M';\n }\n }", "function filterGenres() {\r\n var genderMovieSelect = $(\"#genders-movie select\").val()\r\n if (genderMovieSelect != \"all\") {\r\n $(\"#movie .template\").each(function() {\r\n var gid = $(this).attr(\"data-generi\").split(',');\r\n if (gid.includes(genderMovieSelect)) $(this).show()\r\n else $(this).hide()\r\n });\r\n } else {\r\n $(\"#movie .template\").show()\r\n }\r\n var genderTVSelect = $(\"#genders-tv select\").val()\r\n if (genderTVSelect != \"all\") {\r\n $(\"#tvshow .template\").each(function() {\r\n var gid = $(this).attr(\"data-generi\").split(',');\r\n if (gid.includes(genderMovieSelect)) $(this).show()\r\n else $(this).hide()\r\n });\r\n } else {\r\n $(\"#tvshow .template\").show()\r\n }\r\n }", "function sizeScale() {\n // create size scales for chosen size\n var linearScale = d3.scaleLinear()\n .domain([d3.min(happinessData, d => d[chosenSize]),\n d3.max(happinessData, d => d[chosenSize])])\n .range([6, 12]);\n \n return linearScale;\n}", "function size(d) {\n\n switch (d.nodeType) {\n case \"likerNode\":\n return Math.sqrt(d.size) * 5 || 6;\n case \"taggedNode\":\n return Math.sqrt(d.size) * 5 || 4;\n case \"postNode\":\n return Math.sqrt(d.size) * 5 || 4.5;\n case \"coreNode\":\n return 20;\n case \"year\":\n return Math.sqrt(d.size) / 5 || 8;\n default:\n return Math.sqrt(d.size) * 5 || 4.5;\n }\n }", "function enemySnakes(opts = {}) {\n let you = urData.you;\n let enemies = urBoard.snakes.filter((s) => s.id !== you.id);\n if (opts.bigger)\n enemies = enemies.filter((s) => s.body.length >= you.body.length);\n else if (opts.smaller)\n enemies = enemies.filter((s) => s.body.length < you.body.length);\n\n return enemies;\n }", "static getAllDogs() {\n return $.get(this.url);\n }", "function findVialPriceWithSize(arr, targetSize) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].size === targetSize) {\n // console.log(arr[i])\n return arr[i].price;\n }\n }\n\n return 0;\n}", "function outOfStack () {\n if (!get('.colorChoosed')) {\n get(\"#productColor > div:nth-of-type(1)\").className = \"colorChoosed\";\n } \n \n let sizeDivs = get('#productSize > div',true);\n let variants = frank_global.product.product.variants;\n let targetColor = get('.colorChoosed').firstChild.dataset.color_code;\n let sizeHasNoStack = [];\n \n for (let variant of variants) {\n if (variant.color_code === targetColor && variant.stock ===0 ) {\n sizeHasNoStack.push(variant.size);\n }\n }\n for (let div of sizeDivs) { /** reset all size div to display */\n div.style.display = 'inline-block';\n for (let size of sizeHasNoStack) {\n if (size === div.innerText) {\n div.style.display = 'none';\n div.className = '';\n }\n }\n } \n if (!get('.sizeChoosed') ) {\n getFirstOne: for (let div of sizeDivs) {\n if (div.style.display !== 'none') {\n div.className = 'sizeChoosed';\n break getFirstOne;\n }\n } \n }\n}", "function dog(index) {\n dogs = [\n {\n name: 'Benji',\n parent: 'Tazz',\n image: 'https://scontent-ort2-2.cdninstagram.com/t51.2885-15/e35/13117822_577074802454648_669561747_n.jpg'\n },\n {\n name: 'Stella',\n parent: 'Christina',\n image: 'https://scontent-ort2-2.cdninstagram.com/t51.2885-15/e35/18580614_459447704391612_3858491631091056640_n.jpg'\n },\n {\n name: 'Gus',\n parent: 'Melissa',\n image: 'https://scontent-ort2-2.cdninstagram.com/t51.2885-15/e35/19379679_376805552721596_5539474451298516992_n.jpg'\n },\n {\n name: 'Britta',\n parent: 'Sonia',\n image: 'https://scontent-ort2-2.cdninstagram.com/t51.2885-15/e35/17933967_207807146377335_5752163340625379328_n.jpg'\n },\n {\n name: 'Andi',\n parent: 'Lisa',\n image: 'https://scontent-ort2-2.cdninstagram.com/t51.2885-15/e35/17494535_1673261656312694_1446182537297657856_n.jpg'\n },\n {\n name: 'Pepper',\n parent: 'Lisa',\n image: 'https://scontent-ort2-2.cdninstagram.com/t51.2885-15/e35/17662042_658843390974923_5702249000237793280_n.jpg'\n },\n {\n name: 'Bowie',\n parent: 'Becky',\n image: 'https://scontent-ort2-2.cdninstagram.com/t51.2885-15/e35/18011536_156234241574344_7176909219407331328_n.jpg'\n },\n {\n name: 'Tonks',\n parent: 'Meghan',\n image: 'https://scontent-ort2-2.cdninstagram.com/t51.2885-19/s320x320/13774700_319544435046731_1301136002_a.jpg'\n }\n ];\n return dogs[index % dogs.length].image;\n}", "function getBagSizeName\n(\n size\n)\n{\n var sizeName = '';\n switch(size)\n {\n case 'S' :\n sizeName = 'Small';\n break; \n case 'M' :\n sizeName = 'Medium';\n break; \n case 'L' :\n sizeName = 'Large';\n break; \n }\n return sizeName;\n}", "function dog(id, coat, nrg, eye, K_){\nthis.id = id;\nthis.color = coat;\nthis.nrg = nrg;\nthis.eyeColor = eye;\nthis.K = K_;\n}", "getSize(name) {\n let size = this._data.sizes.find(s => s.name === name);\n return size;\n // for (let i = 0; i < this._data.sizes.length; i++) {\n // if (this._data.sizes[i].name === name) {\n // return this._data.sizes[i];\n // }\n // }\n }", "function buildPizzaSize(e) {\n \"use strict\";\n var i, j, checkbox, option, pizzaSize = $(\"pizzasize\");\n j = pizzaSize.getElementsByTagName(\"option\").length;\n checkbox = $(\"toppings\").getElementsByTagName(\"input\");\n //ENABLE ALL THE TOPPING OPTIONS\n $(\"cheese\").disabled = false;\n $(\"sauce\").disabled = false;\n $(\"pizzasize\").disabled = false;\n for (i = 0; i < checkbox.length; i += 1) {\n checkbox[i].removeAttribute(\"disabled\");\n }\n //CHECK IF THERE IS ANY OPTION IN THE DROPDOWN SELECTION\n if (j > 0) {\n //IF YES THEN WE DELETE THEM\n for (i = j; i > 0; i -= 1) {\n pizzaSize.remove(pizzaSize.querySelector(\"option\"));\n }\n }\n //ITERATE THROUGH ALL OF THE KEYS OF THE DOUGHTYPE OBJECT\n Object.keys(doughType).forEach(function (key) {\n //IF THE KEY MATCHES THE SELECTION\n if (key.toLowerCase() === e.target.id) {\n //IF WE HAVE MORE THAN ONE OPTION FOR PIZZA SIZE\n if (doughType[key][0][0].length > 1) {\n pizzaSizePrice = doughType[key][0][1];\n for (i = 0; i < doughType[key].length; i += 1) {\n //CREATE OPTIONS FOR DIFFERENT PIZZA SIZES\n option = window.document.createElement(\"option\");\n option.text = doughType[key][i][0] + \" $\" + doughType[key][i][1];\n pizzaSize.add(option);\n }\n //IF WE HAVE ONLY ONE OPTION FOR PIZZA SIZE (GLUTTEN FREE)\n } else {\n pizzaSizePrice = doughType[key][1];\n option = window.document.createElement(\"option\");\n option.text = doughType[key][0] + \" $\" + doughType[key][1];\n pizzaSize.add(option);\n }\n }\n });\n}", "function classPhotos(redShirtHeights, blueShirtHeights) {\n redShirtHeights.sort((a, b) => b - a);\n blueShirtHeights.sort((a, b) => b - a);\n\n let redShirtsAreTaller = true;\n let blueShirtsAreTaller = true;\n\n for (let i = 0; i < redShirtHeights.length; i += 1) {\n const redShirt = redShirtHeights[i];\n const blueShirt = blueShirtHeights[i];\n\n if (redShirt > blueShirt) {\n blueShirtsAreTaller = false;\n }\n if (redShirt < blueShirt) {\n redShirtsAreTaller = false;\n }\n if (redShirt === blueShirt) {\n return false;\n }\n }\n\n return redShirtsAreTaller || blueShirtsAreTaller;\n}", "function gooseFilter(birds){\n const geese = ['African', 'Roman Tufted', 'Toulouse', 'Pilgrim', 'Steinbacher'];\n return birds.filter(bird => !geese.includes(bird));\n}", "function getTwoDogs(minimum_count_diff, maximum_count_diff) {\n var dog1 = dogs[Math.floor(Math.random() * dogs.length)]\n\n var other_dogs = dogs.filter(function(dog) {\n // check for minimum difference\n if (!isNaN(parseInt(minimum_count_diff))) {\n if (Math.abs(dog.count - dog1.count) < parseInt(minimum_count_diff)) {\n return false\n }\n }\n\n // check for maximum difference\n if (!isNaN(parseInt(maximum_count_diff))) {\n if (Math.abs(dog.count - dog1.count) > parseInt(maximum_count_diff)) {\n return false\n }\n }\n\n // make sure they don't have the same count\n if (dog.count === dog1.count) return false\n\n return true\n })\n var dog2 = other_dogs[Math.floor(Math.random() * other_dogs.length)]\n\n /* Dog1 is almost guarateened to be the lowest score because\n the distribution strongly favors picking a very low-numbered name\n so let's randomize the order a bit\n */\n return Math.random() < 0.5 ? [ dog1, dog2 ] : [ dog2, dog1 ]\n}", "function fontSizes(vars, maxSize) {\n\n var sizes = [];\n var svg = d3.select(\"body\").append(\"svg\");\n\n // Create some spans such that we can work out the length of the various words\n var tspans = svg.append(\"text\")\n .selectAll(\"tspan\")\n .data(vars.words)\n .enter()\n .append(\"tspan\")\n .attr(\"left\", \"0px\")\n .attr(\"position\", \"absolute\")\n .attr(\"top\", \"0px\")\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .style(\"font-size\", maxSize + \"px\")\n .text(function (d) {\n return d;\n })\n .each(function (d) {\n\n var width = this.getComputedTextLength();\n var height = this.offsetHeight || this.getBoundingClientRect().height || this.parentNode.getBBox().height;\n\n var children = d3.select(this).selectAll(\"tspan\");\n if (children.size()) {\n alert(\"didn't expect to get here\");\n }\n\n return sizes.push({\n height: height,\n width: width,\n text: d\n });\n });\n\n tspans.remove();\n svg.remove();\n return sizes;\n }", "function filterLongWords(words, size){\n \"use strict\";\n var newWordList = [];\n\n for(var i=0; i<words.length; i++){\n var word = words[i];\n if(word.length < size){\n newWordList.push(word);\n }\n }\n\n return newWordList;\n}", "render() {\n console.log(this.state)\n \n const filteredHornedAnimals = Images.filter((Image) => {\n //if there is no keyword and no horns selected by the user, then show all of my pictures\n if (!this.state.keyword && !this.state.horns) return true;\n //What is your condition? If there is a keyword selected and there is not a horns selected...what \n //do I want to happend? \n if (this.state.keyword && !this.state.horns) { \n //what I want to happen in this space \n if (Image.keyword === this.state.keyword) return true;\n }\n if (this.state.horns && !this.state.keyword) {\n //what I want to happen in this space \n if (Image.horns === this.state.horns) return true; \n }\n if (this.state.keyword && this.state.horns) { \n //what I want to happen in this space \n if(Image.keyword === this.state.keyword && Image.horns === this.state.horns) return true;\n }\n\n return false;\n });\n\n return (\n <div className=\"App\">\n <Router>\n < MyHeader/>\n \n Animal Search\n < Dropdown\n currentValue= {this.state.keyword}\n handleChange= {this.handleKeywordChange}\n options={['narwhal', 'rhino', 'unicorn', 'unilego', 'triceratops', 'markhor', 'mouflon', 'addax', 'chameleon', 'lizard', 'dragon']}\n />\n\n Number of Horns\n < Dropdown\n currentValue = {this.state.horns}\n handleChange = {this.handleHornChange}\n options={[1, 2, 3, 100]}\n />\n < MyImageList filteredHornedAnimals= {filteredHornedAnimals}/>\n </Router>\n </div>\n );\n }", "render() {\n const filteredImages = images\n .filter((image) => {\n if (this.state.keyword === '') return true\n if (image.keyword === this.state.keyword) return true\n return false\n }) \n .filter((image) => {\n if (this.state.horns === '') return true\n if (image.horns === this.state.horns) return true\n return false\n })\n\n //get an array for just the keywords and get an array for all the horn options (Diyana helped here)\n const keywordsArray = images.map(entry=>entry.keyword)\n const hornsArray = images.map(entry=>entry.horns) \n return (\n <div className =\"main\"> \n <Header />\n <Dropdown option={keywordsArray} select={this.state.keyword} handleChange = {this.handleKeyword} />\n \n \n <Dropdown option ={hornsArray} select={this.state.horns} handleChange = {this.handleHorns} /> \n <ImageList filteredImages={filteredImages}/>\n \n </div>\n )\n }", "function SizeInput() {\n if(sizes.length > 0) {\n return (\n <select className=\"px-4 py-2 mb-4 text-base text-white bg-gray-800 border border-gray-700 rounded focus:outline-none focus:border-indigo-500\" name=\"size\">\n {sizes.map((size, index) => (\n <option key={index} value={size}>{size}</option>\n ))}\n </select>\n )\n } else {\n return <span className='hidden'></span>\n }\n}", "function filterBeds(bedNum){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n if(bedNum === 4) {\r\n listings[i].visible = l.bedNum >= bedNum && listings[i].visible;\r\n } else {\r\n listings[i].visible = l.bedNum === bedNum && listings[i].visible;\r\n }\r\n }\r\n}", "showDogsBreed(){\r\n const elem = document.querySelector(\".dogsBreed\");\r\n elem.innerHTML = '';\r\n for (let i = 0; i<this.dogsBreed.length; i++){\r\n let li = document.createElement('li');\r\n li.innerHTML = this.dogsBreed[i];\r\n elem.appendChild(li);\r\n }\r\n }", "function MakespotsDroppable() {\n var disabled = \"disabled\";\n\n for (var i = 1; i <= $(\"#board div\").length; i++) {\n if (\n $(\"#spot\" + i)\n .attr(\"class\")\n .search(disabled) > 0 &&\n $(\"#spot\" + i).has(\"img\").length == 0\n ) {\n $(\"#spot\" + i).droppable(\"enable\");\n }\n }\n}", "function cenaPoDimenziji(size) {\n switch (size) {\n case \"9x13\":\n return 10;\n case \"10x15\":\n return 15;\n case \"13x18\":\n return 20;\n case \"15x21\":\n return 25;\n case \"20x30\":\n return 30;\n case \"25x38\":\n return 35;\n }\n}", "function preRenderFilteredItems(animal, type, priceRange) {\r\n for (let i in accessoriesArr) {\r\n if (animal === accessoriesArr[i].animal) {\r\n if (type === accessoriesArr[i].type) {\r\n if (accessoriesArr[i].price >= parseInt(priceRange) && accessoriesArr[i].price < (parseInt(priceRange) + 25)) {\r\n renderFilteredAccessories(i);\r\n } else if (priceRange === '-1') {\r\n renderFilteredAccessories(i);\r\n }\r\n } else if (type === '0') {\r\n if (accessoriesArr[i].price >= parseInt(priceRange) && accessoriesArr[i].price < (parseInt(priceRange) + 25)) {\r\n renderFilteredAccessories(i);\r\n } else if (priceRange === '-1') {\r\n renderFilteredAccessories(i);\r\n }\r\n }\r\n } else if (animal === 'Select') {\r\n if (accessoriesArr[i].type.includes(type)) {\r\n if (accessoriesArr[i].price >= parseInt(priceRange) && accessoriesArr[i].price < (parseInt(priceRange) + 25)) {\r\n renderFilteredAccessories(i);\r\n } else if (priceRange === '-1') {\r\n renderFilteredAccessories(i);\r\n }\r\n } else if (type === '0') {\r\n if (accessoriesArr[i].price >= parseInt(priceRange) && accessoriesArr[i].price < (parseInt(priceRange) + 25)) {\r\n renderFilteredAccessories(i);\r\n } else if (priceRange === '-1') {\r\n renderFilteredAccessories(i);\r\n }\r\n }\r\n }\r\n }\r\n}", "function filterAnimals(category) {\n let animals = document.getElementsByClassName(\"one-preview2\");\n let allButton = document.querySelector(\".all\")\n const websiteGreen = '#6DB2A2';\n if (category == \"All\") {\n for (animal of animals) {\n animal.style.display = \"flex\";\n allButton.style.color = \"white\";\n allButton.style.backgroundColor = websiteGreen;\n }\n return;\n }\n for (animal of animals) {\n console.log(animal);\n animal.style.display = \"none\";\n allButton.style.color= websiteGreen;\n allButton.style.backgroundColor = \"transparent\";\n allButton.onMouseOver=\"this.style.color='white'\";\n allButton.onMouseOut=\"this.style.color='white'\";\n allButton.onMouseOver=\"this.style.backgroundColor='#6DB2A2'\";\n allButton.onMouseOut=\"this.style.backgroundColor='transparent'\";\n }\n \n let selectedAnimals = document.querySelectorAll(`[techStack='${category}']`);\n \n for (animal of selectedAnimals) {\n animal.style.display = \"flex\";\n allButton.style.color = websiteGreen;\n allButton.style.backgroundColor = \"transparent\";\n allButton.onMouseOver=\"this.style.color='white'\";\n allButton.onMouseOut=\"this.style.color='white'\";\n allButton.onMouseOver=\"this.style.backgroundColor= websiteGreen\";\n allButton.onMouseOut=\"this.style.backgroundColor='transparent'\";\n }}", "function filterAnimals(category) {\n let animals = document.getElementsByClassName(\"one-preview\");\n let allButton = document.querySelector(\".all\")\n const websiteGreen = '#307473';\n if (category == \"All\") {\n for (animal of animals) {\n animal.style.display = \"flex\";\n allButton.style.color = \"white\";\n allButton.style.backgroundColor = websiteGreen;\n }\n return;\n }\n for (animal of animals) {\n console.log(animal);\n animal.style.display = \"none\";\n allButton.style.color= websiteGreen;\n allButton.style.backgroundColor = \"transparent\";\n allButton.onMouseOver=\"this.style.color='white'\";\n allButton.onMouseOut=\"this.style.color='white'\";\n allButton.onMouseOver=\"this.style.backgroundColor='#307473'\";\n allButton.onMouseOut=\"this.style.backgroundColor='transparent'\";\n }\n \n let selectedAnimals = document.querySelectorAll(`[techStack='${category}']`);\n \n for (animal of selectedAnimals) {\n animal.style.display = \"flex\";\n allButton.style.color = websiteGreen;\n allButton.style.backgroundColor = \"transparent\";\n allButton.onMouseOver=\".style.color='transparent'\";\n allButton.onMouseOver=\"this.style.backgroundColor='websiteGreen'\";\n }\n }", "function filterRange(array, range, min, max){\n array.forEach(function(el){\n if(min === 0 || max === 0){\n return false;\n };\n if(range === \"size\"){\n if(!(el.size >= min && el.size <= max)){\n $(\"#\"+el.id).hide();\n } \n }else if(range === \"price\"){\n if(!(el.price >= min && el.price <= max)){\n $(\"#\"+el.id).hide();\n }\n }\n });\n }", "function checkCircleAgainstAllFilters() {\n d3.selectAll('circle')\n .classed('hide', function(d) {\n var isHide = false;\n for (var dimension in filterCollection) {\n var checkingDomain = filterCollection[dimension].domain\n // once one dimension doesn't match the selection, we hide it\n if (typeof(checkingDomain[0]) === 'number' && isOutsideNumberDomain(d, dimension)) {\n getLegendCounts(d)\n return true;\n } else if (typeof(checkingDomain[0]) === 'string' && isOutsideStringDomain(d, dimension)) {\n getLegendCounts(d)\n return true;\n }\n }\n updateSensitivityCount(d, true);\n return isHide;\n })\n}", "function dog(sigma) {\n //Using biliteral filter for better results\n //It isn't working on mobile devices though (why the hell ever ...)\n this.denoise(sigma).update();\n this._.extraTexture.ensureFormat(this._.texture);\n this._.texture.use();\n this._.extraTexture.drawTo(function() {\n Shader.getDefaultShader().drawRect();\n });\n this._.extraTexture.use(1);\n //Second biliteral filter\n this.denoise(sigma*1.6).update();\n \n //Now we're gonna subtract and threshold them to get the edges\n var fragment = '\\\n uniform sampler2D texture0;\\\n uniform sampler2D texture1;\\\n varying vec2 texCoord;\\\n \\\n void main(void) {\\\n vec4 color0 = texture2D(texture0, texCoord).rgba;\\\n vec4 color1 = texture2D(texture1, texCoord).rgba;\\\n color0 = color0 - color1;\\\n color0.a = 1.0;\\\n if((color0.r <= 0.005) || (color0.g <= 0.005) || (color0.b <= 0.005)) {\\\n color0.r = 1.0;\\\n color0.g = 1.0;\\\n color0.b = 1.0;\\\n color0.a = 0.0;\\\n }\\\n gl_FragColor = color0;\\\n }\\\n ';\n \n gl.differenceofgaussian = gl.differenceofgaussian || new Shader(null, fragment).textures({ texture1: 1 });\n simpleShader.call(this, gl.differenceofgaussian);\n \n this._.extraTexture.unuse(1);\n \n //Free the memory\n this._.extraTexture.destroy();\n \n return this;\n}", "function gooseFilter(birds) {\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"]\n const newGeese = []\n for (let i = 0; i < birds.length; i++) {\n if (!geese.includes(birds[i])) {\n newGeese.push(birds[i])\n }\n }\n return newGeese\n}", "function showBreed(event){\n // Jquery\n $(document).ready(function(){\n // Hide breed list\n $(\".breedList\").hide();\n $(\"#pageInformation\").hide();\n\n // Loop Through dog breed and find a breed that matches the clicked breed\n for (i = 0; i < dogBreedArray.length; i++) {\n if (event.target.id == (dogBreedArray[i])){\n // Show single breed view\n document.querySelector(\"#singleBreedView\").removeAttribute(\"style\");\n\n // Create Image of the dog breed\n breedImage();\n // create back link\n goBack('breeds.html', \"Back to Breed List\");\n\n // Display dog name, description and characteristics\n breedName.textContent = (dogBreeds[dogBreedArray[i]].breed);\n breedDescription.textContent = (dogBreeds[dogBreedArray[i]].description);\n\n breedCharacteristics.textContent = (dogBreeds[dogBreedArray[i]].characteristics);\n breedType.textContent = (dogBreeds[dogBreedArray[i]].type);\n breedSize.textContent = (dogBreeds[dogBreedArray[i]].size);\n\n // Check if the dog breed is hypoallergenic or rare and display the results\n var rarity = dogBreeds[dogBreedArray[i]].rarity;\n rarityCheck('breedRarity', rarity);\n var hypoallergenic = dogBreeds[dogBreedArray[i]].hypoallergenic;\n hypoallergenicCheck('breedHypoallergenic', hypoallergenic);\n\n // Display information about the friendliness of the dog breed\n breedFriendliness.textContent = (dogBreeds[dogBreedArray[i]].friendliness);\n\n // Create Star ratings for breed friendliness\n var friendlinessWithFamily = dogBreeds[dogBreedArray[i]].friendliness_with_family;\n starBuilder('breedFamilyFriendliness', friendlinessWithFamily );\n var goodWithChildren = dogBreeds[dogBreedArray[i]].good_with_children;\n starBuilder('breedChildrenFriendliness', goodWithChildren);\n var friendlinessWithStrangers = dogBreeds[dogBreedArray[i]].friendliness_with_strangers;\n starBuilder('breedStrangerFriendliness', friendlinessWithStrangers);\n var friendlinessWithDogs = dogBreeds[dogBreedArray[i]].friendliness_with_dogs;\n starBuilder('breedDogFriendliness', friendlinessWithDogs);\n\n // Display information about the lifestyle of the dog breed\n breedLifestyle.textContent = (dogBreeds[dogBreedArray[i]].lifestyle);\n\n // Create Star ratings for breed lifestyle\n var energy = dogBreeds[dogBreedArray[i]].energy;\n starBuilder('breedEnergy', energy);\n var apartmentAdaptability = dogBreeds[dogBreedArray[i]].apartment_adaptability;\n starBuilder('breedAdaptability', apartmentAdaptability);\n var independence = dogBreeds[dogBreedArray[i]].independence;\n starBuilder('breedIndependence', independence);\n var grooming = dogBreeds[dogBreedArray[i]].grooming;\n starBuilder('breedGrooming', independence);\n\n // Display information about the trainability of the dog breed\n breedTrainability.textContent = (dogBreeds[dogBreedArray[i]].trainability);\n\n // Create Star ratings for breed intelligence\n var intelligence = dogBreeds[dogBreedArray[i]].intelligence;\n starBuilder('breedIntelligence', intelligence);\n var noisiness = dogBreeds[dogBreedArray[i]].noisiness;\n starBuilder('breedNoisiness', noisiness);\n var preyDrive = dogBreeds[dogBreedArray[i]].prey_drive;\n starBuilder('breedPreyDrive', preyDrive);\n var wanderlust = dogBreeds[dogBreedArray[i]].wanderlust;\n starBuilder('breedWanderlust', wanderlust);\n\n // Display information about the health of the dog breed\n breedHealth.textContent = (dogBreeds[dogBreedArray[i]].common_health_issues);\n breedWeight.textContent = (dogBreeds[dogBreedArray[i]].weight);\n breedHeight.textContent = (dogBreeds[dogBreedArray[i]].height);\n breedCoatLength.textContent = (dogBreeds[dogBreedArray[i]].coat_length);\n breedLifespan.textContent = (dogBreeds[dogBreedArray[i]].lifespan);\n }\n }\n // Scroll to the top of the page\n $('html,body').scrollTop(0);\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 testSize(num) {\n if (num < 5) {\n return \"tiny\";\n } else if (num < 10) {\n return \"small\";\n } else if (num < 15) {\n return \"medium\";\n } else if (num < 20) {\n return \"large\";\n } else {\n return \"huge\";\n }\n}", "function small() {\n return $(window).width() < 500 || $(window).height() < 500\n}", "function getRunnersByTShirtSize(/* CODE HERE */) {\n /* CODE HERE */\n}", "function BreedsDropDown() {\n /* The followin are hooks which start being an array or string getting the data to\n our API, this will allow us to update those hooks in accordance with the filter */\n const [loading, setLoading] = useState(true);\n const [items, setItems] = useState([\n { label: \"Loading ...\", value: \"\", type: \"\" },\n ]);\n const [breed, setBreed] = useState(\"\");\n const [data, setData] = useState([]);\n const [search, setSearch] = useState([]);\n // useEffect hook which allow us to wait for a response fetching our API\n useEffect(() => {\n let unmounted = false;\n async function getCharacters() {\n const response = await fetch(\"http://localhost:1235/pets/\");\n const body = await response.json();\n if (!unmounted) {\n setSearch(body);\n setData(body);\n setItems(\n body.map((pets) => ({\n label: pets.breed_name,\n value: pets.breed_name,\n type: pets.animal_type,\n }))\n );\n setLoading(false);\n }\n }\n getCharacters();\n return () => {\n unmounted = true;\n };\n }, []);\n /* useEffect hook which will allow us to render the data in order to obtain\n the value of the breed we want */\n useEffect(() => {\n const breedsRes = data.filter((pets) => pets.breed_name.includes(breed));\n setSearch(breedsRes);\n }, [data, breed]);\n\n let uniq = getUnique(items, \"value\");\n\n // After getting the unique values we decided here to sort them in Alphabetical order\n uniq = uniq.sort(function (a, b) {\n if (a.type > b.type) return -1;\n if (a.type < b.type) return 1;\n return 0;\n });\n // This will return us the view of pets section in accordance with the selection in the Form\n return (\n <div>\n <Form className=\"pad_bot\">\n <Form.Group controlId=\"exampleForm.SelectCustom\">\n <Form.Label column=\"lg\" className=\"filter_text\">\n Select a breed\n </Form.Label>\n <Form.Control\n as=\"select\"\n custom=\"true\"\n disabled={loading}\n value={breed}\n onChange={(e) => setBreed(e.currentTarget.value)}\n onBlur={(e) => setBreed(e.currentTarget.value)}\n >\n <option>All</option>\n {uniq.map(({ label, value, type }) => (\n <option key={label} value={value}>\n {type} - {value}\n </option>\n ))}\n </Form.Control>\n </Form.Group>\n </Form>\n {breed === \"All\" ? (\n <CardDeck>\n {data.map((pets) => (\n <Pets\n key={pets.id}\n id={pets.id}\n name={pets.name}\n picture={pets.picture}\n sex={pets.sex}\n breed={pets.breed_name}\n />\n ))}\n </CardDeck>\n ) : (\n <CardDeck>\n {search.map((pets) => (\n <Pets\n key={pets.id}\n id={pets.id}\n name={pets.name}\n picture={pets.picture}\n sex={pets.sex}\n breed={pets.breed_name}\n />\n ))}\n </CardDeck>\n )}\n </div>\n );\n}", "function _distanceToFitObjectInView(size, fov){\r\n const {tan} = Math\r\n return size / (2 * tan(fov / 2))\r\n}", "dog(state) {\n //this is the function we called\n return (chipNr) => {\n return state.dogs.filter(dog => dog.chipNumber === chipNr)[0]\n }\n }", "function selectBigParties() {\n var partiesCheckboxes = document.getElementsByClassName('party-checkbox');\n\n // loop through parties\n for(var i = 0; i < parties.length; i++){\n if(parties[i].size >= 14){\n partiesCheckboxes[i].checked = true;\n document.getElementsByClassName('party-title')[i].style.fontWeight = 'bold';\n } else {\n partiesCheckboxes[i].checked = false;\n document.getElementsByClassName('party-title')[i].style.fontWeight = 'normal';\n }\n }\n}", "function gooseFilter(birds) {\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"];\n var notgeese = birds.filter(function (bird) {\n return !geese.includes(bird);\n })\n\n\n return notgeese\n\n}", "function displayNoDogs() {\r\n if (\r\n searchValue.toLowerCase() === 'dog' ||\r\n searchValue.toLowerCase() === 'dogs'\r\n ) {\r\n alert('Dogs?! 🙀 Oh the betrayal... ');\r\n }\r\n}", "function checkSize() {\n // apple check size\n let d1 = dist(pig.x, pig.y, apple.x, apple.y);\n // if the food is bigger, the player loses\n if ( d1 < (pig.sizeWidth + pig.sizeHeight) / 7 + (apple.sizeWidth + apple.sizeHeight) / 7){\n if ( (pig.sizeWidth + pig.sizeHeight) / 2 < (apple.sizeWidth + apple.sizeHeight) / 2 ) {\n state = `lose`;\n }\n }\n // if the food is smaller, the pig increases its size\n if ( d1 <(pig.sizeWidth + pig.sizeHeight) / 7 + (apple.sizeWidth + apple.sizeHeight) / 7 ) {\n if ((pig.sizeWidth + pig.sizeHeight) / 2 > (apple.sizeWidth + apple.sizeHeight) / 2 ) {\n score++;\n pig.sizeWidth = pig.sizeWidth + 1.5;\n pig.sizeHeight = pig.sizeHeight + 1.5;\n oink.play();\n appleFalling = true;\n }\n }\n\n // corn check size\n let d2 = dist(pig.x, pig.y, corn.x, corn.y);\n // if the food is bigger, the player loses\n if ( d2 < (pig.sizeWidth + pig.sizeHeight) / 8 + (corn.sizeWidth + corn.sizeHeight) / 8){\n if ( (pig.sizeWidth + pig.sizeHeight) / 2 < (corn.sizeWidth + corn.sizeHeight) / 2 ) {\n state = `lose`;\n }\n }\n // if the food is smaller, the pig increases its size\n if ( d2 <(pig.sizeWidth + pig.sizeHeight) / 8 + (corn.sizeWidth + corn.sizeHeight) / 8 ) {\n if ((pig.sizeWidth + pig.sizeHeight) / 2 > (corn.sizeWidth + corn.sizeHeight) / 2 ) {\n score++;\n pig.sizeWidth = pig.sizeWidth + 2;\n pig.sizeHeight = pig.sizeHeight + 2;\n oink.play();\n cornFalling = true;\n }\n }\n\n // carrot check size\n let d3 = dist(pig.x, pig.y, carrot.x, carrot.y);\n // if the food is bigger, the player loses\n if ( d3 < (pig.sizeWidth + pig.sizeHeight) / 8 + (carrot.sizeWidth + carrot.sizeHeight) / 8){\n if ( (pig.sizeWidth + pig.sizeHeight) / 2 < (carrot.sizeWidth + carrot.sizeHeight) / 2 ) {\n state = `lose`;\n }\n }\n // if the food is smaller, the pig increases its size\n if ( d3 <(pig.sizeWidth + pig.sizeHeight) / 8 + (carrot.sizeWidth + carrot.sizeHeight) / 8 ) {\n if ((pig.sizeWidth + pig.sizeHeight) / 2 > (carrot.sizeWidth + carrot.sizeHeight) / 2 ) {\n score++;\n pig.sizeWidth = pig.sizeWidth + 3.5;\n pig.sizeHeight = pig.sizeHeight + 3.5;\n oink.play();\n carrotFalling = true;\n }\n }\n\n}", "function filterCrewAvail(){\n\n // get current selected parameters from DOM <select> elements\n let baseSelection = $(\"#baseSelect option:selected\").text();\n let crewSelection = $(\"#crewTypeSelect option:selected\").text();\n \n // case: all bases and all crew types\n if(baseSelection === \"All\" && crewSelection === \"All\"){ \n drawVis(masterData); // draw visualization with all data\n return;\n } \n\n // case: specific bases and all crew types\n else if(baseSelection !== \"All\" && crewSelection === \"All\"){ \n let filteredData = masterData.filter(function(d){\n return d.base===baseSelection;\n });\n drawVis(filteredData);\n return;\n } \n\n // case: all bases and specific crew types\n else if(crewSelection !== \"All\" && baseSelection === \"All\"){ \n let filteredData = masterData.filter(function(d){\n return d.crewType === crewSelection;\n });\n drawVis(filteredData);\n return;\n } \n\n // case: specific bases and specific crew types\n else { \n let filteredData = masterData.filter(function(d){\n return d.crewType === crewSelection && d.base === baseSelection;\n });\n drawVis(filteredData);\n return;\n }\n }", "vehicleSize(size) {\n switch (size) {\n case \"small\":\n return \"https://png.icons8.com/dotty/40/000000/dirt-bike.png\";\n case \"medium\":\n return \"https://png.icons8.com/dotty/40/000000/fiat-500.png\";\n case \"large\":\n return \"https://png.icons8.com/dotty/40/000000/suv.png\";\n default:\n return \"https://png.icons8.com/dotty/40/000000/fiat-500.png\";\n }\n }", "function allFilters(dogs, ...checks) {\n return dogs\n .filter(dog => checks.every(check => check(dog)))\n .map(dog => dog.name);\n}", "function isPlaylistSizeValid(size) {\n return size <= 50 && size >= 5;\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}", "getImageSizes() {\n // current image, theme image sizes\n const { image, imageSizes } = this.props;\n // if ajax hasn't completed\n if (!image) return [];\n let options = [];\n // image sizes of current image\n const sizes = image.media_details.sizes;\n //\n for (const key in sizes) {\n const size = sizes[key];\n // is this size set in current theme?\n const imageSize = imageSizes.find(size => size.slug === key);\n //\n if (imageSize) {\n options.push({\n label: imageSize.name,\n value: size.source_url\n });\n }\n }\n return options;\n }", "function sizeCheck(sizes) {\n let lastSize = { width: 0, height: 0 };\n sizes.forEach(size => {\n icon.setAttribute(\"size\", size);\n\n flush(() => {\n const { width, height } = icon.getBoundingClientRect();\n assert.isAbove(width, lastSize.width, `size \"${size}\" should be wider than the size below`);\n assert.isAbove(height, lastSize.height, `size \"${size}\" should be taller than the size below`);\n lastSize = { width, height };\n done();\n });\n });\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 testSize(num) {\n\tif(num < 5) {\n\t\treturn \"tiny\";\n\t} else if(num < 10) {\n\t\treturn \"small\";\n\t} else if(num < 15) {\n\t\treturn \"medium\";\n\t} else if(num < 20) {\n\t\treturn \"large\";\n\t} else {\n\t\treturn \"Huge\";\n\t}\n}", "function atRiskPets(response) {\n\tvar dogImgID;\n\tvar dogImg;\n\tfor (var i = 0; i < response.data.length; i++) {\n\t\tdogImgID = response.data[i].relationships.pictures.data[0].id;\n\t\tfor (var j = 0; j < response.included.length; j++) {\n\t\t\tvar dogImgOptions = response.included[j].id;\n\t\t\tif (dogImgOptions === dogImgID) {\n\t\t\t\tdogImg = response.included[j].attributes.original.url;\n\t\t\t\tvar imgLi = $(\"<li></li>\");\n\t\t\t\timgLi.addClass(\"at-risk-li\");\n\t\t\t\tvar dogImgEl = $(\"<img>\");\n\t\t\t\tdogImgEl.attr(\"src\", dogImg);\n\t\t\t\t$(\".at-risk\").append(imgLi);\n\t\t\t\timgLi.append(dogImgEl);\n\t\t\t}\n\t\t}\n\t}\n}", "function showResults(size) {\n if (size == 0) {\n results.classList.add(\"no-results\");\n climbSize.innerHTML = \"did you enter your shoe size??\";\n }\n else if (isNaN(size)) {\n results.classList.add(\"no-results\");\n climbSize.innerHTML = \"did you choose your desired fit??\";\n }\n else {\n results.classList.remove(\"no-results\");\n results.classList.add(\"show-results\");\n climbSize.innerHTML = size;\n }\n}", "function onlyBooksFiveStars(products) {\n\tlet bestBooks = [];\n\tfor (const product of products) {\n\t\tif (product.category === 'books' && product.stars === 5) {\n\t\t\tbestBooks.push(product);\n\t\t}\n\t}\n\treturn bestBooks;\n}" ]
[ "0.6484849", "0.55410784", "0.5519137", "0.55004203", "0.5353505", "0.53114176", "0.5301908", "0.5297326", "0.52909994", "0.52301896", "0.523016", "0.5223799", "0.51765054", "0.50672436", "0.49874812", "0.4961645", "0.4942444", "0.48781925", "0.4832489", "0.48246303", "0.48071298", "0.47880724", "0.47866258", "0.47729024", "0.47551325", "0.4740598", "0.47378916", "0.47277546", "0.47123146", "0.47083423", "0.47034022", "0.4692615", "0.46914455", "0.46884322", "0.468125", "0.46639326", "0.46573743", "0.46535125", "0.4651101", "0.4643802", "0.46311003", "0.46278465", "0.46188998", "0.46154585", "0.46096596", "0.45810884", "0.4579852", "0.4579452", "0.4577021", "0.4575806", "0.45754394", "0.45723706", "0.45634186", "0.45477453", "0.4546327", "0.4540967", "0.45370582", "0.45368525", "0.45362535", "0.45360923", "0.4530596", "0.4518794", "0.4505127", "0.44978622", "0.44963807", "0.44880855", "0.44851816", "0.4473063", "0.44673598", "0.44520736", "0.44500846", "0.44487175", "0.44404194", "0.4424521", "0.44239083", "0.4415445", "0.44069278", "0.44050077", "0.4403503", "0.439876", "0.43907776", "0.4388788", "0.43823695", "0.43804988", "0.43786436", "0.43738803", "0.4373488", "0.43707117", "0.43694085", "0.4368004", "0.4367747", "0.4365267", "0.4359935", "0.43576476", "0.43539184", "0.43506154", "0.4346643", "0.4341934", "0.43403462", "0.4327086" ]
0.8293143
0
Is the component a react function of scan like java?
constructor() { super() //Think of the car and wheel example wheels on the car or we build many cars... this.state = { //This is where we make the factory name: "", //The person we build email: "", //Their email we have password: "", //Their unique identifyier that they only know error:"", //value can be added to this user profile for support later on? open: false }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scan() {\n store.dispatch(startScan());\n }", "scan(input){\n\n }", "render() {\n return (\n\n <div>\n This is React search Component !\n </div>\n );\n }", "function FunctionalComponent() {}", "handleClickScanButton() {\n this.setState({\n scanningBarcode: true\n });\n if (!this.isSearching()) {\n this.startSearching();\n }\n }", "function SomeComponent() {}", "renderSearchBar () {\n const changeHandler = this.setPattern\n\n return (\n <input\n id='search-bar'\n className='search'\n placeholder='Search'\n onChange={changeHandler}\n />\n )\n }", "scanClicked(e) {\n this.setState( { showScan: ! this.state.showScan } );\n }", "function Component() { }", "fakeScanComplete() {}", "function UserComponent(){\n console.log('User component')\n}", "render() { //all React classes need a render() function. this is what gets returned to be placed on the DOM. must return jsx\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)} />\n </div>\n ); //onChange is a react property. It triggers on every change. React has documentation for other properties.\n //event is a function that uses es6 notation. it doesnt need to be wrapped () because it is a one line solution.\n //event.target.value is a property of the event. try console.logging just the event and you will see an object that contains target. within target is the value\n }", "search() {\n\t\tthis.props.onSearch(this.state.term);\n\t}", "mountComponent(/* instance, ... */) { }", "render(){\n\t\t// every class must have a render method \n\t\treturn(\n\t\t\t<div className=\"search-bar\">\n\t\t \t\t<input \n\t\t \t\t\tvalue = {this.state.term} // this turns into controlled component\n\t\t \t\t\tonChange={(event) => this.onInputChange(event.target.value)} />\n\t\t \t</div>\n\t\t );\n\t}", "render() {\n return (\n <div className=\"search-bar\">\n <input \n value={this.state.term}\n onChange = {event => this.onInputChange(event.target.value)} />\n \n </div>\n );\n //could add this to the div to see the contents of the search bar\n // Value of the input: {this.state.term}\n }", "render(){\n //on change is a react defined property\n // we could have the onInputChange as a function outside and call this.onInputChange\n //with es6 can call function directly and as it is one line don't need curly braces\n //we can even omit the leading braces around the event argument as there is only one\n return(\n <div className=\"search-bar\">\n <input\n value = {this.state.term}\n onChange={event => this.onInputChange(event.target.value)} />\n {/*Value of the input : {this.state.term}*/}\n </div>\n\n ) ;\n }", "async scanSelector() {\n // <tag\n // \t id=\"a'\n // \t class=\"a\"\n // \t class=\"a b\"\n // >\n let match = this.match(/<\\w+\\s*([\\s\\S]*?)>/g, /\\b(?<type>id|class|className)\\s*=\\s*['\"`](.*?)['\"`]/g, /([\\w-]+)/g);\n if (match) {\n if (match.groups.type === 'id') {\n return simple_selector_1.SimpleSelector.create('#' + match.text, match.index);\n }\n else if (match.groups.type === 'class' || match.groups.type === 'className') {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n }\n // Syntax `:class.property=...`\n match = this.match(/\\bclass\\.([\\w-]+)/g);\n if (match) {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n // Syntax: `:class=${{property: boolean}}`.\n match = this.match(/\\bclass\\s*=\\s*\\$\\{\\s*\\{(.*?)\\}\\s*\\}/g, /(\\w+)\\s*:/g);\n if (match) {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n // React syntax:\n // `class={['...']}, '...' part\n // `class={'...'}\n match = this.match(/\\b(?:class|className)\\s*=\\s*\\{((?:\\{[\\s\\S]*?\\}|.)*?)\\}/g, /['\"`](.*?)['\"`]/g, /([\\w-]+)/g);\n if (match) {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n // React syntax:\n // `class={[..., {...}]}, {...} part.\n match = this.match(/\\b(?:class|className)\\s*=\\s*\\{((?:\\{[\\s\\S]*?\\}|.)*?)\\}/g, /\\{(.*?)\\}/g, /(\\w+)\\s*:/g);\n if (match) {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n // Due to https://github.com/gajus/babel-plugin-react-css-modules and issue #60.\n // `styleName='...'.\n match = this.match(/\\bstyleName\\s*=\\s*['\"`](.*?)['\"`]/g, /([\\w-]+)/g);\n if (match) {\n return this.scanDefaultCSSModule(match.text, match.index);\n }\n // React Module CSS, e.g.\n // `class={style.className}`.\n // `class={style['class-name']}`.\n match = this.match(/\\b(?:class|className)\\s*=\\s*\\{(.*?)\\}/g, /(?<moduleName>\\w+)(?:\\.(\\w+)|\\[\\s*['\"`](\\w+)['\"`]\\s*\\])/);\n if (match) {\n return this.scanCSSModule(match.groups.moduelName, match.text, match.index);\n }\n // jQuery selector, e.g.\n // `$('.abc')`\n match = this.match(/\\$\\((.*?)\\)/g, /['\"`](.*?)['\"`]/g, /(?<identifier>^|\\s|.|#)([\\w-]+)/g);\n if (match) {\n if (match.groups.identifier === '#' || match.groups.identifier === '.') {\n return simple_selector_1.SimpleSelector.create(match.groups.identifier + match.text, match.index);\n }\n else {\n return simple_selector_1.SimpleSelector.create(match.text, match.index);\n }\n }\n return null;\n }", "function MyFunctionalComponent() {\n return <input />;\n}", "render(createElement/*(TYPE, props, children, rawcontent)*/,components){\n\t\treturn \"Input.render should be implemented\"\n\t}", "render() {\n // add event handler\n // return <input onChange={this.onInputChange} />;\n return (\n <div>\n <input\n placeholder='search'\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)}\n />\n </div>\n );\n }", "function Searchbar({searchfield,searchChange}){\r\n\treturn(\r\n\t\t\t<div>\r\n\t\t\t\t<input className=\"pa3 ba b--green bg-lightest-green\" \r\n\t\t\t\ttype=\"search\" \r\n\t\t\t\tplaceholder=\"Search!!\"\r\n\t\t\t\tonChange={searchChange} />\r\n\t\t\t\t// triggers searchChange method of main app component event\r\n\t\t\t</div>\t\r\n\t);\r\n}", "render() {\n\t\treturn (\n\t\t\t<div className=\"search-bar\"> \n\t\t\t\n\t\t\t<input \n\t\t\tvalue={this.state.term}\n\t\t\tonChange={event=>{this.onInputChange(event.target.value)}}\n\t\t\t/>\n\t\t\t\n\t\t\t</div>\n\t\t\t);\n\t}", "render() {\n const { searchField, robots, ispending } = this.props;\n const {onSearchChange } = this.props; \n\n //return the robot according to the search field\n const filteredRobots = robots.filter(robot =>{\n return robot.name.toLowerCase().includes(searchField.toLowerCase());\n })\n //if users succeed or not\n return ispending ?\n <h1>Loading...</h1>:\n (\n //return the view\n <div className='tc'>\n <h1 className='f1'>RoboFriends</h1>\n <SearchBox searchChange={onSearchChange}/>\n <Scroll> {/*component that wrap the result in scrollbar */}\n <ErrorBoundary>{/**return error view to the user in a friendly way */}\n {/**component that returns users used for \n * to create users\n */}\n <CardList robots={filteredRobots} />\n </ErrorBoundary>\n \n </Scroll>\n </div>\n );\n }", "search() {\n this.props.onSearch(this.state.searchValue);\n }", "render() {\n return (\n\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)}/>\n </div>\n )\n\n }", "render() {\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onSearch(event.target.value)} />\n </div>\n );\n }", "doHandle(component) {}", "render(){\n\n\t\t//return <input onChange={this.onInputChange} />;\n\n\t\treturn(\n\t\t\t //below input is a controled input and its value is controled by state term\n\t\t\t<div className=\"search-bar\">\n\t\t\t\n\t\t\t\t<input value={this.state.term}\n\n\t\t\t\tonChange={event=> this.onInputChange(event.target.value)} />\n\t\t\t\t\n\t\t\t</div>\n\n\t\t\t) \n\t}", "render() {\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange ={event => this.onInputChange(event.target.value)} />\n </div>\n );\n }", "render() {\n // return <input onChange={this.onInputChange}/>;\n // alternative syntax with more ES6\n return (\n <div className=\"search-bar\">\n <input\n value= {this.state.term}\n onChange={event => this.onInputChange(event.target.value)}/>\n </div>\n );\n }", "render() {\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)}\n />\n </div>\n );\n }", "render() {\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)}\n />\n </div>\n );\n }", "render() {\r\n return (\r\n <div className=\"search-bar\">\r\n <input\r\n value={this.state.term}\r\n onChange = {event => this.onInputChange(event.target.value)} />\r\n </div>\r\n );\r\n }", "render() {\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)} />\n </div>\n );\n }", "function analogueWatch(){\n \n\n \n}", "render() {\n // 2\n // atau tanpa create handler baru\n // return <input onChange={event => console.log(event.target.value)} />;\n\n // 3\n // set state untuk digunakan di this.state\n return (\n <div>\n <input\n value = {this.state.term}\n onChange={event => this.setState({ term: event.target.value })} \n />\n \n </div>\n );\n // 1\n // use metheod on change\n // return <input onChange = { this.onInputChange }/>;\n }", "render() {\n return (\n <div className=\"search-bar\">\n <input \n value={this.state.term}\n onChange={ event => this.onInputChange(event.target.value) } />\n </div>\n );\n }", "function MyComponent() {\r\n return <div>Hello</div>;\r\n}", "render(){\n const {robotsNewFromSearch, searchField} = this.state\n const filteredRobots = robotsNewFromSearch.filter(robot=>{\n return robot.name.toLowerCase().includes(searchField.toLowerCase())\n })\n // console.log(filteredRobots)\n if(!filteredRobots.length){\n return <h1>Loading</h1>\n }else{\n return (\n <Fragment>\n <section className='tc'>\n \n <h1 className='f1'>Robo Friends</h1> \n {/* data flow--inpute----> */}\n <SearchBox inputSearch={this.dataFromInpute}/>\n \n {/* <----output----data flow */}\n <Scroll>\n <CardList robotsPassed={filteredRobots} />\n </Scroll>\n </section>\n </Fragment> \n )\n }\n\n }", "render(){\n return (\n <div className=\"App\">\n\n <div id='searchDiv'>\n \n <SearchBar changingText={this.changeSearchText} />\n \n </div>\n\n <CoolContainer\n searchText={this.state.searchText}\n adjetive={word}\n />\n \n </div>\n );\n }", "render(){\n //esto es lo que te devuelve esta funcion\n return <div></div>;\n }", "componentDidMount(){\n BleManager.start({showAlert: false});\n this.startScan();\n //you might have to scan before you connect to peripheral\n }", "componentDidMount() {\n\t\tthis.performSearch('cats')\n\t\tthis.performSearch('dogs')\n\t\tthis.performSearch('sunset')\n }", "render(){\n const hasCameraPermissions = this.state.hasCameraPermissions\n const scanned = this.state.scanned\n const buttonState = this.state.buttonState\n if(buttonState !== 'normal' && hasCameraPermissions){\n return(\n <BarCodeScanner\n onBarCodeScanned = {scanned? undefined : this.handleBarCodeScanned}\n style = {StyleSheet.absoluteFillObject}\n />\n )\n }\n else if(buttonState === 'normal'){\n\n \n return(\n <KeyboardAvoidingView style = {styles.container} behavior = 'padding' enabled>\n <View>\n <Image\n source = {require('../assets/booklogo.jpg')}\n style = {{width: 200, height: 200}}\n />\n <Text style = {{textAlign: 'center', fontSize:20}}>\n WILY\n </Text>\n </View>\n <View style = {styles.inputView}>\n <TextInput\n style = {styles.inputBox}\n placeholder = {'BookId'}\n onChangeText = {(text)=>{\n this.setState({\n scannedBookId: text\n })\n }}\n value = {this.state.scannedBookId}\n />\n <TouchableOpacity style = {styles.scanButton}\n onPress = {()=>{\n this.getCameraPermissions('BookId')\n }}\n >\n <Text style = {styles.buttonText}>\n Scan\n </Text>\n\n </TouchableOpacity>\n <View style = {styles.inputView}>\n <TextInput\n style = {styles.inputBox}\n placeholder = {'studentId'}\n onChangeText = {(name)=>{\n this.setState({\n scannedStudentId:'name'\n })\n }}\n value = {this.state.scannedStudentId}\n />\n <TouchableOpacity style = {styles.scanButton}\n onPress = {()=>{\n this.getCameraPermissions('studentId')\n }}\n >\n <Text style = {styles.buttonText}>\n Scan\n </Text>\n </TouchableOpacity>\n </View>\n </View>\n <Text>\n {hasCameraPermissions === true ? this.state.scannedData:'request camera permissions'}\n </Text>\n <TouchableOpacity style = {styles.scanButton} onPress = {this.getCameraPermissions}>\n <Text style = {styles.buttonText}>\n Scan\n </Text>\n </TouchableOpacity>\n <TouchableOpacity style = {styles.submitButton} onPress = {()=>{\n this.handleTransaction()\n this.setState({\n scannedBookId:' ',\n scannedStudentId: ' '\n })\n }}>\n <Text style = {styles.submitButtonText}>\n Submit\n </Text>\n </TouchableOpacity>\n </KeyboardAvoidingView>\n )\n\n }\n\n}", "render() {\n if (Constants.isScanDevice) {\n return (\n <Text {...this.props}>{this.props.children}</Text>\n )\n } else {\n return (\n <TouchableOpacity onPress={() => this.showQRCamera()}>\n <Text {...this.props}>{this.props.children || <Text style={{color: '#aaa'}}>点击此处开始扫描</Text>}</Text>\n </TouchableOpacity>\n )\n }\n }", "render() {\n const { gotcaste, searchfield } = this.state;\n //filtering and showing only those characters whose name matches the input value\n const filteredChars = gotcaste.filter(char => {\n return char.name.toLowerCase().includes(searchfield.toLowerCase());\n });\n return (\n <div className=\"tc\">\n <h1 className=\"f1\">GOT FLASH CARDS</h1>\n {/*Passing props*/}\n <Searchbox\n searchChange={this.onSearchChange}\n placeholder={\"search characters...\"}\n />\n <CardList arr={filteredChars} />\n </div>\n );\n }", "componentDidMount() {\n this.performSearch('ocean');\n this.performSearch('mountain');\n this.performSearch('forest');\n this.performSearch('snow');\n }", "render() {\n return (\n // className to give it a class - then css the hell out of it\n // note it is done with jsx instead of html, attributes are slightly different (className instead of class)\n <div className=\"search-bar\">\n <input\n // input value is that of the state.term. This is where it is held in the document\n // okay to referenece state but never modify this way. Only modify using this.setState(). Value of input will update everytime state is modified.\n // here we are telling it that the value of the input is equal to the state\n value={this.state.term}\n //all html input elements emmit a change event whenever a user reacts with them. \n //To use these browser events, simply use 'on' and the name of the event 'Change' then set it equal to the method you want to use. Also include the event handler as simply event=>. Keep it all in curly braces.\n //method syntax should follow basic structure of 'on' or 'handle' follow by the element watching for events, and then the name of the event itself. This way it tells its purpose.\n // event argument (what gets passed into the event handler) will provide the information about the event that occured. Can use this to get value of input.\n //Change is the name of the event we are wishing to tap into. This is a plain vanillaJS with HTML thing. Please look into different events\n onChange={event => this.onInputChange(event.target.value)}\n />\n </div>\n );\n }", "startScan() {\n /// code expected\n console.log(\"Bluetooth: Start scan not implemented\");\n\n }", "render() {\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)}/>\n </div>\n );//single arguments within an arrow function do not need to be enclosed in parentheses, such as (event) =>. this is a controlled component because the input value is determined by state. Whenever an event is called due to the input changing, it tells state to update with the event's updated value. this is turn causes state to rerender the component with the updated value that was entered in the input.\n }", "render() {\n return (\n <Grid\n container\n spacing={1}\n maxWidth=\"sm\"\n justify=\"center\"\n alignItems=\"center\"\n >\n <FoodList barcodeData={this.state.scannerData} />\n {this.state.scanner ? (\n <>\n <Scanner scannerOff={this.scannerOff} />\n </>\n ) : (\n <Grid\n container\n spacing={1}\n maxWidth=\"sm\"\n justify=\"center\"\n alignItems=\"center\"\n >\n <Button onClick={this.scannerOn}>Scan Barcode</Button>\n </Grid>\n )}\n </Grid>\n );\n }", "render() {\n // handling user inputs with property onChange\nreturn (\n <div className =\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)}/>\n\n </div>\n );\n }", "render(){\n return(\n <div className='search-bar'>\n <input type=\"text\"\n value={this.state.term}\n onChange={(event)=> this.onInputChange(event.target.value)} placeholder=\"Search\"/>\n\n </div>\n )\n }", "function SearchBar()\n{\n return(\n <div className= \"SearchBar\">\n <input className = \"Search\" type = \"text\" placeholder = \"Type to search...\" />\n </div>\n )\n}", "obtain(){}", "render(){\n\t\t// return <input onChange = {(event) => this.setState({ term: event.target.value })} />;\n\t\t\n\t\t// If we set the value variable to a controller input, \n\t\treturn (\n\t\t\t<div className = \"search-bar\">\n\t\t\t\t<input \t\n\t\t\t\t\tvalue = {this.state.term}\n\t\t\t\t\tonChange = {(event) => this.onInputChange( event.target.value )} />\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n //onChange is the input handler\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)} />\n </div>\n );\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"search-bar\">\n\t\t\t\t<input \n\t\t\t\t\tvalue={this.state.term}\n\t\t\t\t\tonChange={event =>\n\t\t\t\t\t\t\tthis.onInputChange(event.target.value)}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}", "function artBoofunc() {\n return (\n <SearchFile />\n );\n }", "render() {\n const { name, code } = this.props\n return (\n <div>\n <h1>This is a Class Components</h1>\n <p>I am {name}, and I love {code}</p>\n </div>\n )\n }", "function Usage() {\n return <Counter />\n}", "render() { \n\t\t// onChange is available on all elements; {} evaluates the JS inside the HTML\n\t\treturn (\n\t\t\t<div className=\"search-bar\">\n\t\t\t\t<input onChange={event => this.onInputChange(event.target.value)} value={this.state.term} />\n\t\t\t</div>\n\t\t\t)\n\t}", "function SampleComponent() {\n return <h1>Hello World</h1>;\n}", "getComponents(): Array<ComponentClass> {\n let foundComponents: Array<ComponentClass> = [];\n for (const type: Class<ComponentClass> of this.constructor.componentTypes) {\n for (const comp: ComponentClass of this.manager.componentInstances) {\n if (comp instanceof type) {\n foundComponents.push(comp);\n }\n }\n }\n return foundComponents;\n }\n init() {}\n draw(timeSinceLastUpdate: number) {} // eslint-disable-line\n update() {}\n}", "render() {\n console.log(`component WelcomeComponent da dc render`);\n return(\n <h1> Welcome you !</h1>\n )\n }", "function Input() {}", "componentDidMount(){ \n this.searchPerson() \n }", "setScanResult(result) {\n this.props.parent.onBarCodeRead({code:result});\n }", "render() {\n //Set up autocomplete props\n const inputProps = {\n placeholder: 'Search for a player',\n value: this.state.value,\n onChange: this.onChange\n };\n\n //Return JSX\n return (\n <div className=\"player-search\">\n <label className=\"player-search__label\" htmlFor={this.props.id}>Your {this.props.id} player</label>\n <Autosuggest\n suggestions={this.state.suggestions}\n onSuggestionsFetchRequested={this.getSuggestions}\n onSuggestionsClearRequested={this.onSuggestionsClearRequested}\n getSuggestionValue={this.getSuggestionValue}\n renderSuggestion={this.renderSuggestion}\n inputProps={inputProps}\n id={this.props.id}\n />\n </div>\n );\n }", "render() {\n // in our render method, we must return some JSX, otherwise will throw an error\n // all html input elements have a 'change' event\n // ALWAYS manipulate the state with 'setState' object !\n return (\n <div className=\"search-bar\">\n <input\n value = { this.state.term }\n onChange = { event => this.onInputChange( event.target.value ) } />\n </div>\n );\n\n // Controlled field: has its value set by the state! - Our input is controlled input!\n\n // THE REAL LOGIC: when users types somenthing, they don't change the input value, they just trigger an event,\n // which updates the state, causes the component to rerender\n\n // es6 feature: arrow function\n // we replace our one line handler with arrow function; write less, cleaner code\n\n // Inside of JSX: when we reference javascript variable, we use '{}' !!\n\n }", "function Searcher(props) {\n return (\n <Form onSubmit={props.onSubmit}>\n <InputSearcher\n name=\"buscar\"\n type=\"text\"\n placeholder=\"Busca por canción, artista o álbum\"\n />\n <Button>Buscar</Button>\n </Form>\n )\n}", "function SearchWrapper () {}", "_renderInput(css) {\n return (\n <div className={`inputContainer ${css}`}>\n <input value={this.state.query} type=\"text\" className=\"\" placeholder=\"Search...\" id=\"searchText\" onChange={(e) => this.setState({ query: e.target.value })}\n onKeyPress={(e) => {\n if (e.key === 'Enter')\n this.search();\n }}\n />\n <button onClick={() => this.search()}>\n <img src={searchIconC} alt=\"\" />\n </button>\n </div>\n )\n }", "function registerComponent(comp)\n\t{\n\t\tif (comp.getType() == \"input\") {\n\t\t\tcomp.getGroup().on('click tap', function(event) {\n\t\t\t\tnodeMouseDown(event, comp);\n\t\t\t\tstage.draw();\n\t\t\t\tga(\"send\", \"event\", \"circuits\", \"walk\", \"figure-\" + exerID);\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tcomp.getGroup().on('click tap', function (event) {\n\t\t\t\tcompMouseDown(event, comp);\n\t\t\t\tga(\"send\", \"event\", \"circuits\", \"walk\", \"figure-\" + exerID);\n\t\t\t\tstage.draw();\n\t\t\t});\n\t\t}\n\t}", "render() {\n //manipulating state example\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term}\n onChange={event => this.onInputChange(event.target.value)} />\n </div>\n );\n }", "render() {\n // onChange is a specific React-defined event handler\n return (\n <div className=\"search-bar\">\n <input\n value={this.state.term} // the state is telling the input what its value is\n onChange={e => this.onInputChange(e.target.value)}\n />\n </div>\n );\n }", "function render(comp) {\n // here comp will be the entire fn component code eg.\n // comp ƒ Counter() {\n // const [count, setCount] = TinyHooks.useState(0);\n // const [time, setTime] = TinyHooks.useState(new Date());\n\n // // This could should run on each function call/render\n // TinyHooks.useEffect…\n const instance = comp(); // invoking (executing) the function\n // here instance is a object with a render method. eg.\n // Object\n // render: () => { root.innerHTML = view; }\n // __proto__: Object\n instance.render();\n // in the next render the key counter can start from 0 again\n sequence = undefined;\n return instance;\n }", "render() {\n const filteredRobots = this.state.robots.filter(robots => {\n return robots.name.toLowerCase().includes(this.state.searchfield.toLowerCase());\n })\n return (\n <div className='tc'>\n <h1 className=\"f2\">Current Porfolio Skills</h1>\n <SearchBox searchChange={this.onSearchChange} />\n {/* <Scroll> */}\n <CardList robots={filteredRobots} />\n {/* </Scroll> */}\n </div >\n );\n }", "static define() {\n Akili.component('component', Component);\n }", "render(){\n return (\n <div className=\"container\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /> \n <div id=\"search\" className=\"search\">\n <input \n type=\"text\" \n name=\"search\" \n id=\"search-input\" \n className=\"search-input\" \n placeholder=\"Search movie by title...\"\n ref={input => this.search = input} \n onChange={this.changeInput} /> \n\n <br /><br /> \n </div>\n <LoadingIndicator />\n <br /> \n <ResultsContainer results={this.state.results} query={this.state.query}/> \n </div>\n );\n }", "render() {\n let arrayOfComponents=this.handleSearch().map((todoObj,i)=>(<ToDoCard key={`${i}_${todoObj.title}`} todo={todoObj} handleDeleting={this.props.handleDeleting} handleToggleComplete={this.props.handleToggleComplete}/>))\n\n return (\n <div>\n <h1>Incomplete Todos</h1>\n {<SearchBarComponent value={this.state.searchTerm} handleOnChange={this.handleOnChange}/>}\n {arrayOfComponents}\n {/* Which Array method can you use? */}\n </div>\n )\n }", "render() {\n return (\n <div className=\"query\">\n <input id=\"query\"\n type=\"text\"\n placeholder=\"Filter out text...\"\n // onChange={this.props.handleInput}\n onKeyPress={this.props.handleInput}/>\n </div>\n );\n }", "componentDidMount(props) {\n this.performSearch();\n this.performSearch('meerkat');\n this.performSearch('gorilla');\n this.performSearch('elephant');\n}", "_defineAddComponentFiltrableInput() {\n var _a;\n const items = [], itemsByCategories = {};\n for (let [specs, specsObj] of Object.entries((_a = this._specs) !== null && _a !== void 0 ? _a : {})) {\n if (!specsObj.category) {\n _console.log(`<red>[SCarpenter]</red> Your \"${specs}\" specs does not specify any \"category\". It will be ignored...`);\n continue;\n }\n // take in consideration ONLY the categories that are specified in the \"categories\" props\n if (!this.props.categories[specsObj.category]) {\n continue;\n }\n if (!itemsByCategories[specsObj.category]) {\n itemsByCategories[specsObj.category] = [];\n }\n itemsByCategories[specsObj.category].push({\n title: specsObj.title,\n description: specsObj.description,\n category: specsObj.category,\n preview: specsObj.preview,\n specs,\n });\n items.push({\n title: specsObj.title,\n description: specsObj.description,\n category: specsObj.category,\n preview: specsObj.preview,\n specs,\n });\n }\n __querySelectorLive('s-carpenter-app-add-component', ($elm) => {\n $elm.addEventListener('s-filtrable-input.select', (e) => __awaiter(this, void 0, void 0, function* () {\n // get a proper uniqid\n const nodeMetas = yield this._ask('nodeMetas', {\n prefix: `${e.detail.item.specs.split('.').pop()}`,\n image: {\n url: e.detail.item.preview,\n },\n });\n // add the component\n this._addComponent({\n uid: nodeMetas.uid,\n specs: e.detail.item.specs,\n $after: __traverseUp(e.target, ($elm) => $elm.classList.contains('s-carpenter-app_website-add-component')),\n });\n }));\n }, {\n rootNode: this._$websiteDocument,\n });\n __SFiltrableInputComponent({\n mountWhen: 'interact',\n value: 'specs',\n placeholder: this.props.i18n.addComponent,\n label(item) {\n return item.name;\n },\n filtrable: ['title', 'type'],\n templates: ({ type, item, html, unsafeHTML }) => {\n if (type === 'item') {\n switch (item.type) {\n case 'category':\n return html `\n <div class=\"_item _item-category\">\n <div class=\"_icon\">\n ${unsafeHTML(item.icon)}\n </div>\n <div class=\"_metas\">\n <h3 class=\"_title\">\n ${unsafeHTML(item.title)}\n </h3>\n <p class=\"_description\">\n ${item.description}\n </p>\n </div>\n </div>\n `;\n break;\n default:\n return html `\n <div class=\"_item _item-component\">\n <div class=\"_preview\">\n ${item.preview\n ? html `\n <img\n src=\"${item.preview}?v=${__uniqid()}\"\n />\n `\n : html `\n ${unsafeHTML(this.props\n .noPreviewIcon)}\n `}\n </div>\n <div class=\"_metas\">\n <h3 class=\"_title\">\n ${unsafeHTML(item.title)}\n </h3>\n <span class=\"_description\"\n >${unsafeHTML(item.description)}</span\n >\n </div>\n </div>\n `;\n break;\n }\n }\n },\n searchValudPreprocess(value) {\n return value.replace(/^\\/[a-zA-Z0-9]+\\s?/, '');\n },\n items: ({ value }) => __awaiter(this, void 0, void 0, function* () {\n var _b, _c, _d, _e, _f, _g, _h;\n if (!value) {\n const categoriesItems = [];\n for (let [category, itemsInThisCategory,] of Object.entries(itemsByCategories !== null && itemsByCategories !== void 0 ? itemsByCategories : {})) {\n categoriesItems.push({\n title: (_c = (_b = this.props.categories[category]) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : __upperFirst(category),\n description: (_e = (_d = this.props.categories[category]) === null || _d === void 0 ? void 0 : _d.description) !== null && _e !== void 0 ? _e : '',\n icon: (_g = (_f = this.props.categories[category]) === null || _f === void 0 ? void 0 : _f.icon) !== null && _g !== void 0 ? _g : '',\n type: 'category',\n value: `/${category} `,\n preventClose: true,\n preventReset: true,\n preventSelect: true,\n props: {\n value: 'value',\n },\n });\n }\n return categoriesItems;\n }\n let filteredItems = items;\n if (value.match(/^\\/[a-zA-Z0-9]+/)) {\n const category = (_h = value\n .trim()\n .match(/^\\/([a-zA-Z0-9]+)/)) === null || _h === void 0 ? void 0 : _h[1];\n if (category && itemsByCategories[category]) {\n filteredItems = itemsByCategories[category];\n }\n }\n return filteredItems;\n }),\n }, 's-carpenter-app-add-component', {\n window: this._websiteWindow,\n });\n }", "render() {\n\t\t//always manipulate state, using this.setState\n\t\t//this.state.term : referencing is ok\n\t\treturn (\n\t\t\t<div className=\"search-bar\">\n\t\t\t\t<input \n\t\t\t\t\tvalue={this.state.term} //update the user input whenever the state changes\n\t\t\t\t\tonChange={event => this.onInputChange(event.target.value)} />\n\t\t\t</div>\n\t\t); //pass that event handler function which is defined as method within SearchBar class. All HTML input elements emit change event whenever a user interacts with them\t\t\n\t}", "getFromComponent(componentName, funcName, args=undefined){\n return this.#components.get(componentName)[funcName](args);\n }", "render() {\n\t\treturn(\n\t\t\t<section className='search-bar'>\n\t\t\t\t<label>Search</label>\n\t\t\t\t<input\n\t\t\t\t\tvalue = {this.state.term}\n\t\t\t\t\t// rather than calling directly to the SearchBar props,\n\t\t\t\t\t// call a separate method (below)\n\t\t\t\t\tonChange={ event => this.onInputChange(event.target.value) }\n\t\t\t\t/>\n\t\t\t\t<br/>\n\t\t\t</section>\n\t\t);\n\t}", "function App(){\n return <div><NumberDescriber number=\"1\" event={(text) => alert(text)}>\n Hello , I am a Functional Component !!!\n </NumberDescriber>\n </div>\n}", "componentDidMount() {\n this.props.onSearch(this.props.query);\n }", "componentDidMount() {\n \tthis.props.listenTestataBolla([this.props.match.params.anno, this.props.match.params.mese], this.props.match.params.id); //In modo da acoltare il valore giusto...\t\n }", "render() {\n // in class components as in function component we can access props\n //const { name } = this.props;\n return <p> This is a class component</p>\n }", "componentDidMount() {\n this.performSearch('Fish');\n this.performSearch('Cats');\n this.performSearch('Dogs');\n }", "render() {\n //Whenever the state is updated the render method is called, the result is rendered in CharacterList.\n //Note that a reference to the function is passed.\n const characters = this.state.characters\n return (\n <div>\n <SearchForm searchFn={this.searchFn} />\n {this.state.isJarJar &&\n <h2>Nobody likes Jar Jar binks!</h2>\n }\n\n {characters &&\n <CharacterList characters={characters} />\n }\n\n </div>\n );\n }", "componentDidMount() {\n this.search();\n }", "render() {\n return (\n <div>\n <Input placeholder='Search Here' value={this.state.searchTerm} onChange={this.handleSearch.bind(this)} onBlur={this.handleSearch.bind(this)} />\n <h3>Results:</h3>\n <p> {this.searchFunction(this.state.searchTerm).map(thing => (\n <li>{thing}</li>\n ))}</p>\n </div>\n );\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"search\">\n\t\t\t\t<Autocomplete\n\t\t\t\t\tgetItemValue={(item) => item.symbol}\n\t\t\t\t\titems={this.state.renderData}\n\t\t\t\t\trenderItem={(item, isHighlighted) =>\n\t\t\t\t\t\t<div style={{ background: isHighlighted ? 'lightgray' : 'white' }} key={item.symbol}>\n\t\t\t\t\t\t\t{item.symbol} - {item.name}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t\tvalue={this.state.searchTerm}\n\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\tonSelect={this.handleSelect}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t)\n\t}", "searchWardrobe(query) {\n this.props.searchWardrobe(query.target.value);\n }", "function App() {\n return <Container>\n <Head>\n <AppName><div >React Movie App</div>\n </AppName>\n {/* <SearchBox>\n \n <SearchInput placeholder=\"Search Movie\" /> \n </SearchBox> */}\n </Head>\n \n \n </Container>\n \n \n \n }", "componentDidMount() {\n this.onQuerySubmiT('React development');\n }", "scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }" ]
[ "0.5729474", "0.55795324", "0.55683124", "0.55635256", "0.54626864", "0.54334146", "0.54009145", "0.535205", "0.53415686", "0.53217983", "0.5287848", "0.5252748", "0.52402735", "0.52396387", "0.5231014", "0.520937", "0.5199561", "0.5167802", "0.51661414", "0.5162427", "0.5126418", "0.51220876", "0.51151097", "0.5099912", "0.5095108", "0.508567", "0.5073763", "0.50728124", "0.50580746", "0.50555164", "0.5055271", "0.5047771", "0.5047771", "0.5046024", "0.50436854", "0.5040606", "0.5038107", "0.5036684", "0.50301135", "0.500642", "0.5000207", "0.49927938", "0.49839664", "0.49838713", "0.4980254", "0.4972895", "0.49583533", "0.49554005", "0.4955362", "0.4947322", "0.49469405", "0.4945399", "0.49389827", "0.4938693", "0.49386105", "0.49339938", "0.49338952", "0.49333167", "0.49289846", "0.4923861", "0.4922293", "0.49160334", "0.49124476", "0.49120426", "0.49113873", "0.4891843", "0.4891565", "0.4891557", "0.48895332", "0.48861414", "0.4884411", "0.48800558", "0.48792595", "0.48774123", "0.48725286", "0.48687372", "0.48629373", "0.4860607", "0.4859353", "0.48577586", "0.48576668", "0.48570558", "0.48517212", "0.48445594", "0.48440304", "0.4843968", "0.48430446", "0.48413715", "0.4839819", "0.4836946", "0.48352337", "0.48346177", "0.4832273", "0.48278952", "0.4826303", "0.48196504", "0.48105934", "0.4809351", "0.4801482", "0.48003438", "0.47990686" ]
0.0
-1
The render function opens method(s) below If you want to add things to the signup page Put them in here
render() { const {name, email, password, error, open} = this.state //destructure is a Big O return ( <div className="container"> <h2 className="ml-0 mt-5 mb-5" > Signup </h2> {/*// margin of 5 bottom of 5*/} {/* The error message will be above the form - the light blue stripe*/} {/*condiitonal value is set within the style tag to appear only on error */} <div className="alert alert-danger" style={{display: error ? "" :"none"}}> {error} {/*this is destructured and collects the state value */} </div> <div className="alert alert-info" style={{display: open ? "" :"none"}} > Account created Successfully. Please <Link to="/signin">Sign In</Link> </div> {this.signupForm(name, email, password)} </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n\t\treturn (\n\t\t\t<SignUp\n\t\t\t\t{...this.props}\n\t\t\t\t{...this.state}\n\t\t\t\tonSubmit={this.handleSubmit}\n\t\t\t\tonBack={this.handleCancel}\n\t\t\t\tonChange={this.handleChange}\n\t\t\t\tonRangeChange={this.handleRangeChange}\n\t\t\t\tonUserSelection={this.handleUserSelection}\n\t\t\t\tonCreate={this.createInterest}\n\t\t\t\tonTodoSelection={this.handleJournoInterestSelection}\n\t\t\t\tonCreateCompany={this.createPrCompany}\n\t\t\t\tonCompanySelection={this.handleCompanySelection}\n\t\t\t\tonCreatePosition={this.createPosition}\n\t\t\t\tonPositionSelection={this.handlePositionSelection}\n\t\t\t\tonChangeSelect={this.onSelectOutlet}\n\t\t\t\tchangeInput={this.onInputChange}\n\t\t\t\tfilterCompany={this.filterCompany}\n\t\t\t\tfilterPosition={this.filterPosition}\n\t\t\t/>\n\t\t);\n\t}", "signup(request, response) {\n const viewData = {\n title: \"Login to the Service\",\n };\n response.render(\"signup\", viewData);\n }", "function getFormRegister(request,response) {\n response.render('pages/login/signUp')\n}", "render() {\n\t\treturn this.renderRegisterPage();\n\t}", "function signupForm(req, res) {\n res.render('sign-up.ejs');\n}", "function goSignUp() {\n \n body.innerHTML = renderSignupDiv(first, \n last, email1, pass1, '', message1);\n assignListener('signup2');\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 }", "function studentSignup(req, res){\n res.render(\"signup\", {});\n}", "function renderButton() {\n gapi.signin2.render('signin2', {\n 'scope': 'profile email',\n 'width': 250,\n 'height': 40,\n 'longtitle': true,\n 'theme': 'dark',\n 'onsuccess': onSuccess,\n 'onfailure': onFailure\n });\n\n gapi.signin2.render('registrar-gmail', {\n 'scope': 'profile email',\n 'width': 250,\n 'height': 40,\n 'longtitle': true,\n 'theme': 'dark',\n 'onsuccess': onSuccess,\n 'onfailure': onFailure\n });\n}", "function renderSignupPage() {\n return `\n\t<section class=\"signup-page-screen\" aria-live=\"assertive\">\n\t\t\t<form role=\"form\" class=\"signup\">\n\t\t\t\t<fieldset name=\"signup-info\">\n\t\t\t\t\t<div class=\"login-header\">\n <legend>Sign Up</legend>\n <hr class=\"style-two\">\n\t\t\t\t </div>\n\t\t\t\t <p id='notification'></p>\n\t\t\t\t\t<label for=\"email\" required>Email</label>\n\t\t\t\t\t<input type=\"email\" name=\"email\" id=\"email\" placeholder=\"Email address\" required=\"\">\n\t\t\t\t\t<label for=\"password\" required>Password</label>\n\t\t\t\t\t<input type=\"password\" name=\"password\" id=\"password\" placeholder=\"Password\" required>\n\t\t\t\t\t<label for=\"password-confirm\" required>Confirm password</label>\n\t\t\t\t\t<input type=\"password\" name=\"password\" id=\"password-confirm\" placeholder=\"Confirm password\" required >\n\t\t\t\t</fieldset>\n\t\t\t\t<button type=\"submit\" class=\"js-signup-button\">Sign up</button>\n <p>Already have an account? <a href=\"#\" class=\"nav-login\">Log in</p></a>\n\t\t\t</form>\n\t\t</section>\n\t`;\n}", "createAccount(req,res){\n res.render('user/signup.ejs');\n }", "function handleSignUp(e) {\n setVisible(false);\n setSignUp('true');\n }", "render(){\n return(\n <div>\n {this.state.name}<br />\n {this.state.email}<br />\n {this.state.password}<br />\n {this.state.logEmail}<br />\n {this.state.logPassword}<br />\n <br />\n \n SignUp check\n \n </div>\n )\n }", "render() {\n return (\n <div>\n <Signup />\n </div>\n );\n }", "function showRegister() {\n clearErrorMsg();\n showLinks(['loginLink']);\n showView('registerForm');\n}", "function showRegister(req, res){\n \n var userstat_si_so=\"<a class=\\\"index\\\" id=\\\"signin\\\" href=\\\"/login\\\">התחבר</a>\";\n var userstat_su_un=\"<a class=\\\"index\\\" id=\\\"signup\\\" href=\\\"/register\\\">הרשם</a>\"+\" | \";\n \n //check if the user is conected\n if (req.isAuthenticated()){\n userstat_su_un = \" שלום \"+req.user.local.username+\" | \";\n userstat_si_so = \"<a class=\\\"index\\\" id=\\\"signout\\\" href=\\\"/logout\\\">התנתק</a>\";\n \n res.render('pages/register', {message: req.flash('signupMessage'),userstat_su_un:userstat_su_un ,userstat_si_so:userstat_si_so});\n// ,'errors: req.flash('errors')});\n // res.render('pages/register', {userstat_su_un:userstat_su_un ,userstat_si_so:userstat_si_so,\n // errors: req.flash('errors'),message: req.flash('signupMessage')});\n }\n \n // return a view with data in case user didn't connect\n else{\n \n res.render('pages/register', {message: req.flash('signupMessage'), userstat_su_un: userstat_su_un ,userstat_si_so:userstat_si_so });\n// ,errors: req.flash('errors') });\n }\n//\tres.render('pages/register', {\n// \t\terrors: req.flash('errors')\n// \t});\n}", "signUp() {\n I.fillField(this.signupLocators.fullName, 'SignUpOrgAdmin');\n I.fillField(this.signupLocators.email, '[email protected]');\n I.fillField(this.signupLocators.password, 'SECRET123');\n I.fillField(this.signupLocators.confirmPassword, 'SECRET123');\n I.click(this.signupLocators.toggleAgreeToTermsAndConditions);\n I.click(this.signupLocators.signUpRegistration);\n }", "function RegisterForm(){ \n return (\n <div>\n <h1>register form</h1>\n {/* <h3>{street} {city}, {state} {zip}</h3>\n <button >Register</button>\n <button>Close List</button> */}\n </div>\n );\n \n }", "function signUpTemplate() {\n return `<form class=\"signUpForm\" autocomplete=\"on\">\n <div class=\"loginError\"></div>\n <legend class=\"loginRegisterTitle\">Welcome, aboard!</legend>\n <label for=\"username\">USERNAME:</label>\n <input class=\"usernameSignUp\" type=\"text\" name=\"username\" pattern=\".{1,}\" required title=\"1 characters minimum\" required>\n <br>\n <label for=\"password\">PASSWORD:</label>\n <input class=\"passwordSignUp\" type=\"password\" name=\"password\" pattern=\".{10, 72}\" required title=\"10 characters minimum\" required>\n <br>\n <label for=\"firstName\">FIRST NAME:</label>\n <input class=\"firstnameSignUp\" type=\"text\" name=\"firstName\" required>\n <br>\n <label for=\"lastName\">LAST NAME:</label>\n <input class=\"lastnameSignUp\" type=\"text\" name=\"lastName\" required>\n <br>\n <label for=\"email\">EMAIL:</label>\n <input class=\"emailSignUp\" type=\"email\" name=\"email\" required>\n <br>\n <button class=\"loginButton signingUpNewAccount\" type=\"submit\">Submit</button>\n </form>\n <a href=\"#\" id=\"login\"><p class=\"toggleReg\">Login!</p></a>`;\n}", "register(request, response) {\n\t\tresponse.render('auth/register');\n\t}", "render() {\n const { canSubmit, username, displayName, email, password, confirmPassword } = this.state;\n const { handlePrev, handleNext, goToSignIn } = this.props;\n\n return (\n <div className='form-container'>\n <Header title='INSCRIPTION' handlePrev={handlePrev} chevronLeft />\n <form action='/auth/signup' method='post'>\n <Input inputText=\"Nom d'utilisateur\"\n type='text'\n name='username'\n value={username.text}\n onChange={(e) => this.handleChange(e)}\n onBlur={this.checkNamesErrors}\n errForm={username.errForm}\n errMsg={username.errMsg} />\n <Input inputText=\"Nom d'affichage\"\n type='text'\n name='displayName'\n value={displayName.text}\n onChange={(e) => this.handleChange(e)}\n onBlur={this.checkNamesErrors}\n errForm={displayName.errForm}\n errMsg={displayName.errMsg} />\n <Input inputText='Email'\n type='email'\n name='email'\n value={email.text}\n onChange={(e) => this.handleChange(e)} />\n <Input inputText='Mot de passe'\n type='password'\n name='password'\n value={password.text}\n onChange={(e) => this.handleChange(e)}\n onBlur={this.checkPasswordsErrors}\n errForm={password.errForm}\n errMsg={password.errMsg} />\n <Input inputText='Confirmer le mot de passe'\n type='password'\n name='confirmPassword'\n value={confirmPassword.text}\n onChange={(e) => this.handleChange(e)}\n onBlur={this.checkPasswordsErrors}\n errForm={confirmPassword.errForm}\n errMsg={confirmPassword.errMsg} />\n <Button\n // disabled={!canSubmit}\n buttonText='Créer un compte'\n // onClick={handleNext}\n type='submit'\n chevronRight />\n </form>\n <p className='sign-link' onClick={goToSignIn}>Déjà enregistré? Se connecter</p>\n </div>\n )\n }", "afterRender() {\n document.forms['signupForm'].addEventListener('submit', (e) => {\n e.preventDefault();\n\n const birthDate = new Date(e.target.elements['birthDate'].value);\n const userData = {\n email: e.target.elements['email'].value,\n password: e.target.elements['password'].value,\n nickname: e.target.elements['nickname'].value,\n first_name: e.target.elements['firstName'].value,\n last_name: e.target.elements['lastName'].value,\n phone: e.target.elements['phone'].value,\n gender_orientation: e.target.elements['gender'].value,\n city: e.target.elements['city'].value,\n country: e.target.elements['country'].value,\n date_of_birth_day: birthDate.getDate(),\n date_of_birth_month: birthDate.getMonth() + 1,\n date_of_birth_year: birthDate.getFullYear(),\n };\n\n // prevent sending an http-request to the server if not all user data is provided\n for (let key in userData) {\n if (!userData[key]) return;\n }\n\n this._authService.signup(userData)\n .then((response) => {\n console.log(response);\n })\n .catch((err) => {\n console.log(err);\n });\n });\n }", "function showSignupPage(){\n showPagesHelper(\"#signUpPage\");\n}", "function displaySignupPage() {\n // create variable that holds the render sign up html\n const signupPage = renderSignupPage();\n $(\".landing-page\").prop(\"hidden\", true);\n // select main-page and display html from signup variable that holds the function\n $(\"#main-page\").html(signupPage);\n}", "function createUserScreen(){\n const view = document.createElement('div');\n view.setAttribute('class','signInView');\n\n let inputs = {};\n ['name','email address','password','confirm password'].forEach(function (label){\n inputs[label] = appendLabel(view, label, 'register');\n })\n\n let termsClicked = true;\n\n const terms = document.createElement('div');\n terms.setAttribute('class','termsField');\n view.appendChild(terms);\n\n const termsButton = document.createElement('img');\n termsButton.setAttribute('class','termsButton');\n terms.appendChild(termsButton);\n\n const termsText = document.createElement('div');\n termsText.setAttribute('class','termsText');\n termsText.innerHTML = 'I have read and accept Bespin FM\\'s <a href=\"../terms.html\" target=\"_blank\" id=\"terms\" ' +\n 'class=\"terms\">Terms and Conditions</a>';\n terms.appendChild(termsText);\n\n terms.onclick = function (){\n termsClicked = !termsClicked;\n if (termsClicked){\n termsButton.src = 'media/check.png';\n termsButton.style.backgroundColor = '#a2d7f1';\n }\n else{\n termsButton.src = 'media/check_faded.png';\n termsButton.style.backgroundColor = 'white';\n }\n }\n terms.click();\n\n const submit = document.createElement('div');\n submit.setAttribute('class','signInSubmit');\n submit.textContent = 'Submit';\n view.appendChild(submit);\n\n submit.onclick = function (){\n createUser(inputs['name'].value,inputs['email address'].value,inputs['password'].value);\n }\n\n return view;\n}", "render(){\n return (\n\n <form>\n <label>\n Name:\n <input type=\"text\" name=\"name\" placeholder=\"Full Name\" onChange={this.registerUser}/>\n </label>\n <label>\n Specialty:\n <input type=\"text\" name=\"specialty\"\n placeholder=\"Profession/work\" onChange={this.registerUser}/>\n </label>\n <label>\n Location:\n <input type=\"text\" name=\"tag\" placeholder=\"i.e. Uptown, Chicago\" onChange={this.registerUser}/>\n </label>\n <label>\n Contact:\n <input type=\"text\" name=\"tag\"\n placeholder=\"email/phone number\" onChange={this.registerUser}/>\n </label>\n <input type='submit'/>\n </form>\n\n\n )\n }", "render() {\n return (\n <div className=\"signup_reg_page\">\n <form className=\"Form\" onSubmit={this.handleSubmit}>\n <h2>Login to your account</h2>\n <hr />\n <h3> Sign In to Get access to the shops. </h3>\n <div className=\"form-group \">\n <label htmlFor=\"email\">Email address</label>\n <input\n type=\"email\"\n className=\"form-control\"\n name=\"email\"\n placeholder=\"Email\"\n value={this.state.email}\n onChange={this.handleUserInput}\n />\n </div>\n <div className=\"form-group \">\n <label htmlFor=\"password\">Password</label>\n <input\n type=\"password\"\n className=\"form-control\"\n name=\"password\"\n placeholder=\"Password\"\n value={this.state.password}\n onChange={this.handleUserInput}\n />\n </div>\n <div>\n <button\n type=\"submit\"\n name=\"signin\"\n className=\"btn btn-primary\"\n disabled={!this.state.formValid}\n >\n {\" \"}\n Sign In{\" \"}\n </button>\n </div>{\" \"}\n <FormErrors formErrors={this.state.formErrors} />\n <hr className=\"Form\" />\n <h5>\n Not register yet <Link to=\"/signup\">Sign UP</Link>\n </h5>\n </form>\n </div>\n );\n }", "function handleRegister() {\n navigation.navigate('SignUp');\n }", "render() {\n const { value } = this.state;\n if (this.state.finished) {\n return <Redirect to=\"/userhome\"/>;\n }\n return (\n <Container className=\"signup-format\">\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\" inverted>\n <p className=\"consistent-font\">Register your account</p>\n </Header>\n <Form onSubmit={this.handleSubmit} color='black' inverted>\n <Segment stacked inverted>\n <Form.Input\n label=\"Email\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"email\"\n type=\"email\"\n placeholder=\"E-mail address\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Password\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <Form.Field>\n <Dropdown placeholder='Are you a customer or a vendor?'\n name=\"role\"\n type=\"role\"\n fluid\n selection\n options={roleOption}\n value={value}\n onChange={this.handleChange}/>\n </Form.Field>\n <Form.Button content=\"Submit\"/>\n </Segment>\n </Form>\n <Message className=\"consistent-font\" color='black' inverted=\"true\">\n Already have an account? Login <Link to=\"/signin\">here</Link>\n </Message>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Registration was not successful\"\n content={this.state.error}\n />\n )}\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "signup(e) {\n e.preventDefault();\n signupUser(this.state.email, this.state.password);\n }", "render() {\n return (\n <div>\n <SignupRender {...this.props} /> \n </div>\n );\n }", "function showSignupForm(req, res){\n\t// render the page and pass in any flash data if it exists\n res.render('pages/signup', { message: req.flash('signupMessage') });\n}", "function signup() {\r\n try {\r\n if (!dw.system.Site.getCurrent().getCustomPreferenceValue(\"emarsysEnabled\")) {\r\n emarsysDisabledTemplate();\r\n return;\r\n }\r\n // clear form\r\n app.getForm('emarsyssignup').clear();\r\n // render the Submit Form\r\n app.getView({\r\n ContinueURL: URLUtils.https('EmarsysNewsletter-SubmitForm')\r\n }).render('subscription/emarsyssignup');\r\n } catch(e) {\r\n errorPage(e);\r\n }\r\n}", "function signup() {\n return (\n <div className=\"bless\" >\n <div className= 'style'>\n <div className= 'style2'>\n <div className= 'box2'>\n <div className= \"row\">\n {/* <img src ={picture} width=\"300px\" alt=\"woman\"/> */}\n </div>\n <form>\n <h2 style={{color:'red'}}>Create Account</h2>\n\n <labe for=\"fname\">First Name:</labe><br/>\n <input type=\"text\" id=\"fname\" className=\"form-group\" /><br/>\n\n <label for=\"lname\">Last Name:</label><br/>\n <input type=\"text\"id=\"lname\" className=\"form-group\" /><br/>\n\n <label for=\"email\">Email:</label><br/>\n <input type=\"email\" id=\"email\" className=\"form-group\" /><br/>\n\n <label for=\"password\">Password:</label><br/>\n <input type=\"password\"id=\"password\" className=\"form-group\" /><br/>\n </form>\n <button style={{color:'blue'}}>Signup</button>\n </div>\n </div>\n </div>\n </div>\n )\n}", "render() {\n return (\n <div>\n <h4>Signup</h4>\n <TextField name=\"name\" floatingLabelText=\"Name\" value={this.state.name} onChange={this.setProperty} errorText={this.usernameValid()}/>\n <TextField name=\"email\" floatingLabelText=\"Email\" value={this.state.email} onChange={this.setProperty}/>\n <TextField name=\"password\" floatingLabelText=\"Password\" type=\"password\" value={this.state.password} onChange={this.setProperty}/>\n <RaisedButton label=\"Sign Up\" onClick={this.signUp}/>\n <pre>{JSON.stringify(this.state.response, null, 2)}</pre>\n <ButtonLink to=\"/welcome\">Back</ButtonLink>\n </div>\n )\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"new-user-form\">\n\t\t\t\t<Form>\n\t\t\t\t\t<Form.Input\n\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tplaceholder=\"User Name\"\n\t\t\t\t\trequired />\n\t\t\t\t\t<Button id=\"create-user-button\" type=\"submit\">*</Button>\n\t\t\t\t</Form>\n\t\t\t</div>\n\t\t\t)\n\t\t//Need to ensure that this button is actually used for game creation, not just ROOM creation\n\t}", "function SignUpButton () {\n return (\n <div id=\"my-signin2\"></div>\n );\n}", "function gplus_render() {\n\n\t// Additional params including the callback, the rest of the params will\n\t// come from the page-level configuration.\n\tvar additionalParams = {\n\t\t'callback': signinCallback,\n\t\t'clientid': ae_globals.gplus_client_id,\n\t\t'cookiepolicy': 'single_host_origin',\n\t\t'requestvisibleactions': 'http://schema.org/AddAction',\n\t\t'scope': 'https://www.googleapis.com/auth/plus.login'\n\t};\n\n\t// Attach a click listener to a button to trigger the flow.\n\tif(currentUser.ID == 0){\n\t\tvar signinButton = document.getElementById('signinButton');\n\t\tsigninButton.addEventListener('click', function() {\n\t\t\tgapi.auth.signIn(additionalParams); // Will use page level configuration\n\t\t});\n\t}\n}", "render() {\n //put the state in the variable; instead of using this.state for each variable\n const {username, password, firstname, lastname, email, phone, address} = this.state\n return (\n <div class=\"form-container\">\n <form>\n <div style={{ marginTop: 100 }}>\n <h3>User Registration</h3>\n </div>\n <div>\n <label>First Name</label>\n <input type = \"text\" value={firstname} onChange={this.handlerFirstnameChange}/>\n </div>\n <div>\n <label>Username</label>\n <input type = \"text\" value={username} onChange={this.handlerLastnameChange}/>\n </div>\n <div>\n <label>Phone no. </label>\n <input type = \"text\" value={phone} onChange={this.handlerPhoneChange}/>\n </div>\n <div>\n <label>Email </label>\n <input type = \"text\" value={email} onChange={this.handlerEmailChange}/>\n </div>\n <div>\n <label>Address </label>\n <input type = \"text\" value={address} onChange={this.handlerAddressChange}/>\n </div>\n <div>\n <label>Password </label>\n <input type = \"password\" value ={password} onChange={this.handlerPasswordChange}/>\n </div>\n <button onClick={this.handleSubmit}>Submit</button>\n <button onClick={this.handleHome}>Home</button>\n </form>\n </div>\n );\n }", "render(){\n //generate props to pass to UI\n const props = this._generateProps()\n\n return( <SignupForm { ...props } submitHandler = {this.submitHandler} handleChange = {this.handleChange}/>);\n }", "function renderButton() {\n gapi.signin2.render('my-signin2', {\n 'scope': 'profile',\n 'width': 240,\n 'height': 50,\n 'longtitle': true,\n 'theme': 'dark',\n 'onsuccess': onSuccess,\n 'onfailure': onFailure\n });\n}", "function renderUserPage(type) {\n switch (type) {\n case 'register':\n return [\n '<section>',\n '<h2>Registreren</h2>',\n '<form method=\"post\" action=\"/user/register\" class=\"user-form\">',\n '<fieldset>',\n '<label>',\n 'Gebruikersnaam',\n '<input type=\"text\" name=\"username\">',\n '</label>',\n '<label>',\n 'Wachtwoord',\n '<input type=\"password\" name=\"password\">',\n '</label>',\n '<label>',\n 'Herhaal wachtwoord',\n '<input type=\"password\" name=\"passwordcopy\">',\n '</label>',\n '<input type=\"submit\">',\n '</fieldset>',\n '<fieldset>',\n '<p>Al een account? <a href=\"/user/login\">Log in</a>!</p>',\n '</fieldset>',\n '</form>',\n '</section>'\n ].join('\\n');\n break;\n case 'login':\n return [\n '<section>',\n '<h2>Inloggen</h2>',\n '<form method=\"post\" action=\"/user/login\" class=\"user-form\">',\n '<fieldset>',\n '<label>',\n 'Gebruikersnaam',\n '<input type=\"text\" name=\"username\">',\n '</label>',\n '<label>',\n 'Wachtwoord',\n '<input type=\"password\" name=\"password\">',\n '</label>',\n '<input type=\"submit\">',\n '</fieldset>',\n '<fieldset>',\n '<p>Nog geen account? <a href=\"/user/register\">Registreer</a>!</p>',\n '</fieldset>',\n '</form>',\n '</section>'\n ].join('\\n');\n break;\n }\n}", "function signUpUser(email, password, pet_types, pet_names) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n pet_types: pet_types,\n pet_names: pet_names\n }).then(function (data) {\n window.location.replace('/');\n // If there's an error, handle it by throwing up a boostrap alert\n\n //hide or empty the add member button and the new member form after creating a member\n\n $(\"button#newMembers\").hide();\n\n\n\n\n }).catch(handleLoginErr);\n\n }", "render() {\n let pages;\n if (this.state.loggedIn) {\n return <Redirect to={{ pathname: '/homepage', state: { username: this.state.username, password: this.state.password } }} />\n } else {\n pages =\n <div className=\"signupArea\">\n <div className=\"login-container\">\n <div className=\"login-header\">Create An Account</div>\n <form action=\"/signup\" className=\"userInfo\">\n <div className=\"text-field\">\n <input className=\"username\" type=\"text\" placeholder=\"username\" onChange={e => { this.setState({ username: e.target.value }) }}></input>\n </div>\n <div className=\"text-field\">\n <input className=\"password\" type=\"password\" placeholder=\"password\" onChange={e => { this.setState({ password: e.target.value }) }}></input>\n </div>\n <br />\n <button className=\"loginbtn\" type=\"submit\" value=\"createUser\" onClick={e => { e.preventDefault(); this.updateData()}}>Sign Up</button>\n </form>\n </div>\n </div>\n };\n return <div>{pages}</div>\n }", "function renderRegister(req, res) {\n if (! auth.isAuthenticated(req)) {\n //Show the registration form.\n res.render('register', {\n message: getFlashFromReq(req),\n next: req.query.next,\n title: 'Ready to play?',\n mode: 'register'\n });\n }\n else if (User.isGuest(req.user.username)) {\n //Show the 'conversion' form.\n res.render('register', {\n message: getFlashFromReq(req),\n next: req.query.next,\n title: 'Ready to play?',\n mode: 'convert'\n });\n }\n else {\n //Redirect to 'next' URL (or base page).\n res.redirect(req.query.next || base_page);\n }\n}", "getCreateAccountPage() {\n return <CreateAccount\n onSignIn={this.onSignIn}\n client={this.props.client}\n />;\n }", "function handleSignUpBtnClick() {\n console.log(\"signup clicked\");\n }", "goToSignupPage() {\n Linking.openURL('https://signup.sbaustralia.com');\n //Actions.signup();\n }", "render() {\n return (\n <SignUpForm\n onSubmit={this.processForm}\n onChange={this.changeUser}\n errors={this.state.errors}\n user={this.state.user}\n />\n );\n }", "create({view}) {\n \n return view.render('user.create')\n }", "render() {\n return (\n <StyledDiv className=\"Signup\">\n <h2>Advisor Sign Up</h2>\n <form onSubmit={this.signUp}>\n \n <StyledBox\n type=\"text\"\n name=\"name\"\n value={this.state.credentials.name}\n onChange={this.handleChange}\n placeholder=\"Name\"\n className=\"sign-up-input\"\n />\n <StyledBox\n type=\"text\"\n name=\"username\"\n value={this.state.credentials.username}\n onChange={this.handleChange}\n placeholder=\"Username\"\n className=\"sign-up-input\"\n />\n <StyledBox\n type=\"password\"\n name=\"password\"\n placeholder=\"Password\"\n value={this.state.credentials.password}\n onChange={this.handleChange}\n className=\"sign-up-input\"\n />\n <StyledBox \n type=\"text\"\n name=\"geo\"\n value={this.state.credentials.geo}\n onChange={this.handleChange}\n placeholder=\"Geographic Location\"\n className=\"sign-up-input\"\n />\n <StyledBox \n type=\"text\"\n name=\"area\"\n value={this.state.credentials.area}\n onChange={this.handleChange}\n placeholder=\"Area of Expertise\"\n className=\"sign-up-input\"\n />\n <StyledPress className=\"signup-btn\">Sign Up</StyledPress>\n \n </form>\n \n <StyledLink to= \"signup\">Click here to sign up as an advisee!</StyledLink>\n </StyledDiv>\n )\n }", "async create ({ view }) {\n return view.render('user.create')\n }", "register() {\n this.jquery(\"#register\").on(\"click\", function (event) {\n event.preventDefault();\n navigateTo(\"/sign\");\n });\n }", "render() {\n return (\n <div>\n <div className='container'>\n <div className='form-div'>\n <center>\n <h1><b>SignUp</b></h1>\n </center>\n <form onSubmit={this.onSubmit}>\n <input type=\"text\"\n placeholder=\"Full Name\"\n onChange={this.changeFullName}\n value={this.state.fullName}\n className='form-control form-group'\n />\n <input type='text'\n placeholder='Username'\n onChange={this.changeUserName}\n value={this.state.username}\n className=\"form-control form-group\"\n />\n\n <input type='email'\n placeholder='Email'\n onChange={this.changeEmail}\n value={this.state.email}\n className=\"form-control form-group\"\n />\n\n <input type='password'\n placeholder='Password'\n onChange={this.changePassword}\n value={this.state.password}\n className=\"form-control form-group\"\n />\n\n <input type='submit' className=\"'btn btn-danger btn block\" value='Submit' />\n\n </form>\n </div>\n </div>\n </div>\n );\n }", "render() {\n\n if(UserStore._id) return <Redirect to=\"/\" />\n\n return (\n <div className=\"full-page\">\n <div className=\"form-container mx-auto my-md-5 pt-5\">\n <h1 className=\"mb-4\">SignIn</h1>\n <input\n type=\"email\"\n value={SignUpStore.email}\n onChange={evt => SignUpStore.handleInputChange('email', evt.target.value)}\n className=\"input\"\n placeholder=\"E-Mail\"\n />\n <br />\n <br />\n <input\n type=\"password\"\n value={SignUpStore.password}\n onChange={evt => SignUpStore.handleInputChange('password', evt.target.value)}\n className=\"input\"\n placeholder=\"Password\"\n />\n <br />\n <br />\n <button className=\"button\" onClick={() => {\n SignUpStore.sign('in').then(data => { this.props.history.push(\"/\")})\n }}>\n Sign In\n </button>\n <br />\n <br />\n <p>{SignUpStore.error}</p>\n {/* Displays the error when there is one */}\n <Link className=\"link\" to=\"/auth/sign-up\">\n Don't have an account yet? Sign up instead!\n </Link>\n </div>\n </div>\n )\n }", "renderRegistration()\n {\n return (\n <div id=\"registration\">\n <Registration\n callback={this.registerCallback}\n />\n </div>\n );\n }", "renderPage() {\n return (\n <div id=\"signup-page\" style={{width: \"40rem\"}}>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">\n Edit my info\n </Header>\n <Form onSubmit={this.submit}>\n <Segment stacked>\n <Form.Input\n label=\"Name\"\n id=\"signup-form-password\"\n name=\"name\"\n placeholder=\"Your name\"\n onChange={this.handleChange}\n value={this.state?.name}\n disabled\n />\n <Form.Group widths=\"equal\">\n <Form.Field\n label=\"Gender\"\n control=\"select\"\n onChange={this.genderOnChange}\n value={this.state?.gender}\n >\n <option value=\"male\">Male</option>\n <option value=\"female\">Female</option>\n </Form.Field>\n </Form.Group>\n <Form.Group>\n <label>Are you vaccinated?</label>\n <Form.Radio\n label=\"Yes\"\n value={true}\n name=\"vaccinated\"\n checked={this.state?.vaccinated}\n onChange={this.handleChange}\n />\n <Form.Radio\n label=\"No\"\n value={false}\n name=\"vaccinated\"\n checked={!this.state?.vaccinated}\n onChange={this.handleChange}\n />\n </Form.Group>\n <Form.Input\n label=\"what type of vaccine did you recieve? (optional)\"\n id=\"signup-form-password\"\n name=\"vaccineType\"\n placeholder=\"e.g. Pfizer, Moderna, Johnson and Johnson\"\n value={this.state?.vaccineType}\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"What is the lot number (optional)\"\n id=\"signup-form-password\"\n name=\"vaccineLot\"\n placeholder=\"1001-101\"\n value={this.state?.vaccineLot}\n onChange={this.handleChange}\n />\n <Form.Button\n id=\"signup-form-submit\"\n content=\"Submit\"\n onSubmit={this.submit}\n />\n </Segment>\n </Form>\n </Grid.Column>\n </Grid>\n </div>\n );\n }", "function register(){\n\tusername = document.getElementById('usernameRegister').value;\n\temail = document.getElementById('emailRegister').value;\n\tpassword = document.getElementById('passwordRegister').value;\n\n\tvar registrationData = {\n \t\tdisplayName: username,\n \t\temail : email,\n \t\tpassword: password\n\t};\n\n\tvar newUser = new Stamplay.User().Model;\n\tnewUser.signup(registrationData).then(function(){\n\t\tdocument.getElementById('usernameRegister').value = \"\";\n\t\tdocument.getElementById('emailRegister').value = \"\";\n\t\tdocument.getElementById('passwordRegister').value = \"\";\n\t\twindow.location = \"home.html\";\n\t});\n}", "function show() {\n\n var wrapper = $(document).find('#quick-sign-up-wrapper');\n var partial = quickSignUpPartial.replace('*|base-app-url|*', config.baseAppUrl);\n wrapper.empty().append(partial);\n\n }", "signIn(signUp) {\n this.setState({signingIn: \"flex\", createUser: signUp})\n }", "signUp() {\n\t\tipcRenderer.send('openSignUp', true);\n\t}", "function returningUserScreen(){\n const view = document.createElement('div');\n view.setAttribute('class','signInView');\n\n let inputs = {};\n ['email address','password'].forEach(function (text){\n const label = appendLabel(view,text,'sign in');\n inputs[text] = label;\n label.onkeypress = function (e){\n if (e.key === 'Enter'){\n submit.click();\n }\n }\n })\n\n const forgot = document.createElement('div');\n forgot.setAttribute('class','forgotten');\n forgot.textContent = 'forgotten password?';\n view.appendChild(forgot);\n\n const submit = document.createElement('div');\n submit.setAttribute('class','signInSubmit');\n submit.textContent = 'Sign In';\n view.appendChild(submit);\n\n submit.onclick = function (){\n attemptSignIn(inputs['email address'].value,inputs['password'].value);\n }\n\n return view;\n}", "render() {\n\n\n\n\t\treturn (\n\t\t\t<div className=\"row valign-wrapper\">\n\t\t\t\t\n\n\t\t\t\t<div className=\" card col s5\">\n\n\t\t\t\t\t<div className=\"row center\"> Already a member? Login</div>\n\n\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t\t<input type=\"text\" name=\"loginEmail\" value={this.state.loginEmail} onChange={this.handleChange.bind(this)} className=\"cursiveFont col s8 offset-s2\" placeholder=\"email\"/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t <input type=\"password\" name=\"loginPassword\" value={this.state.loginPassword} onChange={this.handleChange.bind(this)} className=\"cursiveFont col s8 offset-s2\" placeholder=\"password\"/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\n\n\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t <a onClick={this.handleLogin} className=\"waves-effect waves-light btn flat col s4 offset-s4\">Login</a>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"row center\">\n\t\t\t\t\t\t {this.state.loginMessage}\n\t\t\t\t\t</div>\n\n\t\t\t\t</div>\n\n\n\t\t\t\t<div className=\"col s5 card offset-s1\">\n\n\t\t\t\t\t\t<div className=\"row center\"> New member? Signup</div>\n\n\t\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t\t\t<input type=\"text\" name=\"signupEmail\" value={this.state.signupEmail} onChange={this.handleChange.bind(this)} className=\"cursiveFont col s8 offset-s2\" placeholder=\"email\"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t\t <input type=\"password\" name=\"signupPassword\" value={this.state.signupPassword} onChange={this.handleChange.bind(this)} className=\"cursiveFont col s8 offset-s2\" placeholder=\"password\"/>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t\t <input type=\"text\" name=\"signupUsername\" value={this.state.signupUsername} onChange={this.handleChange.bind(this)} className=\"cursiveFont col s8 offset-s2\" placeholder=\"username\"/>\n\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t <a onClick={this.handleSignup} className=\"waves-effect waves-light btn flat col s4 offset-s4\">Signup</a>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"row center\">\n\t\t\t\t\t\t\t {this.state.signupMessage}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\n\n\t\t\t\t</div>\n\n\n\t\t\t</div>\n\n\n\t\t);\n\t}", "function registerPage() {\n\t\tsignPg.style.display = \"none\"\n\t\tregPg.style.display = \"block\";\n\t\tmyOutput.style.display = \"none\";\n\n\t\t//Create the captcha\n\t\tgenerateCaptcha();\n\t}", "render() {\n return (\n <div className=\"registration-page\">\n\n <RegisterForm \n handleChanges={this.handleChanges}\n submitLogin={this.handleSubmit}\n login={this.state.login}\n />\n\n <div className=\"view-bottom-image\">\n <img src=\"../images/refugee7.png\" alt=\"Syrian Refugees coming ashore in a boat\"/>\n </div>\n\n </div> \n );\n }", "render() {\n return (\n <Container>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">\n Register your account\n </Header>\n <Form onSubmit={this.handleSubmit}>\n <Segment stacked>\n <Form.Input\n label=\"First Name\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"firstName\"\n type=\"text\"\n placeholder=\"First Name\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Last Name\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"lastName\"\n type=\"text\"\n placeholder=\"Last Name\"\n onChange={this.handleChange}\n />\n <Form.Select fluid label='Student or Faculty' options={sf_options} placeholder='Student or Faculty'/>\n <Form.Select fluid label='Proficiency' options={prof_options} placeholder='Native Speaker or Learning'/>\n <Form.TextArea\n label=\"Description\"\n name=\"desc\"\n placeholder=\"Tell us about yourself..\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Email\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"email\"\n type=\"email\"\n placeholder=\"[email protected]\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Password\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <Form.Button content=\"Submit\" />\n </Segment>\n </Form>\n <Message>\n Already have an account? Login <Link to=\"/signin\">here</Link>\n </Message>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Registration was not successful\"\n content={this.state.error}\n />\n )}\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "function displayRegister() {\n Reddcoin.messenger.getReddidStatus(function(data){\n Reddcoin.popup.updateRegister({action: 'open'});\n Reddcoin.popup.updateRegister({registration: data});\n });\n}", "render () {\n return (\n <a href=\"#\" className=\"btn btn-default btn-lg\" onClick={this.handler} id=\"btnSignup\">Sign Up</a>\n )\n }", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<form onSubmit={this.handleSubmit}>\t\t\t \n\t\t\t\t <label>\n\t\t\t\t Email:\n\t\t\t\t <input id=\"username\" type=\"text\" name=\"email\" onKeyUp={this.handleChange} />\n\t\t\t\t </label>\n\t\t\t\t <label>\n\t\t\t\t Password:\n\t\t\t\t <input id=\"password\" type=\"password\" name=\"password\" onKeyUp={this.handleChange} />\n\t\t\t\t </label>\n\t\t\t\t <input type=\"submit\" value=\"Submit\" />\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t\t);\n\t\t}", "@Bind()\n signUpWithEmailAndPassword() {\n this.setState({ isLoading: true });\n\n const { history } = this.props;\n const { name, email, password } = this.state;\n\n authStore.signUp(name, email, password).then(() => {\n history.push(SIGN_IN);\n }) \n }", "renderExtraFields() {\r\n if (this.props.formType === \"Sign Up\") return (\r\n <>\r\n <label htmlFor=\"form-email\">Email:</label>\r\n <input id=\"form-email\" type=\"email\"\r\n placeholder=\"Email\"\r\n //value={this.state.email}\r\n onChange={this.handleChange(\"email\")}\r\n />\r\n\r\n <label htmlFor=\"form-firstName\">First Name:</label>\r\n <input id=\"form-firstName\" type=\"text\"\r\n placeholder=\"First name\"\r\n //value={this.state.firstName}\r\n onChange={this.handleChange(\"firstName\")}\r\n />\r\n\r\n <label htmlFor=\"form-lastName\">Last Name:</label>\r\n <input id=\"form-lastName\" type=\"text\"\r\n placeholder=\"Last name\"\r\n //value={this.state.lastName}\r\n onChange={this.handleChange(\"lastName\")}\r\n />\r\n </>\r\n );\r\n }", "render() {\n const options = [\n { key: 'm', text: 'Mānoa', value: 'Mānoa' },\n { key: 'h', text: 'Hilo', value: 'Hilo' },\n { key: 'ha', text: 'Hawaiʻi', value: 'Hawaiʻi' },\n { key: 'ho', text: 'Honolulu', value: 'Honolulu' },\n { key: 'k', text: 'Kapiʻolani', value: 'Kapiʻolani' },\n { key: 'ka', text: 'Kauaʻi', value: 'Kauaʻi' },\n { key: 'le', text: 'Leeward', value: 'Leeward' },\n { key: 'ma', text: 'Maui', value: 'Maui' },\n { key: 'wi', text: 'Windward', value: 'Windward' },\n { key: 'wo', text: 'West Oʻahu', value: 'West Oʻahu' },\n ];\n\n // if correct authentication, redirect to from: page instead of signup screen\n if (this.state.redirectToReferer) {\n return <Redirect to={'/signin'}/>;\n }\n return (\n <Container>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">\n Register your account\n </Header>\n <Form onSubmit={this.handleSubmit} inverted>\n <Segment stacked inverted>\n <Header as=\"h5\" textAlign=\"center\">\n Account Information\n </Header>\n <Form.Input\n label=\"Email\"\n icon=\"user\"\n iconPosition=\"left\"\n required\n name=\"email\"\n type=\"email\"\n placeholder=\"E-mail address\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Password\"\n icon=\"lock\"\n iconPosition=\"left\"\n required\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"repassword\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"repassword\"\n required\n placeholder=\"repassword\"\n type=\"password\"\n onChange={this.handleChange}\n />\n\n <Header as=\"h5\" textAlign=\"center\">\n Student Information\n </Header>\n <Form.Group widths={'equal'}>\n <Form.Input fluid label='First name' placeholder='First name' name=\"firstName\"\n type=\"firstName\"\n onChange={this.handleChange} required/>\n <Form.Input fluid label='Last name' placeholder='Last name' name=\"lastName\"\n type=\"lastName\"\n onChange={this.handleChange} required/>\n </Form.Group>\n <Form.Group widths={'equal'}>\n <Form.Select\n fluid\n label='Campus'\n options={options}\n required\n placeholder='Campus'\n name=\"campus\"\n type=\"campus\"\n onChange={this.handleChange}\n />\n </Form.Group>\n <Form.Button content=\"Submit\"/>\n </Segment>\n </Form>\n <Message color='black'>\n Have an account with us? <Link to=\"/signin\">Sign in</Link>\n </Message>\n\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Registration was not successful\"\n content={this.state.error}\n />\n )}\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "function Signup() {\n return (\n <Container>\n <div id=\"signupContainer\">\n <div className=\"outside cell medium-3 medium-cell-block center\">\n </div>\n <div id=\"signup-center\" className=\"cell medium-6 medium-cell-block center\">\n <form>\n <div className=\"sign-up-form\">\n <h4 className=\"text-center\">Signup</h4>\n <label for=\"sign-up-form-username\">Username</label>\n <input type=\"text\" className=\"sign-up-form-username\" id=\"sign-up-form-username\" />\n <label for=\"sign-up-form-password\">Password</label>\n <input type=\"text\" className=\"sign-up-form-password\" id=\"sign-up-form-password\" />\n <button type=\"submit\" className=\"sign-up-form-button\">Create Account</button>\n </div>\n </form>\n </div>\n <div className=\"cell medium-3 medium-cell-block center\">\n </div>\n </div>\n </Container>\n )\n}", "renderuser(){\n console.log('The user profile '+String(this.state.authenticate));\n \n switch(this.state.authenticate){\n default: return <Load color='rgb(54, 123, 252)' type='bubbles'/>\n case false: return this.notsignedin();\n case true: return this.userprofile();\n }\n }", "registered(req, res) {\n res.render('user/registered');\n }", "async submitFullSignup(){\n const {signupName, signupEmail, signupPw, signupBirthday, signupCPF, signupPhoneNumber} = this.state\n const data = {signupName, signupEmail, signupPw, signupBirthday, signupCPF, signupPhoneNumber}\n\n const createdAccount = await this.context.signup({...data})\n\n if(createdAccount){\n const logged = await this.context.login(signupEmail, signupPw)\n\n if(logged){\n const {base} = this.props.match.params\n if(base === 'login'){ this.props.history.push('/minhaconta') }\n return\n }\n\n // $('.form-signup').trigger('reset')\n // $('.form-full-signup').trigger('reset')\n\n // $('.form-login').show()\n // $('.form-recovery').hide()\n\n // $('.switcher-login').trigger('click')\n // $('#signup-back').trigger('click')\n\n // alert('Sua conta foi criada com sucesso.')\n }\n\n $('#full-signup .error-message').text(\"Ocorreu um erro. Tente mais tarde.\")\n\n return\n }", "function register(){ // rencer the register screen, hide main\n document.getElementById(\"main\").style.display = \"none\";\n\tlet src = document.getElementById(\"registerTemplate\").innerHTML;\n\tlet template = Handlebars.compile(src);\n\tlet context = {}; // {{ N/A }}\n\tlet html = template(context);\n\trender(html);\n\tlet registerButton = document.getElementById(\"registerButton\");\n\tregisterButton.addEventListener(\"click\", (e) => {\n\t\te.preventDefault();\n\t\tregisterClick();\n\t});\n}", "function signup(req, res) {\n return res.send('Post signUp');\n}", "render() {\n return (\n <div id=\"RegistrationScreen\">\n <div id=\"registrationForm\">\n <h1>BUDGHETTO</h1>\n <form action=\"\" onSubmit={this.handleSubmit}>\n <label htmlFor=\"username\">\n Username\n </label>\n <input defaultValue=\"[email protected]\" type=\"<strong>email</strong>\" id=\"username\" placeholder=\"[email protected]\"></input>\n <label htmlFor=\"password\">\n Password\n </label>\n <input type=\"password\" id=\"password\" pattern=\"^.{3,}$\"></input>\n <label htmlFor=\"repassword\">\n Retype password\n </label>\n <input type=\"password\" id=\"repassword\"></input>\n <input type=\"submit\" id=\"submit\" value=\"Sign up\"></input>\n </form>\n <input type=\"button\" id=\"cancel\" value=\"Cancel\" onClick={ () => browserHistory.push('/') }/>\n </div>\n </div>\n );\n }", "function Register(event) {\n event.preventDefault();\n CollapseElements(error_message);\n\n const agreed_to_terms = sign_form[4].checked;\n console.log(\"Agreed to terms: \" + agreed_to_terms);\n\n if (!agreed_to_terms) {\n ShowFormError(\"You have to agree with Terms of Use.\");\n return;\n }\n\n const email = sign_form[2].value;\n if (!email) {\n ShowFormError(\"Email is empty.\");\n return;\n }\n const user = JSON.parse(localStorage.getItem(email));\n console.log(\"user read : \" + user);\n\n if (user) {\n ShowFormError(\"The user with this email already exists\");\n } else {\n const name = sign_form[0].value;\n const surname = sign_form[1].value;\n const password = sign_form[3].value;\n\n if (\n !CheckIfStringsNotEmpty(\n [\"Name\", \"Surname\", \"Password\"],\n name,\n surname,\n password\n )\n )\n return;\n\n user_data = {\n email: email,\n name: name,\n surname: surname,\n password: HashText(password),\n lists: [],\n };\n\n console.log(\"Hashed password to \" + HashText(password));\n\n try {\n localStorage.setItem(email, JSON.stringify(user_data));\n console.log(\"Registered: \" + email);\n current_user_data = user_data;\n console.log(JSON.stringify(current_user_data));\n SetClassVisible(\"loggedIn\", true);\n SetClassVisible(\"loggedOut\", false);\n ShowDashboard();\n } catch (error) {\n ShowFormError(\"Error while signing up.\");\n console.log(\"Error while signing up: \" + error);\n }\n }\n}", "render() {\n return (\n <View style={{flex: 1, backgroundColor: theme.backgroundColor}}>\n <Text style = {styles.welcome}>\n Signup\n </Text>\n\n {/* This allows the user to input an email address*/}\n\n <TextInput\n placeholder = \"email\"\n keyboardType={'email-address'}\n onChangeText = {(email) => this.setState ({email})}\n value = {this.state.email}\n />\n\n {/* This allows the user to input an username*/}\n\n <TextInput\n placeholder = \"username\"\n onChangeText = {(username) => this.setState ({username})}\n value = {this.state.username}\n />\n\n {/* This allows the user to input their own secure password*/}\n\n <TextInput\n secureTextEntry = {true}\n placeholder = \"password\"\n onChangeText = {(password) => this.setState ({password})}\n value = {this.state.password}\n />\n\n {/* This make sure their password is the same as the one they entered*/}\n <TextInput\n secureTextEntry = {true}\n placeholder = \"confirm password\"\n onChangeText = {(passwordConfirm) => this.setState ({passwordConfirm})}\n value = {this.state.passwordConfirm}\n />\n\n {/* This is a button that sign up the user.*/}\n <Button onPress = {() => this.signUpOnPress(this.props.navigator.push,\n {name: 'MyListView'})}\n > Sign up\n </Button>\n\n {/* This goes to the main login page if the user has an account already*/}\n <Button onPress = {() => this._navigateBack()}>\n Already have an account? Log in\n </Button>\n </View>\n )\n }", "function signupDetails() {\n if(firstName && lastName && email && password){\n\n let data = {\n signupDetails: { firstName, lastName, email, password }\n }\n axios.post(`${serverURL.server_base_URL}/users/signup`, data)\n .then(signupDetails => {\n if (signupDetails.status) {\n dispatch({\n type: \"setUserId\",\n payload: signupDetails.data.user._id,\n })\n navigation.navigate(\"Signin\")\n }\n })\n .catch(err => {\n console.log(\"Error in creating account\", err)\n })\n }\n else{\n alert(\"Please fill out all the fields.\")\n }\n }", "function signup() {\n\n if (usernameAvailabe && numberAvailabe && emailAvailable) {\n fetch('https://desolate-thicket-70111.herokuapp.com/v1/webapi/signup/', {\n method: 'POST', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin' : '*'\n },\n body: JSON.stringify({\n username: username,\n email: email,\n telefoonnummer: telefoonnummer\n }),\n })\n .then(response => response.json())\n .then(data => {\n console.log(data);\n router.push('/aangemeld')\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n } else {\n console.log(\"Dit werkt niet\")\n }\n }", "function renderButton() {\n gapi.signin2.render('gSignIn', {\n 'scope': 'profile email https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly',\n 'width': 240,\n 'height': 50,\n 'longtitle': true,\n 'theme': 'dark',\n 'onsuccess': onLoginSuccess,\n 'onfailure': onLoginFailure\n });\n}", "function register(req, h){\n if(req.state.user){\n return h.redirect('/')\n }\n return h.view('register',{\n title: 'registro',\n user: req.state.user\n })\n}", "function openRegistrationPage() {\n $state.go('triangular.admin-default-no-scroll.registration');\n ToastService.showToast('Please create a account before play');\n }", "render() {\n return (\n <div className='user-info-block'>\n <label className='user-name-label'>{`Name`}</label>\n <div>\n {this.renderUserNameField()}\n </div>\n <label className='user-email-label'>{`Email`}</label>\n <div>\n {this.renderUserEmailField()}\n </div>\n </div>\n );\n }", "function signup() {\n // do something\n}", "handleSignUp() {\n\n // Create a new user and save their information, THEN\n // - Update the display name of the user\n\n // - Return promise for chaining, THEN\n // - Set the state as the current (firebase) user\n\n }", "render(){\n return(\n <Form onSubmit={this.signUp}>\n <Title>Sign up for our newsletter</Title>\n <Input\n onChange={this.handleChange}\n name=\"firstName\"\n type=\"text\"\n placeholder=\"First Name\"\n value={this.state.firstName} />\n <Input\n onChange={this.handleChange}\n name=\"lastName\"\n type=\"text\"\n placeholder=\"Last Name\"\n value={this.state.lastName} />\n <Input\n onChange={this.handleChange}\n name=\"email\"\n type=\"email\"\n placeholder=\"email address\"\n value={this.state.email} />\n <Button>Submit</Button>\n <div>First Name: {this.state.firstName} </div>\n <div>Last Name: {this.state.lastName}</div>\n </Form>\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 }", "function handleSignUp() {\n \n if (email.length < 4 || password.length < 4) {\n setFeedback({color: 'red', message: 'Mailadress/lösenord måste innehålla mer än 4 tecken.'})\n return\n }\n \n // Sign in with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function(value) {\n \n setFeedback({color: 'green', message: \"Skapade ett konto för \" + email})\n create_db_user_doc()\n \n }).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code\n \n if (errorCode === 'auth/email-already-in-use')\n setFeedback({color: 'red', message: 'Ett konto med denna email finns redan.'})\n else if (errorCode === 'auth/weak-password')\n setFeedback({color: 'red', message: 'Lösenordet är för svagt.'})\n })\n }", "function getSignUpUI() {\n fetch('/api/signUp', {\n method: 'GET'\n }).then(response => response.text())\n .then(res => {\n var mainBody = document.getElementById('main-body');\n mainBody.innerHTML = res;\n selectIcon('home');\n });\n}", "signUpUser(data) {\n return this.post('signup', data);\n }", "renderRegister() {\n return (\n <div className=\"col-md-6 log-reg\">\n <h2 className=\"text-center\">Registrarse</h2>\n <form>\n <label className=\"col-form-label col-md-6\">\n Correo\n </label>\n <input name=\"emailReg\" type=\"text\" onChange={this.handleInputChange.bind(this)} value={this.state.emailReg}/>\n <label className=\"col-form-label col-md-6\">\n Contraseña\n </label>\n <input name=\"passwordReg\" type=\"password\" onChange={this.handleInputChange.bind(this)} value={this.state.passwordReg}/>\n <label className=\"col-form-label col-md-6\">\n Confirmar Contraseña\n </label>\n <input name=\"passwordConf\" type=\"password\" onChange={this.handleInputChange.bind(this)} value={this.state.passwordConf}/>\n <div className=\"row justify-content-center align-self-center\">\n <button type=\"button\" className=\"btn-format\" onClick={this.handleRegisterClick.bind(this)}>Registrar</button>\n </div>\n </form>\n </div>\n );\n }", "function handleSignUpButton() {\n $(\".main-area\").on(\"click\", \".nav-signup\", function(e) {\n console.log(\"SignUp button clicked\");\n // stop from form submitting\n e.preventDefault();\n // excute display signup page function that holds the html\n displaySignupPage();\n });\n}", "render(){\n return(\n <div className='Profile'>\n {this.renderuser()}\n </div>\n );\n }", "function loginAndSignUpDisplay (style1, style2) {\n displayContent('login_form', style1)\n displayContent('sign_up_form', style2)\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 return(\n <div className=\"modal-dialog\">\n <div className=\"modal-content\">\n <div className=\"modal-header\">\n <h4 className=\"modal-title\">SIGN UP</h4>\n </div>\n <div className=\"modal-body\">\n <form onSubmit={this.submitForm}>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-eye-open\"></i></span>\n <input type=\"text\" id=\"username\" placeholder=\"USERNAME\" className=\"form-control\"\n onChange={this.handleChange}\n required \n />\n </div>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-user\"></i></span>\n <input type=\"text\" id=\"fullname\" placeholder=\"FULLNAME\" className=\"form-control\"\n onChange={this.handleChange}\n required\n />\n </div>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-envelope\"></i></span>\n <input type=\"email\" id=\"email\" placeholder=\"EMAIL\" className=\"form-control\"\n onChange={this.handleChange}\n required\n />\n </div>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-lock\"></i></span>\n <input type=\"password\" id=\"password\" placeholder=\"PASSWORD\" className=\"form-control\"\n onChange={this.handleChange}\n required\n />\n </div>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-lock\"></i></span>\n <input type=\"password\" id=\"confirmpassword\" placeholder=\"CONFIRM PASSWORD\" className=\"form-control\"\n onChange={this.handleChange}\n required\n />\n </div>\n <br />\n <div className=\"form-group\">\n <input className=\"btn btn-success btn-md\" type=\"submit\" name=\"submit\" id=\"btnsignup\" value=\"CREATE ACCOUNT\" />\n </div> \n </form>\n </div>\n </div>\n </div>\n );\n }" ]
[ "0.7378705", "0.73150885", "0.71624327", "0.70459884", "0.70391893", "0.7010485", "0.69932497", "0.6988795", "0.6946535", "0.6912021", "0.6899727", "0.6857819", "0.6855621", "0.685367", "0.6695107", "0.6692088", "0.66763264", "0.6659908", "0.6630246", "0.66160893", "0.6602883", "0.659455", "0.65916634", "0.6583054", "0.65776205", "0.6561673", "0.6558037", "0.65552324", "0.6537294", "0.65215605", "0.652021", "0.6511549", "0.6507597", "0.6490378", "0.64743936", "0.646445", "0.6453452", "0.6412264", "0.64064705", "0.63942575", "0.63928014", "0.6387354", "0.6380198", "0.6379879", "0.6358888", "0.63093305", "0.6309182", "0.6306983", "0.6278468", "0.6269234", "0.6252079", "0.6241309", "0.62357056", "0.62264466", "0.62114996", "0.6204342", "0.6204067", "0.6180689", "0.6173175", "0.6170776", "0.61691195", "0.61598605", "0.6152993", "0.615026", "0.6150022", "0.6147175", "0.6131536", "0.61300415", "0.6116565", "0.6109364", "0.6107493", "0.6105599", "0.6103501", "0.6103237", "0.6098343", "0.6086922", "0.60825205", "0.60824203", "0.60822505", "0.6078977", "0.60755527", "0.60662395", "0.6065903", "0.60534763", "0.6046542", "0.60437965", "0.60391176", "0.6034055", "0.60305786", "0.601915", "0.6016192", "0.6012343", "0.60117036", "0.6000697", "0.60005444", "0.59983397", "0.5996861", "0.59940827", "0.5985853", "0.59841645" ]
0.61811364
57
If you click on input with same name then minus val and ckecked false
function checkActiveSameNames(context) { $('.form-content input').each(function(i, input) { if ($(input).prop('checked')) { if (context.prop('name') == $(this).prop('name')) { if (context.prop('id') != $(this).prop('id')) { $(this).prop('checked', false); carPrice = carPrice - parseInt($(this).val()); } } } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_element_value() {\n if ( regex.test(this.name) ) {\n $(this).val(nval);\n //log_inline.log('Blanking value [' , nval , '] for input with name: ' , this.name);\n }\n }", "function a(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function canBtnHdlr() {\n\tvar cells = $(this).closest(\"tr\").find(\"input[data-changed=true]\");\n\tif ( cells.length > 0 ) {\n\t\tcells.each( function () { // Restore the old value\n\t\t\t$(this).val( $(this).attr( \"data-oldv\" ) );\n\t\t\t$(this).attr( \"data-changed\", \"false\" );\n\t\t}); // forEach\n\t}\n\t$(this).closest(\"tr\").find(\"input[type=text]\").prop( \"disabled\", true );\n\tchgUpd2Edit( $(this).siblings(\".updBtn\") );\n}", "function inputAdjust(elem, disableIfSame){\r\n\tvar type=elem.type;\r\n\tvar name=elem.name;\r\n\tvar pool = name.split(\"_\"); \r\n\tif (pool.length>3){\r\n\t\tif (pool[3] == \"radio\"){\r\n\t\t\telem.disabled = true;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\tif (!((type==\"checkbox\") || (type==\"radio\"))){\r\n\t\tif (isHInput(type,name)){\r\n\t\t\tvar hostVal;\r\n\t\t\tif (type==\"select-one\"){\r\n\t\t\t\thostVal = getDefaultSelectValue(elem);\r\n\t\t\t} else if (type==\"hidden\"){\r\n\t\t\t\tif (MOZILLA || IEVersion == IE10Version){//bugzilla.mozilla#158209,184732 //SP3c\r\n\t\t\t\t\thostVal = elem.getAttribute(\"initValue\"); \r\n\t\t\t\t}else if (!MAC && !isIEMobile){ \r\n\t\t\t\t\thostVal = elem.defaultValue;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\thostVal = elem.defaultValue;\r\n\t\t\t}\r\n\r\n\t\t\tif (hostVal==null) hostVal=\"\";\r\n\t\t\tvar webVal = elem.value;\r\n\t\t\tif (webVal==null) webVal=\"\";\r\n\r\n\t\t\tvar mdt = isIEMobile?\"0\":elem.getAttribute(\"MDT\"); \r\n\t\t\tif (suppressUnchangedData) mdt = \"0\";\r\n\r\n\t\t\tif (webVal == hostVal && mdt != \"1\"){ \r\n\t\t\t\tif (disableIfSame){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (webVal == \"\" && type == \"hidden\" && window.isDijit && getEnclosingDijitWidget(elem) != null && getEnclosingDijitWidget(elem).declaredClass == \"dijit.form.FilteringSelect\" && getDojoAttr(getEnclosingDijitWidget(elem).valueNode, \"dftVal\")!=null){ \r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t} else \r\n\t\t\t\t\t\tif (MOZILLA || (isIE && !isIEMobile)){\r\n\t\t\t\t\t\t\telem.name=\"disabled\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\telem.disabled=true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ((MAC && isIE) && (type==\"select-one\")){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tvar update = webVal;\r\n\t\t\t\tif (!autoEraseFields){\r\n\t\t\t\t\tif (enableBIDI && (pushMode || isFldreversed) && (elem.style.textAlign == \"right\")){\r\n\t\t\t\t\t\twhile (hostVal.length > update.length){\r\n\t\t\t\t\t\t\tupdate = \" \"+update;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\twhile (hostVal.length > update.length){\r\n\t\t\t\t\t\t\tvar is3270Num = \" \" + elem.alt;\r\n\t\t\t\t\t\t\tif ( is3270Num.indexOf(\"3270Num\") != -1){\t\t\t\r\n\t\t\t\t\t\t\t\tupdate = \"0\"+update;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tupdate = update+\" \";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (type==\"select-one\"){\r\n\t\t\t\t\tif (elem.selectedIndex >= 0){\r\n\t\t\t\t\t\telem.options[elem.selectedIndex].value=update;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (elem.value!=update) elem.value = update;\r\n\t\t\t\t}\r\n\t\t\t\tif (update != webVal){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function inputValueChange(idn){\n\t\t$(\".flexarea\").each(function(i){\n\t\t\tvar changeClass = $(this).find(\".inner\");\n\t\t\tvar iIndex = i+1;\n\t\t\tif(iIndex != idn){\n\t\t\t\t$(this).find(\".inputarea div:nth-child(1) input\").prop(\"checked\",\"checked\");\n\t\t\t\tif(!$(this).has('itemsselect')){\n\t\t\t\t\tdataClass($(this).find(\".inputarea div:nth-child(1) input\"),changeClass);\n\t\t\t\t\t}\n\t\t\t\t$(\".flexarea\").removeClass(\"unselect\");\n\t\t\t\t$(this).addClass(\"unselect\");\t\t\t\n\t\t\t\t}else if(idn == '' || idn == false){\n\t\t\t\t\t$(this).find(\".inputarea div:nth-child(1) input\").prop(\"checked\",\"checked\");// 페이지 초기 로딩시 input checked 초기값 설정;\n\t\t\t\t\t}\n\t\t\t});\n\t\t}", "function disableSameTime (name, name2) {\n const $nameTwo = $(`input[name=${name2}]`);\n if ($(`input[name=${name}]`).is(\":checked\")) {\n $nameTwo.attr(\"disabled\", true);\n $nameTwo.parent().css(\"color\", \"grey\");\n } else {\n $nameTwo.removeAttr(\"disabled\");\n $nameTwo.parent().css(\"color\", \"black\");\n }\n}", "function l(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function l(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function l(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function l(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function l(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function l(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function l(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function l(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function v(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function ceClicked(){\n\t$display.val('');\n\tneedNewNum = true;\n\tnumEntered = false;\n}", "valueChanged() {\n const e = this.innerEdit;\n e && e.value !== this.value && (e.value = this.value);\n }", "function g(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function clearInput(event){\n\tinputName.value=\"\";\n\tinputAmount.value=\"\";\n\tsingleAmount.checked = false;\n\tperlap.checked = false;\n}", "function vider_formulaire(form) {$(':input',form).not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected');}", "function s(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function s(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function checkForChangedFieldValues(e, ContainerInputArray ) {\n var el = document.getElementById(ContainerInputArray[2]);\n var unhide = false;\n if ( el ) {\n if ( el.value != ContainerInputArray[3] ||\n ( el.value == \"\" && el.id != \"alias\") ) {\n unhide = true;\n }\n else {\n var set_default = document.getElementById(\"set_default_\" +\n ContainerInputArray[2]);\n if ( set_default ) {\n if(set_default.checked){\n unhide = true;\n } \n }\n }\n }\n if(unhide){\n YAHOO.util.Dom.addClass(ContainerInputArray[0], 'bz_default_hidden');\n YAHOO.util.Dom.removeClass(ContainerInputArray[1], 'bz_default_hidden');\n }\n\n}", "function enabledInputBrowse(boo, input1, input2, boton) {\r\n\tdocument.getElementById(input1).value = \"\";\r\n\tdocument.getElementById(input2).value = \"\";\r\n\tdocument.getElementById(boton).disabled = !boo;\r\n}", "function U(ac){return function(){var ad=this.element.val();ac.apply(this,arguments);this._refresh();if(ad!==this.element.val()){this._trigger(\"change\")}}}", "function clickAssessmentName() {\n var inputElement=document.getElementById(\"inpt-change-assess-name\");\n\n /*\n if input is active\n want to save the input\n */\n\n if(inputElement!= null){\n console.log('Has input element');\n console.log(inputElement);\n var assessName = $('#assess-name-reorder').attr('value');\n var newName = inputElement.value;\n\n if (newName != null) {\n newName = newName.trim();\n if (newName.length > 0) {\n assessName = newName;\n }\n }\n $('#assess-name-reorder').html(assessName).attr('value', assessName);\n $('#assess-name-reorder').append('<button class=\"btn btn-dark-background rename-btn\"><span class=\"glyphicon glyphicon-edit\"></span></button>');\n\n\n } else {\n /*\n Want to add input element\n display old name as a placeholder\n */\n console.log($('#assess-name-reorder').attr('value'));\n $('#assess-name-reorder').html('<input type=\"text\" id=\"inpt-change-assess-name\">');\n inputElement = document.getElementById(\"inpt-change-assess-name\");\n inputElement.setAttribute('placeholder', $('#assess-name-reorder').attr('value'));\n inputElement.focus();\n $('#inpt-change-assess-name').click(function () {\n\n return false;\n });\n $('#assess-name-reorder').append('<button class=\"btn btn-dark-background rename-btn\"><span class=\"glyphicon glyphicon-edit\"></span></button>');\n\n }\n\n\n}", "function resetInput(event) {\n var node = event.target;\n var expected = node.getAttribute('value');\n if (node.value !== expected) {\n node.value = expected;\n }\n}", "function minusNum(obj){\r\n let value = $(obj).prev().val();\r\n let pIdCart;\r\n if(value > 0){\r\n let pId = $(obj).parents('div[class=items]').attr('id');\r\n pIdCart = pId + 'Cart';\r\n value--;\r\n console.log(pIdCart + \" , \" +$('div#'+pIdCart).attr('id'));\r\n $('div#'+pIdCart).find('input#num').val(value);\r\n }\r\n if(value == 0 ){\r\n $('div#'+pIdCart).remove();\r\n }\r\n \r\n $(obj).prev().val(value);\r\n showSumma();\r\n}", "edit(input, date, description){\n if(input.disabled == true || date.disabled == true){\n input.disabled = !input.disabled;\n date.disabled = !date.disabled;\n }\n \telse{\n input.disabled = !input.disabled;\n date.disabled = !date.disabled;\n }\n }", "function modValue(e){\n e.preventDefault();\n\n // validate btn data\n var $btn = $(this);\n var btnDatas = $btn.data();\n if (!btnDatas[_btnInputId] || !btnDatas[_btnAmount]) {\n throw Error(\"Button must contain data \" + _btnInputId + \" and \" + _btnAmount);\n }\n\n // validate input\n var $input = $('#' + btnDatas[_btnInputId]);\n var inputDatas = $input.data();\n if (!inputDatas[_inputStructureId]) {\n throw Error(\"Input must contain data \" + _inputStructureId);\n }\n\n var value = Number($input.val() || 0);\n\n // btn amount to add/remove\n var amount = btnDatas[_btnAmount];\n\n // modify value\n var newValue = value + amount;\n\n // check max value\n var max = inputDatas[_inputMax];\n if ((max !== undefined) && newValue > max) {\n newValue = max;\n }\n\n // check min value\n var min = inputDatas[_inputMin];\n if ((min !== undefined) && newValue < min) {\n newValue = min;\n }\n\n // if value changes\n if (newValue !== value) {\n $input.val(newValue);\n newValue = Number($input.val());\n\n // mod cookie\n var jCookie = getJCookie(_cookieName);\n var strId = inputDatas[_inputStructureId];\n\n // remove data\n var rmVal = inputDatas[_inputRmValue];\n if (rmVal !== undefined && newValue === rmVal) {\n delete jCookie[_jResources][strId];\n } else {\n // add data\n var jResource = jCookie[_jResources][strId];\n if (!jResource) {\n jResource = {};\n }\n jResource[_jQuantity] = newValue;\n //console.log(\"resource to modify\", jResource);\n\n jCookie[_jResources][strId] = jResource;\n //console.log(\"modified cookie\", jCookie);\n }\n\n saveCookie(jCookie);\n }\n }", "function lockChoice(){\r\n $(\"input\").attr(\"disabled\", true);\r\n}", "input_price_id(field){\n var price_id = $(field).attr(\"id\").split(\"-\")[1];\n $(price_id_field).val(price_id);\n if($(field).is(':checked') == false){\n $(price_id_field).val('');\n }\n }", "function shouldUseClickEvent(elem){ // Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nreturn elem.nodeName==='INPUT'&&(elem.type==='checkbox'||elem.type==='radio');}", "function i(a){return function(){var b=this.element.val();a.apply(this,arguments),this._refresh(),b!==this.element.val()&&this._trigger(\"change\")}}", "function editInsuranceAccepted () {\n var vehicleClassIndependentDriver = document.getElementById('taxi_driver_office_profile_vehicle_vehicleClass');\n var checkboxInsuranceAccepted = document.getElementById('taxi_driver_office_profile_insuranceAccepted');\n\n $(vehicleClassIndependentDriver).change( function(){\n var vehicleClassVal = $(this).val();\n\n if ( vehicleClassVal <= 0) {\n $(checkboxInsuranceAccepted).removeAttr('checked');\n // $(checkboxInsuranceAccepted).attr('checked',false);\n // alert('Мало');\n } else {\n // $(checkboxInsuranceAccepted).attr('checked', 'checked');\n $(checkboxInsuranceAccepted).attr('checked', true);\n // alert('Норм');\n }\n return true;\n });\n \n }", "function triggerSkip(inputToCheck,rightValue,toQnID,toTabID) {\r\n $('input[name=\"'+inputToCheck+'\"]').on('change', function () {\r\n \r\n // textbox, numbers, dates etc\r\n if($('input[name=\"'+inputToCheck+'\"]').attr('type') == 'date' || $('input[name=\"'+inputToCheck+'\"]').attr('type') == 'text' || $('input[name=\"'+inputToCheck+'\"]').attr('type') == 'number'){\r\n var valFromInput = $('input[name=\"'+inputToCheck+'\"]').val();\r\n if(valFromInput == rightValue){\r\n var unDo = false\r\n skipToQn(inputToCheck,toQnID,toTabID,unDo);\r\n }else{\r\n var unDo = true;\r\n skipToQn(inputToCheck,toQnID,toTabID,unDo);\r\n }\r\n }\r\n // END textbox, numbers, dates etc\r\n\r\n // cater for checkbox\r\n if($('input[name=\"'+inputToCheck+'\"]').attr('type') == 'checkbox'){\r\n console.log(\"checkbox with Name: \"+inputToCheck+\" found\");\r\n var valFromInput = '';\r\n $.each($(this), function (chind, eachbx) {\r\n if($(this).is(':checked')){\r\n console.log(\"TICKED checkbox with Name: \"+inputToCheck+\" found\");\r\n var unDo = false;\r\n skipToQn(inputToCheck,toQnID,toTabID,unDo);\r\n }else{\r\n console.log(\"UNDO ticked checkbox with Name: \"+inputToCheck);\r\n var unDo = true;\r\n skipToQn(inputToCheck,toQnID,toTabID,unDo);\r\n }\r\n });\r\n }\r\n // END cater for checkbox\r\n\r\n // cater for radio\r\n if($('input[name=\"'+inputToCheck+'\"]').attr('type') == 'radio'){\r\n console.log(\"radio with Name: \"+inputToCheck+\" found\");\r\n var valFromInput = $('input[name=\"'+inputToCheck+'\"]:checked').val();\r\n console.log(\"valFromInput======> \"+valFromInput);\r\n if(valFromInput === rightValue){\r\n console.log(\"TICKED radio with Name: \"+inputToCheck+\" found\");\r\n var unDo = false;\r\n skipToQn(inputToCheck,toQnID,toTabID,unDo);\r\n }else if(valFromInput !== rightValue){\r\n console.log(\"UNDO tick radio with Name: \"+inputToCheck+\" found\");\r\n var unDo = true;\r\n skipToQn(inputToCheck,toQnID,toTabID,unDo);\r\n }\r\n }\r\n //END cater for radio\r\n });\r\n}", "function bindDisableClick(){\n $('.disable_click').on('click',function(){return false;});\n// $('.disable_click').on('change',function(){return false;});\n}", "function onChangeAut1()\n{\n\tvar value = $(\"#author1\").val();\n\t// Set status of author2 according to value\n\t$(\"#author2\").prop(\"disabled\",(value === \"\") ? true : false);\n}", "checkClearOnEdit(ev) {\n if (!this.clearOnEdit) {\n return;\n }\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput(ev);\n }\n // Reset the flag\n this.didBlurAfterEdit = false;\n }", "clickHandler(event) {\n event.target.value='';\n }", "function value(kuangValue){\n\tvar oldValue=kuangValue.value;\n\t//console.log(oldValue);\n\tkuangValue.onfocus=function(){\n\t\tif(this.value==oldValue){\n\t\t\tthis.value=\"\";\n\t\t}\t\n\t}\n\tkuangValue.onblur=function(){\n\t\tif (this.value==\"\") {\n\t\t\tthis.value=oldValue;\n\t\t};\n\t}\t\n}", "function sjekk() {\n console.log(input)\n\n //disable knappen som blir trykket\n var gjettResultat = false;\n $(\"#\"+input).attr('disabled', 'disabled');\n // var input = inpBokstav.value\n\n for(var x = 0;x<ordArray.length;x++){\n if(input == ordArray[x]){\n $('#t'+x).append(input.toUpperCase());\n gjettResultat = true;\n\n }\n}\n if(gjettResultat){sjekkSvar();}\n else{feil();}\n }", "function sjekk() {\n console.log(input)\n\n //disable knappen som blir trykket\n var gjettResultat = false;\n $(\"#\"+input).attr('disabled', 'disabled');\n // var input = inpBokstav.value\n\n for(var x = 0;x<ordArray.length;x++){\n if(input == ordArray[x]){\n $('#t'+x).append(input.toUpperCase());\n gjettResultat = true;\n\n }\n}\n if(gjettResultat){sjekkSvar();}\n else{feil();}\n }", "function check($event) {\n $event.preventDefault();\n var inputVal = angular.element('#input-1').val();\n if (inputVal) {\n $scope.inputDisabled = true;\n inputVal = parseInt(inputVal);\n if (inputVal === $scope.answer) {\n $scope.scoreboard.up();\n $scope.flag = 1;\n angular.element('.check-btns').addClass('move-disable');\n } else {\n $scope.flag = 0;\n }\n }\n return false;\n }", "function delTextFocus(el){\n\tif(el.value == el.defaultValue){\n\t\tel.value=\"\";\n\t}\n}", "switcherClicked () {\r\n this.$emit('input', !this.value)\r\n }", "function checkvalue (event) {\n \n var value = $(\"#\" + this.event.target.id).val();\n var Id = this.event.target.id.replace('AirlineParameterValue', 'ParameterType');\n var idNo = this.event.target.id.split('_')[2]\n //var Remarks =$('#tblAirlineParameterTrans_ParameterRemarks_'+idNo).val();\n //if (Remarks == \"\" && this.event.target.id.indexOf('ParameterRemarks_')==-1) {\n // $('#tblAirlineParameterTrans_ParameterRemarks_'+idNo).attr('required', 'required');\n // $('#tblAirlineParameterTrans_ParameterRemarks_'+idNo).attr('data-valid-msg', 'Remarks are Required');\n // ShowMessage('warning', 'Warning - Remarks are Required.', \"Kindly Add Remarks !\");\n // event.preventDefault();\n // return\n //}\n if ($('#' + Id + ' :selected').text().toUpperCase() == \"DECIMAL\") {\n if (value.length > 6) {\n event.preventDefault();\n }\n else if ((event.which != 46 || value.indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {\n event.preventDefault(); \n }\n }\n\n else if ($('#' + Id + ' :selected').text().toUpperCase() == \"NUMBER\")\n {\n event = (event) ? event : window.event;\n var charCode = (event.which) ? event.which : event.keyCode;\n if (charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n }\n else if ($('#' + Id + ' :selected').text().toUpperCase() == \"IP\") {\n Onclickchange(idNo);\n var regex = new RegExp(\"^[0-9\\\\,.\\\\s]+$\");\n var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);\n if (!regex.test(key)) {\n event.preventDefault();\n return false;\n }\n }\n else if ($('#' + Id + ' :selected').text().toUpperCase() == \"TEXT\" || this.event.target.id.indexOf('tblAirlineParameterTrans_ParameterRemarks_') != -1)\n {\n Onclickchange(idNo);\n var regex = new RegExp(\"^[a-zA-Z0-9\\\\-\\\\s]+$\");\n var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);\n if (!regex.test(key)) {\n event.preventDefault();\n return false;\n }\n \n }\n\n}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nreturn elem.nodeName&&elem.nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function enableInput()\n{\n\t$('#dialogEquip input').off(\"click\", returnFalse)\n\t$('#dialogEquip input[type=text]').prop('disabled', false)\n\t$('#dialogEquip textarea').prop('disabled', false)\n\t$('#clearPosition').on('click', clearPosition)\n\t$('#clearShunt').on('click', clearShunt)\n}", "_restoreInputValue(input, formattedVal) {\n // must blur for FF to reset value\n input.blur();\n input.value = formattedVal;\n this.toggleClass('validation-error', false, input);\n }", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function addressfinderinput() {\r\n var empty = false;\r\n $('.input--findaddress').each(function() {\r\n if ($(this).val() == '') {\r\n empty = true;\r\n }\r\n });\r\n\r\n if (empty) {\r\n $('.btn--findaddress').attr('disabled', 'disabled');\r\n } else {\r\n $('.btn--findaddress').removeAttr('disabled');\r\n }\r\n }", "function emptyField(event){\n\t\tvar thisObj = $(this);\n\t\tvar currVal=thisObj.val();\n\t\t\n\t\tif (currVal == thisObj.data(\"defaultValue\")){\n\t\t\tthisObj.val(\"\");\n\t\t}\n\t}", "function newEntry(){\n if (eq === 'o'){\n $('#box').val('');\n eq = 'x'\n }\n }", "function a(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger(\"change\")}}", "function v(e) {\n // Use the `click` event to detect changes to checkbox and radio inputs.\n // This approach works across all browsers, whereas `change` does not fire\n // until `blur` in IE8.\n var t = e.nodeName;\n return t && \"input\" === t.toLowerCase() && (\"checkbox\" === e.type || \"radio\" === e.type);\n }", "function cloak(val) {\n $(val).hide();\n }", "function tempValidate3()\n{\nif(document.frmMembRegi.amatCrdPoss3.checked==false && document.frmMembRegi.amatCrdElig3.checked==false){\n\tdocument.frmMembRegi.nameAmat3.value=\"\";\n\treturn false;\n\t}\n\telse{\n\tdocument.frmMembRegi.nameAmat3.value;\n\treturn false;\n\t} \n\nreturn true; \n}", "function validardebe(field) {\r\n\t\t\tvar nombre_elemento = field.id;\r\n\t\t\tif(nombre_elemento==\"debe_dcomprobantes\")\r\n\t\t\t{\r\n\t\t\t\t$(\"#haber_dcomprobantes\").val(\"0.00\");\r\n\t\t\t\t\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\t$(\"#debe_dcomprobantes\").val(\"0.00\");\r\n\t\t\t}\r\n\t\t }", "update() {\n if (this.originalInputValue === '') {\n this._reset();\n }\n }", "function changeInput() {\n var paid;\n if(paySetting == 0) {\n paid = $('#paidInput').val() == '' ? '___' : $('#paidInput').val();\n } else {\n paid = $('#paidInputWindow').val() == '' ? '___' : $('#paidInputWindow').val();\n }\n var total = document.getElementById(\"total\").innerHTML;\n var required = total - paid;\n $('#required').html(parseFloat(required).toFixed(2));\n $('#requiredWindow').html(parseFloat(required).toFixed(2));\n if(total != 0 && required <= 0) {\n if(paySetting == 0) {\n $('#process').prop('disabled', false);\n } else {\n $('#prcBtn').prop('disabled', false);\n }\n } else {\n $('#process').prop('disabled', true);\n $('#prcBtn').prop('disabled', true);\n }\n}", "update() {\n\t if (this.originalInputValue === '') {\n\t this._reset();\n\t }\n\t }", "function emptyField(event){\n\t\tvar thisObj = $(this);\n\t\tvar currVal=thisObj.val();\n\t\tif (currVal == thisObj.data(\"orgVal\")){\n\t\t\tthisObj.val(\"\");\n\t\t\tthisObj.parent().removeClass(\"g_search_default\");\n\t\t}\n\t}", "function eventosControl() {\n\n $('.victima').each(function (ind, obj) {\n var padre = $(obj).parent().parent();\n if ($(obj).val() === 'true') {\n $(padre).find('.ruv').removeAttr('disabled');\n $(padre).find('.desplazado').removeAttr('disabled');\n } else {\n $(padre).find('.ruv').attr('disabled', 'disabled');\n\n $(padre).find('.desplazado').attr('disabled', 'disabled');\n\n $(padre).find('.retorno').attr('disabled', 'disabled');\n\n }\n });\n// caracterizacion paso 3\n $('.victima').on('change', function () {\n var bl_vic = $(this).val();\n var padre = $(this).parent().parent();\n switch (bl_vic) {\n case 'null':\n $(padre).find('.ruv').attr('disabled', 'disabled');\n $(padre).find('.ruv').val('null');\n $(padre).find('.desplazado').attr('disabled', 'disabled');\n $(padre).find('.desplazado').val('null');\n $(padre).find('.retorno').attr('disabled', 'disabled');\n $(padre).find('.retorno').val('null');\n break;\n case 'false':\n $(padre).find('.ruv').attr('disabled', 'disabled');\n $(padre).find('.ruv').val('null');\n $(padre).find('.desplazado').attr('disabled', 'disabled');\n $(padre).find('.desplazado').val('null');\n $(padre).find('.retorno').attr('disabled', 'disabled');\n $(padre).find('.retorno').val('null');\n break;\n case 'true':\n $(padre).find('.ruv').removeAttr('disabled');\n $(padre).find('.desplazado').removeAttr('disabled');\n break;\n }\n });\n $('.desplazado').each(function (ind, obj) {\n var padre = $(obj).parent().parent();\n if ($(obj).val() === 'true') {\n $(padre).find('.retorno').removeAttr('disabled');\n } else {\n $(padre).find('.retorno').attr('disabled', 'disabled');\n\n }\n });\n $('.desplazado').on('change', function () {\n var bl_vic = $(this).val();\n var padre = $(this).parent().parent();\n\n switch (bl_vic) {\n case 'null':\n $(padre).find('.retorno').attr('disabled', 'disabled');\n $(padre).find('.retorno').val('null');\n break;\n case 'false':\n $(padre).find('.retorno').attr('disabled', 'disabled');\n $(padre).find('.retorno').val('null');\n break;\n case 'true':\n $(padre).find('.retorno').removeAttr('disabled');\n break;\n }\n });\n\n// controles para el paso de servicios sociales, salud y educación\n $('.ayuda').each(function (ind, obj) {\n var padre = $(obj).parent().parent();\n if ($(obj).val() === '6') {\n $(padre).find('.ayuda-cual').removeAttr('disabled');\n } else {\n $(padre).find('.ayuda-cual').attr('disabled', 'disabled');\n\n }\n });\n $('.ayuda').on('change', function () {\n var bl_ayu = $(this).val();\n var padre = $(this).parent().parent();\n if (bl_ayu === '6') {\n $(padre).find('.ayuda-cual').removeAttr('disabled');\n } else {\n $(padre).find('.ayuda-cual').attr('disabled', 'disabled');\n $(padre).find('.ayuda-cual').val('');\n }\n });\n $('.estudio').each(function (ind, obj) {\n var padre = $(obj).parent().parent();\n if ($(obj).val() === '2') {\n $(padre).find('.razones').removeAttr('disabled');\n } else {\n $(padre).find('.razones').attr('disabled', 'disabled');\n\n }\n });\n $('.estudio').on('change', function () {\n var bl_ayu = $(this).val();\n var padre = $(this).parent().parent().parent();\n if (bl_ayu === '2') {\n $(padre).find('.razones').removeAttr('disabled');\n } else {\n $(padre).find('.razones').attr('disabled', 'disabled');\n $(padre).find('.razones').val('0');\n }\n });\n $('.razones').each(function (ind, obj) {\n var padre = $(obj).parent().parent();\n if ($(obj).val() === '14') {\n $(padre).find('.cual-razon').removeAttr('disabled');\n } else {\n $(padre).find('.cual-razon').attr('disabled', 'disabled');\n }\n });\n $('.razones').on('change', function () {\n var bl_ayu = $(this).val();\n var padre = $(this).parent().parent();\n if (bl_ayu === '14') {\n $(padre).find('.cual-razon').removeAttr('disabled');\n } else {\n $(padre).find('.cual-razon').attr('disabled', 'disabled');\n $(padre).find('.cual-razon').val('');\n }\n });\n $('.razones').each(function (ind, obj) {\n var padre = $(obj).parent().parent();\n if ($(obj).val() === 'true') {\n $(padre).find('.enfermedad').removeAttr('disabled');\n $(padre).find('.diagnostico').removeAttr('disabled');\n } else {\n $(padre).find('.enfermedad').attr('disabled', 'disabled');\n $(padre).find('.diagnostico').attr('disabled', 'disabled');\n }\n });\n $('.bool-enfermedad').on('change', function () {\n var bl_enfer = $(this).val();\n var padre = $(this).parent().parent();\n switch (bl_enfer) {\n case 'null':\n $(padre).find('.enfermedad').attr('disabled', 'disabled');\n $(padre).find('.diagnostico').attr('disabled', 'disabled');\n $(padre).find('.enfermedad').val('');\n $(padre).find('.diagnostico').val('null');\n break;\n case 'false':\n $(padre).find('.enfermedad').attr('disabled', 'disabled');\n $(padre).find('.diagnostico').attr('disabled', 'disabled');\n $(padre).find('.enfermedad').val('');\n $(padre).find('.diagnostico').val('null');\n break;\n case 'true':\n $(padre).find('.enfermedad').removeAttr('disabled');\n $(padre).find('.diagnostico').removeAttr('disabled');\n break;\n }\n });\n\n// controles paso 5 dimensión economica\n if ($('#blTrabajo').val() === 'true') {\n $('#trabajo').removeAttr('disabled');\n } else {\n $('#trabajo').attr('disabled', 'disabled');\n }\n\n $('#blTrabajo').on('change', function () {\n var bl_enfer = $(this).val();\n\n switch (bl_enfer) {\n case 'null':\n $('#trabajo').attr('disabled', 'disabled');\n $('#trabajo').val('');\n break;\n case 'false':\n $('#trabajo').attr('disabled', 'disabled');\n $('#trabajo').val('');\n break;\n case 'true':\n $('#trabajo').removeAttr('disabled');\n break;\n }\n });\n\n if ($('#blExperiencia').val() === 'true') {\n $('#Experiencia').removeAttr('disabled');\n } else {\n $('#Experiencia').attr('disabled', 'disabled');\n }\n $('#blExperiencia').on('change', function () {\n var bl_enfer = $(this).val();\n\n switch (bl_enfer) {\n case 'null':\n $('#Experiencia').attr('disabled', 'disabled');\n $('#Experiencia').val('0');\n break;\n case 'false':\n $('#Experiencia').attr('disabled', 'disabled');\n $('#Experiencia').val('0');\n break;\n case 'true':\n $('#Experiencia').removeAttr('disabled');\n break;\n }\n });\n\n if ($('#blMotocicleta').val() === 'true') {\n $('#motocicletas').removeAttr('disabled');\n } else {\n $('#motocicletas').attr('disabled', 'disabled');\n }\n $('#blMotocicleta').on('change', function () {\n var bl_enfer = $(this).val();\n\n switch (bl_enfer) {\n case 'null':\n $('#motocicletas').attr('disabled', 'disabled');\n $('#motocicletas').val('0');\n break;\n case 'false':\n $('#motocicletas').attr('disabled', 'disabled');\n $('#motocicletas').val('0');\n break;\n case 'true':\n $('#motocicletas').removeAttr('disabled');\n break;\n }\n });\n\n if ($('#blCarro').val() === 'true') {\n $('#carros').removeAttr('disabled');\n } else {\n $('#carros').attr('disabled', 'disabled');\n }\n $('#blCarro').on('change', function () {\n var bl_enfer = $(this).val();\n\n switch (bl_enfer) {\n case 'null':\n $('#carros').attr('disabled', 'disabled');\n $('#carros').val('0');\n break;\n case 'false':\n $('#carros').attr('disabled', 'disabled');\n $('#carros').val('0');\n break;\n case 'true':\n $('#carros').removeAttr('disabled');\n break;\n }\n });\n\n if ($('#blBici').val() === 'true') {\n $('#bicicletas').removeAttr('disabled');\n } else {\n $('#bicicletas').attr('disabled', 'disabled');\n }\n $('#blBici').on('change', function () {\n var bl_enfer = $(this).val();\n\n switch (bl_enfer) {\n case 'null':\n $('#bicicletas').attr('disabled', 'disabled');\n $('#bicicletas').val('0');\n break;\n case 'false':\n $('#bicicletas').attr('disabled', 'disabled');\n $('#bicicletas').val('0');\n break;\n case 'true':\n $('#bicicletas').removeAttr('disabled');\n break;\n }\n });\n\n// Control de paso 6 tecnologias\n if ($('#blDesktop').val() === 'true') {\n $('#num_pc').removeAttr('disabled');\n $('#uso_pc').removeAttr('disabled');\n } else {\n $('#num_pc').attr('disabled', 'disabled');\n\n $('#uso_pc').attr('disabled', 'disabled');\n }\n $('#blDesktop').on('change', function () {\n var bl_enfer = $(this).val();\n\n switch (bl_enfer) {\n case 'null':\n $('#num_pc').attr('disabled', 'disabled');\n $('#num_pc').val('0');\n $('#uso_pc').attr('disabled', 'disabled');\n $('#uso_pc').val('0');\n break;\n case 'false':\n $('#num_pc').attr('disabled', 'disabled');\n $('#num_pc').val('0');\n $('#uso_pc').attr('disabled', 'disabled');\n $('#uso_pc').val('0');\n break;\n case 'true':\n $('#num_pc').removeAttr('disabled');\n $('#uso_pc').removeAttr('disabled');\n break;\n }\n });\n\n if ($('#blPortatil').val() === 'true') {\n $('#num_port').removeAttr('disabled');\n $('#uso_port').removeAttr('disabled');\n } else {\n $('#num_port').attr('disabled', 'disabled');\n $('#uso_port').attr('disabled', 'disabled');\n }\n $('#blPortatil').on('change', function () {\n var bl_enfer = $(this).val();\n\n switch (bl_enfer) {\n case 'null':\n $('#num_port').attr('disabled', 'disabled');\n $('#num_port').val('0');\n $('#uso_port').attr('disabled', 'disabled');\n $('#uso_port').val('0');\n break;\n case 'false':\n $('#num_port').attr('disabled', 'disabled');\n $('#num_port').val('0');\n $('#uso_port').attr('disabled', 'disabled');\n $('#uso_port').val('0');\n break;\n case 'true':\n $('#num_port').removeAttr('disabled');\n $('#uso_port').removeAttr('disabled');\n break;\n }\n });\n\n if ($('#blTablet').val() === 'true') {\n $('#num_tab').removeAttr('disabled');\n $('#uso_tab').removeAttr('disabled');\n } else {\n $('#num_tab').attr('disabled', 'disabled');\n\n $('#uso_tab').attr('disabled', 'disabled');\n }\n $('#blTablet').on('change', function () {\n var bl_enfer = $(this).val();\n\n switch (bl_enfer) {\n case 'null':\n $('#num_tab').attr('disabled', 'disabled');\n $('#num_tab').val('0');\n $('#uso_tab').attr('disabled', 'disabled');\n $('#uso_tab').val('0');\n break;\n case 'false':\n $('#num_tab').attr('disabled', 'disabled');\n $('#num_tab').val('0');\n $('#uso_tab').attr('disabled', 'disabled');\n $('#uso_tab').val('0');\n break;\n case 'true':\n $('#num_tab').removeAttr('disabled');\n $('#uso_tab').removeAttr('disabled');\n break;\n }\n });\n\n// Controles paso 8 \n\n if ($('#blTablet').val() === '5') {\n $('#cual_tipovivienda').removeAttr('disabled');\n } else {\n $('#cual_tipovivienda').attr('disabled', 'disabled');\n }\n $('#blTablet').on('change', function () {\n var bl_tablet = $(this).val();\n\n if (bl_tablet === '5') {\n $('#cual_tipovivienda').removeAttr('disabled');\n } else {\n $('#cual_tipovivienda').attr('disabled', 'disabled');\n $('#cual_tipovivienda').val('');\n }\n });\n if ($('#tipotenencia').val() === '5') {\n $('#doctenencia').removeAttr('disabled');\n } else {\n $('#doctenencia').attr('disabled', 'disabled');\n }\n $('#tipotenencia').on('change', function () {\n var bl_tablet = $(this).val();\n\n if (bl_tablet === '4') {\n $('#doctenencia').removeAttr('disabled');\n } else {\n $('#doctenencia').attr('disabled', 'disabled');\n $('#doctenencia').val('');\n }\n });\n\n}", "function check(name) {\n var new_name = name.value;\n\n if (!isNaN(new_name)) {\n new_name = new_name.substring(0, (new_name.length - 1));\n name.value = new_name;\n }\n}", "function tempValidate2()\n{\nif(document.frmMembRegi.amatCrdPoss2.checked==false && document.frmMembRegi.amatCrdElig2.checked==false){\n\tdocument.frmMembRegi.nameAmat2.value=\"\";\n\treturn false;\n\t}\n\telse{\n\tdocument.frmMembRegi.nameAmat2.value;\n\treturn false;\n\t} \n\nreturn true; \n}", "onChangeInput() {\n this.setState({\n value: !this.state.value,\n manualChangeKey: !this.state.manualChangeKey,\n });\n }", "_inputBlurHandler() {\n const that = this;\n\n if (that._suppressBlurEvent === true) {\n // suppresses validation because it was already handled in \"_incrementOrDecrement\" function\n that._suppressBlurEvent = false;\n\n if (that._formattedValue) {\n that._cachedInputValue = that._formattedValue;\n that.$.input.value = that._formattedValue;\n delete that._formattedValue;\n }\n }\n else if (that.$.input.value !== that._editableValue) {\n that._triggerChangeEvent = true;\n that._validate();\n that._triggerChangeEvent = false;\n }\n else {\n that.$.input.value = that._cachedInputValue;\n }\n\n if (that.radixDisplay) {\n that.$.radixDisplayButton.removeAttribute('focus');\n }\n\n if (that.opened) {\n that._closeRadix();\n }\n\n if (that.spinButtons) {\n that.$.spinButtonsContainer.removeAttribute('focus');\n }\n if (that.showUnit) {\n that.$.unitDisplay.removeAttribute('focus');\n }\n\n that.removeAttribute('focus');\n }", "function isSame(anElmnt) {\n\n valuesObject[anElmnt.target.id] = anElmnt.target.value;\n\n let filteredCpy = Object.values(valuesObject).filter(x => x > 0);\n\n let uniqueCpy = [...new Set(Object.values(filteredCpy))];\n\n\n /* to block save button */\n\n if (uniqueCpy.length != filteredCpy.length) {\n\n layoutButton.disabled = true;\n layoutButton.style.background = '#b03636';\n layoutButton.style.cursor = 'auto'\n layoutButton.style.color = buttonColor;\n layoutButton.innerText = \"Can't save\"\n } else {\n\n layoutButton.disabled = false;\n layoutButton.style.background = buttonColor;\n layoutButton.style.cursor = 'pointer'\n layoutButton.style.color = '#000'\n layoutButton.innerText = \"Save\"\n }\n}", "function shouldUseClickEvent(elem){ // Use the `click` event to detect changes to checkbox and radio inputs.\n\t// This approach works across all browsers, whereas `change` does not fire\n\t// until `blur` in IE8.\n\treturn elem.nodeName&&elem.nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){ // Use the `click` event to detect changes to checkbox and radio inputs.\n\t// This approach works across all browsers, whereas `change` does not fire\n\t// until `blur` in IE8.\n\treturn elem.nodeName&&elem.nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function updateTourType() {\n \n if ($(\"#tour-type\").val() == 1) {\n\n $('#date-return').prop('disabled', true);\n\n } else {\n\n $('#date-return').prop('disabled', false);\n }\n\n}", "function del(no) {\n\t\t \tvar totalharga = $('#total_harganya').val();\n\t\t \tvar harga = $('#total'+no).val();\n\t\t \tvar totalharganya = parseInt(totalharga) - parseInt(harga);\n\t\t \t$('#total_harganya').val(totalharganya);\n\t\t\trealnomor = realnomor - 1;\n\t\t\tnomornya = jQuery.grep(nomornya,function(value){\n\t\t \treturn value != no;\n\t\t });\n\n\t\t \tdocument.getElementById('input'+no).remove();\n\t\t \thitungtotalharga();\n\t\t\t\thitungbayar();\n\t\t}", "function checkProductInputVals() {\n var fields = [\n 'cat-make',\n 'cat-model',\n 'cat-drivetype',\n 'cat-category'\n ];\n\n for (var indx = 0; indx < fields.length; indx++) {\n if( $('#' + fields[indx]).val() ) {\n $('#' + fields[indx]).prop('disabled', false);\n $('#' + fields[indx]).parent('.products-filter__select').removeClass('select--disabled');\n }\n }\n }", "function tempValidate1()\n{\nif(document.frmMembRegi.amatCrdPoss1.checked==false && document.frmMembRegi.amatCrdElig1.checked==false){\n\tdocument.frmMembRegi.nameAmat1.value=\"\";\n\treturn false;\n\t}\n\telse{\n\tdocument.frmMembRegi.nameAmat1.value;\n\treturn false;\n\t} \n\nreturn true; \n}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n\t// This approach works across all browsers, whereas `change` does not fire\n\t// until `blur` in IE8.\n\tvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){ // Use the `click` event to detect changes to checkbox and radio inputs.\n\t// This approach works across all browsers, whereas `change` does not fire\n\t// until `blur` in IE8.\n\treturn elem.nodeName === 'INPUT' && (elem.type === 'checkbox' || elem.type === 'radio');}", "function campsOk(){\n if(event.target.value != \"\"){\n event.target.classList.remove(\"invalid\");\n return true;\n }\n }", "function _checkField(name, val) {\n var cc = $(target).find('input[name=\"' + name + '\"][type=radio], input[name=\"' + name + '\"][type=checkbox]');\n if (cc.length) {\n cc.iCheck('uncheck');\n cc.each(function () {\n var checked = _isChecked($(this).val(), val);\n $(this).iCheck(checked ? 'check' : 'uncheck');\n });\n return true;\n }\n return false;\n }", "function unfocus(){\n\n var newTagName = self.edt.val();\n if ( newTagName.length && ! ( newTagName in self.byname ) )\n self.addElement( newTagName );\n self.edt.val( '' );\n\n }", "function toggleInput(oid)\n{\n var elem = document.getElementById(oid);\n if (elem)\n {\n elem.value = (elem.value == 1) ? 0 : 1;\n } \n}", "onClickFunc() {\n\tlet eng = document.getElementById(\"inputEng\");\n\tif(eng.classList.contains(\"unclicked\")){\n\t\teng.classList.remove(\"unclicked\");\n\t\teng.classList.add(\"clicked\");\n\t\teng.value = \"\";\n\t}\n }", "function deletetag(){\n\t// event.preventDefault();\n\t$(\"#ProcessSuppPayment\").click(function(event) {\n\t \tvar countfalse = parseInt($(\"#countnan\").val());\n\t \tconsole.log(countfalse);\n\t \tfor (var i = 0; i < countfalse; i++) {\n\t \t\ttes = $(\"[name=amount\"+i+\"]\").val();\n\t \t\t// console.log(tes);\n\t \t\tif (tes == \"\"){\n\t\t \t\t$(\"[name=iniaja\"+i+\"]\").remove();\n\t\t \t}\t\n\t \t}\n\t}\n\t \t// $(\"#ProcessSuppPayment\").submit();\n\t);\n\t\n\t$(\"#AddPaymentItem\").click(function(event) {\n\t\t\n\t // event.preventDefault();\n\n\t \tvar countfalse = parseInt($(\"#countnan\").val());\n\t \t//console.log(countfalse);\n\t \tfor (var i = 0; i < countfalse; i++) {\n\t \t\ttes = $(\"[name=amount\"+i+\"]\").val();\n\t \t\t// console.log(tes);\n\t \t\tif (tes == \"\"){\n\t\t \t\t$(\"[name=iniaja\"+i+\"]\").remove();\n\t\t \t}\t\n\t \t}\n\t}\n\t\t// $(\"#AddPaymentItem\").submit();\n\t);\n\n}", "function disableTermInput() {\n var value = $(this).val();\n var disable = value === 'is empty' || value === 'is not empty';\n $(this).siblings('.advanced-search-terms').prop('disabled', disable);\n }", "function o(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger(\"change\")}}", "function preventChange(event){\n\tif(stopPressed == 0){\n\t\tevent.preventDefault();\n\t}\n}", "function checkButton() {\n calculateBtn.addEventListener(\"mouseup\",function (){\n if(!active) {\n somme = 0;\n active = checkInputValue();\n }\n });\n resetBtn.addEventListener(\"mouseup\",function (){\n somme = 0;\n let inputTab = document.getElementsByTagName(\"input\");\n for(let value of inputTab){\n value.value = \"\";\n value.style.border = \" 3px solid darkblue\";\n }\n document.getElementById(\"resultAll\").innerHTML = \"\";\n });\n}", "function tempValidate4()\n{\nif(document.frmMembRegi.amatCrdPoss4.checked==false && document.frmMembRegi.amatCrdElig4.checked==false){\n\tdocument.frmMembRegi.nameAmat4.value=\"\";\n\treturn false;\n\t}\n\telse{\n\tdocument.frmMembRegi.nameAmat4.value;\n\treturn false;\n\t} \n\nreturn true; \n}", "function dirtyManualFields() {\n\tvar len = fieldsToCheck.length;\n\tvar element;\n\tfor (var i=0; i<len; ++i) {\n\t\tid = fieldsToCheck[i];\n\t\telement = '#' + id;\n\t\tif($(element).val() != $(element).data('initial_value')) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function toggleValue(fieldName, theValue, selector) {\n writeDebug(\"toggleValue(\"+fieldName+\",\"+theValue+\",\"+selector+\")\");\n\n var values = $(\"input#\"+fieldName).val() || '';\n writeDebug(\"values=\"+values);\n values = values.split(/\\s*,\\s*/);\n\n clsClearSelection(fieldName, selector, values);\n\n var found = false;\n var newValues = new Array();\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n if (!value)\n continue;\n if (value == theValue) {\n found = true;\n } else {\n newValues.push(value);\n }\n }\n\n if (!found) {\n newValues.push(theValue)\n }\n\n clsSetSelection(fieldName, selector, newValues);\n}" ]
[ "0.6132339", "0.59494346", "0.5926352", "0.57899845", "0.5777096", "0.576324", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.57335013", "0.5720987", "0.57096267", "0.5706699", "0.5704157", "0.56800157", "0.5675853", "0.5673558", "0.5673558", "0.56486505", "0.5635758", "0.56244594", "0.562133", "0.5616181", "0.5570961", "0.5557812", "0.5533624", "0.55229527", "0.547976", "0.5467771", "0.54616606", "0.5443755", "0.54435116", "0.5432393", "0.5431735", "0.5425198", "0.54178536", "0.5416377", "0.5398615", "0.5398615", "0.5396673", "0.5396204", "0.53949946", "0.5390009", "0.5388793", "0.53880835", "0.53796566", "0.5368921", "0.5368921", "0.5368921", "0.5368921", "0.5368921", "0.5368921", "0.5368921", "0.5368921", "0.5368921", "0.5368921", "0.5368921", "0.5367648", "0.5357266", "0.5354504", "0.5342169", "0.53390086", "0.53368783", "0.5334584", "0.5334269", "0.5333486", "0.5332735", "0.5330742", "0.532605", "0.5318342", "0.5317484", "0.53171104", "0.53093797", "0.5306335", "0.530598", "0.5299686", "0.5299686", "0.5295485", "0.5294883", "0.5293396", "0.5288389", "0.528538", "0.52827054", "0.52766883", "0.5272351", "0.5267889", "0.52670926", "0.52663505", "0.5250401", "0.5250002", "0.5248207", "0.5241534", "0.5240048", "0.52374244", "0.5237072", "0.52275497" ]
0.57686555
5
Show calctulated car price
function showCarPrice(price) { $(modelPrice).empty().text(price + '$'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayPrice(){\r\n\tdocument.getElementById(\"cost\").innerText = \"$\" + (cost + size_cost + glazing_cost).toFixed(2);\r\n}", "function calcPrice(){\n var price = doorPrice + handlePrice;\n document.getElementById('price').innerHTML = \"\";\n document.getElementById('price').innerHTML = \"Prezzo: \" + price.toFixed(2) + \" €\";\n}", "function total(){\n\tvar TotalPrice=CakeSizePrice() +FilingPrice()+ CandlePrice()+InscriptionPrice() ;\n\n\t//final result\n\tdocument.getElementById(\"display\").innerHTML=\"total price $\"+TotalPrice;\n}", "function total(){\n\tvar TotalPrice=CakeSizePrice() + FlavorPrice()+ FillingPrice()+ ColorPrice() ;\n\n\t//final result\n\tdocument.getElementById(\"display\").innerHTML=\"Total Price: $\"+TotalPrice;\n}", "function calculatePrice() {\n\t\tmodelPrice = 26000;\n\t\tmodelPrice += +$('input[name=\"cpu\"]:checked', '#autoForm').val();\n\t\tmodelPrice += +$('input[name=\"gpu\"]:checked', '#autoForm').val();\n\t\tmodelPrice += +$('input[name=\"ssd\"]:checked', '#autoForm').val();\n\n\t\tlet chassisSRC = $('#imgHolder img').attr('src');\n\t\tlet chassisPrice = +$('#chassisSelector img[data-flag=\"1\"]').attr('data-price');\n\t\tmodelPrice += chassisPrice;\n\n\n\t\tmodelPriceHolder.text(addSpace(modelPrice) + ' грн');\n\t}", "function calculateTotal() {\r\n\t\tvar Amount =getPrice() *getPages();\r\n\t\t//display cost.\r\n\t\tvar obj =document.getElementById('totalPrice');\r\n\t\tobj.style.display='block';\r\n\t\tobj.innerHTML =\" Cost of the paper: \\t $\"+ Amount;\r\n\t}", "function updateDisplayedTotalPrice(){\n // calculate total price of the cart\n let totalPrice = cart.getTotalPrice();\n\n // Modify the displayed value\n document.getElementById(\"total-price\").innerHTML = formatPrice(totalPrice);\n}", "function getPrice() {\n if (result.Prijs.Koopprijs && !result.Prijs.Huurprijs) {\n return '<strong>€ ' + numberWithPeriods(result.Prijs.Koopprijs) + ' <abbr title=\"Kosten Koper\">k.k.</abbr></strong>';\n } else {\n return '<strong>€ ' + numberWithPeriods(result.Prijs.Huurprijs) + ' <abbr title=\"Per maand\">/mnd</abbr></strong>';\n }\n }", "function displayPriceTeddy(teddy) {\n let priceTeddy = document.querySelector('#card-price')\n let teddyPriceCents = teddy.price\n priceTeddy.innerHTML = \"Prix : \" + teddyPriceCents + \" €\"\n}", "function renderPrice(){\n \n}", "getCalculate() {\n const price = 100000 * this.#rom + 150000 * this.#ram;\n console.log(\n `The Price of Smartphone ${this.#name} with ROM ${this.#rom} GB and RAM ${\n this.#ram\n } GB is Rp ${price}`\n );\n }", "function calculation(){\n const bestPrice = getCosting('bestPrice');\n const extraMemoryCost = getCosting('extraMemoryCost');\n const extraStorageCost = getCosting('extraStorageCost');\n const deliveryCharge = getCosting('deliveryCharge');\n const totalSubPrice = bestPrice + extraMemoryCost + extraStorageCost + deliveryCharge; \n document.getElementById(\"totalPrice\").innerText = totalSubPrice;\n \n}", "function calculatePieCost() {\n const price = priceInput.value;\n const cost = price * 2;\n console.log(cost);\n total.innerText = `₽ всего за срок вклада - ${cost}`;\n }", "function totalPrice() {\n var totalPrice = 0;\n for (var i = 0; i < pets.length; i++) {\n totalPrice += pets[i].price;\n }\n\n document.getElementById(\"total-price\").innerHTML = `\n <p>\n Total Cost: <b>$${totalPrice}.00\n </p>`;\n}", "function costoutput() {\n cost =price.value*quantity.value;\n document.getElementById('cost').innerHTML='$'+cost;\n\n \n }", "function fnShowPrice(data) {\n\n if (typeof data === 'undefined') return null;\n\n var out = \"\", interest = \"\", priceNormal = data.pn, priceOriginal = data.po, code = data.cp, maxParcels = parseInt(data.mp), isSub = (typeof data.issub !== 'undefined') ? JSON.parse(data.issub) : false;\n var pricemin = data.pricemin, pricemax = data.pricemax;\n // console.log('pricemin', pricemin, 'pricemax', pricemax);\n /* verifica preços diferentes entre os subprodutos */\n if (typeof pricemin !== \"undefined\" && typeof pricemax !== \"undefined\") {\n if (parseFloat(pricemin) > 0 && parseFloat(pricemax) > 0 && parseFloat(pricemin) !== parseFloat(pricemax)) {\n var priceInicial = pricemin.toString().split(\".\");\n if (priceInicial.length == 2) {\n var priceIntMin = priceInicial[0], priceDecimalMin = priceInicial[1];\n if (priceDecimalMin.length == 1) priceDecimalMin += \"0\";\n }\n else {\n var priceIntMin = priceInicial, priceDecimalMin = \"00\";\n }\n\n var priceFinal = pricemax.toString().split(\".\");\n if (priceFinal.length == 2) {\n var priceInt = priceFinal[0], priceDecimal = priceFinal[1];\n if (priceDecimal.length == 1) priceDecimal += \"0\";\n }\n else {\n var priceInt = priceFinal, priceDecimal = \"00\";\n }\n\n var text_prom = \"\";\n if (priceNormal != priceOriginal && priceOriginal != pricemax) { //verfica se o produto está em promoção e também se não é igual ao valor maior\n text_prom = \"<div class=\\\"old-price\\\"><span><strike>\" + FormatPrice(priceOriginal, 'R$') + \"</strike></span></div>\";\n }\n var txt = (isSub == false) ? '<span style=\"font-size:14px\">Escolha o produto para ver o preço.</span>' : \"\";\n return '<div class=\"prices\">'\n + text_prom\n + \"<div class=\\\"price\\\">&nbsp;&nbsp;<span class=\\\"price-intro\\\"></span><span class=\\\"currency font-primary\\\">R$ </span><span class=\\\"int font-primary\\\">\" + fnFormatNumber(priceIntMin) + \"</span><span class=\\\"dec font-primary\\\">,\" + priceDecimalMin + \"</span></div>\"\n + \"<div class=\\\"price\\\"><span class=\\\"price-intro\\\"> - </span><span class=\\\"currency font-primary\\\">R$ </span><span class=\\\"int font-primary\\\">\" + fnFormatNumber(priceInt) + \"</span><span class=\\\"dec font-primary\\\">,\" + priceDecimal + \"</span></div>\"\n + '</div>'\n + txt;\n }\n }\n\n if (priceNormal == 0 && priceOriginal == 0) {\n return \"<div class=\\\"prices\\\">\"\n + \" <div class=price>\"\n + \" <div class='currency zf-consult-price'>\"\n + \" <a href='/faleconosco.asp?idloja=\" + FC$.IDLoja + \"&assunto=Consulta%20sobre%20produto%20(Código%20\" + code + \")' target='_top' >Preço Especial - Consulte!</a>\"\n + \" </div>\"\n + \" </div>\"\n + \"</div>\";\n }\n\n var priceFinal = priceNormal.toString().split(\".\");\n if (priceFinal.length == 2) {\n var priceInt = priceFinal[0], priceDecimal = priceFinal[1];\n if (priceDecimal.length == 1) priceDecimal += \"0\";\n }\n else {\n var priceInt = priceFinal, priceDecimal = \"00\";\n }\n\n if (typeof Juros !== \"undefined\") {\n maxParcels = (maxParcels == 0 || maxParcels > Juros.length) ? Juros.length : maxParcels;\n interest = (Juros[maxParcels - 1] > 0) ? \"\" : \" s/juros\";\n }\n else {\n maxParcels = 0;\n }\n\n var text = (isSub == true) ? 'a partir de ' : (priceNormal != priceOriginal) ? '' : ''; //var text = (isSub==true) ? 'a partir de ': (priceNormal != priceOriginal)? 'de ': '';\n\n if (priceNormal != priceOriginal) {\n out += \"<div class=\\\"prices\\\">\";\n out += \" <div class=\\\"old-price\\\">\" + text + \" <span class=\\\"font-primary\\\"><strike>\" + FormatPrice(priceOriginal, 'R$') + \"</strike>&nbsp;</span></div>\";\n out += \" <div class=\\\"price font-primary\\\">por&nbsp;<span class=\\\"currency\\\">R$ </span><span class=\\\"int\\\">\" + fnFormatNumber(priceInt) + \"</span><span class=\\\"dec\\\">,\" + priceDecimal + \"</span></div>\";\n out += \"</div>\";\n if (maxParcels > 1) out += \"<div class=\\\"installments\\\">ou&nbsp;<strong><span class=\\\"installment-count\\\">\" + maxParcels + \"</span>x</strong> de <strong><span class=\\\"installment-price\\\">\" + FormatPrecoReais(CalculaParcelaJurosCompostos(priceNormal, maxParcels)) + \"</span></strong>\" + interest + \"</div>\";\n }\n else {\n out += \"<div class=\\\"prices\\\">\";\n out += \"<div class=\\\"price\\\"><span class=\\\"price-intro\\\">\" + text + \"</span><span class=\\\"currency font-primary\\\">R$ </span><span class=\\\"int font-primary\\\">\" + fnFormatNumber(priceInt) + \"</span><span class=\\\"dec font-primary\\\">,\" + priceDecimal + \"</span></div>\";\n out += \"</div>\";\n if (maxParcels > 1) out += \"<div class=\\\"installments\\\">ou&nbsp;<strong><span class=\\\"installment-count\\\">\" + maxParcels + \"</span>x</strong> de <strong><span class=\\\"installment-price\\\">\" + FormatPrecoReais(CalculaParcelaJurosCompostos(priceNormal, maxParcels)) + \"</span></strong>\" + interest + \"</div>\";\n }\n //retorna html da preço\n return out;\n }", "function displayCouplesPrice(){\n document.getElementById(\"couplesPriceAmount\").innerHTML = CouplesPrice;\n}", "function calculatePrice() {\n const firstClassCount = getBooking(\"firstClass\");\n const economyCount = getBooking(\"economy\");\n const subTotalPricing = firstClassCount * 150 + economyCount * 100;\n document.getElementById(\"subtotal\").innerText = \"$\" + subTotalPricing;\n\n const tax = Math.round(subTotalPricing * 0.1);\n document.getElementById(\"tax\").innerText = \"$\" + tax;\n\n const total = subTotalPricing + tax;\n document.getElementById(\"total\").innerText = \"$\" + total;\n}", "function productPriceDisplay() {\n let priceContainer = document.createElement('h4');\n priceContainer.classList.add(\"mt-4\", \"mb-3\");\n let amount = product.price * 0.01;\n let price = amount.toFixed(2);\n priceContainer.innerHTML = '$' + ' ' + price;\n productDetails.appendChild(priceContainer);\n}", "function getCarPrice(id)\n{\t\n\tvar country = cars[id].c, volume = cars[id].v, org = cars[id].o;\n\tvar r = [[1, 1.2, 2], [0.75, 0.9, 1.5], [0.7, 0.8, 1.35], [0, 0, 0]][country][(volume>5&&2)||(volume>2&&1)||0];\n\treturn Math.ceil((org + org*r + (org + org*r)*0.12)*47);\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}", "getPrice() {\n return `${this.price} euros`;\n }", "function showPriceCaller() {\n plan.showPrice();\n}", "function getPrice() {\n if (interest.Prijs.Koopprijs && !interest.Prijs.Huurprijs) {\n return '<strong>€ ' + numberWithPeriods(interest.Prijs.Koopprijs) + ' <abbr title=\"Kosten Koper\">k.k.</abbr></strong>';\n } else {\n return '<strong>€ ' + numberWithPeriods(interest.Prijs.Huurprijs) + ' <abbr title=\"Per maand\">/mnd</abbr></strong>';\n }\n }", "function calculate () {\n const finalPrice = priceArray.reduce(getSum);\n priceDisplay.textContent = 'Total - Price $' + finalPrice;\n}", "function calculateUSD() {\n\t\tmodelPriceUSD = modelPrice / uahUsdRate;\n\t\tmodelPriceUSD = modelPriceUSD.toFixed(2);\n\n\t\tmodelPriceUsdHolder.text(\"$ \" + addSpace(modelPriceUSD));\n\t}", "function printPriceCart(){\n document.getElementById(\"chopping-price-discount\").innerHTML = \"\";\n document.getElementById(\"chopping-price\").innerHTML = calcularPrecioTotal () + simbolMoney;\n document.getElementById(\"info-chopping-price\").innerHTML = '\"' + infoGastosEnvio () + '\"';\n}", "static displayBudget() {\n const calced = Store.getBudget();\n document.getElementById(\"budgetDisplay\").innerHTML = \"$\" + calced;\n }", "function updateTotalCost(value, price) {\n var element = $(\"#@human.code_erc\");\n value = parseInt(value);\n isNaN(value) ? element.html(\"\") : element.html(\"$\" + value*price);\n}", "function CalPriceIva (value,iva){\n let price = (value+(value*(iva/100)));\n console.log(\"<valor precio iva\",price,\">\" )\n return price;\n }", "updatePriceFromPricing () {\n this.config.display.amount = this.pricing.totalNow;\n this.config.display.currency = this.pricing.currencyCode;\n }", "function calculateTotalPrice() {\n const basePriceAmount = parseFloat(basePriceDisplay.innerText);\n const extraMemoryCostAmount = parseFloat(extraMemoryCostDisplay.innerText);\n const extraStorageCostAmount = parseFloat(extraStorageCostDisplay.innerText);\n const deliveryChargeAmount = parseFloat(deliveryChargeDisplay.innerText);\n totalPriceDisplay.innerText = basePriceAmount + extraMemoryCostAmount + extraStorageCostAmount + deliveryChargeAmount;\n}", "function getQuote() {\n\tvar price = getTapeLength() * X_CONST_USD + getDimensionWeight() * DIMENSION_WEIGHT_DOLLARS_PER_KG;\n\tconsole.log('unit price before waterproofing: ' + price.toFixed(2));\n\tprice *= isOutdoor(inOutChoice);\n\tprice *= getQuantity(qtyMultiplier)\n\tdocument.getElementById('dollar').innerHTML = price.toFixed(2);\n}", "function add_tax_to_price_onscreen(tax) {\n let price_id = get_price_div();\n let price = get_price()\n let p = document.getElementById(price_id);\n p.innerText = \"$\" + (price * (1 + tax)).toFixed(2) + \" with tax\";\n console.log(\"price adjusted.\");\n}", "function displayTotals() {\r\n const totalPrice = SeatData.getTotalHeldPrice(seats);\r\n const heldSeatLabels = SeatData.getHeldSeats(seats).map(seat => seat.label);\r\n\r\n const priceSpan = document.querySelector(\"#selected-seat-price\");\r\n const labelSpan = document.querySelector(\"#selected-seat-labels\");\r\n\r\n priceSpan.innerText = totalPrice.toFixed(2);\r\n labelSpan.innerText = heldSeatLabels.length > 0 ? heldSeatLabels.join(\", \") : \"None\";\r\n }", "function calculatePrice() {\n const priceTotal = priceCalculation();\n innerChanger('sum', priceTotal);\n innerChanger('sum-footer', priceTotal);\n}", "formatPrice(price) {\n return price === 0 ? \"Free\" : \"Starts at $\" + price.toFixed(2);\n }", "function updateTotalCartPricing() {\r\n\t $('.cart .pricing').text(formatAsMoney(cart.subtotal));\r\n\t }", "function calculateTotal(){\n let totalPrice = 0;\n $('#myCart #item').each(function(){\n totalPrice = totalPrice + $(this).data('price');\n })\n $('#price').text(`Total Price:Rs.${totalPrice}/-`)\n }", "function priceCalculator() {\n const firstClassTicketQuantity = getInputNumber('first-class-input');\n const firstClassTicketCost = firstClassTicketQuantity *150;\n const economyTicketQuantity = getInputNumber('economy-input');\n const economyTicketCost = economyTicketQuantity *100;\n const subtotal = firstClassTicketCost + economyTicketCost;\n document.getElementById('subtotal').innerText = '$' + subtotal;\n const vat = Math.round((subtotal *10)/100);\n document.getElementById('vat').innerText = '$' + vat;\n const total = subtotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "function calculateTotal()\n {\n\n var kPrice = keychainsQuantity() + secondkeychainsQuantity();\n \n document.getElementById('totalPrice').innerHTML =\n \"Total Price For Keychain is $\"+kPrice;\n \n }", "function featurePrice(product, price) {\n document.getElementById(product + '-price').innerText = price;\n const total = calculateTotal();\n document.getElementById('total-price').innerText = total;\n document.getElementById('final-price').innerText = total;\n\n}", "function totalPriceUpdate() {\n var subTotal = currentPrice.reduce((a, b) => a + b, 0);\n var tax = (subTotal * 15) / 100;\n var total = subTotal + tax;\n document.getElementById(\"sub-total\").innerText = subTotal;\n document.getElementById(\"tax\").innerText = tax;\n document.getElementById(\"total\").innerText = total;\n}", "function calcCostOfJava (javaQ) {\n console.log(\"In CostofJava\");\n javaCost = javaQ * 84.99;\n javaCost = javaCost.toFixed(2);\n document.getElementById(\"javaBookCost\").innerHTML = \"Total: $\" + javaCost;\n}", "function displayPrice(dollarString) {\n addTextToDom(dollarString, \"bd-price\");\n}", "function calculatePrice(updatePrice, onOff){\n if($(onOff).is(':visible')){\n total += updatePrice;\n $(\".price strong\").html(\"$\"+ total);\n }\n else {\n total-=updatePrice;\n $(\".price strong\").html(\"$\"+ total);\n }\n}", "displayPrice() {\n this.updatePrice();\n var tmp_show_price = false;\n for (let option_item of this.check_option_list) {\n if (option_item) {\n tmp_show_price = true;\n break;\n }\n }\n this.show_price = tmp_show_price;\n }", "function displayFamilyPrice(){\n document.getElementById(\"familyPriceAmount\").innerHTML = FamilyPrice;\n}", "showSum() {\n let sum = 0\n this.shirts.forEach(e => {\n sum += e.cartQuantity * e.price;\n });\n\n this.shoppingCartSum = sum;\n\n document.getElementById(\"shoppingCartSum\").textContent = \"Sum: \" + sum.toFixed(2) + \" €\";\n }", "function updateDomPrice() {\n dom.sPrice.innerHTML = totalPrice - deliveryCharges;\n\n dom.tPrice.innerHTML = totalPrice === deliveryCharges ? 0 : totalPrice;\n }", "function getPrice() {\n\tif (_slider) {\n\t\treturn \"(@tpprixnum==\" + _slider.values()[0] + \"..\" + _slider.values()[1] + \")\";\n\t}\n\telse\n\t\treturn \"\";\n}", "function totalPrice(price) {\n return `$${price.toFixed(2)}`;\n}", "function PriceUpdate(price) {\n $(\"#price\").text(price);\n}", "function totalPrice(){\n const memoryCost = document.getElementById('memory_cost').innerText;\n const storageCost = document.getElementById('storage_cost').innerText;\n const delivaryCost = document.getElementById('delivary_cost').innerText;\n const total = 1299 + parseInt(memoryCost) + parseInt(storageCost) + parseInt(delivaryCost);\n document.getElementById('total_cost').innerText = total;\n document.getElementById('total_cost_fainal').innerText = total;\n}", "function showPrice() {\n var price_components = document.getElementsByClassName('price');\n for(let c of price_components){\n var price = c.innerText;\n var realPrice = \"£\" + (parseFloat(price) / 100);\n c.innerText = realPrice;\n }\n}", "function milkCows() {\r\n milk += dairyNumber * dairyRate;\r\n document.getElementById(\"milk\").innerHTML = milk.toFixed(2);\r\n}", "function calculateTotal_pr_cm() {\n //Aqui obtenemos el precio total llamando a nuestra funcion\n\t//Each function returns a number so by calling them we add the values they return together\n\t'use strict';\n var cakePrice = traerDensidadSeleccionada() * traerDensidadSeleccionada2() / getIndiceDeLogro() / 1000000, densidadimplantada = traerDensidadSeleccionada() / getIndiceDeLogro(), densidadobjetivo = traerDensidadSeleccionada();\n\t\t\t\t\n\t//Aqui configuramos los decimales que queremos que aparezcan en el resultado\n\tvar resultadodosdecimales1 = cakePrice.toFixed(2), resultadodosdecimales2 = densidadimplantada.toFixed(2), resultadodosdecimales3 = densidadobjetivo.toFixed(2);\n \n\t//Aqui exponemos el calculo\n\tvar divobj = document.getElementById('totalPrice_pr_cm');\n\tdivobj.style.display = 'block';\n\tdivobj.innerHTML = 'Você vai precisar plantar ' + resultadodosdecimales2 + ' sementes por hectare, que representa ' + resultadodosdecimales1 + ' sementes em um metro linear para atingir o seu alvo população de ' + resultadodosdecimales3;\n}", "function calculateTotal(){\n \n var childPrice = (getageGroupPrice() * getlengthOfDayInput()) * \n getdaysperweekInput() * gettimeframeInput() +\n summerClassPrice() + nonstudentfeeInput();\n\n// Display the results\n var grandTotal = document.getElementById('totalPrice');\n grandTotal.style.display='block';\n grandTotal.innerHTML = \"Total price for this child is $\"+childPrice.toFixed(2);\n}", "function updatePrice() {\n var distance = getRoutesData().reduce(function(pv, cv) {return pv + cv.distance; }, 0);\n // taxi for very short distance has constant min price\n var businessDistance = (distance > getMinDistance()) ? distance : getMinDistance();\n var price = getTaxiPricePerKm() * businessDistance;\n $('#price').val(price.toFixed(2) + \" UAH\");\n}", "function totalPrice() {\n const firstCount = document.getElementById('first-count');\n const firstCountNumber = parseInt(firstCount.value);\n\n const economyCount = document.getElementById('economy-count');\n const economyCountNumber = parseInt(economyCount.value);\n\n // subtotal price...\n const subTotalPrice = (firstCountNumber * 150) + (economyCountNumber * 100);\n document.getElementById('sub-total').innerText = subTotalPrice;\n\n // sub total price..\n const vat = subTotalPrice * 0.1;\n document.getElementById('total-vat').innerText = vat;\n\n // total price...\n const totalTicketPrice = subTotalPrice + vat;\n document.getElementById('total-price').innerText = totalTicketPrice;\n}", "function totalPriceUpdate() {\n const totalPrice = document.getElementById(\"total-price\");\n const grandTotalPrice = document.getElementById(\"grand-total\");\n const calculateTotalPrice =\n priceTextToNumber(\"best-price\") +\n priceTextToNumber(\"memory-cost\") +\n priceTextToNumber(\"storage-cost\") +\n priceTextToNumber(\"delivery-cost\");\n totalPrice.innerText = calculateTotalPrice;\n grandTotalPrice.innerText = calculateTotalPrice;\n}", "changePrice() {\n var parts = this.precio.toFixed(2).toString().split(\".\");\n var result = parts[0].replace(/\\B(?=(\\d{3})+(?=$))/g, \".\") + (parts[1] ? \",\" + parts[1] : \"\");\n return `$${result}`;\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 newCost() {\n let precioSubtotal = 0;\n let precioTotal = 0;\n let productos = cart_products_info.articles\n for(let i = 0; i <productos.length; i++) {\n let units = document.getElementById(\"cart_\"+i+\"_units\").value;\n precioSubtotal += convertir(productos[i].currency)*units*productos[i].unitCost;\n }\n // precioTotal = precioSubtotal*(1+precioEnvio()).toFixed(0)\n\n document.getElementById(\"precioSubtotal\").innerHTML = \"UYU \" + precioSubtotal.toFixed(0)\n document.getElementById(\"precioEnvio\").innerHTML = \"UYU \" + (precioSubtotal*precioEnvio()).toFixed(0)\n document.getElementById(\"precioTotal\").innerHTML = \"UYU \" + (precioSubtotal*(1+precioEnvio())).toFixed(0)\n\n}", "get price() {\n const {\n priceMoney\n } = this.defaultVariation.itemVariationData;\n // item price money can be undefined, then we default to 0.00\n return priceMoney ? `${(parseInt(priceMoney.amount)/100).toFixed(2)}` : 0.00;\n }", "function updateVariantPrice(variant) {\r\n\t $('#buy-button-1 .variant-price').text('$' + variant.price);\r\n\t }", "function summary(){\n const phonePrice = parseFloat(document.getElementById('phn-price').innerText);\n const casePrice = parseFloat(document.getElementById('case-price').innerText);\n\n const tax = parseFloat(document.getElementById('tax-price').innerText);\n document.getElementById('sub-total').innerText = phonePrice + casePrice;\n document.getElementById('total').innerText = phonePrice + casePrice + tax;\n\n \n}", "function price_display() {\r\n document.getElementById(\"adultTicket\").innerHTML = ticket_price[\"adult\"];\r\n document.getElementById(\"seniorTicket\").innerHTML= ticket_price[\"senior\"];\r\n document.getElementById(\"childTicket\").innerHTML = ticket_price[\"child\"];\r\n }", "function showCost(el, cost) {\n\tel.querySelector(\".item-cost\").innerHTML = `${cost}`;\n}", "carAero() {\n console.log(\n `Added the aero package and the car's top speed changed: ${\n this.topSpeed - 5\n }`\n );\n }", "function priceCalculation() {\n\n const bestPrice = getValue('primary-price');\n const extraMemory = getValue('extra-memory');\n const extraStorage = getValue('extra-storage');\n const fastDelivery = getValue('extra-delivery');\n const priceTotal = bestPrice + extraStorage + fastDelivery + extraMemory;\n return priceTotal;\n}", "function productPrice(productName, valuePrice) {\n const productCost = document.getElementById(productName + \"-cost\");\n productCost.innerText = valuePrice;\n totalPrice();\n}", "showPrice() {\n if(this.props.price == 0) {\n return(\n <td>\n <p className=\"RideEntryFieldPrice\">\n free\n </p>\n </td>\n );\n } else {\n return(\n <td>\n <p className=\"RideEntryFieldPrice\">\n ${this.props.price}\n </p>\n </td>\n )\n }\n }", "displayPrice(book) {\r\n\t\tif(book.saleInfo.saleability === \"FOR_SALE\" && \r\n\t\t\tbook.saleInfo.listPrice.amount !== 0) {\r\n\t\t\treturn(\r\n\t\t\t\t\"$\" + \r\n\t\t\t\tbook.saleInfo.listPrice.amount + \r\n\t\t\t\t\" \" +\r\n\t\t\t\tbook.saleInfo.listPrice.currencyCode\r\n\t\t\t)\r\n\t\t} else {\r\n\t\t\treturn(\r\n\t\t\t\t\"FREE\"\r\n\t\t\t)\r\n\t\t}\r\n\t}", "function calcularPrecio()\n{\n\tvar precioTotal = 0;\n\t$(\".precioTotal\").each(function() {\n precioTotal += parseFloat($(this).text());\n });\n $(\"#botonPrecio\").text(\"Precio total: \" + precioTotal);\n}", "getprice(){\n return this.price;\n }", "function showCarsByPrice(_carprice){\n for(let i=0;i<cars.length;i++){\n if(cars[i].Price>_carprice){\n cars[i].showCarDetails()\n }\n }\n}", "precioTotal() {\n return this.ctd * this.valor;\n }", "get totalPrice() {\n\n return Model.totalPriceCounter();\n }", "getTotalPrice () {\n return _.reduce(this.options.data, (total, option) => total + option.quantity * option.price, 0).toFixed(2);\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 total(){\n // regular price area call here \n const regularPrice = document.getElementById(\"regular-price\").innerText;\n // final memory price area call here \n const finalMemoryPrice =document.getElementById('previous-memory-cost').innerText;\n // final storage price area call here \n const finalStoragePrice = document.getElementById(\"previous-storage-cost\").innerText;\n // final delivery charge area call here \n const finalDeliveryFee = document.getElementById(\"delivery-fee\").innerText;\n // total price showing area call here \n const totalPrice = document.getElementById('previous-total');\n // pomo total price showing here \n const pomoFinalTotal = document.getElementById(\"before-pomo\");\n // total price calculation \n const sumTotalPrice = parseFloat(regularPrice) + parseFloat(finalMemoryPrice) + parseFloat(finalStoragePrice) + parseFloat(finalDeliveryFee );\n totalPrice.innerText = sumTotalPrice;\n pomoFinalTotal.innerText = sumTotalPrice;\n}", "function newPrice() {\n if (hotels.price < 100) {\n return (\n <>\n <Card.Text className=\"establishmentDetail__price--old\">\n NOK {hotels.price}\n </Card.Text>\n <Card.Text className=\"establishmentDetail__price--new\">\n NOK {discountPrice}\n </Card.Text>\n <Card.Text className=\"establishmentDetail__price--discount\">\n Save: {discount}&#37;\n </Card.Text>\n </>\n );\n }\n\n return (\n <Card.Text className=\"establishmentDetail__price--org text-center\">\n <strong>Total: NOK {hotels.price}</strong>\n </Card.Text>\n );\n }", "function calculateNewPrice(oldPrice){\n console.log(`The new price is $${oldPrice*0.8}`);\n}", "function totalPrice() {\n const previousTotal = document.getElementById('total-price');\n\n const bestPrice = parseInt(document.getElementById('best-price').innerText);\n const extraMemoryCost = parseInt(document.getElementById('extra-memory-total').innerText);\n const extraStorageCost = parseInt(document.getElementById('extra-storage-total').innerText);\n const deliveryCharge = parseInt(document.getElementById('delivery-charge-total').innerText);\n const netPrice = bestPrice + extraMemoryCost + extraStorageCost + deliveryCharge;\n previousTotal.innerText = netPrice;\n\n const promoTotal = document.getElementById('promo-total');\n promoTotal.innerText = netPrice;\n}", "function printTotalCost() {\n $(\".totalCost span\").append(\"<p> $\"+totalCost+ \"</p>\");\n }", "function updateGlobalPrice(num){\n document.querySelector(\"#global-price span\").textContent = \"$\" + num.toFixed(2);\n}", "function setOutput(cost, total, discount, final) {\n document.getElementById(total).innerHTML = \"Total: \" + cost.toFixed(2);\n document.getElementById(discount).innerHTML = \"Discount: \" + (cost * .2).toFixed(2) + \" (20% off)\";\n document.getElementById(final).innerHTML = \"Final: \" + (cost * .8).toFixed(2);\n}", "price() {\n return this.bid / this.capacity;\n }", "function updateCost(e) {\n if (this.checked) {\n if (this.id == \"checkboxTaxi\") {\n totalAmount += parseFloat(this.value);\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n } else {\n totalAmount += parseFloat(this.value) * dayAmount;\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n }\n } else {\n if (this.id == \"checkboxTaxi\") {\n totalAmount -= parseFloat(this.value);\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n } else {\n totalAmount -= parseFloat(this.value) * dayAmount;\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n }\n }\n }", "function calculateTotal() {\n const fisrtClassTotalQuantity = document.getElementById('firstClass-ticket-quantity').value;\n const ecoClassTotalQuantity = document.getElementById('ecoClass-ticket-quantity').value;\n const totalPrice = fisrtClassTotalQuantity * 150 + ecoClassTotalQuantity * 100;\n\n document.getElementById('sub-total').innerText = ('$' + totalPrice);\n const vat = Math.round(totalPrice * .10);\n document.getElementById('vat').innerText = ('$' + vat);\n const grandTotal = totalPrice + vat;\n document.getElementById('grand-total').innerText = '$' + grandTotal;\n}", "function showQuote(data) {\n // For each room, add a row to the quote table with it's specs\n // (like broadloom meters, carpet_type, price etc...)\n $.each(data, function(key, val) {\n $(\".quote table tbody\").append('' +\n '<tr>' +\n '<td>Room ' + key + ' &mdash; <b style=\"font-size:14px;\">' + val.broadloom + 'b&sup2;</b></td>' +\n '<td style=\"text-transform:capitalize;\">' + val.carpet_type + '</td>' +\n '<td>$' + val.cost + '</td>' +\n '<td>-</td>' +\n '</tr>'\n );\n\n // If the 'discounts' key exists in the data returned by the API,\n // calculate the new price (normal cost price - discounted price).\n if (val.discount) {\n var newprice = val.cost - ((val.discount / 100) * val.cost)\n $(\".quote table tbody tr td\").last().text(val.discount + \"% ($\" + newprice + \")\");\n }\n });\n\n // Add the new price to the subtotal. This will also apply to the calculations\n // of GST & ultimately the Grand Total.\n var subtotal = 0\n $.each(data, function(key, val) {\n subtotal = subtotal + parseInt(val.cost)\n if (val.discount) {\n var newprice = val.cost - ((val.discount / 100) * val.cost)\n if (newprice == 0) {\n subtotal = subtotal - val.cost\n } else {\n subtotal = subtotal - newprice\n }\n }\n });\n $(\"#subtotal span\").text(subtotal);\n\n // Calculate GST\n var gst = 0\n gst = gst + subtotal * 0.1\n $(\"#gst span\").text(gst);\n\n // Calculate Grand Total\n var grandtotal = subtotal + gst\n $(\"#grandtotal span\").text(\"$\" + grandtotal);\n\n // FINALLY, slide the quote container down and show everything we've been\n // alluding to.\n $(\".quote\").delay(700).slideDown(500);\n }", "function details() {\n let did = dsel.value;\n if (!did) return;\n fetch(base + \"/dispenser/\" + did)\n .then(resp => resp.json()).then(function(json) {\n let perc = Math.ceil(json[\"valor_atual\"]/json[\"vol_max\"]*100);\n curml.innerText = json[\"valor_atual\"] + \" mL (\" + perc + \"%)\";\n curdesc.innerText = json[\"desc\"];\n });\n}", "function add_price(attr_price) {\n lumise.cart.price.attr = attr_price;\n if(lumise.cart.price.color == 0) return;\n var origin_price = lumise.cart.price.base + lumise.cart.price.attr + lumise.cart.price.color;\n var total_price = lumise.cart.price.base * lumise.cart.price.attr * lumise.cart.price.color;\n\t\tvar extra_price = total_price - origin_price;\n lumise.cart.price.extra.values = [{ price: extra_price }];\n\n var vat_price = total_price * 0.2;\n lumise.cart.price.vat = vat_price;\n var vat_ele = $('#vat_price');\n if(vat_ele.length == 0) {\n vat_ele = '<span id=\"vat_price\">' + vat_price.toFixed(2) + '</span><span> (VAT)</span>';\n $(vat_ele).appendTo($('#lumise-navigations ul[data-block=\"right\"]>li:first-child'));\n } else {\n vat_ele.text(vat_price.toFixed(2));\n }\n lumise.cart.calc();\n lumise.render.cart_change();\n lumise.actions.do('cart-changed', true);\n // lumise.cart.display();\n // console.log(lumise.cart.price);\n }", "travel(miles) {\n this.currentFuel = this.currentFuel - (miles/this.mpg);\n console.log(\"The car \" + this.make + this.model + \" has \" + this.currentFuel.toFixed(1) + \" gallons of \" + this.engineType + \" left.\");\n}", "function displayTotalcalories() {\n //Get total calories\n const totalCalories = ItemCtr.getTotalCalories();\n //add total calories to UI\n UICtrl.showTotalCalories(totalCalories);\n }", "function totalPrice(){\n let sum = 0;\n $(\".row-total\").each(function(){\n sum += $(this).data('rowtotal');\n $(\".total-price\").html(\"TOTAL PRICE: &euro; \" +sum);\n })\n}", "function update_price() {\n var row = $(this).parents('.line-item');\n var kolicina = parseFloat(row.find('.kolicina>input').val());\n var cena = parseFloat(row.find('.cena>input').val());\n var popust = parseFloat(row.find('.popust>input').val());\n var davek = parseFloat(row.find('.davek>input').val());\n popust = (100-popust)/100;\n davek = (100 + davek)/100;\n skupaj = cena*kolicina*popust*davek;\n row.find('.skupaj').html(skupaj.toFixed(2));\n //update_total();\n}", "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "function updateCostAndPrice() {\n $(\"#totalCostCalculated\").text(Math.round(totalCostCalculated * Math.pow(10, 2)) / Math.pow(10, 2));\n $(\"#sellingPriceAtSpan\").text($(\"#profitMarginInput\").val());\n $(\"#sellingPrice\").text((Math.round(sellingPrice * Math.pow(10, 2)) / Math.pow(10, 2)));\n alert('recalculated via updateCostAndPrice method');\n }" ]
[ "0.7187774", "0.6948575", "0.6907733", "0.68868595", "0.68632525", "0.6844997", "0.6727364", "0.6718678", "0.66953075", "0.66783535", "0.6627213", "0.6595778", "0.6594391", "0.6583834", "0.65674424", "0.6555324", "0.6554547", "0.6553843", "0.6550379", "0.65397143", "0.6528668", "0.6522133", "0.65063834", "0.6472958", "0.64399767", "0.63975793", "0.63967544", "0.63966197", "0.6371438", "0.636751", "0.63668257", "0.63561696", "0.63508093", "0.6334148", "0.6328388", "0.6327031", "0.6321711", "0.63201857", "0.631263", "0.6311062", "0.62592417", "0.62519854", "0.62394226", "0.62305474", "0.6226568", "0.6220797", "0.6206988", "0.6199683", "0.61974514", "0.6194849", "0.6194198", "0.61935467", "0.61931515", "0.6184007", "0.61657727", "0.61655974", "0.61613816", "0.616092", "0.616065", "0.6158936", "0.6150307", "0.6148716", "0.61463207", "0.61441547", "0.6140186", "0.6136367", "0.6126243", "0.612021", "0.6101053", "0.60949224", "0.6074726", "0.6072782", "0.60714704", "0.607039", "0.6060272", "0.6057157", "0.6051489", "0.60495454", "0.60389316", "0.603608", "0.6031621", "0.60305905", "0.60292184", "0.60254854", "0.60229146", "0.6016435", "0.601485", "0.6011948", "0.6003483", "0.59996426", "0.5998837", "0.5988725", "0.5987257", "0.5986508", "0.59845644", "0.597786", "0.5977589", "0.59769154", "0.59744734", "0.5970468" ]
0.7564609
0
This plugin will automatically rotate the globe around its vertical axis a configured number of degrees every second.
function autorotate(degPerSec) { // Planetary.js plugins are functions that take a `planet` instance // as an argument... return function(planet) { var lastTick = null; var paused = false; planet.plugins.autorotate = { pause: function() { paused = true; }, resume: function() { paused = false; } }; // ...and configure hooks into certain pieces of its lifecycle. planet.onDraw(function() { if (paused || !lastTick) { lastTick = new Date(); } else { var now = new Date(); var delta = now - lastTick; // This plugin uses the built-in projection (provided by D3) // to rotate the globe each time we draw it. var rotation = planet.projection.rotate(); rotation[0] += degPerSec * delta / 1000; if (rotation[0] >= 180) rotation[0] -= 360; planet.projection.rotate(rotation); lastTick = now; } }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myTimer(now) {\n if (rotationOn) {\n tNew = now;\n dt = tOld - tNew;\n steps = dt * 360 / tRotation;\n\n pos = oldPos - steps //the earth rotates towards the east\n\n if (pos <= -180) {pos = pos+360}\n\n projection.rotate([pos, 0]);\n viz.selectAll(\"path\").attr(\"d\", pathMaker)\n\n\n tOld = tNew;\n oldPos = pos;\n }\n else {\n tOld = now;\n }\n }", "function stopGlobeRotation(){\n setTimeout(function() {\n globe.updateOptions(\n {...options,cameraAutoRotateSpeed: 0}\n )\n }, 1000)\n }", "function autorotate(degPerSec) {\n // Planetary.js plugins are functions that take a `planet` instance\n // as an argument...\n return function (planet) {\n var lastTick = null;\n var paused = false;\n planet.plugins.autorotate = {\n pause: function () {\n paused = true;\n },\n resume: function () {\n paused = false;\n }\n };\n // ...and configure hooks into certain pieces of its lifecycle.\n planet.onDraw(function () {\n if (paused || !lastTick) {\n lastTick = new Date();\n } else {\n var now = new Date();\n var delta = now - lastTick;\n // This plugin uses the built-in projection (provided by D3)\n // to rotate the globe each time we draw it.\n var rotation = planet\n .projection\n .rotate();\n rotation[0] += degPerSec * delta / 1000;\n if (rotation[0] >= 180)\n rotation[0] -= 360;\n planet\n .projection\n .rotate(rotation);\n lastTick = now;\n }\n });\n };\n }", "function autorotate(degPerSec) {\n // Planetary.js plugins are functions that take a `planet` instance\n // as an argument...\n return function(planet) {\n let lastTick = null;\n let paused = false;\n planet.plugins.autorotate = {\n pause: function() { paused = true; },\n resume: function() { paused = false; }\n };\n // ...and configure hooks into certain pieces of its lifecycle.\n planet.onDraw(function() {\n if (paused || !lastTick) {\n lastTick = new Date();\n } else {\n let now = new Date();\n let delta = now - lastTick;\n // This plugin uses the built-in projection (provided by D3)\n // to rotate the globe each time we draw it.\n let rotation = planet.projection.rotate();\n rotation[0] += degPerSec * delta / 1000;\n if (rotation[0] >= 180) rotation[0] -= 360;\n planet.projection.rotate(rotation);\n lastTick = now;\n }\n });\n };\n }", "function autorotate(degPerSec) {\n // Planetary.js plugins are functions that take a `planet` instance\n // as an argument...\n return function(planet) {\n var lastTick = null;\n var paused = false;\n planet.plugins.autorotate = {\n pause: function() { paused = true; },\n resume: function() { paused = false; }\n };\n // ...and configure hooks into certain pieces of its lifecycle.\n planet.onDraw(function() {\n if (paused || !lastTick) {\n lastTick = new Date();\n } else {\n var now = new Date();\n var delta = now - lastTick;\n // This plugin uses the built-in projection (provided by D3)\n // to rotate the globe each time we draw it.\n var rotation = planet.projection.rotate();\n rotation[0] += degPerSec * delta / 1000;\n if (rotation[0] >= 180) rotation[0] -= 360;\n planet.projection.rotate(rotation);\n lastTick = now;\n }\n });\n };\n }", "function autorotate(degPerSec) {\n\t // Planetary.js plugins are functions that take a `planet` instance\n\t // as an argument...\n\t return function(planet) {\n\t var lastTick = null;\n\t var paused = false;\n\t planet.plugins.autorotate = {\n\t pause: function() { paused = true; },\n\t resume: function() { paused = false; }\n\t };\n\t // ...and configure hooks into certain pieces of its lifecycle.\n\t planet.onDraw(function() {\n\t if (paused || !lastTick) {\n\t lastTick = new Date();\n\t } else {\n\t var now = new Date();\n\t var delta = now - lastTick;\n\t // This plugin uses the built-in projection (provided by D3)\n\t // to rotate the globe each time we draw it.\n\t var rotation = planet.projection.rotate();\n\t rotation[0] += degPerSec * delta / 1000;\n\t if (rotation[0] >= 180) rotation[0] -= 360;\n\t planet.projection.rotate(rotation);\n\t lastTick = now;\n\t }\n\t });\n\t };\n\t }", "function rotateYcon() {\n console.log('continuous rotate about y triggered');\n clearInterval(rotY);\n rotY = setInterval(rotateY, 50);\n}", "function earthSpin(start, end, duration) {\n $('#globe-animate svg').animateRotate(end, { duration: duration }, start)\n}", "function autorotate(degPerSec) {\n return function(planet) {\n var lastTick = null;\n var paused = false;\n planet.plugins.autorotate = {\n pause: function() { paused = true; },\n resume: function() { paused = false; }\n };\n planet.onDraw(function() {\n if (paused || !lastTick) {\n lastTick = new Date();\n } else {\n var now = new Date();\n var delta = now - lastTick;\n var rotation = planet.projection.rotate();\n rotation[0] += degPerSec * delta / 1000;\n if (rotation[0] >= 180) rotation[0] -= 360;\n planet.projection.rotate(rotation);\n lastTick = now;\n }\n });\n };\n }", "function autorotate(degPerSec) {\n return function(planet) {\n var lastTick = null;\n var paused = false;\n planet.plugins.autorotate = {\n pause: function() { paused = true; },\n resume: function() { paused = false; }\n };\n planet.onDraw(function() {\n if (paused || !lastTick) {\n lastTick = new Date();\n } else {\n var now = new Date();\n var delta = now - lastTick;\n var rotation = planet.projection.rotate();\n rotation[0] += degPerSec * delta / 1000;\n if (rotation[0] >= 180) rotation[0] -= 360;\n planet.projection.rotate(rotation);\n lastTick = now;\n }\n });\n };\n }", "animate() {\n this.graphics.rotation = this.rotateClockwise\n ? this.graphics.rotation + this.rotateSpeed\n : this.graphics.rotation - this.rotateSpeed\n }", "rotate() {\n\t\tthis.scene.rotate(-Math.PI / 2, 1, 0, 0);\n\t}", "function updateForFrame() {\r\n rotatingComponents.rotation.y += rotateSpeed;\r\n}", "function rotateTime(t) {\n timeMarker.css({'transform':'rotate(' + t + 'deg)'});\n }", "function autorotate(degPerSecFunc) {\n return function(planet) {\n var lastTick = null;\n var paused = false;\n var manually_paused = false;\n planet.plugins.autorotate = {\n set_paused: function(v) {\n manually_paused = v;\n },\n pause: function() {\n paused = true;\n },\n resume: function() {\n paused = false;\n }\n };\n planet.onDraw(function() {\n if (paused || manually_paused || !lastTick) {\n lastTick = new Date();\n } else {\n planet.requiresDredraw = true;\n var now = new Date();\n var delta = now - lastTick;\n var rotation = planet.projection.rotate();\n rotation[0] += degPerSecFunc() * delta / 1000;\n if (rotation[0] >= 180) rotation[0] -= 360;\n planet.projection.rotate(rotation);\n lastTick = now;\n }\n });\n };\n}", "function rotateDeg(wise){\n\tvar outer = document.getElementById('inner'),\n inner = document.getElementById('mainPhoto'),\n rotator = setRotator(inner);\n\n\tif(wise == 'clock'){\n\t\tdegrees += 90;\n\t} else{\n\t\tdegrees -= 90;\n\t}\n\n\n if (degrees >= 360) {\n degrees = 0;\n }\n\n rotator.rotate(degrees);\n\t\n}", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "function spin(e) {\n\t\tsetInterval(function() {\n\t\t\tif ( (($window.scrollTop() + $window.height()) > e.offset().top) && $window.scrollTop() < (e.offset().top + e.height())) {\n\t\t\t\t//spinReset = true;\n\t\t\t\tdeg = deg + 0.5;\n\t\t\t\t//console.log(deg);\n\t\t\t\te.css('-webkit-transform', 'rotate(' + deg + 'deg)');\n\t\t\t} else if ( $window.scrollTop() > ($intelRevo.offset().top + e.height()) && (($window.scrollTop() + $window.height()) < $archWhl.offset().top) ) {\n\t\t\t\t//spinReset = true;\n\t\t\t\tdeg = 0;\n\t\t\t}\n\t\t}, 100);\n\t}", "function animate () {\n renderer.autoClear = false;\n const delta = clock.getDelta();\n orbitControls.update(delta);\n globe.rotation.y -= 0.002;\n //render\n renderer.render(scene, camera);\n //schedule the next frame.\n requestAnimationFrame(animate);\n}", "rotate(rotateAmount) {\n }", "rotate(azimuthAngle, polarAngle, enableTransition) {\n \n this.rotateTo(\n this._sphericalEnd.theta + azimuthAngle,\n this._sphericalEnd.phi + polarAngle,\n enableTransition\n )\n \n }", "animate() {\n this.renderScene()\n this.frameId = window.requestAnimationFrame(this.animate)\n this.camera.rotation.z -= .0004;\n this.clouds1.rotation.y += .001;\n this.clouds2.rotation.y += .001;\n\n this.yinYang.rotation.y += 0.00;\n this.earth.rotation.y += 0.001;\n this.fire.rotation.y += 0.001;\n this.metal.rotation.y += 0.001;\n this.water.rotation.y += 0.001;\n this.wood.rotation.y += 0.001;\n }", "timer() {\n this.sethandRotation('hour');\n this.sethandRotation('minute');\n this.sethandRotation('second');\n }", "function rotateZcon() {\n console.log('continuous rotate about z triggered');\n clearInterval(rotZ);\n rotZ = setInterval(rotateZ, 50);\n}", "rotation() {\n // Map mouse location (horizontal)\n let distX = map(mouseX, width / 2, 2, 0, width);\n // Making it rotate according to mouseX\n let rotationValue = (frameCount * this.rotationSpeed * distX);\n\n // Making it rotate across each axis\n rotateY(rotationValue);\n rotateX(rotationValue);\n rotateZ(rotationValue);\n }", "function rotate_y() {\n curr_sin = Math.sin(map.degree);\n curr_cos = Math.cos(map.degree);\n var x = (this.x * curr_cos) + (this.z * curr_sin);\n this.z = (this.x * (-curr_sin)) + (this.z * (curr_cos));\n this.x = x;\n }", "animer() {\n //A chaque appel le presse agrume tourne de 6 degres\n this.setRotation(this.getRotation() + Math.PI / 30);\n\n super.animer();\n }", "function FixedUpdate () {\n // Camera rotation with step 2 * time.deltaTime:\n mainCamera.transform.Rotate(0, 2 * time.deltaTime, 0);\n}", "function animate() {\n window.requestAnimationFrame(function (now) {\n rotationDif = (now - lastFrame) * .001;\n settings.rotate += rotationDif * 2 * Math.PI * rotationSpeed;\n app.draw(settings);\n lastFrame = now;\n animate();\n });\n }", "rotate() {\n const now = Date.now();\n const delta = now - this.lastUpdate;\n this.lastUpdate = now;\n\n this.setState({rotation: this.state.rotation + delta / 20});\n this.frameHandle = requestAnimationFrame(this.rotate);\n }", "function rotateBy(current) {\n if (!stop) {\n var rotateNumber = current;\n map.rotateTo(rotateNumber + 90, { duration: 2000, easing: function (t) { return t; } });\n }\n }", "function animate() {\n requestAnimationFrame(animate);\n\n torus.rotation.x += 0.01;\n earth.rotation.y += 0.001;\n torus.rotation.y += 0.005;\n torus.rotation.z += 0.01;\n\n // listens to dom events and updates the camera\n // controls.update();\n\n\n\n renderer.render(scene, camera);\n}", "function draw() {\n background(\"white\");\n translate(300, 300);\n rotate(rotateBy);\n makeArm(rotateBy);\n rotateBy += 2; // I thought this was controlling the speed of the rotation, but this still confuses me.\n}", "function onTick() { //------------------------ start \"onTick()\"\n var now = new Date();\n nowHour = now.getHours();\n nowMinute = now.getMinutes();\n nowSecond = now.getSeconds();\n hourHandRotation = nowHour * 30 + nowMinute * 0.5 ;\n minuteHandRotation = nowMinute * 6;\n secondHandRotation = nowSecond * 6;\n myHourHand.css({\n '-webkit-transform' : 'rotate(' + hourHandRotation + 'deg)',\n '-moz-transform' : 'rotate(' + hourHandRotation + 'deg)',\n '-o-transform' : 'rotate(' + hourHandRotation + 'deg)',\n 'transform' : 'rotate(' + hourHandRotation + 'deg)'\n });\n myMinuteHand.css({\n '-webkit-transform' : 'rotate(' + minuteHandRotation + 'deg)',\n '-moz-transform' : 'rotate(' + minuteHandRotation + 'deg)',\n '-o-transform' : 'rotate(' + minuteHandRotation + 'deg)',\n 'transform' : 'rotate(' + minuteHandRotation + 'deg)'\n });\n mySecondHand.css({\n '-webkit-transform' : 'rotate(' + secondHandRotation + 'deg)',\n '-moz-transform' : 'rotate(' + secondHandRotation + 'deg)',\n '-o-transform' : 'rotate(' + secondHandRotation + 'deg)',\n 'transform' : 'rotate(' + secondHandRotation + 'deg)'\n });\n} //------------------------------------------------ end \"onTick()\"", "rotate(angleInRadians) {\n this.rotation = angleInRadians;\n }", "function animate() {\n illo.rotate.y += 0.01;\n illo.rotate.x += 0.01;\n illo.rotate.z += 0.01;\n illo.updateRenderGraph();\n requestAnimationFrame(animate);\n}", "function animate() {\n // Computes how time has changed since last display\n var now = Date.now();\n var deltaTime = now - curTime;\n curTime = now;\n var fracTime = deltaTime / 1000; // in seconds\n // Now we can move objects, camera, etc.\n var angle = Math.PI * 2 * fracTime;\n\n mercuryOrbit.rotation.y += angle / 100;\n mercury.rotation.y += angle / 20;\n\n venusOrbit.rotation.y += angle / 160;\n venus.rotation.y += angle / 50;\n\n earthMoonSystem.rotation.y += angle / 220;\n earth.rotation.y += angle / 10;\n moonSystem.rotation.y += angle / 28;\n moon.rotation.y += angle / 28;\n\n marsOrbit.rotation.y += angle / 280;\n mars.rotation.y += angle / 10;\n\n jupiterOrbit.rotation.y += angle / 340;\n jupiter.rotation.y += angle / 4;\n\n saturnSystem.rotation.y += angle / 400;\n saturnOrbit.rotation.y += angle / 4;\n\n uranusOrbit.rotation.y += angle / 460;\n uranus.rotation.y += angle / 7;\n\n neptuneOrbit.rotation.y += angle / 520;\n neptune.rotation.y += angle / 6;\n\n controls.update()\n}", "function rotateGrid() {\n grid.style.transform = 'rotate('+ angle +'deg)'; \n\n angle += 90;\n}", "function rotate() {\r\n // get the current Date object from which we can obtain the current hour, minute and second\r\n const currentDate = new Date();\r\n\r\n // get the hours, minutes and seconds\r\n const hours = currentDate.getHours();\r\n const minutes = currentDate.getMinutes();\r\n const seconds = currentDate.getSeconds();\r\n\r\n // rotating fraction --> how many fraction to rotate for each hand.\r\n const secondsFraction = seconds / 60;\r\n const minutesFraction = (secondsFraction + minutes) / 60;\r\n const hoursFraction = (minutesFraction + hours) / 12;\r\n\r\n // actual deg to rotate\r\n const secondsRotate = secondsFraction * 360;\r\n const minutesRotate = minutesFraction * 360;\r\n const hoursRotate = hoursFraction * 360;\r\n\r\n // apply the rotate style to each element\r\n // use backtick `` instead of single quotes ''\r\n secondHand.style.transform = `rotate(${secondsRotate}deg)`;\r\n minuteHand.style.transform = `rotate(${minutesRotate}deg)`;\r\n hourHand.style.transform = `rotate(${hoursRotate}deg)`;\r\n}", "function spin() {\n\tlargeImage.style.transform += \"rotate(0.1deg)\";\n\tsetInterval(spin, 40);\n}", "rotateSceneObjects(time) {\n var forceSlider = document.getElementById(\"rangesliderSpeedInput\");\n var forceSliderValue = document.getElementById(\"rangesliderSpeedValue\");\n forceSliderValue.innerHTML = forceSlider.value;\n this.setSpeedValue(forceSliderValue.innerHTML);\n\n this.planetObject.orbitClass.positionAllMoonOrbits();\n this.planetObject.rotateAllPlanets(time);\n this.moonObject.rotateAllMoons(time);\n this.planetObject.cosmicObject.findClickedPlanet(this.getSpeedValue());\n }", "function rotatePano(){\n if(panoGo){\n heading-=0.0625;\n if(heading<0){\n heading+=360;\n }\n panorama.setPov({heading:heading,pitch:0});\n setTimeout(rotatePano,100);\n }\n}", "function rotateHut() {\n var slideKey = currentSlideKey(),\n iframe = twoFaceContainer[slideKey].find(iframeSelector)[0],\n hut = iframe && iframe.contentWindow.document.querySelector(\".center-area.hut\");\n\n if (hut && hut.style) {\n var prevTransform = hut.style.WebkitTransform,\n prevDegreesMatch = prevTransform && prevTransform.match(/rotateY\\((\\-?\\d+)deg\\)/),\n prevDegrees = prevDegreesMatch && +prevDegreesMatch[1];\n prevDegrees = prevDegrees || 0;\n hut.style.WebkitTransform = \"rotateY(\" + (prevDegrees - 721) + \"deg)\";\n } else {\n logger.error(\"There is no hut!\");\n }\n }", "function rotateY() {\n console.log('rotate about y triggered');\n var cosA = Math.cos(0.05);\n var sinA = Math.sin(0.05);\n var m = new THREE.Matrix4();\n m.set( cosA, 0, sinA, 0,\n 0, 1, 0, 0,\n -sinA, 0, cosA, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n // render\n render();\n}", "function rotate() {\n angle = angle + speed; // apply the speed.\n duration++; // increase the current duration.\n \n $('#fidget').css('transform','rotate(' + angle + 'deg)'); // rotate the image.\n \n recompute_speed(); // recompute speed.\n if(duration >= MAX_DURATION) stop(); // Stop when animation is complete.\n}", "tick () {\n if (!this.enabled || !this.el.object3D || !this.video.srcObject) {\n return\n }\n\n this.el.sceneEl.camera.getWorldDirection(this.directionVector)\n\n if (this.lastCameraAngle >= this.angleRadians && this.directionVector.y < this.angleRadians) {\n this.debounceShowVideo()\n } else if (this.lastCameraAngle <= this.angleRadians && this.directionVector.y > this.angleRadians) {\n this.hideVideo()\n }\n\n this.lastCameraAngle = this.directionVector.y\n }", "function loop() {\r\n setTimeout(\"rotate()\", speed);\r\n}", "function rotateKnob(knob) {\n var interval = setInterval(function () {\n knob.angle += 1;\n if (knob.angle >= -36 && knob.angle <= -34) {\n clearInterval(interval);\n }\n }, 4);\n}", "function spin_controller(){\n game_content.spin_degrees = game_content.spin_degrees + 4;\n if(game_content.spin_degrees > 360){\n game_content.spin_degrees = 0;\n }\n}", "oscillate() {\n this.angle += 0.02;\n }", "rotate(rotateAmount, rotateAround) {\n if (!rotateAround) {\n rotateAround = this.center;\n }\n let vectorsRelativeToCenter = [];\n\n for (let v of this.pixelVectorPositions) {\n vectorsRelativeToCenter.push(p5.Vector.sub(v, rotateAround));\n }\n\n for (let v of vectorsRelativeToCenter) {\n v.rotate(rotateAmount);\n }\n\n for (var i = 0; i < this.pixelVectorPositions.length; i++) {\n this.pixelVectorPositions[i] = p5.Vector.add(vectorsRelativeToCenter[i], rotateAround);\n }\n this.setCenter();\n this.setShape();\n this.resetFixture();\n\n }", "setRotation(angle){\n this.rotation = angle;\n }", "function animate() {\r\n var timeNow = new Date().getTime();\r\n if (lastTime != 0) {\r\n var elapsed = timeNow - lastTime;\r\n\r\n if (speed != 0) {\r\n xPosition -= Math.sin(degToRad(yaw)) * speed * elapsed;\r\n zPosition -= Math.cos(degToRad(yaw)) * speed * elapsed;\r\n\r\n joggingAngle += elapsed * 0.6; // 0.6 \"fiddle factor\" - makes it feel more realistic :-)\r\n yPosition = Math.sin(degToRad(joggingAngle)) / 20 + 3\r\n }\r\n\r\n yaw += yawRate * elapsed;\r\n pitch += pitchRate * elapsed;\r\n\r\n }\r\n lastTime = timeNow;\r\n}", "function autorotate(rate, paused) {\n var stop = paused === true;\n return function(planet) {\n planet.plugins.autorotate = {\n pause: function(b) {\n stop = b !== false;\n if (!stop) { tick = null; }\n }\n };\n var tick = null;\n planet.onDraw(function() {\n if (stop) { return; }\n if (!tick) {\n tick = new Date();\n } else {\n var now = new Date();\n var delta = now - tick;\n var rotation = planet.projection.rotate();\n rotation[0] += rate * delta * 0.001;\n if (rotation[0] >= 180) { rotation[0] -= 360; }\n planet.projection.rotate(rotation);\n tick = now;\n }\n });\n };\n }", "function animate() {\n var timeNow = new Date().getTime();\n if (lastTime != 0) {\n var elapsed = timeNow - lastTime;\n\n if (speed != 0) {\n xPosition -= Math.sin(degToRad(yaw)) * speed * elapsed;\n zPosition -= Math.cos(degToRad(yaw)) * speed * elapsed;\n\n joggingAngle += elapsed * 0.6; // 0.6 \"fiddle factor\" - makes it feel more realistic :-)\n yPosition = Math.sin(degToRad(joggingAngle)) / 20 + 0.4\n }\n\n yaw += yawRate * elapsed;\n pitch += pitchRate * elapsed;\n }\n lastTime = timeNow;\n}", "rotate(dir) {\n\n if (dir === 'rotateright') {\n\n if (this.rotation === 3){\n this.rotation = -1\n }\n this.rotation ++;\n this.checkGhost();\n this.render();\n\n } else {\n\n if (this.rotation === 0){\n this.rotation = 4;\n }\n this.rotation --;\n this.checkGhost();\n this.render();\n\n }\n\n }", "function runRotateImages(){\n xx = setInterval(\"rotateImages()\", 7000); \n}//roda", "function fireInterval4(param) {\n //console.log('[fireInterval4] hit! param=' + param);\n var n = $('#' + param.id);\n var t = \"rotate(2 \" + (param.x + param.width/2) + \" \" + (param.y + param.height/2) + \")\";\n //console.log('[fireInterval4] transform=' + t);\n n.attr(\"transform\", t);\n setTimeout(fireIntervalFinal, 250, param);\n}", "function moveMinuteHands(containers) {\nvar containers = document.querySelectorAll('.minutes-container');\t\n for (var i = 0; i < containers.length; i++) {\n containers[i].style.webkitTransform = 'rotateZ(6deg)';\n containers[i].style.transform = 'rotateZ(6deg)';\n }\n // Then continue with a 60 second interval\n setInterval(function() {\n for (var i = 0; i < containers.length; i++) {\n if (containers[i].angle === undefined) {\n containers[i].angle = 12;\n } else {\n containers[i].angle += 0; //containers[i].angle += 6;\n }\n containers[i].style.webkitTransform = 'rotateZ('+ containers[i].angle +'deg)';\n containers[i].style.transform = 'rotateZ('+ containers[i].angle +'deg)';\n }\n }, 60000);\n}", "function rotateOnce() {\n \n $enterprise.css('text-indent', 0);\n \n $enterprise.animate(\n {\n 'text-indent': 2*Math.PI\n }, {\n step: function (now) {\n \n /* \n * Unlike the other example, we need to have the object\n * (in this case the Enterprise) rotate while it is \n * travelling around the sun, so we use cssSandpaper to\n * do this work.\n */\n cssSandpaper.setTransform($enterprise[0], \n 'rotate(' + now + 'rad) translateX(250px)');\n },\n \n duration: 20000,\n \n easing: 'linear',\n \n complete: rotateOnce\n }\n );\n}", "function rotate(direction) {\n player.stop();\n display.rotate(direction > 0 ? ROTATE_STEP : -ROTATE_STEP);\n }", "rotate(){\r\n if(this.state.spinTime > 2800) {\r\n clearTimeout(this.spinTimer);\r\n this.stopRotateWheel();\r\n } else {\r\n const spinAngle = this.rngSpinAngle - this.easeOut(this.state.spinTime, 0, this.rngSpinAngle, this.rngSpinTime);\r\n \r\n this.setState({\r\n startAngle: this.state.startAngle + spinAngle * Math.PI / 180,\r\n spinTime: this.state.spinTime + 30,\r\n }, () => {\r\n this.drawRouletteWheel();\r\n clearTimeout(this.spinTimer);\r\n this.spinTimer = setTimeout(() => this.rotate(), 30);\r\n })\r\n }\r\n }", "draw() {\n let ratio = this.animateUnit / this.totalUnits;\n this.element.style.transform = `rotate(${ratio * 360}deg)`;\n }", "rotate(rdelta) {\n this.rotation += rdelta\n this.tModelToWorld.setRotation(this.rotation)\n }", "function animate(){\n requestAnimationFrame(animate);\n\n // torus.rotation.y += 0.01\n object.rotation.y += 0.02\n\n\n renderer.render(scene, camera);\n}", "function Update (){\n\ttransform.Rotate(Vector3(0,rotationSpeed * 10,0) * Time.deltaTime);\n}", "function tick() {\n\n\n var moveSpeed = 2;\n var turnSpeed = 2;\n\n if(keys.left){\n lookAngle -= turnSpeed;\n if(lookAngle < 0) lookAngle = 360 + lookAngle;\n }\n else if(keys.right){\n lookAngle+=turnSpeed;\n if(lookAngle >= 360) lookAngle %= 360;\n }\n if(keys.up) {\n var vec = getMoveVector();\n $scope.eye.x += moveSpeed * vec[0];\n $scope.eye.y += moveSpeed * vec[1];\n }\n else if(keys.down){\n var vec = getMoveVector();\n $scope.eye.x-=moveSpeed*vec[0];\n $scope.eye.y-=moveSpeed*vec[1];\n }\n\n sunAngle++;\n sun.xform = new Matrix4().rotate(sunAngle/80,1,0,0);\n\n\n\n\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n for(var a = 0; a < drawables.length; a++){\n drawables[a].render($scope.eye);\n }\n requestAnimationFrame(tick, canvas);\n\n }", "function animate() {\n var timeNow = new Date().getTime();\n if(lastTime!=0){\n var elapsed = timeNow - lastTime;\n if(speed != 0) {\n camera.eyeX -= Math.sin(degToRad(yaw)) * speed * elapsed;\n camera.eyeZ -= Math.cos(degToRad(yaw)) * speed * elapsed;\n }\n camera.lapX = Math.sin(degToRad(yaw))*1000;\n camera.lapZ = Math.cos(degToRad(yaw))*1000;\n yaw += yawRate*elapsed;\n\n }\n lastTime = timeNow;\n angle = chosenSpeed * (45.0 * lastTime) / 1000.0;\n // angle %= 360;\n}", "_rotate() {\n this.attachmentViewer.update({ angle: this.attachmentViewer.angle + 90 });\n }", "function animateControlPanel()\n{\n service_control_panel.rotation.y -= CP_SPEED;\n time_control_panel.rotation.z += CP_SPEED/4;\n timeObj[\"REALTIME\"].rotation.y -= CP_SPEED/4;\n}", "rotate(theta, x, y, z){\n\t\tvar axis = new GFX.Vector(x,y,z);\n\t\tthis.rotation = this.rotation.mult(GFX.Quaternion.AxisAngle(axis.unit(), theta));\n\t}", "function rotateHands(){\n\n secondAngle = map(sc, 0, 60, 0, 360);\n minuteAngle = map(mn, 0, 60, 0, 360);\n hourAngle = map(hr%12, 0, 12, 0, 360);\n}", "function rotateContainer() {\n anime({\n targets: '.loading',\n rotate: '360deg',\n duration: 2000,\n // when complete expand the squares to cover the entirety of the viewport\n complete: expandSquares\n })\n}", "animateToAngle(angle_, time_) {\n let time = time_ || 1000;\n let relativeAngle = angle_ - this.position.angle || 0;\n if(relativeAngle !== 0){\n this.position.angle = angle_;\n let rotateTransform = {\n rotation: relativeAngle,\n cx:0,\n cy:0,\n relative:true\n };\n\n this.torso.animate(time, \">\", 0)\n .transform(rotateTransform, true);\n\n }\n }", "render({ time }) {\n controls.update();\n scene.rotation.x = time / 30;\n // scene.rotation.z = time / 50;\n renderer.render(scene, camera);\n }", "function moveSecondHands() {\r\n var containers = document.querySelectorAll('.seconds-container');\r\n setInterval(function() {\r\n for (var i = 0; i < containers.length; i++) {\r\n if (containers[i].angle === undefined) {\r\n containers[i].angle = 6;\r\n } else {\r\n containers[i].angle += 6;\r\n }\r\n containers[i].style.webkitTransform = 'rotateZ('+ containers[i].angle +'deg)';\r\n containers[i].style.transform = 'rotateZ('+ containers[i].angle +'deg)';\r\n }\r\n }, 1000);\r\n}", "rotate(angle) {\n this.heading += angle;\n let index = 0;\n for (let a = -this.fov; a < this.fov; a += 1) {\n this.rays[index].setAngle(radians(a) + this.heading);\n index++;\n }\n }", "function perpetual(board) {\n\tboard.rotation.x = (Math.radians(DEFAULT_ROTATION_PERPETUAL_X_START) + Math.cos(clock.elapsedTime*DEFAULT_ROTATION_PERPETUAL_X_SPEED * DEFAULT_ROTATION_PERPETUAL_X) * Math.radians(DEFAULT_ROTATION_PERPETUAL_X_AMPLITUDE));\n\tboard.rotation.y = (Math.radians(DEFAULT_ROTATION_PERPETUAL_Y_START) + Math.cos(clock.elapsedTime*DEFAULT_ROTATION_PERPETUAL_Y_SPEED * DEFAULT_ROTATION_PERPETUAL_Y + 300) * Math.radians(DEFAULT_ROTATION_PERPETUAL_Y_AMPLITUDE));\n}", "function rotate_z() {\n curr_sin = Math.sin(map.degree);\n curr_cos = Math.cos(map.degree);\n var x = (this.x * curr_cos) + (this.y * (-curr_sin));\n this.y = (this.x * curr_sin) + (this.y * (curr_cos));\n this.x = x;\n }", "function animate_to() {\n //Clear animation loop if degrees reaches to new_degrees\n if (degrees == new_degrees) clearInterval(animation_loop);\n \n if (degrees < new_degrees) degrees++;\n else degrees--;\n \n init();\n }", "function anim_reload(){\nconst galBlock = document.getElementById(\"galBlock\");\nconsole.log(\"rotate\");\ngalBlock.style.transform = \"rotateY(90deg)\";\n\n\n}", "function getCurrentTime(){\nhourPosition = hourPosition + (3 / 360)\nminutePosition = minutePosition + (6 / 60);\nsecondPosition = secondPosition + 6;\n\nhourHand.style.transform = \"rotate(\" + hourPosition + \"deg )\";\nminuteHand.style.transform = \"rotate(\" + minutePosition + \"deg )\";\nsecondHand.style.transform = \"rotate(\" + secondPosition + \"deg )\";\n}", "function update() {\r\n\r\n\tthis.loop.rotation += 0.1;\r\n}", "render({ time }) {\n mesh.rotation.y = time * 0.15;\n lightGroup.rotation.y = time * 0.5;\n controls.update();\n renderer.render(scene, camera);\n }", "function rotate2_90 (){\n angleRot2 += 90;\n cube2.style.transform = \"translateZ(-170px) rotateY(\"+ angleRot2 + \"deg)\";}", "rotateTo(azimuthAngle, polarAngle, enableTransition) {\n \n const theta = Math.max(this.minAzimuthAngle, Math.min(this.maxAzimuthAngle, azimuthAngle))\n const phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, polarAngle))\n \n this._sphericalEnd.theta = theta\n this._sphericalEnd.phi = phi\n this._sphericalEnd.makeSafe()\n \n if (!enableTransition) {\n \n this._spherical.theta = this._sphericalEnd.theta\n this._spherical.phi = this._sphericalEnd.phi\n \n }\n \n this._hasUpdated = true\n \n }", "rotate(rotateAmount) {\n\n\n let vectorsRelativeToCenter = [];\n for (let v of this.pixelVectorPositions) {\n vectorsRelativeToCenter.push(p5.Vector.sub(v, this.center));\n }\n\n for (let v of vectorsRelativeToCenter) {\n v.rotate(rotateAmount);\n }\n\n for (let i = 0; i < this.pixelVectorPositions.length; i++) {\n this.pixelVectorPositions[i] = p5.Vector.add(vectorsRelativeToCenter[i], this.center);\n }\n\n for (let f of this.fixtures) {\n f.rotate(rotateAmount, this.center);\n }\n }", "function rotate90 (){\n angleRot -= 90;\n cube1.style.transform = \"translateZ(-170px) rotateY(\"+ angleRot + \"deg)\";}", "function animate() {\n //tells the browser to \n requestAnimationFrame(animate)\n\n torus.rotation.x += 0.01;\n torus.rotation.y += 0.005;\n torus.rotation.z += 0.01;\n\n //controls.update();\n moon.rotation.x += 0.005;\n renderer.render(scene,camera)\n}", "function rotarFigura() {\n ctx.rotate(0.17);\n ctx.restore(); //dibuja la figura\n\n }", "timerPosition() {\n this.scene.translate(0,1,0.25);\n this.scene.scale(0.1,0.1,0.1);\n this.scene.rotate(Math.PI/2, 0, 1, 0);\n }", "rotateTurtle(x, y, z) {\n x = x * this.angle;\n y = 45;\n z = z * this.angle ;\n var e = new THREE.Euler(\n x * 3.14/180,\n\t\t\t\ty * 3.14/180,\n\t\t\t\tz * 3.14/180);\n this.state.dir.applyEuler(e);\n }", "function rotate(){\n\tvar ballRadius=12;\n\tvar posX = gameWindow1.bg.board.ballsArray[0].posX;\n\tvar posY = gameWindow1.bg.board.ballsArray[0].posY;\n\tgameWindow1.bg.board.stick.rotate(posX,posY,ballRadius);\n}", "function Start() {\n\t// transform.Rotate(-90,0,0);\n}", "function anim_reload_reverse(){\n const galBlock = document.getElementById(\"galBlock\");\n galBlock.style.transform = \"rotateY(0deg)\";\n \n \n }", "function bird_movement(bird_movement_interval){\n\tvar count = 0;\n\tsetInterval(function(){\n\t\tif(count%2 == 0){\n\t\t\t$(\".after_fly_brd\").css({\"transform\":\"rotateY(150deg)\"});\n\t\t}else{\n\t\t\t$(\".after_fly_brd\").css({\"transform\":\"rotateY(0deg)\"});\n\t\t}\t\t\n\t\tcount++;\n\t},bird_movement_interval)\n\t\n}", "function tick() {\n\n\n var moveSpeed = 2;\n var turnSpeed = 2;\n\n if (keys.left) {\n lookAngle -= turnSpeed;\n if (lookAngle < 0) lookAngle = 360 + lookAngle;\n }\n else if (keys.right) {\n lookAngle += turnSpeed;\n if (lookAngle >= 360) lookAngle %= 360;\n }\n if (keys.up) {\n var vec = getMoveVector();\n $scope.eye.x += moveSpeed * vec[0];\n $scope.eye.y += moveSpeed * vec[1];\n }\n else if (keys.down) {\n var vec = getMoveVector();\n $scope.eye.x -= moveSpeed * vec[0];\n $scope.eye.y -= moveSpeed * vec[1];\n }\n\n sunAngle++;\n sun.xform = new Matrix4().rotate(sunAngle / 80, 1, 0, 0);\n\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n for (var a = 0; a < drawables.length; a++) {\n drawables[a].render($scope.eye, $scope.ambientValue);\n }\n requestAnimationFrame(tick, canvas);\n\n }", "function clockBgRotation() {\n TweenMax.set(clockBgEl, {rotation: 0});\n TweenMax.to(clockBgEl, 60, {\n rotation: 359, \n ease: Power1.linear,\n onComplete: clockBgRotation\n });\n}", "function fireInterval(param) {\n //console.log('[fireInterval] hit! param=' + param);\n var n = $('#' + param.id);\n var t = \"rotate(-1 \" + (param.x + param.width/2) + \" \" + (param.y + param.height/2) + \")\";\n //console.log('[fireInterval] transform=' + t);\n n.attr(\"transform\", t);\n setTimeout(fireInterval2, 250, param);\n}", "function animate() {\n// if (then==0)\n// {\n// then = Date.now();\n// }\n// else\n// {\n// now=Date.now();\n// // Convert to seconds\n// now *= 0.001;\n// // Subtract the previous time from the current time\n// var deltaTime = now - then;\n// // Remember the current time for the next frame.\n// then = now;\n//\n// //Animate the rotation\n// modelXRotationRadians += 1.2 * deltaTime;\n// modelYRotationRadians += 0.7 * deltaTime; \n// }\n}" ]
[ "0.6983913", "0.64857525", "0.63927674", "0.6361528", "0.63423246", "0.63388485", "0.630926", "0.6284332", "0.62682617", "0.62682617", "0.618183", "0.6147924", "0.61002016", "0.60458523", "0.60326064", "0.60320854", "0.60225177", "0.59840155", "0.5983982", "0.59717625", "0.59703743", "0.5961356", "0.59356713", "0.59233123", "0.5909543", "0.5905459", "0.58856916", "0.5877843", "0.58762234", "0.58562964", "0.57679105", "0.57627845", "0.5754413", "0.57509303", "0.5708343", "0.56890297", "0.568622", "0.56686425", "0.5668474", "0.56678355", "0.565497", "0.5642832", "0.56172985", "0.5605866", "0.560313", "0.55887544", "0.55867773", "0.5585295", "0.5582864", "0.55721134", "0.5571877", "0.5571412", "0.55692697", "0.5561578", "0.55572337", "0.5548471", "0.5537946", "0.55346197", "0.55296093", "0.5525499", "0.5522115", "0.55194694", "0.5519241", "0.551084", "0.5510738", "0.55088395", "0.54892874", "0.54883844", "0.54857826", "0.54826593", "0.54748356", "0.54703796", "0.54700005", "0.5466417", "0.5462041", "0.5460164", "0.5454347", "0.5453169", "0.5446384", "0.54419917", "0.5436133", "0.54271185", "0.54267657", "0.5417214", "0.54165405", "0.5416235", "0.54142326", "0.5411834", "0.54117405", "0.5411481", "0.5411241", "0.53887784", "0.5384315", "0.53826165", "0.5373957", "0.5371718", "0.5367773", "0.5366039", "0.5357408", "0.5353563" ]
0.63778317
3
This plugin takes lake data from the special TopoJSON we're loading and draws them on the map.
function lakes(options) { options = options || {}; var lakes = null; return function(planet) { planet.onInit(function() { // We can access the data loaded from the TopoJSON plugin // on its namespace on `planet.plugins`. We're loading a custom // TopoJSON file with an object called "ne_110m_lakes". var world = planet.plugins.topojson.world; lakes = topojson.feature(world, world.objects.ne_110m_lakes); }); planet.onDraw(function() { planet.withSavedContext(function(context) { context.beginPath(); planet.path.context(context)(lakes); context.fillStyle = options.fill || 'black'; context.fill(); }); }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lakes(options) {\n\t options = options || {};\n\t var lakes = null;\n\t\n\t return function(planet) {\n\t planet.onInit(function() {\n\t // We can access the data loaded from the TopoJSON plugin\n\t // on its namespace on `planet.plugins`. We're loading a custom\n\t // TopoJSON file with an object called \"ne_110m_lakes\".\n\t var world = planet.plugins.topojson.world;\n\t lakes = topojson.feature(world, world.objects.ne_110m_lakes);\n\t });\n\t\n\t planet.onDraw(function() {\n\t planet.withSavedContext(function(context) {\n\t context.beginPath();\n\t planet.path.context(context)(lakes);\n\t context.fillStyle = options.fill || 'black';\n\t context.fill();\n\t });\n\t });\n\t };\n\t }", "function loadPumpStationlayer(pumpstationdata){\r\nvar pumpstationjson = JSON.parse(pumpstationdata);\r\nvar jproperties = pumpstationjson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nif (pumpstationarray=[]){\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tpumpstationarray.push(Object.values(jproperties[i]));\r\n}}\r\nif (pumpstapumpinc =[]){\r\nfor (i = 0; i < pumpstationarray.length; i++) { \r\n\tpumpstapumpinc.push([pumpstationarray[i][1],pumpstationarray[i][2]]);\r\n}}\r\n\r\nif (boroughfloodinclayer){\r\n\t\tmymap.removeLayer(boroughfloodinclayer);\r\n\t}\r\n\t\r\nif (pumpstationlayer){\r\n\tmymap.removeLayer(pumpstationlayer);\r\n}\r\n\r\n\r\n// REMOVING PREVIOUS INFO BOX\r\nif (legend != undefined) {\r\nlegend.remove();\r\n}\r\npumpstationlayer=L.geoJson(pumpstationjson,{pointToLayer: pumpstadisplay,onEachFeature:onEachpumpstaFeature});\r\npumpstationlayer.addTo(mymap);\r\npumpstationlayer.bringToFront();\r\n// change the map zoom so that all the data is shown\r\nmymap.fitBounds(pumpstationlayer.getBounds());\r\nanychart.onDocumentReady(chartpumpsta);\r\n}", "function lakes(options) {\n options = options || {};\n let lakes = null;\n\n return function(planet) {\n planet.onInit(function() {\n // We can access the data loaded from the TopoJSON plugin\n // on its namespace on `planet.plugins`. We're loading a custom\n // TopoJSON file with an object called \"ne_110m_lakes\".\n let world = planet.plugins.topojson.world;\n lakes = topojson.feature(world, world.objects.ne_110m_lakes);\n });\n\n planet.onDraw(function() {\n planet.withSavedContext(function(context) {\n context.beginPath();\n planet.path.context(context)(lakes);\n context.fillStyle = options.fill || 'black';\n context.fill();\n });\n });\n };\n }", "function lakes(options) {\n options = options || {};\n var lakes = null;\n\n return function (planet) {\n planet\n .onInit(function () {\n // We can access the data loaded from the TopoJSON plugin\n // on its namespace on `planet.plugins`. We're loading a custom\n // TopoJSON file with an object called \"ne_110m_lakes\".\n var world = planet.plugins.topojson.world;\n lakes = topojson.feature(world, world.objects.ne_110m_lakes);\n });\n\n planet.onDraw(function () {\n planet\n .withSavedContext(function (context) {\n context.beginPath();\n planet\n .path\n .context(context)(lakes);\n context.fillStyle = options.fill || 'black';\n context.fill();\n });\n });\n };\n }", "function lakes(options) {\n options = options || {};\n var lakesf = null;\n\n return function(planet) {\n planet.onInit(function() {\n // We can access the data loaded from the TopoJSON plugin\n // on its namespace on `planet.plugins`. We're loading a custom\n // TopoJSON file with an object called \"ne_110m_lakes\".\n var world = planet.plugins.topojson.world;\n if (world.objects.ne_110m_lakes) {\n lakesf = topojson.feature(world, world.objects.ne_110m_lakes);\n }\n });\n\n planet.onDraw(function() {\n if (lakesf === null) { return; }\n planet.withSavedContext(function(context) {\n context.beginPath();\n planet.path.context(context)(lakesf);\n context.fillStyle = options.fill || 'blue';\n context.fill();\n });\n });\n };\n }", "function getData(map){\n\n //load the data\n $.ajax(\"data/hotspotInfo.geojson\", {\n dataType: \"json\",\n success: function(response){\n\n //create a leaflet GeoJSON layer and add it to the map\n geojson = L.geoJson(response, {\n style: function (feature){\n if(feature.properties.TYPE === 'hotspot_area'){\n return {color: '#3182bd',\n weight: 2,\n stroke:1};\n } else if(feature.properties.TYPE ==='outer_limit'){\n return {color: '#9ecae1',\n weight: 2,\n stroke: 0,\n fillOpacity: .5};\n }\n },\n\n\n onEachFeature: function (feature,layer) {\n var popupContent = \"\";\n if (feature.properties) {\n //loop to add feature property names and values to html string\n popupContent += \"<h5>\" + \"Region\" + \": \" + feature.properties.NAME + \"</h5>\";\n\n if (feature.properties.TYPE ===\"hotspot_area\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot\" + \"</h5>\";\n\n }\n\n\n if (feature.properties.TYPE ===\"outer_limit\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot Outer Limit\" + \"</h5>\";\n\n }\n\n\n layer.bindPopup(popupContent);\n\n };\n\n\n layer.on({\n mouseover: highlightFeature,\n mouseout: resetHighlight,\n click: zoomToFeature\n });\n layer.on({\n click: panelInfo,\n })\n }\n }).addTo(map);\n\n //load in all the biodiversity and threatened species image overlays\n var noneUrl = 'img/.png',\n noneBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var none = L.imageOverlay(noneUrl, noneBounds);\n\n \tvar amphibianUrl = 'img/amphibian_richness_10km_all.png',\n \tamphibianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var amphibians = L.imageOverlay(amphibianUrl, amphibianBounds);\n\n var caecilianUrl = 'img/caecilian_richness_10km.png',\n \tcaecilianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caecilians = L.imageOverlay(caecilianUrl, caecilianBounds);\n\n var anuraUrl = 'img/frog_richness_10km.png',\n \tanuraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var anura = L.imageOverlay(anuraUrl, anuraBounds);\n\n var caudataUrl = 'img/salamander_richness_10km.png',\n \tcaudataBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caudata = L.imageOverlay(caudataUrl, caudataBounds);\n\n var threatenedaUrl = 'img/threatened_amp.png',\n threatenedaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threateneda = L.imageOverlay(threatenedaUrl, threatenedaBounds);\n\n var birdsUrl ='img/birds.png',\n birdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var birds = L.imageOverlay(birdsUrl, birdsBounds);\n\n var psittaciformesUrl = 'img/psittaciformes_richness.png',\n psittaciformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var psittaciformes = L.imageOverlay(psittaciformesUrl, psittaciformesBounds);\n\n var passeriformesUrl = 'img/passeriformes_richness.png',\n \t passeriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var passeriformes = L.imageOverlay(passeriformesUrl, passeriformesBounds)\n\n var nonpasseriformesUrl = 'img/nonPasseriformes.png',\n nonpasseriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var nonpasseriformes = L.imageOverlay(nonpasseriformesUrl, nonpasseriformesBounds)\n\n var hummingbirdsUrl = 'img/hummingbirds.png',\n hummingbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var hummingbirds = L.imageOverlay(hummingbirdsUrl, hummingbirdsBounds)\n\n var songbirdsUrl = 'img/songbirds_richness.png',\n \tsongbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var songbirds = L.imageOverlay(songbirdsUrl, songbirdsBounds);\n\n var threatenedbUrl = 'img/threatened_birds.png',\n threatenedbBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedb = L.imageOverlay(threatenedbUrl, threatenedbBounds);\n\n var mammalsUrl = 'img/mammals.png',\n mammalsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var mammals = L.imageOverlay(mammalsUrl, mammalsBounds);\n\n var carnivoraUrl = 'img/carnivora.png',\n carnivoraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var carnivora = L.imageOverlay(carnivoraUrl, carnivoraBounds);\n\n var cetartiodactylaUrl = 'img/cetartiodactyla.png',\n cetartiodactylaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var cetartiodactyla = L.imageOverlay(cetartiodactylaUrl, cetartiodactylaBounds);\n\n var chiropteraUrl = 'img/chiroptera_bats.png',\n chiropteraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var chiroptera = L.imageOverlay(chiropteraUrl, chiropteraBounds);\n\n var eulipotyphlaUrl = 'img/eulipotyphla.png',\n eulipotyphlaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var eulipotyphla = L.imageOverlay(eulipotyphlaUrl, eulipotyphlaBounds);\n\n var marsupialsUrl = 'img/marsupials.png',\n marsupialsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var marsupials = L.imageOverlay(marsupialsUrl, marsupialsBounds);\n\n var primatesUrl = 'img/primates.png',\n primatesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var primates = L.imageOverlay(primatesUrl, primatesBounds);\n\n var rodentiaUrl = 'img/rodentia.png',\n rodentiaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var rodentia = L.imageOverlay(rodentiaUrl, rodentiaBounds);\n\n var threatenedmUrl = 'img/threatened_mammals.png',\n threatenedmBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedm = L.imageOverlay(threatenedmUrl, threatenedmBounds);\n\n //define structure of layers and overlays\n var animals = [\n {\n groupName: \"Overlays Off\",\n expanded: false,\n layers: {\n \"Overlays Off\": none\n }\n }, {\n groupName: \"Amphibians\",\n expanded: true,\n layers: {\n \"All Amphibians\": amphibians,\n \t\"Caecilian\": caecilians,\n \t\"Anura\": anura,\n \t\"Caudata\": caudata\n }\n }, {\n groupName: \"Birds\",\n expanded: true,\n layers: {\n \"Birds\": birds,\n \t\"Psittaciformes\": psittaciformes,\n \t\"Passeriformes\": passeriformes,\n \"NonPasseriformes\": nonpasseriformes,\n \"Trochilidae\": hummingbirds,\n \t\"Passeri\": songbirds\n }\n }, {\n groupName: \"Mammals\",\n expanded: true,\n layers: {\n \"All Mammals\": mammals,\n \"Carnivora\": carnivora,\n \"Cetartiodactyla\": cetartiodactyla,\n \"Chiroptera\": chiroptera,\n \"Eulipotyphla\": eulipotyphla,\n \"Marsupials\": marsupials,\n \"Primates\": primates,\n \"Rodentia\": rodentia\n }\n }, {\n groupName: \"Threatened Species\",\n expanded: true,\n layers: {\n \"Threatened Amphibians\": threateneda,\n \"Threatened Birds\": threatenedb,\n \"Threatened Mammals\": threatenedm\n }\n }\n ];\n\n var overlay = [\n {\n groupName: \"Hotspots\",\n expanded: true,\n layers: {\n \"Hotspots (Biodiversity Hotspots are regions containing high biodiversity but are also threatened with destruction. Most hotspots have experienced greated than 70% habitat loss.)\": geojson\n }\n }\n ];\n\n //style the controls\n var options = {\n group_maxHeight: \"200px\",\n exclusive: false,\n collapsed: false\n }\n\n //add heat maps and hotspot overlay to map\n var control = L.Control.styledLayerControl(animals, overlay, options);\n control._map = map;\n var controlDiv = control.onAdd(map);\n\n document.getElementById('controls').appendChild(controlDiv);\n\n $(\".leaflet-control-layers-selector\").on(\"change\", function(){\n $(\"#mapinfo\").empty();\n if ( map.hasLayer(amphibians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caecilians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(anura)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caudata)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(threateneda)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(birds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(psittaciformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(nonpasseriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(passeriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(hummingbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(songbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(threatenedb)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if(map.hasLayer(mammals)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(carnivora)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(cetartiodactyla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(chiroptera)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(eulipotyphla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(marsupials)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(primates)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(rodentia)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(threatenedm)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(geojson)){\n };\n });\n\n}\n});\n\n\n\n}", "function addwifihotspotData() {\n $.getJSON( \"../../geojson/NYC_Wi-Fi_Hotspot_Locations.geojson\", function( data ) {\n var wifihotspot = data;\n\n var wifihotspotPointToLayer = function (Feature, latlng){\n var wifihotspotMarker= L.circle(latlng, 300, {\n fillColor: 'tomato',\n fillOpacity: 1\n });\n \n return wifihotspotMarker; \n }\n\n var wifihotspotMouseOver = function (Feature, layer) {\n\n // let's bind some feature properties to a pop up\n layer.bindPopup(\"<strong>Name:</strong> \" + Feature.properties.businessname+ \"<br/><strong>Business Type: </strong>\" + Feature.properties.businesstype +\"<br/><strong>Address:</br></strong>\" + Feature.properties.address + \"<br/><strong>Design Services Needed: </strong>\" + Feature.properties.design);\n }\n\n // create Leaflet layer using L.geojson; don't add to the map just yet\n wifihotspotGeoJSON = L.geoJson(wifihotspot, {\n pointToLayer: wifihotspotPointToLayer,\n onEachFeature: wifihotspotMouseOver\n });\n\n // don't add the pawn shop layer to the map yet\n\n // run our next function to bring in the Pawn Shop data\n addNeighborhoodData();\n\n });\n\n}", "function displayGeojson(dataIn) {\n var routeLayer = new google.maps.Data();\n //routeLayer.setMap(null);\n var geojsonURL1 = 'http://localhost:9000/routeserver/';\n var geojsonURL2 = 'TMRoutes?=format%3Djson&format=json&rte=';\n var geojsonRteURL = dataIn;\n routeLayer.loadGeoJson(geojsonURL1 + geojsonURL2 + geojsonRteURL);\n routeLayer.setStyle(function(feature){\n return{\n strokeColor: 'blue',\n strokeOpacity: 0.5,\n };\n })\n routeLayer.setMap(map);\n mapObjects.push(routeLayer);\n}", "function DisplayGEOJsonLayers(){\n map.addLayer({ \n //photos layer\n \"id\": \"photos\",\n \"type\": \"symbol\",\n \"source\": \"Scotland-Foto\",\n \"layout\": {\n \"icon-image\": \"CustomPhoto\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg'); // Place polygon under this labels.\n\n map.addLayer({ \n //selected rout section layer\n \"id\": \"routes-today\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'housenum-label'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"routes\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(120, 180, 244, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"routes-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'routes'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"walked\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(80, 200, 50, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"walked-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'walked'); // Place polygon under this labels.\n\n map.addLayer({\n \"id\": \"SelectedMapLocationLayer\",\n \"type\": \"symbol\",\n \"source\": \"SelectedMapLocationSource\",\n \"layout\": {\n \"icon-image\": \"CustomPhotoSelected\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg');\n //ClickbleMapItemCursor(); //Now that the layers a loaded, have the mouse cursor change when hovering some of the layers\n NewSelectedMapLocation();\n\n}", "function loadLayer(features){\n try{\n var contents=features;\n var fc = JSON.parse(JSON.stringify(eval(\"(\" + contents + \")\")));\n //var fc = turf.featurecollection(res.geojson);\n var color=geoOperation.get_random_color();\n angular.forEach(fc.features, function(value, key){\n if (fc.features[key].properties==null){\n fc.features[key].properties={};\n }\n });\n leafletData.getMap(\"mapabase2\").then(function(map) {\n map.spin(true);\n var geojson=L.geoJson(fc, {\n style: function (feature) {\n if(feature.properties['stroke']!=null&&feature.properties['stroke-width']!=null&&feature.properties['stroke-opacity']!=null&&feature.properties['fill']!=null&&feature.properties['fill-opacity']!=null){\n return {color:feature.properties['stroke'],weight:feature.properties['stroke-width'],opacity:feature.properties['stroke-opacity'],fillOpacity:feature.properties['fill-opacity'],fillColor:feature.properties['fill']};\n }else if(feature.properties['stroke']!=null&&feature.properties['stroke-width']!=null&&feature.properties['stroke-opacity']!=null){\n if(feature.properties['line-stroke']!=null){\n if(feature.properties['line-stroke']=='stroke1'){\n return {stroke: true, color:feature.properties['stroke'], weight:feature.properties['stroke-width'], opacity:feature.properties['stroke-opacity'],dashArray:'1'};\n }else if(feature.properties['line-stroke']=='stroke2'){\n return {stroke: true, color:feature.properties['stroke'], weight:feature.properties['stroke-width'], opacity:feature.properties['stroke-opacity'],dashArray:'10,10'};\n }else if(feature.properties['line-stroke']=='stroke3'){\n return {stroke: true, color:feature.properties['stroke'], weight:feature.properties['stroke-width'], opacity:feature.properties['stroke-opacity'],dashArray:'15, 10, 1, 10'};\n }\n\n }else{\n return {stroke: true, color:feature.properties['stroke'], weight:feature.properties['stroke-width'], opacity:feature.properties['stroke-opacity']};\n }\n }else {\n return {stroke: true, color: '#000000', weight:2, fillOpacity: 1.0, fillColor: color};\n }\n },\n onEachFeature: function(feature, layer){\n try{\n if(feature.properties['marker-color']!=null&&feature.properties['marker-symbol']!=null){\n\n var markerSymbol=feature.properties['marker-symbol'];\n var markerColor=feature.properties['marker-color'];\n var markerSize=feature.properties['marker-size'];\n var mSize=\"s\";\n\n if(markerSize==\"small\"){\n mSize=\"s\";\n }else if(markerSize==\"medium\"){\n mSize=\"m\";\n }else if(markerSize==\"large\"){\n mSize=\"l\";\n }else{\n mSize=\"s\";\n markerSize=\"small\";\n }\n var iconSize;\n switch (markerSize) {\n case \"small\":\n iconSize = [20, 50];\n break;\n case \"medium\":\n iconSize = [30, 70];\n break;\n case \"large\":\n iconSize = [35, 90];\n break;\n }\n markerColor=markerColor.replace(\"#\",\"\");\n //Set marker icon\n if(markerSymbol!=\"\"){\n if(markerSymbol!=\" \"){\n var iconURL=mapAPI+'pin-'+mSize+'-'+markerSymbol+'+'+markerColor+'.png';\n layer.setIcon(new L.Icon({iconUrl: iconURL, iconSize: iconSize,\n iconAnchor: [iconSize[0] / 2, iconSize[1] / 2],\n popupAnchor: [0, -iconSize[1] / 2]}));\n }\n }\n }\n }catch(err){\n\n }\n var content = '<table class=\"dropchop-table\"><tr>';\n if (layer.feature.properties) {\n for (var prop in layer.feature.properties) {\n if(prop==\"fill\"){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;background-color:' + layer.feature.properties[prop] + ';\"></div></td></tr>';\n }else if(prop==\"stroke\"){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;background-color:' + layer.feature.properties[prop] + ';\"></div></td></tr>';\n }else if(prop==\"line-stroke\"){\n var sColor=layer.feature.properties[\"stroke\"];\n if(layer.feature.properties['line-stroke']=='stroke1'){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;margin-top: -15px;border-bottom:2px solid '+sColor+';\"></div></td></tr>';\n }else if(layer.feature.properties['line-stroke']=='stroke2'){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:95%;height:20px;margin-top: -15px;border-bottom: 2px dashed '+sColor+';\"></div></td></tr>';\n }else if(layer.feature.properties['line-stroke']=='stroke3'){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;margin-top: -15px;border-bottom: 2px dotted '+sColor+';\"></div></td></tr>';\n }else{\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;margin-top: -15px;border-bottom:2px solid '+sColor+';\"></div></td></tr>';\n }\n }else if(prop==\"marker-symbol\"){\n var mColor=layer.feature.properties[\"marker-color\"];\n mColor=mColor.replace('#','');\n var mSrc=mapAPI+'pin-m-'+layer.feature.properties[prop]+'+'+mColor+'.png';\n var img='<img src=\"'+mSrc+'\" width=\"20\" height=\"35\" style=\"margin-top: 15px;\">';\n content += '<tr><td><strong>' + prop + '</strong></td><td style=\"text-align:center;\">' + img + '</td></tr>';\n }else{\n if(prop!=\"marker-color\"){\n content += '<tr><td><strong>' + prop + '</strong></td><td>' + layer.feature.properties[prop] + '</td></tr>';\n }\n\n }\n\n }\n }else {\n //content += '<p></p>';\n }\n content += '</table>';\n layer.bindPopup(L.popup({\n maxWidth: 450,\n maxHeight: 200,\n autoPanPadding: [45, 45],\n className: 'dropchop-popup'\n }, layer).setContent(content));\n }\n\n }).addTo(map);\n aLayers.push(geojson);\n map.fitBounds(geojson.getBounds());\n map.spin(false);\n });\n\n }catch(err){\n //console.log(err);\n }\n }", "function loadGeomitriesOfObject() {\n var json = document.getElementById(\"white\").innerHTML;\n var geojson = JSON.parse(json);\n geojson = JSON.parse(\"\"+geojson+\"\");\n var bild = geojson.features[0].features[0].properties.img;\n var iname = geojson.features[0].features[0].properties.name;\n var layer = L.geoJSON(geojson.features[0]).addTo(map);\n var marker = L.geoJSON(geojson.features[1]).addTo(map).bindPopup(\"<h5>\"+iname+\"<h5><img src=\"+bild+\" width='200'><br>\").openPopup();\n map.fitBounds(layer.getBounds());\n}", "function loadMaps() {\n axios.get('/api/loadMaps')\n .then(response => {\n var lots = [];\n for(let x = 0; x < response.data.length; x++) {\n lots.push({\n type: 'Feature',\n properties: {\n id: response.data[x]['id'],\n lot: response.data[x]['lot'],\n watering_type: response.data[x]['watering_type'],\n soil_type: response.data[x]['soil_type'],\n municipality: response.data[x]['municipality'],\n barangay: response.data[x]['barangay'],\n area: response.data[x]['area'],\n coordinates: response.data[x]['coordinates'],\n lot_lat: response.data[x]['lot_lat'],\n lot_lng: response.data[x]['lot_lng'],\n municipality_name: response.data[x]['municipality_name'],\n barangay_name: response.data[x]['barangay_name']\n },\n geometry: {\n type: 'Polygon',\n coordinates: JSON.parse(response.data[x]['coordinates'])\n }\n });\n }\n L.geoJSON(lots, {\n onEachFeature: onEachFeature\n }).addTo(map);\n })\n .catch(error => {\n console.log(error);\n }); \n }", "function loadMap() {\n\n //Change the cursor\n map.getCanvas().style.cursor = 'pointer';\n\n //NOTE Draw order is important, largest layers (covers most area) are added first, followed by small layers\n\n\n //Add raster data and layers\n rasterLayerArray.forEach(function(layer) {\n map.addSource(layer[0], {\n \"type\": \"raster\",\n \"tiles\": layer[1]\n });\n\n map.addLayer({\n \"id\": layer[2],\n \"type\": \"raster\",\n \"source\": layer[0],\n 'layout': {\n 'visibility': 'none'\n }\n });\n });\n\n //Add polygon data and layers\n polyLayerArray.forEach(function(layer) {\n map.addSource(layer[0], {\n \"type\": \"vector\",\n \"url\": layer[1]\n });\n\n map.addLayer({\n \"id\": layer[2],\n \"type\": \"fill\",\n \"source\": layer[0],\n \"source-layer\": layer[3],\n \"paint\": layer[4],\n 'layout': {\n 'visibility': 'none'\n }\n });\n });\n\n map.setLayoutProperty('wildness', 'visibility', 'visible');\n\n //Add wildness vector data source and layer\n for (i = 0; i < polyArray.length; i++) {\n map.addSource(\"vector-data\"+i, {\n \"type\": \"vector\",\n \"url\": polyArray[i]\n });\n\n //fill-color => stops sets a gradient\n map.addLayer({\n \"id\": \"vector\" + i,\n \"type\": \"fill\",\n \"source\": \"vector-data\" + i,\n \"source-layer\": polySource[i],\n \"minzoom\": 6,\n \"maxzoom\": 22,\n \"paint\": wildPolyPaint\n });\n }\n\n //Add polygon/line data and layers\n for (i=0; i<lineLayerArray.length; i++) {\n map.addSource(lineLayerArray[i][0], {\n \"type\": \"vector\",\n \"url\": lineLayerArray[i][1]\n })\n\n map.addLayer({\n \"id\": lineLayerArray[i][2],\n \"type\": \"line\",\n \"source\": lineLayerArray[i][0],\n \"source-layer\": lineLayerArray[i][4],\n \"paint\": {\n 'line-color': lineLayerArray[i][5],\n 'line-width': 2\n }\n });\n\n map.addLayer({\n \"id\": lineLayerArray[i][3],\n \"type\": \"fill\",\n \"source\": lineLayerArray[i][0],\n \"source-layer\": lineLayerArray[i][4],\n \"paint\": {\n 'fill-color': lineLayerArray[i][5],\n 'fill-opacity': .3\n }\n });\n\n map.setLayoutProperty(lineLayerArray[i][2], 'visibility','none');\n map.setLayoutProperty(lineLayerArray[i][3], 'visibility','none');\n map.moveLayer(lineLayerArray[i][2]);\n map.moveLayer(lineLayerArray[i][3]);\n }\n\n //Add States data set\n map.addSource('states', {\n \"type\": \"vector\",\n \"url\": \"mapbox://wildthingapp.2v1una7q\"\n });\n\n //Add States outline layer, omitting non-state territories\n map.addLayer({\n \"id\": \"states-layer\",\n \"type\": \"line\",\n \"source\": \"states\",\n \"source-layer\": \"US_State_Borders-4axtaj\",\n \"filter\": [\"!in\",\"NAME\",\"Puerto Rico\", \"Guam\",\"American Samoa\", \"Commonwealth of the Northern Mariana Islands\",\"United States Virgin Islands\"]\n });\n\n map.setLayerZoomRange('wildness', 0, 7);\n}", "function createFeatures(UFOPlots) {\nconsole.log(\"-----------\");\nconsole.log(UFOPlots.features[20][\"geometry\"].properties.index);\ncurindx =UFOPlots.features[20][\"geometry\"].properties.index \nurlcall =\"/api_getUFOText_v1.1 <\" + curindx + \">\"\nconsole.log(getText(urlcall))\nconsole.log(UFOPlots.features[20][\"geometry\"].properties.Date_Time);\n console.log(UFOPlots.features[20][\"geometry\"].properties.Shape);\n console.log(UFOPlots.features[20][\"geometry\"].properties.Duration); \nconsole.log(UFOPlots.features[20][\"geometry\"].coordinates[0]);\nconsole.log(UFOPlots.features[20][\"geometry\"].coordinates[1]);\n\nlet plot = [];\nlet plot2 =[];\nvar test=[]; \n// let features = UFOPlots.features;\n// features.forEach(f => {\n// coords = f.geometry.coordinates;\n// plot.push([coords[1]['latitude'], coords[0]['longitude']])\n// });\n\n let features = UFOPlots[\"features\"];\n console.log(\"Point 20:\",features[20]['geometry'].coordinates[0] ,features[20]['geometry'].coordinates[1] );\nfor (let i = 0; i < UFOPlots[\"features\"].length; i++){\n let test = [features[i]['geometry'].coordinates[0] , features[i]['geometry'].coordinates[1]] \n let lng =features[i]['geometry'].coordinates[0]//['longitude']\n let lat =features[i]['geometry'].coordinates[1]//['latitude']\n plot.push([lng,lat])\n plot2.push([lat,lng])\n //plot.push(test);\n} \nconsole.log(\"here\");\n// console.log(plot);\n\nvar MiB2 = L.geoJson(plot,{\n pointToLayer: function (features, plot) {\n return L.circleMarker(plot, geojsonMarkerOptions_MiB)\n .bindPopup(\"<h3>\" + \"Base: \" + features.properties[2] +\n \"</h3><hr><p>\" + \"Military Branch: \" + features.properties[2] + \"<br>\" +\n \"State: \" + features.properties[2] + \"</p>\");\n }\n});\n // createMap(MiB,true);\n //if you used the heat map with the for loop above, this will work \nvar MiB2 = L.heatLayer(plot, {\n radius: 10,\n blur: 1\n}); \nconsole.log(\"here after\");\n// Sending our UFO layer to the createMap function\ncreateMap(MiB2,true);\n}", "function loadMapShapes() {\n\n map.data.loadGeoJson('https://raw.githubusercontent.com/lotharJiang/Cluster-Sentiment-Analysis/master/Data%20Visualisation/newVicJson.json',{idPropertyName:'Suburb_Name'});\n\n google.maps.event.addListenerOnce(map.data,\"addfeature\",function(){\n google.maps.event.trigger(document.getElementById('Aurin-Variable'),'change');\n })\n\n map2.data.loadGeoJson('https://raw.githubusercontent.com/lotharJiang/Cluster-Sentiment-Analysis/master/Data%20Visualisation/newVicJson.json',{idPropertyName:'Suburb_Name'});\n\n google.maps.event.addListenerOnce(map2.data,\"addfeature\",function(){\n google.maps.event.trigger(document.getElementById('Aurin-Variable2'),'change');\n })\n}", "function createMap(){\n\n var black = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png', {maxZoom: 19}),\n satelite = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {\n attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'\n });\n\n var leafletMap = L.map('map',{\n center: [6.45, -9.5],\n zoom: 8,\n layers: [black,satelite]\n});\n\n var baseMaps = {\n \"Satelite\": satelite,\n \"Black\": black\n};\n \n\n L.control.layers(baseMaps).addTo(leafletMap);\n\n\n ////////////////////////////////////////////////////// Counties JSON\n\n // waCountiesJSON = L.geoJson(waCounties, {\n // style: lowStyle,\n // onEachFeature: onEachLowFeature\n // }).addTo(leafletMap); \n\n // slCountiesJSON = L.geoJson(slCounties, {\n // style: style,\n // onEachFeature: onEachFeature\n // }).addTo(leafletMap); \n\n // ginCountiesJSON = L.geoJson(ginCounties, {\n // style: style,\n // onEachFeature: onEachFeature\n // }).addTo(leafletMap); \n\n libCountiesJSON = L.geoJson(libCounties, {\n style: style,\n onEachFeature: onEachFeature\n }).addTo(leafletMap); \n\n ////////////////////////////////////////////////////////// Country JSON\n\n libOutline = L.geoJson(libCountry, {\n style: countryStyle,\n }).addTo(leafletMap); \n\n\n\n//////////////////////////////////////////////////////////// Roads\n\n libRoadJSON = L.geoJson(libROADS, {\n style: roadStyle,\n \n }).addTo(leafletMap); \n\n//////////////////////////////////////////////////// ETU JSON Files\n \n libJSON = L.geoJson(libETUData, {\n style: ETUstyle,\n pointToLayer : pointToLayer,\n onEachFeature: onEachETU\n}).addTo(leafletMap); \n\n// slJSON = L.geoJson(slETUData, {\n// style: ETUstyle,\n// pointToLayer : pointToLayer,\n// onEachFeature: onEachETU\n// }).addTo(leafletMap); \n\n// ginJSON = L.geoJson(ginETUData, {\n// style: ETUstyle,\n// pointToLayer : pointToLayer,\n// onEachFeature: onEachETU \n// }).addTo(leafletMap); \n\n CCCJSON = L.geoJson(CCCData, {\n style: ETUstyle,\n pointToLayer : pointToLayer,\n onEachFeature: onEachETU \n}).addTo(leafletMap); \n\n\n//////////////////////////////////////////////////////////// health centers \n\n// ginHealthJSON = L.geoJson(ginHealth, {\n// style: ETUstyle,\n// pointToLayer : HpointToLayer,\n// onEachFeature: onEachETU\n// }).addTo(leafletMap); \n\n libHealthJSON = L.geoJson(libHealth, {\n style: healthStyle,\n pointToLayer : HpointToLayer,\n onEachFeature: onEachHealth\n}).addTo(leafletMap); \n\n// slHealthJSON = L.geoJson(slHealth, {\n// style: ETUstyle,\n// pointToLayer : HpointToLayer,\n// onEachFeature: onEachETU \n// }).addTo(leafletMap); \n}", "function loadfloodrisklayer(floodriskdata){\r\nvar floodriskjson = JSON.parse(floodriskdata);\r\nvar features = []; \r\nfeatures = floodriskjson.features; \r\n// convert data from geojson to anychart data format\r\nvar jproperties = floodriskjson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nif (floodriskarray=[]){\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tfloodriskarray.push(Object.values(jproperties[i]));\r\n}\r\n}\r\nif (floodriskper=[]){\r\nfor (i = 0; i < floodriskarray.length; i++) { \r\n\tfloodriskper.push([floodriskarray[i][1],floodriskarray[i][2]]);\r\n}\r\n}\r\nif (boroughfloodinclayer){\r\n\t\tmymap.removeLayer(boroughfloodinclayer);\r\n\t}\r\n\t\r\nif (pumpstationlayer){\r\n\tmymap.removeLayer(pumpstationlayer);\r\n}\r\n\r\n\r\n// REMOVING PREVIOUS INFO BOX\r\nif (legend != undefined) {\r\nlegend.remove();\r\n}\r\n\r\n\r\nfloodrisklayer=L.geoJson(floodriskjson, {style: FloodRiskstyle,onEachFeature: onEachfloodriskFeature}).addTo(mymap);\r\n// change the map zoom so that all the data is shown\r\nmymap.fitBounds(floodrisklayer.getBounds());\r\ngetPumpStation();\r\n}", "function loadEarthquakelayer(earthquakedata) \r\n{\r\n\t// convert the text to JSON\r\n\tvar earthquakejson = JSON.parse(earthquakedata);\r\n\tearthquakes = earthquakejson;\r\n\t// add the JSON layer onto the map\r\n\tearthquakelayer = L.geoJson(earthquakejson).addTo(mymap);\r\n\t// change the map zoom so that all the data is shown\r\n\tmymap.fitBounds(earthquakelayer.getBounds());\r\n}", "function style(data, callback){\n L.geoJson(data, {style: callback}).addTo(map);\n}", "function onLoad() {\n // Load map.\n OpenLayers.ProxyHost = '/proxy/';\n map = new OpenLayers.Map('map');\n map.addControl(new OpenLayers.Control.LayerSwitcher());\n\n var layer = new OpenLayers.Layer.WMS('OpenLayers WMS',\n 'http://labs.metacarta.com/wms/vmap0',\n {layers: 'basic'},\n {wrapDateLine: true});\n map.addLayer(layer);\n map.setCenter(new OpenLayers.LonLat(-145, 0), 3);\n\n // Add layer for the buoys.\n buoys = new OpenLayers.Layer.Markers('TAO array');\n map.addLayer(buoys);\n\n // Add buoys. Apparently, dapper always returns the data\n // in the order lon/lat/_id, independently of the projection.\n var url = baseUrl + \".dods?location.lon,location.lat,location._id\";\n jsdap.loadData(url, plotBuoys, '/proxy/');\n\n // Read variables in each location.\n jsdap.loadDataset(baseUrl, loadVariables, '/proxy/');\n}", "function createMap(){\n\n //create the map\n var map = L.map('mapid', {\n center: [20, 0],\n zoom: 2,\n maxBounds:[\n [70, 176],\n [-48, -130]\n ],\n minZoom: 2,\n maxZoom: 6,\n zoomControl: false\n });\n\n map.addControl(new L.Control.ZoomMin());\n\n //create the layers to make the maps\n L.tileLayer('http://korona.geog.uni-heidelberg.de/tiles/roadsg/x={x}&y={y}&z={z}', {\n maxZoom: 19,\n\t attribution: 'Imagery from <a href=\"http://giscience.uni-hd.de/\">GIScience Research Group @ University of Heidelberg</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>; <a href=\"http://biodiversitymapping.org/wordpress/index.php/home/\">Biodiversity Mapping</a>'\n\t }).addTo(map);\n\n//call getData function\ngetData(map);\n\nvar geojson;\n\n //function to retrieve map data\n function getData(map){\n\n //load the data\n $.ajax(\"data/hotspotInfo.geojson\", {\n dataType: \"json\",\n success: function(response){\n\n //create a leaflet GeoJSON layer and add it to the map\n geojson = L.geoJson(response, {\n style: function (feature){\n if(feature.properties.TYPE === 'hotspot_area'){\n return {color: '#3182bd',\n weight: 2,\n stroke:1};\n } else if(feature.properties.TYPE ==='outer_limit'){\n return {color: '#9ecae1',\n weight: 2,\n stroke: 0,\n fillOpacity: .5};\n }\n },\n\n\n onEachFeature: function (feature,layer) {\n var popupContent = \"\";\n if (feature.properties) {\n //loop to add feature property names and values to html string\n popupContent += \"<h5>\" + \"Region\" + \": \" + feature.properties.NAME + \"</h5>\";\n\n if (feature.properties.TYPE ===\"hotspot_area\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot\" + \"</h5>\";\n\n }\n\n\n if (feature.properties.TYPE ===\"outer_limit\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot Outer Limit\" + \"</h5>\";\n\n }\n\n\n layer.bindPopup(popupContent);\n\n };\n\n\n layer.on({\n mouseover: highlightFeature,\n mouseout: resetHighlight,\n click: zoomToFeature\n });\n layer.on({\n click: panelInfo,\n })\n }\n }).addTo(map);\n\n //load in all the biodiversity and threatened species image overlays\n var noneUrl = 'img/.png',\n noneBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var none = L.imageOverlay(noneUrl, noneBounds);\n\n \tvar amphibianUrl = 'img/amphibian_richness_10km_all.png',\n \tamphibianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var amphibians = L.imageOverlay(amphibianUrl, amphibianBounds);\n\n var caecilianUrl = 'img/caecilian_richness_10km.png',\n \tcaecilianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caecilians = L.imageOverlay(caecilianUrl, caecilianBounds);\n\n var anuraUrl = 'img/frog_richness_10km.png',\n \tanuraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var anura = L.imageOverlay(anuraUrl, anuraBounds);\n\n var caudataUrl = 'img/salamander_richness_10km.png',\n \tcaudataBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caudata = L.imageOverlay(caudataUrl, caudataBounds);\n\n var threatenedaUrl = 'img/threatened_amp.png',\n threatenedaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threateneda = L.imageOverlay(threatenedaUrl, threatenedaBounds);\n\n var birdsUrl ='img/birds.png',\n birdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var birds = L.imageOverlay(birdsUrl, birdsBounds);\n\n var psittaciformesUrl = 'img/psittaciformes_richness.png',\n psittaciformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var psittaciformes = L.imageOverlay(psittaciformesUrl, psittaciformesBounds);\n\n var passeriformesUrl = 'img/passeriformes_richness.png',\n \t passeriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var passeriformes = L.imageOverlay(passeriformesUrl, passeriformesBounds)\n\n var nonpasseriformesUrl = 'img/nonPasseriformes.png',\n nonpasseriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var nonpasseriformes = L.imageOverlay(nonpasseriformesUrl, nonpasseriformesBounds)\n\n var hummingbirdsUrl = 'img/hummingbirds.png',\n hummingbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var hummingbirds = L.imageOverlay(hummingbirdsUrl, hummingbirdsBounds)\n\n var songbirdsUrl = 'img/songbirds_richness.png',\n \tsongbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var songbirds = L.imageOverlay(songbirdsUrl, songbirdsBounds);\n\n var threatenedbUrl = 'img/threatened_birds.png',\n threatenedbBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedb = L.imageOverlay(threatenedbUrl, threatenedbBounds);\n\n var mammalsUrl = 'img/mammals.png',\n mammalsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var mammals = L.imageOverlay(mammalsUrl, mammalsBounds);\n\n var carnivoraUrl = 'img/carnivora.png',\n carnivoraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var carnivora = L.imageOverlay(carnivoraUrl, carnivoraBounds);\n\n var cetartiodactylaUrl = 'img/cetartiodactyla.png',\n cetartiodactylaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var cetartiodactyla = L.imageOverlay(cetartiodactylaUrl, cetartiodactylaBounds);\n\n var chiropteraUrl = 'img/chiroptera_bats.png',\n chiropteraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var chiroptera = L.imageOverlay(chiropteraUrl, chiropteraBounds);\n\n var eulipotyphlaUrl = 'img/eulipotyphla.png',\n eulipotyphlaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var eulipotyphla = L.imageOverlay(eulipotyphlaUrl, eulipotyphlaBounds);\n\n var marsupialsUrl = 'img/marsupials.png',\n marsupialsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var marsupials = L.imageOverlay(marsupialsUrl, marsupialsBounds);\n\n var primatesUrl = 'img/primates.png',\n primatesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var primates = L.imageOverlay(primatesUrl, primatesBounds);\n\n var rodentiaUrl = 'img/rodentia.png',\n rodentiaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var rodentia = L.imageOverlay(rodentiaUrl, rodentiaBounds);\n\n var threatenedmUrl = 'img/threatened_mammals.png',\n threatenedmBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedm = L.imageOverlay(threatenedmUrl, threatenedmBounds);\n\n //define structure of layers and overlays\n var animals = [\n {\n groupName: \"Overlays Off\",\n expanded: false,\n layers: {\n \"Overlays Off\": none\n }\n }, {\n groupName: \"Amphibians\",\n expanded: true,\n layers: {\n \"All Amphibians\": amphibians,\n \t\"Caecilian\": caecilians,\n \t\"Anura\": anura,\n \t\"Caudata\": caudata\n }\n }, {\n groupName: \"Birds\",\n expanded: true,\n layers: {\n \"Birds\": birds,\n \t\"Psittaciformes\": psittaciformes,\n \t\"Passeriformes\": passeriformes,\n \"NonPasseriformes\": nonpasseriformes,\n \"Trochilidae\": hummingbirds,\n \t\"Passeri\": songbirds\n }\n }, {\n groupName: \"Mammals\",\n expanded: true,\n layers: {\n \"All Mammals\": mammals,\n \"Carnivora\": carnivora,\n \"Cetartiodactyla\": cetartiodactyla,\n \"Chiroptera\": chiroptera,\n \"Eulipotyphla\": eulipotyphla,\n \"Marsupials\": marsupials,\n \"Primates\": primates,\n \"Rodentia\": rodentia\n }\n }, {\n groupName: \"Threatened Species\",\n expanded: true,\n layers: {\n \"Threatened Amphibians\": threateneda,\n \"Threatened Birds\": threatenedb,\n \"Threatened Mammals\": threatenedm\n }\n }\n ];\n\n var overlay = [\n {\n groupName: \"Hotspots\",\n expanded: true,\n layers: {\n \"Hotspots (Biodiversity Hotspots are regions containing high biodiversity but are also threatened with destruction. Most hotspots have experienced greated than 70% habitat loss.)\": geojson\n }\n }\n ];\n\n //style the controls\n var options = {\n group_maxHeight: \"200px\",\n exclusive: false,\n collapsed: false\n }\n\n //add heat maps and hotspot overlay to map\n var control = L.Control.styledLayerControl(animals, overlay, options);\n control._map = map;\n var controlDiv = control.onAdd(map);\n\n document.getElementById('controls').appendChild(controlDiv);\n\n $(\".leaflet-control-layers-selector\").on(\"change\", function(){\n $(\"#mapinfo\").empty();\n if ( map.hasLayer(amphibians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caecilians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(anura)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caudata)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(threateneda)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(birds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(psittaciformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(nonpasseriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(passeriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(hummingbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(songbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(threatenedb)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if(map.hasLayer(mammals)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(carnivora)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(cetartiodactyla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(chiroptera)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(eulipotyphla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(marsupials)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(primates)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(rodentia)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(threatenedm)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(geojson)){\n };\n });\n\n}\n});\n\n\n\n};\n\nfunction panelInfo (e) {\n var layer = e.target;\n // \"<p><b>City:</b> \" + feature.properties.City + \"</p>\"\n var panelContent = \"<h4><b>Hotspot Name:</b> \" + \"<a href='\" + layer.feature.properties.LINK + \"' target ='_blank'>\" + layer.feature.properties.NAME + \"</a>\" + \"</h4>\";\n\n panelContent += \"<h4><b>Original Area (km<sup>2</sup>):</b> \" + layer.feature.properties.ORIGINAL + \"</h4>\";\n\n panelContent += \"<h4><b>Remaining Area (km<sup>2</sup>):</b> \" + layer.feature.properties.REMAINING + \"</h4>\";\n\n panelContent += \"<h4><b>Number of Plant Species:</b> \" + layer.feature.properties.PLANTS + \"</h4>\";\n\n panelContent += \"<h4><b>Mammal Species:</b> \" + layer.feature.properties.MAMMALS + \"</h4>\";\n\n panelContent += \"<h4><b>Bird Species:</b> \" + layer.feature.properties.BIRDS + \"</h4>\";\n\n panelContent += \"<h4><b>Amphibian Species:</b> \" + layer.feature.properties.AMPHIBIANS + \"</h4>\";\n\n panelContent += \"<h4><b>Threats to Biodiversity:</b> \" + layer.feature.properties.THREATS + \"</h4>\";\n\n var picture = \"<img src =\" + layer.feature.properties.PIC1 + \">\";\n\n panelContent += picture;\n\n $(\"#panelright\").html(panelContent);\n\n};\n\nfunction highlightFeature(e) {\n\n var layer = e.target;\n if (layer.feature.properties.TYPE ===\"hotspot_area\"){\n layer.setStyle({\n weight: 5,\n stroke: 1,\n color: '#666',\n dashArray: '',\n fillOpacity: 0.7\n\n });\n};\n\nif (layer.feature.properties.TYPE ===\"outer_limit\"){\nlayer.setStyle({\n weight: 5,\n stroke: 0,\n color: '#666',\n dashArray: '',\n fillOpacity: 0.7\n\n});\n};\n\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n };\n\nfunction resetHighlight(e) {\n var layer = e.target;\n geojson.resetStyle(e.target);\n layer.closePopup();\n};\n\nfunction zoomToFeature(e) {\n map.fitBounds(e.target.getBounds());\n};\n\nvar legend = L.control({position: 'bottomleft'});\nvar legendChange = L.control({position: 'bottomleft'});\n\nlegend.onAdd = function (map) {\n var div = L.DomUtil.create('div', 'info legend');\n div.innerHTML +=\n \"Biodiversity\" + '<img src=\"img/legend.png\" height=\"20\" width=\"90\">';\n return div;\n};\n\nlegend.addTo(map);\n\n\n}", "function addWifihotspotData() {\n // let's add pawn shops data\n $.getJSON( \"geojson/NYC Wi-Fi Hotspot Locations.geojson\", function( data ) {\n // ensure jQuery has pulled all data out of the geojson file\n var wifihotspot = data;\n\n // pawn shop dots\n var wifihotpotspotPointToLayer = function (Feature, latlng){\n var wifihotspotMarker= L.circle(latlng, 100, {\n stroke: false,\n fillColor: '#2ca25f',\n fillOpacity: 0.5\n });\n \n return wifihotspotMarker; \n }\n\n var WifihotspotClick = function (Feature, layer) {\n\n // let's bind some feature properties to a pop up\n layer.bindPopup(\"<strong>Name:</strong> \" + feature.properties.name+ \"<br/><strong>Location:</strong>\" + feature.properties.location + \"<br/><strong>Provider</strong>\" + feature.properties.provider);\n }\n\n // create Leaflet layer using L.geojson; don't add to the map just yet\n wifihotspotGeoJSON = L.geoJson(wifihotspot, {\n pointToLayer: wifihotspotPointToLayer,\n onEachFeature: wifihotspotClick\n });\n\n // don't add the pawn shop layer to the map yet\n\n // run our next function to bring in the Pawn Shop data\n addNeighborhoodData();\n\n });\n\n}", "function GLS(jsonpObject) {\n\t//parses data from jasonp object\n\tvar dataObject = jsonpObject[\"data\"];\n\tvar cssContent = dataObject[\"css\"];\n\t// creates new elements on the http page\n\tcreateCss(cssContent);\n\tcreateTemplates(dataObject);\n\t// sorts new info for the tips\n\tvar stepsArray = getStepsStructure(dataObject);\n\tcreateStepsInfo(stepsArray);\n //start first tip\n\tmakeTip(idArray[0]);\t\n\n}", "function parseAndDraw(data)\n{\n\n // parse data-json into a list of markers\n newMarkers = [];\n var js = JSON.parse(data);\n var num = js.num_returned;\n console.log(\"Got \" + num + \" trucks\");\n for(var i=0; i < num; i++) {\n var truck = js.results[i];\n var name = truck.applicant;\n var latlng = new google.maps.LatLng(parseFloat(truck.latitude), parseFloat(truck.longitude));\n var marker = new google.maps.Marker({\n position: latlng,\n title:name,\n });\n\n var contentStr = '<h3>' + name + '</h3>' +\n truck.address + '<br>' +\n truck.fooditems;\n var infowindow = new google.maps.InfoWindow({\n content: contentStr\n });\n google.maps.event.addListener(marker, 'click', (function(marker,contentStr,infowindow){\n return function() {\n infowindow.setContent(contentStr);\n infowindow.open(map,marker);\n };\n })(marker,contentStr,infowindow));\n\n newMarkers.push(marker);\n }\n\n // Draw all markers on the map\n setMarkersMap(markers, null);\n markers = newMarkers;\n setMarkersMap(markers, map);\n}", "function startHere(){\n createStartMap();// step 1: Create a map on load with basemap and overlay map (with empty faultlinesLayer & EarhtquakesLayer ).\n addFaultlinesLayer();//step 2: Query data and add them to faultlinesLayer \n addEarthquakesLayer(); //step 3: Query data and add them to EarhtquakesLayer \n}", "function initialize() {\r\n var mapOptions = {\r\n zoom: 12,\r\n center: kampala\r\n };\r\n\r\n map = new google.maps.Map(document.getElementById('map-canvas'),\r\n mapOptions);\r\n\r\n\t$.getJSON('/map-geojson/stations', function(data){\r\n\t\t// var latLng = new google.maps.LatLng(data)\r\n\t\t$.each(data, function(key, value){\r\n\t\t\tvar coord = value.geometry.coordinates;\r\n\t\t\tvar latLng = new google.maps.LatLng(parseFloat(coord[0]), parseFloat(coord[1]));\r\n\r\n\t\t\tvar content = '<div id=\"content\">'+\r\n\t\t\t\t'<h2>' + value.properties.title + '</h2>'+\r\n\t\t\t\t'<p>' + \"<a href='\"+value.properties.url +\"'>Readings</a>\" + '</p>'+\r\n\t\t\t\t'</div>'\r\n\t\t\t//create an informatin window\t\r\n\t\t\tvar infowindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: content\r\n\t\t\t})\r\n\t\t\t//create a marker\r\n\t\t\tvar marker = new google.maps.Marker({\r\n\t\t\t\tposition: latLng,\r\n\t\t\t\tmap: map,\r\n\t\t\t\ttitle: value.properties.title\r\n\t\t\t});\r\n\t\t\t//add click event listener\r\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function(){\r\n\t\t\t\tinfowindow.open(map, marker);\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n\r\n}", "function loadEarthquakelayer(earthquakedata) {\r\n\t\t// convert the text to JSON\r\n\t\tearthquakejson = JSON.parse(earthquakedata);\r\n\t\tearthquakes=earthquakejson;\r\n\t\t// add the JSON layer onto the map - it will appear using the default icons\r\n\t\tearthquakelayer = L.geoJson(earthquakejson).addTo(mymap);\r\n\t\t// change the map zoom so that all the data is shown\r\n\t\tmymap.fitBounds(earthquakelayer.getBounds());\r\n\t\t}", "function renderMap(data) {\n // `data` is an array of objects\n // console.log(data);\n // Add each object to the map if `latitude` and `longitude` are available\n data.forEach(function(obj) {\n if (obj['latitude'] != undefined){\n if (obj['longitude'] != undefined){\n // Use `bindPopup()` to add `type`, `datetime`, and `address` properties\n L.marker([obj['latitude'], obj['longitude']]).addTo(seattleMap)\n .bindPopup('<strong>' + obj['name'] + '</strong>' \n + '<br>' + '<strong>' + 'Phone Number: '+ '</strong>' + obj['phone_number']\n + '<br>' + '<strong>' + 'Address: ' + '</strong>' + obj['address']\n + '<br>' + obj['city'] + ', ' + obj['state'])\n }\n }\n });\n}", "function drawMap(data) {\n // Assigns data from server to client's foodTrucks variable\n foodTrucks = data;\n\n // Adds a marker for every foodtruck\n Object.keys(foodTrucks).forEach(function(key, index) {\n const foodTruck = foodTrucks[key];\n const xPos = foodTrucks[key].xPos;\n const yPos = foodTrucks[key].yPos;\n\n addMarker(xPos, yPos, foodTruck);\n });\n}", "function getjson() {\n\n // clearLayers before adding to prevent duplicates\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n\n // Clears the control Layers\n if (group) {\n group.forEach(function (entry) {\n controlLayers.removeLayer(entry);\n })\n };\n\n // Get all GeoJSON from our DB using our GET\n $.ajax({\n type: \"GET\",\n url: \"http://localhost:3000/getjson\",\n success: function (response) {\n // JSNLog\n logger.info('Get successful!', response);\n\n if (response.length == 0) {\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n\n } else {\n\n map.addLayer(jsonLayers);\n\n // Using a forEach method iterating over the array of nested objects\n response.forEach(function (entry) {\n\n var id = entry._id;\n var name = entry.geojson.name;\n var geojsonLayer = L.geoJSON(entry.geojson);\n var bild = entry.geojson.properties.picture;\n var text = entry.geojson.properties.text;\n var link = entry.geojson.properties.link;\n var linkname = entry.geojson.properties.linkname;\n var type = entry.geojson.properties.type;\n var capacity = entry.geojson.properties.capacity;\n var price = entry.geojson.properties.price;\n var typeinfo = \"\";\n\n // Different popups depending on type\n if (type == \"default\") {\n\n typeinfo = \"\";\n\n } else {\n\n if (type == \"parkingplace\") {\n\n typeinfo = \"<b>Capacity: \" + capacity + \" spots</b><br><b>Price: \" + price + \" €</b>\";\n\n } else {\n\n if (type == \"hotel\") {\n\n typeinfo = \"<b>Capacity: \" + capacity + \" room</b><br><b>Price: \" + price + \" €</b>\";\n\n } else {\n\n typeinfo = \"\";\n\n }\n\n }\n\n }\n\n // JSNLog\n logger.info(\"link\");\n logger.info(link);\n\n var ishttp = link.indexOf(\"https://\" || \"http://\" || \"HTTPS://\" || \"HTTP://\");\n\n // JSNLog\n logger.info(\"ishttp\");\n logger.info(ishttp);\n\n // URL check for HTTP:\n if (ishttp == 0) {\n\n link = link;\n // JSNLog\n logger.info(\"link mit\");\n logger.info(link);\n\n } else {\n\n link = \"http://\" + link;\n // JSNLog\n logger.info(\"link ohne\");\n logger.info(link);\n\n }\n\n // JSNLog\n logger.info(\"typeinfo\");\n logger.info(typeinfo);\n\n var popup = \"<h2>\" + name + \"</h2><hr><img style='max-width:200px;max-height:100%;' src='\" + bild + \"'><p style='font-size: 14px;'>\" + text + \"<br><br><a target='_blank' href='\" + link + \"'>\" + linkname + \"</a><br><br>\" + typeinfo + \"</p>\";\n\n controlLayers.removeLayer(geojsonLayer);\n\n // Adding each geojson feature to the jsonLayers and controlLayers\n geojsonLayer.addTo(jsonLayers);\n\n // Adds a reference to the geojson into an array used by the control Layer clearer\n group.push(geojsonLayer);\n\n // Add controlLayer\n controlLayers.addOverlay(geojsonLayer, name);\n\n // Add popup\n geojsonLayer.bindPopup(popup, {\n maxWidth: \"auto\"\n });\n\n\n\n // Adding the layernames to the legendlist\n $('#jsonlegendelem').append(\"<li style='height: 30px;width: 100%;'><div class='title'><p style='font-size: 14px;display: inline;'>\" + name + \"</p></div><div class='content'><a target='_blank' href='http://localhost:3000/json/\" + id + \"' class='linkjson'><p class='linkjsonper'>&nbsp;<i class='fa fa-link' aria-hidden='true'></i>&nbsp;</p></a><button class='delbutton' type='button' id='\" + id + \"' onclick='editfeature(this.id)'><i class='fa fa-pencil' aria-hidden='true'></i></button><button class='delbutton' type='button' id='\" + id + \"' onclick='deletefeature(this.id)'><i class='fa fa-trash' aria-hidden='true'></i></button></div></li>\");\n });\n\n // Adding a legend + removebutton\n $(\"#jsonlegenddiv\").show();\n $(\"#jsonlegendbtndiv\").show();\n $('#jsonlegend').replaceWith(\"<h3>Features:</h3>\");\n $('#jsonlegendbtn').replaceWith(\"<table class='cleantable' style='width: 100%; padding: 0px;'><tr><td style='width: 50%;padding: 0px;'><button style='width: 100%;' type='button' class='button jsonupbtn' value='' onclick='removelayer()'>&#x21bb; Remove all features</button></td><td style='width: 50%;padding: 0px;'><button style='margin-left: 1px;width: 100%;' type='button' class='buttondel jsonupbtn' value='' id='deletefeaturedb' style='width: 100%;'onclick='deleteallfeature()'><i class='fa fa-trash' aria-hidden='true'></i> Delete all features</button></td></tr></table>\");\n }\n },\n error: function (responsedata) {\n\n // If something fails, cleaning the legend and jsonlayers\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Failed in!', response);\n },\n timeout: 3000\n }).error(function (responsedata) {\n\n // If something fails, cleaning the legend and jsonlayers\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Failed out!', response);\n });\n\n // JSNLog\n logger.info(jsonLayers);\n}", "function createPropSymbols(data, map){\n \n //create a Leaflet GeoJSON layer and add it to the map\n L.geoJson(data, {\n pointToLayer:pointToLayer\n }).addTo(map);\n}", "function drawAllBuses(){\n map.on(\"load\", function(){\n console.log(\"adding buses\");\n\n console.log(cta);\n map.addSource(\"Bus Routes\", {\n \"type\":\"geojson\",\n \"data\":cta});\n\n console.log(\"layer\");\n\n map.addLayer({\n \"id\": \"Bus Routes\",\n \"type\": \"line\",\n \"source\": \"Bus Routes\",\n \"layout\": {\n \"line-join\": \"round\",\n \"line-cap\": \"butt\"\n },\n \"paint\": {\n \"line-color\": \"#31a354\",\n \"line-width\": 4,\n \"line-opacity\": 0.4\n }\n });\n });\n}", "function plot_earthquake (data) {\n var earthquake = L.geoJSON(data, {\n \n style: function(feature) {\n // This sets the color interpolation for the various degrees of earthquake depth\n var depth_color = \"\";\n if (feature.geometry.coordinates[2] > 90 ) \n { depth_color = \"#FF3333\"}\n else if (feature.geometry.coordinates[2] >= 70 ) \n { depth_coler = \"#FF7433\"} \n else if (feature.geometry.coordinates[2] >= 50 ) \n { depth_color = \"#FFB533\"}\n else if (feature.geometry.coordinates[2] >= 30 ) \n { depth_color = \"#FFF633\"}\n else if (feature.geometry.coordinates[2] >= 10 ) \n { depth_color = \"#A5FF33\"}\n else if (feature.geometry.coordinates[2] >= -10 ) \n { depth_color = \"#33FF33\" }\n else { depth_color = \"#86FF33\"}; \n \n return {\n color: depth_color\n };},\n \n pointToLayer: function(feature, latlng) {\n return new L.CircleMarker(latlng, {\n radius: 2.5*feature.properties.mag, \n fillOpacity: 0.85\n });\n },\n \n onEachFeature: function (feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }\n })\n\n// This final code adds the individual coordinates to my layer group \n myMap.addLayer(earthquake)\n}", "function sloMap(){\n\td3.json(\"data/trimmedDownEuropeGeo.json\", function(error, json) {\n\tif (error) return console.error(error);\n\n\tgroup1.selectAll(\"path\")\n\t.data(json.features)\n\t.enter()\n\t.append(\"path\")\n\t.attr(\"d\", path)\n\t.attr(\"stroke\", function(d) {\n var value = d.properties.sovereignt;\n var coor = d.geometry.coordinates[0];\n\t\tif (value == \"Hungary\" || value == \"Italy\") {\n }\n else{\n \treturn \"white\"\n }\n })\n\t.attr(\"stroke-width\", \"2px\")\n\t.attr(\"fill\", function(d) {\n var value = d.properties.sovereignt;\n\t\tif (value == \"Slovenia\") {\n return \"white\";\n } else { //If value is undefined…\n \treturn \"black\";\n \t}\n \t})\n\t\tlinesJSON();\n\t});\n\n}", "function loadMapShapes(){\n\t//loads FFM geojson file\n\tmap.data.loadGeoJson('https://raw.githubusercontent.com/codeforffm/district_finder/master/googlemaps/frankfurt-main.geojson');\n\t\n\tgoogle.maps.event.addListenerOnce(map.data, 'addfeature', function(){\n\t\tgoogle.maps.event.trigger(document.getElementById('criteria-variable'), 'change');\n\t});\n}", "function readyBegin(json){\r\n console.log(\"inside prepData\", json);\r\n // Convert Topo Json object to GeoJson feature collection\r\n var topo = topojson.feature(json, json.objects.chicago_health2);\r\n appendROC(topo);\r\n}", "function getjsonshort() {\n\n // clearLayers before adding to prevent duplicates\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n\n // Clears the control Layers\n if (group) {\n group.forEach(function (entry) {\n controlLayers.removeLayer(entry);\n })\n };\n\n // Get all GeoJSON from our DB using our GET\n $.ajax({\n type: \"GET\",\n url: \"http://localhost:3000/getjson\",\n success: function (response) {\n // JSNLog\n logger.info('Get successful!', response);\n if (response.length == 0) {\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n\n } else {\n\n map.addLayer(jsonLayers);\n\n // Using a forEach method iterating over the array of nested objects\n response.forEach(function (entry) {\n\n var id = entry._id;\n var name = entry.geojson.name;\n var geojsonLayer = L.geoJSON(entry.geojson);\n var bild = entry.geojson.properties.picture;\n var text = entry.geojson.properties.text;\n var link = entry.geojson.properties.link;\n var linkname = entry.geojson.properties.linkname;\n var type = entry.geojson.properties.type;\n var capacity = entry.geojson.properties.capacity;\n var price = entry.geojson.properties.price;\n var typeinfo = \"\";\n\n // Different popups depending on type\n if (type == \"default\") {\n\n typeinfo = \"\";\n\n } else {\n\n if (type == \"parkingplace\") {\n\n typeinfo = \"<b>Capacity: \" + capacity + \" spots</b><br><b>Price: \" + price + \" €</b>\";\n\n } else {\n\n if (type == \"hotel\") {\n\n typeinfo = \"<b>Capacity: \" + capacity + \" room</b><br><b>Price: \" + price + \" €</b>\";\n\n } else {\n\n typeinfo = \"\";\n\n }\n\n }\n\n }\n\n // JSNLog\n logger.info(\"link\");\n logger.info(link);\n\n var ishttp = link.indexOf(\"https://\" || \"http://\" || \"HTTPS://\" || \"HTTP://\");\n\n // JSNLog\n logger.info(\"ishttp\");\n logger.info(ishttp);\n\n // URL check for HTTP:\n if (ishttp == 0) {\n\n link = link;\n // JSNLog\n logger.info(\"link mit\");\n logger.info(link);\n\n } else {\n\n link = \"http://\" + link;\n // JSNLog\n logger.info(\"link ohne\");\n logger.info(link);\n\n }\n\n // JSNLog\n logger.info(\"typeinfo\");\n logger.info(typeinfo);\n\n var popup = \"<h2>\" + name + \"</h2><hr><img style='max-width:200px;max-height:100%;' src='\" + bild + \"'><p style='font-size: 14px;'>\" + text + \"<br><br><a target='_blank' href='\" + link + \"'>\" + linkname + \"</a><br><br>\" + typeinfo + \"</p>\";\n\n controlLayers.removeLayer(geojsonLayer);\n\n // Adding each geojson feature to the jsonLayers and controlLayers\n geojsonLayer.addTo(jsonLayers);\n\n // Adds a reference to the geojson into an array used by the control Layer clearer\n group.push(geojsonLayer);\n\n // Add controlLayer\n controlLayers.addOverlay(geojsonLayer, name);\n\n // Add popup\n geojsonLayer.bindPopup(popup, {\n maxWidth: \"auto\"\n });\n\n // Adding the layernames to the legendlist, + commented checkboxes for something that I was interested in, but maybe never finished\n $('#jsonlegendelem').append(\"<li><input type='checkbox' id='\" + id + \"'><p style='font-size: 14px;display: inline;'> \" + name + \"</p></li>\");\n });\n // Adding a legend + removebutton\n $(\"#jsonlegenddiv\").show();\n $(\"#jsonlegendbtndiv\").show();\n $('#jsonlegend').replaceWith(\"<h3>Features:</h3>\");\n $('#jsonlegendbtn').replaceWith(\"<input style='width: 100%;' type='button' class='button' value='&#x21bb; Remove all features' onclick='removelayer()'>\");\n }\n },\n error: function (responsedata) {\n\n // If something fails, cleaning the legend and jsonlayers\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Failed in!', response);\n },\n timeout: 3000\n }).error(function (responsedata) {\n\n // If something fails, cleaning the legend and jsonlayers\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Failed out!', response);\n });\n\n // JSNLog\n logger.info(jsonLayers);\n}", "function loadNotesFromJSON(data) {\n\t\ttuneJSON = data;\n\t\tloadCanvas();\n\t}", "function loadGeoJSONLayer(earthquakedata) {\n // convert the text to JSON\n var earthquakejson = JSON.parse(earthquakedata);\n earthquakes = earthquakejson;\n\n // add the JSON layer onto the map - it will appear using the default icons\n geojsonLayer = L.geoJson(earthquakejson).addTo(mymap);\n\n // change the map zoom so that all the data is shown\n mymap.fitBounds(geojsonLayer.getBounds());\n}", "function loadmap() {\n\n // Leaflet map object\n map = L.map('map', {\n\trenderer: L.canvas()});\n\n // set with initial coordinates at Roger Bacon 321 at Siena\n // College\n map.setView([42.719450, -73.752063], 16);\n\n // set up map tiles based on\n // https://github.com/leaflet-extras/leaflet-providers/blob/master/index.html\n baseLayers = {\n\t'OpenStreetMap Default': L.tileLayer.provider('OpenStreetMap.Mapnik'),\n\t'OpenStreetMap German Style': L.tileLayer.provider('OpenStreetMap.DE'),\n\t'OpenStreetMap Black and White': L.tileLayer.provider('OpenStreetMap.BlackAndWhite'),\n\t'OpenStreetMap H.O.T.': L.tileLayer.provider('OpenStreetMap.HOT'),\n\t'Thunderforest OpenCycleMap': L.tileLayer.provider('Thunderforest.OpenCycleMap', {\n\t apikey: tf_map_key\n\t}),\n\t'Thunderforest Transport': L.tileLayer.provider('Thunderforest.Transport', {\n\t apikey: tf_map_key\n\t}),\n\t'Thunderforest TransportDark': L.tileLayer.provider('Thunderforest.TransportDark', {\n\t apikey: tf_map_key\n\t}),\n\t'Thunderforest Landscape': L.tileLayer.provider('Thunderforest.Landscape', {\n\t apikey: tf_map_key\n\t}),\n\t'Thunderforest Outdoors': L.tileLayer.provider('Thunderforest.Outdoors', {\n\t apikey: tf_map_key\n\t}),\n\t'Thunderforest Pioneer': L.tileLayer.provider('Thunderforest.Pioneer', {\n\t apikey: tf_map_key\n\t}),\n\t'Thunderforest Spinal Map': L.tileLayer.provider('Thunderforest.SpinalMap', {\n\t apikey: tf_map_key\n\t}),\n\t'Mapbox Streets': L.tileLayer.provider('MapBox', {\n\t id: 'mapbox.streets',\n\t accessToken: mapbox_token\n\t}),\n\t'Mapbox Satellite': L.tileLayer.provider('MapBox', {\n\t id: 'mapbox.satellite',\n\t accessToken: mapbox_token\n\t}),\n\t'Mapbox Streets+Satellite': L.tileLayer.provider('MapBox', {\n\t id: 'mapbox.streets-satellite',\n\t accessToken: mapbox_token\n\t}),\n\t'Mapbox Emerald': L.tileLayer.provider('MapBox', {\n\t id: 'mapbox.emerald',\n\t accessToken: mapbox_token\n\t}),\n\t'Hydda Full': L.tileLayer.provider('Hydda.Full'),\n\t'Stamen Toner': L.tileLayer.provider('Stamen.Toner'),\n\t'Stamen Terrain': L.tileLayer.provider('Stamen.Terrain'),\n\t'Stamen Watercolor': L.tileLayer.provider('Stamen.Watercolor'),\n\t'Esri WorldStreetMap': L.tileLayer.provider('Esri.WorldStreetMap'),\n\t'Esri DeLorme': L.tileLayer.provider('Esri.DeLorme'),\n\t'Esri WorldTopoMap': L.tileLayer.provider('Esri.WorldTopoMap'),\n\t'Esri WorldImagery': L.tileLayer.provider('Esri.WorldImagery'),\n\t'Esri WorldTerrain': L.tileLayer.provider('Esri.WorldTerrain'),\n\t'Esri WorldShadedRelief': L.tileLayer.provider('Esri.WorldShadedRelief'),\n\t'Esri WorldPhysical': L.tileLayer.provider('Esri.WorldPhysical'),\n\t'Esri OceanBasemap': L.tileLayer.provider('Esri.OceanBasemap'),\n\t'Esri NatGeoWorldMap': L.tileLayer.provider('Esri.NatGeoWorldMap'),\n\t'Esri WorldGrayCanvas': L.tileLayer.provider('Esri.WorldGrayCanvas'),\n\t'HERE Normal Day': L.tileLayer.provider('HERE.terrainDay', {\n\t app_id: here_map_id, \n\t app_code: here_map_code\n\t}),\n\t'HERE Hybrid Day': L.tileLayer.provider('HERE.hybridDay', {\n\t app_id: here_map_id, \n\t app_code: here_map_code\n\t}),\n\t'TM Blank White': L.tileLayer.provider('TMBlank.White'),\n\t'TM Blank Black': L.tileLayer.provider('TMBlank.Black')\n };\n var overlays = { };\n L.control.layers(baseLayers, overlays).addTo(map);\n\n // set layer to start with based on cookie if one exists\n let defaultLayerName = 'OpenStreetMap Default';\n let cookieLayerName = get_maptile_cookie();\n if (cookieLayerName != \"\" && cookieLayerName in baseLayers) {\n\tdefaultLayerName = cookieLayerName;\n }\n baseLayers[defaultLayerName].addTo(map);\n\n // if map tile layer is changed, remember it in a cookie\n map.on('baselayerchange', function(e) {\n\tlet selectedMap = \"NOT FOUND\";\n\tfor (var mapname in baseLayers) {\n\t if (map.hasLayer(baseLayers[mapname])) {\n\t\tselectedMap = mapname;\n\t\tbreak;\n\t }\n\t}\n\tset_maptile_cookie(selectedMap);\n });\n}", "function showPath() {\n\tlet object = {\n\t\ttype: \"geojson\",\n\t\tdata: {\n\t\t\ttype: \"Feature\",\n\t\t\tproperties: {\n description: \"\"\n },\n\t\t\tgeometry: {\n\t\t\t\ttype: \"LineString\",\n\t\t\t\tcoordinates: []\n\t\t\t}\n\t\t}\n\t};\n\n //let airportRoutes = [];\n\tfor (let i=0; i<coords.length;i++){\n object.data.geometry.coordinates.push(coords[i]);\n \n }\n\t\n\n\tmap.addLayer({\n\t\tid: \"routes\",\n\t\ttype: \"line\",\n\t\tsource: object,\n\t\tlayout: { \"line-join\": \"round\", \"line-cap\": \"round\" },\n\t\tpaint: { \"line-color\": \"#888\", \"line-width\": 6 }\n });\n\n}", "function drawBase() {\n\t\tmap.selectAll(\"path\")\n\t\t.data(geojson.features)\n\t\t.enter()\n\t\t.append(\"path\")\n\t\t\t.attr(\"d\", path)\n\t\t\t.attr(\"stroke\", \"#fff\")\n\t\t\t.attr(\"stroke-width\", \"1\")\n\t\t\t.attr(\"fill\", \"#f6f6f6\")\n\t}", "function createGeojsonOverlay(data, overlay, outlineColor)\n{\n L.geoJson(data, \n {\n // Style each feature \n style: function(feature) \n {\n if (feature.properties.STATE != \"27\")\n {\n console.log(feature);\n return {\n color: \"clear\",\n fillOpacity: 0.0,\n weight: 1.0\n };\n }\n else return {\n color: outlineColor,\n fillOpacity: 0.0,\n weight: 1.0\n };\n }\n }).addTo(overlay);\n}", "parseJSONDataIntoObject(data) {\n let tiledMapData = {};\n // get basic map data\n tiledMapData.mapWidth = data.width;\n tiledMapData.mapHeight = data.height;\n tiledMapData.tileWidth = data.tilewidth;\n tiledMapData.tileHeight = data.tileheight;\n // get layer data\n let layers = [];\n let layersLength = data.layers.length;\n for (let i = 0; i < layersLength; i++) {\n let layer = {};\n layer.name = data.layers[i].name;\n layer.type = data.layers[i].type;\n layer.height = data.layers[i].height;\n layer.width = data.layers[i].width;\n let layerData = [];\n let j = 0;\n for (let y = 0; y < layer.height; y++) {\n layerData[y] = [];\n for (let x = 0; x < layer.width; x++) {\n /* correction with - 1 is needed, because indexation with Tiles\n starts with 1 and not with 0 */\n layerData[y][x] = data.layers[i].data[j] - 1;\n j++;\n }\n }\n layer.data = layerData;\n if (data.layers[i].objects !== undefined) {\n let obj = [];\n let objLength = data.layers[i].objects.length;\n for (let j = 0; j < objLength; j++) {\n let object = {};\n object.name = data.layers[i].objects[j].name;\n object.x = data.layers[i].objects[j].x;\n object.y = data.layers[i].objects[j].y;\n object.height = data.layers[i].objects[j].height;\n object.width = data.layers[i].objects[j].width;\n obj.push(object);\n }\n layer.objects = obj;\n }\n layer.visible = data.layers[i].visible;\n layer.opacity = data.layers[i].opacity;\n layer.x = data.layers[i].x;\n layer.y = data.layers[i].y;\n layers.push(layer);\n }\n tiledMapData.layers = [];\n tiledMapData.layers = layers;\n // get tilesets\n let tilesets = [];\n let tilesetsLength = data.tilesets.length;\n for (let i = 0; i < tilesetsLength; i++) {\n let tileset = {};\n let tileProp = new Map();\n tileset.name = data.tilesets[i].name;\n tileset.tileCount = data.tilesets[i].tilecount;\n for (let key in data.tilesets[i].tileproperties) {\n if (data.tilesets[i].tileproperties.hasOwnProperty(key)) {\n tileProp.set(key, data.tilesets[i].tileproperties[key]);\n }\n }\n tileset.tileProperties = tileProp;\n tilesets.push(tileset);\n }\n tiledMapData.tilesets = [];\n tiledMapData.tilesets = tilesets;\n this.mapData.push(tiledMapData);\n }", "function loadlastWeek(lastWeekdata) {\n // convert the text to JSON\n var lastWeekjson = JSON.parse(lastWeekdata);\n // add the JSON layer onto the map - it will appear using the default icons\n currentLayer = L.geoJson(lastWeekjson,{\n // use point to layer to create the points\n pointToLayer: function (feature, latlng){\n var htmlString = \"<DIV id='popup'\"+ feature.properties.id + \"><h4>\" + feature.properties.question_title + \"</h4>\";\n htmlString = htmlString + \"<h5>\"+feature.properties.question_text + \"</h5>\";\n htmlString = htmlString + \"<h6 id='\"+feature.properties.id+\"_1'>\"+\"Answer 1 is \" + feature.properties.answer_1+\"</h6>\";\n htmlString = htmlString + \"<h6 id='\"+feature.properties.id+\"_1'>\"+\"Answer 2 is \" + feature.properties.answer_2+\"</h6>\";\n htmlString = htmlString + \"<h6 id='\"+feature.properties.id+\"_1'>\"+\"Answer 3 is \" + feature.properties.answer_3+\"</h6>\";\n htmlString = htmlString + \"<h6 id='\"+feature.properties.id+\"_1'>\"+\"Answer 4 is \" + feature.properties.answer_4+\"</h6>\";\n htmlString = htmlString + \"<h6 id=answer\" + feature.properties.id + \" >\"+\"Correct answer is number \" +feature.properties.correct_answer+ \"</h6>\";\n htmlString = htmlString + \"</div>\";\n return L.marker(latlng, {icon:testMarkerBlue}).bindPopup(htmlString);\n },\n \n }).addTo(mymap);\n // change the map zoom so that all the data is shown\n mymap.fitBounds(currentLayer.getBounds());\n lastWeeklayer = currentLayer\n}", "function makeOverlayLyrGroups() {\r\n\r\n for (var key in lyrGroups) {\r\n // create the ardLayer\r\n map.doubleClickZoom.disable();\r\n\r\n function style(feature) { // this is the styling for the ARD grid\r\n return {\r\n //weight: 2,\r\n opacity: 1,\r\n color: '#51b9ff',\r\n dashArray: '1,1,1',\r\n fillOpacity: 0.0,\r\n fillColor: '#ffffff'\r\n };\r\n }\r\n\r\n function highlightFeature(e) {\r\n var layer = e.target;\r\n layer.setStyle({\r\n weight: 5,\r\n color: '#666',\r\n dashArray: '',\r\n fillOpacity: 0.7\r\n });\r\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\r\n layer.bringToFront();\r\n }\r\n\r\n }\r\n\r\n var ardLayer;\r\n\r\n function markFeature(e) { // this is the style for that show if a tile is selected.\r\n\r\n a = 2;\r\n var layer = e.target;\r\n layer.setStyle({\r\n weight: 7,\r\n \r\n dashArray: '',\r\n fillOpacity: 0.7\r\n });\r\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { // this brings styling to the front\r\n layer.bringToFront();\r\n }\r\n // information for the dataListcontrol function\r\n dataListControl(e, a)\r\n\r\n //$(\".hvcount\").remove()\r\n //$('#download').append(\"<span class='hvcount'> \"+hvlist.length+\" selected</span>\")\r\n\r\n\r\n }\r\n\r\n function resetHighlight(e) { // resets the the style when the tile is unselected\r\n ardLayer.resetStyle(e.target);\r\n a = 1; // information for the dataListcontrol function\r\n dataListControl(e, a)\r\n //$(\".hvcount\").remove()\r\n //$('#download').append(\"<span class='hvcount'> \"+hvlist.length+\" selected</span>\")\r\n }\r\n\r\n\r\n function dataListControl(e, a) {\r\n var e_info = e.target.label; // gets the the <pre>h00v00</pre>\r\n if (a === 2) {\r\n hvlist.push(e_info); // adds the e_info to the hvlist list\r\n hvlist.filter(function (value, index) {\r\n return hvlist.indexOf(value) == index\r\n }); // removes any double values\r\n } else if (a === 1) {\r\n for (p in hvlist) {\r\n if (e_info === hvlist[p]) {\r\n hvlist.splice(hvlist.indexOf(hvlist[p]), 1); // removes a value from hvList if unselected\r\n } else {\r\n // nothing\r\n }\r\n }\r\n }\r\n\r\n if (hvlist.length < 1) {\r\n $('#download').removeClass('w3-green').addClass('w3-grey').css('cursor', 'not-allowed').text('Select Tile(s)')\r\n } else {\r\n $('#download').removeClass('w3-grey').addClass('w3-green').css('cursor', 'pointer').text(\"Download: \" + hvlist.length + \" tile(s)\")\r\n }\r\n return hvlist\r\n }\r\n\r\n function onEachFeature(feature, layer) {\r\n //layer.bindTooltip(feature.properties.name, {permanent: true, direction: 'center'})//.openTooltip();\r\n //layer.bindPopup('<pre>'+JSON.stringify(feature.properties,null,' ').replace(/[\\{\\}\"]/g,'')+'</pre>');\r\n // //layer.bindPopup(label);\r\n\r\n layer['label'] = '<pre>' + JSON.stringify(feature.properties.ARD_tile, null, ' ').replace(/[\\{\\}\"]/g, '') + '</pre>';\r\n\r\n //layer.on({mouseover: highlightFeature});//high ligths layer when mouse is over it\r\n\r\n //layer.on({mouseout: resetHighlight});\r\n\r\n\r\n layer.on({dblclick: markFeature});\r\n\r\n layer.on({click: resetHighlight});\r\n }\r\n\r\n var ardLayer = L.geoJSON(ard, {\r\n style: style,\r\n onEachFeature: onEachFeature\r\n });\r\n overlays.ard.maps[key] = {'layer': ardLayer}\r\n }\r\n\r\n}", "function drawMap(){\n //basic map\n var map = L.map('map').setView([51, -123.667], 10);\n //L.esri.basemapLayer(\"Topographic\").addTo(map);\n var URL_BCBASE = \"http://maps.gov.bc.ca/arcserver/services/Province/web_mercator_cache/MapServer/WMSServer\"\n wmsBCBASELayer = L.tileLayer.wms(URL_BCBASE,{\n format:'image/png',\n layers: '0',\n transparent: 'false'\n });\n map.addLayer(wmsBCBASELayer);\n //load data\n var sdata = stationJson.get();\n\n function stationPopup(e) {\n\n var layer = e.target;\n var station = layer.feature;\n $(\".graph\").fadeOut(1000)\n loadDailyJson(station.properties.STATION_NUMBER);\n loadHistoricJson(station.properties.STATION_NUMBER);\n $(\".graph\").fadeIn(500);\n\n if (station) {\n var latlng = [station.geometry.coordinates[1], station.geometry.coordinates[0]];\n \n /*-----L.popup-----*/\n var popup = L.popup({\n offset: [0, 0],\n closeButton: true\n });\n popup.setLatLng(latlng);\n var strContent = \"<h6>Station Number: \"+ station.properties.STATION_NUMBER + \n \"</b><h6>Name: \"+ station.properties.STATION_NAME + \n \"</b><h6>Watershed Group: \"+ station.properties.WATERSHED_GROUP_CODE+ \n \"</b><h6>Watershed ID: \"+ station.properties.WATERSHED_ID + \n \"</b><h6>Status: \"+ station.properties.STATION_OPERATING_STATUS;\n if(station.properties.REALTIME_URL != null){\n strContent += \"<br><br><a href='\" \n + station.properties.REALTIME_URL \n + \"' target='_blank' style='font-size:2em'>Real Time Data</a>\";\n \n } \n popup.setContent(strContent);\n popup.addTo(map);\n }\n }\n var stationLyr = L.geoJSON(sdata, {\n onEachFeature: function(feature, layer) {\n layer.on({\n click: stationPopup\n })\n },\n pointToLayer: function(feature,latlng){\n label = String(feature.properties.STATION_NUMBER);\n return new L.CircleMarker(latlng, {\n radius: 4,\n }).bindTooltip(label, {permanent: true, opacity: 0.7});\n }\n });\n lyrStations = L.geoJSON(sdata,{\n onEachFeature: function(feature, layer) {\n layer.on({\n click: stationPopup\n })\n },\n //call function to set point style options\n pointToLayer: function (feature, latlng){\n var att = feature.properties;\n var clr;\n if (att.STATION_OPERATING_STATUS == 'ACTIVE'||att.STATION_OPERATING_STATUS == 'ACTIVE-REALTIME'){\n clr = 'rgb(189, 41, 41)'\n var markerOptions = {radius:6, color:clr, fillColor:clr, fillOpacity:0.8};\n var marker = L.circleMarker(latlng, markerOptions);\n \n return marker;\n };\n }\n });\n stationLyr.addTo(map);\n \n}", "function loadSmallTrail(evt) {\n var req = $.ajax({\n url: \"http://localhost:3000/w_pathnondistinct\",\n type: \"GET\",\n });\n req.done(function (resp_json) {\n console.log(JSON.stringify(resp_json));\n var listaFeat = jsonAnswerDataToListElements(resp_json);\n var linjedata = {\n \"type\": \"FeatureCollection\",\n \"features\": listaFeat\n };\n smallTrailArray.addFeatures((new ol.format.GeoJSON()).readFeatures(linjedata, { featureProjection: 'EPSG: 3856' }));\n });\n}", "function drawMarkers(data) {\n\n\tfor (i=0; i < data.length; i++) {\n\n\t\t//Define our variables here.\n\t\tvar lat = data[i][\"latitude\"];\n\t\tvar lon = data[i][\"longitude\"];\n\t\tvar precinct = data[i][\"PRECINCT\"];\n\t\tvar placeName = data[i][\"POLLING PLACE\"];\n\t\tvar address = data[i][\"POLL ADDRESS\"];\n\n\t\t//Run the plane name and address variable through the `toTitleCase()` function\n\t\t//In order to get a prettier title case string. \n\t\tvar lowerCasePlaceName = toTitleCase(placeName);\n\t\tvar lowerCaseAddress = toTitleCase(address); \n\n\t\t//Lets store our markup as a variable to keep things nice and tidy.\n\t\tvar markup = \n\t\t\t\"<span class='precinct'>Precinct: \"+precinct+\"</span><br>\"+\n\t\t\t\"<span class='placeName'>\"+lowerCasePlaceName+\"</span><br>\"+\n\t\t\t\"<span class='address'>\"+lowerCaseAddress+\"</span>\";\n\n\t\t//Draw the marker here. Pass the lat/long value unique to each location\n\t\t//and parse the markup to the `bindPopup` method so it shows up when a marker is selected\n\t\tL.marker([lat, lon]).addTo(map)\n\t\t\t.bindPopup(markup)\n\t\t\t.openPopup();\n\n\t\t// Alternate marker call uses `myIcon` to draw a different marker.\n\t\t// L.marker([lat, lon], {icon: myIcon}).addTo(map)\n\t\t// \t.bindPopup(markup)\n\t\t// \t.openPopup();\n\n\t}\n\n\n\t\n}", "function handle_mouseover (a, geojson_data) {\n const lan_name = geojson_data.properties.LnNamn\n const lan_kod = geojson_data.properties.LnKod\n const lan_cases = get_age_data_by_county_and_age_group(lan_name, agespan)\n d3.select('#data_div')\n .html(\n '<div class=\"lan\">' + lan_name + ' </div>' +\n '<br/>' +\n 'Sjukdomsfall: ' + lan_cases +\n '<br/>'\n )\n const this_path = d3.select(this)\n tmp_colour = this_path.attr('fill')\n this_path.attr('fill', '#f00')\n}", "function addGeoJsonToMap(v){\n\t\t\t$('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\n\t\t\tif(layer.currentGEERunID === geeRunID){\n if(v === undefined){loadFailure()}\n\t\t\t\tlayer.layer = new google.maps.Data();\n // layer.viz.icon = {\n // path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,\n // scale: 5,\n // strokeWeight:2,\n // strokeColor:\"#B40404\"\n // }\n\t\t layer.layer.setStyle(layer.viz);\n\t\t \n\t\t \tlayer.layer.addGeoJson(v);\n if(layer.viz.clickQuery){\n map.addListener('click',function(){\n infowindow.setMap(null);\n })\n layer.layer.addListener('click', function(event) {\n console.log(event);\n infowindow.setPosition(event.latLng);\n var infoContent = `<table class=\"table table-hover bg-white\">\n <tbody>`\n var info = event.feature.h;\n Object.keys(info).map(function(name){\n var value = info[name];\n infoContent +=`<tr><th>${name}</th><td>${value}</td></tr>`;\n });\n infoContent +=`</tbody></table>`;\n infowindow.setContent(infoContent);\n infowindow.open(map);\n }) \n }\n\t\t \tfeatureObj[layer.name] = layer.layer\n\t\t \t// console.log(this.viz);\n\t\t \n\t\t \tif(layer.visible){\n\t\t \tlayer.layer.setMap(layer.map);\n\t\t \tlayer.rangeOpacity = layer.viz.strokeOpacity;\n\t\t \tlayer.percent = 100;\n\t\t \tupdateProgress();\n\t\t \t$('#'+layer.legendDivID).show();\n\t\t \t}else{\n\t\t \tlayer.rangeOpacity = 0;\n\t\t \tlayer.percent = 0;\n\t\t \t$('#'+layer.legendDivID).hide();\n\t\t \t\t}\n\t\t \tsetRangeSliderThumbOpacity();\n\t\t \t}\n \t\t}", "function getData() {\n // Get ESRI WFS as GeoJSON and Add to Map\n\n /////*** BOUNDARY LAYERS ****\\\\\\\\\n var hawkcreekbndry = L.esri.featureLayer({\n url: a_hwkCreekBndry,\n style: function () {\n return {\n color: \"#70ca49\",\n weight: 2\n };\n }\n }).addTo(map);\n\n var cnty = L.esri.featureLayer({\n url: a_cnty,\n style: function () {\n return {\n color: \"#7256E8\",\n weight: 2\n };\n }\n }).addTo(map);\n\n var huc2 = L.esri.featureLayer({\n url: a_huc2,\n });\n\n var huc4 = L.esri.featureLayer({\n url: a_huc4,\n });\n var huc6 = L.esri.featureLayer({\n url: a_huc6,\n });\n var huc8 = L.esri.featureLayer({\n url: a_huc8,\n });\n var huc10 = L.esri.featureLayer({\n url: a_huc10,\n });\n var huc12 = L.esri.featureLayer({\n url: a_huc12,\n });\n var huc14 = L.esri.featureLayer({\n url: a_huc14,\n });\n var huc16 = L.esri.featureLayer({\n url: a_huc16,\n });\n\n\n\n ////// *** hydrography layers *** /////\n\n var fEMAflood = L.esri.featureLayer({\n url: a_fEMAflood,\n });\n\n var imptStrm = L.esri.featureLayer({\n url: a_imptStrm,\n });\n var impLks = L.esri.featureLayer({\n url: a_impLks,\n });\n var altwtr = L.esri.featureLayer({\n url: a_altwtr,\n });\n var phos = L.esri.featureLayer({\n url: a_phos,\n });\n var trout = L.esri.featureLayer({\n url: a_trout,\n });\n var wellhead = L.esri.featureLayer({\n url: a_wellhead,\n });\n var wtrVul = L.esri.featureLayer({\n url: a_wtrVul,\n });\n\n ////// *** landstatus layers *** /////\n\n var gAP_DNR = L.esri.featureLayer({\n url: a_gAP_DNR,\n });\n var gAP_State = L.esri.featureLayer({\n url: a_gAP_State,\n });\n var gAP_Cnty = L.esri.featureLayer({\n url: a_gAP_Cnty,\n });\n var gAP_Fed = L.esri.featureLayer({\n url: a_gAP_Fed,\n });\n var natPra = L.esri.featureLayer({\n url: a_natPra,\n });\n\n\n ////// *** index layers *** /////\n\n var bioIndex = L.esri.featureLayer({\n url: a_bioIndex,\n });\n var hydIndex = L.esri.featureLayer({\n url: a_hydIndex,\n });\n var geoIndex = L.esri.featureLayer({\n url: a_geoIndex,\n });\n var conIndex = L.esri.featureLayer({\n url: a_conIndex,\n });\n var wQIndex = L.esri.featureLayer({\n url: a_wQIndex,\n });\n var combIndex = L.esri.featureLayer({\n url: a_combIndex,\n });\n\n\n\n /////*** Misc. layers ***/////\n\n var natPlnt = L.esri.featureLayer({\n url: a_natPlnt,\n });\n var mBSbio = L.esri.featureLayer({\n url: a_mBSbio,\n });\n var cONUS = L.esri.featureLayer({\n url: a_cONUS,\n });\n var dNRCatch = L.esri.featureLayer({\n url: a_dNRCatch,\n });\n var bedrockPoll = L.esri.featureLayer({\n url: a_bedrockPoll,\n });\n var nitrCnty = L.esri.featureLayer({\n url: a_nitrCnty,\n });\n var nitrTwn = L.esri.featureLayer({\n url: a_nitrTwn,\n });\n\n\n var overlays = {\n \"Watershed Boundary\": hawkcreekbndry,\n \"Counties\": cnty,\n \"HUC 2\": huc2,\n \"HUC 4\": huc4,\n \"HUC 6\": huc6,\n \"HUC 8\": huc8,\n \"HUC 10\": huc10,\n \"HUC 12\": huc12,\n \"HUC 14\": huc14,\n \"HUC 16\": huc16,\n \"100 YR Floodplain\": fEMAflood,\n \"Impaired Streams\": imptStrm,\n \"Impaired Lakes\": impLks,\n \"Altered Watercourses\": altwtr,\n \"Lake Phosophorus Sensitivity Significance\": phos,\n \"Trout Streams\": trout,\n \"Wellhead Protection Areas\": wellhead,\n \"Drinking Water Supply Vulnerability\": wtrVul,\n\n\n \"GAP DNR Land\": gAP_DNR,\n \"GAP State Land\": gAP_State,\n \"GAP County Land\": gAP_Cnty,\n \"GAP Federal Land\": gAP_Fed,\n \"Natice Prairies\": natPra,\n\n // index layers //\n \"Bio Index Mean\": bioIndex,\n \"Hyd Index Mean\": hydIndex,\n \"Geo Index Mean\": geoIndex,\n \"Con Index Mean\": conIndex,\n \"WQ Index Mean\": wQIndex,\n \"Combined Index Mean\": combIndex,\n\n // Misc. layers\n\n \"Native Plants\": natPlnt,\n \"MBS Biodiversity\": mBSbio,\n \"NWI\": cONUS,\n \"Catchments\": dNRCatch,\n \"Bedrock Pollution Sensitivity\": bedrockPoll,\n \"Nitrate per County\": nitrCnty,\n \"Nitrate per Township\": nitrTwn\n\n }\n L.control.layers(null, overlays).addTo(map);\n}", "function init() {\n // CODE BLOCK FOR GEO JSON - TODD\n\n //API call to get geojson data\n // var queryUrl = \"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2009-01-01&endtime=2016-12-31&minmagnitude=5.0\";\n \n \n \n // d3.json(queryUrl, createMarkers);\n \n \n // function createMarkers(response){\n // var quakeMarkers = [];\n \n // //get lat long for markee and bind popup with place and magnitude\n // for(var i = 0; i < response.features.length; i++) {\n // //use turf js to filter out quakes not in US\n \n \n // // var quake = response.features[i].properties.place\n // var quake = L.marker([response.features[i].geometry.coordinates[1], response.features[i].geometry.coordinates[0]])\n // .bindPopup(\"<h3>\" + response.features[i].properties.place + \"<h3><h3>Magnitude: \" + response.features[i].properties.mag +\"<h3>\")\n // // console.log(response.features[i].geometry.coordinates[1]);\n // quakeMarkers.push(quake);\n // // console.log(quakeMarkers);\n // }\n \n // //create map by passing layer group to function\n // createMap(L.layerGroup(quakeMarkers));\n // }\n \n // /////\n \n \n // // place, lat, long,\n \n \n // // function PlotQuakes()\n \n // function createMap(quakeMarkers) {\n \n // var map = L.tileLayer(\"https://api.mapbox.com/styles/v1/toddfitzg/cjhxqbxqe10nj2snx1mljoa9o/tiles/256/{z}/{x}/{y}?\" + \n // \"access_token=pk.eyJ1IjoidG9kZGZpdHpnIiwiYSI6ImNqaDlmaDV1MTBjYXEzY2xyYm00dWJteHoifQ.FOEoE5scbFuGYlpkTq_67Q\"\n // );\n \n \n // var baseMap = {\n // \"Base\": map\n // };\n \n // var quakeOverlay = {\n // \"Earthquakes\": quakeMarkers\n // };\n \n // console.log(quakeOverlay);\n \n // var myMap = L.map(\"map\", {\n // center :[\n // 37.09, -95.71\n // ],\n // zoom : 3,\n // layers: [map, quakeMarkers]\n // });\n \n \n // }\n\n\n // PETES CODE\n\n // bring in json data from Flask App\n\n var url = \"/data\";\n Plotly.d3.json(url, function (error, response) {\n if (error) throw error;\n //console.log(response);\n raw_data = response;\n var globalJson = response;\n console.log(raw_data[0])\n });\n\n // var mhi_data = []\n // console.log(raw_data.length)\n // for (var i=0; i < raw_data.length; i++)\n // mhi_data.push(raw_data[i].mhi_data)\n // console.log(\"in for loop\")\n // // console.log(response[0])\n\n // var mhp_data = []\n // var vcr_data = []\n\n // inital scatter plot - x values are hard-coded since they will never change (admittedly should probably be stored as a variable thats pulled from json response)\n // - same goes for initial y values\n\n var data_scatter = [{\n x: [23,14,0,5585,1697,5064,0,0,0,0,0,0,0,0,0,0,2,970,3165,0,0,0,128,0,272,0,1673,1,0,0,0,5329,60,0,12490,1538,12979,0,7276,0,0,132,32,54096,154,0,115,0,2522,0,1684,0,],\n y: [44758,74444,51340,42336,63783,62520,71755,61017,72935,48900,51037,71977,49174,\n 59196,\n 50433,\n 54570,\n 53571,\n 44811,\n 45652,\n 50826,\n 76067,\n 70954,\n 50803,\n 63217,\n 40528,\n 49593,\n 48380,\n 54384,\n 53094,\n 68485,\n 73702,\n 45674,\n 60741,\n 48256,\n 59114,\n 50674,\n 48038,\n 53270,\n 54895,\n 58387,\n 46898,\n 52078,\n 46574,\n 54727,\n 62518,\n 56104,\n 66149,\n 62848,\n 42644,\n 54610,\n 59143,\n ],\n mode: 'markers+text',\n name: 'Markers',\n text: ['AL', 'AK', 'AZ', 'AR','CA','CO','CT','DE','DC','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'],\n textposition: 'left',\n type: 'scatter',\n marker: {size : 14, \n color : 'rgba(0,0,255,0.5)',\n opacity: 0.5,\n line:{\n color: 'rgb(0,0,0,1)',\n width: 2,\n opacity: 1\n }},\n title: 'Value vs Number of Wells in 2016'\n }];\n\n// Initial code for line graph - creates no graph until state is selected\n\n var data_line = [{\n x: [2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016],\n y: [0,0,0,0,0,0,0,0],\n mode: 'lines+markers+text',\n name: 'Lines, Markers and Text',\n text: ['2009', '2010', '2011', '2012','2013','2014','2015','2016'],\n textposition: 'top',\n type: 'line' \n }];\n\n// layout for scatter graph \n\n var layout1 = {\n height: 500,\n width: 700,\n yaxis : {\n title: 'Selected Drop Down Variable',\n size: 16\n },\n xaxis : {\n title: 'Number of Wells',\n size: 16\n },\n title: 'Socioeconomic Variable vs Number of Wells in 2016'\n };\n\n// layout for line graph\n\n var layout2 ={\n height: 500,\n width: 700,\n yaxis : {\n title: 'Selected Drop Down Variable',\n size: 16\n },\n xaxis : {\n title: 'Years',\n size: 16\n },\n title: 'State Specific Socioeconimic Variable vs Years'\n };\n\n// plot scatter graph using inital data/layout\n\n Plotly.plot(\"scatter\", \n data_scatter, \n layout1,\n // updatemenus: [{\n // buttons: [\n // {method: 'animate', args: [['sine']], label: 'sine'},\n // {method: 'animate', args: [['cosine']], label: 'cosine'},\n // {method: 'animate', args: [['circle']], label: 'circle'}\n // ]\n // }]);\n )\n\n// plot line graph using initial data/layout\n\n Plotly.plot(\"line\",\n data_line,\n layout2);\n \n// \"on\" function used to apply listeners to scatter points - first extracts text value of point, then uses that point to match data records in json\n// currently will update line graph with mhi data only -- working to allow drop down to also alter chart rendering\n\n scatter.on(\"plotly_click\", function(d) {\n var text = d.points[0].text;\n console.log(text);\n console.log(raw_data.length)\n console.log(raw_data[0]);\n\n var mhi_data = []\n console.log(raw_data.length)\n for (var i=0; i < raw_data.length; i++)\n if (text == raw_data[i].abbr){\n mhi_data.push(raw_data[i].mhi_data)\n console.log(\"in mhi for loop\")\n console.log(\"in mhi loop: \" + mhi_data[0])\n updatePlotly2(mhi_data[0])\n }\n \n var mhp_data = []\n for (var i=0; i < raw_data.length; i++)\n if (text == raw_data[i].abbr){\n mhp_data.push(raw_data[i].mhp_data)\n console.log(\"in mhp for loop\")\n console.log(\"mhp loop: \" + mhp_data[0])\n }\n var vcr_data = []\n for (var i=0; i < raw_data.length; i++)\n if (text == raw_data[i].abbr){\n vcr_data.push(raw_data[i].vcr_data)\n console.log(\"in vcr for loop\")\n console.log(\"vcr loop: \" + vcr_data[0])\n }\n\n mhi_data = raw_data.filter(function() {\n if (text == raw_data[0].abbr){\n return raw_data[0].mhi_data;\n console.log(mhi_data);\n updatePlotly2();\n }}); \n\n mhp_data = raw_data.filter(function() {\n if (text == raw_data[0].abbr){\n return raw_data[0].mhp_data\n console.log(mhp_data)\n updatePlotly2()\n }});\n\n vcr_data = raw_data.filter(function() {\n if (text == raw_data[0].abbr){ \n return raw_data[0].vcr_data\n console.log(vcr_data)\n updatePlotly2()\n }});\n\n updatePlotly2(mhi_data[0]);\n } \n )\n}", "function loadCallback() {\n\n // set itial values for external parts\n // pitch and bearing and animated element\n pitch.innerHTML = map.getPitch().toFixed(1);\n bearing.innerHTML = map.getBearing().toFixed(1);\n compass.style.transform = 'rotate(-' + map.getBearing().toFixed(4) + 'deg) translateZ(0) rotateX(' + map.getPitch() + 'deg)';\n \n loadMapCaptures(map);\n\n /**\n * EVENT LISTENERS FOR NON-MAP CANVAS ELEMENTS\n */\n // zoom buttons and value\n zoom.innerHTML = map.getZoom().toFixed(1);\n zoomIn.addEventListener('click', function(event) {\n event.preventDefault();\n var currentZoom = map.getZoom();\n map.setZoom(0.5 + currentZoom);\n });\n zoomOut.addEventListener('click', event => {\n event.preventDefault();\n var currentZoom = map.getZoom();\n map.setZoom(currentZoom - 0.5);\n });\n\n map.addSource('dem', {\n \"type\": \"raster-dem\",\n \"url\": \"mapbox://mapbox.terrain-rgb\"\n });\n hillShader.addEventListener('change', () => {\n if (hillShader.checked) {\n map.addLayer({\n \"id\": \"hillshading\",\n \"source\": \"dem\",\n \"type\": \"hillshade\"\n });\n } else {\n map.removeLayer(\"hillshading\");\n }\n });\n\n // smaller data set in geojson file\n map.addSource('yesterday', {\n \"type\": \"geojson\",\n \"data\": \"geo/2018-08-15.geojson\"\n });\n map.addLayer({\n \"id\": \"movements\",\n \"type\": \"line\",\n \"source\": \"yesterday\",\n \"layout\": {},\n \"paint\": {\n \"line-width\": 2,\n \"line-color\": \"#F51945\"\n },\n \"filter\": [\"==\", \"$type\", \"LineString\"]\n });\n\n \n\n /**\n * INIT FLY-TO EVENTS\n */\n map.on('click', 'my-symbols', function(e) {\n map.flyTo({center: e.features[0].geometry.coordinates});\n console.log({center: e.features[0].geometry.coordinates});\n // data for popup on click\n var coordinates = e.features[0].geometry.coordinates.slice();\n var name = e.features[0].properties.name;\n while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {\n coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;\n }\n new mapboxgl.Popup()\n .setLngLat(coordinates)\n .setHTML(name)\n .addTo(map);\n });\n\n map.on('mouseenter', 'my-symbols', function () {\n map.getCanvas().style.cursor = 'pointer';\n });\n map.on('mouseleave', 'my-symbols', function () {\n map.getCanvas().style.cursor = '';\n });\n}", "function createMap(earthquakes, faultLines) {\n // Define outdoors, satellite, and darkmap layers\n // Outdoors layer\n var outdoors = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/outdoors-v10/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n // Satellite layer\n var satellite = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n // Darkmap layer\n var darkmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/dark-v9/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n\n // Define a baseMaps object to hold base layers\n var baseMaps = {\n \"Outdoors\": outdoors,\n \"Satellite\": satellite,\n \"GrayScale\": darkmap,\n };\n\n // Create overlay object to hold overlay layers\n var overlayMaps = {\n \"Earthquakes\": earthquakes,\n \"Fault Lines\": faultLines\n };\n\n // Create map, default settings: outdoors and faultLines layers display on load\n var map = L.map(\"map\", {\n center: [37.09, -95.71],\n zoom: 4,\n layers: [outdoors, earthquakes],\n scrollWheelZoom: false\n });\n\n // Create a layer control\n // Pass in baseMaps and overlayMaps\n // Add the layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(map);\n\n // Adds Legend\n var legend = L.control({position: 'bottomright'});\n legend.onAdd = function(map) {\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [\"0-1\", \"1-2\", \"2-3\", \"3-4\", \"4-5\", \"5+\"];\n\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML += '<i style=\"background:' + chooseColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n };\n\n return div;\n };\n legend.addTo(map);\n\n }", "function loadNewGeoJsonData(data) {\n // clear vector featers and popups\n if(points && points.length > 0) {\n $.each(points, function(i, p) {\n p.setMap(null); // remove from map\n });\n points = [];\n } else {\n points = [];\n }\n\n if(infoWindows && infoWindows.length > 0) {\n $.each(infoWindows, function(i, n) {\n n.close(); // close any open popups\n });\n infoWindows = [];\n } else {\n infoWindows = [];\n }\n\n $.each(data.features, function(i, n) {\n var latLng1 = new google.maps.LatLng(n.geometry.coordinates[1], n.geometry.coordinates[0]);\n var iconUrl = EYA_CONF.imagesUrlPrefix + '/circle-' + n.properties.color.replace('#', '') + '.png';\n var markerImage = new google.maps.MarkerImage(iconUrl,\n new google.maps.Size(9, 9),\n new google.maps.Point(0, 0),\n new google.maps.Point(4, 5)\n );\n points[i] = new google.maps.Marker({\n map: map,\n position: latLng1,\n title: n.properties.count + ' ' + $.i18n.prop('eya.map.nrOccurrences'),\n icon: markerImage\n });\n\n var solrQuery;\n if($.inArray('|', taxa) > 0) {\n var parts = taxa.split('|');\n var newParts = [];\n parts.forEach(function(j) {\n newParts.push(rank + ':' + parts[j]);\n });\n solrQuery = newParts.join(' OR ');\n } else {\n solrQuery = '*:*'; // rank+':'+taxa;\n }\n var fqParam = '';\n if(taxonGuid) {\n fqParam = '&fq=species_guid:' + taxonGuid;\n } else if(state.speciesGroup !== 'ALL_SPECIES') {\n fqParam = '&fq=species_group:' + state.speciesGroup;\n }\n\n var content =\n '<div class=\"infoWindow\">' +\n $.i18n.prop('eya.speciesTable.header.count.label') + ': ' + n.properties.count +\n '<br />' +\n '<a href=\"' + EYA_CONF.contextPath + '/occurrences/search?q=' + solrQuery + fqParam + '&lat=' + n.geometry.coordinates[1] + '&lon=' + n.geometry.coordinates[0] + '&radius=0.06\">' +\n '<span class=\"fa fa-list\"></span>' +\n '&nbsp;' +\n $.i18n.prop('general.btn.viewRecords') +\n '</a>' +\n '</div>';\n\n infoWindows[i] = new google.maps.InfoWindow({\n content: content,\n maxWidth: 200,\n disableAutoPan: false\n });\n google.maps.event.addListener(points[i], 'click', function(event) {\n if(lastInfoWindow) {\n // close any previously opened infoWindow\n lastInfoWindow.close();\n }\n infoWindows[i].setPosition(event.latLng);\n infoWindows[i].open(map, points[i]);\n lastInfoWindow = infoWindows[i]; // keep reference to current infoWindow\n });\n });\n\n }", "function loadQuestionslayer(questiondata) {\r\n // convert the text to JSON\r\n var questionsjson = JSON.parse(questiondata);\r\n // add the JSON layer onto the map - it will appear using the default icons\r\nquestionslayer = L.geoJson(questionsjson,\r\n{\r\npointToLayer: function (feature, latlng)\r\n{return L.marker(latlng).bindPopup(\"<b>\"+feature.properties.questionid+\". \"\r\n+feature.properties.question+\"</b>\" );\r\n},\r\n}).addTo(mymap);\r\n // change the map zoom so that all the data is shown\r\nmymap.fitBounds(questionslayer.getBounds());\r\n}", "function createFeatures(earthquakeData) {\n var earthquakes = L.geoJSON(earthquakeData), {\n onEachFeature: function(feature, layer) {\n layer.bindPopup(\"<h3> Location: \" + feature.properties.place + \"</h3><hr><p> Date/Time: \" + new Date(feature.properties.time) + \"</p><p> Magnitude: \" + feature.properties.mag + \"</p>\"); \n },\n\n pointToLayer: function (feature, latlng) {\n return new L.circle(latlng,\n {radius: getRadius(feature.properties.mag),\n fillColor: circleColor(earthquakeData.geometry.coordinates[2]),\n fillOpacity: .6,\n color: \"black\",\n stroke: true,\n weight: .75\n })\n }\n });\n createMap (earthquakes);\n}\n\n//create the mapping and layers\nfunction createMap(earthquakes) {\n var topoMap = L.tileLayer('https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}', {\n maxZoom: 20,\n attribution: 'Tiles courtesy of the <a href=\"https://usgs.gov/\">U.S. Geological Survey</a>'\n });\n\n var streetMap = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n });\n\n var let satelliteMap = L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{\n maxZoom: 20,\n subdomains:['mt0','mt1','mt2','mt3']\n });\n\n var baseMaps = {\n \"Topo Map\": topoMap,\n \"Street Map\": streetMap,\n \"Satellite Map\": satelliteMap\n }\n});\n\n// Create an overlay object to hold the overlay layer\nvar overlayMaps = {\n \"Earthquakes\": earthquakes\n};\n \n// Create a myMap centered on Houston\nvar myMap = L.map(\"map\", {\n center: [29.75, -95.37],\n zoom: 3,\n layers: [topoMap, earthquakes]\n});\n//Add layer control to the map\nL.control.layers(baseMaps, overlayMaps, {\n collapsed: false,\n legend: true\n}).addTo(myMap);\n\n// Create a legend\nvar legend = L.control({position: 'bottomleft'});\n legend.onAdd = function (myMap) {\n\n var div = L.DomUtil.create('div', 'info legend');\n labels = [],\n grades = [0,1,2,3,4,5];\n\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n return div;\n };\n legend.addTo(myMap);\n}", "function loadTractGeoData(msa) {\n\t\tvar src = Site.rootDir + \"data/tracts/topojson_quantized_1e6/\" + msa + \"_tract.topojson\";\n\t\tif (MAP_DEBUG) console.log(\" -> loadTractGeoData()\", msa, src);\n\n\t\td3.json(src, function(error, data) { // use D3 to load JSON\n\t\t\tif (error) return console.warn(error); // return if error\n\t\t\tif (MAP_DEBUG) console.log(\" -> d3.json\", data); // testing\n\t\t\t// is there already a tract layer?\n\t\t\tif (tractLayer != {}) {\n\t\t\t\tif (MAP_DEBUG) console.log(\" -> tractLayer != null = \", tractLayer);\n\t\t\t\t// map.eachLayer(function (layer) {\n\t\t\t\t// \tif (prop(layer.feature) && prop(layer.feature.properties) && prop(layer.feature.properties.TID))\n\t\t\t\t// \t\tif (MAP_DEBUG) console.log(\"layer.feature.properties\",layer.feature.properties);\n\t\t\t\t// });\n\t\t\t\tmap.removeLayer(tractLayer); // remove current layer from map\n\t\t\t\ttractLayer = {};\n\t\t\t}\n\t\t\ttractTIDindex = {}; // reset TID references\n\t\t\ttractRIDindex = {}; // reset RID references\n\n\t\t\tif (MAP_DEBUG) console.log(\"currentScenarioTIDs = \", currentScenarioTIDs);\n\n\t\t\ttractLayer = new L.TopoJSON(data, { // create new tractLayer, add data\n\t\t\t\tmsa: msa, // for reference later\n\t\t\t\tstyle: initialTractStyle,\n\t\t\t\tonEachFeature: onEachTractFeature\n\t\t\t});\n\t\t\ttractLayer.addTo(map); // add layer to map\n\t\t\t// may not need this because msa already selected/zoomed\n\t\t\t//zoomToMSAonMap(msa, \"loadTractGeoData\");\n\t\t\tresetMSAStyle(); // make sure the MSA is not visible\n\t\t\t//restyleTractLayer()\n\n\t\t\t// hide the last msa\n\t\t\thideLastMSAFeature();\n\t\t\t//if (MAP_DEBUG) console.log(\" -> lastMSAFeature\",lastMSAFeature);\n\n\t\t\t// bring to front\n\t\t\tif (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n\t\t\t\ttractLayer.bringToFront();\n\t\t\t}\n\t\t});\n\t}", "function draw()\n {\n var ctx = $(\"map-overview\").getContext('2d');\n \n var halfWidthMap = overviewImage.width/2;\n var halfHeightMap = overviewImage.height/2;\n\n // mapping between 1 px and 1 'world unit'\n // the following values come from \"cl_leveloverview\"\n var posX = -overviewInfo[\"pos_x\"];\n var posY = overviewInfo[\"pos_y\"];\n \n var x_unit_to_pixel = (halfWidthMap/posX);\n var y_unit_to_pixel = (halfHeightMap/posY);\n \n ctx.clearRect(0,0, overviewImage.width, overviewImage.height);\n ctx.drawImage(overviewImage, 0, 0);\n \n ctx.save();\n \n // move the drawing cursor to the center of the image\n ctx.translate(halfWidthMap, halfHeightMap);\n \n for (var i = 0, len = interpolatedPlayers.length; i < len; i++)\n {\n var iplayer = interpolatedPlayers[i];\n \n ctx.save();\n \n // Position\n ctx.translate(iplayer[\"iposx\"]*x_unit_to_pixel, -iplayer[\"iposy\"]*y_unit_to_pixel);\n\n // Team\n switch (iplayer[\"player\"][\"teamNumber\"])\n {\n case 0:\n ctx.strokeStyle = ctx.fillStyle = \"red\";\n break;\n case 1:\n ctx.strokeStyle = ctx.fillStyle = \"blue\";\n break;\n default:\n ctx.strokeStyle = ctx.fillStyle = \"yellow\";\n break;\n }\n \n // Name\n ctx.font = \"7pt Arial\";\n var str = iplayer[\"player\"][\"name\"];\n var strSize = ctx.measureText(str);\n ctx.fillText(str, -Math.round(strSize.width)/2, -10);\n \n // Rotation\n ctx.rotate(-iplayer[\"iyaw\"] * (Math.PI/180));\n \n // Circle + direction drawing\n ctx.beginPath();\n var wCursor = 3;\n ctx.lineTo(-wCursor, 0);\n ctx.lineTo(wCursor*2, 0);\n ctx.arc(0, 0, wCursor, 0, Math.PI*2);\n ctx.stroke(); // or fill();\n ctx.closePath();\n \n // \"Look at\" drawing\n //ctx.translate(-sight.width/2, -sight.height/2);\n //ctx.drawImage(sight, 0, 0);\n //ctx.drawImage(cursor, 0, 0);\n \n ctx.restore();\n }\n ctx.restore();\n }", "function createMap(){\n //zooms automatically to California\n var map = L.map('map', {\n center: [36.7783, -116.4179],\n zoom: 6\n });\n\n//mapbox basemap\nL.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZW1pbGxpZ2FuIiwiYSI6ImNqczg0NWlxZTBia2U0NG1renZyZDR5YnUifQ.UxV3OqOsN6KuZsclo96yvQ', {\n //map attribution\n attribution: 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery &copy; <a href=\"http://mapbox.com\">Mapbox</a>',\n maxZoom: 18,\n //uses mapbox streets as opposed to satellite imagery, etc.\n id: 'mapbox.light',\n //my unique access token\n accessToken: 'pk.eyJ1IjoiZW1pbGxpZ2FuIiwiYSI6ImNqczg0NWlxZTBia2U0NG1renZyZDR5YnUifQ.UxV3OqOsN6KuZsclo96yvQ'\n}).addTo(map);\n \n getData(map);\n getNextLayer(map);\n}", "renderLayers() {\n const subLayerProps = this.getSubLayerProps({\n id: 'geojson',\n\n // Proxy most GeoJsonLayer props as-is\n data: this.props.data,\n fp64: this.props.fp64,\n filled: this.props.filled,\n stroked: this.props.stroked,\n lineWidthScale: this.props.lineWidthScale,\n lineWidthMinPixels: this.props.lineWidthMinPixels,\n lineWidthMaxPixels: this.props.lineWidthMaxPixels,\n lineJointRounded: this.props.lineJointRounded,\n lineMiterLimit: this.props.lineMiterLimit,\n pointRadiusScale: this.props.pointRadiusScale,\n pointRadiusMinPixels: this.props.pointRadiusMinPixels,\n pointRadiusMaxPixels: this.props.pointRadiusMaxPixels,\n lineDashJustified: this.props.lineDashJustified,\n getLineColor: this.selectionAwareAccessor(this.props.getLineColor),\n getFillColor: this.selectionAwareAccessor(this.props.getFillColor),\n getRadius: this.selectionAwareAccessor(this.props.getRadius),\n getLineWidth: this.selectionAwareAccessor(this.props.getLineWidth),\n getLineDashArray: this.selectionAwareAccessor(this.props.getLineDashArray),\n\n updateTriggers: {\n getLineColor: [this.props.selectedFeatureIndexes, this.props.mode],\n getFillColor: [this.props.selectedFeatureIndexes, this.props.mode],\n getRadius: [this.props.selectedFeatureIndexes, this.props.mode],\n getLineWidth: [this.props.selectedFeatureIndexes, this.props.mode],\n getLineDashArray: [this.props.selectedFeatureIndexes, this.props.mode]\n }\n });\n\n let layers: any = [new GeoJsonLayer(subLayerProps)];\n\n layers = layers.concat(this.createTentativeLayers());\n layers = layers.concat(this.createEditHandleLayers());\n\n return layers;\n }", "function processLayer(json) {\n\t\t\t// Create a map\n\t\t\tvar map = L.map(mapContainer, {\n\t\t\t\tzoomAnimation: true, // Removing the zoom animation makes D3 overlay work more nicely when zooming\n\t\t\t\tfadeAnimation : true // Fade animation is ok\n\t\t\t});\n\t\t\tvar tileLayer = new L.TileLayer.Main();\n\t\t\t\n\t\t\t// Create Leaflet TopoJSON layer\n\t\t\tvar featureLayer = new L.TopoJSON();\n\t\t\tfeatureLayer.addData(json)\n\t\t\t\n\t\t\tmap.fitBounds(featureLayer.getBounds());\n\t\t\ttileLayer.addTo(map); // Render map\n\t\t\t\n\t\t\tprocessFeatures(featureLayer, 0);\n\t\t\tfeatureLayer.addTo(map);\n\t\t\t\n\t\t\t// Create SVG container for the legend\n\t\t\tvar legendContainer = d3.select(container)\n\t\t\t\t.append('svg')\n\t\t\t\t.classed('legendContainer', true)\n\t\t\t\t.classed('do-not-print', true)\n\t\t\t\t\t.style({\n\t\t\t\t\t\t'margin-left': '10px',\n\t\t\t\t\t\t'display': 'inline-block',\n\t\t\t\t\t\t'font': '10px sans-serif'\n\t\t\t\t\t})\n\t\t\t\t\t.attr('height', height)\t\n\t\t\t\t\t.append('g');\n\t\t\t\n\t\t\tif (config.legend) { // Draw legend\n\t\t\t\tvar legend = rmvpp.api.legend.create(d3.select(container).select('.legendContainer>g'), measureNames, 'Measures', 0); // Legend\n\t\t\t\trmvpp.api.legend.addColourKey(legend, measureNames, colour);\n\t\t\t\t\n\t\t\t\t// Make legend a measure selector\n\t\t\t\td3.select(container).selectAll('.legendContainer .key')\n\t\t\t\t\t.on('click', function(d, i) {\n\t\t\t\t\t\trmvpp.api.tooltip.hide(tooltip);\n\t\t\t\t\t\tprocessFeatures(featureLayer, i);\n\t\t\t\t\t})\n\t\t\t\t\t.style('cursor','pointer');\n\t\t\t}\n\t\t}", "function addGeoJSON() {\r\n $.ajax({\r\n url: \"https://potdrive.herokuapp.com/api/map_mobile_data\",\r\n type: \"GET\",\r\n success: function(data) {\r\n window.locations_data = data\r\n console.log(data)\r\n //create markers from data\r\n addMarkers();\r\n //redraw markers whenever map moves\r\n map.on(plugin.google.maps.event.MAP_DRAG_END, addMarkers);\r\n setTimeout(function(){\r\n map.setAllGesturesEnabled(true);\r\n $.mobile.loading('hide');\r\n }, 300);\r\n },\r\n error: function(e) {\r\n console.log(e)\r\n alert('Request for locations failed.')\r\n }\r\n }) \r\n }", "function createFeatures(quakeData, tectonicData) {\n /**** onEachFeature properties ******** */\n function onEachFeature(feature, layer) {\n // Does this feature have a property ?\n if (feature.properties) {\n // Create a popup that provides detailed description\n popupContent = \"<h3>\" + feature.properties.place +\n \"</h3> <h4> Magnitude: \" + feature.properties.mag + \"</h4><hr><p>\" + \n new Date(feature.properties.time) + \"</p>\";\n layer.bindPopup(popupContent,{offset: new L.Point(0, -10)});\n }\n }\n // Creating earthquakes overlay map\n var earthquakes = L.geoJSON(quakeData, {\n pointToLayer: function(quakeData, latlng){\n return L.circle ( latlng,{ \n radius: MarkerSize(quakeData.properties.mag),\n fillColor: MarkerColors(quakeData.properties.mag),\n fillOpacity: 1.0,\n weight: 1,\n color: \"black\",\n className: 'blinking'\n });\n },\n onEachFeature: onEachFeature\n }); \n // Creating tectonic plates overlay map\n var tectonic_plates = L.geoJSON(tectonicData, {\n style: function(feature){\n return {color: \"orange\",\n weight: 2};\n },\n onEachFeature: function(feature, layer ){\n // Create a popup that provides detailed description\n popupContent = \"<h3>\" + feature.properties.Name +\n \"</h3><h4> PlateA: \" + feature.properties.PlateA + \n \"<br>PlateB:\" + feature.properties.PlateB +\"</h4> <hr><p>\" + \n feature.properties.Source + \"</p>\";\n layer.bindPopup(popupContent)\n }\n });\n\n // Sending our earthquakes layer to the createMap function\n createMap(earthquakes, tectonic_plates);\n}", "function loadline() {\n map.on('click', () => {\n map.addSource('route', {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': [\n [\n -25.6, 12.901505084198375\n ],\n [\n -25.250701904296875,\n 12.902843703352639\n ],\n [\n -25.149078369140625,\n 13.007233869059881\n ]\n ]\n }\n }\n });\n map.addLayer({\n 'id': 'route',\n 'type': 'line',\n 'source': 'route',\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': '#21FFBD',\n 'line-width': 8\n }\n });\n });\n}", "function loadJSON() {\n \n //GET JSON file\n $.getJSON( \"scr/links.json\", function(result) {\n\n var json = result;\n\n $('#SupaeroMap').wrap('<a ' + json.SupaeroMap + ' target=\"_blank\"' + ' class=\"pull-left margin-fix-map\"> </a>');\n $('#Supaero').wrap('<a ' + json.Supaero + ' target=\"_blank\"' + ' class=\"margin-left-10\"> </a>');\n $('#ConcordiaMap').wrap('<a ' + json.ConcordiaMap + ' target=\"_blank\"' + ' class=\"pull-left margin-fix-map\"> </a>');\n $('#Concordia').wrap('<a ' + json.Concordia + ' target=\"_blank\"' + ' class=\"margin-left-10\"> </a>');\n $('#UnipaMap').wrap('<a ' + json.UnipaMap + ' target=\"_blank\"' + ' class=\"pull-left margin-fix-map\"> </a>');\n $('#Unipa').wrap('<a ' + json.Unipa + ' target=\"_blank\"' + ' class=\"margin-left-10\"> </a>');\n $('#AeroconseilMap').wrap('<a ' + json.AeroconseilMap + ' target=\"_blank\"' + ' class=\"pull-left margin-fix-map\"> </a>');\n $('#Aeroconseil').wrap('<a ' + json.Aeroconseil + ' target=\"_blank\"' + ' class=\"margin-left-10\"> </a>');\n $('#AssystemMap').wrap('<a ' + json.AssystemMap + ' target=\"_blank\"' + ' class=\"pull-left margin-fix-map\"> </a>');\n $('#Assystem').wrap('<a ' + json.Assystem + ' target=\"_blank\"' + ' class=\"margin-left-10\"> </a>');\n $('#EnscoMap').wrap('<a ' + json.EnscoMap + ' target=\"_blank\"' + ' class=\"pull-left margin-fix-map\"> </a>');\n $('#Ensco').wrap('<a ' + json.Ensco + ' target=\"_blank\"' + ' class=\"margin-left-10\"> </a>');\n $('#MechtronixMap').wrap('<a ' + json.MechtronixMap + ' target=\"_blank\"' + ' class=\"pull-left margin-fix-map\"> </a>');\n $('#Mechtronix').wrap('<a ' + json.Mechtronix + ' target=\"_blank\"' + ' class=\"margin-left-10\"> </a>');\n });\n \n}", "function initialize() {\r\n //get the json\r\n $.getJSON('/resources/maps/' + name + '.json', {}, function (data) {\r\n //json loaded\r\n\r\n //get size of map\r\n _self.size = new Size(data.size.width, data.size.height);\r\n\r\n //get the tilesets\r\n for (var k = 0; k < data.tilesets.length; k++) {\r\n var tileset = data.tilesets[k];\r\n\r\n var img = new Image();\r\n img.src = tileset.src;\r\n var set = {\r\n image: img,\r\n autotile: tileset.autotile,\r\n frames: tileset.frames,\r\n size: tileset.size\r\n };\r\n //add tileset to array\r\n _tilesets.push(set);\r\n }\r\n\r\n //separate the layers out into logical layers to be drawn\r\n //get all tiles with prioriry 0, and layer them first\r\n createLayers(data, _bottomLayers, PRIORITY_BELOW);\r\n\r\n //then, get all tiles with priority 1, and layer them last\r\n createLayers(data, _topLayers, PRIORITY_ABOVE);\r\n\r\n //map is loaded\r\n _self.mapLoaded = true;\r\n\r\n //loaded callback\r\n if (typeof loaded == 'function') {\r\n loaded();\r\n }\r\n });\r\n\r\n }", "function addPOIs(map,getURL,apiKey){\r\n \r\n var POIlayers = [];\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n var campMarker = L.icon({\r\n iconUrl: 'img/tent.svg',\r\n //shadowUrl: 'img/home-white.svg',\r\n iconSize: [30, 30],\r\n shadowSize: [30, 30],\r\n shadowAnchor: [14,14]\r\n });\r\n \r\n var parkingMarker = L.icon({\r\n iconUrl: 'img/car.svg',\r\n //shadowUrl: 'img/parking-white.svg',\r\n iconSize: [30, 30],\r\n shadowSize: [20, 20],\r\n shadowAnchor: [9,9]\r\n });\r\n \r\n var landingMarker = L.icon({\r\n iconUrl: 'img/kayak.svg',\r\n //shadowUrl: 'img/zoo-white.svg',\r\n iconSize: [30, 30],\r\n shadowSize: [40, 40],\r\n shadowAnchor: [19,19]\r\n });\r\n \r\n var lookoutMarker = L.icon({\r\n iconUrl: 'img/binoculars.svg',\r\n //shadowUrl: 'img/baseball-white.svg',\r\n iconSize: [30, 30],\r\n shadowSize: [32, 32],\r\n shadowAnchor: [15,15]\r\n });\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n // Get CARTO selection as GeoJSON and Add to Map\r\n $.getJSON(getURL+'SELECT * FROM parking&api_key='+apiKey, function(data) {\r\n var features = data.features\r\n Parking = L.geoJson(features, {\r\n \r\n pointToLayer: function(feature,latlng){\r\n return L.marker(latlng, {icon: parkingMarker});\r\n },\r\n onEachFeature: hoverName\r\n });\r\n \r\n \r\n POIlayers.push(Parking);\r\n \r\n Parking.addTo(map);\r\n \r\n \r\n })\r\n \r\n // Get CARTO selection as GeoJSON and Add to Map\r\n $.getJSON(getURL+'SELECT * FROM lookout&api_key='+apiKey, function(data) {\r\n var features = data.features\r\n Lookout = L.geoJson(features, {\r\n pointToLayer: function(feature,latlng){\r\n return L.marker(latlng, {icon: lookoutMarker});\r\n },\r\n onEachFeature: hoverName\r\n });\r\n \r\n \r\n POIlayers.push(Lookout);\r\n \r\n Lookout.addTo(map);\r\n })\r\n \r\n // Get CARTO selection as GeoJSON and Add to Map\r\n $.getJSON(getURL+'SELECT * FROM camp&api_key='+apiKey, function(data) {\r\n var features = data.features\r\n Camp = L.geoJson(features, {\r\n pointToLayer: function(feature,latlng){\r\n return L.marker(latlng, {icon: campMarker});\r\n },\r\n onEachFeature: hoverName\r\n });\r\n \r\n \r\n POIlayers.push(Camp);\r\n \r\n Camp.addTo(map);\r\n })\r\n \r\n // Get CARTO selection as GeoJSON and Add to Map\r\n $.getJSON(getURL+'SELECT * FROM landing&api_key='+apiKey, function(data) {\r\n var features = data.features\r\n Landing = L.geoJson(features, {\r\n pointToLayer: function(feature,latlng){\r\n return L.marker(latlng, {icon: landingMarker});\r\n },\r\n onEachFeature: hoverName\r\n });\r\n \r\n \r\n POIlayers.push(Landing);\r\n \r\n Landing.addTo(map);\r\n })\r\n}", "function createFeatures(earthquakeData) {\n \n function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }\n\n // Read GeoJSON data, create circle markers, and add to earthquake layer group\n L.geoJSON(earthquakeData, {\n pointToLayer: function (feature, latlng) {\n return L.circleMarker(latlng, {\n radius: feature.properties.mag * 5,\n fillColor: chooseColour(feature.properties.mag),\n color: \"black\",\n weight: 0.5,\n opacity: 0.5,\n fillOpacity: 0.8\n });\n },\n onEachFeature: onEachFeature\n }).addTo(earthquakes);\n\n // Define street map layer\n var streetmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox/streets-v11\",\n accessToken: API_KEY\n });\n\n // Define satellite map layer\n var satellitemap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.satellite\",\n accessToken: API_KEY\n });\n\n // Define outdoors map layer\n var outdoorsmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/outdoors-v9/tiles/256/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox/outdoors\",\n accessToken: API_KEY\n });\n\n // define greyscale map layer\n var lightmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/light-v9/tiles/256/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.light\",\n accessToken: API_KEY\n });\n\n // Define the baseMaps for the map types we created above\n var baseMaps = {\n \"Street Map\": streetmap,\n \"Satellite Map\": satellitemap,\n \"Outdoors Map\": outdoorsmap,\n \"Greyscale Map\": lightmap\n };\n\n // Read the tectonic Plate GeoJSON from the source URL, and add to faultLines layer group\n d3.json(\"https://raw.githubusercontent.com/fraxen/tectonicplates/master/GeoJSON/PB2002_boundaries.json\",\n function(platedata) {\n L.geoJson(platedata, {\n color: \"orange\",\n weight: 2\n }).addTo(faultLines);\n });\n\n // Create a new map\n var myMap = L.map(\"map\", {\n center: [\n 48.10, -100.10\n ],\n zoom: 3,\n layers: [streetmap, earthquakes, faultLines]\n });\n\n // create overlay map with the 2 data layers\n var overlayMaps = {\n \"Earthquakes\": earthquakes,\n \"Fault Lines\": faultLines,\n };\n\n // Add a layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n // function to set the earthquake circle size based on value of mag (magnitude)\n function chooseColour(mag) {\n if (mag > 5) {\n return \"red\";\n }\n else if (mag > 4){\n return \"orangered\";\n }\n else if (mag > 3){\n return \"orange\";\n }\n else if (mag > 2){\n return \"gold\";\n }\n else if (mag > 1){\n return \"yellow\"\n }\n else {\n return \"greenyellow\";\n }\n }\n\n // Create the legend control and set its position\n var legend = L.control({\n position: \"bottomright\"\n });\n\n // function to assign values to the legend, as well as color boxes (see style.css file)\n legend.onAdd = function (myMap) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + chooseColour(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n return div;\n };\n // add the legend to the map\n legend.addTo(myMap);\n\n}", "function addPlaceMarks() {\n // first init layer\n if (gazetteerLayer == null) {\n gazetteerLayer = new WorldWind.RenderableLayer(\"GazetteerLayer\"); \n\n for (var i = 0; i < availableRegionsCSV.length; i++) { \n // create a marker for each point\n var name = availableRegionsCSV[i].name;\n var latitude = availableRegionsCSV[i].center_lat;\n var longitude = availableRegionsCSV[i].center_lon; \n var diameter = parseFloat(availableRegionsCSV[i].diameter);\n\n var labelAltitudeThreshold = 0; \n\n if (diameter >= 0 && diameter < 10) { \n labelAltitudeThreshold = 1.1e3;\n } else if (diameter > 10 && diameter < 20) {\n labelAltitudeThreshold = 1.7e3;\n } else if (diameter >= 20 && diameter < 40) {\n labelAltitudeThreshold = 1.2e4;\n } else if (diameter >= 40 && diameter < 60) {\n labelAltitudeThreshold = 1.7e4;\n } else if (diameter >= 60 && diameter < 80) {\n labelAltitudeThreshold = 1.2e5;\n } else if (diameter >= 80 && diameter < 100) {\n labelAltitudeThreshold = 1.7e5;\n } else if (diameter >= 100 && diameter < 200) {\n labelAltitudeThreshold = 1.2e6;\n } else if (diameter >= 200 && diameter < 400) {\n labelAltitudeThreshold = 1.7e6;\n } else if (diameter >= 400 && diameter < 600) {\n labelAltitudeThreshold = 1.2e7;\n } else if (diameter >= 600 && diameter < 1000) {\n labelAltitudeThreshold = 1.7e7;\n } else if (diameter >= 1000 && diameter < 1400) {\n labelAltitudeThreshold = 1.2e8;\n } else if (diameter >= 1400 && diameter < 2000) {\n labelAltitudeThreshold = 1.7e8;\n } else {\n labelAltitudeThreshold = 1.2e9;\n }\n\n\n var placemark = new WorldWind.Placemark(new WorldWind.Position(latitude, longitude, 10), true, null);\n placemark.label = name;\n placemark.altitudeMode = WorldWind.RELATIVE_TO_GROUND; \n\n placemark.eyeDistanceScalingThreshold = labelAltitudeThreshold - 1e5;\n placemark.eyeDistanceScalingLabelThreshold = labelAltitudeThreshold;\n\n var placemarkAttributes = new WorldWind.PlacemarkAttributes(); \n placemarkAttributes.labelAttributes.color = new WorldWind.Color(0.43, 0.93, 0.97, 1);\n placemarkAttributes.labelAttributes.depthTest = false;\n placemarkAttributes.labelAttributes.scale = 1.2;\n placemarkAttributes.imageScale = 0.8;\n placemarkAttributes.imageSource = \"html/images/close.png\"; \n\n placemark.attributes = placemarkAttributes;\n\n\n // as they are small and slow\n if (diameter < MIN_DEFAULT_LOAD) {\n placemark.enabled = false;\n }\n\n var obj = {\"diameter\": diameter};\n placemark.userProperties = obj;\n\n\n // add place mark to layer\n gazetteerLayer.addRenderable(placemark); \n } \n\n // Marker layer\n wwd.insertLayer(10, gazetteerLayer);\n\n } else { \n if (isShowGazetteer === false) {\n gazetteerLayer.enabled = false; \n } else { \n gazetteerLayer.enabled = true;\n }\n } \n }", "function LoadGEOJsonSources() {\n map.addSource('Scotland-Foto', {\n \"type\": \"geojson\",\n \"data\": \"https://daanvr.github.io/Schotland/geojson/Scotrip-FotoDataFile-RichOnly-Live.geojson\"\n });\n map.addSource('Scotland-Routes', {\n \"type\": \"geojson\",\n \"data\": \"https://daanvr.github.io/Schotland/geojson/Routes.geojson\"\n });\n\n var data = JSON.parse('{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-5.096936,57.149319]},\"properties\":{\"FileName\":\"IMG_8571\",\"type\":\"Foto\",\"FileTypeExtension\":\"jpg\",\"SourceFile\":\"/Users/daan/Downloads/Schotlandexpiriment/IMG_8571.JPG\",\"CreateDate\":\"2018-04-13\",\"CreateTime\":\"15:15:34\",\"Make\":\"Apple\",\"Model\":\"iPhoneSE\",\"ImageSize\":\"16382x3914\",\"Duration\":\"\",\"Altitude\":\"276\",\"URL\":\"https://farm1.staticflickr.com/823/26804084787_f45be76bc3_o.jpg\",\"URLsmall\":\"https://farm1.staticflickr.com/823/26804084787_939dd60ebc.jpg\"}}]}');\n map.addSource('SelectedMapLocationSource', {\n type: \"geojson\",\n data: data,\n });\n\n AddMapIcon(); // add img to be used as icon for layer\n}", "function makeMap(json){\n\t//Bind data and create one path per GeoJSON feature\n\tmap.selectAll(\"path\")\n\t\t.data(json.features)\n\t\t.enter()\n\t\t.append(\"path\")\n\t\t.attr(\"d\", path)\n\t\t.style(\"fill\", function(d){\n\t\t\treturn color(d.properties.mapcolor7)\n\t\t})\n\t\t.style(\"stroke\", \"#5a5959\")\n\t\t.on(\"mouseover\", handleMouseOver)\n\t\t.on(\"mouseout\", handleMouseOut)\n}", "function update(geojson) {\n g.selectAll('path')\n .data(geojson.features)\n .enter()\n .append('path')\n .style(\"fill\", \"white\")\n .style(\"stroke\", \"black\") \n .style(\"stroke-width\", 0.2) \n .attr('d', geoGenerator);\n }", "function onEachFeature(feature, layer) {\r\n\r\n //abracadabra\r\n let stopId = feature.properties.stopId;\r\n let stopTitle = feature.properties.title;\r\n // let muniLine = feature.properties.Route;\r\n\r\n let stopInfo = APICallResponse.filter(function(stop) {\r\n return stop.stop_point_ref == stopId;\r\n });\r\n\r\n // console.log(stopInfo.length, feature.properties.Route);\r\n // console.log(\"stops being used\", stopInfo, feature.properties.Route, stopId);\r\n\r\n\r\n // if the stopID was found in the APICallResponse and there were no duplicate stop IDs found, then it will return an array with length 1\r\n if(stopInfo.length == 1){\r\n\r\n let direction = stopInfo[0].direction_ref;\r\n let lines = stopInfo[0].lines;\r\n\r\n layer.bindPopup(\r\n \"<h4>\" + \"Stop ID: \" + stopId + \"</h4>\" +\r\n \"<h4>\" + \"Direction: \" + direction + \"</h4>\" + \r\n \"<h4>\" + \"Title: \" + stopTitle + \"</h4>\" + \r\n linesInfo(lines)\r\n );\r\n\r\n // this function is used to generate the HTML for each line in the lines array\r\n function linesInfo(linesArray){\r\n\r\n let htmlBlock = \"\";\r\n \r\n linesArray.forEach((line) =>{\r\n\r\n let lineName = line.line_ref;\r\n let minLate = line.scores.min_late;\r\n let shameScorePredictionLabel = line.scores.prediction_label;\r\n let shameScoreDescription = shameScoreInfo[shameScorePredictionLabel].description;\r\n\r\n // console.log(\"minstype\", minLate);\r\n // console.log(\"mintype\", typeof(minLate));\r\n\r\n if(typeof(minLate) == \"number\"){\r\n minLate = parseFloat(minLate.toFixed(2));\r\n // console.log(\"minslate\", minLate);\r\n minLate = hhmmss(minLate);\r\n // console.log(\"minslate 2\", minLate);\r\n \r\n }\r\n\r\n if(userSelectedMUNILineList.includes(lineName)){\r\n htmlBlock += \"<hr>\" +\r\n \"<p>\" + \r\n \"<big><b>Line: </b>\" + lineName + \"</big><br><br>\" +\r\n \"<b>Current Shame Score: </b>\" + shameScoreDescription + \"<br>\" +\r\n \"<b>Current Trip Prognosis: </b>There is a 50% chance that this bus will be \" + shameScorePredictionLabel + \"<br>\" + \"<br>\" +\r\n \"<b>Historical average minutes late: </b>\" + minLate + \r\n \"</p>\";\r\n\r\n }\r\n\r\n });\r\n \r\n return htmlBlock;\r\n }\r\n\r\n\r\n } else {\r\n layer.bindPopup(\r\n \"<h4>\" + \"Stop ID: \" + stopId + \"</h4>\" +\r\n \"<hr>\" +\r\n \"<b>\" + \"Title: \" + \"</b>\" + stopTitle + \"</p>\"\r\n );\r\n }\r\n }", "function populateLevelObjects() {\n console.log(\"%c[Level] Populating level objects\", \"font-weight: bold;\");\n\n var objectLayers = mapImporter.getObjectLayers();\n\n objectLayers.forEach(function(currentObjectLayer) {\n switch(currentObjectLayer.name) {\n case \"Note\":\n // Since we only have one note in the level, we can hardcode the text. Not a great solution, but the time's running out \n var note = new Note(\"number of pillars x number of crates / number of people who failed this riddle - the width of the ctrl room\", currentObjectLayer.objects[0].x * 4, currentObjectLayer.objects[0].y * 4);\n note.onNoteRead = function() {\n levers.forEach(function(lever) {\n lever.object.setInteractable(true);\n })\n }\n break;\n case \"Levers\":\n currentObjectLayer.objects.forEach(function(object, index) {\n // To be fair, I don't know where the -50 is coming from. Seems like some trouble with images that aren't a power of two size. This is a workaround!\n var lever = new Lever(index, false, object.x*4, object.y*4 - 50);\n lever.onLeverStateChanged = checkLeverPuzzle;\n lever.object.setInteractable(false);\n levers.push(lever);\n });\n break;\n case \"Podest\":\n new GameObject({\n sprite: {\n spriteSheet: \"assets/img/objects/podest.png\",\n tileCount: 1,\n tickRate: 0,\n tileWidth: 32,\n tileHeight: 32,\n renderWidth: 128,\n renderHeight: 128,\n renderPixelated: true\n },\n interactable: false,\n name: \"podest\",\n renderLayer: 13,\n animated: false,\n collidable: false,\n }, currentObjectLayer.objects[0].x*4, currentObjectLayer.objects[0].y*4-110);\n break;\n case \"Gauntlet\":\n new GameObject({\n sprite: {\n spriteSheet: \"assets/img/objects/gauntlet.png\",\n tileCount: 1,\n tickRate: 0,\n tileWidth: 27,\n tileHeight: 36,\n renderWidth: 27*2,\n renderHeight: 36*2,\n renderPixelated: true\n },\n interactable: true,\n name: \"gauntlet\",\n renderLayer: 14,\n animated: false,\n onInteract: onGauntletInteract,\n collidable: true\n }, currentObjectLayer.objects[0].x*4, currentObjectLayer.objects[0].y*4-48); \n break;\n case \"PressurePlates\":\n currentObjectLayer.objects.forEach(function(obj, index) {\n var plate = new PressurePlate(index, obj.x*4, obj.y*4);\n plate.onPlateStateChanged = checkPlatePuzzle;\n plates.push(plate);\n });\n break;\n case \"Chest\":\n currentObjectLayer.objects.forEach(function(obj) {\n // TODO: make this better\n var item;\n switch(utils.getObjectProperty(obj, \"item\")) {\n case \"limestone-cube\":\n item = items.limestoneCube;\n break;\n case \"hammer\":\n item = items.hammer;\n break;\n }\n\n new Chest(item, obj.x*4, obj.y*4-115);\n });\n break;\n case \"BreakableRock\":\n currentObjectLayer.objects.forEach(function(obj) {\n switch(obj.name) {\n case \"BigRock\":\n var bigRock = new Breakable(utils.getObjectProperty(obj, \"health\"), {\n spriteSheet: \"assets/img/objects/big-rock.png\",\n tileCount: 10,\n tickRate: 0,\n tileWidth: 32,\n tileHeight: 64,\n renderWidth: 64,\n renderHeight: 128,\n renderPixelated: true\n }, obj.x*4+48, obj.y*4-100);\n \n var rockClusterDrop = new Pickup({\n item: items.rockCluster\n }, obj.x*4+48, obj.y*4-64);\n\n rockClusterDrop.object.setInteractable(false);\n rockClusterDrop.object.sprite.hide();\n\n bigRock.onBroken = function() {\n rockClusterDrop.object.setInteractable(true);\n rockClusterDrop.object.sprite.show();\n }\n break;\n case \"SmallRock\":\n var smallRock = new Breakable(utils.getObjectProperty(obj, \"health\"), {\n spriteSheet: \"assets/img/objects/small-rock.png\",\n tileCount: 5,\n tickRate: 0,\n tileWidth: 32,\n tileHeight: 32,\n renderWidth: 64,\n renderHeight: 64,\n renderPixelated: true\n }, obj.x*4, obj.y*4-64);\n\n var timeStone = new GameObject({ \n sprite: {\n spriteSheet: \"assets/img/stones/timestone.png\",\n tileCount: 1,\n tickRate: 0,\n tileWidth: 32,\n tileHeight: 32,\n renderWidth: 64,\n renderHeight: 64,\n renderPixelated: true\n },\n interactable: false,\n name: \"timestone\",\n renderLayer: 13, // 1 above the player\n animated: false,\n collidable: false,\n onStartOverlap: function() { \n unlockStone(\"time\"); \n timeStone.remove(); \n var stoneSounds = [sounds.stonePickup1, sounds.stonePickup2, sounds.stonePickup3, sounds.stonePickup4];\n var i = utils.clamp(Math.round(Math.random()*stoneSounds.length)-1, 0, stoneSounds.length);\n audioSystem.playSound(stoneSounds[i], false);\n }\n }, obj.x*4+28, obj.y*4-50);\n\n timeStone.pickedUp = false;\n stones.time = timeStone;\n\n smallRock.onBroken = function() {\n timeStone.setOverlappable(true);\n utils.displayDialogBox(\"I'm sorry little one\", 2000);\n //player.getInventory().addItem(items.rockCluster);\n }\n\n break;\n }\n });\n break;\n case \"Stones\":\n currentObjectLayer.objects.forEach(function(obj) {\n if (obj.name != \"Time\") {\n var newStone = new GameObject({ \n sprite: {\n spriteSheet: \"assets/img/stones/\" + obj.name.toLowerCase() + \"stone.png\",\n tileCount: 1,\n tickRate: 0,\n tileWidth: 32,\n tileHeight: 32,\n renderWidth: 64,\n renderHeight: 64,\n renderPixelated: true\n },\n interactable: false,\n name: obj.name.toLowerCase(),\n renderLayer: 13, // 1 above the player\n animated: false,\n collidable: false,\n overlappable: !utils.getObjectProperty(obj, \"conditional\"),\n onStartOverlap: function() { \n unlockStone(obj.name.toLowerCase()); \n newStone.remove();\n var stoneSounds = [sounds.stonePickup1, sounds.stonePickup2, sounds.stonePickup3, sounds.stonePickup4];\n var i = utils.clamp(Math.round(Math.random()*stoneSounds.length)-1, 0, stoneSounds.length);\n audioSystem.playSound(stoneSounds[i], false);\n }\n }, obj.x*4, obj.y*4);\n\n if (utils.getObjectProperty(obj, \"conditional\")) {\n newStone.sprite.hide();\n }\n\n newStone.pickedUp = false;\n\n stones[obj.name.toLowerCase()] = newStone;\n }\n });\n break;\n case \"Lasers_Bottom\":\n currentObjectLayer.objects.forEach(function(obj) {\n var laser = new Laser(obj.x*4, obj.y*4 - obj.height*4 + 20, obj.width*4, obj.height*4);\n laser.onLaserDeath = onLaserDeath.bind(this);\n lasers.push(laser);\n });\n break;\n case \"Lasers_Top\":\n currentObjectLayer.objects.forEach(function(obj) {\n var laser = new Laser(obj.x*4, obj.y*4 - obj.height*4 + 20, obj.width*4, obj.height*4);\n laser.onLaserDeath = onLaserDeath.bind(this);\n lasers.push(laser);\n });\n break;\n case \"Lights\":\n currentObjectLayer.objects.forEach(function(obj, i) {\n var light = new Light(i, obj.x*4, obj.y*4-64);\n light.onLightActivated = onLightActivated.bind(this);\n lights.push(light);\n });\n break;\n }\n });\n}", "function initMap() {\n const map = new google.maps.Map(document.querySelector('#map'), {\n zoom: 15,\n center: {\n // CIT Coimbatore\n lat: 11.0283,\n lng: 77.0273\n }\n });\n map.data.loadGeoJson('/data/subway-stations');\n var iconBase =\n 'http://maps.google.com/mapfiles/kml/shapes/';\n\n var icons = {\n potholes: {\n icon: iconBase + 'mechanic.png'\n },\n road_sign: {\n icon: iconBase + 'forbidden.png'\n },\n road_furniture: {\n icon: iconBase + 'campground.png'\n }\n };\n\n var features = [\n {\n position: new google.maps.LatLng(11.02368110531636, 77.00253009796143),\n type: 'potholes'\n },{\n position: new google.maps.LatLng(11.038057916898168, 77.03770758256542),\n type: 'potholes'\n },{\n position: new google.maps.LatLng(11.026906181104199, 77.02227924334716),\n type: 'road_furniture'\n }, {\n position: new google.maps.LatLng(11.0148203513, 77.0236160564),\n type: 'road_sign'\n }, {\n position: new google.maps.LatLng(11.030678331460905, 77.0167635037908),\n type: 'road_furniture'\n },\n {\n position: new google.maps.LatLng(11.025787271795734, 77.01538324356079),\n type: 'potholes'\n },\n {\n position: new google.maps.LatLng(11.025050115243769, 77.01119899749756),\n type: 'road_furniture'\n },\n {\n position: new google.maps.LatLng(11.021111561787002, 76.99392557144165),\n type: 'road_sign'\n },\n {\n position: new google.maps.LatLng(11.022301558097276, 76.99972987174988),\n type: 'road_furniture'\n },\n {\n position: new google.maps.LatLng(11.019847843620942, 76.99221968650818),\n type: 'road_furniture'\n },\n {\n position: new google.maps.LatLng(11.04401668721413, 77.04674883076848),\n type: 'road_sign'\n },{\n position: new google.maps.LatLng(11.045501433384475, 77.05025716015996),\n type: 'potholes'\n }\n\n ];\n\n // Create markers.\n for (var i = 0; i < features.length; i++) {\n var marker = new google.maps.Marker({\n position: features[i].position,\n icon: icons[features[i].type].icon,\n map: map\n });\n };\n }", "function genInfo() {\n d3.json(url).then(function(data) {\n \n // Create arrays for function\n var lats = [];\n var longs = [];\n var years = [];\n var ages = [];\n var names = [];\n var engs = [];\n var elects = [];\n var addresses = [];\n // Will uncomment once Corry fixes api\n // var sizes = [];\n \n // Add heroku data to arrays\n for (i = 0; i < data.data.length; i++) {\n lats.push(data.data[i].latitude);\n longs.push(data.data[i].longitude);\n years.push(data.data[i].data_year);\n ages.push(data.data[i].year_built);\n addresses.push(data.data[i].address);\n engs.push(data.data[i].site_eui_kbtu_sq_ft);\n names.push(data.data[i].property_name);\n elects.push(data.data[i].electricity_use_kbtu);\n // Will uncomment once Corry fixes api\n // sizes.push(data.data[i].whateverthesizeis);\n }\n // Create tilelayer\n var lightmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"© <a href='https://www.mapbox.com/about/maps/'>Mapbox</a> © <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> <strong><a href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a></strong>\",\n maxZoom: 18,\n id: \"mapbox/streets-v11\",\n accessToken: API_KEY\n });\n\n // Initialize all of the LayerGroups we'll be using\n var layers = {\n eng_less_100: new L.LayerGroup(),\n eng_less_200: new L.LayerGroup(),\n eng_less_300: new L.LayerGroup(),\n eng_less_400: new L.LayerGroup(),\n eng_great_400: new L.LayerGroup()\n };\n\n// Creating map object\n// Chose Merch Mart as the center coordinate\nvar map = L.map(\"map2\", {\n center: [41.8885, -87.6355],\n zoom: 11,\n layers: [\n layers.eng_less_300,\n layers.eng_less_400,\n layers.eng_great_400\n ]\n });\n\nlightmap.addTo(map);\n\n// Create an overlays object to add to the layer control\nvar overlays = {\n \"kBTU/sq ft < 100\": layers.eng_less_100,\n \"kBTU/sq ft < 200\": layers.eng_less_200,\n \"kBTU/sq ft < 300\": layers.eng_less_300,\n \"kBTU/sq ft < 400\": layers.eng_less_400,\n \"kBTU/sq ft >= 400\": layers.eng_great_400\n };\n\n// Create a control for our layers, add our overlay layers to it\nL.control.layers(null, overlays).addTo(map);\n\n// Create a legend to display information about our map\nvar info = L.control({\n position: \"bottomleft\"\n });\n \n // When the layer control is added, insert a div with the class of \"legend\"\n info.onAdd = function() {\n var div = L.DomUtil.create(\"div\", \"legend\");\n return div;\n };\n // Add the info legend to the map\n info.addTo(map);\n \n// Initialize an object containing icons for each layer group\nvar icons = {\n eng_less_100: L.ExtraMarkers.icon({\n icon: \"ion-settings\",\n iconColor: \"white\",\n markerColor: \"red\",\n shape: \"circle\"\n }),\n eng_less_200: L.ExtraMarkers.icon({\n icon: \"ion-settings\",\n iconColor: \"white\",\n markerColor: \"orange\",\n shape: \"circle\"\n }),\n eng_less_300: L.ExtraMarkers.icon({\n icon: \"ion-settings\",\n iconColor: \"white\",\n markerColor: \"green\",\n shape: \"circle\"\n }),\n eng_less_400: L.ExtraMarkers.icon({\n icon: \"ion-settings\",\n iconColor: \"white\",\n markerColor: \"blue\",\n shape: \"circle\"\n }),\n eng_great_400: L.ExtraMarkers.icon({\n icon: \"ion-settings\",\n iconColor: \"white\",\n markerColor: \"violet\",\n shape: \"circle\"\n })\n}\n//Keeping in case heroku ever goes down\n// d3.csv(\"Buildings.csv\").then((data) => {\n // Create an object to keep of the number of markers in each layer\n var buildingCount = {\n eng_less_100: 0,\n eng_less_200: 0,\n eng_less_300: 0,\n eng_less_400: 0,\n eng_great_400: 0\n };\n \n // Initialize a buildingAge, which will be used as a key to access the appropriate layers, icons, and building age for layer group\n var buildingEff;\n \n //Keeping in case heroku ever goes down\n // locations = [];\n // for (i = 0; i < data.length; i++) {\n // if (data[i].Data_Year >= 2017 && Number(data[i].Site_EUI_kBtu_sqft)<=500) {\n // var dataItem = data[i];\n // var lat = dataItem.Latitude;\n // var long = dataItem.Longitude;\n // var energy = parseInt(dataItem.Site_EUI_kBtu_sqft);\n // var sqFt = dataItem.SqFt;\n // var age = dataItem.Year_Built;\n // var color;\n\n\n // Plot data from heroku arrays\n for (j = 0; j < data.data.length; j++) {\n if (Number(years[j]) >= 2017 \n && engs[j] != null\n ) {\n // console.log(j);\n // var dataItem = data[i];\n var lat = lats[j];\n // console.log(lat);\n var long = longs[j];\n // console.log(long)\n var energy = engs[j];\n // var sqFt = sizes[j];\n var age = ages[j];\n // console.log(age);\n var color;\n if (energy > 0) {\n\n if (energy < 100) {\n buildingEff = \"eng_less_100\";\n color = \"#edf8fb\";\n }\n else if (energy < 200) {\n buildingEff = \"eng_less_200\";\n color = \"#ccece6\";\n }\n else if (energy < 300) {\n buildingEff = \"eng_less_300\";\n color = \"#99d8c9\";\n }\n else if (energy < 400) {\n buildingEff = \"eng_less_400\";\n color = \"#66c2a4\";\n }\n else {\n buildingEff = \"eng_great_400\";\n color = \"#005824\";\n }\n }\n buildingCount[buildingEff]++;\n //Keeping in case heroku ever goes down\n // var latLong = [lat, long];\n var newMarker = L.marker([lat, long]\n , {\n icon: icons[buildingEff]\n }\n )\n // Add the new marker to the appropriate layer\n newMarker.addTo(layers[buildingEff]);\n\n // Add popup\n newMarker.bindPopup(\"<h1>\" + names[j] \n + \"</h1> <hr> <h5>\" \n + \"Energy Consumption: \" \n + engs[j]\n + \" kBtu/sq ft </h5> <h5>\" \n // Will uncomment once Corry fixes heroku\n // + \"Square Footage: \"\n // + sqFt\n // + \" ft^2</h5>\"\n // + \"<h5>\"\n + \"Year Built: \"\n + age\n + \"</h5>\"\n );\n //Keeping in case heroku ever goes down\n // locations.push(latLong);\n }\n }\n // Call the updateLegend function, which will... update the legend!\n updateLegend(buildingCount);\n\n\n//Keeping in case heroku ever goes down\n// });\n\n// Update the legend's innerHTML with the last updated time and station count\nfunction updateLegend(buildingCount) {\n document.querySelector(\".legend\").innerHTML = [\n \" <div class='my-legend'>\" +\n \"<div class='legend-title'>Legend</div>\" +\n \"<div class='legend-scale'>\" +\n \"<ul class='legend-labels'>\" +\n \"<li><span style='background:#b50e0e;'></span> Buildings Where kBTU/sq ft < 100: \" + buildingCount.eng_less_100 + \"</li>\" +\n \"<li><span style='background:#e37a09;'></span>Buildings Where kBTU/sq ft Between 100 & 200: \" + buildingCount.eng_less_200 + \"</li>\" +\n \"<li><span style='background:#108f07;'></span>Buildings Where kBTU/sq ft Between 200 & 300: \" + buildingCount.eng_less_300 + \"</li>\" +\n \"<li><span style='background:#0964e3;'></span>Buildings Where kBTU/sq ft Between 300 & 400: \" + buildingCount.eng_less_400 + \"</li>\" +\n \"<li><span style='background:#610d91;'></span>Buildings Where kBTU/sq ft > 400: \" + buildingCount.eng_great_400 + \"</li>\" + \n \"</ul>\"+\n \"</div>\"+\n \"<div class='legend-source'>Source: <a href='https://data.cityofchicago.org/Environment-Sustainable-Development/Chicago-Energy-Benchmarking/xq83-jr8c' target='blank_'>Chicago Energy Benchmarking</a></div>\"+\n \"</div>\"\n ].join(\"\");\n }\n})}", "function mappy(dataset) {\n var newAreas = {};\n dataset.forEach((key) => {\n let area = {};\n area.value = key.Tasso;\n area.tooltip = {\n content:\n \"<span style='font-weight:bold;'>\" +\n key.Nazione +\n \" \" +\n \"</span>\" +\n \"<br/>\" +\n \"Software illegale: \" +\n area.value +\n \"%\" +\n \"<br>Valore: \" +\n key.Valore +\n \"$ milioni\",\n };\n area.eventHandlers = {\n click: function (e, id, mapElem, textElem) {\n $(\".first\").remove();\n $(\".f32\").remove();\n $(\".graph-container\").removeClass(\"hidden\");\n $(\"#description\").append(\n \"<p class='first f32' style='font-weight:bold; font-size: 1.2em; margin-left: 20px;'>\" +\n key.Nazione +\n \" \" +\n \"<span class='flag \" +\n key.Codice.toLowerCase() +\n \"'></span></p>\"\n );\n $(\"#description\").append(\n \"<p class='first' style='font-size:18px; margin-left: 20px;'>É possibile confrontare fino a quattro paesi, da notare \" +\n \"la tendenza inversamente proporzionale tra i valori dei due grafici</p>\"\n );\n creategraph(dataset, key.Codice);\n creategraphalt(dataset, key.Codice);\n $(\".container\").trigger(\"zoom\", {\n level: 8,\n latitude: key.latitude,\n longitude: key.longitude,\n });\n $(\".container\").addClass(\"active\");\n $(\".container\").trigger(\"tooltip.css\", {\n display: \"block\",\n });\n },\n };\n newAreas[key.Codice] = area;\n });\n $(\".container\").mapael({\n map: {\n name: \"world_countries\",\n //width: 500,\n zoom: {\n enabled: true,\n step: 0.25,\n maxLevel: 20,\n },\n defaultArea: {\n attrs: {\n fill: \"#666666\",\n stroke: \"#ced8d0\",\n \"stroke-width\": 0.3,\n cursor: \"pointer\",\n },\n attrsHover: {\n \"stroke-width\": 1.5,\n },\n },\n defaultPlot: {\n text: {\n attrs: {\n fill: \"#b4b4b4\",\n },\n attrsHover: {\n fill: \"#fff\",\n \"font-weight\": \"bold\",\n },\n },\n },\n },\n text: {\n attrs: {\n cursor: \"pointer\",\n \"font-size\": 10,\n fill: \"#666\",\n },\n },\n areas: newAreas,\n legend: {\n area: {\n display: true,\n //mode: \"horizontal\",\n title: \"Percentuale di software illegale scaricato\",\n marginBottom: 6,\n slices: [\n {\n max: 25,\n attrs: {\n fill: \"#6aafe1\",\n },\n legendSpecificAttrs: {\n stroke: \"#505050\",\n },\n label: \"Tasso < 25%\",\n },\n {\n min: 26,\n max: 50,\n attrs: {\n fill: \"#459bd9\",\n },\n label: \"Tasso compreso tra 25 e 50 %\",\n },\n {\n min: 51,\n max: 75,\n attrs: {\n fill: \"#2579b5\",\n },\n label: \"Tasso compreso tra 50 e 75 %\",\n },\n {\n min: 76,\n attrs: {\n fill: \"#1a527b\",\n },\n label: \"Tasso > 75%\",\n },\n ],\n },\n },\n });\n $(\".zoomReset\").click(function () {\n //flush all\n $(\".container\").removeClass(\"active\");\n $(\".graph-container\").addClass(\"hidden\");\n myfunCalls = 0;\n check = [];\n checkalt = [];\n $(\"#limit\").css(\"display\", \"none\");\n });\n }", "function drawMap(){\n // Map Calling & customization\n mapboxgl.accessToken = 'pk.eyJ1IjoibWlja2V5bWljazI1IiwiYSI6ImNqOThvcmY0ejBwdjYyd24ycmUwb2J5OG8ifQ.FtLU2J74aNJxTx7_WTRxlw';\n map = new mapboxgl.Map({\n container: 'map', // container id\n style: 'mapbox://styles/mickeymick25/cj9ffl8ym04tj2ro4zbvmj9n2', // stylesheet location\n center: [2.095, 48.745], // starting position [lng, lat]\n zoom: 8, // starting zoom\n //bearing: 21.60,\n //pitch: 40\n });\n\n // Add controls to the map\n var nav = new mapboxgl.NavigationControl();\n map.addControl(nav, 'bottom-right');\n\n //\n map.on('load', function(){\n map.addSource('points', {\n type: 'geojson',\n data: jsonFlightData.data\n });\n\n // Define a style for all the flights.\n map.addLayer({\n \"id\":\"flights\",\n \"type\":\"symbol\",\n \"source\": \"points\",\n \"layout\":{\n \"icon-image\": \"airport-15\",\n \"icon-rotate\": { \"type\": \"identity\", \"property\": \"heading\" },\n \"icon-allow-overlap\": false,\n \"icon-ignore-placement\": false,\n \"icon-pitch-alignment\" : \"map\"\n },\n \"paint\":{\n // \"icon-color\": \"#FF0000\"\n }\n });\n });\n\n /* Define interaction with flights */\n map.on('click', 'flights', function(e){\n map.flyTo({center: e.features[0].geometry.coordinates});\n console.log(\"flight event: Flight clicked!\");\n console.log(\"flight event: Flight \"+e.features[0].properties.callsign);\n });\n\n map.on('mouseenter', 'flights', function(){\n console.log(\"flight event: Mouse entered!\");\n });\n\n map.on('mouseleave', 'flights', function(){\n console.log(\"flight event: Mouse leaved!\");\n });\n\n window.setInterval(function() {\n console.log(\"------------------------------------ Log\");\n getFlights();\n map.getSource('points').setData(jsonFlightData.data);\n }, 10500);\n\n // window.setInterval(function(){\n //\n // }, 1000);\n\n}", "function loadNewYorkMap() {\n\n //Define projection_clusterMap for the bounding box\n projection_clusterMap = d3.geoMercator()\n .center(clusterMapCenter)\n .scale(75000)\n .translate([width_2 / 2, height_2 / 2])\n\n //Define path generator\n var path = d3.geoPath()\n .projection(projection_clusterMap);\n\n // Define the div for the tooltip\n var div = d3.select(\"#clustering\")\n .append(\"div\") \n .classed(\"tooltip\",true)\n .style(\"opacity\", 0);\n\n //Create SVG element\n svg_2 = d3.select(\"#clustering\")\n .append(\"svg\")\n .attr(\"height\", height_2)\n .attr(\"width\", width_2);\n\n //Load the json coordinates and print the map\n d3.json(geojsonMapFilename, function(json) {\n svg_2.selectAll(\"path\")\n .data(json.features)\n .enter()\n .append(\"path\")\n .attr(\"d\", path)\n .attr(\"stroke\", \"white\")\n .attr(\"stroke-width\", 2)\n .attr(\"stroke-opacity\", 0.3)\n .style(\"fill\", \"black\")\n .style(\"opacity\", \"0.4\");\n\n loadDefaultPoints();\n});\n}", "appendMapData(newData, coordinates, scene) {\n const parkingSpaceCalcInfo = [];\n for (const kind in newData) {\n if (!newData[kind]) {\n continue;\n }\n\n if (!this.data[kind]) {\n this.data[kind] = [];\n }\n\n for (let i = 0; i < newData[kind].length; ++i) {\n switch (kind) {\n case 'lane':\n const lane = newData[kind][i];\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addLane(lane, coordinates, scene),\n text: this.addLaneId(lane, coordinates, scene),\n }));\n break;\n case 'clearArea':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addZone(\n newData[kind][i], colorMapping.YELLOW, coordinates, scene,\n ),\n }));\n break;\n case 'crosswalk':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addZone(\n newData[kind][i], colorMapping.PURE_WHITE, coordinates, scene,\n ),\n }));\n break;\n case 'junction':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addBorder(\n newData[kind][i], colorMapping.BLUE, coordinates, scene,\n ),\n }));\n break;\n case 'pncJunction':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addZone(\n newData[kind][i], colorMapping.BLUE, coordinates, scene,\n ),\n }));\n break;\n case 'signal':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addStopLine(\n newData[kind][i].stopLine, coordinates, scene,\n ),\n }));\n this.trafficSignals.add([newData[kind][i]], coordinates, scene);\n break;\n case 'stopSign':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addStopLine(\n newData[kind][i].stopLine, coordinates, scene,\n ),\n }));\n this.stopSigns.add([newData[kind][i]], coordinates, scene);\n break;\n case 'yield':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addStopLine(\n newData[kind][i].stopLine, coordinates, scene,\n ),\n }));\n this.yieldSigns.add([newData[kind][i]], coordinates, scene);\n break;\n case 'road':\n const road = newData[kind][i];\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addRoad(road, coordinates, scene),\n }));\n break;\n case 'parkingSpace':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addBorder(\n newData[kind][i], colorMapping.YELLOW, coordinates, scene,\n ),\n text: this.addParkingSpaceId(newData[kind][i], coordinates, scene),\n }));\n parkingSpaceCalcInfo.push(this.calcParkingSpaceExtraInfo(newData[kind][i],\n coordinates));\n break;\n case 'speedBump':\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: this.addCurve(\n newData[kind][i].position, colorMapping.RED, coordinates, scene,\n ),\n }));\n break;\n default:\n this.data[kind].push(newData[kind][i]);\n break;\n }\n }\n }\n return [parkingSpaceCalcInfo];\n }", "function updateMap()\n{\n var startTime = new Date();\n // remove any existing Polyline connections shown\n for (var i = 0; i < connections.length; i++) {\n\tconnections[i].remove();\n }\n connections = new Array();\n\n // set up to find bounding box of points we plot\n var minlat = 999;\n var maxlat = -999;\n var minlon = 999;\n var maxlon = -999;\n\n // remove any markers previously on the map\n for (var i = 0; i < markers.length; i++) {\n\tmarkers[i].remove();\n }\n markers = new Array();\n\n // set variables that determine if all/only visible/no markers\n // should be drawn on the map\n var showHidden = false;\n if (document.getElementById('showHidden') != null) {\n showHidden = document.getElementById('showHidden').checked;\n }\n var showMarkers = true;\n if (document.getElementById('showMarkers') != null) {\n showMarkers = document.getElementById('showMarkers').checked;\n }\n\n // draw our waypoint markers\n markerinfo = new Array();\n polypoints = new Array();\n\n for (var i = 0; i < waypoints.length; i++) {\n\tminlat = Math.min(minlat, waypoints[i].lat);\n\tmaxlat = Math.max(maxlat, waypoints[i].lat);\n\tminlon = Math.min(minlon, waypoints[i].lon);\n\tmaxlon = Math.max(maxlon, waypoints[i].lon);\n\t\n\tpolypoints[i] = [waypoints[i].lat, waypoints[i].lon];\n\t\n\tmarkerinfo[i] = markerInfo(i, waypoints[i]);\n\tlet icon = intersectionimage;\n\tif (waypointColors.length > i) {\n\t let options = {\n\t\ticonShape: 'circle-dot',\n\t\ticonSize: [4, 4],\n\t\ticonAnchor: [4, 4],\n\t\tborderWidth: 4,\n\t\tborderColor: waypointColors[i]\n\t };\n\t \n\t icon = L.BeautifyIcon.icon(options);\n\t}\n\tmarkers[i] = L.marker(polypoints[i], {\n\t title: waypoints[i].label,\n\t icon: icon\n\t});\n\tif (showMarkers && (showHidden || waypoints[i].visible)) {\n\t addMarker(markers[i], markerinfo[i], i);\n\t}\n }\n\n // set our map view according to the bounds we found\n map.fitBounds([[minlat, minlon],[maxlat, maxlon]]);\n\n // if this is a graph in HDX, we draw edges as connections,\n // otherwise we may be connecting waypoints in order to plot a\n // path\n if (graphEdges.length > 0) {\n\tfor (var i = 0; i < graphEdges.length; i++) {\n\t var numPoints;\n\t if (graphEdges[i].via == null) {\n\t\tnumPoints = 2;\n\t }\n\t else {\n\t\tnumPoints = graphEdges[i].via.length/2 + 2;\n\t }\n\t var edgePoints = new Array(numPoints);\n\t var v1 = graphEdges[i].v1;\n\t var v2 = graphEdges[i].v2;\n\t //\t DBG.write(\"Adding edge \" + i + \" from \" + v1 + \"(\" + waypoints[v1].lat + \",\" + waypoints[v1].lon + \") to \" + v2 + \"(\" + waypoints[v2].lat + \",\" + waypoints[v2].lon + \")\");\n\t edgePoints[0] = [waypoints[v1].lat, waypoints[v1].lon];\n\t nextPoint = 1;\n\t if (graphEdges[i].via != null) {\n\t\tfor (var j = 0; j < graphEdges[i].via.length; j+=2) {\n\t\t edgePoints[nextPoint] = [graphEdges[i].via[j], graphEdges[i].via[j+1]];\n\t\t nextPoint++;\n\t\t}\n\t }\n\t edgePoints[nextPoint] = [waypoints[v2].lat, waypoints[v2].lon];\n\t // check for custom colors for NMP \"graphs\"\n\t if (waypointColors.length > v2) {\n\t\tcolor = waypointColors[v2];\n\t }\n\t else {\n\t\tcolor = getGraphEdgeColor(graphEdges[i]);\n\t }\n connections[i] = L.polyline(edgePoints, {\n color: color,\n weight: 10,\n opacity: 0.4\n }).addTo(map);\n\t edgeListener(i);\n\t}\n }\n else if (usingAdjacencyLists) {\n\tvar edgeNum = 0;\n\tfor (var i = 0; i < waypoints.length; i++) {\n\t for (var j = 0; j < waypoints[i].edgeList.length; j++) {\n\t\tvar thisEdge = waypoints[i].edgeList[j];\n\t\t// avoid double plot by only plotting those with v1 as i\n\t\tif (thisEdge.v1 == i) {\n\t\t var numPoints;\n\t\t if (thisEdge.via == null) {\n\t\t\tnumPoints = 2;\n\t\t }\n\t\t else {\n\t\t\tnumPoints = thisEdge.via.length/2 + 2;\n\t\t }\n\t\t var edgePoints = new Array(numPoints);\n\t\t edgePoints[0] = [waypoints[thisEdge.v1].lat, waypoints[thisEdge.v1].lon];\n\t\t nextPoint = 1;\n\t\t if (thisEdge.via != null) {\n\t\t\tfor (var p = 0; p < thisEdge.via.length; p+=2) {\n\t\t\t edgePoints[nextPoint] = [thisEdge.via[p], thisEdge.via[p+1]];\n\t\t\t nextPoint++;\n\t\t\t}\n\t\t }\n\t\t edgePoints[nextPoint] = [waypoints[thisEdge.v2].lat, waypoints[thisEdge.v2].lon];\n\t\t \n\t\t color = getGraphEdgeColor(thisEdge);\n connections[edgeNum] = L.polyline(edgePoints, {\n color: color,\n weight: 10,\n opacity: 0.4\n }).addTo(map);\n\t\t edgeListener(edgeNum);\n\t\t edgeNum++;\n\t\t}\n\t }\n\t}\n map.on('zoomend', zoomChange);\n zoomChange();\n }\n // connecting waypoints in order to plot a path\n else if (mapClinched) {\n\t// clinched vs unclinched segments mapped with different colors\n\tvar nextClinchedCheck = 0;\n\tvar totalMiles = 0.0;\n\tvar clinchedMiles = 0.0;\n\tvar level = map.getZoom();\n\tvar weight = 2;\n\tif (newRouteIndices.length > 0) {\n\t // if newRouteIndices is not empty, we're plotting multiple routes\n\t var nextSegment = 0;\n\t // segmentLengths will have properties added to it where\n\t // keys are the lengths of segments and the value for each\n\t // is a list of segment numbers which are of that length, used\n\t // to make sure only one Polyline is plotted for any segment\n\t // that contains concurrencies\n\t let segmentLengths = new Object();\n\t for (var route = 0; route < newRouteIndices.length; route++) {\n\t\tvar start = newRouteIndices[route];\n\t\tvar end;\n\t\tif (route == newRouteIndices.length-1) {\n\t\t end = waypoints.length-1;\n\t\t}\n\t\telse {\n\t\t end = newRouteIndices[route+1]-1;\n\t\t}\n\t\t// support for clinch colors from systems.csv\n\t\tvar unclinchedColor = \"rgb(200,200,200)\"; //\"#cccccc\";\n\t\tvar clinchedColor = \"rgb(255,128,128)\"; //\"#ff8080\";\n\t\tfor (var c = 0; c<colorCodes.length; c++) {\n\t\t if (colorCodes[c].name == routeColor[route]) {\n\t\t\tunclinchedColor = colorCodes[c].unclinched;\n\t\t\tclinchedColor = colorCodes[c].clinched;\n\t\t }\n\t\t}\n\t\t// override with tier or system colors given in query string if they match\n\t\tfor (var c = 0; c<customColorCodes.length; c++) {\n\t\t if (customColorCodes[c].name == (\"tier\"+routeTier[route])) {\n\t\t\tunclinchedColor = customColorCodes[c].unclinched;\n\t\t\tclinchedColor = customColorCodes[c].clinched;\n\t\t }\n\t\t if (customColorCodes[c].name == routeSystem[route]) {\n\t\t\tunclinchedColor = customColorCodes[c].unclinched;\n\t\t\tclinchedColor = customColorCodes[c].clinched;\n\t\t }\n\t\t}\n\t\tfor (var i=start; i<end; i++) {\n\t\t var edgePoints = new Array(2);\n\t\t edgePoints[0] = [waypoints[i].lat, waypoints[i].lon];\n\t\t edgePoints[1] = [waypoints[i+1].lat, waypoints[i+1].lon];\n\t\t var segmentLength = distanceInMiles(waypoints[i].lat,\n\t\t\t\t\t\t\twaypoints[i].lon,\n\t\t\t\t\t\t\twaypoints[i+1].lat,\n\t\t\t\t\t\t\twaypoints[i+1].lon);\n\t\t totalMiles += segmentLength;\n\t\t var color = unclinchedColor;\n\t\t var opacity = 0.3;\n\t\t if (segments[nextSegment] == clinched[nextClinchedCheck]) {\n\t\t\tcolor = clinchedColor;\n\t\t\tnextClinchedCheck++;\n\t\t\tclinchedMiles += segmentLength;\n\t\t\topacity = 0.85;\n\t\t }\n connections[nextSegment] = L.polyline(edgePoints, {\n color: color,\n weight: weight,\n opacity: opacity\n }).addTo(map);\n\t\t edgeListener(nextSegment);\n\n\t\t // Look for any previous polyline at the exact\n\t\t // same location and make it transparent if found.\n\t\t // We only need to find most recently added as its\n\t\t // addition would have taken care of any even\n\t\t // earlier match. This is done efficiently by\n\t\t // searching only among segments of the same length\n\t\t // which are stored in the values of properties\n\t\t // of the segmentLengths object with the key\n\t\t // as the length of the segment\n\n\t\t if (segmentLengths.hasOwnProperty(segmentLength)) {\n\t\t\tlet sameLengths = segmentLengths[segmentLength];\n\t\t\tfor (var sL = sameLengths.length-1; sL >= 0; sL--) {\n\t\t\t let latLngs = connections[sameLengths[sL]].getLatLngs();\n\t\t\t // check for match in either direction\n\t\t\t if ((waypoints[i].lat == latLngs[0].lat &&\n\t\t\t\t waypoints[i].lon == latLngs[0].lng &&\n\t\t\t\t waypoints[i+1].lat == latLngs[1].lat &&\n\t\t\t\t waypoints[i+1].lon == latLngs[1].lng)\n\t\t\t\t||\n\t\t\t\t(waypoints[i+1].lat == latLngs[0].lat &&\n\t\t\t\t waypoints[i+1].lon == latLngs[0].lng &&\n\t\t\t\t waypoints[i].lat == latLngs[1].lat &&\n\t\t\t\t waypoints[i].lon == latLngs[1].lng)) {\n\t\t\t\tconnections[sameLengths[sL]].setStyle({opacity: 0});\n\t\t\t\tbreak;\n\t\t\t }\n\t\t\t}\n\t\t\t// add this segment to the existing list of segments\n\t\t\t// of this exact length\n\t\t\tsameLengths.push(nextSegment);\n\t\t }\n\t\t else {\n\t\t\t// this is the first time we've seen a segment of\n\t\t\t// this length, so this creates a new property\n\t\t\t// and initializes its value to a one-element\n\t\t\t// array with this segment number\n\t\t\tsegmentLengths[segmentLength] = [ nextSegment ];\n\t\t }\n nextSegment++;\n\t\t}\n\t }\n\t // set up listener for changes to zoom level and adjust\n\t // weight in response\n\t map.on('zoomend', zoomChange);\n\t zoomChange();\n\t}\n\telse {\n\t // single route\n\t for (var i=0; i<segments.length; i++) {\n\t\tvar edgePoints = new Array(2);\n\t\tedgePoints[0] = [waypoints[i].lat, waypoints[i].lon];\n\t\tedgePoints[1] = [waypoints[i+1].lat, waypoints[i+1].lon];\n\t\tvar segmentLength = distanceInMiles(waypoints[i].lat,\n\t\t\t\t\t\t waypoints[i].lon,\n\t\t\t\t\t\t waypoints[i+1].lat,\n\t\t\t\t\t\t waypoints[i+1].lon);\n\t\ttotalMiles += segmentLength;\n\t\tvar color = \"#cccccc\";\n\t\tif (segments[i] == clinched[nextClinchedCheck]) {\n\t\t color = \"#ff8080\";\n\t\t nextClinchedCheck++;\n\t\t clinchedMiles += segmentLength;\n\t\t}\n connections[i] = L.polyline(edgePoints, {\n color: color,\n weight: 10,\n opacity: 0.75\n }).addTo(map);\n\t\tedgeListener(i);\n\t }\n\t}\n if (document.getElementById('controlboxinfo') != null) {\n \t document.getElementById('controlboxinfo').innerHTML = \"\"; //clinchedMiles.toFixed(2) + \" of \" + totalMiles.toFixed(2) + \" miles (\" + (clinchedMiles/totalMiles*100).toFixed(1) + \"%) clinched by \" + traveler + \".\";\n }\n }\n else if (genEdges) {\n connections[0] = L.polyline(polypoints, {\n color: \"#0000FF\",\n weight: 10,\n opacity: 0.75\n }).addTo(map);\n\tconnections[0].on('click', function(){edgeClick(0);});\n }\n // don't think this should not be needed, but an attempt to get\n // hidden waypoints to be hidden when first created\n showHiddenClicked();\n\n}", "function drawIcons() {\n map.data.addGeoJson(geoJSON);\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 createArmiesOverlays(){\n let armiesOverlay = [];\n\n map.data.forEach(function(feature){\n if(feature.getGeometry().getType()=='Polygon'){\n let coord = [];\n feature.getGeometry().forEachLatLng(function(LatLng){\n coord.push(LatLng);\n });\n const poly = new google.maps.Polygon({paths: coord});\n const center = poly.getApproximateCenter();\n\n armiesOverlay[feature.getProperty('name')] = new ArmiesOverlay(center, map);\n }\n });\n\n return armiesOverlay;\n}", "function mapDisplay(){\n\n // center of the map\n var center = [38.205,-122.2869];\n // Create the map\n var map = L.map('mapid',{ drawControl: true }).setView(center, 10);\n //add base layer\n mapLink =\n '<a href=\"http://www.esri.com/\">Esri</a>';\n wholink =\n 'i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community';\n /*\nvar layer=L.tileLayer(\n 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {\n attribution: '&copy; '+mapLink+', '+wholink,\n// Set up the OSM layer\n\n maxZoom: 18\n}).addTo(map);\n */\n L.tileLayer('https://maps.tilehosting.com/styles/hybrid/{z}/{x}/{y}.jpg?key=trAzZh4tFv6kVYo4It60',{\n attribution: '<a href=\"https://www.maptiler.com/license/maps/\" target=\"_blank\">© MapTiler</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">© OpenStreetMap contributors</a>',\n crossOrigin: true\n }).addTo(map);\n //make second layer\n /*\n var layer2=L.tileLayer(\n 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: 'Data © <a href=\"http://osm.org/copyright\">OpenStreetMap</a>',\n maxZoom: 18\n })\n */\n // add a marker in the given location\n L.marker(center).addTo(map);\n\n // Initialise the FeatureGroup to store editable layers\n var editableLayers = new L.FeatureGroup();\n map.addLayer(editableLayers);\n\n var drawPluginOptions = {\n position: 'topright',\n draw: {\n polygon: {\n allowIntersection: false, // Restricts shapes to simple polygons\n drawError: {\n color: '#e1e100', // Color the shape will turn when intersects\n message: '<strong>DURI Map Service Error<strong> you can\\'t draw that!' // Message that will show when intersect\n },\n shapeOptions: {\n color: '#97009c'\n }\n },\n // disable toolbar item by setting it to false\n polyline: false,\n circle: false, // Turns off this drawing tool\n rectangle: false,\n marker: false,\n },\n edit: {\n featureGroup: editableLayers, //REQUIRED!!\n remove: false\n }\n };\n\n // Initialise the draw control and pass it the FeatureGroup of editable layers\n var drawControl = new L.Control.Draw(drawPluginOptions);\n map.addControl(drawControl);\n\n var editableLayers = new L.FeatureGroup();\n map.addLayer(editableLayers);\n\n map.on('draw:created', function(e) {\n var type = e.layerType,\n layer = e.layer;\n\n if (type === 'marker') {\n layer.bindPopup('A popup!');\n }\n\n editableLayers.addLayer(layer);\n arr = layer.toGeoJSON()[\"geometry\"][\"coordinates\"][0];\n finalCoord = [];\n polygon = \"POLYGON((\";\n for(x in arr)\n if(x%2==0)\n finalCoord.push(arr[x])\n finalCoord.pop();\n for(x in finalCoord)\n if(x!=finalCoord.length-1)\n polygon+=finalCoord[x][0]+\" \"+finalCoord[x][1]+\",\";\n else\n polygon+=finalCoord[x][0]+\" \"+finalCoord[x][1];\n polygon+=\"))\"\n document.getElementById(\"polygon\").value = polygon;\n console.log(polygon);\n console.log(layer);\n });\n\n var geocodeService = L.esri.Geocoding.geocodeService();\n\n map.on('click', function(e) {\n geocodeService.reverse().latlng(e.latlng).run(function(error, result) {\n var patt1 = /[1-9][0-9]{4}/g;\n document.getElementById(\"zipcode\").value = result.address.Match_addr.match(patt1);\n\n });\n });\n map.on('measurefinish', function(evt){\n writeResults(evt);\n console.log(\"function is being called\");\n });\n\n function writeResults(results){\n \n }\n}", "initiliaze (item) {\n //First we empty the container to make sure its properly displayed\n this.container.innerHTML = ''\n //This bit is used to make sure the map is emptied if it been already used before\n if(this.map != null){\n this.map.remove();\n }\n //This block is just for display generation\n const title = document.createElement('h1');\n title.textContent = `Origin place of the ${item.name}`;\n this.container.appendChild(title);\n //This is similar to the previous block generates our dynamic details\n const description = document.createElement('p');\n description.textContent = `${item.description}`;\n this.container.appendChild(description);\n //This line is just to create some space between the details and the map\n const breakLine = document.createElement('br')\n this.container.appendChild(breakLine);\n //This is a new container for the map to be initiliazed in\n const displayContainer = document.createElement('div');\n displayContainer.id = 'item-map-container'\n this.container.appendChild(displayContainer);\n //The url is refears to our API where we pull the map and location from\n const openStreetMapUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';\n //We new up a class with the url and the assign it a layer type as class\n const openStreetMapTileLayer = new L.TileLayer(openStreetMapUrl);\n //We load the invidual cordinates and zooming levels here\n this.map = L.map(displayContainer)\n .addLayer(openStreetMapTileLayer)\n .setView(item.coordinates, 3)\n //The marker is placed by this function\n this.addMarker(item.coordinates);\n }", "async function getData() {\n const response = await fetch('/api') // podria ser otra ruta , pero como este es un metodo GET, la mantengo\n const data = await response.json();\n console.log(data);\n\n for (item of data) {\n const marker =L.marker([item.lat, item.lon]).addTo(mymap);\n const txt = `\tel clima aqui ${item.lat} &deg, ${item.lon}&deg \n\t\t\t y la temperatura es de ${item.temperature} & deg C, y tipo de cambio ${item.tipoDeCambio}`\n marker.bindPopup(txt); // vincula el texto a cada marker\n\n // const root = document.createElement('div');\n // const geo = document.createElement('div');\n // const date = document.createElement('div');\n // const img = document.createElement('img');\n\n // geo.textContent = `geo: ${item.lat}, ${item.lon}`; // OJO es la otra comilla\n // const dateString = new Date(item.timestamp).toLocaleString();\n // date.textContent = dateString;\n // //img.src = item.image64;\n // // img.alt= \"varias fotos de ejemplo\";\n // root.append(geo, date, img); // agrega los divs \n // document.body.append(root); // los pone en el body\n }\n}", "function setup(map) {\n //$(\".feature-btn\").tooltip({ placement: 'right', title: 'Charts'});\n //map.addControl(new ChartControl());\n refresh();\n var layers = JSON.parse(localStorage.getItem(\"sk-load-charts\"));\n if (!layers) return;\n layers = jQuery.grep(layers, function(value) {\n addChartLayer(map, value.key, value.type, value.scale);\n });\n}", "function createFeatures() {\r\n var url = \"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson\";\r\n d3.json(url, function (data) {\r\n console.log(data);\r\n\r\n var geojson = L.geoJSON(data.features, {\r\n pointToLayer: function (feature, latlng) {\r\n return L.circleMarker(latlng, {\r\n radius: (feature.properties.mag) * 3,\r\n fillColor: Color(feature.geometry.coordinates[2]),\r\n color: \"black\",\r\n weight: 1,\r\n opacity: 1,\r\n fillOpacity: 0.8\r\n });\r\n },\r\n\r\n onEachFeature: function (feature, layer) {\r\n layer.bindPopup(\"<strong> Magnitude: \" + feature.properties.mag +\r\n \"<hr></hr>Depth: \" + feature.geometry.coordinates[2] + \"</strong>\");\r\n }\r\n });\r\n createMap(geojson);\r\n });\r\n}", "function cargarTrazoLineas(){\r\n /**\r\n * Capa para hacer el trazado de las lineas de una nueva ruta de bus\r\n */\r\n var pointLayer = new OpenLayers.Layer.Vector(\"Point Layer\");\r\n var lineLayer = new OpenLayers.Layer.Vector(\"Line Layer\");\r\n var polygonLayer = new OpenLayers.Layer.Vector(\"Polygon Layer\");\r\n\r\n map.addLayers([wmsLayer, pointLayer, lineLayer, polygonLayer]);\r\n map.addControl(new OpenLayers.Control.LayerSwitcher());\r\n map.addControl(new OpenLayers.Control.MousePosition());\r\n\r\n drawControls = {\r\n point: new OpenLayers.Control.DrawFeature(pointLayer,\r\n OpenLayers.Handler.Point),\r\n line: new OpenLayers.Control.DrawFeature(lineLayer,\r\n OpenLayers.Handler.Path),\r\n polygon: new OpenLayers.Control.DrawFeature(polygonLayer,\r\n OpenLayers.Handler.Polygon)\r\n };\r\n\r\n for(var key in drawControls) {\r\n map.addControl(drawControls[key]);\r\n }\r\n}", "function createMap(earthquakePins){\n// Add a tile layer (the background map image) to our map\n// We use the addTo method to add objects to our map\nL.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.streets\",\n accessToken: API_KEY\n}).addTo(map);\n\nvar outdoormap = L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/streets-v10/tiles/256/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: \"Map data &copy; <a href=\\\"http://openstreetmap.org\\\">OpenStreetMap</a> contributors, <a href=\\\"http://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"http://mapbox.com\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.outdoor\",\n accessToken: API_KEY\n });\n\nvar satellitemap = L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: \"Map data &copy; <a href=\\\"http://openstreetmap.org\\\">OpenStreetMap</a> contributors, <a href=\\\"http://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"http://mapbox.com\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.satellite\",\n accessToken: API_KEY\n });\n\nvar baseLayer = {\n\t\"satellite\": satellitemap,\n\t\"Light\": lightmap,\n\t\"Outdoor\": outdoormap\n\n}}", "function renderPointsOfInterest() {\n markers.clearLayers();\n var pointsGeoJsonAPI = '/api/geojson/points';\n updateMap(pointsGeoJsonAPI);\n removeSpinner();\n}", "function buildLayer(data,key){\r\n var states=[];\r\n var values=[];\r\n \r\n data.forEach((d)=>{\r\n states.push(d.state);\r\n values.push(+d[key]);\r\n })\r\n tempStatesData=statesData;\r\n for (d in tempStatesData.features){\r\n tempStatesData.features[d].properties[key]=values[d];\r\n console.log(tempStatesData.features[d].properties);\r\n }\r\n if(key==\"n_killed_per_mil\"){\r\n var choro_layer=L.geoJson(tempStatesData,\r\n {\r\n style:style_killed,\r\n onEachFeature: function(feature, layer) {\r\n layer.bindPopup(\r\n \"Name: \"\r\n + feature.properties.name\r\n + \"<br>Killed: \"\r\n + feature.properties[key]\r\n );\r\n }\r\n });\r\n }\r\n if(key==\"n_injured_per_mil\"){\r\n var choro_layer=L.geoJson(tempStatesData,\r\n {\r\n style:style_injuired,\r\n onEachFeature: function(feature, layer) {\r\n layer.bindPopup(\r\n \"Name: \"\r\n + feature.properties.name\r\n + \"<br>Injured: \"\r\n + feature.properties[key]\r\n );\r\n }\r\n });\r\n }\r\n return choro_layer;\r\n\r\n}", "function geojsonGen(dataset, style) {\r\n return L.geoJson(dataset, {\r\n style: style\r\n }).addTo(map);\r\n}", "function refresh_map() {\n var ly_id = 1\n var ly_parts = [\n \"1235\", \"2475\", \"2455\", \"1110\", \"1240\", \"2460\", \"2470\", \"1120\",\n \"1101\", \"2465\", \"1125\", \"1350\", \"1230\", \"1105\", \"1115\", \"1345\"\n ]\n var ly_values = [141, 140, 155, 147, 132, 146, 151, 137, 146,\n 136, 145, 141, 149, 151, 138, 164]\n var ly_type = 1 // Palestine\n var ly_label = ''\n var ly_color = 'rgb(255,0,0)'\n map.add_layer(1,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n\n var ly_id = 1345\n var ly_parts = [\n 13452415\n ]\n var ly_values = [1041]\n var ly_type = 2 // localities\n var ly_label = 'Econmics'\n var ly_color = 'rgb(0,0,255)'\n map.add_layer(2,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n}", "function createOverlay(tectonicplatesData) {\n\n // Create a GeoJSON layer containing the features array on the tectonicplatesData object\n var tectonic = L.geoJSON(tectonicplatesData, {\n\n // Update default style for polygon\n style: {\n color: \"rgb(253,126,20)\",\n opacity: 1,\n fill: false\n }\n\n })\n\n // Add new layer to map\n myMap.addLayer(tectonic);\n\n // Add tectonic plates overlay to layer control\n controlLayers.addOverlay(tectonic, \"Fault Lines\")\n\n}", "function initHeat(data) {\n \n var marker = L.marker([38.845224, -104.8198]).addTo(map);\n\n map.dragging.disable();\n map.removeControl(map.zoomControl);\n map.scrollWheelZoom.disable();\n \n} //end init() function", "function createFeatures(flightData) { \n\n // Create a GeoJSON layer containing the features array on the flightData object\n // Run the onEachFeature function once for each piece of data in the array\n var flights = L.geoJson(flightData, {\n onEachFeature: function (feature, layer){\n layer.bindPopup(\"<h3>\" + feature.properties.callsign +\n \"</h3><hr><p>\" + \"ICAO24: \"+ feature.properties.icao24 + \"</p>\");\n },\n pointToLayer: function (feature, latlng) {\n return new L.circle(latlng,\n {radius: 5000,\n fillColor: '#f03',\n fillOpacity: 0.5,\n stroke: true,\n color: \"red\",\n weight: 1\n })\n }\n });\n \n // Sending our flight layer to the createMap function\n createMap(flights)\n }" ]
[ "0.64040565", "0.6390578", "0.6311872", "0.6278037", "0.6254612", "0.6191077", "0.6155553", "0.61390954", "0.6113944", "0.6065498", "0.6058482", "0.6048828", "0.6002596", "0.59925497", "0.59917957", "0.598388", "0.59825766", "0.5957769", "0.5957241", "0.5940285", "0.59372556", "0.59209305", "0.5890757", "0.58872944", "0.5886254", "0.5885109", "0.58832294", "0.587281", "0.58684665", "0.586517", "0.5849849", "0.58451355", "0.58435553", "0.5842449", "0.5838141", "0.5834318", "0.5822495", "0.57968163", "0.57851326", "0.5782994", "0.5764883", "0.57624346", "0.57503027", "0.57484734", "0.5729795", "0.57208025", "0.571183", "0.57052344", "0.57041", "0.57033646", "0.569726", "0.5692428", "0.56902725", "0.56870854", "0.5683697", "0.56541073", "0.56436694", "0.5641619", "0.563623", "0.56297666", "0.5625207", "0.56147414", "0.56101966", "0.56090826", "0.5608464", "0.5585818", "0.558174", "0.55781066", "0.5576608", "0.55677474", "0.55654985", "0.556257", "0.55582035", "0.555758", "0.5553306", "0.5550924", "0.55477405", "0.554612", "0.55440885", "0.5540595", "0.55358523", "0.5535409", "0.55305195", "0.55291134", "0.55282676", "0.5527087", "0.55269396", "0.5524452", "0.55192083", "0.55155593", "0.5510798", "0.5507914", "0.5502124", "0.54953456", "0.549157", "0.54853684", "0.54834133", "0.54822993", "0.5480307", "0.5478843" ]
0.64078116
0
region Traverse =============================================================== BEGIN ===============================================================
function Traverse(obj) { if (!(this instanceof Traverse)) { return new Traverse(obj); } this.value = obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function walker() {\n\n}", "function traverse(root) {}", "traverse(fn) { \n var curr = this.head; \n //var str = \"\"; \n while (curr) { \n //str += curr.element + \" \"; \n \n fn (curr.element, curr.next.element);\n\n curr = curr.next; \n } \n }", "function inOrderTraversal(node) {}", "inorderTraversal() {\n\n }", "function traverse(val){_traverse(val,seenObjects);seenObjects.clear();}", "function traverse(val){_traverse(val,seenObjects);seenObjects.clear();}", "traverse() {\n this.root.visit(this.root);\n }", "traverse(fn) {\n fn(this)\n\n const children = this._children\n for (let i = 0, l = children.length; i < l; i++) {\n children[i].traverse(fn)\n }\n }", "preOrder() { //DLR\n let results = [];\n\n let _walk = node => {\n results.push(node.value); //executing code\n if(node.left) _walk(node.left); //go left - if node,left is null, we are at a leaf - traversing\n if(node.right) _walk(node.right); // go right - if node.right=null then we are at a leaf - traversing\n };\n console.log(_walk(this.root));\n _walk(this.root); // for whiteboard use ll.root instead of this.root, unless using a class constructor\n return results;\n }", "function avlTree() {\n \n}", "traverseToIndex() { }", "traverse() {\n \n\n for(var i = 0; i < this.arr.length; i++) {\n console.log(this.items[i])\n }\n}", "function traverse(_itemData,_start,_stop,_list){\n\tif (_itemData.children){\n\t\t_start++;\n\t\tfor (var i in _itemData.children){\n\t\t\tif (_itemData.children[i].children && _stop >_start){\n\t\t\t\ttraverse(_itemData.children[i],_start,_stop,_list);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// do whtever needs to be don on the stop-level\n\t\t\t\t// as an example just return the elements\n\t\t\t\t_list.push(_itemData.children[i]);\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\tconsole.log(\"....no more children found..\");\n\t}\n}", "function preOrderTraversal(node) {}", "_traverse(n, state, f) {\n var content = \"\";\n\n if (TreeTransformer.isNode(n)) {\n // If we were called on a node object, then we handle it\n // this way.\n var node = n; // safe cast; we just tested\n // Put the node on the stack before recursing on its children\n\n state._containers.push(node);\n\n state._ancestors.push(node); // Record the node's text content if it has any.\n // Usually this is for nodes with a type property of \"text\",\n // but other nodes types like \"math\" may also have content.\n\n\n if (typeof node.content === \"string\") {\n content = node.content;\n } // Recurse on the node. If there was content above, then there\n // probably won't be any children to recurse on, but we check\n // anyway.\n //\n // If we wanted to make the traversal completely specific to the\n // actual Perseus parse trees that we'll be dealing with we could\n // put a switch statement here to dispatch on the node type\n // property with specific recursion steps for each known type of\n // node.\n\n\n var keys = Object.keys(node);\n keys.forEach(key => {\n // Never recurse on the type property\n if (key === \"type\") {\n return;\n } // Ignore properties that are null or primitive and only\n // recurse on objects and arrays. Note that we don't do a\n // isNode() check here. That is done in the recursive call to\n // _traverse(). Note that the recursive call on each child\n // returns the text content of the child and we add that\n // content to the content for this node. Also note that we\n // push the name of the property we're recursing over onto a\n // TraversalState stack.\n\n\n var value = node[key];\n\n if (value && typeof value === \"object\") {\n state._indexes.push(key);\n\n content += this._traverse(value, state, f);\n\n state._indexes.pop();\n }\n }); // Restore the stacks after recursing on the children\n\n state._currentNode = state._ancestors.pop();\n\n state._containers.pop(); // And finally call the traversal callback for this node. Note\n // that this is post-order traversal. We call the callback on the\n // way back up the tree, not on the way down. That way we already\n // know all the content contained within the node.\n\n\n f(node, state, content);\n } else if (Array.isArray(n)) {\n // If we were called on an array instead of a node, then\n // this is the code we use to recurse.\n var nodes = n; // Push the array onto the stack. This will allow the\n // TraversalState object to locate siblings of this node.\n\n state._containers.push(nodes); // Now loop through this array and recurse on each element in it.\n // Before recursing on an element, we push its array index on a\n // TraversalState stack so that the TraversalState sibling methods\n // can work. Note that TraversalState methods can alter the length\n // of the array, and change the index of the current node, so we\n // are careful here to test the array length on each iteration and\n // to reset the index when we pop the stack. Also note that we\n // concatentate the text content of the children.\n\n\n var index = 0;\n\n while (index < nodes.length) {\n state._indexes.push(index);\n\n content += this._traverse(nodes[index], state, f); // Casting to convince Flow that this is a number\n\n index = state._indexes.pop() + 1;\n } // Pop the array off the stack. Note, however, that we do not call\n // the traversal callback on the array. That function is only\n // called for nodes, not arrays of nodes.\n\n\n state._containers.pop();\n } // The _traverse() method always returns the text content of\n // this node and its children. This is the one piece of state that\n // is not tracked in the TraversalState object.\n\n\n return content;\n }", "function walkObjectProcess()\n\t\t{\n\t\t\t// the function to process the children\n\t\t\t\tfunction process(element, index, depth)\n\t\t\t\t{\n\t\t\t\t\ttrace (indent(depth) + '/' + element.name);\n\t\t\t\t}\n\n\t\t\t// the function to identify the children\n\t\t\t\tfunction getContents(element)\n\t\t\t\t{\n\t\t\t\t\treturn element instanceof Folder ? element.contents : null;\n\t\t\t\t}\n\n\t\t\t// start processing\n\t\t\t\tvar folder = new Folder('{user}');\n\t\t\t\tUtils.walk (folder, process, getContents)\n\t\t}", "traverse(w, fn) {\n const c = this.getComponent()\n if (c) fn(c, w)\n\n for (const key of this) {\n if (w) w.descend(key)\n this.traverse(w, fn)\n if (w) w.ascend()\n }\n }", "traverse(){\r\n this.Array.forEach(function (sa) {\r\n \r\n console.log(sa);\r\n\r\n })\r\n}", "function traverse(node, func) {\n\tfunc(node);//1\n\tfor (var key in node) { //2\n\t\tif (node.hasOwnProperty(key)) { //3\n\t\t\tvar child = node[key];\n\t\t\tif (typeof child === 'object' && child !== null) { //4\n\n\t\t\t\tif (Array.isArray(child)) {\n\t\t\t\t\tchild.forEach(function (node) { //5\n\t\t\t\t\t\ttraverse(node, func);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\ttraverse(child, func); //6\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "visit() {\n this.state = 'visiting'\n const _this = this\n this.recordInfor('开始遍历文件树...')\n removeOutOfVisitlessQueue(this)\n addToVisitingQueue(this)\n visitTask(this.target, this.name, this.type, this.rootSize, this.dirUUID, this.tree, this, (err, data) => {\n if (err) return _this.error(err, '遍历服务器数据出错')\n _this.tree[0].downloadPath = _this.downloadPath\n removeOutOfVisitingQueue(this)\n _this.recordInfor('遍历文件树结束...')\n this.diff()\n })\n }", "function jb(){this.za=this.root=null;this.ea=!1;this.N=this.$=this.oa=this.assignedSlot=this.assignedNodes=this.S=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.V=void 0;this.Ea=this.ua=!1;this.Z={}}", "function hc_nodelisttraverselist() {\n var success;\n var doc;\n var elementList;\n var employeeNode;\n var employeeList;\n var child;\n var childName;\n var nodeType;\n var result = new Array();\n\n expected = new Array();\n expected[0] = \"em\";\n expected[1] = \"strong\";\n expected[2] = \"code\";\n expected[3] = \"sup\";\n expected[4] = \"var\";\n expected[5] = \"acronym\";\n\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(2);\n employeeList = employeeNode.childNodes;\n\n for(var indexN65651 = 0;indexN65651 < employeeList.length; indexN65651++) {\n child = employeeList.item(indexN65651);\n nodeType = child.nodeType;\n\n childName = child.nodeName;\n\n \n\tif(\n\t(1 == nodeType)\n\t) {\n\tresult[result.length] = childName;\n\n\t}\n\t\n\t\telse {\n\t\t\tassertEquals(\"textNodeType\",3,nodeType);\n assertEquals(\"textNodeName\",\"#text\",childName);\n \n\t\t}\n\t\n\t}\n assertEqualsListAutoCase(\"element\", \"nodeNames\",expected,result);\n \n}", "function walkObject()\n\t\t{\n\t\t\tfunction process(value, index, depth)\n\t\t\t{\n\t\t\t\ttrace(indent(depth) + '[' +index+ '] ' + value);\n\t\t\t}\n\n\t\t\tUtils.walk(arr, process);\n\t\t\tUtils.walk(obj, process);\n\t\t}", "traverse() {\n this.#array.forEach((element, i) => console.log(`Indice ${i}: ${element}`));\n }", "function traverse(element) {\n var nodeName = element.nodeName;\n\n var elemDetails = ' ';\n elemDetails += 'Call to traverse(el) function, where el = <' + nodeName + '>. ';\n elemDetails += 'Constructor: ' + element.constructor.name + '. ';\n elemDetails += 'Type: ' + element.type + '. ';\n elemDetails += 'willValidate: ' + element.willValidate + '. ';\n console.log(elemDetails);\n\n var len = element.children.length\n for (var i = 0; i < len; i++) {\n // call recursive funct with current element's children\n traverse(element.children[i]);\n }\n }", "traverse() {\n let current = this.head;\n\n while (current) {\n console.log(current.val)\n current = current.next\n }\n }", "levelTraversal () {\n let elements = [];\n let agenda = [this];\n while(agenda.length > 0) {\n let curElem = agenda.shift();\n if(curElem.height == 0) continue;\n elements.push(curElem);\n agenda.push(curElem.left);\n agenda.push(curElem.right);\n }\n return elements;\n }", "print_in_dfs() {\n let layer = 0;\n for (let i = 0; i < this.root.child_list.length; i++) {\n this._print_sub_tree(this.root.child_list[i], layer+1, i);\n }\n console.log(\"1th element at layer \" + layer + \": \" + this.root.type + \"(\" + this.root.id + \")\");\n }", "function firstWalk(v){var children=v.children,siblings=v.parent.children,w=v.i?siblings[v.i-1]:null;if(children){executeShifts(v);var midpoint=(children[0].z+children[children.length-1].z)/2;if(w){v.z=w.z+separation(v._,w._);v.m=v.z-midpoint}else{v.z=midpoint}}else if(w){v.z=w.z+separation(v._,w._)}v.parent.A=apportion(v,w,v.parent.A||siblings[0])}", "getChildNodeIterator() {}", "function wb(){this.wa=this.root=null;this.Y=!1;this.C=this.T=this.ka=this.assignedSlot=this.assignedNodes=this.J=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.O=void 0;this.Ca=this.pa=!1}", "function ka(){this.ja=this.root=null;this.O=!1;this.w=this.K=this.X=this.assignedSlot=this.assignedNodes=this.C=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.F=void 0;this.oa=this.ea=!1;this.J={}}", "traverse(){\r\n for (let i = 0; i < this.Array.length; i++) {\r\n console.log(this.Array[i])\r\n }}", "function kP(e,t){var n=function o(i){var l=[];return Array.isArray(i)&&i.forEach(function(s){if(Wa(s)){var u;l.push(s),(u=s.component)!==null&&u!==void 0&&u.subTree&&(l.push(s.component.subTree),l.push.apply(l,jt(o(s.component.subTree.children)))),s.children&&l.push.apply(l,jt(o(s.children)))}}),l},r=[];if(t!==void 0)r.push.apply(r,jt(n(t)));else{var a;r.push.apply(r,jt(n((a=Ne())===null||a===void 0?void 0:a.subTree.children)))}return r.filter(function(o){var i;return((i=o.type)===null||i===void 0?void 0:i.name)===e})}", "traverse(){\n let current = this.head;\n while(current){\n console.log(current.val);\n current = current.next;\n }\n }", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._nativeParent;}var i;for(i=path.length;i-->0;){fn(path[i],false,arg);}for(i=0;i<path.length;i++){fn(path[i],true,arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._nativeParent;}var i;for(i=path.length;i-->0;){fn(path[i],false,arg);}for(i=0;i<path.length;i++){fn(path[i],true,arg);}}", "function traverseObject(someObj) {\r\n \r\n console.log(someObj);\r\n}", "traverse(fn, skipSelf = false) {\n const {\n children\n } = this;\n\n if (!skipSelf) {\n fn.call(this, this);\n } // Simply testing whether there is non-zero children length\n // is 10x faster than using this.isLoaded\n\n for (let i = 0, l = children && children.length; i < l; i++) {\n children[i].traverse(fn);\n }\n }", "traverse(fn, skipSelf = false) {\n const me = this;\n\n if (!skipSelf) {\n fn.call(me, me);\n }\n if (me.isLoaded) me.children.forEach((child) => child.traverse(fn));\n }", "traversal () {\n var elements = [];\n if(this.height == 0) return elements;\n elements.push(...this.left.traversal());\n elements.push(this);\n elements.push(...this.right.traversal());\n\n return elements;\n }", "function walk(nodes) {\n for(var i = 0;i < nodes.length;i++) {\n\n // can't rely on crawl item depth property\n nodes[i].depth = depth; \n\n printer.item(nodes[i]);\n\n if(nodes[i].nodes && nodes[i].nodes.length) {\n\n if(typeof printer.enter === 'function') {\n printer.enter(nodes[i]);\n }\n\n walk(nodes[i].nodes, ++depth); \n\n if(typeof printer.exit === 'function') {\n printer.exit(nodes[i]);\n }\n }\n } \n depth--;\n }", "function process(element, index, depth)\n\t\t\t\t{\n\t\t\t\t\ttrace (indent(depth) + '/' + element.name);\n\t\t\t\t}", "function traverse(object, visitor, master) {\r\n var key, child, parent, path;\r\n\r\n parent = (typeof master === 'undefined') ? [] : master;\r\n\r\n if (visitor.call(null, object, parent) === false) {\r\n return;\r\n }\r\n for (key in object) {\r\n if (object.hasOwnProperty(key)) {\r\n child = object[key];\r\n path = [ object ];\r\n path.push(parent);\r\n if (typeof child === 'object' && child !== null) {\r\n traverse(child, visitor, path);\r\n }\r\n }\r\n }\r\n }", "DFSPreOrder(){\n var data = [],\n current = this.root\n \n function traverse(node) {\n data.push(node.value)\n if (node.left) traverse(node.left)\n if (node.right) traverse(node.right)\n }\n traverse(current)\n return data\n }", "traverse(method) {\n inOrder(this.root);\n // Helper method for traversing the nodes in order\n function inOrder(currentNode) {\n if(currentNode.left) {\n inOrder(currentNode.left);\n }\n method.call(this, currentNode);\n if(currentNode.right) {\n inOrder(currentNode.right);\n }\n }\n }", "depthFirstForEach(cb) {\n\n }", "function step2(map) {\n\tconst root = { name: '/', nodes: [] };\n\treturn (function next(map, parent, level) {\n\t\tObject.keys(map).forEach(key => {\n\t\t\tlet val = map[key];\n\t\t\tlet node = { name: key };\n\t\t\tif (typeof val === 'object') {\n\t\t\t\tnode.nodes = [];\n\t\t\t\tnode.open = level < 1;\n\t\t\t\tnext(val, node, level + 1);\n\t\t\t} else {\n\t\t\t\tnode.src = val;\n\t\t\t}\n\t\t\tparent.nodes.push(node);\n\t\t});\n\t\treturn parent;\n\t})(map, root, 0);\n}", "DFSPostOrder() {\n let data = [];\n let current = this.root;\n\n function traverse(node) {\n if (node.left) traverse(node.left)\n if (node.right) traverse(node.right)\n data.push(node.value)\n }\n\n traverse(current);\n console.log(data);\n return data;\n }", "_traverse(callback) {\n function exec(node) {\n callback(node);\n node.children && node.children.forEach(exec);\n }\n exec(this.root);\n }", "function init() {\n createOneDepth(root, 0);\n document.getElementById('preOrder').addEventListener('click', traverse);\n document.getElementById('inOrder').addEventListener('click', traverse);\n document.getElementById('postOrder').addEventListener('click', traverse);\n }", "traverseBF(fn) {\n //will give us some element within our root node, inside an array\n const arr = [this.root]\n\n //while-loop, works as long as array has something in it, is TRUTHY\n while (arr.length) {\n //remove first element out of array, with shift() method\n const node = arr.shift()\n //then take all node's children and push them into our array\n // CAN'T do node.children, would create a nested array\n // use spread operator to take all elements out, and push them into the array\n arr.push(...node.children) //TODO:For-loop, would have been more code!!!\n\n //take node AND pass in to our iterator func\n fn(node)\n }\n }", "DFSPreOrder() {\n let data = [];\n let current = this.root;\n\n function traverse(node) {\n data.push(node.value);\n if (node.left) traverse(node.left);\n if (node.right) traverse(node.right);\n }\n traverse(current)\n console.log(data)\n return data;\n }", "printAll() {\n if (!this.root) return;\n \n this.traverseBF((item) => {\n console.log(item);\n })\n }", "printAll() {\n if (!this.root) return;\n \n this.traverseBF((item) => {\n console.log(item);\n })\n }", "traverse() {\n let result = [];\n let curr = this.first;\n while (curr) {\n result.push(curr.val);\n curr = curr.next;\n }\n return result;\n }", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function SubTree(){\r\n\r\n\r\n}", "function postOrderTraversal(node) {}", "traverseDF(fn) {\n //Same: Create an array for traversing with only the root\n const nodeToProcess = [this.root];\n //Same: as long as the array has something in it loop through it\n while (nodeToProcess.length) {\n //Same: Take out the first thing in the array\n const childToProcess = nodeToProcess.shift();\n //DIFFERENT: put all the children of the shifted data into the front of the array for processing in the same order as above.\n nodeToProcess.unshift(...childToProcess.children);\n //Same: recursion part, put shifted node into the argument function for processing.\n fn(childToProcess);\n }\n }", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "traverse(callback) {\n if (this.type instanceof index_1.ReflectionType) {\n if (callback(this.type.declaration, abstract_1.TraverseProperty.TypeLiteral) === false) {\n return;\n }\n }\n super.traverse(callback);\n }", "buildTree() {\n\t\tthis.assignLevel(this.nodesList[0], 0);\n\t\tthis.positionMap = new Map();\n\t\tthis.assignPosition(this.nodesList[0], 0);\n\t}", "DFSPreOrder() {\n let data = [];\n traverse = (node) => {\n data.push(node);\n if (node.left) traverse(node.left);\n if (node.right) traverse(node.right);\n }\n traverse(this.root)\n return data\n }", "traverseDown (callback, object, property, parent) {\n\t\t\tif (Array.isArray(object)) {\n\t\t\t\tobject.forEach((item, i) => _.traverse(callback, item, i, object));\n\t\t\t}\n\t\t\telse if (Mavo.isPlainObject(object)) {\n\t\t\t\tfor (var prop in object) {\n\t\t\t\t\t_.traverse(callback, object[prop], prop, object);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "DFSPreOrder() {\n let data = []\n function traverse(node) {\n data.push(node.value)\n if (node.left) traverse(node.left)\n if (node.right) traverse(node.right)\n }\n traverse(this.root)\n return data\n }", "breathFirstTraversalHelper(root) {\n // Vinicio - This is a pseudocode help for your homework\n // const queue = ....; --> BFT\n // const stack = ...; --> DFT\n // while the queue is not empty\n // dequeue one element\n // enqueue all its children into queue\n // print/visit the node you just dequeued\n }", "*forwards() {\r\n yield this;\r\n yield* this.descendants();\r\n }", "function traverse(bookmarkItems) {\n console.log(\"START\",bookmarkItems);\n for (node of bookmarkItems) {\n console.log(\"current node: \", node);\n if (node.title == \"saved pages\") {\n console.log(\"existing folder node: \", node);\n return (node);\n }\n else if (node.children) {\n\n //wraping result in a promise\n var recursivePromiseBranch = Promise.resolve().then(\n function () {\n console.log(\"traversing to next child\")\n return (traverse(node.children));\n }\n );\n return (recursivePromiseBranch);\n }\n }\n }", "function visitNodes(node, action, context)\r\n {\r\n for (var fieldname in node)\r\n {\r\n var childNode = node[fieldname];\r\n if (childNode == undefined)\r\n continue;\r\n\r\n action(node, fieldname, context);\r\n if (typeof(childNode) != 'object')\r\n continue;\r\n\r\n if (childNode instanceof Array)\r\n {\r\n for (var i = 0; i < childNode.length; i++)\r\n {\r\n if (typeof(childNode[i]) == 'object')\r\n visitNodes(childNode[i], action, context);\r\n }\r\n }\r\n else\r\n {\r\n visitNodes(childNode, action, context);\r\n }\r\n }\r\n }", "traverseChildren(crossScope, func) {\r\n\t\t\t\t\tif (crossScope) {\r\n\t\t\t\t\t\treturn super.traverseChildren(crossScope, func);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function traverse(node) {\n // push the value of the node to the variable that stores the values\n result.push(node.value);\n // if the node has a left property, call the helper function with the left property on the node\n if (node.left) traverse(node.left);\n // if the node has a right property, call the helper function with the right property on the node\n if (node.right) traverse(node.right);\n }", "function TNodes_doCopyBranchToJson(source){\n \n var mysplit={};\n var splitnodecollection=new Array();\n var nodeAttr=new TComAttr();\n var boxnodeAttr=new TComAttr();\n var tmpnds=new TNodes('tempNodes',source.Owner,source.Owner.Ident);\n var e=0;\n var maxlevel=-1;\n var list=[]; // array for json-bifork-objects\n var myitemlist={}; // subelementlist container or sticker\n var myitemnds={}; // Nodes in subelement\n var partlist={}; // return-receiver for recursive callings \n var curindex=0;\n var mybuildorder='noinfo';\n\n switch (source.Type){\n case 'node':\n var mysourcends=source.Owner;\n var myzeronode=null;\n var zeronodeflag=false; \n break;\n \n case 'nodes':\n var myzeronode=new TNode();\n myzeronode.doAssign(source.Item[0]);\n var mysourcends=source;\n source=mysourcends.Item[0];\n var zeronodeflag=true; \n break;\n\n case 'container':\n var mysourcends=source.Nodes;\n source=mysourcends.Item[0];\n tmpnds.Item[0]=source; \n break;\n /* STICKER_mp\n case 'sticker':\n var mysourcends=source.Nodes;\n \n break;*/\n default:\n return null;\n } \n \n /* ====================================\n * Node with childs == bifork-structure\n * ==================================== \n */ \n \n if (source.HasChild==true){\n \n mybuildorder='child';\n \n // set the startlevel\n var minlevel=source.Child.Level;\n\n // get all objects with ident from this branch\n // load it into the tmpnds\n for (var i=source.Child.AbsoluteIndex;i<=mysourcends.Count;i++){\n \n mysplit=mysourcends.Item[i];\n if (i>source.Child.AbsoluteIndex && mysplit.Level<=source.Child.Level){\n break;\n }\n tmpnds.Item[i] = new TSplit();\n tmpnds.Item[i].doAssign(mysplit);\n tmpnds.Item[i].ParentIndex=mysplit.Parent.Parent.AbsoluteIndex;\n if (mysplit.Level>maxlevel){\n maxlevel=mysplit.Level;\n }\n \n // show copy-result\n doPrint('copy to node -> ' + i + ' type:' + mysplit.Type);\n doPrint('copy-target -> ' + i + ' type:' + tmpnds.Item[i].Type);\n \n // + ' ident: ' + myobjectlist[e].Ident + ' ->' , myobjectlist[e]);\n \n }\n \n // initialize the two-dimensional horizontal array\n var levellist = new Array(maxlevel-minlevel+1);\n for (var L=minlevel;L<=maxlevel;L++){\n levellist[L] = new Array();\n }\n \n // sort the elements of tmpnds in levellist[level, absoluteindex]\n for (var S in tmpnds.Item){\n mysplit=tmpnds.Item[S];\n levellist[mysplit.Level][S]=tmpnds.Item[S];\n }\n\n if (zeronodeflag){\n curindex=list.length;\n list[list.length]=myzeronode.doDBTreeDataobject();\n list[curindex].buildorder='zeronode'; \n }\n \n for (L=minlevel;L<=maxlevel;L++){ \n for (S in levellist[L]){\n \n mysplit=levellist[L][S];\n \n curindex=list.length;\n list[curindex]=mysplit.UpNode.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder; //'U'+mysplit.AbsoluteIndex;\n curindex=list.length;\n list[curindex]=mysplit.DownNode.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder; //'D'+mysplit.AbsoluteIndex;\n\n // scanning the sub-elements\n\n // the two nodes in a mini-array for dry-code\n // UpNode\n splitnodecollection[1]=mysplit.UpNode;\n // DownNode\n splitnodecollection[2]=mysplit.DownNode;\n \n // container and splits \n // seq. up- and downnode => 1, then 2\n for (var i=1;i<=2;i++){\n // t iterats 1 and 2 for container und splits to keep the code dry \n for (var t=1;t<=2;t++){ \n \n switch (t){\n case 1: myitemlist=splitnodecollection[i].ContainerList;\n break;\n case 2: myitemlist=splitnodecollection[i].StickerList;\n break;\n }\n \n for (var j=1;j<=myitemlist.Count;j++){\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n curindex=list.length;\n list[curindex]=partlist[e];\n list[curindex].buildorder=mybuildorder;\n }\n // mark last element\n curindex=list.length-1;\n list[curindex].buildorder='lastelement';\n \n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n \n }//if != undefined\n }// for itemlist\n\n }// for t container and sticker\n }// for i, up und down\n }//for levellist\n }// for levellist\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype\n + ' buildorder: ' + list[e].buildorder\n + ' ->' , list[e]);\n }\n\n delete levellist;\n\n }// end node-child\n\n\n /* ======================================\n * Zeronode without children in container\n * ====================================== \n */ \n\n if (source.HasChild==false && source.ZeroNodeType=='container'){\n mybuildorder='nochild';\n curindex=list.length;\n list[curindex]=source.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n \n }\n\n /* ======================================\n * Zeronode without children in sticker\n * ====================================== \n */ \n/* STICKER_mp\n if (source.HasChild==false && source.ZeroNodeType=='sticker'){\n mybuildorder='nochild';\n curindex=list.length;\n list[curindex]=source.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n \n }*/\n\n /* ====================================\n * Node with containerlist\n * ==================================== \n */ \n\n if (source.ContainerList.Count>0){\n mybuildorder='container';\n myitemlist=source.ContainerList;\n\n for (var j=1;j<=myitemlist.Count;j++){\n\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n /* STICKER_mpif (myitemlist.Owner.ZeroNodeType=='sticker'){\n list[curindex].buildorder='sticker'; \n }*/\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n \n list[list.length]=partlist[e];\n }\n\n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n }//----\n \n }\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n\n\n }// end node-container\n\n\n /* ====================================\n * Node with stickerlist\n * ==================================== \n */ \n/* STICKER_mp\n if (source.StickerList.Count>0){\n mybuildorder='sticker';\n myitemlist=source.StickerList;\n\n for (var j=1;j<=myitemlist.Count;j++){\n\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n \n list[list.length]=partlist[e];\n }\n\n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n }//----\n \n }\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n\n\n }// end node-sticker */\n\n delete tmpnds;\n \n return list;\n\n }", "function secondWalk(v){v._.x=v.z+v.parent.m;v.m+=v.parent.m}", "function traverseTree(obj) {\n var obj = obj //|| document.getElementsByTagName('testing')[0];\n var _compEle = []\n if (obj && obj.hasChildNodes()) {\n var child = obj.firstChild;\n while (child) {\n if (child.nodeType === 1) {\n _compEle.push(child.nodeName)\n traverseTree(child);\n }\n child = child.nextSibling;\n }\n }\n return _compEle;\n }", "transient protected internal function m189() {}", "function dfs(root){\r\n\r\n}", "function secondWalk(v) {\n\t v._.x = v.z + v.parent.m;\n\t v.m += v.parent.m;\n\t } // APPORTION", "function traverse(node) {\n // if the node has a left property, call the helper function with the left property on the node\n if (node.left) traverse(node.left);\n // if the node has a right property, call the helper function with the right property on the node\n if (node.right) traverse(node.right);\n // push the value of the node to the variable that stores the values\n result.push(node.value);\n }", "function o0(o1)\n{\n var o2 = -1;\n try {\nfor (var o259 = 0; o3 < o1.length; function (o502, name, o38, o781, o782, o837, o585, o838, o549) {\n try {\no839.o468();\n}catch(e){}\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var o840 = name ? o591.resolve(o591.o592(o502, name)) : o502;\n\n function o841(o842) {\n function o843(o842) {\n try {\nif (!o838) {\n try {\no474.o800(o502, name, o842, o781, o782, o549);\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o837) try {\no837();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n }\n var o844 = false;\n try {\nModule['preloadPlugins'].forEach(function (o845) {\n try {\nif (o844) try {\nreturn;\n}catch(e){}\n}catch(e){}\n try {\nif (o845['canHandle'](o840)) {\n try {\no845['handle'](o842, o840, o843, function () {\n try {\nif (o585) try {\no585();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n });\n}catch(e){}\n try {\no844 = true;\n}catch(e){}\n }\n}catch(e){}\n });\n}catch(e){}\n try {\nif (!o844) try {\no843(o842);\n}catch(e){}\n}catch(e){}\n }\n try {\no332('cp ' + o840);\n}catch(e){}\n try {\nif (typeof o38 == 'string') {\n try {\no839.o846(o38, function (o842) {\n try {\no841(o842);\n}catch(e){}\n }, o585);\n}catch(e){}\n } else {\n try {\no841(o38);\n}catch(e){}\n }\n}catch(e){}\n })\n {\n try {\nif (o1[o3] == undefined)\n {\n try {\nif (o2 == -1)\n {\n try {\no2 = o3;\n}catch(e){}\n }\n}catch(e){}\n }\n else\n {\n try {\nif (o2 != -1)\n {\n try {\no4.o5(o2 + \"-\" + (o3-1) + \" = undefined\");\n}catch(e){}\n try {\no2 = -1;\n}catch(e){}\n }\n}catch(e){}\n try {\no4.o5(o3 + \" = \" + o1[o3]);\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "buildTree() {\n // note: in this function you will assign positions and levels by making calls to assignPosition() and assignLevel()\n let rootNode = this.nodeList.find(theRootNode => theRootNode.parentName === \"root\");\n this.assignLevel(rootNode, 0);\n this.assignPosition(rootNode, 0);\n }", "function traverse(node) {\n // if the node has a left property, call the helper function with the left property on the node\n if (node.left) traverse(node.left);\n // push the value of the node to the variable that stores the values\n result.push(node.value);\n // if the node has a right property, call the helper function with the right property on the node\n if (node.right) traverse(node.right);\n }", "function walkTreeRecursive($node) {\n\t// try visit me 1st\n\tif ($node[0].count==0 ) {\n\t\t$node[0].count++;\n\t\tif ( !$node.hasClass(abstractClass)) { // $node.hasClass(abstractClass) is an interesting part, bottom up parsing, we see a handle not a top node.\n\t\t\tsetFocus($node);\n\t\t\t_.delay(walkTreeRecursive, calcDelay($node), $node);\n\t\t\treturn ;\n\t\t}\n\t}\n\t// try visit any unvisited children - 1st time\n\tif ( $node[0].children && $node[0].children.length )\n\t\tfor (var i=0; i<$node[0].children.length; i++) \n\t\t{\n\t\t\tif ( $node[0].children[i].count==0 ) {\n\t\t\t\twalkTreeRecursive( $( $node[0].children[i] ) ) ;\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\telse { // so remove focus when we move to sibling, but keep focus if i am last sibling\n\t\t\t\tvar isEdge = i == $node[0].children.length-1; \n\t\t\t\tunfocusDecendantsAndOptionallyLeaves( $($node[0].children[i] ), isEdge );\n\t\t\t}\n\t\t}\n\n\t// try visit myself 2nd time\n\tif ($node[0].count==1 ) {\n\t\t$node[0].count++;\n\t\t//unfocusLeaf($node);\n\t\tvar delay = $node.hasClass(abstractClass) ? calcDelay($node) : 0 ;\n\t\t_.delay(walkTreeRecursive, calcDelay($node), $node.parent());\n\t\treturn ;\n\t}\n\n}", "dfsPreOrder() {\n let result = []\n const traverse = (node) => {\n // capture root node value\n result.push(node.value);\n // if left exists, go left again\n if (node.left) {\n traverse(node.left);\n } \n // if right child exists, go right again\n if (node.right) { \n traverse(node.right);\n }\n }\n traverse(this.root);\n return result;\n }", "display() {\n let o = {\n data: {},\n rawData: ''\n };\n this.getAllTrie(this.head, '', o, true);\n }", "consstructor(){\n this.traverseMethod = 'pre-order';\n }", "buildHierarchy(obj) {\n var that = this;\n var csv = obj;\n // obj = _.clone(obj);\n csv = _.filter(obj, (obje) => {\n return obje[0].split(\">\").length < 13;\n });\n var root = {\"name\": \"root\", \"children\": []};\n for (var i = 1; i < csv.length - 1; i++) {\n var sequence = csv[i][0];\n var size = +csv[i][1];\n var conType = csv[i][2];\n //console.log(csv[i])\n if (isNaN(size)) {\n break;\n }\n var parts = sequence.split(\">\");\n parts = _.map(parts, _.trim);\n parts = _.map(parts, function (a) {\n return that.resolveStepName(a);\n });\n var currentNode = root;\n for (var j = 0; j < parts.length; j++) {\n var children = currentNode[\"children\"];\n var nodeName = parts[j];\n var childNode;\n if (j + 1 < parts.length) {\n // Not yet at the end of the sequence; move down the tree.\n var foundChild = false;\n for (var k = 0; k < children.length; k++) {\n if (children[k][\"name\"] == nodeName) {\n childNode = children[k];\n foundChild = true;\n break;\n }\n }\n // If we don't already have a child node for this branch, create it.\n if (!foundChild) {\n childNode = {\"name\": nodeName, \"children\": []};\n children.push(childNode);\n }\n currentNode = childNode;\n }\n else {\n // Reached the end of the sequence; create a leaf node.\n childNode = {\"name\": nodeName, \"children\": [], \"size\": size, conversion_type: conType};\n children.push(childNode);\n }\n }\n }\n\n\n return root;\n }", "getTree() {\n\n return [\n 'apply',\n this.address.getTree(),\n this.args.map(arg => arg.getTree()),\n this.block\n ];\n }", "createMyList(data,_pre){\n var _this=this,cLen=0;\n data.map(function(i){\n cLen=0;\n i.child.map(function(data){\n if(data.folderName){\n cLen++;\n }\n });\n _this.state.displayList.push({child:cLen,folder:i.folderName,level:i.level, _on:i._on, editable:i.editable,rel:_pre+'/'+i.folderName,type:i.type});\n if(_this.state.exAll){\n i._on =true;\n }\n if(_this.state.colAll){\n i._on =false;\n }\n if(i._on){\n _this.createMyList(i.child,_pre+'/'+i.folderName); // recursive call to iterate over the nested data structure\n }\n });\n }", "function traverseFileTree(item,filePath) {\n\t\n\t// If File\n\tif (item.isFile) {\n\t\t\n\t\titem.file(function(file) {\n\n\t\t\tvar fileName = filePath + file.name;\n\t\t\tdisplayTransferWindow(file,fileName,globalFileUploadPreCount); // display file in transfer window\n\t\t\tglobalFiles[globalFileUploadPreCount] = file; // record file to array\n\t\t\tglobalPaths[globalFileUploadPreCount] = encodeURIComponent(filePath); // record path to array\n\t\t\tglobalFileUploadPreCount++;\n\t\t});\n\t}\n\t\n\t// If Directory\n\tif (item.isDirectory) {\n\n\t\tvar dirReader = item.createReader();\n\t\t\n\t\t// Read list of files/folders and call this function on each\n\t\tdirReader.readEntries(function(entries) {\n\t\t\n\t\t\tfor (var i=0; i<entries.length; i++) {\n\t\t\t\ttraverseFileTree(entries[i], filePath + item.name + \"/\");\n\t\t\t}\n\t\t});\n\t}\n}", "visitNode(node) { }", "dfsPreOrder() {\r\n let result = []\r\n\r\n const traverse = node => {\r\n result.push(node.data)\r\n if (node.left) traverse(node.left)\r\n if (node.right) traverse(node.right)\r\n }\r\n\r\n traverse(this.root)\r\n return result\r\n }" ]
[ "0.62409014", "0.6152476", "0.609079", "0.60179514", "0.60150814", "0.5981329", "0.5981329", "0.59724647", "0.58751833", "0.5854579", "0.5852606", "0.5834093", "0.5831164", "0.5795604", "0.5757922", "0.5731947", "0.5724908", "0.5721031", "0.5698307", "0.5684423", "0.5668885", "0.5649078", "0.56357205", "0.56355214", "0.56134427", "0.55840456", "0.5516392", "0.5514573", "0.5490694", "0.5487333", "0.5484969", "0.548404", "0.54783356", "0.5478248", "0.54745346", "0.5473321", "0.54688966", "0.54688966", "0.5465559", "0.5425314", "0.5423825", "0.54164386", "0.54115003", "0.54083645", "0.54067415", "0.54028636", "0.5402799", "0.5399526", "0.53973365", "0.5396325", "0.5394817", "0.5380312", "0.53519404", "0.53507656", "0.535034", "0.535034", "0.53495604", "0.531619", "0.531619", "0.531619", "0.531619", "0.531619", "0.531619", "0.531605", "0.53144306", "0.531093", "0.5308745", "0.5308745", "0.5308745", "0.5308745", "0.5308291", "0.5303624", "0.5294741", "0.5292394", "0.5285041", "0.52768177", "0.5268423", "0.5261207", "0.52574056", "0.52552223", "0.52340686", "0.5232061", "0.5231582", "0.52298814", "0.5221608", "0.5221297", "0.52117795", "0.52046525", "0.5202373", "0.5201825", "0.5195694", "0.51944363", "0.51906353", "0.51839423", "0.5179036", "0.51752627", "0.51737905", "0.5171213", "0.5169871", "0.51695853", "0.51691544" ]
0.0
-1
Recalculates svg and element sizes when the chart is resized
recalculateSizes() { let elem = ReactDOM.findDOMNode(this).parentNode; this.width = elem.offsetWidth - 30; this.divHeight = elem.offsetHeight; this.height = this.data.length * 60; this.barHeight = (this.height - 50) / this.data.length / 2; const minSize = Math.min(this.width, this.divHeight); this.textSize = minSize / 30; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize() {\n size = chartData.size = d3.event.detail.size;\n redraw();\n }", "function chart_resize(width)\n {\n if( $(elm).length )\n {\n var height = width * ratio;\n $(elm).attr(\"height\", height + \"px\");\n $(elm).attr(\"width\", width + \"px\");\n $(elm).width(width);\n $(elm).height(height);\n if( $(svg_elm).length )\n {\n $(svg_elm).attr(\"height\", height + \"px\");\n $(svg_elm).attr(\"width\", width + \"px\");\n }\n }\n }", "function _resize() {\n _svg\n .attr(\"width\", _svgWidth)\n .attr(\"height\", _svgHeight);\n\n _chartGroup\n .attr(\"width\", _width)\n .attr(\"height\", _height)\n .attr(\"transform\", \"translate(\" + [_margin.left, _margin.top] + \")\");\n\n _xAxisGroup\n .attr(\"width\", _width)\n .attr(\"height\", _height)\n .attr(\"transform\", \"translate(\" + [_margin.left, (_height + _margin.top)] + \")\")\n .call(_xAxis.ticks(5).tickSizeInner([-_height]));\n\n _clearBtnGroup.attr(\"transform\", \"translate(\" + [_svgWidth - 50, 2] + \")\");\n\n }", "function _calcSize() {\n var bounds = parent.getBoundingClientRect();\n\n _chart.width(bounds.width);\n _chart.height(_svgHeight);\n }", "function resize() {\n const w = parseInt(container.style(\"width\"));\n svg.attr(\"width\", w);\n svg.attr(\"height\", Math.round(w / aspect));\n }", "function resize() {\n const w = parseInt(container.style(\"width\"));\n svg.attr(\"width\", w);\n svg.attr(\"height\", Math.round(w / aspect));\n }", "function resize() {\r\n var targetWidth = parseInt(container.style(\"width\"));\r\n svg.attr(\"width\", targetWidth);\r\n svg.attr(\"height\", Math.round(targetWidth / aspect));\r\n }", "function updateSvgSize() {\n let g = document.getElementById('graph');\n width = g.clientWidth;\n height = g.clientHeight;\n}", "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resizeChart() {\n var container = d3.select('#chart1');\n var svg = container.select('svg');\n\n if (fitScreen) {\n // resize based on container's width AND HEIGHT\n var windowSize = nv.utils.windowSize();\n svg.attr(\"width\", windowSize.width);\n svg.attr(\"height\", windowSize.height);\n } else {\n // resize based on container's width\n var aspect = chart.width() / chart.height();\n var targetWidth = parseInt(container.style('width'));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }\n }", "function resizeChart() {\n\t var container = d3.select('#workout-line-chart');\n\t var svg = container.select('svg');\n\n\t if (fitScreen) {\n\t // resize based on container's width AND HEIGHT\n\t var windowSize = nv.utils.windowSize();\n\t svg.attr(\"width\", windowSize.width);\n\t svg.attr(\"height\", windowSize.height);\n\t } else {\n\t // resize based on container's width\n\t var aspect = chart.width() / chart.height();\n\t var targetWidth = parseInt(container.style('width'));\n\t svg.attr(\"width\", targetWidth);\n\t svg.attr(\"height\", Math.round(targetWidth / aspect));\n\t }\n\t }", "function updateSize() {\n $svg.remove();\n var width = $element.width(),\n height = $element.height(),\n elmRatio = width/height;\n if (!height || elmRatio < ratio) {\n height = width / ratio;\n } else {\n width = height * ratio;\n }\n $svg.appendTo($element);\n $svg.css({width: width, height: height});\n }", "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function adjustSize() {\n var\n prevW = canvasW,\n prevH = canvasH;\n canvasW = $(svgContainer).innerWidth();\n canvasH = $(svgContainer).innerHeight();\n canvasR = canvasW / canvasH;\n boxW *= canvasW / prevW ;\n boxH *= canvasH / prevH ;\n svgRoot.setAttribute( 'width', canvasW );\n svgRoot.setAttribute( 'height', canvasH );\n //console.log('called adjustSize: '+canvasW+' '+canvasH);\n }", "function resize() {\n let targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", .8 * targetWidth);\n svg.attr(\"height\", .8 * Math.round(targetWidth / aspect));\n }", "function resize() {\n let targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resize() {\n let targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resize() {\n let targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resize() {\n var targetWidth = (isNaN(parseInt(container.style(\"width\")))) ? 960 : parseInt(container.style(\"width\")); \n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resizeChart() {\n if (chart && chart.update) {\n chart.update();\n }\n }", "function resize() {\n drawChart(rawData, props)\n }", "function resize() {\n d3.selectAll(\"g\").attr(\"transform\", \"scale(\" + $(\"#content-container\").width()/1900 + \")\");\n $(\"svg\").height($(\"#content-container\").width()/2);\n }", "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n targetWidth = targetWidth > 500 ? 500 : targetWidth;\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resizeChart() {\n var oldWidth = options.width\n var oldHeight = options.height\n\n var width = parseInt(wrap.style('width'), 10)\n var height = parseInt(wrap.style('height'), 10)\n\n if (!width || !height) {\n return\n }\n\n options.width = width - options.margin.left - options.margin.right\n options.height = height - options.margin.top - options.margin.bottom\n\n if (options.height < 150) {\n options.height = 150\n }\n\n if (oldWidth !== options.width ||\n oldHeight !== options.height) {\n\n svg.attr('width', options.width +\n options.margin.left +\n options.margin.right)\n .attr('height', options.height +\n options.margin.top +\n options.margin.bottom)\n\n svg.select('rect')\n .attr('width', options.width)\n .attr('height', options.height)\n\n svg.select('rect.background')\n .attr('width', options.width)\n .attr('height', options.height)\n\n if (base && counter) {\n drawData(true)\n }\n }\n }", "resize() {\n mainW = $main.node().offsetWidth;\n mobile = mainW < 960;\n marginLeft = BUFFER;\n marginRight = BUFFER;\n\n // defaults to grabbing dimensions from container element\n width = $chart.node().offsetWidth - marginLeft - marginRight;\n height = $chart.node().offsetHeight - MARGIN_TOP - MARGIN_BOTTOM;\n\n $svg\n .attr(\"width\", width + marginLeft + marginRight)\n .attr(\"height\", height + MARGIN_TOP + MARGIN_BOTTOM);\n\n scaleArcX.range([0, width]);\n scaleArcY.range([0, SPLIT * height]);\n scaleHistX.range([0, width]);\n\n rectHeight = Math.floor(((1 - SPLIT) * height - SPACER) / maxBin);\n offY = SPLIT * height + SPACER;\n\n return Chart;\n }", "function resizeChart() {\n var old = width;\n width = parseInt(self.div.style('width'), 10) -\n margin.left - margin.right;\n height = width / 2 > 150 ? width / 2 : 150;\n\n if (!width) {\n return;\n }\n\n if (old !== width) {\n drawChart();\n drawData();\n }\n }", "function resize() {\r\n \t$(\".docInformation\").css(\"opacity\", 1);\r\n var targetWidth = parseInt(container.style(\"width\"));\r\n svg.attr(\"width\", targetWidth);\r\n svg.attr(\"height\", Math.round(targetWidth / aspect));\r\n }", "function resize() {\n var targetWidth = window.innerWidth;\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resizeChart() {\n selectedChart.renderChart();\n}", "function sizeChange() {\n\n // Resize the timeline\n var wide = container.width(),\n high = container.height();\n var scale = wide / outerWidth;\n d3.select(\".topGroup\").attr(\"transform\", \"scale(\" + scale + \")\");\n $(\".svg-chart\").height(wide * (1.0 / aspect));\n\n}", "function originalSize() {\n svg.setAttribute(\"width\", w);\n svg.setAttribute(\"height\", h);\n resizeDiv(w, h);\n\n propObj.wProp = w;\n propObj.hProp = h;\n updateProperties();\n}", "function handleResize() {\n\n\t// 1. update height of step elements for breathing room between steps\n\tvar stepHeight = Math.floor(window.innerHeight * 0.9);\n\tstep.style('height', stepHeight + 'px');\n\n\t// 2. update height of graphic element\n\tvar bodyWidth = d3.select('body').node().offsetWidth;\n\n\tgraphic\n\t\t.style('height', window.innerHeight + 'px');\n\n\t// 3. update width of chart by subtracting from text width\n\tvar chartMargin = 10;\n\tvar textWidth = text.node().offsetWidth;\n\tvar chartWidth = graphic.node().offsetWidth - textWidth - chartMargin;\n var chartHeight = Math.floor(chartWidth * 0.66)\n\n\tchart\n\t\t.style('width', chartWidth + 'px')\n\t\t.style('height', chartHeight + 'px');\n\n // 4. update dimensions of svg element in chart div\n var svg = d3.select(\".plotArea is-active\").select(\"svg\")\n\n svg\n .attr(\"width\", chartWidth + \"px\")\n .attr(\"height\", chartHeight + \"px\")\n\n\t// 5. tell scrollama to update new element dimensions\n\tscroller.resize();\n}", "function setSize() {\n\t\twidth = document.querySelector(\"#graph\").clientWidth\n\t\theight = document.querySelector(\"#graph\").clientHeight\n\n\t\tmargin = {top:0, left:0, bottom:0, right:0 }\n\n\t\tchartWidth = width - (margin.left+margin.right)\n\t\tchartHeight = height - (margin.top+margin.bottom)\n\n\t\tsvg.attr(\"width\", width).attr(\"height\", height)\n\n\t\tchartLayer\n\t\t\t.attr(\"width\", chartWidth)\n\t\t\t.attr(\"height\", chartHeight)\n\t\t\t.attr(\"transform\", \"translate(\"+[margin.left, margin.top]+\")\")\n\t}", "function resize() {\n var targetWidth = parseInt(container.style('width'))\n svg.attr('width', targetWidth)\n svg.attr('height', Math.round(targetWidth / aspect))\n // svg.selectAll('.d3-tip').style('max-width', targetWidth / 2)\n }", "function resize() {\n \tconsole.log(\"------:resize: \"+ svg+\"/\"+ container.attr(\"id\"))\n var targetWidth = parseInt(container.style(\"width\"));\n \tconsole.log(targetWidth);\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function resize() {\n marginTop = scope.hideXAxis === \"true\" ? 3 : 23;\n element.height(scope.height);\n $(element).find(\".scalable-series-paddingDiv\").css(\"height\", marginTop);\n canvasWidth = $(window).width();\n canvasHeight = element.height()-marginTop-marginBottom;\n bufferWidth = canvasWidth + 2*bufferMargin;\n canvas\n .attr(\"width\", canvasWidth)\n .attr(\"height\", canvasHeight);\n svgElement\n .style(\"height\", element.height())\n .style(\"top\", -canvasHeight-marginTop-8); // don't know where 8 comes from...but it makes things line up\n \n buffer.width = bufferWidth;\n buffer.height = canvasHeight;\n\n yAxis.tickSize(-element.width()-30);\n\n view.xScale.range([0, element.width()]);\n view.zoom.x(view.xScale);\n yScale.range([canvasHeight, 0]);\n\n backgroundRect\n .attr(\"width\", element.width())\n .attr(\"height\", element.height())\n .call(view.zoom);\n canvas.call(view.zoom);\n yaxisBacking\n .attr(\"height\", element.height()-marginTop)\n .attr(\"y\", marginTop);\n yaxisGroup.attr(\"transform\", \"translate(\" + 40 + \", \" + (marginTop+2) + \")\");\n xaxisGroup.call(xAxis);\n\n notFoundLabel\n .attr(\"x\", element.width()/2)\n .attr(\"y\", element.height()/2+7);\n\n if (currChunkIndexes) resetZoom();\n }", "function resize() {\n var svgRoot = document.documentElement;\n svgRoot.setAttribute('width', window.innerWidth);\n svgRoot.setAttribute('height', window.innerHeight);\n exports.update();\n }", "function resize() { \n\t\tbase.width = parent.clientWidth;\n\t\tsvg.setAttributeNS(null, \"width\", base.width);\n\n\t\t// only resize the height if aspect was specified instead of height\n\t\tif (opts.aspect) {\n\t\t base.height = base.width * opts.aspect;\n\t\t\tsvg.setAttributeNS(null, \"height\", base.height);\n\t\t}\n\n\t base.scale = base.width / base.original_width;\n\n\t\t// optional callback\n\t\tif (opts.onResize) {\n\t\t\topts.onResize(base.width, base.height, base.scale, svg);\n\t\t}\n\t}", "function handleResize() {\n console.log(\"handleresize\");\n d3.selectAll(\".step-details\").style(\"display\", \"none\");\n // 1. update height of step elements\n const baseStepHeight = Math.floor(window.innerHeight * 0.75);\n\n\n for (let s of step.nodes()) {\n const node = d3.select(s).select(\".entry-content\").node();\n const innerHeight = node ? node.offsetHeight + 100 : baseStepHeight;\n\n d3.select(s).style(\"height\", innerHeight + 'px');\n\n }\n\n // 2. update width/height of graphic element\n const bodyWidth = d3.select('body').node().offsetWidth;\n const textWidth = text.node().offsetWidth;\n\n var graphicWidth = bodyWidth - textWidth;\n\n graphic\n .style('width', graphicWidth + 'px')\n .style('height', window.innerHeight + 'px');\n\n const chartMargin = 32;\n const chartWidth = graphic.node().offsetWidth - chartMargin;\n\n chart\n .style('width', chartWidth + 'px')\n .style('height', Math.floor(window.innerHeight / 2) + 'px');\n\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n}", "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\twidth = $sel.node().offsetWidth - marginLeft - marginRight;\n\t\t\t\theight = $sel.node().offsetHeight - marginTop - marginBottom;\n\t\t\t\t$svgFront.at({\n\t\t\t\t\twidth: width + marginLeft + marginRight,\n\t\t\t\t\theight: height + marginTop + marginBottom\n\t\t\t\t});\n\n $svgBack.at({\n width: width + marginLeft + marginRight,\n height: height + marginTop + marginBottom\n });\n\n scale\n .domain([0, 29])\n .range([0, 280])\n\n\t\t\t\treturn Chart;\n\t\t\t}", "function resize(){\n\t\t\t\twidth = window.innerWidth, height = window.innerHeight;\n\t\t\t\tsvg.attr(\"width\", width).attr(\"height\", height);\n\t\t\t}", "function resize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width + margin.left + margin.right);\n\n // Width of appended group\n svg.attr(\"width\", width + margin.left + margin.right);\n\n\n // Axes\n // -------------------------\n\n // Horizontal range\n x.range([0, width]);\n\n // Horizontal axis\n svg.selectAll('.d3-axis-horizontal').call(xAxis);\n\n\n // Chart elements\n // -------------------------\n\n // Bar group\n svg.selectAll('.d3-bar').attr(\"transform\", function(d) { return \"translate(\" + x(d.x) + \",\" + y(d.y) + \")\"; });\n\n // Bar rect\n svg.selectAll('.d3-bar rect').attr(\"x\", 1).attr(\"width\", x(data[0].dx) - 3);\n\n // Bar text\n svg.selectAll('.d3-bar text').attr(\"x\", x(data[0].dx) / 2);\n }", "resize() {\n // defaults to grabbing dimensions from container element\n const w = $chart.node().offsetWidth;\n const h = $chart.node().offsetHeight;\n const factor = shouldShrink ? fraction : 1;\n mobile = w < BP;\n // marginLeft = Math.floor(\n // Chart.getDayCount() * MARGIN_FACTOR * w * factor\n // );\n // marginRight = marginLeft;\n\n width = w * factor - marginLeft - marginRight;\n height = h - marginTop - marginBottom;\n scaleX.range([0, width]);\n scaleY.range([height, 0]);\n\n $svg.style('margin-left', d3.format('%')(offset));\n return Chart;\n }", "resize() {\n let rect = d3.select(this.parentElement).node().getBoundingClientRect();\n this.width = rect.width;\n this.height = rect.height;\n\n this.svg.attr(\"width\", this.width).attr(\"height\", this.height);\n }", "function updateSize()\n{\n\ttry\n {\n $(svgParent).width($(\"#view\").width());\n viewWidth=$('#svg').width();\n viewHeight=$('#svg').height();\n updateViewBox();\n }\n catch(e)\n {\n\n }\n}", "function resize(what) {\n var width = parseInt(d3.select(divPanelTag).style(\"width\")) - margin * 3,\n height = parseInt(d3.select(divPanelTag).style(\"height\")) - margin * 2;\n\n /* Update the range of the scale with new width/height */\n xScale.range([0, width]);\n yScale.range([height, 0]);\n\n xAxis.ticks(Math.max(width / 50, 2));\n yAxis.ticks(Math.max(height / 50, 2));\n\n d3.selectAll(\".graph\").attr(\"height\", height + margin);\n d3.selectAll(\".graph\").attr(\"width\", width + (margin * 2));\n \n /* Update the axis with the new scale */\n graph.select(divPanelTag + ' .x.axis')\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n \n d3.select(divPanelTag + \" #xAxisTitle\")\n .attr(\"x\", width - 100);\n \n graph.select(divPanelTag + ' .y.axis')\n .call(yAxis);\n \n /* Force D3 to recalculate and update the line */\n graph.selectAll(divPanelTag + ' .line')\n .attr(\"d\", line);\n \n /* Force D3 to recalculate and update the area */\n graph.selectAll(divPanelTag + ' .area')\n .attr(\"d\", area);\n \n }", "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\tconst chartWidth = 225\n\t\t\t\tconst blocks = $sel.selectAll('.fit-brand')\n\t\t\t\t\t.st('width', chartWidth)\n\t\t\t\t\t.st('height', d3.round(chartWidth * 1.33, 0))\n\n\t\t\t\tblocks.selectAll('.display, .tooltip')\n\t\t\t\t\t.st('width', chartWidth)\n\t\t\t\t\t.st('height', d3.round(chartWidth * 1.33, 0))\n\n\t\t\t\twidth = 225//blocks.node().offsetWidth - marginLeft - marginRight;\n\t\t\t\theight = 175//(width) - marginTop - marginBottom//$sel.node().offsetHeight - marginTop - marginBottom;\n\n\t\t\t\t$svg.at({\n\t\t\t\t\twidth: width + marginLeft + marginRight,\n\t\t\t\t\theight: height + marginTop + marginBottom\n\t\t\t\t});\n\n\t\t\t\tscale\n\t\t\t\t\t.domain([0, 29])\n\t\t\t\t\t.range([0, height])\n\n\t\t\t\treturn Chart;\n\t\t\t}", "function resize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width + margin.left + margin.right);\n\n // Width of appended group\n svg.attr(\"width\", width + margin.left + margin.right);\n\n\n // Axes\n // -------------------------\n\n // Horizontal ranges\n x0.rangeRoundBands([0, width], .1);\n x1.rangeRoundBands([0, x0.rangeBand()]);\n\n // Horizontal axis\n svg.selectAll('.d3-axis-horizontal').call(xAxis);\n\n\n // Chart elements\n // -------------------------\n\n // Bar group\n svg.selectAll('.bar-group').attr(\"transform\", function(d) { return \"translate(\" + x0(d.State) + \",0)\"; });\n\n // Bars\n svg.selectAll('.d3-bar').attr(\"width\", x1.rangeBand()).attr(\"x\", function(d) { return x1(d.name); });\n\n // Legend\n svg.selectAll(\".d3-legend text\").attr(\"x\", width - 24);\n svg.selectAll(\".d3-legend rect\").attr(\"x\", width - 18);\n }", "function handleResize() {\n // 1. update height of step elements for breathing room between steps\n let stepHeight = Math.floor(window.innerHeight);\n step.style('height', stepHeight + 'px');\n\n // 2. update height of graphic element\n let bodyWidth = d3.select('body').node().offsetWidth;\n\n graphic\n .style('height', window.innerHeight + 'px');\n\n // 3. update width of chart by subtracting from text width\n let chartMargin = 0;\n let textWidth = text.node().offsetWidth;\n let chartWidth = graphic.node().offsetWidth - textWidth - chartMargin;\n // make the height 1/2 of viewport\n let chartHeight = 100;\n\n chart\n .style('width', chartWidth + 'px')\n .style('height', chartHeight + '%');\n\n // 4. tell scrollama to update new element dimensions\n scroller.resize();\n}", "_windowResizeEventListener() {\r\n // CLASS REFERENCE\r\n let that = this;\r\n\r\n // WINDOW - RESIZER LISTENER\r\n d3.select(window).on('resize.updatesvg', function () {\r\n let width = d3.select(\"#drawArea\").node().offsetWidth;\r\n let height = d3.select(\"#drawArea\").node().offsetHeight;\r\n \r\n // ? RESIZE SVG ON WINDOW SIZE CHANGE\r\n that.svg.attr('width',width).attr('height',height);\r\n that.attribute.setWidth(width)\r\n that.attribute.setHeight(height)\r\n\r\n // ? C A N V A S S I Z E\r\n that.canvasSize = {\r\n width: width,\r\n height: height,\r\n };\r\n\r\n // // RECT SIZE RESIZE \r\n // that.RECT_SIZE = {\r\n // x: Utility.centerOfCanvas(that.canvasSize, 3000).x,\r\n // y: Utility.centerOfCanvas(that.canvasSize, 3000).y,\r\n // width: 3000,\r\n // height: 3000\r\n // }\r\n\r\n // // RECT \r\n // that.rect.attr('x', that.RECT_SIZE.x).attr('y', that.RECT_SIZE.y);\r\n })\r\n }", "function onResize() {\n\t\t$log.log(preDebugMsg + \"onResize called\");\n\n\t\tvar windowWidth = $(window).width();\n\t\tvar windowHeight = $(window).height() - 100;\n\n\t\tvar dataLeft = 250;\n\t\tvar dataTop = 10;\n\t\tvar vizLeft = 5;\n\t\tvar vizTop = 105;\n\t\tif(windowHeight < windowWidth) {\n\t\t\tdataLeft = 5;\n\t\t\tdataTop = 105\n\t\t\tvizLeft = 250;\n\t\t\tvizTop = 10\n\t\t}\n\n\t\tvar fontSize = 11;\n\n\t\tif(loadedChildren[\"DigitalDashboardSmartDataSource\"].length > 0) {\n\t\t\tvar datasrc = $scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboardSmartDataSource\"][0]);\n\t\t\tdatasrc.scope().set(\"root:top\", dataTop);\n\t\t\tdatasrc.scope().set(\"root:left\", dataLeft);\n\t\t}\n\n\t\tif(loadedChildren[\"DigitalDashboardPlugin3DDensityPlotAdv\"].length > 0) {\n\t\t\tvar n = 256;\n\t\t\tvar cw = Math.max(1, Math.min(Math.ceil((windowWidth - vizLeft - 50) / 2 / (2*n)), Math.floor((windowHeight - vizTop - 60) / (2*n))));\n\t\t\tvar zoom = Math.max(200, Math.min(windowWidth - vizLeft - 2*cw * 256 - 50, windowHeight - vizTop - 60));\n\n\t\t\tvar viz = $scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboardPlugin3DDensityPlotAdv\"][0]);\n\t\t\tviz.scope().set(\"root:top\", vizTop);\n\t\t\tviz.scope().set(\"root:left\", vizLeft);\n\t\t\tviz.scope().set(\"DrawingArea:width\", cw * 256 * 2 + 20);\n\t\t\tviz.scope().set(\"DrawingArea:height\", cw * 256 * 2 + 20);\n\t\t\tviz.scope().set(\"CellWidth\", cw);\n\t\t\tviz.scope().set(\"ZoomSpace\", zoom);\n\n\t\t\t$log.log(preDebugMsg + \"viz moved and set to \" + vizTop + \" \" + vizLeft + \" \" + cw + \" \" + zoom);\n\t\t}\n\t}", "function resize() {\n // Redefine the displayWidth, height and leftTextY .\n displayWidth = parseInt(d3.select(\"#plotarea\").style(\"width\"));\n displayHeight = displayWidth - displayWidth / 3.9;\n leftTextY = (displayHeight + labelArea) / 2 - labelArea;\n\n // Apply the displayWidth and height to the svg canvas.\n graphImg.attr(\"width\", displayWidth).attr(\"height\", displayHeight);\n\n // Change the xScale and yScale ranges\n xScale.range([margin + labelArea, displayWidth - margin]);\n yScale.range([displayHeight - margin - labelArea, margin]);\n\n // With the scales changes, update the axes (and the height of the x-axis)\n graphImg\n .select(\".xAxis\")\n .call(xAxis)\n .attr(\n \"transform\",\n \"translate(0,\" + (displayHeight - margin - labelArea) + \")\"\n );\n\n graphImg.select(\".yAxis\").call(yAxis);\n\n // Update the ticks on each axis.\n tickCount();\n\n // Update the labels.\n xTextRefresh();\n yTextRefresh();\n\n // Update the radius of each dot.\n determineCircleRadius();\n\n // updating the location and radius of the state circles.\n d3.selectAll(\"circle\")\n .attr(\"cy\", function(d) {\n return yScale(d[yData]);\n })\n .attr(\"cx\", function(d) {\n return xScale(d[xData]);\n })\n .attr(\"r\", function() {\n return circleRad;\n });\n\n // We need change the location and size of the state texts, too.\n d3.selectAll(\".stateText\")\n .attr(\"dy\", function(d) {\n return yScale(d[yData]) + circleRad / 3;\n })\n .attr(\"dx\", function(d) {\n return xScale(d[xData]);\n })\n .attr(\"r\", circleRad / 3);\n }", "function responsiveUpdatedVariables(changingVar) {\n //define hight/width on resize\n var chartWidth = returnParentWidth(chartSvg),\n chartHeight = returnParentHeight(chartSvg)\n\n //Change attributes of chart itself on resize\n chartSvg\n // .transition()\n .attr('height', chartHeight)\n .attr('width', chartWidth)\n\n // Change overall xScale on resize\n xScale.range([0, chartWidth])\n\n yScale.range([chartHeight, 0])\n\n // Change circle width on resize\n circles\n .transition()\n .duration(300)\n .attr('cx',\n function(d) {\n return xScale(d[changingVar])\n })\n .attr('cy', function(d) { return yScale(d.value) })\n .attr('r', chartHeight/250)\n\n\n\n }", "function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tvar bgDirty = false;\n\t\tif(bgCanvas === null) {\n\t\t\tbgDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(bgCanvas.width != rw) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.width = rw;\n\t\t}\n\t\tif(bgCanvas.height != rh) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.height = rh;\n\t\t}\n\n\t\tvar plotDirty = false;\n\t\tif(plotCanvas === null) {\n\t\t\tplotDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#thePlotCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tplotCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(plotCanvas.width != rw) {\n\t\t\tplotDirty = true;\n\t\t\tplotCanvas.width = rw;\n\t\t}\n\t\tif(plotCanvas.height != rh) {\n\t\t\tplotDirty = true;\n\t\t\tplotCanvas.height = rh;\n\t\t}\n\n\t\tvar axesDirty = false;\n\t\tif(axesCanvas === null) {\n\t\t\taxesDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theAxesCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\taxesCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(axesCanvas.width != rw) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.width = rw;\n\t\t}\n\t\tif(axesCanvas.height != rh) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.height = rh;\n\t\t}\n\n\t\tif(dropCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDropCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdropCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t}\n\t\t}\n\t\tif(dropCanvas) {\n\t\t\tdropCanvas.width = rw;\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\t// $log.log(preDebugMsg + \"updateSize found selections: \" + JSON.stringify(selections));\n\t\t// $log.log(preDebugMsg + \"updateSize updated selections to: \" + JSON.stringify(selections));\n\t}", "calcDimensions () {\n let dayIndex = Math.round (\n (moment () - moment ().subtract (1, 'year').startOf ('week')) / 86400000\n );\n let colIndex = Math.trunc (dayIndex / 7);\n let numWeeks = colIndex + 1;\n\n this.settings.width = this.container.offsetWidth < 1000\n ? 1000\n : this.container.offsetWidth;\n this.settings.item_size =\n (this.settings.width - this.settings.label_padding) / numWeeks -\n this.settings.gutter;\n this.settings.height =\n this.settings.label_padding +\n 7 * (this.settings.item_size + this.settings.gutter);\n this.svg\n .attr ('width', this.settings.width)\n .attr ('height', this.settings.height);\n\n if (!!this.props.data && !!this.props.data[0].summary) {\n this.drawChart ();\n }\n }", "function resizeChart () {\n console.log('D3collisiondetectionController.resizeChart()');\n draw();\n }", "function setChartSize() {\n currentChart.destroy();\n setContainerSize();\n currentChart = getChartByChartNumber(chartNum);\n}", "function resizeVisualization() {\n oldWidth = width;\n oldHeight = height;\n width = document.getElementById('allFunerals').clientWidth - margin.left - margin.right,\n height = Math.min(700, window.innerHeight - 124);\n\n let newScale = (width * 1.0 / oldWidth);\n zoomScreenSizeMulti *= newScale;\n currentZoom.x *= newScale;\n currentZoom.y *= newScale;\n currentZoom.k *= newScale;\n\n d3.select(\"#allFunerals svg\")\n .attr(\"width\", width + margin.right + margin.left - 20)\n .attr(\"height\", height + margin.top + margin.bottom)\n\n setZoom();\n}", "resize(width, height) {\n d3.select(this.element).select(\"g\").attr(\"transform\", \"scale(\" + width / this.width + \",\" + height / this.height + \")\");\n this.width = width;\n this.height = height;\n }", "function resize() {\n const w = parseInt(container.offsetWidth);\n node.attr('width', w);\n node.attr('height', Math.round(w / aspect));\n }", "function resize4() {\n\n\t// Find the new window dimensions \n var width4 = parseInt(d3.select('#chart4').style('width')) - margin4.left - margin4.right,\n \theight4 = parseInt(d3.select('#chart4').style('height')) - margin4.top - margin4.bottom;\n\n\t// Radius details\n\tif (((width4 + margin4.left + margin4.right) <= 500) && ((height4 + margin4.top + margin4.bottom) <= 400)){\n\t\tradius4 = radiusValues4['Small'];\n\t\thoveredRadius4 = hoveredRadiusValues4['Small'];\n\t\tradiusBestSongs4 = radiusBestSongsValues4['Small'];\n\t\thoveredRadiusBestSongs4 = hoveredRadiusValues4['Small'];\n\t} \n\telse if(((width4 + margin4.left + margin4.right) >= 1500) && ((height4 + margin4.top + margin4.bottom) >= 700)){\n\t\tradiusBestSongs4 = radiusBestSongsValues4['Big'];\n\t\tradius4 = radiusValues4['Medium'];\n\t\thoveredRadius4 = hoveredRadiusValues4['Medium'];\n\t\thoveredRadiusBestSongs4 = hoveredRadiusValues4['Big'];\n\t} \n\telse {\n\t\tradius4 = radiusValues4['Medium'];\n\t\thoveredRadius4 = hoveredRadiusValues4['Medium'];\n\t\tradiusBestSongs4 = radiusBestSongsValues4['Medium'];\n\t\thoveredRadiusBestSongs4 = hoveredRadiusValues4['Medium'];\n\t} \n\n\n\t// Update the range of the scales with new width/height\n\txScale4.range([0, width4]);\n\tyScale4.range([height4, 0]);\n\n\t// Update all the existing elements (gridlines, axis text, circles)\n\tgridXAxis4.scale(xScale4);\n\tgridYAxis4.scale(yScale4);\n\n\tcontainer4.select('#gridY')\n\t\t\t.attr('transform', 'translate(0, '+height4+')')\n\t\t\t.call(gridXAxis4.tickSize(-height4 - 15, 0, 0));\n\n\tcontainer4.select('#gridX')\n\t\t\t.call(gridYAxis4.tickSize(-width4, 0, 0));\n\n\tcontainer4.select('.x.label')\n\t .attr('x', width4)\n\t .attr('y', height4 + 30);\n\n\tcontainer4.selectAll('circle')\n\t\t.attr('cx', function(d) {return xScale4(d['Valence']);})\n\t\t.attr('cy', function(d) {return yScale4(d['Energy']);})\n\t\t.attr('r', radius4); \n\n\tcontainer4.select('.bestSongsCircles').selectAll('circle')\n\t\t.attr('cx', function(d) {return xScale4(d['Valence']);})\n\t\t.attr('cy', function(d) {return yScale4(d['Energy']);})\n\t\t.attr('r', radiusBestSongs4);\n\n\tvar mean_x = d3.mean(dataset4, function(d) { return +d['Valence']});\n\tvar mean_y = d3.mean(dataset4, function(d) { return +d['Energy']});\t\n\n\tcontainer4.select('#mean_x_all')\n\t \t.attr('x1', function() { return xScale4(mean_x); })\n\t \t.attr('y1', function() { return yScale4(-0.01); })\n\t \t.attr('x2', function() { return xScale4(mean_x); })\n\t \t.attr('y2', function() { return yScale4(1.01); });\n\n\tcontainer4.select('#mean_y_all')\n \t.attr('x1', function() { return xScale4(-0.01); })\n \t.attr('y1', function() { return yScale4(mean_y); })\n \t.attr('x2', function() { return xScale4(1.01); })\n \t.attr('y2', function() { return yScale4(mean_y); });\n\n\tfor(var decade in decadeData){\n\t\tmean_x = d3.mean(decadeData[decade], function(d) { return +d['Valence']});\n\t\tmean_y = d3.mean(decadeData[decade], function(d) { return +d['Energy']});\n\n\t\tcontainer4.select('#mean_x' + decade)\n\t \t.attr('x1', function() { return xScale4(mean_x); })\n\t \t.attr('y1', function() { return yScale4(-0.01); })\n\t \t.attr('x2', function() { return xScale4(mean_x); })\n\t \t.attr('y2', function() { return yScale4(1.01); });\n\n\t\tcontainer4.select('#mean_y' + decade)\n\t \t.attr('x1', function() { return xScale4(-0.01); })\n\t \t.attr('y1', function() { return yScale4(mean_y); })\n\t \t.attr('x2', function() { return xScale4(1.01); })\n\t \t.attr('y2', function() { return yScale4(mean_y); });\n\t}\n\n}", "function handleResize() {\r\n\t\t\t// 1. update height of step elements\r\n\t\t\tvar stepHeight = Math.floor(window.innerHeight * 0.75);\r\n\t\t\t\r\n\r\n\t\t\t// 2. update width/height of graphic element\r\n\t\t\tvar bodyWidth = d3.select('body').node().offsetWidth;\r\n\r\n\t\t\tvar graphicMargin = 16 * 4;\r\n\t\t\tvar textWidth = text.node().offsetWidth;\r\n\t\t\tvar graphicWidth = container.node().offsetWidth - textWidth - graphicMargin;\r\n\t\t\tvar graphicHeight = Math.floor(window.innerHeight/2)\r\n\t\t\tvar graphicMarginTop = Math.floor(graphicHeight/2)\r\n\r\n\t\t\tgraphic\r\n\t\t\t\t.style('width', '100%')\r\n\t\t\t\t .style('height', '100%')\r\n\t\t\t\t.style('top', graphicMarginTop + 'px');\r\n\r\n\r\n\t\t\t// 3. tell scrollama to update new element dimensions\r\n\t\t\tscroller.resize();\r\n\t\t}", "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 redraw(){\n var windowWidth = window.innerWidth > minWidth ? window.innerWidth : minWidth;\n var windowHeight = window.innerHeight > minHeight ? window.innerHeight : minHeight;\n\n container.attr(\"width\", `${windowWidth * .90}px`);\n container.attr(\"height\", `${windowHeight * .85}px`);\n\n svg_width = parseInt(container.style(\"width\")); // Width of svg (90% of screenWidth)\n svg_height = parseInt(container.style(\"height\")); // Height of svg (85% of screen)\n\n top_width = (svg_width - margin.left - margin.right - innerPadding * 2) / 3\n top_height = svg_height - margin.top - margin.bottom;\n\n // -------------------------------------- Resize all drawings to the new sizes -----------------------------\n containerBorder.attr(\"width\", `${windowWidth * .90}px`);\n containerBorder.attr(\"height\", `${windowHeight * .85}px`);\n\n chartWidth = top_width - margin.left - margin.right; // Adding margins for chart\n\n var mapTitleHeight = top_height * .25; // 25% of the space\n var mapTitlePadding = top_height * .02; // 2% padding\n var mapHeight = top_height * .73; // 73% of the space\n\n map\n .attr('width', top_width)\n .attr('height', top_height)\n\n demographics\n .attr('width', top_width)\n .attr('x', margin.left + top_width + innerPadding)\n .attr('y', margin.top + 40) \n\n demographicLabels\n .attr('width', top_width)\n .attr('x', margin.left + top_width * 2 + innerPadding * 2)\n .attr('y', margin.top + 40) \n\n demographicTitleSvg\n .attr('width', top_width)\n .attr('x', margin.left + top_width + innerPadding)\n .attr('y', 0) \n\n demographicLabelsTitleSvg\n .attr('width', top_width)\n .attr('x', margin.left + top_width * 2 + innerPadding * 2)\n .attr('y', 0) \n\n demoTitle\n .attr(\"x\", (top_width + margin.left) / 2)\n\n demoLabelsTitle\n .attr(\"x\", top_width / 2)\n\n clinicalTitle\n .attr(\"x\", top_width / 2)\n\n pathologicalTitle\n .attr(\"x\", top_width / 2)\n\n\n map\n .select(\"#mapLegend\")\n .attr('width', top_width)\n\n // Generate new projection\n projection = d3.geoMercator().fitSize([top_width, mapHeight], geojson)\n map\n .select(\"#mapImage\")\n .attr('width', top_width)\n .attr('height', top_height) \n .attr('x', 0)\n .attr('y', mapTitleHeight + mapTitlePadding) \n .selectAll(\"path\")\n .attr(\"id\", function(d, i) {\n return String(\"zip\" + d.properties.zip);\n })\n .attr(\"d\", d3.geoPath(projection));\n\n \n // Edit the stacked bar charts\n\n // Scale for x direction stacked bars\n xAxisScale = d3\n .scaleLinear()\n .range([margin.left, chartWidth]);\n\n demographics\n .selectAll(\"rect\")\n .attr(\"x\", function(data, index) {\n return xAxisScale(data[0][0]);\n }) \n .attr(\"width\", function(data, index) {\n return xAxisScale(data[0][1]) - xAxisScale(data[0][0]);\n })\n \n xAxis = d3\n .axisTop()\n .scale(xAxisScale)\n .ticks(10, \"%\"); \n\n demographics \n .select(\"g.xAxis\").call(xAxis);\n\n // Scale for labels\n xBarLabelScale = d3\n .scaleBand()\n .domain(stackedBarDomain)\n .range([0, chartWidth])\n .paddingInner(0.05);\n\n for (var i = 0; i < stackedBarDomain.length; i++) {\n demographicLabels\n .select(`g.${stackedBarDomain[i]}legend`) \n .attr(\"transform\", `translate(${margin.left + xBarLabelScale.step() * i},${margin.top})`);\n }\n\n // Edit the rating scales\n for(var i = 0; i < ratingScaleDomain_C.length; i++){\n xRatingScale = d3\n .scalePoint()\n .domain(Object.keys(populationData[ratingScaleDomain_C[i]]))\n .range([0, chartWidth]);\n\n xAxis = d3\n .axisBottom()\n .scale(xRatingScale)\n .tickPadding(15);\n\n demographics\n .select(`.${ratingScaleDomain_C[i]}xAxis`)\n .call(xAxis); \n\n demographics\n .select(`g.g${ratingScaleDomain_C[i]}`)\n .selectAll(\"circle\")\n .attr(\"cx\", function(data, index) {\n return xRatingScale(data);\n }) \n }\n for(var i = 0; i < ratingScaleDomain_P.length; i++){\n xRatingScale = d3\n .scalePoint()\n .domain(Object.keys(populationData[ratingScaleDomain_P[i]]))\n .range([0, chartWidth]);\n\n xAxis = d3\n .axisBottom()\n .scale(xRatingScale)\n .tickPadding(15);\n\n demographicLabels\n .select(`.${ratingScaleDomain_P[i]}xAxis`)\n .call(xAxis); \n\n demographicLabels\n .select(`g.g${ratingScaleDomain_P[i]}`)\n .selectAll(\"circle\")\n .attr(\"cx\", function(data, index) {\n return xRatingScale(data);\n }) \n }\n\n}", "resize() {\n\t\t/* Update width and height just incase canvas size has changed */\n \tthis.menuWidth = $(\"#pixel-analysis-menu\").width();\n \tthis.menuHeight = $(\"#pixel-analysis-menu\").height();\n\t\tthis.menuSVG.attr(\"width\", this.menuWidth)\n\t\t\t\t\t\t.attr(\"height\", this.menuHeight);\n\n\t\tif (this.checkpoint == 0) {\n\t\t\tthis.rayTreeView.resize();\n\t\t\tthis.parallelBarView.resize();\n\t\t} else if (this.checkpoint = 1) {\n\t\t\tthis.parallelBarView.resize();\n\t\t\t\n\t\t\tthis.rayTreeView.resize();\n\t\t}\n\t\t\t\t\t\t\n\t\tthis.update()\n\t}", "function resize() {\n width = $(\"body\").width() - 100;\n d3.select('svg').attr('width', $(\"body\").width() - 50);\n x.range([0, width - margin.left - margin.right]);\n render(data);\n }", "function changesize(h,sq,intv,tm) {\n chartx.chart.height = h ;\n standWD(sq) ;\n initChart(sq,intv,tm) ;\n\n // setTimeout( chart.setSize(null,h) ,500);\n}", "function resizeChart() {\n winW = $(window).width();\n if(winW > 1023){\n chartSize = parseInt(winW)*0.60;\n } else {\n chartSize = parseInt(winW)*0.94;\n }\n $('#chart').width(chartSize);\n $('#chart').height(chartSize);\n $('#chart').css('visibility', 'visible');\n}", "$_keepAspectRatio() {\n if (this.aspectRatio) {\n // this.chartInstance.$el.style.height = 'auto';\n\n this.$_resizeHandler = debounce(() => {\n // this.$_resize();\n const width = this.chartInstance.width;\n const height = this.chartInstance.width / this.aspectRatio;\n\n this.$_resize({\n height,\n });\n\n setTimeout(() => {\n this.$emit('size-change', {\n width,\n height,\n });\n }, 100);\n }, 150);\n addListener(this.chartInstance.$el, this.$_resizeHandler);\n\n this.$_resizeHandler();\n }\n }", "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\twidth = $sel.node().offsetWidth - marginLeft - marginRight;\n\t\t\t\theight = $sel.node().offsetHeight - marginTop - marginBottom;\n\t\t\t\t$svg\n\t\t\t\t\t.attr('width', width + marginLeft + marginRight)\n\t\t\t\t\t.attr('height', height + marginTop + marginBottom);\n\n\t\t\t\tgetTicks(width)\n\n\t\t\t\txScale\n\t\t\t\t\t.domain([minX, maxX])\n\t\t\t\t\t.range([0, width])\n\n\t\t\t\tyScale\n\t\t\t\t\t.domain([0, maxY])\n\t\t\t\t\t.range([height, 0])\n\n\t\t\t\txAxis = d3\n\t\t\t\t\t.axisBottom(xScale)\n\t\t\t\t\t.tickPadding(axisPadding)\n\t\t\t\t\t.ticks(numTicks)\n\t\t\t\t\t.tickFormat(d3.format('d'))\n\n\t\t\t\tyAxis = d3\n\t\t\t\t\t.axisLeft(yScale)\n\t\t\t\t\t.tickPadding(axisPadding)\n\t\t\t\t\t.tickSize(-width)\n\t\t\t\t\t.ticks(8)\n\n\t\t\t\t$axis.select('.x')\n\t\t\t\t\t.attr('transform', `translate(${marginLeft},${height - marginBottom + axisPadding})`)\n\t\t\t\t\t.call(xAxis);\n\n\t\t\t\t$axis.select('.x.axis .tick text').attr('transform', `translate(20,0)`)\n\n\t\t\t\t$axis.select('.y')\n\t\t\t\t\t.attr('transform', `translate(${marginLeft},0)`)\n\t\t\t\t\t.call(yAxis);\n\n\t\t\t\tgenderLines = d3.line()\n\t\t\t\t\t.x(d => xScale(d.year))\n\t\t\t\t\t.y(d => yScale(d.smoothed))\n\n\t\t\t\tmaleLine\n\t\t\t\t\t.attr('d', genderLines)\n\n\t\t\t\tfemaleLine\n\t\t\t\t\t.attr('d', genderLines)\n\n\t\t\t\tgenderArea = d3.area()\n\t\t\t\t\t.x(d => xScale(d.key))\n\t\t\t\t\t.y0(d => yScale(d.value.female))\n\t\t\t\t\t.y1(d => yScale(d.value.male))\n\n\t\t\t\tdrawArea.attr('d', genderArea)\n\n\t\t\t\t$svg\n\t\t\t\t\t.on('mousemove', lineMouseMove)\n\t\t\t\t\t.on('mouseover', lineMouseMove)\n\t\t\t\t\t.on('mouseout', lineMouseOut)\n\n\t\t\t\t$fLabel\n\t\t\t\t\t.attr('x', width)\n\t\t\t\t\t.attr('y', 30)\n\n\t\t\t\t$mLabel\n\t\t\t\t\t.attr('x', 0)\n\t\t\t\t\t.attr('y', height/1.5)\n\n\t\t\t\t$biggerLabelGroup.attr('transform', `translate(0,${axisPadding*1.5})`)\n\t\t\t\t$biggerLabel.attr('transform', `translate(25,0)`)\n\t\t\t\t$upArrow.attr('transform', `translate(0,-15)`)\n\n\t\t\t\t$smallerLabelGroup.attr('transform', `translate(0,${height - axisPadding/2})`)\n\t\t\t\t$smallerLabel.attr('transform', `translate(25,0)`)\n\t\t\t\t$downArrow.attr('transform', `translate(0,-15)`)\n\n\t\t\t\treturn Chart;\n\t\t\t}", "function handleResize() {\n\t\t// 1. update height of step elements\n\t\tvar stepHeight = Math.floor(window.innerHeight * 0.35);\n\t\tstep.style('height', stepHeight + 'px');\n\t\t// 2. update width/height of graphic element\n\t\tvar bodyWidth = d3.select('body').node().offsetWidth;\n\t\tvar graphicMargin = 16 * 4;\n\t\tvar textWidth = text.node().offsetWidth;\n\t\tvar graphicWidth = container.node().offsetWidth; // - textWidth - graphicMargin;\n\t\tvar graphicHeight = Math.floor(window.innerHeight * 0.5);\n\t\tvar graphicMarginTop = Math.floor(graphicHeight / 2);\n\t\tgraphic\n\t\t\t.style('width', graphicWidth + 'px')\n\t\t\t.style('height', graphicHeight + 'px');\n\t\t// 3. tell scrollama to update new element dimensions\n\t\tscroller.resize();\n\t}", "function resize() { \n\t\t\tconsole.log(\"resizing base\");\n\t\t\tbase.width = parent.clientWidth;\n\t\t\tsvg.setAttributeNS(null, \"width\", base.width);\n\n\t\t\t// only resize the height if aspect was specified instead of height\n\t\t\tif (opts.aspect) {\n\t\t\t base.height = base.width * opts.aspect;\n\t\t\t\tsvg.setAttributeNS(null, \"height\", base.height);\n\t\t\t}\n\n\t\t base.scale = base.width / base.original_width;\n\n\t\t\t// optional callback\n\t\t\tif (opts.onResize) {\n\t\t\t\topts.onResize(base.width, base.height, base.scale);\n\t\t\t}\n\t\t}", "resize() {\n var factor = 1; //multiply by one - so no resizing \n this.selected = !this.selected;\n if(this.selected) { //make the graph big\n //increase the size\n this.width = this.width*factor;\n this.height = this.height *factor;\n this.colour = this.selectedColour;\n //reposition\n // this.x = this.x - this.width/4;\n // this.y = this.y - this.height /4;\n } else { //make it small\n //reposition\n // this.x = this.x + this.width/4;\n // this.y = this.y + this.height /4;\n //double the size\n this.width = this.width/factor;\n this.height = this.height /factor;\n this.colour = this.idleColour;\n }\n }", "calculateSize(){\n const { width: staticWidth, height: staticHeight } = this._options\n let { options } = this\n\n const elem = d3.select(options.target).node()\n\n // set width\n options.width = staticWidth || elem.clientWidth || 400\n\n // set height\n options.height = staticHeight || elem.clientHeight || 350\n\n // calculate width and height without margins\n const { width, height, margin } = options\n options.w = width - margin.left - margin.right\n options.h = height - margin.top - margin.bottom\n }", "calculateSize(){\n const { width: staticWidth, height: staticHeight } = this._options\n let { options } = this\n\n const elem = d3.select(options.target).node()\n\n // set width\n options.width = staticWidth || elem.clientWidth || 400\n\n // set height\n options.height = staticHeight || elem.clientHeight || 350\n\n // calculate width and height without margins\n const { width, height, margin } = options\n options.w = width - margin.left - margin.right\n options.h = height - margin.top - margin.bottom\n }", "function resize() {\n width = parseInt(d3.select('#viz').style('width'));\n width = width - margin.left - margin.right;\n height = width * mapRatio;\n\n // update projection\n projection.translate([width / 2, height / 2])\n .center(ca_center)\n .scale(width * [mapRatio + mapRatioAdjuster]);\n\n // resize map container\n svg.style('width', width + 'px')\n .style('height', height + 'px');\n\n // resize map\n svg.selectAll(\"path\").attr('d', path);\n}", "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\tif (data.location === 'Maine'){\n \t\t\t\twidth = $sel.node().offsetWidth\n \t\t\t\t$sel.style('height', `${width * 0.7}px`)\n\t\t\t\t} else {\n\t\t\t\t\twidth = d3.select('.block-Maine').node().offsetWidth\n\t\t\t\t\t$sel.style('height', `${width * 0.7}px`)\n\t\t\t\t}\n\n\t\t\t\tconst windowWidth = window.innerWidth\n\t\t\t\tisMobile = windowWidth <= 600\n\t\t\t\tfactor = isMobile === true ? 20 : 4\n\n\t\t\t\t$legendScale.text(`${factor}`)\n\n\t\t\t\t// container height should be height - text height\n\t\t\t\tcontainerHeight = (width * 0.7) - textHeight\n\n\t\t\t\t// resize entire bounding chart once\n\t\t\t\tif (data.location === 'Florida') {\n\t\t\t\t\tconst $figure = d3.select('.movement-figure')\n\t\t\t\t\tconst $bound = $figure.select('.figure-container')\n\t\t\t\t\t\t.style('height', `${width * 8}px`)\n\t\t\t\t}\n\n\n\n\t\t\t\tconst $imports = $sel.select('.container-imports')\n\t\t\t\tconst $exports = $sel.select('.container-exports')\n\n\t\t\t\t// if the blocks have already been drawn\n\t\t\t\tif (rendered && data.location !== 'blank') {\n\t\t\t\t\t// console.log({factor})\n\t\t\t\t\t// addDogBlocks({$imports, $exports, factor})\n\t\t\t\t\t$imports.selectAll('.import')\n\t\t\t\t\t\t.data(d3.range(data.count.imported / factor))\n\t\t\t\t\t\t.join(update => {\n\t\t\t\t\t\t\tupdate.append('div')\n\t\t\t\t\t\t\t\t.attr('class', 'export')\n\t\t\t\t\t\t\t\t.style('background-color', 'red')\n\t\t\t\t\t\t})\n\n\t\t\t\t\t$exports.selectAll('.export')\n\t\t\t\t\t\t.data(d3.range(data.count.exported / factor))\n\t\t\t\t\t\t.join(update => {\n\t\t\t\t\t\t\tupdate.append('div')\n\t\t\t\t\t\t\t\t.attr('class', 'export')\n\t\t\t\t\t\t})\n\n\t\t\t\t}\n\n\t\t\t\treturn Chart;\n\t\t\t}", "function resizeGraph() {\n\t\n\tw = document.getElementById(\"graph\").offsetWidth - MARGIN.left - MARGIN.right;\n\th = w - 200 - MARGIN.top - MARGIN.bottom;\n\t\n\t// check to see if width or height exceeded dimension limits\n\tif(w < WIDTH.min) { w = WIDTH.min; }\n\tif( h > HEIGHT.max )\t { h = HEIGHT.max;} \n\telse if( h < HEIGHT.min) { h = HEIGHT.min;}\n\t\n\tif(w < 300) { X_TICKS_DEFAULT = 3; }\n\telse \t\t{ X_TICKS_DEFAULT = 5; }\n\t\n\tsvg.transition()\n\t\t\t\t .attr(\"height\", MARGIN.top + h + MARGIN.bottom)\n\t\t\t\t .attr(\"width\", MARGIN.left + w + MARGIN.right )\n\t\t\t\t .attr(\"transform\", \"translate(\" + (MARGIN.left).toString() + \",\" + (MARGIN.top).toString() + \")\");\n\t\n\tpathContainer.transition()\n\t\t\t.attr(\"height\", h)\n\t\t\t.attr(\"width\", w);\n\t\n\tvar maxIndex = symptomInfoStack.length - 1;\n\t\t\n\t// X & Y SCALE\t\t\t\t \n\tupdateScales(symptomInfoStack[ maxIndex ].maxValue);\n\t\t\n\t// SCALE LINES\n\tscaleLines();\n\t\t\n\t// X & Y GRIDS \n\tupdateGrids(symptomInfoStack[ maxIndex ].maxValue);\n\t\n\t// X & Y AXIS\n\tupdateAxes(symptomInfoStack[ maxIndex ].maxValue);\n}", "function resizeView(){\n\n width = window.innerWidth;\n height = window.innerHeight;\n\n console.log(width, height);\n\n canvas.clientWidth = width;\n canvas.clientHeight = height;\n\n d3.select('#fpsvgbkgrd').attr('width',width).attr('height',height);\n d3.select('#fpbkgrd').attr('width',width).attr('height',height);\n //svg.clientWidth = width;\n //svg.clientHeight = height;\n\n resetScales();\n\n}", "resize() {\n if (!this.canvasContainer) return;\n var containerWidth = this.canvasContainer.offsetWidth;\n var containerHeight = this.canvasContainer.offsetHeight;\n\n if (this._renderMode === 'svg' && this._svgCanvas) {\n this.paper.view.viewSize.width = containerWidth;\n this.paper.view.viewSize.height = containerHeight;\n } else if (this._renderMode === 'webgl' && this._webGLCanvas) {\n this._pixiApp.renderer.resize(containerWidth, containerHeight);\n }\n }", "function scaleGraph() {\n var aspect = width / height;\n var targetWidth = chart.parent().width();\n var targetHeight = chart.parent().height();\n console.log('width: ' + targetWidth);\n console.log('height: ' + targetHeight);\n chart.attr(\"width\", targetWidth + \"px\");\n chart.attr(\"height\", targetHeight + \"px\");\n }", "function onWindowResize() {\n updateSizes();\n }", "function resizeEvent() {\n var width = window.innerWidth, height = window.innerHeight;\n var functionsBarHeight = height/10;\n height = height * 9 / 10;\n\n w=width; h = height;\n\n node.attr(\"r\", nodeR(width, height));\n functionBar.attr(\"width\", width).attr(\"height\", functionsBarHeight).style(\"top\",height + \"px\");\n svg.attr(\"width\", width).attr(\"height\", height);\n\n label.attr(\"dx\", nodeR(width,height)*1.3)\n .attr(\"font-size\", 5*Math.sqrt(nodeR(width,height)));\n\n force.stop();\n force.size([width, height])\n .linkDistance(linkD(width, height))\n .start();\n\n btngrp.style(\"top\", (parseInt(functionBar.style(\"height\")) - parseInt(btngrp.style(\"height\")))/2+\"px\");\n }", "onCustomWidgetResize(_width, _height){\r\n\t\t\t\r\n\t\t\tthis.wdth = _width;\r\n\t\t\tthis.hght = _height;\r\n\t\t\t//dispatching new custom event to capture width & height changes\r\n\t\t\tthis.dispatchEvent(new CustomEvent(\"propertiesChanged\", {\r\n\t\t\t\t\tdetail: {\r\n\t\t\t\t\t\tproperties: {\r\n\t\t\t\t\t\t\tchWidth: this.chWidth,\r\n\t\t\t\t\t\t\tchHeight: this.chHeight\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}));\r\n\t\t\t\r\n\t\t\td3.select(this.shadowRoot).select(\"svg\").remove();\r\n\t\t\tthis.redraw();\r\n\t\t}", "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\twidth = $sel.node().offsetWidth - marginLeft - marginRight;\n\t\t\t\theight = $sel.node().offsetHeight - marginTop - marginBottom;\n\n scaleX\n .range([0, 110])\n .domain([0, 8.2])\n\n\t\t\t\treturn Chart;\n\t\t\t}", "function setSize() {\n if ($(document).width() > 1700) {\n //line chart\n position = 'right';\n $('#agree-poll-chart-canvas').attr('width', 750);\n $('#agree-poll-chart-canvas').attr('height', 280);\n\n $('#index-csi-chart-canvas').attr('width', 220);\n $('#index-csi-chart-canvas').attr('height', 220);\n\n $('#manager-chart-canvas').attr('width', 220);\n $('#manager-chart-canvas').attr('height', 220); \n\n $('#alert-statistic-chart-canvas').attr('width', 1200 );\n $('#alert-statistic-chart-canvas').attr('height', 450 );\n }\n else if ($(document).width() > 1600) {\n position = 'right';\n $('#agree-poll-chart-canvas').attr('width', 650);\n $('#agree-poll-chart-canvas').attr('height', 280);\n\n $('#index-csi-chart-canvas').attr('width', 210);\n $('#index-csi-chart-canvas').attr('height', 210);\n\n \n $('#manager-chart-canvas').attr('width', 210);\n $('#manager-chart-canvas').attr('height', 210); \n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 305 ); \n }\n else if ($(document).width() > 1500) {\n position = 'right';\n $('#agree-poll-chart-canvas').attr('width', 550);\n $('#agree-poll-chart-canvas').attr('height', 280);\n\n $('#index-csi-chart-canvas').attr('width', 210);\n $('#index-csi-chart-canvas').attr('height', 210);\n\n \n $('#manager-chart-canvas').attr('width', 210);\n $('#manager-chart-canvas').attr('height', 210); \n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 320 ); \n }\n else if ($(document).width() > 1400) {\n position = 'right';\n $('#agree-poll-chart-canvas').attr('width', 550);\n $('#agree-poll-chart-canvas').attr('height', 280);\n\n\n $('#index-csi-chart-canvas').attr('width', 210);\n $('#index-csi-chart-canvas').attr('height', 210);\n \n $('#manager-chart-canvas').attr('width', 210);\n $('#manager-chart-canvas').attr('height', 210); \n $('#alert-statistic-chart-canvas').attr('width', 800);\n $('#alert-statistic-chart-canvas').attr('height', 350); \n }\n else if ($(document).width() > 1350) {\n position = 'right';\n $('#agree-poll-chart-canvas').attr('width', 400);\n $('#agree-poll-chart-canvas').attr('height', 200);\n\n\n $('#index-csi-chart-canvas').attr('width', 200);\n $('#index-csi-chart-canvas').attr('height', 200);\n\n \n $('#manager-chart-canvas').attr('width', 200);\n $('#manager-chart-canvas').attr('height', 200); \n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 300 ); \n }\n else if ($(document).width() > 1300) {\n position = 'bottom';\n $('#agree-poll-chart-canvas').attr('width', 380);\n $('#agree-poll-chart-canvas').attr('height', 200);\n\n $('#index-csi-chart-canvas').attr('width', 200);\n $('#index-csi-chart-canvas').attr('height', 200);\n\n \n $('#manager-chart-canvas').attr('width', 200);\n $('#manager-chart-canvas').attr('height', 200); \n \n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 400 );\n }\n else if ($(document).width() > 1200) {\n position = 'bottom';\n $('#agree-poll-chart-canvas').attr('width', 350);\n $('#agree-poll-chart-canvas').attr('height', 200);\n\n\n $('#index-csi-chart-canvas').attr('width', 200);\n $('#index-csi-chart-canvas').attr('height', 200);\n\n \n $('#manager-chart-canvas').attr('width', 200);\n $('#manager-chart-canvas').attr('height', 200); \n \n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 500 );\n }\n else if ($(document).width() > 1000) {\n position = 'bottom';\n $('#agree-poll-chart-canvas').attr('width', 300);\n $('#agree-poll-chart-canvas').attr('height', 200);\n\n $('#index-csi-chart-canvas').attr('width', 200);\n $('#index-csi-chart-canvas').attr('height', 200);\n $('#manager-chart-canvas').attr('width', 200);\n $('#manager-chart-canvas').attr('height', 200);\n\n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 500 );\n\n }\n else if ($(document).width() > 767) {\n position = 'bottom';\n $('#agree-poll-chart-canvas').attr('width', 350);\n $('#agree-poll-chart-canvas').attr('height', 350);\n\n $('#index-csi-chart-canvas').attr('width', 150);\n $('#index-csi-chart-canvas').attr('height', 150);\n\n $('#manager-chart-canvas').attr('width', 150);\n $('#manager-chart-canvas').attr('height', 150);\n\n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 600 );\n\n }\n else if ($(document).width() > 600) {\n position = 'bottom';\n $('#agree-poll-chart-canvas').attr('width', 300);\n $('#agree-poll-chart-canvas').attr('height', 200);\n\n $('#index-csi-chart-canvas').attr('width', 200);\n $('#index-csi-chart-canvas').attr('height', 200);\n\n $('#manager-chart-canvas').attr('width', 200);\n $('#manager-chart-canvas').attr('height', 200);\n\n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 380 );\n }\n else if ($(document).width() < 600) {\n position = 'bottom';\n $('#agree-poll-chart-canvas').attr('width', 300);\n $('#agree-poll-chart-canvas').attr('height', 200);\n\n $('#index-csi-chart-canvas').attr('width', 200);\n $('#index-csi-chart-canvas').attr('height', 200);\n\n $('#manager-chart-canvas').attr('width', 200);\n $('#manager-chart-canvas').attr('height', 200);\n\n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 440 );\n\n }\n else {\n position = 'bottom';\n $('#agree-poll-chart-canvas').attr('width', 300);\n $('#agree-poll-chart-canvas').attr('height', 200);\n\n $('#index-csi-chart-canvas').attr('width', 200);\n $('#index-csi-chart-canvas').attr('height', 200);\n\n $('#manager-chart-canvas').attr('width', 200);\n $('#manager-chart-canvas').attr('height', 200);\n\n $('#alert-statistic-chart-canvas').attr('width', 800 );\n $('#alert-statistic-chart-canvas').attr('height', 280 );\n\n }\n\n} // add media sizes", "function setResponsiveSVG(chart) {\n let width = +chart.select('svg').attr('width');\n let height = +chart.select('svg').attr('height');\n let calcString = +(height / width) * 100 + \"%\";\n\n let svgElement = chart.select('svg');\n let svgParent = d3.select(chart.select('svg').node().parentNode);\n \n svgElement.attr({\n 'class':'scaling-svg',\n 'preserveAspectRatio':'xMinYMin',\n 'viewBox':'0 0 ' + width + ' ' + height,\n 'width':null,\n 'height':null\n });\n \n svgParent.style('padding-bottom',calcString);\n}", "onCustomWidgetResize(width, height){\n this.redraw();\n }", "function resize() {\n width = window.innerWidth*.8, height = window.innerHeight*.9;\n svg.attr(\"width\", width).attr(\"height\", height);\n force.size([width, height]).resume();\n node = svg.selectAll(\".node\")\n }", "function resize() {\n getNewSize();\n rmPaint();\n}", "function ResizeGraph() {\n\n}", "function resize(){\n dc.renderAll()\n }", "setChartDimension(){\n // SVG element\n this.svg\n .attr(\"viewBox\", `0 0 ${this.cfg.width+this.cfg.margin.left+this.cfg.margin.right} ${this.cfg.height+this.cfg.margin.top+this.cfg.margin.bottom}`)\n .attr(\"width\", this.cfg.width + this.cfg.margin.left + this.cfg.margin.right)\n .attr(\"height\", this.cfg.height + this.cfg.margin.top + this.cfg.margin.bottom);\n \n // Center element\n this.gcenter\n .attr('transform', `translate(${this.cfg.width/2}, ${this.cfg.height/2})`);\n }", "function resize() {\n\n\t var width = $(self.scatterEl).width() - self.margin.left - self.margin.right,\n\t \t\theight = $(self.scatterEl).height() - self.margin.top - self.margin.bottom;\n\n\t \tself.height = height;\n\t\tself.width = width;\n\n\t \tself.scatter_svg.select(\"#clip\").selectAll(\"rect\")\n\t \t\t.attr(\"width\", width)\n\t .attr(\"height\", (height-self.margin.bottom));\n\n\t \t// Update zoom and pan handles size\n\t\tself.scatter_svg.select('rect.zoom.xy.box')\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", height-self.margin.bottom);\n\n\t\tself.scatter_svg.select('rect.zoom.x.box')\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", self.margin.bottom)\n\t\t\t.attr(\"transform\", \"translate(\" + 0 + \",\" + (height - self.margin.bottom) + \")\");\n\n\t\tself.scatter_svg.select('rect.zoom.y.box')\n\t\t\t.attr(\"width\", self.margin.left)\n\t\t\t.attr(\"height\", height - self.margin.bottom);\n\n\t\tself.scatter_svg.select('rect.zoom.y2.box')\n\t\t\t.attr(\"width\", self.margin.left)\n\t\t\t.attr(\"height\", height - self.margin.bottom)\n\t\t\t.attr(\"transform\", \"translate(\" + width + \",0)\");\n\n\t\tself.scatter_svg.select('.y2.axis')\n\t\t\t.attr(\"transform\", \"translate(\"+width+\",0)\");\n\n\t\t// Add x scale label to y axis to make sure it is rendered over all ticks\n\t\tself.scatter_svg.select(\".xaxislabel\")\n\t\t\t.attr(\"x\", width - 10)\n\t\t\t.attr(\"transform\", \"translate(0,\" + (height-self.margin.bottom) + \")\");\n\n\n\t // Update the range of the scale with new width/height\n\t self.xScale.range([0, width]);\n\t self.yScale_left.range([0, (height-self.margin.bottom)]);\n\t if(self.right_scale.length > 0){\n\t \tself.yScale_right.range([0, (height-self.margin.bottom)]);\n\t }\n\n\n\t for (var i = self.sel_y.length - 1; i >= 0; i--) {\n\t \t//var par = self.sel_y[i]\n\t\t // Update legend for available unique identifiers\n\t\t\tvar legend = self.scatter_svg.selectAll(\".legend_\"+self.sel_y[i].replace(/[^a-zA-Z ]/g, \"\"))\n\t\t\tlegend.select(\"circle\")\n\t\t\t\t.attr(\"cx\", width - 25)\n\t\t\t\n\t\t\tlegend.select(\"text\")\n\t\t\t\t.attr(\"x\", width - 34)\n\t\t}\n\n\t\tself.updateTicks();\n\n\t\t// Update the axis with the new scale\n\t self.scatter_svg.select('.x.axis')\n\t .attr(\"transform\", \"translate(0,\" + (height-self.margin.bottom) + \")\")\n\t .call(self.xAxis);\n\n\t self.scatter_svg.select('.y.axis')\n\t .call(self.yAxis_left);\n\n\t if(self.yAxis_right){\n\t \tself.scatter_svg.select('.y2.axis')\n\t \t\t.call(self.yAxis_right);\n\t }\n\n\t self.updatedots();\n\n\t for (var i = self.sel_y.length - 1; i >= 0; i--) {\n\t\t\trenderlines(self.sel_y[i]);\n\t\t};\n\t \n\t if (self.renderBlocks){\n\n\t\t\tself.scatter_svg.selectAll(\".datarectangle\")\n\t\t\t\t.attr(\"x\",function(d) { \n\t\t\t\t\tif(self.daily_products){\n\t\t\t\t\t\tvar t = d.starttime;\n\t\t\t\t\t\tt.setUTCHours(0,0,0,0);\n\t\t\t\t\t\treturn self.xScale(t); \n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn self.xScale(d.starttime); \n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.attr(\"y\",function(d) { \n\t\t\t\t\treturn self.yAxis_left(d.max_height); \n\t\t\t\t})\n\t\t\t\t.attr(\"width\", function(d) { \n\t\t\t\t\tif(self.daily_products){\n\t\t\t\t\t\tvar t = d.starttime;\n\t\t\t\t\t\tt.setUTCHours(23,59,59,999);\n\t\t\t\t\t\tvar x_max = self.xScale(t); \n\t\t\t\t\t\tt.setUTCHours(0,0,0,0);\n\t\t\t\t\t\treturn (x_max-self.xScale(t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn (self.xScale(d.endtime)-self.xScale(d.starttime));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.attr(\"height\", function(d){\n\t\t\t\t\treturn (self.yAxis_left(d.min_height)-self.yAxis_left(d.max_height));\n\t\t\t\t});\n\n\t\t\tcolorAxisScale.range([(height-self.margin.bottom), 0]);\n\n\t\t\tself.scatter_svg.selectAll(\".color.axis\")\n\t\t\t\t.attr(\"transform\", \"translate(\" + (width+40) + \" ,0)\")\n\t\t\t\t.call(colorAxis);\n\n\t\t\tself.scatter_svg.selectAll(\".colorscaleimage\")\n\t\t\t\t.attr(\"width\", height-self.margin.bottom)\n\t\t\t\t.attr(\"transform\", \"translate(\" + (width+17) + \" ,\"+(height-self.margin.bottom)+\") rotate(270)\");\n\t\t}\n\n\t}", "function resize() {\n xMax = canvas.width;\n yMax = canvas.height;\n\n positionInstrumentCircles();\n\n getRun();\n tickChase();\n drawCircles();\n }", "adjustSize () {\n this._resize();\n }" ]
[ "0.8191736", "0.79434687", "0.787385", "0.7837152", "0.7815759", "0.7815759", "0.78108543", "0.78098637", "0.7780156", "0.7780156", "0.7780156", "0.7780156", "0.7754976", "0.7749732", "0.7736269", "0.77310205", "0.77310205", "0.7721554", "0.7709251", "0.7703007", "0.7703007", "0.7688644", "0.766831", "0.76661956", "0.7659431", "0.7652979", "0.76381844", "0.76289636", "0.76251715", "0.7597078", "0.7571864", "0.75206774", "0.7490991", "0.7478442", "0.7478038", "0.7432361", "0.7422985", "0.739451", "0.73708475", "0.73534995", "0.733739", "0.7308601", "0.7267205", "0.7260229", "0.72479373", "0.724296", "0.7225841", "0.7224996", "0.72219056", "0.7214767", "0.7213163", "0.718786", "0.7187503", "0.7177036", "0.71615416", "0.7141355", "0.71389925", "0.71161336", "0.7104849", "0.7056187", "0.7050851", "0.69616526", "0.69530374", "0.6949192", "0.6917746", "0.6910504", "0.6899667", "0.68955016", "0.68819386", "0.68800956", "0.6865079", "0.68599695", "0.6856003", "0.68541944", "0.6853303", "0.6838536", "0.6837331", "0.6828952", "0.6828952", "0.6823602", "0.68134224", "0.6812135", "0.6796314", "0.67670596", "0.67575", "0.6742804", "0.67359763", "0.6729549", "0.67234427", "0.67212194", "0.6706386", "0.6671865", "0.6671622", "0.6658005", "0.6640351", "0.66354525", "0.662597", "0.66215646", "0.6613881", "0.6609229" ]
0.7320122
41
Called from the visualization page
handleResize() { if (this.data === undefined) { // do nothing } else { this.drawBarChart(); // Draw bar chart this.forceUpdate(); // Forces re-render so that it takes up the appropriate space } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addDataVisuals () {\n }", "_render() {\n\t\tthis.tracker.replaceSelectedMeasures();\n }", "function SVGPieChart() {\r\n }", "function makeVis() {\n ScatterPlot = new ScatterPlot(\"scatter_plot\", all_data, lottery_data, round_1_data, round_2_data);\n Slider = new Slider('slider', all_data);\n\n}", "function overviewplotdrawn() {\n $scope.overviewplotcomplete = true;\n }", "wrangle() {\n // Define this vis\n const vis = this;\n\n // Update resultsCount from data\n vis.resultsCount = vis.data.length;\n\n // Call render\n vis.render();\n }", "function _drawVisualization() {\n // Create and populate a data table.\n var data = new google.visualization.DataTable();\n data.addColumn('datetime', 'start');\n data.addColumn('datetime', 'end');\n data.addColumn('string', 'content');\n data.addColumn('string', 'group');\n\n var date = new Date(2014, 04, 25, 8, 0, 0);\n\n var loader_text = '<img src=\"/res/qsl/img/loader33x16.png\" width=\"33px\" height=\"16px\"> L-105';\n var inspe_text =\n '<div title=\"Inspection\" class=\"order\">' +\n '<i class=\"fa fa-lg fa-wrench\"></i> ' +\n 'Inspection' +\n '</div>';\n var inspe_start = new Date(date);\n var inspe_end = new Date(date.setHours(date.getHours() + 6));\n\n data.addRow([inspe_start, inspe_end, inspe_text, loader_text]);\n\n var vessl_text =\n '<div title=\"Snoekgracht\" class=\"order\">' +\n '<i class=\"fa fa-lg fa-anchor\"></i> ' +\n 'Snoekgracht' +\n '</div>';\n var inspe_start = new Date(date.setHours(date.getHours() + 6));\n var inspe_end = new Date(date.setHours(date.getHours() + 48));\n\n data.addRow([inspe_start, inspe_end, vessl_text, loader_text]);\n\n // specify options\n var options = {\n width: \"100%\",\n //height: \"300px\",\n height: \"auto\",\n layout: \"box\",\n editable: true,\n eventMargin: 5, // minimal margin between events\n eventMarginAxis: 0, // minimal margin beteen events and the axis\n showMajorLabels: false,\n axisOnTop: true,\n // groupsWidth : \"200px\",\n groupsChangeable: true,\n groupsOnRight: false,\n stackEvents: false\n };\n\n // Instantiate our timeline object.\n that.timeline = new links.Timeline(document.getElementById(that.optio.vva_id_regn));\n\n // Draw our timeline with the created data and options\n that.timeline.draw(data, options);\n }", "function drawVisualization() {\n // Create and populate a data table.\n formArrayFromObj(satData);\n\n\n // specify options\n var options = {\n width: '600px',\n height: '600px',\n style: 'dot',\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n tooltip: getName\n };\n\n // Instantiate our graph object.\n var container = document.getElementById('myGraph');\n graph = new vis.Graph3d(container, data, options);\n\n}", "handleVisualize() {\n const { selectedBrowserAssembly } = this.getSelectedAssemblyAnnotation();\n visOpenBrowser(this.props.context, this.state.currentBrowser, selectedBrowserAssembly, this.state.selectedBrowserFiles, this.context.location_href);\n }", "function initVis() {\r\n\r\n createMapChart();\r\n populateTable();\r\n createLineCharts();\r\n}", "function drawVisualization() {\n // create the data table.\n data = new vis.DataSet();\n\n // create the animation data\n for (var i = 0; i < field1.length; i++) {\n x = field1[i];\n y = field2[i];\n z = field3[i];\n var style = clusters[i] == 0 ? \"#FFA500\" : clusters[i] == 1 ? \"#0000FF\" : clusters[i] == 2 ? \"#008000\" : clusters[i] == 3 ? \"#FFFF00\" : clusters[i] == 4 ? \"#4B0082\" : \"#000000\";\n\n data.add({ x: x, y: y, z: z, style: style });\n }\n\n // specify options\n var options = {\n width: \"100%\",\n height: \"100%\",\n style: \"dot-color\",\n showPerspective: true,\n showGrid: true,\n keepAspectRatio: true,\n verticalRatio: 1.0,\n showLegend: false,\n tooltip: {\n color: \"red\",\n },\n cameraPosition: {\n horizontal: -0.35,\n vertical: 0.22,\n distance: 1.8,\n },\n xLabel: field1Name,\n yLabel: field2Name,\n zLabel: field3Name\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n graph.on(\"click\", onclick);\n }", "function finalDraw() {\n\t Shapes.drawAll(gd);\n\t Images.draw(gd);\n\t Plotly.Annotations.drawAll(gd);\n\t Legend.draw(gd);\n\t RangeSlider.draw(gd);\n\t RangeSelector.draw(gd);\n\t }", "function initVis() {\n var eventHandlers = {};\n\n var mapSelectionChanged = function () {\n queue().defer(updateChildViews);\n };\n\n var activitySelectionChanged = function () {\n queue().defer(updateActivitiesVis);\n };\n\n var activitiesParkSelectionChanged = function (_newSelection)\n {\n ActivitiesPark = _newSelection;\n queue().defer(selectedParkChanged)\n }\n\n mapVis = new MapVis(\"#parks\", usStateData, dataloaded, allData, mapSelectionChanged);\n mapVis.updateVis();\n\n barVis = new barVis(\"#barVis\", allData, activitiesParkSelectionChanged, mapSelectionChanged,reset);\n BubbleVis = new BubbleVis(\"#bubble\", allData, activitySelectionChanged);\n // listVis = new listVis(\"#title\", allData, dataloaded, eventHandlers);\n infoVis = new InfoVis(\"#information\", dataloaded, mapSelectionChanged, eventHandlers);\n ActivitiesVis = new ActivitiesVis(\"#activityChart\",allData,activitiesParkSelectionChanged);\n }", "handleVisualize() {\n const { visualizeHandler } = this.props;\n visualizeHandler();\n }", "function onSelect(){\n d3.select(\"#model-chart\").html(\"\")\n let modelChoice = d3.select(\"#model-selector\").property(\"value\");\n let region = d3.select(\"#region-selector\").property(\"value\");\n makePage(region, 12, modelChoice);\n}", "function visualizationChanged(){\n \n // get visualization style\n\tvar visualization = $('#visSelect').val();\n\t\n // manage settings\n\tmanageSettings(visualization);\n \n // on first execution or when visualization changes execute proband management \n if((visualization != oldvisualization && typeof oldvisualization !== 'undefined')){\n manageProbands($('#fileSelection').find('option:selected').attr('count'), false);\n }\n \n oldvisualization = visualization;\n \n vischanged = true;\n\n\tdrawCanvas(g_imgSrc);\n}", "updateVis() {\n let vis = this;\n\n // Data Processing Functions: \n vis.groups = d3.rollup(vis.data, v => d3.mean(v, d => d.Consumption), d => d.Country, d => d.Type); // Mean Consumption across all time for country by type\n vis.countries = d3.rollup(vis.data, v => [v[0].lat, v[0].lon], d => d.Country); // LatLon by Country\n vis.linegroups = d3.group(vis.data, d => d.Country, d => d.Type); // Scatterplot Data for each type, by country\n vis.years = d3.extent(vis.data, d => d.Year); // Extent Year Range\n vis.consumption = d3.rollup(vis.data, v => d3.extent(v, d => d.Consumption), d => d.Country); // Consumption extent, by country\n vis.renderVis();\n }", "render() {\n return (\n <div className=\"px-3\">\n <hr />\n Visualization method{this.createVisualizationSelector()}\n <hr />\n </div>\n );\n }", "viewMode() {\n this.initChart();\n }", "function initViz() {\n const button5 = document.getElementById(\"btnPrevious\");\n button5.disabled = true;\n var placeholderDiv = document.getElementById(\"Div1\"),\n vizURL = \"https://public.tableau.com/views/ElectionsFinanceData/Dashboard1?:language=en-US&publish=yes&:display_count=n&:origin=viz_share_link&:showShareOptions=false&:toolbar=no&:download=no\";\n options = {\n hideTabs: true,\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n //querySheets();\n activeSheet = workbook.getActiveSheet();\n console.log(activeSheet.getName());\n }\n };\n\n\n viz = new tableau.Viz(placeholderDiv, vizURL, options);\n //var dashboardDesc = getElementById(\"textForDashboard\");\n dashboard1Text()\n // dashboardDesc.appendChild(textNode);\n\n\n console.log(\"viz displayed\");\n\n console.log(\"event listened to\");\n\n\n}", "function drawVisualization() {\n // Create and populate a data table.\n var data = new vis.DataSet();\n\n $.getJSON('/rawstars', function(stars) { \n for (i in stars) {\n var x = stars[i].x,\n y = stars[i].y,\n z = stars[i].z;\n starMemos[getKey(stars[i])] = stars[i];\n data.add({\n x: x,\n y: y,\n z: z,\n style: stars[i].lum\n });\n }\n\n // specify options\n var options = {\n width: '100%',\n height: '100%',\n style: 'dot-color',\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n legendLabel: \"Luminosity\",\n tooltip: function(star) {return generateTooltip(star);}\n };\n\n // create a graph3d\n var container = document.getElementById('mygraph');\n graph3d = new vis.Graph3d(container, data, options);\n });\n}", "onAfterRendering() {}", "#generateStateOverviewPlots () {\n const overviewMaternalHealthSelected = this.#controlPanel.overview.maternalHealthSelected;\n // enable the right plots\n this.#selectOverviewPlot(overviewMaternalHealthSelected);\n if (overviewMaternalHealthSelected == \"Maternal Deaths\" || overviewMaternalHealthSelected == \"Maternity Care Deserts\"){\n this.#generateMaternalDeathsPlot();\n }\n else {\n // set chart title\n document.getElementById(\"chart-title\").innerHTML = `${this.#controlPanel.getBroadbandSelected()} and ${this.#controlPanel.getMaternalHealthSelected()} by ${this.#capitalizeGeoLevel()}`;\n // If the identifier is not known, resort to a default value.\n const scatterLayout = {\n xaxis: {\n title: {\n text: this.broadbandTitlePart,\n },\n },\n yaxis: {\n title: {\n text: this.maternalHealthTitlePart,\n }\n },\n shapes: [\n {\n type: 'line',\n x0: this.cutoffs[1],\n y0: 0,\n x1: this.cutoffs[1],\n yref: 'paper',\n y1: 1,\n line: {\n color: 'grey',\n width: 1.5,\n dash: 'dot'\n }\n },\n {\n type: 'line',\n x0: 0,\n y0: this.cutoffs[0],\n x1: 1,\n xref: 'paper',\n y1: this.cutoffs[0],\n line: {\n color: 'grey',\n width: 1.5,\n dash: 'dot'\n }\n },\n ],\n legend: {\n bordercolor: '#B0BBD0',\n borderwidth: 1,\n orientation: 'h',\n yanchor: 'bottom',\n y: 1.02,\n xanchor: 'right',\n x: 0.75\n },\n };\n\n const boxLayout = {\n hovermode: false,\n xaxis: {\n title: {\n text: 'Categorizations',\n },\n },\n yaxis: {\n title: {\n text: this.maternalHealthTitlePart,\n }\n },\n legend: {\n bordercolor: '#B0BBD0',\n borderwidth: 1,\n orientation: 'h',\n yanchor: 'bottom',\n y: 1.02,\n xanchor: 'right',\n x: 0.75\n },\n boxmode: 'group',\n };\n\n // Initialize data structures for plots.\n const county_categorization_color_mapping_temp = [...county_categorization_color_mapping, county_categorization_color_mapping_unknowns[1], WITHHELD_COLOR];\n const county_categorization_color_mapping_light_temp = [...county_categorization_color_mapping_light, county_categorization_color_mapping_unknowns[1], WITHHELD_COLOR];\n const boxBorderColors = [\"#68247F\", \"#02304B\", \"#6E3C0C\", \"#274200\", \"#0F0F0F\", \"#474747\", WITHHELD_COLOR];\n this.chart_data = [];\n this.box_data = [];\n\n for (const [i, cat] of [\"Double Burden\", \"Opportunity\", \"Single Burden\", \"Milestone\", \"Unreliable\", WITHHELD_COLOR].entries()) {\n this.chart_data.push({\n x: [],\n y: [],\n mode: 'markers',\n type: 'scatter',\n name: cat,\n text: [],\n hovertemplate: '<i>Broadband</i>: %{x}' + '<br><i>Health</i>: %{y}<br>',\n marker: { color: county_categorization_color_mapping_temp[i], }\n });\n this.box_data.push({\n // https://github.com/plotly/plotly.js/issues/3830\n // Setting offsetgroup fixes issue where boxes become skinny.\n offsetgroup: '1',\n y: [],\n type: 'box',\n name: cat,\n fillcolor: county_categorization_color_mapping_temp[i],\n marker: { color: boxBorderColors[i], }\n });\n if (this.mapIsSplit) {\n this.chart_data.push({\n x: [],\n y: [],\n mode: 'markers',\n type: 'scatter',\n name: cat,\n text: [],\n hovertemplate: '<i>Broadband</i>: %{x}' + '<br><i>Health</i>: %{y}<br>',\n marker: {\n color: county_categorization_color_mapping_temp[i],\n symbol: \"circle-open\"\n }\n });\n this.box_data.push({\n offsetgroup: '2',\n y: [],\n type: 'box',\n name: cat,\n marker: {\n color: county_categorization_color_mapping_temp[i],\n },\n fillcolor: county_categorization_color_mapping_light_temp[i],\n line: {\n color: county_categorization_color_mapping_temp[i],\n }\n });\n }\n }\n\n // Load data into the plots.\n for (const el of this.data.state_data) {\n if (el[\"state_categorization\"] === undefined || el[\"state_categorization\"] === null || el[\"state_categorization\"] < 0) continue;\n let category = this.mapIsSplit ? 2 * (el[\"state_categorization\"] - 1) : el[\"state_categorization\"] - 1;\n if (el[\"health_status\"] == \"unreliable\") {\n category = this.mapIsSplit ? 8 : 4;\n } else if (this.#controlPanel.displayWithheld() && el[\"broadband\"] === -9999.0) {\n category = this.mapIsSplit ? 10 : 5;\n } else if (this.#controlPanel.getMaternalHealthSelected() == \"Mental Health Provider Shortage\"){\n if (el[\"health\"] < 0){\n continue;\n }\n }\n this.chart_data[category][\"x\"].push(Number(el[\"broadband\"]));\n this.chart_data[category][\"y\"].push(Number(el[\"health\"]));\n\n this.box_data[category][\"y\"].push(Number(el[\"health\"]));\n if (this.mapIsSplit) {\n // Populate the data for the second map with the same data as the first map. Eventually, this will change.\n category += 1;\n this.chart_data[category][\"x\"].push(Number(el[\"broadband\"]));\n this.chart_data[category][\"y\"].push(Number(el[\"health\"]));\n\n this.box_data[category][\"y\"].push(Number(el[\"health\"]));\n }\n }\n\n Plotly.newPlot(\"maternalHealthSecondPlot\", this.chart_data, scatterLayout,\n { displaylogo: false, responsive: true, displayModeBar: true });\n Plotly.newPlot(\"maternalHealthFirstPlot\", this.box_data, boxLayout,\n { displaylogo: false, responsive: true, displayModeBar: true });\n\n this.makePlotsAccessible();\n }\n }", "function gVizloaded() {\n\nconsole.log(\"google visualization is loaded!\");\n\n\n//the url is split on the question mark \"?\"\n//if there's a question mark and something on the other side, its a 2 item array\n//if the length is greater than 1 there's something in the url\n//if its 1 or less than 1, then there's nothing in the url and default year is added\n\n\n\tvar mURL = History.getState().cleanUrl;\n\tvar mqueryArray = mURL.split(\"?\");\n\n//default year is 1990 but if the length of the queryarray exceeds 1, \n//default year becomes the queryarray split, and the second half is taken\n\n\tvar mdefaultYear = \"1990\";\n\n\tif (mqueryArray.length > 1) {\n\n\t\tmdefaultYear = mqueryArray[1].split(\"=\")[1];\n\t}\n\n\n\n//$ is a jquery function, refers back to index page, when the button is clicked, new data is shown\n//as it starts with a \".\"\" grab by class name\n\n\n$(\".btn-success\").on(\"click\", displayNewData);\n\n//here, the hash # says to grab by id, ie the year\n//the round parenthesis () indicates that click is a function and not a property (as it might be since it comes after a \".\")\n\n$(\"#year_\"+mdefaultYear).click();\n\n\n}", "function drawViz(){\n\n let currentYearData = incomingData.filter(filterYear);\n console.log(\"---\\nthe currentYearData array now carries the data for year\", currentYear);\n\n\n // Below here is where your coding should take place! learn from lab 6:\n // https://github.com/leoneckert/critical-data-and-visualization-spring-2020/tree/master/labs/lab-6\n // the three steps in the comments below help you to know what to aim for here\n\n // bind currentYearData to elements\n\n\n\n // take care of entering elements\n\n\n\n // take care of updating elements\n\n\n\n\n\n\n\n\n\n\n }", "function visualise(){\r\n//sets the background to grey to hide any text that was previously on it\r\n background(80);\r\n\r\n//creates a button that calls the function priceDraw when pressed\r\n visPrice = createButton('Prices');\r\n visPrice.position(10,630);\r\n visPrice.size(100,30);\r\n visPrice.mousePressed(priceDraw);\r\n\r\n//creates a button that calls the function quanDraw when pressed\r\n visQuan = createButton('Quantity');\r\n visQuan.position(10,600);\r\n visQuan.size(100,30);\r\n visQuan.mousePressed(quanDraw);\r\n\r\n//hides the other buttons so they don't interfere\r\n listButtons.hide();\r\n graphButton.hide();\r\n visButton.hide();\r\n }", "function renderVis1() {\n\tdrunkButtonMode = false;\n\tv1part2g = svg1.append(\"g\")\n\tv1barsg = svg1.append(\"g\")\n\tv1part2g.attr(\"transform\", \"translate(\"+(vis1x0+vis1xspace)+\", \"+vis1part2y0+\")\");//.attr(\"opacity\", 0);\n\trenderV1Axis();\n\trenderV1Data();\n\trenderV1Titles();\n\tupdateAllV1(0);\t\n\trenderV1Part2();\n\t\n}", "function render() {\n // Render pie chart.\n if (angular.isDefined(vm.dataset)) {\n renderChart(vm.dataset.summary, $scope.meters.listAll);\n }\n }", "function visualizationLogic(){\n console.log(\"Visualization Logic\")\n //text\n //INFO from: https://earthquake.usgs.gov/earthquakes/browse/significant.php#sigdef\n // let t2 = createP('Events in this list and shown in red on our real-time earthquake map and list are considered “significant events’,<br>and they are determined by a combination of magnitude, number of Did You Feel It responses, and PAGER alert level.');\n // t2.class('small');\n // t2.parent('canvas1');\n // t2.position(0,0);\n\n //-------------------------------------------------------------//\n // 1. Magnitude Level //\n //-------------------------------------------------------------//\n\n //Variables for All\n let legendW = 60;\n //Variables for Magnitude\n let Mag_Legends = [0, 1, 3, 4.5, 6, 9];\n let Mag_xPos = (cWidth - Mag_Legends.length * legendW)/2; //CENTER THEM\n let Mag_margin = 10;\n let Mag_angle = 0;\n\n //Variables for Significance\n let minSig = minValue(quakes, 'sig');\n let maxSig = maxValue(quakes, 'sig');\n console.log(`MinSig is ${minSig} MaxSig is ${maxSig}`);\n let sig_Legends = [0, 100, 200, 400, 600, 1000, 1500];\n let sig_xPos = (cWidth - sig_Legends.length * legendW)/2; //CENTER THEM\n let sig_margin = 10;\n\n textFont(font1);\n //\n push();\n translate(Mag_xPos, legendW); \n for (let i = 0; i < Mag_Legends.length; i ++) {\n let myAPT_W, myAPT_H;\n myAPT_W = map(1000, 0, 1500, 1, legendW/2); \n myAPT_H = 2 * myAPT_W;\n Mag_angle = radians ( map(Mag_Legends[i], 0, 9, 0, 90) ); //Input, min, max, 0, 90\n //This is the class for the buildings;\n //\n push();\n let xTrans = legendW/2 - myAPT_W/2;\n translate(xTrans, 0); // ****************. FIX THIS PART\n rotate(Mag_angle);\n //2. Building \n let mySigC = sigScale(1000).hex();\n let myMagC = magScale(Mag_Legends[i]).hex();\n myMagC = color(myMagC);\n myMagC.setAlpha(150); // Add Alpha\n fill(mySigC);\n strokeWeight(1);\n stroke('#000000');\n rect(0, 0, myAPT_W, - myAPT_H);//x, y, w, h\n //3. Window\n fill('#ffffff');\n strokeWeight(0.5);\n let myWindowW = map(400, 0, 1500, 1, legendW/7);\n let myWindwX1 = legendW/2 - myAPT_W/5 - myWindowW/2 - xTrans;\n let myWindwX2 = myWindwX1 + 2*(myAPT_W/5) ;\n rect(myWindwX1, - myAPT_H/4 + myWindowW/2, myWindowW, - myWindowW); \n rect(myWindwX1, - (myAPT_H/4) * 2 + myWindowW/2, myWindowW, - myWindowW);\n rect(myWindwX1, - (myAPT_H/4) * 3 + myWindowW/2, myWindowW, - myWindowW);\n rect(myWindwX2, - myAPT_H/4 + myWindowW/2, myWindowW, - myWindowW); \n rect(myWindwX2, - (myAPT_H/4) * 2 + myWindowW/2, myWindowW, - myWindowW);\n rect(myWindwX2, - (myAPT_H/4) * 3 + myWindowW/2, myWindowW, - myWindowW);\n //4. Rooftop\n let x1, y1;\n x1 = legendW/2 - myAPT_W/2 - xTrans;\n y1 = - myAPT_H;\n let h = map(1000, 0, 1500, 1, myWindowW);\n line(x1, y1, x1 - h, y1 - h); //Left\n line(x1 + myAPT_W, y1, x1 + myAPT_W + h, y1 - h); //Right\n line(x1 - h, y1 - h, x1 + myAPT_W + h, y1 - h); //top\n pop();\n //1. Ground\n noStroke(); \n fill(myMagC);\n rect(Mag_margin, 0, legendW - 2 * Mag_margin, 15 * map(Mag_Legends[i], 0, 9, 0, 90)/90 ); ////x, y, w, h\n //5. -- Legend Text Below -- //\n noStroke();\n fill('orange');\n textSize(12);\n textAlign(CENTER);\n text(Mag_Legends[i], legendW/2, 35); //text,x, y\n //6. //Move to the next spot to the Right (Add scale)\n translate(legendW, 0); \n }\n pop();\n //Text Description\n textAlign(CENTER);\n textSize(15);\n text(\"Magnitude Level\", cWidth/2, legendW*1.9); \n\n //-------------------------------------------------------------//\n // 2. Significance Level //\n //-------------------------------------------------------------//\n // Cali range 0 from 640, World Range from 0 to 1492\n\n push();\n translate(sig_xPos, legendYPos + legendW + sig_margin); //x, y\n for (let i = 0; i < sig_Legends.length; i ++) {\n let myAPT_W, myAPT_H;\n myAPT_W = map(sig_Legends[i], 0, 1500, 1, legendW/2); //Input, min, max,\n myAPT_H = 2 * myAPT_W; //2 Times over -> Max will be 60\n //This is the class for the buildings;\n //1. Ground\n // noStroke();\n // fill(magScale(0).hex()); //Show the Color at Mag = 0;\n // //fill('rgba(150, 75, 0, 0.5)'); // Brown //************** Should be re-written \n // rect(sig_margin, 0, legendW - 2 * sig_margin, 20); ////x, y, w, h\n //2. Building //Half Point: legendW/2\n let myC = sigScale(sig_Legends[i]).hex();\n fill(myC);\n strokeWeight(1);\n stroke('#000000');\n rect(legendW/2 - myAPT_W/2, 0, myAPT_W, - myAPT_H);//x, y, w, h\n //3. Apartment Windows\n fill('#ffffff');\n strokeWeight(0.5);\n let myWindowW = map(sig_Legends[3], 0, 1500, 1, legendW/7);\n if (sig_Legends[i] < 200) { // No Window\n console.log(\"Sig level below 200 - No Window\");\n }\n if (sig_Legends[i] >= 200 && sig_Legends[i] < 400) { //One Window\n console.log(\"Sig level between 200 & 400\"); \n rect(legendW/2 - myWindowW/2, - myAPT_H/2 + myWindowW/2, myWindowW, - myWindowW); \n } \n if (sig_Legends[i] >= 400 && sig_Legends[i] < 600) { //Two Windows\n console.log(\"Sig level between 400 & 600\"); \n rect(legendW/2 - myWindowW/2, - myAPT_H/3 + myWindowW/2, myWindowW, - myWindowW); \n rect(legendW/2 - myWindowW/2, - (myAPT_H/3) * 2 + myWindowW/2, myWindowW, - myWindowW);\n }\n if (sig_Legends[i] >= 600 && sig_Legends[i] < 1000) { //Two Windows * 2 Cols\n console.log(\"Sig level between 600 & 1000\"); \n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - myAPT_H/3 + myWindowW/2, myWindowW, - myWindowW); \n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - (myAPT_H/3) * 2 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - myAPT_H/3 + myWindowW/2, myWindowW, - myWindowW); \n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - (myAPT_H/3) * 2 + myWindowW/2, myWindowW, - myWindowW);\n }\n if (sig_Legends[i] >= 1000 && sig_Legends[i] < 1500) { //Two Windows * 3 Cols\n console.log(\"Sig level between 1000 & 1500\"); \n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - myAPT_H/4 + myWindowW/2, myWindowW, - myWindowW); \n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - (myAPT_H/4) * 2 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - (myAPT_H/4) * 3 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - myAPT_H/4 + myWindowW/2, myWindowW, - myWindowW); \n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - (myAPT_H/4) * 2 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - (myAPT_H/4) * 3 + myWindowW/2, myWindowW, - myWindowW);\n }\n if (sig_Legends[i] >= 1500) { //Two Windows * 3 Cols\n console.log(\"Sig level Over 1500\"); \n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - myAPT_H/6 + myWindowW/2, myWindowW, - myWindowW); \n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - (myAPT_H/6) * 2 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - (myAPT_H/6) * 3 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - (myAPT_H/6) * 4 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 - myAPT_W/5 - myWindowW/2, - (myAPT_H/6) * 5 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - myAPT_H/6 + myWindowW/2, myWindowW, - myWindowW); \n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - (myAPT_H/6) * 2 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - (myAPT_H/6) * 3 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - (myAPT_H/6) * 4 + myWindowW/2, myWindowW, - myWindowW);\n rect(legendW/2 + myAPT_W/5 - myWindowW/2, - (myAPT_H/6) * 5 + myWindowW/2, myWindowW, - myWindowW);\n }\n //4. RoofTop - 3 lines;\n let x1, y1, x2, y2;\n x1 = legendW/2 - myAPT_W/2;\n y1 = - myAPT_H;\n let h = map(sig_Legends[i], 0, 1500, 1, myWindowW);\n line(x1, y1, x1 - h, y1 - h); //Left\n line(x1 + myAPT_W, y1, x1 + myAPT_W + h, y1 - h); //Right\n line(x1 - h, y1 - h, x1 + myAPT_W + h, y1 - h); //top\n //5. -- Legend Text Below -- //\n noStroke();\n fill('#cccccc');\n textSize(12);\n textAlign(CENTER);\n text(sig_Legends[i], legendW/2, 15); //text,x, y\n //6. //Move to the next spot to the Right (Add scale)\n translate(legendW, 0); \n }\n pop();\n //Text Description\n textAlign(CENTER);\n textSize(15);\n fill('#000000');\n text(\"Significance Level\", cWidth/2, legendYPos + legendW*1.75);\n\n\n}", "render() {\n const total = this.values.reduce((a, b) => a + b, 0);\n\n const rest = 100 - total;\n const dataset = rest > 0 ? [...this.values, rest] : this.values;\n\n this._renderSvg();\n this._renderGroups(dataset, rest);\n this._renderRects(dataset);\n this._renderMarkers();\n }", "render() {\n MapPlotter.setUpFilteringButtons();\n MapPlotter.readFiltersValues();\n\n MapPlotter.currentStateName = 'Texas';\n MapPlotter.drawRaceDoughnut();\n\n MapPlotter.drawMap();\n }", "initVis() {\n let vis = this;\n\n /*vis.margin = {top: 30, right: 80, bottom: 30, left: 80};\n\n vis.width = $(\"#\" + vis.parentElement).width() - vis.margin.left - vis.margin.right,\n vis.height = 700 - vis.margin.top - vis.margin.bottom;\n\n // SVG drawing area\n vis.svg = d3.select(\"#\" + vis.parentElement).append(\"svg\")\n .attr(\"width\", vis.width + vis.margin.left + vis.margin.right)\n .attr(\"height\", vis.height + vis.margin.top + vis.margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + vis.margin.left + \",\" + vis.margin.top + \")\");*/\n\n vis.boxPlotDiv = document.getElementById(vis.parentElement)\n vis.boxPlotDiv.style.height = '650px'\n\n vis.colors = {\n 'navy': '#010D26',\n 'blue': '#024059',\n 'paleOrange': '#D98E04',\n 'orange': '#F28705',\n 'darkOrange': '#BF4904',\n 'purp': '#8F2051',\n 'tan': '#F2E1C9',\n }\n\n vis.filter = \"mean_vote\"\n\n vis.layout = {\n title: 'Distribution of Movie Ratings by Genre',\n yaxis: {\n // autorange: true,\n showgrid: true,\n zeroline: true,\n range: [0,10],\n // dtick: 0,\n gridcolor: 'rgb(255, 255, 255)',\n gridwidth: 1,\n zerolinecolor: 'rgb(255, 255, 255)',\n zerolinewidth: 2\n },\n margin: {\n l: 60,\n r: 50,\n b: 80,\n t: 100\n },\n paper_bgcolor: vis.colors.tan,\n plot_bgcolor: vis.colors.tan,\n showlegend: false\n };\n\n /*vis.pieChartGroup = vis.svg\n .append('g')\n .attr('class', 'pie-chart')\n .attr(\"transform\", \"translate(\" + vis.width / 2 + \",\" + vis.height / 2 + \")\");\n\n // Pie chart settings\n let outerRadius = vis.width / 2;\n let innerRadius = 20;\n\n // Path generator for the pie segments\n vis.arc = d3.arc()\n .innerRadius(innerRadius)\n .outerRadius(outerRadius);\n\n // Pie Layout\n vis.pie = d3.pie()\n .value(function(d){\n return d.value\n });*/\n\n vis.wrangleData()\n }", "function initDashboard() {\n \n tempGauge(city);\n percipGauge(city);\n generateChart();\n generate_prcp();\n addParagraph(city) \n}", "function createVisualization(sequenceArray) {\r\n\r\n // Basic setup of page elements.\r\n initializeBreadcrumbTrail();\r\n\r\n updateBreadcrumbs(sequenceArray;\r\n\r\n // // For efficiency, filter nodes to keep only those large enough to see.\r\n // var nodes = partition.nodes(json)\r\n // .filter(function(d) {\r\n // return (d.dx > 0.005); // 0.005 radians = 0.29 degrees\r\n // });\r\n\r\n // var path = vis.data([json]).selectAll(\"path\")\r\n // .data(nodes)\r\n // .enter().append(\"path\")\r\n // .attr(\"display\", function(d) { return d.depth ? null : \"none\"; })\r\n // .attr(\"d\", arc)\r\n // .attr(\"fill-rule\", \"evenodd\")\r\n // .style(\"fill\", function(d) { return colors(d.label); })\r\n // .style(\"opacity\", 1)\r\n // .on(\"mouseover\", mouseover)\r\n // .on(\"click\", click);\r\n\r\n // // Add the mouseleave handler to the bounding circle.\r\n // d3.select(el).select(\"#\"+ el.id + \"-container\").on(\"mouseleave\", mouseleave);\r\n\r\n // // Get total size of the tree = value of root node from partition.\r\n // totalSize = path.node().__data__.value;\r\n\r\n // drawLegend();\r\n // d3.select(el).select(\".sunburst-togglelegend\").on(\"click\", toggleLegend);\r\n\r\n }", "function onchange()\r\n{\r\n window.updateHeatmap();\r\n window.updateBar();\r\n window.updateLine();\r\n}", "function draw() {\n\n var isGridDrawn = false;\n\n if(graph.options.errorMessage) {\n var $errorMsg = $('<div class=\"elroi-error\">' + graph.options.errorMessage + '</div>')\n .addClass('alert box');\n\n graph.$el.find('.paper').prepend($errorMsg);\n }\n\n if(!graph.allSeries.length) {\n elroi.fn.grid(graph).draw();\n }\n\n $(graph.allSeries).each(function(i) {\n\n if(!isGridDrawn && graph.seriesOptions[i].type != 'pie') {\n elroi.fn.grid(graph).draw();\n isGridDrawn = true;\n }\n\n var type = graph.seriesOptions[i].type;\n elroi.fn[type](graph, graph.allSeries[i].series, i).draw();\n\n });\n\n }", "function setup(){\n loadData(\"life_expectancy_data_csv.csv\", \"fertility_rate_data_csv.csv\", \"africa_scatterplot.csv\");\n _vis = document.getElementById(\"vis\");\n _vis = d3.select(\"#vis\");\n // grab our container's dimension\n _vis_width = d3.select(\"#vis\").node().getBoundingClientRect().width;\n _vis_height = d3.select(\"#vis\").node().getBoundingClientRect().height;\n\n _vis2 = document.getElementById(\"vis2\");\n _vis2 = d3.select(\"#vis2\");\n // grab our container's dimension\n _vis2_width = d3.select(\"#vis2\").node().getBoundingClientRect().width;\n _vis2_height = d3.select(\"#vis2\").node().getBoundingClientRect().height;\n}", "function initViz() {\n var containerDiv = document.getElementById(\"vizContainer\"),\n // define url to a Overview view from the Superstore workbook on my tableau dev site\n url = \"https://10ax.online.tableau.com/t/loicplaygrounddev353480/views/Superstore/Overview?:showAppBanner=false&:display_count=n&:showVizHome=n\";\n options = {\n hideTabs: true,\n onFirstInteractive: function () {\n var worksheets = getWorksheets(viz);\n // process all filters used on the dashboard initially and subscribe to any filtering event comming out of the dashboard to recompute the filters on the webpage.\n processFilters(worksheets);\n viz.addEventListener('filterchange', (filterEvent) => {\n var worksheets = getWorksheets(filterEvent.getViz());\n processFilters(worksheets);\n });\n viz.addEventListener(tableau.TableauEventName.MARKS_SELECTION, (marksEvent) => {\n var worksheets = getWorksheets(marksEvent.getViz());\n processFilters(worksheets);\n });\n }\n };\n\n viz = new tableau.Viz(containerDiv, url, options);\n}", "function onResize() {\n\t\t$log.log(preDebugMsg + \"onResize called\");\n\n\t\tvar windowWidth = $(window).width();\n\t\tvar windowHeight = $(window).height() - 100;\n\n\t\tvar dataLeft = 250;\n\t\tvar dataTop = 10;\n\t\tvar vizLeft = 5;\n\t\tvar vizTop = 105;\n\t\tif(windowHeight < windowWidth) {\n\t\t\tdataLeft = 5;\n\t\t\tdataTop = 105\n\t\t\tvizLeft = 250;\n\t\t\tvizTop = 10\n\t\t}\n\n\t\tvar fontSize = 11;\n\n\t\tif(loadedChildren[\"DigitalDashboardSmartDataSource\"].length > 0) {\n\t\t\tvar datasrc = $scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboardSmartDataSource\"][0]);\n\t\t\tdatasrc.scope().set(\"root:top\", dataTop);\n\t\t\tdatasrc.scope().set(\"root:left\", dataLeft);\n\t\t}\n\n\t\tif(loadedChildren[\"DigitalDashboardPlugin3DDensityPlotAdv\"].length > 0) {\n\t\t\tvar n = 256;\n\t\t\tvar cw = Math.max(1, Math.min(Math.ceil((windowWidth - vizLeft - 50) / 2 / (2*n)), Math.floor((windowHeight - vizTop - 60) / (2*n))));\n\t\t\tvar zoom = Math.max(200, Math.min(windowWidth - vizLeft - 2*cw * 256 - 50, windowHeight - vizTop - 60));\n\n\t\t\tvar viz = $scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboardPlugin3DDensityPlotAdv\"][0]);\n\t\t\tviz.scope().set(\"root:top\", vizTop);\n\t\t\tviz.scope().set(\"root:left\", vizLeft);\n\t\t\tviz.scope().set(\"DrawingArea:width\", cw * 256 * 2 + 20);\n\t\t\tviz.scope().set(\"DrawingArea:height\", cw * 256 * 2 + 20);\n\t\t\tviz.scope().set(\"CellWidth\", cw);\n\t\t\tviz.scope().set(\"ZoomSpace\", zoom);\n\n\t\t\t$log.log(preDebugMsg + \"viz moved and set to \" + vizTop + \" \" + vizLeft + \" \" + cw + \" \" + zoom);\n\t\t}\n\t}", "_drawChart()\n {\n\n }", "constructor() { \n \n JsonAnalysisVisualization.initialize(this);\n }", "function drawVisualization() {\n // create the data table.\n data = new vis.DataSet();\n\n // create the animation data\n for (var i = 0; i < pc1.length; i++) {\n x = pc1[i];\n y = pc2[i];\n z = pc3[i];\n var style = \"#0000CD\";\n\n data.add({ x: x, y: y, z: z, style: style });\n }\n\n // specify options\n var options = {\n width: \"100%\",\n height: \"100%\",\n style: \"dot-color\",\n showPerspective: true,\n showGrid: true,\n keepAspectRatio: true,\n verticalRatio: 1.0,\n showLegend: false,\n tooltip: {\n color: \"red\",\n },\n cameraPosition: {\n horizontal: -0.35,\n vertical: 0.22,\n distance: 1.8,\n },\n xLabel: \"PC1\",\n yLabel: \"PC2\",\n zLabel: \"PC3\"\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n graph.on(\"click\", onclick);\n }", "function fourthView(){\n populateAppropGridOnSubmit();\n populateAppropGridWhenPlotClicked();\n }", "function updateViz() {\n background(\"seashell\");\n\n loadImage(\"USVizLegend.png\", displayLegend);\n if (stateArray.length > 0) {\n for (let i = 1; i < stateArray.length; i++) {\n stateArray[i].display();\n }\n }\n else { //handles error if stateArray does not contain data\n text(\"Waiting to load data files...\", width / 2, height / 2);\n }\n}", "render() {\n // Define this vis\n const vis = this;\n\n // Bind and modify - using 'datum' method to bind a single datum\n vis.topCounterEl.datum(vis.resultsCount)\n .text('Results Count: ')\n .append('span')\n .text(d => d);\n }", "function visualize(theData){\r\n\t// Part 1: Essential Local Variables and Functions\r\n\t// ===============================================\r\n\t// curX and curY will determine what data get's represented in each axis\r\n\r\n}", "function OnDataLoaded() {\n\t\tobjChart.showWaiting(false);\t\t\t\t\n\t\tobjChart.reorganize();\t\t\n\t}", "function selectFilter() {\n createVisualization();\n}", "function drawVisualization() {\n // create the data table.\n data = new vis.DataSet();\n\n // create the animation data\n\n for (var i = 0; i < pc1.length; i++) {\n x = pc1[i];\n y = pc2[i];\n z = pc3[i];\n var style = clusters[i] == 0 ? \"#FFA500\" : clusters[i] == 1 ? \"#0000FF\" : clusters[i] == 2 ? \"#008000\" : clusters[i] == 3 ? \"#FFFF00\" : clusters[i] == 4 ? \"#4B0082\" : \"#000000\";\n\n data.add({ x: x, y: y, z: z, style: style });\n }\n\n // specify options\n var options = {\n width: \"100%\",\n height: \"100%\",\n style: \"dot-color\",\n showPerspective: true,\n showGrid: true,\n keepAspectRatio: true,\n verticalRatio: 1.0,\n showLegend: false,\n tooltip: {\n color: \"red\",\n },\n cameraPosition: {\n horizontal: -0.35,\n vertical: 0.22,\n distance: 1.8,\n },\n xLabel: \"PC1\",\n yLabel: \"PC2\",\n zLabel: \"PC3\"\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n graph.on(\"click\", onclick);\n }", "function renderClassChart() {\n\tclassHoverRect();\n\tincrementProgress();\n}", "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barChart.draw();\n // scatterplot\n // this.scatter.draw();\n }", "function onViewChangeEnd() {\n _addLabelsForZoomLevel();\n }", "function pageOnLoad(){\n render(datasetInit);\n render(convertedDataSet1992);\n }", "function initializeViz() {\n var container = document.getElementById(\"vizcontainer\");\n var url = \"https://public.tableau.com/views/WorldIndicators/GDPpercapita\";\n var options = {\n width: container.offsetWidth,\n height: container.offsetHeight,\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n activeSheet = workbook.getActiveSheet();\n publishedSheets = workbook.getPublishedSheetsInfo();\n annyangInit();\n var options = {\n maxRows: 0, // 0 is returning all rows\n ignoreAliases: false,\n ignoreSelection: true\n };\n //activeSheet.getUnderlyingDataAsync(options).then(function(d) {dataFunc(d)});\n //activeSheet.getSummaryDataAsync(options).then(function(t) {sumFunc(t)});\n //getFilters(activeSheet);\n buildSelectFilterCountryCmd();\n buildSelectFilterRegionCmd();\n buildFuzzyCmds();\n }\n };\n viz = new tableau.Viz(container, url, options);\n }", "function createComparisonVis(id) {\n createEmptyGraph(id);\n $(\".loading-compare\").fadeOut(\"slow\");\n}", "run() {\n this.chart.drawChart();\n this.demographicsChart.drawChart(this.createCurrentStats().sum());\n this.model.setupCommunity();\n this.model.run();\n this.reset();\n }", "function showTitle() {\n\n console.log(\"showTitle\")\n\n d3.select(\"#toolbar\").style(\"visibility\" , \"visible\");\n\n magnitudeLegend.style(\"opacity\", 0.0);\n depthLegend.style(\"opacity\" , 0.0);\n faultLegend.style(\"opacity\" , 0.0);\n d3.selectAll(\".histoG\").style(\"opacity\" , 0.0);\n d3.selectAll(\".highlight.highlight-g\").style(\"opacity\" , 0.0);\n\n $( \".scroll\" ).addClass( \"disabled\" ).removeClass( \"enabled\" );\n $( \".scroll.down\" ).addClass( \"enabled\" ).removeClass( \"disabled\" );\n $( \".scroll.counter\" ).css( \"opacity\" , 0.0 );\n\n // hide depth axis and profile\n g.selectAll(\".depth.axis\").style(\"opacity\" , 0.0);\n\n g.selectAll('.count-title')\n .transition()\n .duration(0)\n .style('opacity', 0);\n\n g.selectAll('.openvis-title')\n .transition()\n .duration(0)\n .style('opacity', 1.0);\n\n g.selectAll('.image.wave')\n .transition()\n .duration(0)\n .style('opacity', 1.0);\n\n g.selectAll(\".barcode\")\n .transition()\n .duration(0)\n .style('opacity', 0)\n .style('pointer-events', \"none\");\n\n g.selectAll(\".eventInfo\")\n .transition()\n .duration(0)\n .style(\"opacity\" , 0.0)\n .style('pointer-events', \"none\");\n\n\n return;\n \n }// end function showTitle", "function VisulisationSetup(crimeData, countryArray, rawData) {\n \n // Puts the data into a table\n $.each(crimeData, function() {\n //http://stackoverflow.com/questions/171027/add-table-row-in-jquery\n $(\"#totalRegionTable tr:last\").after(\"<tr><td>\" + this.id + \"</td><td>\" + this.total + \"</td></tr>\");\n });\n \n // Creation of region charts\n CreateRegionCharts(crimeData[0].id.replace(/\\s/g, \"_\"), crimeData[0].id + \" Information\");\n // Creation of the Totals pie/bar charts\n CreateCharts(\n crimeData,\n document.getElementById(\"total-chart-pie\"),\n document.getElementById(\"total-chart-bar\"),\n \"Region Totals\",\n \"Country Name\",\n \"Totals Including Fraud\");\n \n // Creation of the Country pie/ bar charts\n CreateCharts(\n countryArray,\n document.getElementById(\"country-chart-pie\"),\n document.getElementById(\"country-chart-bar\"),\n \"Countries Crime Totals\",\n \"Country Name\",\n \"Totals Including Fraud\");\n \n // Puts the raw data on the page\n $(\"#regionTotalRaw\").html(rawData);\n}", "function renderChart() {\n\n if($scope.currentChartModel==null) {\n $scope.app.getObject($element.find('div'), $scope.currentChart).then(function(model) {\n $scope.currentChartModel = model;\n });\n }\n else {\n $scope.currentChartModel.enigmaModel.endSelections(true)\n .then(destroyObject)\n .then(\n function() {\n $scope.app.getObject($element.find('div'), $scope.currentChart)\n .then(function(model) {\n $scope.currentChartModel = model;\n });\n });\n }\n\n }", "function display() {\n\t\tlet totFilteredRecs = ndx.groupAll().value();\n\t\tlet end = ofs + pag > totFilteredRecs ? totFilteredRecs : ofs + pag;\n\t\td3.select('#begin').text(end === 0 ? ofs : ofs + 1);\n\t\td3.select('#end').text(end);\n\t\td3.select('#last').attr('disabled', ofs - pag < 0 ? 'true' : null);\n\t\td3.select('#next').attr(\n\t\t\t'disabled',\n\t\t\tofs + pag >= totFilteredRecs ? 'true' : null\n\t\t);\n\t\td3.select('#size').text(totFilteredRecs);\n\t\tif (totFilteredRecs != ndx.size()) {\n\t\t\td3.select('#totalsize').text('(Unfiltered Total: ' + ndx.size() + ')');\n\t\t} else {\n\t\t\td3.select('#totalsize').text('');\n\t\t}\n\t}", "initVis() {\n let vis = this;\n\n // Define size of SVG drawing area\n vis.svg = d3.select(vis.config.parentElement)\n .attr('width', vis.config.containerWidth)\n .attr('height', vis.config.containerHeight)\n .attr(\"rx\", 20).attr(\"ry\", 20);\n\n // add a lightgray outline for the rect of lexis svg\n vis.svg\n .append(\"rect\")\n .attr(\"width\", vis.config.containerWidth)\n .attr(\"height\", vis.config.containerHeight)\n .attr(\"stroke\", \"lightgray\")\n .attr(\"fill\", \"none\");\n\n\n // Append group element that will contain our actual chart \n // and position it according to the given margin config\n vis.chartArea = vis.svg.append('g')\n .attr('transform', `translate(${vis.config.margin.left},${vis.config.margin.top})`);\n\n\n\n // define inner box size\n vis.innerHeight =\n vis.config.containerHeight -\n vis.config.margin.top -\n vis.config.margin.bottom;\n\n vis.innerWidth =\n vis.config.containerWidth -\n vis.config.margin.left -\n vis.config.margin.right;\n\n vis.chart = vis.chartArea.append('g');\n\n\n /**\n * Have implemented this part in HTML file\n */\n // Create default arrow head\n // Can be applied to SVG lines using: `marker-end`\n // vis.chart.append('defs').append('marker')\n // .attr('id', 'arrow-head')\n // .attr('markerUnits', 'strokeWidth')\n // .attr('refX', '2')\n // .attr('refY', '2')\n // .attr('markerWidth', '10')\n // .attr('markerHeight', '10')\n // .attr('orient', 'auto')\n // .append('path')\n // .attr('d', 'M0,0 L2,2 L 0,4')\n // .attr('stroke', '#ddd')\n // .attr('fill', 'none');\n\n\n // apply clipping mask to 'vis.chart', restricting the region at the very beginning and end of a year\n vis.chart\n .append(\"defs\")\n .append(\"clipPath\")\n .attr(\"id\", \"chart-mask\")\n .append(\"rect\")\n .attr(\"width\", vis.config.containerWidth)\n .attr(\"height\", vis.config.containerHeight);\n vis.chart.attr(\"clip-path\", \"url(#chart-mask)\");\n\n // text label for lexischart\n vis.svg\n .append(\"text\")\n .attr(\"y\", 25)\n .attr(\"x\", 10)\n .attr(\"class\", \"text-label\")\n .text(\"Age\");\n\n // Todo: initialize scales, axes, static elements, etc.\n\n // define x-axis scale\n vis.yearScale = d3\n .scaleLinear()\n .domain([1950, 2021])\n .range([0, vis.innerWidth]);\n\n // define y-axis scale\n vis.ageScale = d3\n .scaleLinear()\n .domain([25, 95])\n .range([vis.innerHeight, 0]);\n\n //define y-axis\n vis.chartArea\n .append(\"g\")\n .call(d3.axisLeft(vis.ageScale).tickValues([40, 50, 60, 70, 80, 90]));\n\n // define x-axis\n vis.chartArea\n .append(\"g\")\n .attr(\"transform\", `translate(0,${vis.innerHeight})`)\n .call(d3.axisBottom(vis.yearScale).tickFormat(d3.format(\"\"))); // tickFormat can make x-axis tick's label without comma, like 1,950\n\n // remove path on the axis\n vis.chartArea.selectAll(\"path\").remove();\n\n // define tooltip\n d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"tip\")\n .attr(\"visible\", \"hidden\")\n .style(\"position\", \"absolute\");\n }", "function update() {\n // Update size of the vis\n vis.width(window.innerWidth)\n .height(window.innerHeight);\n\n // Update size of the vis container and redraw\n d3.select('.pv-vis-demo')\n .attr('width', window.innerWidth)\n .attr('height', window.innerHeight)\n .datum(data)\n .call(vis);\n }", "onExport() {\n\t\t// you can do work before running the export using this method\n\t\t// (e.g. re-ordering paths for plotting)\n\t}", "function onPageLoad() { \n drawRegions();\n}", "function drawVisualization() {\n\t\t//default graph as an exampe; for when there is no data running ie the car not in race\n\t\tdata = new google.visualization.DataTable();\n\t\tdata.addColumn('string', 'Example Time'); \n\t\tdata.addColumn('number', 'Example Speed(sec)'); \n\t\tdata.addRows([\n\t\t['56',32],\n\t\t['57', 46],\n\t\t['58', 63],\n\t\t['59', 63],\n\t\t['60', 43]\n\t\t]);\t\n\t\t\n\t\n\t// Sets up options on how the graph will look and feel\n\toptions = {curveType: \"function\",\n \t\t\tbackgroundColor: '#F8F8F8',\n width: 320, height: 180,\n colors: ['#5a2260', \"red\", \"#acf\", \"#1BE032\"],\n legend: {position: 'top'},\n hAxis: {title: 'Time'},\n \tvAxis: {title: 'Speed',\n\t\t\t\t\t\t\t\t\tviewWindow:{\n\t\t\t\t\t\t\t\t\tmin:0 }\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\tcurveType: \"function\",\n\t\t\t\t\t\ttitle: 'Real Time Stats',\n\t\t\t\t\t\tanimation:{\n\t\t\t\t\t\tduration: 1000,\n\t\t\t\t\t\teasing: 'linear'\n }\n }\n\t \n // Create the graph\n chart = new google.visualization.LineChart(document.getElementById('visualization'));\n chart.draw(data, options);\n }", "function renderCallback(renderConfig) {\n\n\t\tvar chart = renderConfig.moonbeamInstance;\n\t\tvar props = renderConfig.properties;\n\n\t\tchart.legend.visible = false;\n\n\t\tprops.width = renderConfig.width;\n\t\tprops.height = renderConfig.height;\n\t\t//props.data = renderConfig.data;\n\n\t\tprops.data = (renderConfig.data || []).map(function(datum){\n\t\t\tvar datumCpy = jsonCpy(datum);\n\t\t\tdatumCpy.elClassName = chart.buildClassName('riser', datum._s, datum._g, 'bar');\n\t\t\treturn datumCpy;\n\t\t});\n\n\t\tprops.buckets = renderConfig.dataBuckets.buckets;\n\t\tprops.formatNumber = renderConfig.moonbeamInstance.formatNumber;\n\n\t\tprops.isInteractionDisabled = renderConfig.disableInteraction;\n\n\t\tvar container = d3.select(renderConfig.container)\n\t\t\t.attr('class', 'tdg_marker_chart');\n\n\t\tprops.onRenderComplete = function() {\n console.log(container);\n renderConfig.modules.tooltip.updateToolTips();\n renderConfig.renderComplete();\n }\n\t\tvar marker_chart = tdg_marker(props);\n\n\n\t\tmarker_chart(container);\n\n\t}", "function Visualizer() {\n return <h1> Visualizer is working </h1> \n}", "function drawVisualization() {\r\n var style = \"bar-color\";//document.getElementById(\"style\").value;\r\n var showPerspective = true;//document.getElementById(\"perspective\").checked;\r\n // var withValue = [\"bar-color\", \"bar-size\", \"dot-size\", \"dot-color\"].indexOf(style) != -1;\r\n\r\n // Create and populate a data table.\r\n data = [];\r\n\r\n var color = 0;\r\n var steps = 3; // number of datapoints will be steps*steps\r\n var axisMax = 8;\r\n var axisStep = axisMax / steps;\r\n for (var x = 0; x <= axisMax; x += axisStep+1) {\r\n for (var y = 0; y <= axisMax; y += axisStep) {\r\n var z = Math.random();\r\n if (true) {\r\n data.push({\r\n x: x,\r\n y: y,\r\n z: z,\r\n style: {\r\n fill: colors[color],\r\n stroke: colors[color+1]\r\n }\r\n });\r\n }\r\n else {\r\n data.push({ x: x, y: y, z: z });\r\n }\r\n }\r\n color+=1;\r\n }\r\n\r\nvar category = [\"A\",\"B\",\"C\",\"D\"];\r\nvar cat_count = 0;\r\n // specify options\r\n var options = {\r\n width:'100%',\r\n style: style,\r\n xBarWidth: 2,\r\n yBarWidth: 2,\r\n showPerspective: showPerspective,\r\n showShadow: false,\r\n keepAspectRatio: true,\r\n verticalRatio: 0.5,\r\n xCenter:'55%',\r\n yStep:2.5,\r\n xStep:3.5,\r\n animationAutoStart:true,\r\n animationPreload:true,\r\n showShadow:true,\r\n \r\n yLabel: \"Categories (of Abuse)\",\r\n xLabel: \"Groups\",\r\n zLabel: \"Reports\",\r\n yValueLabel: function (y) {\r\n if(y == 0){\r\n return \"Category \" + category[y];\r\n }else{\r\n return \"Category \" +category[Math.ceil(y/3)];\r\n }\r\n },\r\n \r\n xValueLabel: function(x) {\r\n if(x == 0){\r\n return \"Group 1\";\r\n }else{\r\n return \"Group \" + (Math.ceil(x/3));\r\n }\r\n },\r\n tooltip: function(data){\r\n var res = \"\";\r\n if(data.x == 0){\r\n res += \"<strong>Group 1</strong>\";\r\n }else{\r\n res += \"<strong>Group</strong> \" + (Math.ceil(data.x/3));\r\n }\r\n\r\n if(data.y == 0){\r\n res+= \"<br><strong>Category</strong> \" + category[data.y];\r\n }else{\r\n res+= \"<br><strong>Category</strong> \" +category[Math.ceil(data.y/3)];\r\n }\r\n\r\n res+= \"<br><strong>Reports</strong> \" + data.z;\r\n return res;\r\n }\r\n };\r\n\r\n\r\n var camera = graph ? graph.getCameraPosition() : null;\r\n\r\n // create our graph\r\n var container = document.getElementById(\"mygraph\");\r\n graph = new vis.Graph3d(container, data, options);\r\n\r\n if (camera) graph.setCameraPosition(camera); // restore camera position\r\n/*\r\n document.getElementById(\"style\").onchange = drawVisualization;\r\n document.getElementById(\"perspective\").onchange = drawVisualization;\r\n document.getElementById(\"xBarWidth\").onchange = drawVisualization;\r\n document.getElementById(\"yBarWidth\").onchange = drawVisualization;*/\r\n}", "updateChart () {\n \n }", "_chartistLoaded() {\n this.__chartistLoaded = true;\n this._renderChart();\n }", "afterRender() { }", "afterRender() { }", "updateDemographicChart() {\n const population = this.model.getAllPopulation();\n this.demographicsChart.receiveUpdate(population);\n }", "function regionUpdate(){\n setPlot(regionSel.value);\n}", "function changePageFormat(obj) {\n var plotTemplate = obj[obj.selectedIndex].value;\n if (polygonGraphic != null) {\n removeDatashopPolygon(polygonGraphic);\n polygonGraphic = null;\n }\n addPlotFrame(plotTemplate);\n updatePlotFrameButtons();\n onMovePlotFrame();\n}", "init() {\n // setting up metadata section\n $meta = $sel.append('div')\n .attr('class', 'meta__container')\n\n const $title = $meta.append('h3')\n .attr('class', 'letters-title')\n .text(position === 'first' ? 'Names that start with...' : 'Names that end with...')\n\n\n\t\t\t\t// setting up viz section\n $vizCont = $sel.append('div')\n .attr('class', 'chart__container')\n\n\t\t\t\t// setting up legend\n\t\t\t\t$legend = $sel.append('div')\n\t\t\t\t\t.attr('class', 'letters-legend')\n\n\n\n\t\t\t\tconst $legendScale = $legend.append('div')\n\t\t\t\t\t.attr('class', 'letters-legend-scale')\n\n\t\t\t\tconst $legendLeft = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-left')\n\n\t\t\t\tconst $legendSpace = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-space')\n\n\t\t\t\tconst $legendRight = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-right')\n\n\t\t\t\tconst scale = [0, 4, 8]\n\n\t\t\t\tconst $gLeft = $legendLeft.selectAll('tick')\n\t\t\t\t\t.data(scale)\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr('class', 'tick')\n\n\t\t\t\t$gLeft.append('span')\n\t\t\t\t\t.text(d => `${d}%`)\n\n\t\t\t\tconst $gRight = $legendRight.selectAll('tick')\n\t\t\t\t\t.data(scale)\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr('class', 'tick')\n\n\t\t\t\t$gRight.append('span')\n\t\t\t\t\t.text(d => `${d}%`)\n\n\t\t\t\tconst $legendLabels = $legend.append('div')\n\t\t\t\t\t.attr('class', 'legend-labels')\n\n\t\t\t\t$legendLabels.append('p')\n\t\t\t\t\t.attr('class', 'letters-legend letters-legend-society')\n\t\t\t\t\t.text('More common in society')\n\n\t\t\t\t$legendLabels.append('p')\n\t\t\t\t\t.attr('class', 'letters-legend letters-legend-song')\n\t\t\t\t\t.text('More common in songs')\n\n\n\n\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function colorChangeGraphIt(instance) {\n//$.getScript(\"visualize.jQuery.js\",function(){\n//$('.visualize').trigger('visualizeRefresh');\n//there could be ten types of instances 1&2, 3&4, ... ,19&20\n $orange = '#d85a1a';\n\t$yellow = '#d8c41a';\n $gray = '#adadad';\nif(instance==0) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '1', barGroupMargin:'10',colors:[$orange,$yellow,$gray,$gray,$gray,$gray,$gray,$gray,$gray, $gray]});\n//zero line attempt\n//$(\".graphTable1\").visualize({type: 'line', width: '180px', height: '200px',colors:[$gray]});\n\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$orange,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\nif(instance==1) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '1', barGroupMargin:'10',colors:[$gray,$gray,$orange,$yellow,$gray,$gray,$gray,$gray,$gray, $gray]});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\nif(instance==2) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '4', barGroupMargin:'20',colors:[$orange,$yellow,$gray,$gray,$gray,'#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\nif(instance==3) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '4', barGroupMargin:'20',colors:[$orange,$yellow,$gray,$gray,$gray,'#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\nif(instance==4) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '4', barGroupMargin:'20',colors:[$orange,$yellow,$gray,$gray,$gray,'#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\nif(instance==5) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '4', barGroupMargin:'20',colors:[$orange,$yellow,$gray,$gray,$gray,'#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}if(instance==6) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '4', barGroupMargin:'20',colors:[$orange,$yellow,$gray,$gray,$gray,'#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\nif(instance==7) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '4', barGroupMargin:'20',colors:[$orange,$yellow,$gray,$gray,$gray,'#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\nif(instance==8) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '4', barGroupMargin:'20',colors:[$orange,$yellow,$gray,$gray,$gray,'#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\nif(instance==9) {\n$(\".graphTable1\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '4', barGroupMargin:'20',colors:[$orange,$yellow,$gray,$gray,$gray,'#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable2\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:[$gray,'#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable3\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n$(\".graphTable4\").visualize({type: 'bar', width: '180px', height: '250px', barMargin: '20', barGroupMargin:'20',colors:['#d85a1a','#d8c41a','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']});\n}\n\n//self.visualize(o, $(this).empty()); \n\n\tinstance++;\n//});\n}", "function displayData(data,viewtype){\n // Check if init function exists in data from call\n if (data.initFunc != \"\"){ \n var init = window[data.initFunc];\n if(typeof init === 'function') {\n // Draw the graph or display \"not enough info\" tabpane\n if(!init(data)) {\n displayNei();\n }\n }\n }\n hideLoadingIcon(viewtype);\n \n }", "function new_vis(){\r\n var pic = document.getElementById(\"vis\");\r\n var x;\r\n \r\n //Clear any previous drawings\r\n while (pic.hasChildNodes()) { pic.removeChild(pic.lastChild); }\r\n \r\n //Draw new graph if data is available.\r\n if (data_avail) {\r\n var cell, header, myCanvas;\r\n\r\n //Add Collapsable icon.\r\n cell = document.createElement(\"img\");\r\n cell.setAttribute(\"src\", \"IMG/Collapse.JPG\");\r\n cell.setAttribute(\"onClick\", \"visualization(false)\")\r\n pic.appendChild(cell);\r\n \r\n //Add Header\r\n cell = document.createElement(\"caption\");\r\n header = document.createTextNode(\"Web Crawler Search Results - Visualization\");\r\n cell.appendChild(header);\r\n cell.setAttribute(\"id\", \"vis_header\");\r\n pic.appendChild(cell);\r\n\r\n //Create Visualization Background:\r\n myCanvas = createCanvas(vis_width, vis_height);\r\n myCanvas.parent(\"vis\");\r\n strokeWeight(4);\r\n rectMode(CORNER);\r\n rect(0, 0, vis_width, vis_height, 20);\r\n \r\n //Draw lines first:\r\n stroke(color(0, 0, 0));\r\n strokeWeight(3);\r\n noFill();\r\n for (x = 1; x < vis_count; x++){\r\n var c = {x:0, y:0};\r\n var p = {x:0, y:0};\r\n var horiz_shift;\r\n \r\n //Identify node locations\r\n c.x = node_locations[x][0] + center_adjust;\r\n c.y = node_locations[x][1];\r\n p.x = node_locations[x][2] + center_adjust;\r\n p.y = node_locations[x][3];\r\n horiz_shift = ((c.x + p.x) / 3);\r\n\r\n //Draw connecting curve.\r\n curve(c.x, c.y + 450, c.x, c.y, p.x, p.y, p.x, p.y - 450);\r\n }\r\n\r\n //Draw nodes & #'s' next:\r\n textSize(25);\r\n textStyle(NORMAL);\r\n stroke(color(0, 0, 128));\r\n strokeWeight(4);\r\n for (x = 0; x < vis_count; x++){\r\n var shift;\r\n strokeWeight(4);\r\n fill(256,256,256);\r\n //Turn node red if termination node.\r\n if (terminated && x == node_locations.length - 1) { stroke(color(256, 0, 0)); }\r\n ellipse(node_locations[x][0] + center_adjust, node_locations[x][1], 50, 50);\r\n if (x < 9) { shift = 7; }\r\n else { shift = 14; }\r\n stroke(color(0, 0, 128));\r\n strokeWeight(1);\r\n fill(0, 0, 70);\r\n text(x + 1, node_locations[x][0] - shift + center_adjust, node_locations[x][1] + 8);\r\n }\r\n\r\n //Add Page Titles to Node.\r\n textSize(11);\r\n textStyle(NORMAL);\r\n textAlign(CENTER);\r\n rectMode(CENTER);\r\n color(128);\r\n for (x = 0; x < vis_count; x++){\r\n //Draw white background so title can be read against lines:\r\n noStroke();\r\n fill(256,256,256);\r\n rect(node_locations[x][0] + center_adjust, node_locations[x][1] + 33, 6.5 * node_locations[x][4].length, 11);\r\n //Print title:\r\n stroke(color(0, 0, 128));\r\n strokeWeight(1);\r\n fill(0, 0, 70);\r\n text(node_locations[x][4], node_locations[x][0] + center_adjust, node_locations[x][1] + 36);\r\n }\r\n\r\n //Draw Visualization Key (\"0 - Webpage Found 0(red) - Page contained termination keyword, Web_Crawl terminated.\")\r\n //Seperating Line:\r\n stroke(color(0, 0, 0));\r\n strokeWeight(2);\r\n line(25, vis_height - 85, vis_width - 25, vis_height - 85);\r\n\r\n //Key Header:\r\n textSize(18);\r\n textStyle(BOLD);\r\n stroke(color(0, 0, 128));\r\n strokeWeight(1);\r\n text(\"KEY:\", 50, vis_height - 42);\r\n \r\n //Basic Node Image:\r\n stroke(color(0, 0, 128));\r\n strokeWeight(4);\r\n fill(256,256,256);\r\n ellipse(115, vis_height - 50, 50, 50);\r\n //Termination Node Image\r\n stroke(color(256, 0, 0));\r\n ellipse(320, vis_height - 50, 50, 50);\r\n\r\n //Node Labels\r\n textStyle(NORMAL);\r\n textSize(25);\r\n stroke(color(0, 0, 128));\r\n strokeWeight(1);\r\n fill(0, 0, 70);\r\n text(\"ID\", 116, vis_height - 42);\r\n text(\"ID\", 321, vis_height - 42);\r\n textSize(11);\r\n text(\"Page Title\", 115, vis_height - 14);\r\n text(\"Page Title\", 321, vis_height - 14);\r\n\r\n //Add Explaination Text\r\n textSize(13);\r\n textStyle(NORMAL);\r\n stroke(color(0, 0, 70));\r\n strokeWeight(1);\r\n text(\"- Webpage Found\", 198, vis_height - 44);\r\n text(\"-\", 355, vis_height - 44);\r\n textAlign(LEFT)\r\n text(\"Webpage contained termination keyword\", 362, vis_height - 49);\r\n text(\"Web Crawl terminated\", 362, vis_height - 35);\r\n \r\n //Add Play/Pause Buttons Images and functionality.\r\n var section, div, cell, images, funct, i;\r\n \r\n //Define Images & Function Calls to add.\r\n images = [\"IMG/Restart.JPG\", \"IMG/StepBack.JPG\", \"IMG/Pause.JPG\", \"IMG/Play.JPG\", \"IMG/StepFwd.JPG\", \"IMG/End.JPG\"];\r\n funct = [\"cont_reset()\", \"cont_back()\", \"cont_pause()\", \"cont_play()\", \"cont_fwd()\", \"cont_end()\"];\r\n\r\n //Add Player Control Images with onclick() functions to div following visualization.\r\n section = document.getElementById(\"vis\");\r\n div = document.createElement(\"div\");\r\n div.setAttribute(\"id\", \"control\");\r\n for (i = 0; i < images.length; i++){\r\n cell = document.createElement(\"img\");\r\n cell.setAttribute(\"src\", images[i]);\r\n cell.setAttribute(\"onclick\", funct[i]);\r\n div.appendChild(cell); \r\n }\r\n section.appendChild(div);\r\n }\r\n \r\n //Otherwise only draw expandable icon and header. results only == null at page load when we want to draw nothing.\r\n else if (results != null){\r\n var cell, header;\r\n \r\n //Add Collapsable icon.\r\n cell = document.createElement(\"img\");\r\n cell.setAttribute(\"src\", \"IMG/Expand.JPG\");\r\n cell.setAttribute(\"onClick\", \"visualization(true)\")\r\n pic.appendChild(cell);\r\n \r\n //Add Header\r\n cell = document.createElement(\"caption\");\r\n header = document.createTextNode(\"Web Crawler Search Results - Visualization\");\r\n cell.appendChild(header);\r\n cell.setAttribute(\"id\", \"vis_header\");\r\n pic.appendChild(cell);\r\n }\r\n}", "function initViz() {\n console.log(\"loadingviz\");\n viz = new tableau.Viz(vizContainer, url, options);\n}", "function initialize() {\n\t\t\n\t\tsvg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"overflow\", \"visible\").attr(\"class\", \"vizuly\");\n\t\tbackground = svg.append(\"rect\").attr(\"class\", \"vz-background\");\n\t\tdefs = vizuly2.util.getDefs(viz);\n\t\tplot = svg.append('g');\n\t\t\n\t\tscope.dispatch.apply('initialized', viz);\n\t}", "function DisplayDrawingResultPage(result){\n\t//alert(result['F2']['category'])\n\tresult=JSON.stringify(result)\n\tconsole.log(result)\n\tobj1 = JSON.parse(result);\n\tresult= obj1['message']\n\tShowResult()\n\t\n\t$(\".Result-Pane\").replaceWith('<div class =\"Result-Pane\"> <div class=\"Return-To-Drawing\"><a href=\"javascript: HideResult()\">Back To Drawing</a></div>\t<br/> </div> ');\n\t\n\t//$(\".Result-Pane\").append('<div id=\"chartdiv\" style=\"height:300px;width:300px; \"></div>')\n\t//var plot1=$.jqplot('chartdiv', [[[1, 2],[3,5.12],[3,-90],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);\n\n\tvar a='<br/><br/><br/>';\t\n\t//The whole array\n\tfor(var x in result){\n\t\t\n\t\tif(x!='Calculated' && result[x].Type!='Member'){\n\t\t\ta+=\"<h4> Name of Part: \"+x+\"</h4>\"\n\t\t\tfor(var y in result[x]){//properties of the part \n\t\t\t\tif(y!=\"servx1\" && y!=\"servy1\" && y!=\"servx2\" && y!=\"servy2\"){\n\t\t\t\t\ta+=\"<h5>\"+y+\": \"+result[x][y]+\" </h5>\"\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\ta+=\"<br/><br/>\"\n\t\t}\n\t\telse if(result[x].Type=='Member'){\n\t\t\ta+=\"<h4> Name of Part: \"+x+\"</h4>\"\n\t\t\tfor(var y in result[x]){\n\t\t\t\tif(y!=\"ShearDiagram\"){//properties of the member\n\t\t\t\t\ta+=\"<h5>\"+y+\": \"+result[x][y]+\" </h5>\"\n\t\t\t\t}\n\t\t\t\telse if (y==\"ShearDiagram\"){//For shear Diagrams\n\t\t\t\t\t//a+=\"<br/>\"\n\t\t\t\t\ta+=\"<h5><b>Shear Diagram</b></h5>\"\n\t\t\t\t\ta+='<div id=\"chartdiv_'+x+'\" style=\"height:300px;width:300px; \"></div>';\n\t\t\t\t\t$(\".Result-Pane\").append(a);\n\t\t\t\t\ta='';\n\t\t\t\t\tname='chartdiv_'+x;\n\t\t\t\t\t//alert(name);\n\t\t\t\t\tvar plot1=$.jqplot(name, [result[x].ShearDiagram]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}//properties of the part \n\t\t\ta+=\"<br/><br/>\"\n\t\t}\n\t\t\n\t}\n\t\n\t//add everything to all result part\n\tfor (var x in result){\n\t\tif(result[x].type==\"Member\"){\n\t\t\tpart = new Object();\n\t\t\tpart.name = result[x].name;\n\t\t\t//for(attached in result[x].)\n\t\t}\n\t}\n\t\n\t//$.jqplot('chartdiv' , [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);\n\t\n\tconsole.log(result)\n\t$(\".Result-Pane\").append(a)\n\t\n\t//Display the result pane\n\t//ShowResult()\n\t\n}", "function currentGraphShown() {\n if(current_graphic[0] === \"monthly\" ) {\n callMonthly(current_graphic[1]);\n } else if(current_graphic[0] === \"dayly\") {\n callDayly();\n } else {\n callYearly();\n }\n}", "function salesHeatmap() {}", "async function makeVisualization(){\n {\n console.log(\"loading local data\");\n data = await getData('dataSelection.json');\n }\n console.log({ data });\n \n setupScales();\n setupAxes(group);\n drawBars(group);\n setupInput();\n }", "render(_visData, _status) {\n this.chart.resize();\n updateData();\n\n return new Promise(resolve => {\n resolve('when done rendering');\n });\n }", "_afterRender () {\n this.adjust();\n }", "function display(data) {\n \n // create a new plot and\n // display it\n plot = scrollVis();\n d3.select('#vis')\n .datum(data)\n .call(plot);\n\n // setup scroll functionality\n var scroll = scroller().container(d3.select('#graphic'));\n scroll(d3.selectAll('.step'));\n \n // setup event handling\n scroll.on('active', function (index) {\n\n if( tjb.isReloaded==true ){\n index = 0;\n tjb.isReloaded=false;\n }\n else{\n index = index;\n }\n \n onScrolling(index);\n });\n}", "function get_plot_info_on_page(worksheet){\n var parent = $(worksheet).find('.update-plot').parent();\n\n function variable_values(label){\n var result;\n if(parent.find('.'+label).find(\":selected\").attr(\"type\") == \"gene\"){\n result = { url_code : parent.find('[variable=\"'+ label + '\"] #search-term-select').find(\":selected\").val()};\n } else {\n result = { url_code: parent.find('.'+label).find(\":selected\").val()}\n }\n if (result.url_code == \"-- select a variable--\"){\n result.url_code = \"\";\n }\n return result;\n }\n\n var result = {\n worksheet_id : $(worksheet).find('.update-plot').attr(\"worksheet_id\"),\n plot_id : $(worksheet).find('.update-plot').attr(\"plot_id\"),\n selections : {\n x_axis : get_values($(worksheet).find('.x-axis-select').find(\":selected\")),\n y_axis : get_values($(worksheet).find('.y-axis-select').find(\":selected\")),\n color_by : get_simple_values(parent.find('#color_by')),\n gene_label: get_simple_values(parent.find('#gene_label'))\n },\n attrs : {\n type : parent.parentsUntil(\".worksheet-body\").find(\".plot_selection\").find(\":selected\").text(),\n x_axis : variable_values('x-axis-select'),\n y_axis : variable_values('y-axis-select'),\n color_by: {url_code: parent.find('#color_by').find(\":selected\").val()},\n cohorts: parent.find('[name=\"cohort-checkbox\"]:checked').map(function () {\n return {id: this.value, cohort_id: $(this).attr(\"cohort-id\")};\n }).get(),\n gene_label: parent.find('#gene_label').find(\":selected\").text()\n }\n }\n\n return result;\n }", "function aboutPage()\n {\n // did we already download that?\n if (app.graphs === void 0) {\n $.getJSON(\"static/js/graphs.json\", function(graphs) {\n app.graphs = graphs;\n\n // mutate once to turn 0.75(...) to 75.(...)\n app.graphs.forEach(function (graph) {\n graph.series.forEach(function (member) {\n member.data.forEach(function (datum, _i, data) {\n // mutate array members\n data[_i] = (datum * 100);\n });\n });\n });\n\n // key iteration\n app.graphs.forEach(function (graph) {\n drawLineGraph(graph.title, {series: graph.series}, graph.time, graph.title);\n });\n });\n\n } else {\n // key iteration\n $(\"#line-graphs\").empty();\n\n app.graphs.forEach(function (graph) {\n drawLineGraph(graph.title, {series: graph.series}, graph.time, graph.title);\n });\n }\n\n // Clear graph content and about page if there\n //$('#metro-pie-charts').empty()\n //$('#census-pie-charts').empty()\n }", "function updateViz() {\n el.removeData(); // clear out $.cache so calls to $.fn.data will work\n\n // Update value\n svg.select(\".value\").text(data.value);\n\n var threshold = svg.select(\"#threshold\"),\n currentValue = scaleValue(data.value);\n\n if (orientation === 'vertical') {\n\n svg.select(\".fg\")\n .transition()\n .duration(tweenDuration)\n .attr('height', currentValue)\n .attr('y', height - currentValue);\n\n // (data.threshold !== null)? threshold.attr('display', 'visible').attr('y', height - scaleValue(data.threshold)): threshold.attr('display', 'none');\n } else {\n\n svg.select(\".fg\")\n .transition()\n .duration(tweenDuration)\n .attr('width', currentValue);\n\n // (data.threshold !== null)? threshold.attr('display', 'visible').attr('x', width - scaleValue(data.threshold)): threshold.attr('display', 'none');\n }\n\n }", "function refreshInteractiveElements(){\r\n $.logEvent('[dataVisualization.core.refreshInteractiveElements]');\r\n \r\n var interactiveTypeObj;\r\n \r\n $.each(dataVisualization.configuration.loadSequence,function(){\r\n interactiveTypeObj = this.id.split('-');\r\n \r\n if(typeof(window[this.id]) == 'object'){ \r\n // window[this.id].validateNow();\r\n \r\n // Re-draw the centre percentage value for all instances of donut charts\r\n //if(interactiveTypeObj[0] == 'donut'){\r\n // $('#' + this.id).donutChart('createCentreValue');\r\n //}\r\n }\r\n });\r\n }", "draw() {\n this.plot = this.svg.append('g')\n .classed(\"plot\", true)\n .attr('transform', `translate(${this.margin.left},${this.margin.top})`);\n\n // Add the background\n this.plot.append(\"rect\")\n .attrs({\n fill: \"white\",\n x: 0,\n y: 0,\n height: this.innerHeight,\n width: this.innerWidth\n });\n\n if ( this.opts.nav !== false ) {\n this.drawNav();\n }\n\n // Add the title\n this.svg.append('text')\n .attr('transform', `translate(${this.width / 2},${this.margin.top / 2})`)\n .attr(\"class\", \"chart-title\")\n .attr('x', 0)\n .attr('y', 0)\n .text(this.title);\n }", "drawPlot(){\n\n // Insert HTML elements\n\n d3.select(\".dataviz-element\").remove(); // remove old element\n d3.select(\".viz-header\").remove(); // remove old header\n const container = d3.select(\".dataviz-elements\");\n const header = container.append(\"div\")\n .attr(\"class\", \"dataviz-element\")\n .attr(\"id\", \"dataviz-scatterplot\")\n .append(\"div\")\n .attr(\"class\", \"viz-header--scatterplot\");\n header.append(\"div\")\n .attr(\"class\", \"viz-header__text--scatterplot\")\n .html(\"Scatterplot</br>\")\n .append(\"text\")\n .text(\"Click to view building on map.\");\n\n // Create svg\n\n d3.select('#dataviz-scatterplot').append('div').attr('id', 'chart-view');\n let mainSvg=d3.select('#chart-view')\n .append('svg').classed('plot-svg', true)\n .attr(\"width\", this.width + this.margin.left + this.margin.right)\n .attr(\"height\", this.height + this.margin.top + this.margin.bottom);\n\n mainSvg.attr('xlmns','http://www.w3.org/2000/svg').attr('xmlns:xlink','http://www.w3.org/1999/xlink').append('filter').attr('id','shadow').append('feGaussianBlur').attr('in','SourceGraphic').attr('stdDeviation',3)\n mainSvg.append('g').attr('id','BG_g').append('rect').attr('x','1%').attr('y','1%')\n .attr('width','98%').attr('height','98%')\n .style('filter','url(#shadow)').style('fill','#a2a2a2').classed('BG_rect',true);\n mainSvg.select('#BG_g').append('rect').attr('x','2%').attr('y','2%')\n .attr('width','96%').attr('height','96%')\n .style('fill','#d9d9d9').classed('BG_rect',true);\n d3.select('#chart-view').select('.plot-svg').append('g').classed(\"brush\", true);\n let svgGroup = d3.select('#chart-view').select('.plot-svg').append('g').classed('wrapper-group', true);\n\n // Add axes\n\n svgGroup.append('g').attr('id', 'axesX');\n svgGroup.append('g').attr('id', 'axesY');\n svgGroup.append('text').attr('id', 'axesXlabel').attr('x',0).attr('y',0)\n svgGroup.append('text').attr('id', 'axesYlabel').attr('x',0).attr('y',0)\n\n // Create dropdown panel\n\n let dropdownWrap = d3.select('#chart-view').append('div').classed('dropdown-wrapper', true);\n let cWrap = dropdownWrap.append('div').classed('dropdown-panel', true);\n\n // Add legend and axis labels\n\n cWrap.append('div').classed('c-label', true)\n .append('text')\n .text('Circle Size').classed('SP_DD_text',true);\n\n cWrap.append('div').attr('id', 'dropdown_c').classed('dropdown', true).append('div').classed('dropdown-content', true)\n .append('select');\n\n let xWrap = dropdownWrap.append('div').classed('dropdown-panel', true);\n\n xWrap.append('div').classed('x-label', true)\n .append('text')\n .text('X Axis Data').classed('SP_DD_text',true);\n\n xWrap.append('div').attr('id', 'dropdown_x').classed('dropdown', true).append('div').classed('dropdown-content', true)\n .append('select');\n\n let yWrap = dropdownWrap.append('div').classed('dropdown-panel', true);\n\n yWrap.append('div').classed('y-label', true)\n .append('text')\n .text('Y Axis Data').classed('SP_DD_text',true);\n\n yWrap.append('div').attr('id', 'dropdown_y').classed('dropdown', true).append('div').classed('dropdown-content', true)\n .append('select');\n\n d3.select('#chart-view')\n .append('div')\n .classed('circle-legend', true)\n .append('svg').attr('width', 250)\n .append('g').classed('sizeLegend',true)\n .attr('transform', 'translate(0, 0)');\n d3.select('#chart-view')\n .select('.circle-legend').select('svg')\n .append('g').classed('typeLegend',true);\n\n // Draws default scatterplot and dropdown behavior\n\n this.updatePlot('DamageRatio', 'GroundAcceleration(m/s2)', 'Stories')\n this.drawDropDown('DamageRatio', 'GroundAcceleration(m/s2)', 'Stories')\n this.lineRender()\n\n }", "function showVizChartForSelectedSegment() {\n\n let metric_col = selviz_metric;\n // show actual speeds in chart, not A-F LOS categories\n if (selviz_metric == 'los_hcm85') metric_col = 'auto_speed';\n\n if (_selectedGeo) {\n let segmentData = _allCmpData\n .filter(row => row.cmp_segid == _selectedGeo.cmp_segid)\n .filter(row => row[metric_col] != null);\n buildChartHtmlFromCmpData(segmentData);\n } else {\n buildChartHtmlFromCmpData();\n }\n}", "static rendered () {}", "static rendered () {}", "function renderAll() {\n chart.each((method, index, arr) => {\n render(method, index, arr);\n });\n drawAllValueNumbers();\n }", "initVis(){\n let vis = this;\n\n // empty initial filters\n vis.filters = [];\n // Set a color for dots\n vis.color = d3.scaleOrdinal()\n // Adobe Color Analogous\n .range([\"#F7DC28\", \"#D9AE23\", \"#D98A23\", \"#F77E28\", \"#F0B132\"])\n // set color domain to number of census years\n .domain(v2RectData.map(d => d.count).reverse())\n\n // set a color for background boxes\n vis.rectColor = d3.scaleOrdinal()\n //https://colorbrewer2.org/#type=sequential&scheme=Greys&n=7\n .range(['#f7f7f7','#d9d9d9','#bdbdbd','#969696','#737373','#525252','#252525'])\n .domain(v2RectData.map(d=>d.id))\n\n // Set sizing of the SVG\n vis.margin = {top: 40, right: 10, bottom: 20, left: 10};\n vis.width = $(\"#\" + vis.parentElement).width() - vis.margin.left - vis.margin.right;\n vis.height = $(\"#\" + vis.parentElement).height() - vis.margin.top - vis.margin.bottom;\n vis.buffer = 40;\n\n // For the dots\n // Scale the cells on the smaller height or width of the SVG\n // let cellScaler = vis.height > vis.width ? vis.width: vis.height;\n vis.cellHeight = vis.width / (15 * v2RectData.length) ;\n vis.cellWidth = vis.cellHeight;\n vis.cellPadding = vis.cellHeight / 4;\n\n // For the rects\n vis.rectPadding = 10;\n vis.rectWidth = vis.width/(v2RectData.length) - vis.rectPadding; // fit all the rects in width wise\n vis.rectHeight = vis.rectWidth; //square\n\n\n // init drawing area\n vis.svg = d3.select(\"#\" + vis.parentElement).append(\"svg\")\n .attr(\"width\", vis.width)\n .attr(\"height\", vis.height)\n .attr('transform', `translate (0, ${vis.margin.top})`);\n\n // append a tooltip\n vis.tooltip = d3.select(\"body\").append('div')\n .attr('class', \"tooltip\")\n .attr('id', 'distanceVisToolTip');\n\n // The cell group that *must underlay* the rectangles for rect hover\n vis.cellGroup = vis.svg.append(\"g\")\n .attr(\"class\", \"cell-group\")\n // slightly more offset than the rect group\n .attr(\"transform\", `translate(0, ${vis.buffer + 3 * vis.cellPadding})`);\n\n\n // The background rectangle group that *overlays* the dots (for hover) ----\n vis.rectGroup = vis.svg.append(\"g\")\n .attr(\"class\", \"rect-container\")\n // move down to give room to legend\n .attr(\"transform\", `translate(0, ${vis.buffer})`);\n\n // ------ build a grid of cells ---\n vis.rects = vis.rectGroup\n .selectAll(\".census-rect\")\n .data(v2RectData)\n .enter()\n .append(\"rect\")\n .attr(\"class\", d =>`census-rect rect-${d.id}`)\n .attr(\"x\", (d,i) => i * vis.rectWidth + vis.rectPadding)\n .attr(\"y\", (d,i) => vis.rectPadding) // same y for each rect //Math.floor(i % 100 / 10);\n .attr(\"width\", d => d.id === \"NV\" ? vis.rectWidth/3 : vis.rectWidth)\n .attr(\"height\", vis.rectHeight)\n .attr(\"fill\", \"#f7f7f7\")\n .attr(\"stroke\", \"black\")\n .attr(\"opacity\", d => {\n if (d.count === 0) {\n return 0; // because nothing falls into 0 census with the current attribute set\n } else {\n return 0.3 // for dots to to be seen through it\n }\n })\n .attr(\"stroke-width\", 4)\n .on('mouseover', function(event, d) {\n vis.handleMouseOver(vis, event, d);\n })\n .on('mouseout', function(event, d) {\n vis.handleMouseOut(vis, event, d);\n });\n\n // legend to describe the color and shape\n vis.legend = vis.svg.append('g')\n .attr('class', 'v2-legend-group')\n .attr(\"transform\", `translate(0, 10)`);\n\n // All top row labels to the rectangles\n vis.labelTopGroup = vis.svg.append('g')\n .attr('class', 'v2-label-group-top')\n .attr(\"transform\", `translate(10, 20)`);\n\n vis.labels = vis.labelTopGroup\n .selectAll(\".census-rect-label-top\")\n .data(v2RectData)\n .enter()\n .append(\"text\")\n .attr(\"class\", \"census-rect-label-top\")\n .attr(\"x\", (d,i) => i * vis.rectWidth )\n .attr(\"y\", 0)\n .style(\"fill\", \"black\")\n .text(d => {\n return ` ${d.title}`;\n })\n .attr(\"text-anchor\", \"center\")\n .style(\"alignment-baseline\", \"middle\")\n\n // Add labels to the rectangles\n vis.labelGroup = vis.svg.append('g')\n .attr('class', 'v2-label-group')\n .attr(\"transform\", `translate(10, 40)`);\n\n vis.labels = vis.labelGroup\n .selectAll(\".census-rect-label\")\n .data(v2RectData)\n .enter()\n .append(\"text\")\n .attr(\"class\", \"census-rect-label\")\n .attr(\"x\", (d,i) => i * vis.rectWidth )\n .attr(\"y\", 0)\n .style(\"fill\", \"black\")\n .text(d => {\n return ` ${d.name}`;\n })\n .attr(\"text-anchor\", \"center\")\n .style(\"alignment-baseline\", \"middle\")\n\n vis.wrangleStaticData();\n }", "onRendererBeginPage(page) {\n var _a;\n const model = page.model;\n const builder = new LegendBuilder();\n // immediate children\n this.buildLegend(model, builder);\n // top level items (as appears in navigation)\n (_a = this._project.children) === null || _a === void 0 ? void 0 : _a.forEach((reflection) => {\n if (reflection !== model) {\n this.buildLegend(reflection, builder);\n }\n });\n page.legend = builder.build().sort((a, b) => b.length - a.length);\n }", "get Charting() {}" ]
[ "0.6461024", "0.64574647", "0.62805665", "0.6276297", "0.62708634", "0.6232274", "0.6221378", "0.62108576", "0.6189503", "0.6139483", "0.61315024", "0.6118983", "0.60692227", "0.6065836", "0.60617703", "0.6053029", "0.6041915", "0.60339653", "0.6032007", "0.6012257", "0.59938145", "0.5980014", "0.59781563", "0.59613913", "0.59536594", "0.5951964", "0.5950469", "0.59429586", "0.59399116", "0.59389734", "0.5932494", "0.5928457", "0.5910075", "0.5907842", "0.59064084", "0.590389", "0.59012073", "0.59008443", "0.5895534", "0.589384", "0.5892495", "0.5883841", "0.5874329", "0.5868333", "0.58506656", "0.58476835", "0.58468765", "0.5838748", "0.583691", "0.5825972", "0.5824066", "0.5823435", "0.58194345", "0.5816864", "0.5814638", "0.5800769", "0.58004194", "0.57957745", "0.5776342", "0.57729244", "0.576089", "0.5758984", "0.5748367", "0.5742189", "0.57416344", "0.5732927", "0.5728991", "0.5724587", "0.57083154", "0.57055867", "0.5703883", "0.5703883", "0.56980014", "0.5697187", "0.56867176", "0.56843495", "0.5682728", "0.568187", "0.5668221", "0.5661467", "0.56474", "0.5646323", "0.5645833", "0.5643433", "0.56418276", "0.5638729", "0.5638301", "0.56377536", "0.5633708", "0.56303596", "0.5617646", "0.561717", "0.56136066", "0.5612807", "0.5597774", "0.5596432", "0.5596432", "0.55946505", "0.5593993", "0.5593804", "0.55919427" ]
0.0
-1
Creates the bar chart
drawBarChart() { this.recalculateSizes(); // calculate sizes before drawing // Remove existing bar chart svg d3.select("div." + this.barClass) .select("svg") .remove(); // Create new svg for the bar chart this.svg = d3 .select("div." + this.barClass) .append("svg") .attr("width", this.width) .attr("height", this.height); // alter this dynamically // Finding the maximum number of times a rule has been suggested. // Used to calculate bar width later this.maxSuggested = 0; for (let i = 0; i < this.data.length; i++) { if (this.data[i].num_suggested > this.maxSuggested) { this.maxSuggested = this.data[i].num_suggested; } } // Sorting data to display it in descending order this.data.sort((a, b) => (a.num_suggested < b.num_suggested ? 1 : -1)); // Drawing the rectangles based on times the rule has been suggested this.svg .selectAll("rect.totalRect") .data(this.data) .enter() .append("rect") .attr("fill", "white") .style("fill-opacity", 1e-6) .attr("stroke", "black") .attr("x", this.width * 0.1) .attr("y", (d, i) => { return i * this.barHeight * 2 + 50; }) .attr("height", this.barHeight) .attr("width", d => (d.num_suggested / this.maxSuggested) * 0.8 * this.width) .attr("class", "totalRect") .on("mouseover", (d, i) => { // Shows more statistics when mousing over this.popUp(d, i); }) .on("mouseout", (d, i) => { // Removes the popup from mouseover this.clearPopUp(d, i); }); // Drawing the rectanbles for number of times the rule has been accepted this.svg .selectAll("rect.acceptedRect") .data(this.data) .enter() .append("rect") .attr("fill", "green") .attr("stroke", "black") .attr("x", this.width * 0.1) .attr("y", (d, i) => { return i * this.barHeight * 2 + 50; }) .attr("height", this.barHeight) .attr("width", d => (d.num_accepted / this.maxSuggested) * 0.8 * this.width) .attr("class", "acceptedRect") .on("mouseover", (d, i) => { // Shows more statistics when mousing over this.popUp(d, i); }) .on("mouseout", (d, i) => { // Removes the popup from mouseover this.clearPopUp(d, i); }); // Drawing the rectangles for number of times the rule has been rejected this.svg .selectAll("rect.rejectedRect") .data(this.data) .enter() .append("rect") .attr("fill", "red") .attr("stroke", "black") .attr("x", d => { // Starting where the accepted rectangle ends return this.width * 0.1 + (d.num_accepted / this.maxSuggested) * 0.8 * this.width; }) .attr("y", (d, i) => { return i * this.barHeight * 2 + 50; }) .attr("height", this.barHeight) .attr("width", d => (d.num_rejected / this.maxSuggested) * 0.8 * this.width) .attr("class", "rejectedRect") .on("mouseover", (d, i) => { // Shows more statistics when mousing over this.popUp(d, i); }) .on("mouseout", (d, i) => { // Removes the popup from mouseover this.clearPopUp(d, i); }); // Displaying information about the rule above each bar this.svg .selectAll("text.ruleText") .data(this.data) .enter() .append("text") .text(d => { // LHS -> RHS - confidence: 0.xx (2 decimal places) return d.lhs + " \u2192 " + d.rhs + " - confidence: " + d.confidence.toFixed(2); }) .attr("font-family", this.fontType) .attr("font-size", this.textSize) .attr("y", (d, i) => { return i * this.barHeight * 2 + 45; }) .attr("x", this.width * 0.1) .attr("class", "ruleText"); // Displaying the number of times the rule has been suggested to the right of the bar this.svg .selectAll("text.numText") .data(this.data) .enter() .append("text") .text(d => d.num_suggested) .attr("font-family", this.fontType) .attr("font-size", this.textSize) .attr("y", (d, i) => { return i * this.barHeight * 2 + 50 + (this.barHeight * 3) / 4; }) .attr("x", d => { return this.width * 0.1 + (d.num_suggested / this.maxSuggested) * 0.8 * this.width + 5; }) .attr("class", "numText"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chartBar(){//creating a function which draws the chart when it is called (the code in the function is ran)\n\t\tvar chart = new Chart(ctx, {//creating a new chart\n\t\t type: 'bar',//selecting the type of chart wanted\n\t\t data: dataForChart, //calling dataset\n\t\t\t options:{\n\t\t\t \ttitle:{//adding a title\n\t\t\t \t\tdisplay: true,//displaying a title\n\t\t\t \t\ttext: \"Inquest Conclusions Recorded in England and Wales 2010-2015\",//choosing the text for the title\n\t\t\t \t\tfontSize:20,//changing the font size of the title\n\t\t\t \t}\n\t\t\t },\n\t\t});\n\t}", "function createBar(){\n\t\t\n\t\t/*get the # of values in the clicked dataset*/\n\t\tvalueCount = clickedData.map(d=>d.value).length;\n\n\t\t/*define margins around extra chart area*/\n\t\tvar margin_extraChart = {\n\t\t top: 60 * screenRatio,\n\t\t right: 90 * screenRatio,\n\t\t bottom: 100 * screenRatio,\n\t\t left: 100 * screenRatio\n\t\t};\n\n\t\t/*calculate extra chart area dimensions*/\n\t\tvar width_extraChart = svgWidth_extraChart - margin_extraChart.left - margin_extraChart.right;\n\t\tvar height_extraChart = svgHeight_extraChart - margin_extraChart.top - margin_extraChart.bottom;\n\n\t\t/*create the SVG container and set the origin point of extra chart*/\n\t\tvar svg_extraChart = d3.select(\"#extraChartSection\").append(\"svg\")\n\t\t .attr(\"id\",\"barChart\")\n\t\t .attr(\"width\", svgWidth_extraChart)\n\t\t .attr(\"height\", svgHeight_extraChart);\n\n\t\tvar extraChartGroup = svg_extraChart.append(\"g\")\n\t\t .attr(\"transform\", `translate(${margin_extraChart.left}, ${margin_extraChart.top})`)\n\t\t .attr(\"class\",\"extraChart\"); \n\n\t\t/*add titles to the extra chart area*/\n\t\tvar extraTitle = svg_extraChart.append(\"g\").append(\"text\")\n\t\t .attr(\"class\", \"extra title\")\n\t\t .attr(\"text-anchor\", \"middle\")\n\t\t .attr(\"x\", (width_extraChart + margin_extraChart.left) / 2 + 50 * screenRatio)\n\t\t .attr(\"y\", 20 * screenRatio)\n\t\t .style(\"font-weight\", \"bold\")\n\t\t .style(\"font-size\", 20 * screenRatio + \"px\")\n\t\t .text(\"Breakdown of Violent Crimes\");\n\n\t\tvar extraTitle = svg_extraChart.append(\"g\").append(\"text\")\n\t\t .attr(\"class\", \"extra title\")\n\t\t .attr(\"text-anchor\", \"middle\")\n\t\t .attr(\"x\", (width_extraChart + margin_extraChart.left) / 2 + 50 * screenRatio)\n\t\t .attr(\"y\", 40 * screenRatio)\n\t\t .style(\"font-weight\", \"bold\")\n\t\t .style(\"font-size\", 16 * screenRatio + \"px\")\n\t\t .text(`${clickedState}, Year ${clickedYear}`);\n\t\t\t \n\t\t\n\n\n\t\t/*configure a band scale for the y axis with a padding of 0.1 (10%)*/\n\t\tvar yBandScale_extraChart = d3.scaleBand()\n\t\t\t.domain(clickedData.map(d => d.type).reverse())\n\t\t\t.range([height_extraChart,0])\n\t\t\t.paddingInner(0.01);\n\n\n\t\t/*create a linear scale for the x axis*/\n\t\tvar xLinearScale_extraChart = d3.scaleLinear()\n\t\t\t.domain([0, d3.max(clickedData.map(d => d.value))])\n\t\t\t.range([0,width_extraChart]);\n\n\t\t/*add y axis*/\n\t\tvar leftAxis_extraChart = d3.axisLeft(yBandScale_extraChart);\n\n\t\t/*assign data to donut(pie) chart*/\n\t\tvar pie = d3.pie()\n\t .value(d => d.value)\n\n\t /*define arc to create the donut chart*/\n\t var arc = d3.arc()\n\t \t.cornerRadius(3)\n\n\t\t/*create color scale for extra charts */\n\t\tvar colorScale_extraChart = d3.scaleOrdinal()\n\t\t\t.range([\"#98abc5\", \"#7b6888\", \"#a05d56\", \"#ff8c00\"]);\n\n\t\t/*bind data to bars*/\n\t\tvar bars = extraChartGroup.selectAll(\".barGroup\")\n\t\t .data(function() {\n\t return pie(clickedData);\n\t \t})\n\t\t .enter()\n\t\t .append(\"g\")\n\t\t .attr(\"class\", \"barGroup\");\n\n\t\t/*create bars*/\n\t\tbars.append(\"rect\")\n\t\t .attr(\"width\", 0)\n\t\t .attr(\"height\", yBandScale_extraChart.bandwidth())\n\t\t .attr(\"x\", 0)\n\t\t .attr(\"y\", function(data,index) {\t\t \n\t\t \treturn index * (yBandScale_extraChart.bandwidth() + 1);\n\t\t \t})\n\t\t .attr(\"rx\",5)\n\t\t .attr(\"yx\",5)\n\t\t .style(\"fill\",function(d) {\n\t\t return colorScale_extraChart(d.data.type);\n\t\t })\n\t\t .attr(\"class\",\"bar\")\n\t\t .on(\"mouseover\", function() {highlight(d3.select(this))} )\n\t\t .on(\"mouseout\", function() {unhighlight(d3.select(this))} )\n\t\t .transition()\n\t\t \t.duration(500)\n\t\t \t.attr(\"width\", d => xLinearScale_extraChart(d.data.value))\n\n\t\t/*add the path of the bars and use it to draw donut chart*/\n\t\textraChartGroup.selectAll(\".barGroup\")\n\t\t\t.append(\"path\")\n\t .style(\"fill\",function(d) {\n\t\t return colorScale_extraChart(d.data.type);\n\t\t })\n\n\t\taddBarAxis();\n\n\t\t/*define a function to add y axis to the bar chart*/\n\t\tfunction addBarAxis () {\n\t\t\textraChartGroup.append(\"g\")\n\t\t\t .attr(\"class\", \"barYAxis\")\n\t\t\t .style(\"font-size\", 13 * screenRatio + \"px\")\n\t\t\t .call(leftAxis_extraChart);\n\t\t}\n\t\t\t\n\t\t/*show bar values half second later after the bars are created*/\n\t\tsetTimeout(addBarValues, 500);\n\n\t\t/*define a function to add values to the bar chart*/\n\t\tfunction addBarValues () {\n\t\t\textraChartGroup.append(\"g\").selectAll(\"text\")\n\t\t\t .data(clickedData)\n\t\t\t .enter()\n\t\t\t .append(\"text\")\n\t\t \t\t .attr(\"class\",\"barValues\")\n\t\t\t \t .style(\"font-size\", 11 * screenRatio + \"px\")\n\t\t\t \t .attr(\"x\",d => xLinearScale_extraChart(d.value) + 5)\n\t\t\t \t .attr(\"y\",function(data,index) {\n\t\t\t\t\t return index * height_extraChart / valueCount + 5 + yBandScale_extraChart.bandwidth() / 2;\n\t\t\t\t\t })\n\t\t\t \t .text(d=>d.value + \" per 100K\")\n\t\t}\n\t\t\t\n\t\t/*define a function to switch to donut(pie) chart when the Pie button is clicked*/\n\t\tfunction toPie() {\n\t\t\t/*remove bar chart if it exists*/\n\t\t\tif (document.querySelector(\"#barChart\")) {\n\t\t\t\td3.selectAll(\".bar\").remove();\n\t\t\t\td3.selectAll(\".barYAxis\").remove();\n\t\t\t\td3.selectAll(\".barValues\").remove();\n\t\t\t\t\n\t\t\t\t/*use the bar chart's path to start the transition to donut(pie) chart*/\n\t\t\t\textraChartGroup.selectAll(\"path\")\n\t\t\t .transition()\n\t\t\t .duration(500)\n\t\t\t .tween(\"arc\", arcTween);\n\n\t\t\t /*\n\t\t\t define the function used to do tween on arc.\n\t\t\t \n\t\t\t credits to https://bl.ocks.org/LiangGou/30e9af0d54e1d5287199, codes have been modified.\n\n\t\t\t the idea here is to first draw an arc like a bar,\n\t\t\t then tween the bar-like arc to the donut arc. \n\t\t\t\tThus, the key is to find the initial bar size and position:\n\t\t\t\tThe initial bar width is approximated by the length of \n\t\t\t\toutside arc: barWidth = OuterRadius * startAngle. \n\t\t\t\tSo we can get the startAngle shown in arcArguments below;\n\t\t\t\t(Note that: the measure of angle in d3 starts from vertical y:\n\t\t\t\t y angle\n\t\t\t\t | / \n\t\t\t\t | / \n\t\t\t\t | / \n\t\t\t\t |o/\n\t\t\t\t |/ \n\t\t\t\t ) \n\n\t\t\t\t*/\n\t\t\t function arcTween(d) {\t\t\t \n\t\t\t /*define the path of each tween*/\n\t\t\t var path = d3.select(this);\n\t\t\t /*get the starting y position of each bar*/\n\t\t\t var y0 = d.index * yBandScale_extraChart.bandwidth();\n\t\t\t \n\t\t\t return function(t) {\n\t\t\t /*t starts from 0 and ends with 1. Use cosine to calculate a, a stepping factor that changes from 1 to 0*/\n\t\t\t var a = Math.cos(t * Math.PI / 2);\n\t\t\t /*define radius r as a function of chart height. at the beginning, t is 0 so r is very big, which can render \n\t\t\t the arc like a bar. when t changes to 1, r is reduced to chart height or 1/2 of height based on device screen size*/\n\t\t\t var r = (1 + a) * height_extraChart / (windowWidth > 992? 1 : 2) / Math.min(1, t + .005);\n\t\t\t /*define xx and yy as the central position of arc, and xx and yy change with stepping factor a, until it becomes\n\t\t\t (1/2 of width, height)*/\n\t\t\t var yy = r + a * y0;\n\t\t\t var xx = ((1 - a) * width_extraChart / 2);\n\t\t\t \n\t\t\t /*define arguments used to create arc*/\n\t\t\t var arcArguments = {\n\t\t\t /*inially the delta between inner and outer radius is the bandwidth or height of bar */\n\t\t\t innerRadius: (1-a) * r * .5 + a * (r - yBandScale_extraChart.bandwidth()),\n\t\t\t outerRadius: r,\n\t\t\t /*start and end angle come from d3.pie() created earlier when data was bound to bars, and keeps changing \n\t\t\t with stepping factor a*/\n\t\t\t startAngle: (1 - a) * d.startAngle,\n\t\t\t endAngle: a * (Math.PI / 2) + (1 - a) * d.endAngle\n\t\t\t };\n\n\t\t\t /*shift the central locations of the arc and generate the arc*/\n\t\t\t path.attr(\"transform\", `translate(${xx},${yy})`);\n\t\t\t console.log(xx,yy,r);\n\t\t\t path.attr(\"d\", arc(arcArguments));\n\t\t\t \n\t\t\t /*create events on the path*/\n\t\t\t path.on(\"mouseover\",showSliceInfo);\n\t\t\t path.on(\"mouseout\",hideSliceInfo);\n\n\t\t\t\t\t /*define a function to highlight and display info of each bar or slice of donut chart when moused over*/\n\t\t\t\t\t function showSliceInfo() {\n\t\t\t\t\t\t\t/*for donut/pie chart, highlight the selection and show relevant info*/\n\t\t\t\t\t\t\tconsole.log(\"check\",xx,yy,r);\n\t\t\t\t\t\t\tif(document.querySelector(\"#pieChart\")) {\n\t\t\t\t\t\t\t\tvar slice = d3.select(this)\n\t\t\t\t\t\t\t\t\t.attr(\"stroke\",\"#fff\")\n\t\t \t\t\t\t.attr(\"stroke-width\",\"2px\");\n\t\t\t\t\t\t\t\t/*get the index of which slice has been selected*/\n\t\t\t\t\t\t\t\tvar sliceIndex = (slice._groups[0][0].__data__.index);\n\t\t\t\t\t\t\t\tvar sliceType = clickedData[sliceIndex].type;\n\t\t\t\t\t\t\t\tvar slicePercent = clickedData[sliceIndex].percent;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/*display info of highlighted slice*/\n\t\t\t\t\t\t\t\tsvg_extraChart.append(\"g\").append(\"text\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"crimeType\")\n\t\t\t\t\t\t\t\t .attr(\"text-anchor\", \"middle\")\n\t\t\t\t\t\t\t\t .style(\"font-size\", 18 * screenRatio + \"px\")\n\t\t\t\t\t\t\t\t .attr(\"x\",xx + margin_extraChart.left) /*from the arc center, add the same margin as bar chart and its path shifted*/\n\t\t\t\t\t\t\t\t .attr(\"y\",yy + margin_extraChart.top - 5 * screenRatio) /*from the arc center, add the same margin as bar chart and its path shifted*/\n\t\t\t\t\t\t\t\t .text(`${sliceType}`);\n\n\t\t\t\t\t\t\t\tsvg_extraChart.append(\"g\").append(\"text\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"crimePercent\")\n\t\t\t\t\t\t\t\t .attr(\"text-anchor\", \"middle\")\n\t\t\t\t\t\t\t\t .style(\"font-size\", 14 * screenRatio + \"px\")\n\t\t\t\t\t\t\t\t .attr(\"x\",xx + margin_extraChart.left) /*from the arc center, add the same margin as bar chart and its path shifted*/\n\t\t\t\t\t\t\t\t .attr(\"y\",yy + margin_extraChart.top + 20 * screenRatio) /*from the arc center, add the same margin as bar chart and its path shifted*/\n\t\t\t\t\t\t\t\t .text(function () {\n\t\t\t\t\t\t\t\t \treturn d3.format(\".1%\")(`${slicePercent}`);\n\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t/*for bar charts, just highlight the selected bar*/\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar selection = d3.select(this);\n\t\t\t\t\t\t\t\thighlight(selection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*define a function to remove highlight and info when mouse out*/\n\t\t\t\t\t\tfunction hideSliceInfo() {\n\t\t\t\t\t\t\tif(document.querySelector(\"#pieChart\")) {\n\t\t\t\t\t\t\t\tvar slice = d3.select(this)\n\t\t\t\t\t\t\t\t\t.attr(\"stroke\",\"none\");\n\n\t\t \t\t\td3.select(\".crimeType\").remove();\t\n\t\t \t\t\td3.select(\".crimePercent\").remove();\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar selection = d3.select(this);\n\t\t\t\t\t\t\t\tunhighlight(selection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t };\n\t\t\t }\n\t\t\t}\n\n\t\t\t/*after pie chart is created, change the chart ID to pieChart*/\n\t\t\td3.select(\"#extraChartSection\").select(\"svg\")\n\t\t\t\t\t.attr(\"id\",\"pieChart\");\n\t\t\t}\n\n\t\t\t/*define a function to switch to bar chart when the Bar button is clicked*/\n\t\t\tfunction toBar() {\t\t\t\t\n\t\t\t\tif (document.querySelector(\"#pieChart\")) {\n\t\t\t\t\textraChartGroup.selectAll(\"path\")\n\t\t\t\t .transition()\n\t\t\t\t .duration(500)\n\t\t\t\t .tween(\"arc\", arcTween);\t\t\t\t \n\n\t\t\t\t function arcTween(d) {\n\t\t\t\t \n\t\t\t\t var path = d3.select(this);\n\t\t\t\t \n\t\t\t\t /*define the original y position and width of bars so that when arc is created, the finishing position\n\t\t\t\t and length of arc will be the same as the bars*/\n\t\t\t\t var y0 = d.index * yBandScale_extraChart.bandwidth();\n\t\t\t\t var x0 = xLinearScale_extraChart(d.data.value);\n\t\t\t\t \n\t\t\t\t return function(t) {\t\t\t\t \n\t\t\t\t /*reverse the t so that it changes from 1 to 0, and a changes from 0 to 1.\n\t\t\t\t the donut chart is generated backwards until it appears like a bar chart*/\n\t\t\t\t t = 1 - t;\n\t\t\t\t var a = Math.cos(t * Math.PI / 2);\n\t\t\t\t var r = (1 + a) * height_extraChart / Math.min(1, t + .005);\n\t\t\t\t var yy = r + a * y0;\n\t\t\t\t var xx = (1 - a) * width_extraChart / 2;\n\t\t\t\t var arcArguments = {\n\t\t\t\t innerRadius: r - yBandScale_extraChart.bandwidth() + 1,\n\t\t\t\t outerRadius: r,\n\t\t\t\t startAngle: (1 - a) * d.startAngle,\n\t\t\t\t endAngle: a * (x0 / r) + (1 - a) * d.endAngle\n\t\t\t\t };\n\n\t\t\t\t path.attr(\"transform\", `translate(${xx},${yy})`);\n\t\t\t\t path.attr(\"d\", arc(arcArguments));\n\t\t\t\t };\t\t\t\t \n\t\t\t\t }\n\n\t\t\t\t /*create the y axis and values for the bar chart with some time delays*/\n\t\t\t\t setTimeout(addBarAxis, 600);\n\t\t\t\t setTimeout(addBarValues, 600);\n\n\t\t\t\t /*change the chart ID to barChart*/\n\t\t\t\t d3.select(\"#extraChartSection\").select(\"svg\")\n\t\t\t\t\t.attr(\"id\",\"barChart\");\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t/*create click event for bar button and pie button*/\n\t\t\td3.select(\"#barButton\").on(\"click\",toBar);\n\t\t\td3.select(\"#pieButton\").on(\"click\",toPie);\n\t\t}", "function createBars(data, options) {\n // Calculating bar width given the spacing of the bars\n var numberOfBars = data.length;\n var xAxisLength = $(\"#chartarea\").width();\n var barWidth = (xAxisLength - ((numberOfBars + 1) * parseInt(options.barspacing)))/numberOfBars;\n barWidth = Math.floor(barWidth);\n var yScale = yAxis(data, options)[1];\n var barHeight;\n var barColour;\n var barStartPosition;\n\n //for loop that creates the bars for each of the data\n for (var i = 0; i < data.length; i++) {\n barStartPosition = 0;\n //Calculate x offset from y axis\n var xOffset = (i * barWidth) + ((i + 1) * parseInt(options.barspacing));\n var barId = \"bar\" + i;\n for ( var j = 0; j < data[i].length; j++) {\n barId = barId + j;\n barHeight = data[i][j] * yScale;\n drawBar(data, options, barId, xOffset, barHeight, barWidth, options.barcolour[j], barStartPosition, i, j);\n barStartPosition += barHeight;\n if(j === 0) {\n xAxisLabels(options.datalabels[i], barId);\n }\n }\n\n }\n\n // sets CSS formatting options for all bars, data and labels\n $(\".bar\").css({\n \"width\": barWidth,\n \"margin\": 0,\n \"padding\": 0,\n \"border\": 0\n });\n\n // formats the x labels in the color defined in options\n $(\".xaxislabels\").css({\"color\": options.datalabelcolor,\n \"top\": \"100%\",\n \"padding\": \"5%\"\n });\n\n $(\".xaxislabels, .xaxisdata\").css({ \"border\": \"0\",\n \"margin-bottom\": \"2%\",\n \"margin-top\": \"2%\",\n \"padding\": \"0\",\n \"position\": \"absolute\",\n \"text-align\": \"center\",\n \"width\": \"100%\",\n \"font-size\": \"small\"\n })\n}", "function createBarChart(debits_by_councilman) {\n var data = [];\n var labels = [];\n var backgroundcolor = [];\n var bordercolor = [];\n\n $.each(debits_by_councilman, function (key, val) {\n data.push(val.toFixed(2));\n labels.push(key);\n backgroundcolor.push(get_rgb_randon())\n bordercolor.push(get_rgb_randon_border())\n });\n\n var ctx = document.getElementById(\"barChart\");\n var stackedBar = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: 'R$ ',\n data: data,\n backgroundColor: backgroundcolor,\n borderColor: bordercolor,\n borderWidth: 1\n }],\n },\n options:[]\n });\n}", "function barChart(a, b) {\n\n var data = new google.visualization.arrayToDataTable(barArray, false);\n var chartOptions = {\n title: a,\n width: 400,\n height: 300,\n\n };\n\n var chart = new google.visualization.BarChart(document.getElementById(b));\n\n chart.draw(data, chartOptions);\n }", "function drawBar() {\n\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'Date');\n data.addColumn('number', 'Issues');\n\n data.addRows(self.charts.bars.rows);\n\n var options = self.charts.bars.options;\n\n var chart2 = new google.visualization.ColumnChart(\n document.getElementById('chart_div2'));\n\n chart2.draw(data, options);\n }", "function createBarChart(data, h, w) {\n\tconst svg = createSvg(h, w);\n\n\tconst yScale = d3.scaleLinear()\n\t\t\t\t\t\t\t\t\t .domain([0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\td3.max(data, function(d) { return d[1] })])\n\t\t\t\t\t\t\t\t\t .range([0, h]);\n\n\tconst padding = 1;\n\tconst barWidth = 4;\n\n\t//add rectangles\n\tsvg.selectAll(\"rect\")\n\t .data(data)\n\t .enter()\n\t .append(\"rect\")\n\t\t .attr(\"x\", function(d,i) { return i * barWidth})\n\t\t .attr(\"y\", function(d, i) { return h - yScale(d[1])})\n\t\t .attr(\"width\", barWidth - padding)\n\t\t .attr(\"height\", function(d, i) { return yScale(d[1]) })\n\t\t .attr(\"class\", \"bar\");\n\n}", "function renderBarChart() {\n drawAxisCalibrations();\n var i, j, p, a, x, y, w, h, len;\n\n if (opts.orient === \"horiz\") {\n rotate();\n }\n\n drawAxis();\n\n ctx.lineWidth = opts.stroke || 1;\n ctx.lineJoin = \"miter\";\n\n len = sets[0].length;\n\n // TODO fix right pad\n for (i = 0; i < sets.length; i++) {\n for (j = 0; j < len; j++) {\n p = 1;\n a = rotated ? height : width;\n w = ((a / len) / sets.length) - ((p / sets.length) * i) - 1;\n x = (p / 2) + getXForIndex(j, len + 1) + (w * i) + 1;\n y = getYForValue(sets[i][j]);\n h = y - getYForValue(0) || !isNaN(opts.mapZeroValueTo) && +opts.mapZeroValueTo || 0;\n\n if (isStacked()) {\n // TODO account for negative and positive values in same stack\n w = (a / len) - 2;\n x = getXForIndex(j, len + 1);\n //y = getYForValue(sumY(sets.slice(0, i + 1), j));\n \n // Accounting for negative and positive values in same stack\n y = getYForValue(sumYSigned(sets, i, j));\n }\n\n drawRect(colorOf(i), x, y, w, h);\n }\n }\n }", "function drawBars() {\n\n xScale.domain(d3.range(actividades_jaca.length));\n yScale.domain([0, d3.max(actividades_jaca, function(d) {\n return +d.value;\n })]);\n\n bar_color.domain(d3.range(function(d) {\n return d.act_descripcion;\n }));\n var myBars = svgBar.selectAll('svgBar').data(actividades_jaca);\n\n myBars.enter()\n .append('rect')\n .attr('class', 'addon')\n .attr('x', function(d, i) {\n return xScale(i);\n })\n .attr('y', function(d) {\n return height - yScale(d.value);\n })\n .attr('width', xScale.rangeBand())\n .attr('height', function(d) {\n return yScale(d.value);\n })\n .attr('fill', function(d) {\n return bar_color(d.act_descripcion);\n })\n .on('mouseover', function(d) {\n d3.select(this)\n .style('stroke-width', 0.5)\n .style('stroke', 'red');\n tooltipTitle.html(d.act_descripcion);\n tooltipTotal.html(d.value);\n })\n .on('mouseout', function() {\n d3.select(this)\n .style('stroke-width', 0);\n tooltipTitle.html('Número de empresas');\n tooltipTotal.html(totalActividades);\n });\n }", "function newBarChart(selected) {\r\n var otu_ids = selected[0].otu_ids.slice(0,10).reverse();\r\n var sample_values = selected[0].sample_values.slice(0,10).reverse();\r\n var labels = selected[0].otu_labels.slice(0,10).reverse();\r\n var otu_string = otu_ids.map(x => \"OTU\" + x.toString());\r\n var updatedTrace = {\r\n x: [sample_values],\r\n y: [otu_string],\r\n text: [labels]\r\n };\r\n Plotly.restyle(\"bar\", updatedTrace);\r\n }", "function drawBarChart() {\n console.log(\"CALL: drawBarChart\");\n\n if($AZbutton.hasClass(\"active\"))\n filteredUserData = _.sortBy(filteredUserData, function(obj) { return obj.data; });\n else\n {\n filteredUserData = _.sortBy(filteredUserData, function(obj) { return obj.data; });\n filteredUserData.reverse();\n }\n\n var data = google.visualization.arrayToDataTable(buildBarData());\n\n var chartAreaHeight = data.getNumberOfRows() * 30;\n var chartHeight = chartAreaHeight + 150;\n var heightBar = 60;\n\n var options = {\n title: \"User tags\",\n width: \"100%\",\n height: data.Gf.length == 1? \"100%\" : chartHeight,\n bar: { groupWidth: heightBar + \"%\" },\n legend: { position: 'top', maxLines: 3, textStyle: {fontSize: 13}},\n isStacked: true,\n backgroundColor: 'transparent',\n annotations: {\n alwaysOutside: false,\n textStyle: { color: \"black\"}\n },\n chartArea: {'height': chartAreaHeight, 'right':0, 'top': 100, 'left':150 },\n hAxis: {\n title: \"Number of tagged data\",\n titleTextStyle: { fontSize: 14 },\n textStyle: { fontSize: 13 }},\n vAxis: {\n title: \"User\",\n titleTextStyle: { fontSize: 14 },\n textStyle: { fontSize: 13 }},\n tooltip: { textStyle: {fontSize: 13}}\n };\n var chart = new google.visualization.BarChart(document.getElementById(barChartID));\n chart.draw(data, options);\n }", "function create_bar_chart(data, target, xlabel, ylabel) {\n var default_ylabel = \"Cantidad\";\n $(target + \" svg\").empty();\n nv.addGraph(function() {\n var chart = nv.models.multiBarChart()\n .rotateLabels(0)\n .showControls(true)\n .groupSpacing(0.1)\n .noData('No hay datos en este periodo')\n .forceY([0,5]);\n\n chart.tooltip.enabled();\n\n chart.options({\n showControls: false,\n showLegend: true\n });\n\n chart.yAxis\n .axisLabel(ylabel || default_ylabel)\n .tickFormat(d3.format(',.0'));\n\n chart.xAxis.axisLabel(xlabel).center;\n\n d3.select(target + \" svg\")\n .datum([data])\n .transition()\n .duration(500)\n .call(chart);\n\n nv.utils.windowResize(chart.update);\n chart.update;\n return chart;\n });\n}", "function barchart(listValues) {\n\n // make rectangles for barchart\n var rects = svg.selectAll(\"rect\")\n .data(listValues)\n .enter()\n .append(\"rect\")\n rects.attr(\"x\", function(d, i) {\n return i * ((width - padding)/ listValues.length) + padding;\n })\n .attr(\"y\", function(d) {\n return scaleY(d);\n })\n .attr(\"width\", width / listValues.length - barPadding)\n .attr(\"height\", function(d) {\n return (height - scaleY(d) - padding);\n })\n .attr(\"fill\", function(d) {\n return \"rgb(0, 0, \" + (d * 0.027) + \")\";\n })\n\n // make barchart interactive\n .on('mouseout', function(d) {\n tooltip.style(\"display\", \"none\")\n d3.select(this).attr(\"fill\", function(d) {\n return \"rgb(0,0, \" + (d * 0.027) + \")\"\n });\n })\n .on('mousemove', function(d, i) {\n d3.select(this).attr(\"fill\", \"orange\")\n tooltip.style(\"display\", null);\n tooltip.select(\"text\").text(\"Value: \" + (d) +\n \" thousand toe\" + \", Year: \" + years[i]);\n });\n\n // make x and y axis\n var xAxis = d3.axisBottom(scaleX)\n var yAxis = d3.axisLeft(scaleY)\n\n // append ticks to x-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0,\" + (height - padding) + \")\")\n .call(xAxis);\n\n // append x-label\n svg.append(\"text\")\n .attr(\"class\", \"myLabel\")\n .attr(\"y\", height - 10)\n .attr(\"x\", width / 2)\n .attr('text-anchor', 'middle')\n .text(\"Years\");\n\n // append ticks to y-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + padding + \",0)\")\n .call(yAxis);\n\n // append y-label\n svg.append(\"text\")\n .attr(\"class\", \"myLabel\")\n .attr(\"y\", 10)\n .attr(\"x\", -150)\n .attr('transform', 'rotate(-90)')\n .attr('text-anchor', 'middle')\n .text(\"Values (in thousand toe)\")\n }", "function createBar(pollData, data){\n\n barSVG = d3.select(\".bar_chart\").append(\"svg\")\n .attr(\"width\", barWidth + barMargin.left + barMargin.right + barWidth2 + barMargin2.left + barMargin2.right)\n .attr(\"height\", barHeight + barMargin.top + barMargin.bottom);\n\n //Bar Title\n barTitle = barSVG.append('text')\n .attr(\"fill\", \"#2e3d49\")\n .attr(\"class\", \"chartTitle\")\n .attr('transform', 'translate('+(barMargin.left - 60) + \",\" + (barMargin.top) +')');\n\n if (stateView) {\n barTitle.text(\"Risk Level by Pollutant\");\n } else if (countyClick) {\n barTitle.text(\"Risk Level by Pollutant for \" + selCounty + \", \" + selState);\n } else {\n barTitle.text('Risk Level by Pollutant for ' + selStateName);\n }\n\n focus = barSVG.append(\"g\")\n .attr(\"transform\", \"translate(\" + (barMargin.left) + \",\" + (barMargin.top + 40) + \")\")\n .attr(\"class\",\"focus\");\n\n context = barSVG.append(\"g\")\n .attr(\"class\", \"context\")\n .attr(\"transform\", \"translate(\" + (barMargin.left + barWidth + barMargin.right + barMargin2.left) + \",\" + (barMargin2.top + 40) + \")\");\n\n textScale = d3.scaleLinear()\n .domain([8,75])\n .range([12,6])\n .clamp(true);\n\n xScale = d3.scaleLinear().range([0, barWidth]),\n x2Scale = d3.scaleLinear().range([0, barWidth2]),\n yScale = d3.scaleBand().range([0, barHeight]).paddingInner(0.4),\n y2Scale = d3.scaleBand().range([0, barHeight]).paddingInner(0.4);\n\n //Create axis objects\n xAxis = d3.axisBottom(xScale).ticks(5),\n yAxis = d3.axisLeft(yScale).tickSize(0).tickSizeOuter(0),\n yAxis2 = d3.axisLeft(y2Scale);\n\n pollData.sort(function(a,b) { return b.value.val - a.value.val; });\n\n xScale.domain([0, d3.max(pollData, function(d) { return d.value.val; })]);\n x2Scale.domain([0, d3.max(pollData, function(d) { return d.value.val; })]);\n yScale.domain(pollData.map(function(d) { return d.key; }));\n y2Scale.domain(pollData.map(function(d) { return d.key; }));\n\n var brush = d3.brushY()\n .extent([[0, 0],[barWidth2, barHeight]])\n .on(\"brush\", brushed);\n\n var zoom = d3.zoom()\n .scaleExtent([1, Infinity])\n .translateExtent([[0, 0],[barWidth, barHeight]])\n .extent([[0, 0],[barWidth, barHeight]])\n .on(\"zoom\", zoomed);\n\n // Add the X Axis\n focus.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + barHeight + \")\")\n .call(xAxis);\n\n // Add the Y Axis\n focus.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(-1, 0)\")\n .call(yAxis);\n\n barSVG.append(\"defs\").append(\"clipPath\")\n .attr(\"id\", \"clip\")\n .append(\"rect\")\n .attr(\"width\", barWidth)\n .attr(\"height\", barHeight);\n\n var focus_group = focus.append(\"g\").attr(\"clip-path\", \"url(#clip)\");\n\n var rects = focus_group.selectAll('rect').data(pollData);\n\n //Bar Chart 1\n var newRects1 = rects.enter();\n\n newRects1.append('rect')\n .attr('id', 'mainBars')\n .attr('class', 'bar mainBars')\n .attr('y', function(d, i) {\n return yScale(d.key) + yScale.bandwidth();\n })\n .attr('x', 0)\n .attr('height', 8)\n .attr('width', function(d, i) {\n return xScale(d.value.val);\n })\n .attr('opacity', 0.85)\n .style('fill', '#0086b3')\n .style('stroke', '#0086b3')\n .on(\"click\", function(d) {\n if (!countyClick) {\n if (pollClick) {\n d3.select(selPollBar).style(\"fill\", '#0086b3')\n .style('stroke', '#0086b3');\n }\n pollClick = true;\n selPollBar = this;\n selPoll = d.key;\n if (selState.length > 0) {\n mapTitle.text(selRiskString + ' Assessment for ' + selPoll + ' in '+ selStateName);\n } else if (!countyClick){\n mapTitle.text(selRiskString + \" Assessment for \" + selPoll);\n }\n d3.selectAll(\"button.poll_reset\").style(\"display\", \"inline-block\");\n d3.select(this).style('fill', '#4dd2ff')\n .style('stroke', '#4dd2ff');\n updatePoll(selPoll, data);\n }\n })\n .on(\"mouseover\", function(d){\n d3.select(this).style('fill', '#4dd2ff')\n .style('stroke', '#4dd2ff');\n pollHover(d);\n //Update chloropleth only if there is no county selection\n if (!countyClick) {\n updatePoll(d.key, data);\n }\n })\n .on(\"mouseout\", function(d){\n d3.select(this).style('fill', '#0086b3')\n .style('stroke', '#0086b3');\n hideTip();\n if (pollClick) {\n d3.select(selPollBar).style('fill', '#4dd2ff')\n .style('stroke', '#4dd2ff');\n updatePoll(selPoll, data);\n }\n if (!countyClick) {\n //Update chloropleth only if there is no county selection\n resetPoll();\n }\n });\n\n var focus_group = context.append(\"g\").attr(\"clip-path\", \"url(#clip)\");\n\n var brushRects = focus_group.selectAll('rect').data(pollData);\n\n //Brush Bar Chart\n var brushRects1 = brushRects.enter();\n\n brushRects1.append('rect')\n .attr('class', 'bar miniBars')\n .attr('y', function(d, i) {\n return y2Scale(d.key);\n })\n .attr('x', 0)\n .attr('width', function(d, i) {\n return x2Scale(d.value.val);\n })\n .attr('opacity', 0.85)\n .attr('height', 5)\n .style('fill', '#004d66')\n .style('stroke', '#004d66');\n\n if (pollData.length > 8) { brushExtent = 8;}\n else {brushExtent = pollData.length - 1;}\n\n context.append(\"g\")\n .attr(\"class\", \"brush\")\n .call(brush)\n .call(brush.move, ([y2Scale(pollData[0].key), y2Scale(pollData[brushExtent].key)]));\n\n //create brush function redraw barChart with selection\n function brushed() {\n if (d3.event.sourceEvent && d3.event.sourceEvent.type === \"zoom\") return; // ignore brush-by-zoom\n\n // get bounds of selection\n var s = d3.event.selection,\n nD = [];\n y2Scale.domain().forEach((d)=>{\n var pos = y2Scale(d) + y2Scale.bandwidth()/2;\n if (pos > s[0] && pos < s[1]){\n nD.push(d);\n }\n });\n\n yScale.domain(nD);\n\n focus.selectAll(\".mainBars\")\n .style(\"opacity\", function(d){\n return yScale.domain().indexOf(d.key) === -1 ? 0 : 100;\n })\n .attr(\"y\", function(d) {\n\n // console.log(y.bandwidth(), nD.length);\n return yScale(d.key); //+ yScale.bandwidth()/4;\n })\n .attr(\"x\", 0)\n .attr('width', function(d, i) {\n return xScale(d.value.val)\n })\n .attr('opacity', 0.85)\n .attr('height', yScale.bandwidth()/1.1);\n\n //Update the label size\n d3.selectAll(\".y.axis\")\n .style(\"font-size\", textScale(nD.length) + \"px\");\n\n focus.select(\".y.axis\").call(yAxis);\n\n //Find the new max of the bars to update the x scale\n var newMaxXScale = d3.max(pollData, function(d) {\n return nD.indexOf(d.key) > -1 ? d.value.val : 0;\n });\n xScale.domain([0, newMaxXScale]);\n\n //Update the x axis of the big chart\n d3.select(\".focus\")\n .select(\".x.axis\")\n .transition()\n .duration(250)\n .call(xAxis);\n\n barSVG.select(\".zoom\").call(zoom.transform, d3.zoomIdentity\n .scale(barWidth / (s[1] - s[0]))\n .translate(-s[0], 0));\n }\n\n function zoomed() {\n }\n\n //Highlight the selected pollutant bar after redraw\n if (pollClick) {\n d3.selectAll(\".mainBars\").filter(function(d) {\n return d.key == selPoll;\n }).style(\"fill\", '#4dd2ff').style('stroke', '#4dd2ff');\n }\n}", "function drawBarChart(){\n if(barChartData.length != 0){\n google.charts.load('current', {'packages':['bar']});\n google.charts.setOnLoadCallback(drawChart2);\n function drawChart2(){\n var data = google.visualization.arrayToDataTable(barChartData);\n var options = {\n chart: {\n title: 'Algorithm Performance Comparision',\n vAxis: { title: \"Time taken (in ms)\" },\n hAxis: { title: \"Algorithm\" },\n legend: { position: 'bottom' },\n colors: ['blue','red','green','yellow'],\n }\n };\n var chart = new google.charts.Bar(document.getElementById('algograph'));\n chart.draw(data, google.charts.Bar.convertOptions(options));\n }\n }\n}", "function buildbarchart(option) {\n \n if (option ===\"costsbyyear\") {\n // var trace1 = {\n // x: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n // y: [-3200, -1190, 517.3, 1000, 8.6, 15.4, -2900, -14500, 190.3, 91.3,-1000],\n // name: \"Profits or Loss\",\n // type: \"bar\"\n // // [\"1976\", \"1980\", \"1984\", \"1988\",\"1992\", \"1996\", \"2000\", \"2004\", \"2008\", \"2012\", \"2016\"]\n // };\n var trace2 = {\n x: [\"1976y\", \"1980y\", \"1984y\", \"1988y\",\"1992y\", \"1996y\", \"2000y\", \"2004y\", \"2008y\", \"2012y\", \"2016y\"],\n y: [5100, 6331, 958, 8200, 16200, 2600, 6700, 11500, 47000, 15300, 12000],\n name: \"Total Costs\",\n mode: 'lines+markers',\n type: \"scatter\",\n marker: {\n color: \"purple\",\n },\n };\n var data = [trace2];\n var layout = {\n title: \"Olympic Host City Total Costs\",\n yaxis: {\n title: 'USD (Million)',\n font: {\n family:\"Arial\",\n }, \n } \n }; \n Plotly.newPlot(\"FZbar\", data, layout);\n }\n\n // var data = [\n // {\n // type: 'bar',\n // x: [\"1976\", \"1980\", \"1984\", \"1988\",\"1992\", \"1996\", \"2000\", \"2004\", \"2008\", \"2012\", \"2016\"],\n // y: [500,600,700],\n // base: [-500,-600,-700],\n // marker: {\n // color: 'red'\n // },\n // name: 'expenses'\n // },\n // {\n // type: 'bar',\n // x: ['2016','2017','2018'],\n // y: [300,400,700],\n // base: 0,\n // marker: {\n // color: 'blue'\n // },\n // name: 'revenue'\n // }]\n \n // Plotly.newPlot('myDiv', data);\n \n if (option ===\"byprofit\") { \n var trace1 = {\n x: [\"1988y\",\"1984y\",\"2008y\",\"2012y\",\"1996y\",\"1992y\", \"2016y\", \"1980y\", \"2000y\",\"1976y\",\"2004y\"],\n \n y: [1000, 517.3, 190.3, 91.3,15.4,8.6,-1000,-1190,-2900, -3200,-14500],\n marker:{\n color: [\"rgb(0, 179, 0)\", 'rgb(0, 179, 0)', 'rgb(0, 179, 0)', 'rgb(0, 179, 0)', 'rgb(0, 179, 0)','rgb(0, 179, 0)',\t'rgb(179, 0, 0)',\t'rgb(179, 0, 0)',\n \t'rgb(179, 0, 0)',\t'rgb(179, 0, 0)',\t'rgb(179, 0, 0)']\n },\n\n name: \"Profits or Loss\",\n \n type: \"bar\"\n };\n // var trace2 = {\n // x: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n // y: [8200,958,47000, 15300,2600,16200,12000,6331,6700,5100, 11500], \n // name: \"Total Costs\",\n // mode: \"markers\", \n // type: \"scatter\"\n // };\n var data = [trace1];\n var layout = {\n title: \"Olympic Profits and Fund Loss\", \n yaxis: {\n title: 'USD (Million)',\n font: {\n family:\"Arial\",\n }, \n } \n // <option value=\"byyear\">Profit by Year</option>\n // <option value=\"byprofit\">Profit by amount</option>\n \n }; \n Plotly.newPlot(\"FZbar\", data, layout);\n }\n\n if (option ===\"byyear\") {\n var trace1 = {\n x: [\"1976y\", \"1980y\", \"1984y\", \"1988y\",\"1992y\", \"1996y\", \"2000y\", \"2004y\", \"2008y\", \"2012y\", \"2016y\"],\n y: [-3200, -1190, 517.3, 1000, 8.6, 15.4, -2900, -14500, 190.3, 91.3,-1000],\n name: \"Profits or Loss\",\n marker:{\n color: ['rgb(179, 0, 0)','rgb(179, 0, 0)',\"rgb(0, 179, 0)\", 'rgb(0, 179, 0)',\"rgb(0, 179, 0)\", 'rgb(0, 179, 0)',\n 'rgb(179, 0, 0)', 'rgb(179, 0, 0)','rgb(0, 179, 0)', 'rgb(0, 179, 0)', 'rgb(179, 0, 0)']\n },\n\n \n type: \"bar\"\n };\n // var trace2 = {\n // x: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n // y: [47000, 16200, 15300, 12000, 11500, 8200, 6700, 6331, 5100,2600, 958], \n // name: \"Total Costs\", \n // mode: \"markers\",\n // type: \"scatter\"\n // };\n var data = [trace1];\n var layout = {\n title: \"Olympic Profits or Fund Loss\",\n yaxis: {\n title: 'USD (Million)',\n font: {\n family:\"Arial\",\n }, \n } \n }; \n Plotly.newPlot(\"FZbar\", data, layout);\n }\n\n}", "function drawBarChart(data) {\n\tvar chartData = convertToChartData(data);\n\ttypes = [];\n\tfor (t in accidentTypes) types.push(t);\n\t$(\"#chart\").empty();\n\t$(\"#chart\").jqBarGraph( {\n\t\tdata: chartData,\t// (array) data to show. e.g [ [[5,2,3,1,...,3],'Jan.'], [[2,..,5],'Feb.'], ... [[...],'Dec.']]\n\t\tlegends: types,\t\t// (array) text for each colors in legend \n\t\tlegend: true,\t\t\n\t\tlegendWidth:150,\n\t\tcolors: colors,\t\t// (array) color information for each type\n\t\ttype:false,\t\t\t// stacked bar chart \n\t\twidth:500,\t\t\t\n\t\theight:200,\n\t\tanimate:false, showValues:false\n\t});\n\tattachChartEvents();\n}", "function drawBars(target) {\n const bars = target\n .selectAll('.bar')\n .data(data)\n .enter()\n .append('rect')\n .attr('class', 'bar')\n .attr('x', d => x(d.description))\n .attr('y', d => y(d.capacity))\n .attr('width', x.bandwidth())\n .attr('height', d => height - y(d.capacity));\n }", "function createBarChart(container, data, graphColor, formatComma) {\r\n\r\n var margin = { top: 20, right: 30, bottom: 40, left: 90 };\r\n var axis_margin = 90\r\n\r\n var x = d3.scaleLinear()\r\n .domain([0, d3.max(data, d => d.n)])\r\n .range([0, 0.65 * container.attr('width')]);\r\n\r\n var y = d3.scaleBand()\r\n .range([20, container.attr('height')])\r\n .domain(data.map(d => d.nameCat))\r\n .padding(0.2)\r\n\r\n container.append(\"g\")\r\n .call(d3.axisLeft(y))\r\n .attr(\"transform\", \"translate(\" + axis_margin + \",\" + 0 + \")\")\r\n .attr(\"font-weight\", \"normal\")\r\n\r\n container.selectAll(\"myRect\")\r\n .data(data)\r\n .enter()\r\n .append(\"rect\")\r\n .attr(\"x\", x(0) + axis_margin)\r\n .attr(\"y\", d => y(d.nameCat))\r\n .transition()\r\n .duration(800)\r\n .attr(\"width\", d => x(d.n))\r\n .attr(\"height\", y.bandwidth())\r\n .attr(\"fill\", graphColor)\r\n\r\n // Adds the numbers at the end of the bars\r\n container.selectAll(\"rectText\")\r\n .data(data)\r\n .enter()\r\n .append('text')\r\n .text(d => formatComma(d.n))\r\n .attr(\"x\", d => x(0) + 100)\r\n .attr(\"y\", d => y(d.nameCat) + y.bandwidth() - 0.5)\r\n .transition()\r\n .duration(800)\r\n .attr(\"x\", d => x(d.n) + axis_margin + 8)\r\n .attr(\"y\", d => y(d.nameCat) + y.bandwidth() - 0.5)\r\n\r\n .attr(\"font-size\", 10)\r\n .attr(\"font-weight\", \"normal\")\r\n .attr(\"text-anchor\", \"start\")\r\n\r\n}", "function chartBarChartVertical () {\n\n /* Default Properties */\n var svg = void 0;\n var chart = void 0;\n var classed = \"barChartVertical\";\n var width = 400;\n var height = 300;\n var margin = { top: 20, right: 20, bottom: 20, left: 40 };\n var transition = { ease: d3.easeBounce, duration: 500 };\n var colors = palette.categorical(3);\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n\n /* Chart Dimensions */\n var chartW = void 0;\n var chartH = void 0;\n\n /* Scales */\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = void 0;\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n chartW = width - (margin.left + margin.right);\n chartH = height - (margin.top + margin.bottom);\n\n var _dataTransform$summar = dataTransform(data).summary(),\n seriesNames = _dataTransform$summar.seriesNames,\n columnKeys = _dataTransform$summar.columnKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(columnKeys).range(colors);\n }\n\n xScale = d3.scaleBand().domain(columnKeys).rangeRound([0, chartW]).padding(0.15);\n\n yScale = d3.scaleLinear().domain(valueExtent).range([chartH, 0]).nice();\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias barChartVertical\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n // Create SVG element (if it does not exist already)\n if (!svg) {\n svg = function (selection) {\n var el = selection._groups[0][0];\n if (!!el.ownerSVGElement || el.tagName === \"svg\") {\n return selection;\n } else {\n return selection.append(\"svg\");\n }\n }(selection);\n\n svg.classed(\"d3ez\", true).attr(\"width\", width).attr(\"height\", height);\n\n chart = svg.append(\"g\").classed(\"chart\", true);\n } else {\n chart = selection.select(\".chart\");\n }\n\n // Update the chart dimensions and add layer groups\n var layers = [\"barChart\", \"xAxis axis\", \"yAxis axis\"];\n chart.classed(classed, true).attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\").attr(\"width\", chartW).attr(\"height\", chartH).selectAll(\"g\").data(layers).enter().append(\"g\").attr(\"class\", function (d) {\n return d;\n });\n\n selection.each(function (data) {\n // Initialise Data\n init(data);\n\n // Vertical Bars\n var barsVertical = component.barsVertical().width(chartW).height(chartH).colorScale(colorScale).xScale(xScale).dispatch(dispatch);\n\n chart.select(\".barChart\").datum(data).call(barsVertical);\n\n // X Axis\n var xAxis = d3.axisBottom(xScale);\n\n chart.select(\".xAxis\").attr(\"transform\", \"translate(0,\" + chartH + \")\").call(xAxis);\n\n // Y Axis\n var yAxis = d3.axisLeft(yScale);\n\n chart.select(\".yAxis\").call(yAxis);\n\n // Y Axis Label\n var yLabel = chart.select(\".yAxis\").selectAll(\".yAxisLabel\").data([data.key]);\n\n yLabel.enter().append(\"text\").classed(\"yAxisLabel\", true).attr(\"transform\", \"rotate(-90)\").attr(\"y\", -40).attr(\"dy\", \".71em\").attr(\"fill\", \"#000000\").style(\"text-anchor\", \"end\").merge(yLabel).transition().text(function (d) {\n return d;\n });\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return this;\n };\n\n /**\n * Transition Getter / Setter\n *\n * @param {d3.transition} _v - D3 transition style.\n * @returns {*}\n */\n my.transition = function (_v) {\n if (!arguments.length) return transition;\n transition = _v;\n return this;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function buildCharts() {\n var myChart = Highcharts.chart('barChart', {\n chart: {\n type: 'column'\n },\n title: {\n text: 'So You Think <em> Your </em> Airport Is Crowded?'\n },\n subtitle: {\n text: 'Source: CIA World Factbook'\n },\n xAxis: {\n categories: xCat\n },\n yAxis: {\n title: {\n text: 'Number of People for Every One Airport'\n }\n },\n series: [{\n name: 'Number of People at Every Airport',\n data: numAirports\n }]\n }); //end of Highcharts.chart\n }", "function singleBarChart(data, options, element) {\n\n // extracts needed information from data\n var values = data.values;\n var scale = data.scale;\n\n // extracts needed information from options\n var chartWidth = options.width;\n var chartHeight = options.height;\n var space = options.spacing;\n var colour = options.colour;\n var labelColour = options.labelColour;\n var labelAlign = options.labelAlign;\n\n // updates the size of the area the the chart is rendered into\n $(element).css({width: (chartWidth + 100) + \"px\", height: (chartHeight + 300) + \"px\"});\n\n // creates the chart area that the bars are rendered to\n var chartArea = $(\"<div>\").attr(\"id\", \"chartArea\");\n $(chartArea).css({width: chartWidth + \"px\", height: chartHeight + \"px\"});\n $(element).append(chartArea);\n\n // determines the maximum value to be displayed on the Y axis of the chart and the width of the bars to be displayed\n var maxY = findMaxY(values, scale);\n var barWidth = (chartWidth / values.length) - space;\n var barHeight;\n var i;\n\n for (i = 0; i < values.length; i++) {\n // creates a bar for each value in values\n var bar = $(\"<div>\").addClass(\"bar\");\n\n // determines the bar's height\n barHeight = values[i] / maxY * chartHeight;\n\n // updates the position, colours, and text displayed for the bar\n $(bar).css({width: barWidth + \"px\", height: barHeight + \"px\", marginLeft: (space + i * (barWidth + space)) + \"px\", top: (chartHeight - barHeight) + \"px\", background: colour, color: labelColour});\n $(bar).text(values[i]);\n\n // determines the position of the labels within the bar (\"top\", \"center\", or \"bottom\")\n if (barHeight < 16) {\n $(bar).text(\"\");\n } else if (labelAlign === \"center\") {\n $(bar).css({lineHeight: barHeight + \"px\"});\n } else if (labelAlign === \"bottom\") {\n $(bar).css({lineHeight: (2 * barHeight - 20) + \"px\"});\n } else {\n $(bar).css({lineHeight: 20 + \"px\"});\n }\n\n // appends the bar to the chart area\n $(chartArea).append(bar);\n }\n}", "function barChartSettings(skillArr) {\n\t\t//console.log(\"setting the barchart....\");\n\t\t//svgcMargin = 40;\n\t\t//svgcSpace = 100;\n\t\tsvgcMargin = 60;\n\t\tsvgcSpace = 40;\t\t\n\t\t//svgcHeight = svg.height.baseVal.value - 2 * svgcMargin - svgcSpace;\n\t\tsvgcHeight = svg.height.baseVal.value - 2 * svgcMargin - svgcSpace;\n\t\tsvgcWidth = svg.width.baseVal.value - 2 * svgcMargin - svgcSpace;\n\t\tsvgcMarginSpace = svgcMargin + svgcSpace;\n\t\tsvgcMarginHeight = svgcMargin + svgcHeight;\n\t\t\n\t\t//console.log(\"svgcHeight = \"+svgcHeight);\n\t\t//console.log(\"svgcWidth = \"+svgcWidth);\n\t\t//console.log(\"svgcMarginSpace = \"+svgcMarginSpace);\n\t\t//console.log(\"svgcMarginHeight = \"+svgcMarginHeight);\n\t\t//The Bar Properties\n\t\tbcMargin = 6;\n\t\ttotalChartBars = skillArr.length;\n\t\tbcWidth = (svgcWidth / totalChartBars) - bcMargin;\n\t\t//console.log(\"bcWidth = \"+bcWidth);\n\t\t//Maximum value to plot on chart\n\t\tmaximumDataValue = 0;\n\t\tfor (var i = 0; i < totalChartBars; i++) {\n\t\t var arrVal = skillArr[i].split(\",\");\n\t\t var barVal = parseInt(arrVal[1]);\n\t\t if (parseInt(barVal) > parseInt(maximumDataValue))\n\t\t maximumDataValue = barVal;\n\t\t}\n\t\ttotalLabelOnYAxis = 4;\t\t\n\t}", "function createBarChart(dataMeta, containerID, dataSet, dataSetParameters)\n{\n // Maximum number of items represented on chart\n var maxItems = 50;\n var count = 0;\n\n // Create labels, attributes\n var attr0 = dataSetParameters.attributes[0];\n var attr1 = dataSetParameters.attributes[1];\n var labels = [];\n var attributes = [];\n for (let c = 0; c < dataSet.length; c++)\n {\n if (count < maxItems)\n {\n labels.push(dataSet[c][attr0]);\n attributes.push(dataSet[c][attr1]);\n count++;\n }\n }\n\n // Draw the chart\n var ctx = document.getElementById(containerID).getContext('2d');\n var config = {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: dataSetParameters.attributes[1],\n data: attributes,\n backgroundColor: 'rgba(0, 119, 204, 0.3)'\n }]\n },\n options: {\n title: {\n display: true,\n text: dataSetParameters.title,\n fontSize: '19',\n fontColor: 'grey',\n },\n legend: {\n display: false\n },\n scales: {\n xAxes: [{\n ticks: {\n display: true\n }\n }]\n }\n }\n };\n var chart = new Chart(ctx, config);\n}", "function dosBars() {\n var barChart1 = document.querySelector('#dos-chart').getContext('2d');\n var dataChart = new Chart(barChart1).Bar(dosBar, {\n scaleBeginAtZero : true,\n scaleShowGridLines : true,\n scaleGridLineWidth : 1,\n scaleShowHorizontalLines: true,\n legendTemplate : \"<ul class=\\\"<%=name.toLowerCase()%>-legend\\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\\"background-color:<%=datasets[i].strokeColor%>\\\"></span><%if(datasets[i].label){%><%=datasets[i].labels%><%}%></li><%}%></ul>\"\n\n });\n //document.querySelector('#item3-6 #legend-container').innerHTML = dataChart.generateLegend();\n }", "function addBars(parent, config, data) {\n var bars = parent.selectAll('g.bars')\n .data(data)\n .enter()\n .append('svg:g')\n .attr('transform', function (d, i) { return formatString('translate(0, {0})', config.y(i)); })\n .append('svg:rect')\n .attr('class', function (d, i) { return 'bar' + (d.slowest ? ' slowest' : '') + (d.fastest ? ' fastest' : ''); })\n .attr('x', config.left)\n .attr('width', function (d, i) { return config.x(d.value); })\n .attr('height', config.y.rangeBand());\n\n return bars;\n }", "function barChart(bcData){\n var bC={}, \n bcSizes = {t: 60, r: 0, b: 30, l: 0};\n bcSizes.w = 500 - bcSizes.l - bcSizes.r, \n bcSizes.h = 300 - bcSizes.t - bcSizes.b;\n \n// create the svg for barChart inside the div\n// for the width, put .width + length + radius\n// for height. put height + \n var bCsvg = d3.select(id).append(\"svg\")\n .attr(\"class\", \"barChart\")\n .attr(\"width\", bcSizes.w + bcSizes.l + bcSizes.r)\n .attr(\"height\", bcSizes.h + bcSizes.t + bcSizes.b)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + bcSizes.l + \",\" + bcSizes.t + \")\");\n\n// for the x variable, use map to \n var x = d3.scaleBand()\n // .rangeRoundBands([0, bcSizes.w], 0.1)\n .range([0, bcSizes.w])\n .round(0.1)\n .domain(bcData.map(function(d) { \n return d[0]; \n }));\n\n // Add x-axis to the barChart svg.\n bCsvg.append(\"g\").attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + bcSizes.h + \")\")\n .call(d3.axisBottom(x));\n\n // Create function for y-axis map.\n var y = d3.scaleLinear().rangeRound([bcSizes.h, 0])\n .domain([0, d3.max(bcData, function(d) { return d[1]; })]);\n\n // Create bars for barChart to contain rectangles and sentiment labels.\n var bars = bCsvg.selectAll(\".bar\")\n .data(bcData)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"bar\");\n\n \n// create the bars\n// for x, use return x variable with (d[0]) to determine the location on x axis\n// for y, use function return the y variable width (d[1]) to determine the height (this is still undefined)\n// for the width, use x variable with rageband to use the same width\n// for height, use a function to return bcSizes.height - the height of the negative space due to (d[1])\n bars.append(\"rect\")\n .attr(\"x\", function(d) { \n return x(d[0]); \n })\n .attr(\"y\", function(d) { \n return y(d[1]); \n })\n .attr(\"width\", 40)\n .attr(\"height\", function(d) { \n return bcSizes.h - y(d[1]); \n })\n .attr('fill', \"#8DD4F4\")\n .on(\"mouseover\",mouseover)\n .on(\"mouseout\",mouseout);\n\n// another mouseover function, this time on the bar chart \n// store the selected year in a variable with a function\n// first, filter the year out of the data with a comparison\n// the mouseover year has to be true, all the others are false\n// return the comparison between s.year (selected year) and d[0] (the years) \n// after this function, add the [0] to refer to the sentiment in the data\n// then in another variable, store the selected year variable and sentiment in a new\n// object with .key and use .map to make an object with the selected year and sentiment\n function mouseover(d){ \n var selectedYear = myData.filter(function(s){ \n return s.year == d[0]\n ;})[0];\n var yearSentiment = d3\n .keys(selectedYear.sentiment)\n .map(function(s){ \n return {type:s, sentiment:selectedYear.sentiment[s]};\n });\n \n// call the functions that update the pie chart and legend, to connect this to the mouseover of bar chart\n// refer to the yearSentiment, becaue this new variable tells what data is selected \n pC.update(yearSentiment);\n leg.update(yearSentiment);\n }\n\n// in a function for mouseout, reset the pie chart and legend by refering to \n// the update function before the bar chart was touched \n function mouseout(d){ \n pC.update(updatePC);\n leg.update(updatePC);\n }\n \n// after the bar chart can alter the pie chart, now write a function to make\n// the pie chart update the bar chart\n// in the y domain, use yearSentiment to sort the sentiments in the years\n// and eliminate the bar height for other sentiments\n// give parameter color to change the color of the bars to the selected pie chart slice\n bC.update = function(yearSentiment, color){\n y.domain([0, d3.max(yearSentiment, function(d) { \n return d[1]; \n })]);\n \n// recreate the bars with the new data\n// only the data in the selected sentiment is added now\n var bars = bCsvg.selectAll(\".bar\")\n .data(yearSentiment);\n \n// with a transition, create the y, height, and color over again\n// this is a copy of the attributes as they were in the creation of the bars\n// only attribute fill is different, this refers to the parameter in this function\n bars.select(\"rect\").transition().duration(400)\n .attr(\"y\", function(d) {\n return y(d[1]); \n })\n .attr(\"height\", function(d) { \n return bcSizes.h - y(d[1]); \n })\n .attr(\"fill\", color);\n \n } \n\n// return the bar chart with the new data \n return bC;\n }", "function createGroupedBars() {\n //set all values by series\n chart.data.forEach(function (d) {\n d.values = axis.serieNames.map(function (name) {\n return {\n name: name,\n xValue: d[chart.xField],\n yValue: +d[name]\n };\n })\n });\n\n //get new y domain\n var newYDomain = [0, d3.max(chart.data, function (d) {\n return d3.max(d.values, function (v) {\n return v.yValue * 1.1;\n });\n })];\n\n //check whether the chart is reversed\n if (isReversed) {\n //set new domain\n newYDomain = [d3.max(chart.data, function (d) {\n return d3.max(d.values, function (v) {\n return v.yValue * 1.1;\n });\n }), 0];\n\n //update x axis\n axis.x.domain(newYDomain);\n } else {\n //update y axis\n axis.y.domain(newYDomain);\n }\n\n //get range band\n var rangeBand = groupAxis.rangeBand();\n\n //create bar groups on canvas\n groupedBars = chart.svg.selectAll('.eve-series')\n .data(chart.data)\n .enter().append('g')\n .attr('class', 'eve-series')\n .attr('transform', function (d) {\n if (isReversed)\n return 'translate(' + (axis.offset.left) + ',' + (axis.y(d[chart.xField])) + ')';\n else\n return 'translate(' + (axis.x(d[chart.xField]) + axis.offset.left) + ',0)';\n });\n\n //create bar group rectangles\n groupedBarsRects = groupedBars.selectAll('rect')\n .data(function (d) { return d.values; })\n .enter().append('rect')\n .attr('class', function (d, i) { return 'eve-bar-serie eve-bar-serie-' + i; })\n .attr('width', function (d) { return isReversed ? (axis.offset.width - axis.x(d.yValue)) : rangeBand; })\n .attr('x', function (d) { return isReversed ? 0 : groupAxis(d.name); })\n .attr('y', function (d) { return isReversed ? groupAxis(d.name) : axis.y(d.yValue); })\n .attr('height', function (d) { return isReversed ? rangeBand : (axis.offset.height - axis.y(d.yValue)); })\n .style('fill', function (d, i) {\n //check whether the serie has color\n if (chart.series[i].color === '')\n return i <= e.colors.length ? e.colors[i] : e.randColor();\n else\n return chart.series[i].color;\n })\n .style('stroke', '#ffffff')\n .style('stroke-width', function (d, i) { return chart.series[i].strokeSize + 'px'; })\n .style('stroke-opacity', function (d, i) { return chart.series[i].alpha; })\n .style('fill-opacity', function (d, i) { return chart.series[i].alpha; })\n .on('mousemove', function(d, i) {\n var balloonContent = chart.getXYFormat(d, chart.series[d.index]);\n\n //show balloon\n chart.showBalloon(balloonContent);\n\n //increase bullet stroke size\n d3.select(this)\n .style('stroke-width', function (d) { return chart.series[i].strokeSize + 1; });\n })\n .on('mouseout', function(d, i) {\n //hide balloon\n chart.hideBalloon();\n\n //increase bullet stroke size\n d3.select(this)\n .style('stroke-width', function (d) { return chart.series[i].strokeSize; });\n });\n\n //set serie labels\n groupedBarsTexts = groupedBars.selectAll('text')\n .data(function(d) { return d.values; })\n .enter().append('text')\n .attr('class', function(d, i) { return 'eve-bar-label eve-bar-label-' + i; })\n .style('cursor', 'pointer')\n .style('fill', function(d, i) { return chart.series[i].labelFontColor; })\n .style('font-weight', function(d, i) { return chart.series[i].labelFontStyle == 'bold' ? 'bold' : 'normal'; })\n .style('font-style', function(d, i) { return chart.series[i].labelFontStyle == 'bold' ? 'normal' : chart.series[i].labelFontStyle; })\n .style(\"font-family\", function(d, i) { return chart.series[i].labelFontFamily; })\n .style(\"font-size\", function(d, i) { return chart.series[i].labelFontSize + 'px'; })\n .text(function(d, i) {\n //check whether the label format is enabled\n if(chart.series[i].labelFormat != '')\n return chart.getXYFormat(d, chart.series[i], 'label');\n })\n .attr('x', function(d, i) {\n //return calculated x pos\n return isReversed ? (axis.offset.width - axis.x(d.yValue)) : (i * rangeBand);\n })\n .attr('y', function(d, i) {\n //return calculated y pos\n return isReversed ? groupAxis(d.name) + rangeBand : axis.y(d.yValue) - 2;\n });\n }", "function createBarchart(data, position) {\n\t// if the passed country is the netherlands then update that title\n\tif (data[0].country == \"Netherlands\") {\n\t\td3.select(\"#bar-chart-title-nl\")\n\t\t.html(data[0].country);\n\t// otherwise update the other title with the clicked country\n\t} else {\n\t\td3.select(\"#bar-chart-title\")\n\t\t.html(data[0].country);\n\t}\n\n\t// setting up the height and width of the chart\n\tvar margin = {top: 20, right: 20, bottom: 30, left: 60},\n\twidth = 500 - margin.left - margin.right,\n\theight = 400 - margin.top - margin.bottom;\n\n\t// x-axis\n\tvar x = d3.scale.ordinal()\n\t\t.rangeRoundBands([0, width], .75);\n\tvar xAxis = d3.svg.axis()\n\t\t.scale(x)\n\t\t.orient(\"bottom\");\n\n\t// y-axis\n\tvar y = d3.scale.linear()\n\t\t.range([height, 0]);\n\tvar yAxis = d3.svg.axis()\n\t\t.scale(y)\n\t\t.orient(\"left\")\n\t\t.ticks(15);\n\n\tx.domain(data.map(function(d) { return d.year;}));\n\n\tif(data[0].value > 30000) {\n\t\ty.domain([0, 60000]);\n\t\td3.select(\"#bar-chart-title\")\n\t\t.html(data[0].country + \"<p class='text-danger'>Let op! Y-assen zijn verschillend.</p>\");\n\t} else {\n\t\ty.domain([0, 25000]);\n\t}\n\n\t// tooltip when hovering the bars\n\tvar tip = d3.tip()\n\t\t.attr('class', 'd3-tip')\n\t\t.offset([-10, 0])\n\t\t.html(function(d) {\n\t\t\treturn \"<strong>\" + d.value + \"</strong> kWh\";\n\t\t});\n\n\t// initialze the part for the chart\n\tvar svg = d3.select(position)\n\t\t.append(\"svg\")\n\t\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\t.append(\"g\")\n\t\t\t.attr(\"class\", \"text-center \")\n\t\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\t// set x-axis\n\tsvg.append(\"g\")\n\t\t.attr(\"class\", \"x axis\")\n\t\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t\t.call(xAxis);\n\n\t// set y-axis\n\tsvg.append(\"g\")\n\t\t.attr(\"class\", \"y axis\")\n\t\t.call(yAxis)\n\t\t.append(\"text\")\n\t\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t\t.attr(\"y\", 6)\n\t\t\t.attr(\"dy\", \".71em\")\n\t\t\t.style(\"text-anchor\", \"end\")\n\t\t\t.text(\"Stroom (per kWh)\");\n\n\t// add bars\n\tsvg.selectAll(\".bar\")\n\t\t.data(data)\n\t\t.enter().append(\"rect\")\n\t\t\t.attr(\"class\", \"bar\")\n\t\t\t.attr(\"x\", function(d) { return x(d.year); })\n\t\t\t.attr(\"width\", x.rangeBand())\n\t\t\t.attr(\"y\", function(d) { return y(d.value); })\n\t\t\t.attr(\"height\", function(d) { return height - y(d.value); })\n\t\t\t.on('mouseover', tip.show)\n\t\t\t.on('mouseout', tip.hide);\n\n\t// add tooltip to the chart\n\tsvg.call(tip);\n}", "plotBarChart(data) {\n this.graph.xAxis('Story')\n .yAxis('Memory used (MiB)')\n .title('Labels')\n .setData(data, story => app.$emit('bar_clicked', story))\n .plotBar();\n }", "function barchart(DATA, topx){\n const topSlice = 10;\n let topDATA = [];\n let col = '';\n switch (topx){\n case 0: // Top Deficit\n let temp = DATA.sort((a, b) => a.Balance - b.Balance).slice(0,topSlice);\n for(let i=0; i<temp.length; i++){\n topDATA.push(Object.assign({}, temp[i]))\n }\n for(let i=0; i<topDATA.length; i++){\n topDATA[i].Balance *= -1\n }\n col = 'Balance';\n break\n case 1: // Top Surplus\n topDATA = DATA.sort((a, b) => b.Balance - a.Balance).slice(0,topSlice);\n col = 'Balance';\n break\n case 2: // Top Export\n topDATA = DATA.sort((a, b) => b.Export - a.Export).slice(0,topSlice);\n col = 'Export';\n break\n case 3: // Top Import\n topDATA = DATA.sort((a, b) => b.Import - a.Import).slice(0,topSlice);\n col = 'Import';\n break\n default: // Top Total\n topDATA= DATA.sort((a, b) => b.Total - a.Total).slice(0,topSlice);\n col = 'Total'\n }\n\n xLinearScale_Bar.domain(topDATA.map(d=>d.Country));\n yLinearScale_Bar.domain([d3.min(topDATA, d=>d[col]), d3.max(topDATA, d=>d[col])]);\n\n gButtomAxis_Bar.call(d3.axisBottom(xLinearScale_Bar))\n .selectAll(\"text\")\n .attr(\"transform\", \"translate(-10,0)rotate(-45)\")\n .style(\"text-anchor\", \"end\");\n gLeftAxis_Bar.call(d3.axisLeft(yLinearScale_Bar));\n\n var gBar = chartGroup_Bar.selectAll(\"rect\").data(topDATA)\n gBar\n .enter()\n .append(\"rect\")\n .merge(gBar)\n .transition().duration(1000)\n .attr(\"x\", d => xLinearScale_Bar(d.Country))\n .attr(\"y\", d => yLinearScale_Bar(d[col]))\n .attr(\"width\", xLinearScale_Bar.bandwidth())\n .attr(\"height\", d=>height_Bar-yLinearScale_Bar(d[col]))\n .attr(\"fill\", \"orange\")\n gBar.exit().remove()\n}", "function makeResultsBarChart(countries) {\n var chart = ui.Chart.feature.byFeature(countries, 'Name');\n chart.setChartType('BarChart');\n chart.setOptions({\n title: 'Population Comparison',\n vAxis: {title: null},\n hAxis: {title: 'Approximate 2015 Population', minValue: 0}\n });\n chart.style().set({stretch: 'both'});\n return chart;\n}", "function render_barBijzonder() {\n var plotBar = hgiBar().margin({\n 'top': 20,\n 'right': 20,\n 'bottom': 40,\n 'left': 110\n }).mapping(['name', 'value']).errorMapping('sd').freqMapping('frequency').title('Is er iets bijzonders gebeurd?').xDomain([0, 100]).xLabel('Ik ben van slag').addError(true).addFrequencies(true);\n d3.select('#barBijzonder').datum(data_vanslag).call(plotBar);\n}", "function bar_load() {\n var barctx = document.getElementById(\"MyBar\").getContext('2d');\n var barchart = new Chart(barctx, {\n // The type of chart we want to create\n type: 'bar',\n data: {\n labels: dataset_global['state_district'],\n datasets: [{\n label: 'Total Population',\n backgroundColor: 'rgb(255, 99, 132)',\n borderColor: 'rgb(255, 99, 132)',\n data: totalpop,\n }]\n },\n\n // Configuration options go here\n options: {\n title: {\n\t\t\t\tdisplay: true,\n\t\t\t\ttext: \"Total Population by Congressional District\",\n\t\t\t\tfontsize: 14,\n\t\t\t},\n tooltips: {\n\t\t\t\tcallbacks: {\n\t\t\t\t label: function(tooltipItems, data) {\n\t\t\t\t\treturn data.datasets[0].data[tooltipItems.index].toLocaleString();;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t },\n responsive: true,\n maintainAspectRatio: true,\n legend: {\n position: 'right',\n display: true,\n },\n scales: {\n yAxes: [{\n position: 'left',\n ticks: {\n beginAtZero: true,\n callback: function (value, index, values) {\n return value.toLocaleString();\n }\n // minBarThickness: 500,\n // categoryPercentage:500,\n // barPercentage:500,\n\n }\n }]\n }\n }\n });\n}", "function barChartBuilder(chartName, dimension, group, xAxisLabel, yAxisLabel) {\r\n chartName\r\n .width(300)\r\n .height(300)\r\n .margins({\r\n top: 0,\r\n right: 0,\r\n bottom: 40,\r\n left: 40\r\n })\r\n .useViewBoxResizing(true) // allows chart to be responsive\r\n .dimension(dimension)\r\n .group(group)\r\n .transitionDuration(500)\r\n .transitionDelay(250)\r\n .x(d3.scale.ordinal())\r\n .xUnits(dc.units.ordinal)\r\n .gap(10)\r\n .renderHorizontalGridLines(true)\r\n .xAxisLabel(xAxisLabel)\r\n .yAxisLabel(yAxisLabel)\r\n .yAxis().ticks(10);\r\n }", "function barChartBasics(hgt) {\n var margin = { top: 30, right: 5, bottom: 20, left: 50 },\n width = 500 - margin.left - margin.right,\n height = hgt - margin.top - margin.bottom,\n colorBar = d3.scaleOrdinal(d3.schemeCategory20);\n barPadding = 1;\n return {\n margin: margin,\n width: width,\n height: height,\n colorBar: colorBar,\n barPadding: barPadding\n };\n}", "function BarElement(label, value, x, y, width, height){\n ChartElement.call(this,label, value, x, y, width, height );\n \n}", "function createBars(vals) {\n var barLeft;\n if (that.model.get(\"columnShift\")) {\n barLeft = \" style=left:\" + that.model.get(\"columnShift\") + \"px\";\n }\n var html = [\"<div class='bars'\" + barLeft + \">\"];\n for (var i = 0; i < vals.length; i++) {\n html.push(\"<div class='bar bar\" + (i + 1) + \"' style='height:\" + Math.round(100 * vals[i]) + \"%'></div>\");\n }\n html.push(\"</div>\");\n return html.join(\"\");\n }", "function CreateBarChart(a) {\n\n // Use D3 to get data from samples.json\n d3.json(\"samples.json\").then((data) => {\n // Anonymous function to filter on id\n var sampleData = data.samples.filter(function(sample) {\n return sample.id === a;\n });\n\n // Create ylabels - reversing based on plotly defaults\n var ylabel = sampleData[0].otu_ids.reverse().map(object => `OTU ${object}`);\n\n // Trace1 for the horizontal bar chart\n var trace1 = {\n x: sampleData[0].sample_values.slice(0,10).reverse(),\n y: ylabel,\n // hoverfunction references otu_labels\n hovertemplate: sampleData[0].otu_labels.slice(0,10).reverse(),\n type: \"bar\",\n orientation: \"h\"\n };\n\n // data\n data = [trace1];\n\n // layout\n var layout = {\n title: \"Top 10 OTU_ids by sample value\",\n margin: {\n l: 100,\n r: 20,\n t: 50,\n b: 20\n }\n };\n\n // render the plot at the tag \"bar\"\n Plotly.newPlot(\"bar\", data, layout);\n }); \n}", "function barChart(selector, data) {\n nv.addGraph(function() {\n var chart = nv.models.multiBarHorizontalChart()\n .x(function(d) { return d.label })\n .y(function(d) { return d.value })\n .margin({top: 0, right: 20, bottom: 50, left: 115})\n .showValues(false)\n .tooltips(true)\n .showLegend(false)\n .showControls(false)\n .color(keyColor);\n\n chart.yAxis\n .tickFormat(d3.format(',d'));\n\n var ds = d3.select(selector);\n ds.selectAll('div.bar').remove();\n ds.append('div').attr('class', 'bar').append('svg')\n .datum(data)\n .transition().duration(500)\n .call(chart);\n\n var labels = ds.selectAll('.nv-x text');\n labels.append('text');\n acronymizeBars(labels);\n\n nv.utils.windowResize(function() {\n chart.update;\n acronymizeBars(labels);\n });\n return chart;\n });\n}", "function create_bars()\n{\n // Make the array empty\n arr=[];\n // Make the visible bars empty\n bar.innerHTML=\"\";\n // Take the no of bars from range\n var no_of_bar=arr_size.value;\n var arr_width_size =(500/no_of_bar);\n \n // Set the height\n // we will sort the bars on the basis of height\n for(var i=0;i<no_of_bar;i++)\n arr.push(Math.floor(Math.random()*100));\n\n\n //Set the height and width of visible bars \n for(var i=0;i<no_of_bar;i++)\n {\n \n var div = document.createElement(\"DIV\");\n var margin_size=0.1;\n div.classList.add(\"special\");\n div.style=\"margin:0%\" + margin_size + \"%; width:\" + (100/no_of_bar-(2*margin_size)) + \"%;\";\n var height = (arr[i]*5+10).toString();\n height = height+'px';\n div.style.height=height;\n bar.appendChild(div);\n }\n}", "function plotdata(chartdata) {\n let chartformat = {};\n chartformat.type = 'bar';\n chartformat.data = chartdata;\n chartdata.datasets[0].label = 'Total games';\n\n let options = chartformat.options = {}; \n options.title = {};\n options.title.display = true;\n options.title.text = 'Total produced games between 1980 - 2015';\n options.title.fontSize = 24;\n options.title.fontColor = '#ff0000'\n\n new Chart($('#barChart'), chartformat, options );\n}", "function drawBar()\n{\n\n\n/*var Barview = new google.visualization.DataView(data);\nBarview.setColumns([0, 1,\n { calc: \"stringify\",\n sourceColumn: 1,\n type: \"string\",\n role: \"annotation\" },\n 2]);*/\n\nvar options = {\n title: \"Bar Chart\",\n width: 600,\n height: 400,\n bar: {groupWidth: \"95%\"},\n legend: { position: \"none\" },\n};\nvar Barchart = new google.visualization.BarChart(document.getElementById(\"barDiv\"));\nBarchart.draw(data, options);\n}", "function createStackedBars() {\n //manipulate chart data\n chart.data.forEach(function(d) {\n //set first y value\n var y0 = 0;\n\n //set series\n d.values = axis.serieNames.map(function(name) {\n //set value object\n var dataObj = {\n name: 'name',\n xValue: d[chart.xField],\n yValue: +d[name],\n y0: y0,\n y1: y0 += +d[name]\n };\n\n //return data object\n return dataObj;\n });\n\n //set serie total\n d.total = d.values[d.values.length - 1].y1;\n });\n\n //sort chart data\n chart.data.sort(function (a, b) { return b.total - a.total; });\n \n //check whether the axis is reversed\n /*if (isReversed)\n axis.x.domain([0, d3.max(chart.data, function (d) { return d.total; })]);\n else\n axis.y.domain([0, d3.max(chart.data, function (d) { return d.total; })]);*/\n\n //create stack bars on canvas\n stackedBars = chart.svg.selectAll('.eve-series')\n .data(chart.data)\n .enter().append('g')\n .attr('class', 'eve-series')\n .attr('transform', function (d) {\n //check whether the chart is reversed\n if (isReversed) {\n return 'translate(' + axis.offset.left + ',' + (axis.y(d[chart.xField])) + ')';\n } else {\n return 'translate(' + (axis.x(d[chart.xField]) + axis.offset.left) + ',0)';\n }\n });\n\n //create stacked bar rectangles\n stackedBarsRects = stackedBars.selectAll('rect')\n .data(function (d) { return d.values; })\n .enter().append('rect')\n .attr('class', function (d, i) { return 'eve-bar-serie eve-bar-serie-' + i; })\n .attr('width', function (d) { return isReversed ? (axis.x(d.y1) - axis.x(d.y0)) : axis.x.rangeBand(); })\n .attr('height', function (d) { return isReversed ? axis.y.rangeBand() : (axis.y(d.y0) - axis.y(d.y1)); })\n .style('fill', function (d, i) {\n //check whether the serie has color\n if (chart.series[i].color === '')\n return i <= e.colors.length ? e.colors[i] : e.randColor();\n else\n return chart.series[i].color;\n })\n .style('stroke', function (d, i) {\n //check whether the serie has color\n if (chart.series[i].color === '')\n return i <= e.colors.length ? e.colors[i] : e.randColor();\n else\n return chart.series[i].color;\n })\n .style('stroke-width', function (d, i) { return chart.series[i].strokeSize + 'px'; })\n .style('stroke-opacity', function (d, i) { return chart.series[i].alpha; })\n .style('fill-opacity', function (d, i) { return chart.series[i].alpha; })\n .on('mousemove', function(d, i) {\n var balloonContent = chart.getXYFormat(d, chart.series[d.index]);\n\n //show balloon\n chart.showBalloon(balloonContent);\n\n //increase bullet stroke size\n d3.select(this)\n .style('stroke-width', function (d) { return chart.series[i].strokeSize + 1; });\n })\n .on('mouseout', function(d, i) {\n //hide balloon\n chart.hideBalloon();\n\n //increase bullet stroke size\n d3.select(this)\n .style('stroke-width', function (d) { return chart.series[i].strokeSize; });\n });\n\n //set serie labels\n stackedBarsTexts = stackedBars.selectAll('text')\n .data(function(d) { return d.values; })\n .enter().append('text')\n .attr('class', function(d, i) { return 'eve-bar-label eve-bar-label-' + i; })\n .style('cursor', 'pointer')\n .style('fill', function(d, i) { return chart.series[i].labelFontColor; })\n .style('font-weight', function(d, i) { return chart.series[i].labelFontStyle == 'bold' ? 'bold' : 'normal'; })\n .style('font-style', function(d, i) { return chart.series[i].labelFontStyle == 'bold' ? 'normal' : chart.series[i].labelFontStyle; })\n .style(\"font-family\", function(d, i) { return chart.series[i].labelFontFamily; })\n .style(\"font-size\", function(d, i) { return chart.series[i].labelFontSize + 'px'; })\n .text(function(d, i) {\n //check whether the label format is enabled\n if(chart.series[i].labelFormat != '')\n return chart.getXYFormat(d, chart.series[i], 'label');\n });\n\n //check whether the chart is reversed\n if (isReversed) {\n stackedBarsRects.attr('x', function (d) { return axis.x(d.y0); });\n stackedBarsTexts\n .attr('x', function (d, i) {\n //return calculated x pos\n return axis.x(d.y0) + (axis.x(d.y1) - axis.x(d.y0)) - this.getBBox().width - 2;\n })\n .attr('y', function (d, i) {\n //return calculated y pos\n return axis.y.rangeBand() - 2;\n });\n } else {\n stackedBarsRects.attr('y', function (d) { return axis.y(d.y1); });\n stackedBarsTexts\n .attr('x', function (d, i) {\n //return calculated x pos\n return (axis.x.rangeBand() / 2 - this.getBBox().width / 2);\n })\n .attr('y', function (d) {\n //return calculated y pos\n return axis.y(d.y1) + this.getBBox().height - 2;\n });\n }\n }", "function createBarChart(selectedDimension) {\n\n var idwc;\n\n //var svgBounds = d3.select(\"#barChart\").node().getBoundingClientRect();\n var xpad = 100;\n var ypad = 70;\n var barPadding = 5;\n\n var data = [];\n var year = [];\n\n if (selectedDimension == 'attendance') {\n for (var i = 0; i < allWorldCupData.length; i++) {\n data[allWorldCupData.length - i - 1] = allWorldCupData[i].attendance;\n year[allWorldCupData.length - i - 1] = allWorldCupData[i].year;\n }\n } else if (selectedDimension == \"teams\") {\n for (var i = 0; i < allWorldCupData.length; i++) {\n data[allWorldCupData.length - i - 1] = allWorldCupData[i].teams;\n year[allWorldCupData.length - i - 1] = allWorldCupData[i].year;\n }\n } else if (selectedDimension == \"matches\") {\n for (var i = 0; i < allWorldCupData.length; i++) {\n data[allWorldCupData.length - i - 1] = allWorldCupData[i].matches;\n year[allWorldCupData.length - i - 1] = allWorldCupData[i].year;\n }\n } else if (selectedDimension == \"goals\") {\n for (var i = 0; i < allWorldCupData.length; i++) {\n data[allWorldCupData.length - i - 1] = allWorldCupData[i].goals;\n year[allWorldCupData.length - i - 1] = allWorldCupData[i].year;\n }\n }\n\n // console.log(data);\n // console.log(year);\n\n // ******* TODO: PART I *******\n\n // Create the x and y scales; make\n // sure to leave room for the axes\n\n var margin = { top: 0, right: 0, bottom: 70, left: 100 };\n var w = 500 - margin.left - margin.right;\n var h = 400 - margin.top - margin.bottom;\n\n var yearAxis = d3.scaleBand()\n .range([0, w - ypad])\n //.domain([year.forEach(function (d) { return d; })])\n .domain([1930, 1934, 1938, 1950, 1954, 1958, 1962, 1966, 1970, 1974, 1978, 1982, 1986, 1990, 1994, 1998, 2002, 2006, 2010, 2014]);\n\n var xScale = d3.scaleLinear()\n .range([0, w - ypad])\n .domain([0, year.length]);\n\n var yScale = d3.scaleLinear()\n .range([h, 0])\n .domain([0, d3.max(data, function (d) { return d; })]);\n\n // Create colorScale\n\n var colorScale = d3.scaleLinear()\n .domain([0, d3.max(data, function (d) { return d; })])\n .range([h, 0]); // continuare (?)\n\n // Create the axes (hint: use #xAxis and #yAxis)\n\n // add the x Axis\n var xAxis = d3.select(\"#xAxis\").append(\"g\")\n .attr(\"transform\", \"translate(\" + xpad + \",\" + h + \")\")\n .call(d3.axisBottom(yearAxis));\n\n xAxis.selectAll(\"text\")\n .attr(\"x\", 10)\n .attr(\"y\", 0)\n .attr(\"transform\", \"rotate(70)\")\n .style(\"text-anchor\", \"start\");\n\n // add the y Axis\n d3.select(\"#yAxis\").append(\"g\")\n .attr(\"transform\", \"translate(\" + xpad + \",0)\")\n .call(d3.axisLeft(yScale));\n\n\n // Update & Exit Axis\n\n d3.select(\"#xAxis\")\n .call(d3.axisBottom(yearAxis))\n .selectAll(\"text\")\n .attr(\"x\", 10)\n .attr(\"y\", 0)\n .attr(\"transform\", \"rotate(70)\")\n .style(\"text-anchor\", \"start\");\n\n d3.select(\"#yAxis\")\n .transition(t)\n .call(d3.axisLeft(yScale));\n\n\n // Create the bars (hint: use #bars) lol\n\n var svg = d3.select(\"#bars\").append(\"svg\")\n .attr(\"width\", w + margin.left + margin.right)\n .attr(\"height\", h + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin.left + \",\" + margin.top + \")\");\n svg.selectAll(\"rect\")\n .data(data)\n .enter()\n .append(\"rect\")\n .attr(\"id\", function (d, i) {\n return year[i];\n })\n .attr(\"x\", function (d, i) {\n return (xScale(i));\n })\n .attr(\"y\", function (d) {\n return (yScale(d));\n })\n .attr(\"width\", w / data.length - barPadding)\n .attr(\"height\", function (d) {\n return (h - yScale(d));\n })\n .attr(\"fill\", function (d, i) {\n return \"rgb(0,0,\" + colorScale(d) + \")\";\n })\n .on(\"click\", function () {\n d3.selectAll(\"rect\").attr(\"fill\", function (d, i) {\n return \"rgb(0,0,\" + colorScale(d) + \")\";\n });\n d3.select(this).attr(\"fill\", \"red\");\n idwc = event.target.id;\n //console.log(idwc);\n updateInfo(idwc);\n });\n\n // Exit bars\n d3.select(\"#bars\").selectAll(\"rect\").data(data).exit().remove();\n\n // Update bars\n var t = d3.transition()\n .duration(300)\n .ease(d3.easePoly);\n\n d3.select(\"#bars\")\n .selectAll(\"rect\")\n .data(data)\n .transition(t)\n .attr(\"x\", function (d, i) {\n return (xScale(i));\n })\n .attr(\"y\", function (d) {\n return (yScale(d));\n })\n .attr(\"width\", w / data.length - barPadding)\n .attr(\"height\", function (d) {\n return (h - yScale(d));\n })\n .attr(\"fill\", function (d, i) {\n return \"rgb(0,0,\" + colorScale(d) + \")\";\n });\n\n\n // ******* TODO: PART II *******\n\n // Implement how the bars respond to click events\n // Color the selected bar to indicate it has been selected.\n // Make sure only the selected bar has this new color.\n\n // Call the necessary update functions for when a user clicks on a bar.\n // Note: think about what you want to update when a different bar is selected.\n\n\n}", "function drawBarChart(data, options, element) {\n\n // adds default values to any options that were not specified by the user\n if (!(\"width\" in options)) {\n options.width = 500;\n }\n if (!(\"height\" in options)) {\n options.height = 300;\n }\n if (!(\"spacing\" in options)) {\n options.spacing = 5;\n }\n if (!(\"colour\" in options)) {\n options.colour = \"#008000\";\n }\n if (!(\"labelColour\" in options)) {\n options.labelColour = \"#FFFFFF\";\n }\n if (!(\"labelAlign\" in options)) {\n options.labelAlign = \"top\";\n }\n if (!(\"titleColour\" in options)) {\n options.titleColour = \"#000000\";\n }\n if (!(\"titleSize\" in options)) {\n options.titleSize = \"14\";\n }\n\n // extracts values from data\n var values = data.values;\n\n // draws a single bar chart if values is a list of numbers, or draws a stacked bar chart if values is a list of list of numbers\n if (typeof(values[0]) === typeof(1)) {\n singleBarChart(data, options, element);\n }else if (typeof(values[0]) === typeof([])) {\n stackedBarChart(data, options, element);\n drawLegend(data.legend, options, element);\n }\n\n // draws the labels on the X and Y axes and the chart title\n drawXlabels(data.labels, options, element);\n drawYlabels(data, options.height, element);\n drawTitle(data.title, options, element);\n}", "function drawBars(data, xScaleFn, yScaleFn) {\n select(\".chart-group\")\n .selectAll(\".bar\")\n .data(data)\n .join(\"rect\")\n .transition()\n .attr(\"class\", \"bar\")\n .attr(\"x\", d => xScaleFn(d.letter))\n .attr(\"y\", d => yScaleFn(d.frequency))\n .attr(\"width\", xScaleFn.bandwidth())\n .attr(\"height\", d => chartHeight - yScaleFn(d.frequency));\n }", "function create_barcode(bars) {\n y = d3.scaleBand()\n .range([bar_height, 0])\n .padding(0.1);\n\n x = d3.scaleLinear()\n .range([0, bar_width]);\n\n let svg = d3.select(\"#barcode\");\n svg.append(\"g\");\n\n // format the data\n bars.forEach(function (d) {\n d.death = +d.death;\n });\n bars.sort(function (a, b) {\n if (a.death !== b.death) {\n return b.death - a.death;\n } else {\n return b.ratio - a.ratio;\n }\n });\n\n // Scale the range of the data in the domains\n x.domain([0, d3.max(bars, function (d) {\n return d.death;\n }) + 1])\n y.domain(bars.map(function (d) {\n return d.id;\n }));\n\n // set the slider accordingly\n document.getElementById(\"slider\").max = d3.max(bars, function (d) {\n return d.death;\n }) + 1;\n document.getElementById(\"slider\").value = 0;\n document.getElementById(\"slider\").step = document.getElementById(\"slider\").max / x(document.getElementById(\"slider\").max);\n\n // append the rectangles for the bar chart\n svg.selectAll(\".bar\")\n .data(bars)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"width\", function (d) {\n return x(d.death * d.ratio);\n })\n .attr(\"y\", function (d) {\n return y(d.id);\n })\n .attr(\"fill\", smallBar)\n .attr(\"height\", y.bandwidth())\n\n // adding the second (stacked) bar\n svg.selectAll(\".bar\")\n .data(bars)\n .exit().data(bars)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function (d) {\n return x(d.death * d.ratio);\n })\n .attr(\"width\", function (d) {\n return x(d.death * (1 - d.ratio));\n })\n .attr(\"y\", function (d) {\n return y(d.id);\n })\n .attr(\"fill\", largeBar)\n .attr(\"height\", y.bandwidth())\n\n // this bar is just used for the selection and to attach a border\n svg.selectAll(\".bar\")\n .data(bars)\n .exit().data(bars)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function (d) {\n return 0;\n })\n .attr(\"width\", function (d) {\n return x(d.death);\n })\n .attr(\"y\", function (d) {\n return y(d.id);\n })\n .attr(\"height\", y.bandwidth())\n .attr(\"fill\", deselectedBar)\n .attr(\"opacity\", 0.5)\n .on(\"click\", function(d) {\n d.selected = !d.selected;\n if (d.selected) {\n d3.select(this).style(\"opacity\", 0.0);\n } else {\n d3.select(this).style(\"opacity\", 0.5);\n }\n update_repulsion(d);\n })\n .on(\"mouseover\", function (d) {\n let colorA;\n let colorB;\n\n if (d.componentA.nodes.length < d.componentB.nodes.length) {\n colorA = smallBar;\n colorB = largeBar;\n } else {\n colorB = smallBar;\n colorA = largeBar;\n }\n\n nodes\n .selectAll(\"circle\")\n .attr(\"fill\", function (n) {\n if (!d.componentA.contains(n.id)) {\n return colorB;\n } else {\n return colorA;\n }\n });\n\n prev_opacity = links.filter(function (n) {\n return d.edge.index === n.index;\n }).style(\"opacity\");\n\n links\n .filter(function (n) {\n return d.edge.index === n.index;\n })\n .style(\"opacity\", 1.0)\n .style(\"stroke-width\", 4);\n })\n .on(\"mouseout\", function (d) {\n nodes\n .selectAll(\"circle\")\n .attr(\"fill\", function (g) {\n return color(g.group);\n });\n\n links\n .filter(function (n) {\n return d.edge.index === n.index;\n })\n .style(\"opacity\", prev_opacity)\n .style(\"stroke-width\", 1);\n });\n\n // adding the line associated with the slider => shows repulsion threshold\n svg\n .append(\"line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", 0)\n .attr(\"x2\", 0)\n .attr(\"y2\", bar_height)\n .attr(\"fill\", \"#FF0000\")\n .attr(\"stroke\", \"#4281fc\")\n .attr(\"stroke-width\", 2.0)\n .style(\"opacity\", 1.0);\n}", "function createBarChart(subject) {\n // Read in data\n d3.json('Data/samples.json').then((data) => {\n var samples = data.samples;\n var filterSubject = samples.filter(sample => sample.id == subject);\n var results = filterSubject[0];\n\n // Create variables for bar chart\n var sampleValues = results.sample_values;\n var otuIDs = results.otu_ids;\n var otuLabels = results.otu_labels;\n \n // Bar data trace\n var trace1 = [{\n type: 'bar',\n x: sampleValues.slice(0, 10).sort((firstNum, secondNum) => firstNum - secondNum),\n y: otuIDs.slice(0, 10).sort((firstNum, secondNum) => firstNum - secondNum).map(OTUID => `OTU ${OTUID}`),\n hovertext: otuLabels.slice(0, 10).sort((firstNum, secondNum) => firstNum - secondNum),\n orientation: 'h',\n }]\n\n // Bar layout\n var layout = {\n // title: `Subject ${subject}: Top 10 OTUs` \n margin: {\n t: 0,\n l: 150\n },\n }\n\n // Update bar plot\n Plotly.newPlot('bar', trace1, layout);\n });\n}", "function drawBarChart() {\n d3.select('#bars').selectAll('rect').remove();\n\t // majors for the x axis\n let xScale = d3.scaleBand()\n .domain(selectedMajors.map(x => x['data']['data']['Undergraduate Major']))\n .range([0, 400])\n\n\t // dollar amount for the y axis\n let yScale = d3.scaleLinear()\n .domain([0, 200000])\n .range([450, 0 ]);\n\n\t // align the axis\n let xAxis = d3.axisBottom(xScale);\n d3.select('#xAxis')\n .attr(\"transform\", `translate(${50}, ${475})`)\n .call(xAxis)\n .selectAll(\"text\")\n .attr(\"transform\", \"rotate(90)\")\n .attr(\"x\", 9)\n .attr(\"dy\", \"-.35em\")\n .style(\"text-anchor\", \"start\");\n\n\t // titles\n d3.select('#barChartSvg').append('text').attr('x', 0).attr('y', 10).text('Yearly Salary($)').style('font-size', '11').style('font-weight', 'bold')\n d3.select('#barChartSvg').append('text').attr('x', 440).attr('y', 495).text('Degree').style('font-size', '11').style('font-weight', 'bold')\n\n\t // align the y axis\n let yAxis = d3.axisLeft(yScale);\n d3.select('#yAxis')\n .attr(\"transform\", `translate(${50}, 25)`)\n .call(yAxis)\n .selectAll(\"text\");\n\n\t // g's for every gorup - starting, 10th, 25th, median, etc.\n let bars = d3.select('#bars');\n let g1 = bars.append('g');\n let g2 = bars.append('g');\n let g3 = bars.append('g');\n let g4 = bars.append('g');\n let g5 = bars.append('g');\n let g6 = bars.append('g');\n\n // display the starting median bars\n g1.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 50))\n .attr('x', (d,i) => 30 -1 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {return 450-yScale(d['data']['data']['Starting Median Salary']); }) // always equal to 0\n .attr(\"y\", function(d) { return 25 + yScale(d['data']['data']['Starting Median Salary']); })\n .append('title')\n .text((d) => `Starting Median Salary\\n${formatter.format(d['data']['data']['data']['Starting Median Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n // display the stacked mid career bars\n // let tenthbars = d3.select('#bars').selectAll('rect')\n g2.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 40))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-yScale(Number(d['data']['data']['data']['Mid-Career 10th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career 10th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career 10th Percentile\\n${formatter.format(d['data']['data']['data']['Mid-Career 10th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n\t // 25th percentile salaries\n g3.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 30))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-1-yScale(Number(d['data']['data']['data']['Mid-Career 25th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))-Number(d['data']['data']['data']['Mid-Career 10th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career 25th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career 25th Percentile\\n${formatter.format(d['data']['data']['data']['Mid-Career 25th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n\n\t // median salaries\n g4.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 20))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-1-yScale(Number(d['data']['data']['data']['Mid-Career Median Salary'].replace(/[^0-9.-]+/g,\"\"))-Number(d['data']['data']['data']['Mid-Career 25th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career Median Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career Median\\n${formatter.format(d['data']['data']['data']['Mid-Career Median Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n\n\t // 75th percentile\n g5.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 10))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-1-yScale(Number(d['data']['data']['data']['Mid-Career 75th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))-Number(d['data']['data']['data']['Mid-Career Median Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career 75th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career 75th Percentile\\n${formatter.format(d['data']['data']['data']['Mid-Career 75th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n\n\t // 90th percentile bars\n g6.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), -5))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-1-yScale(Number(d['data']['data']['data']['Mid-Career 90th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))-Number(d['data']['data']['data']['Mid-Career 75th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career 90th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career 90th Percentile\\n${formatter.format(d['data']['data']['data']['Mid-Career 90th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n }", "function barchart() {\n var svg = d3.select(\"#bar_chart svg\"),\n margin = {top: 20, right: 20, bottom: 30, left: 80},\n width = +svg.attr(\"width\") - margin.left - margin.right,\n height = +svg.attr(\"height\") - margin.top - margin.bottom;\n\n var tooltip = d3.select(\"body\").append(\"div\").attr(\"class\", \"toolTip\");\n\n var x = d3.scale.linear().range([0, width]);\n var y = d3.ordinal().range([height, 0]);\n\n var g = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var data = globalProducts[flow][getSelectedProduct()][year]\n data.sort(function(a, b) { return a.value - b.value; });\n x.domain([0, d3.max(data, function(d) { return d.value; })]);\n y.domain(data.map(function(d) { return d.area; })).padding(0.1);\n\n g.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x).ticks(5).tickFormat(function(d) { return parseInt(d / 1000); }).tickSizeInner([-height]));\n\n g.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(d3.axisLeft(y));\n\n g.selectAll(\".bar\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", 0)\n .attr(\"height\", y.bandwidth())\n .attr(\"y\", function(d) { return y(d.area); })\n .attr(\"width\", function(d) { return x(d.value); })\n .on(\"mousemove\", function(d){\n tooltip\n .style(\"left\", d3.event.pageX - 50 + \"px\")\n .style(\"top\", d3.event.pageY - 70 + \"px\")\n .style(\"display\", \"inline-block\")\n .html((d.area) + \"<br>\" + \"£\" + (d.value));\n })\n .on(\"mouseout\", function(d){ tooltip.style(\"display\", \"none\");});\n}", "function barChartData(){\n barChartConfig = {\n\ttype: 'bar',\n\n\tdata: {\n\t\tlabels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n\t\tdatasets: [{\n\t\t\tlabel: 'Orders',\n\t\t\tbackgroundColor: window.chartColors.green,\n\t\t\tborderColor: window.chartColors.green,\n\t\t\tborderWidth: 1,\n\t\t\tmaxBarThickness: 16,\n\t\t\t\n\t\t\tdata: [\n\t\t\t\tview2[0],\n\t\t\t\tview2[1],\n\t\t\t\tview2[2],\n\t\t\t\tview2[3],\n\t\t\t\tview2[4],\n\t\t\t\tview2[5],\n\t\t\t\tview2[6]\n\t\t\t]\n\t\t}]\n\t},\n\toptions: {\n\t\tresponsive: true,\n\t\taspectRatio: 1.5,\n\t\tlegend: {\n\t\t\tposition: 'bottom',\n\t\t\talign: 'end',\n\t\t},\n\t\ttitle: {\n\t\t\tdisplay: true,\n\t\t\ttext: 'View Bar'\n\t\t},\n\t\ttooltips: {\n\t\t\tmode: 'index',\n\t\t\tintersect: false,\n\t\t\ttitleMarginBottom: 10,\n\t\t\tbodySpacing: 10,\n\t\t\txPadding: 16,\n\t\t\tyPadding: 16,\n\t\t\tborderColor: window.chartColors.border,\n\t\t\tborderWidth: 1,\n\t\t\tbackgroundColor: '#fff',\n\t\t\tbodyFontColor: window.chartColors.text,\n\t\t\ttitleFontColor: window.chartColors.text,\n\n\t\t},\n\t\tscales: {\n\t\t\txAxes: [{\n\t\t\t\tdisplay: true,\n\t\t\t\tgridLines: {\n\t\t\t\t\tdrawBorder: false,\n\t\t\t\t\tcolor: window.chartColors.border,\n\t\t\t\t},\n\n\t\t\t}],\n\t\t\tyAxes: [{\n\t\t\t\tdisplay: true,\n\t\t\t\tgridLines: {\n\t\t\t\t\tdrawBorder: false,\n\t\t\t\t\tcolor: window.chartColors.borders,\n\t\t\t\t},\n\n\t\t\t\t\n\t\t\t}]\n\t\t}\n\t\t\n\t}\n}\n}", "function bar(renderOpts) {\n // create object to hold chart updating function\n // as well as current data\n var\n self = {data : start_data},\n container = d3.select(renderOpts.renderTo),\n race = projections.raceAbbr(renderOpts.race),\n margin = self.margin = { top: 50, right: 40, bottom: 40, left: 65 },\n // chart h/w vs full svg h/w\n width = 300 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom,\n full_width = self.width = width + margin.left + margin.right,\n full_height = self.height = height + margin.top + margin.bottom,\n total = 0;\n\n // get population number for age, year, race\n function value(a){\n return self.data[a][0][race];\n }\n\n // generate percentage stat for bar width\n function pop_percent(a) {\n return value(a) / total;\n }\n\n ages.map(function(a) { total += value(a); });\n total = total || 1; // to avoid division by 0\n\n var max = 0.15;\n\n // scale for bar width\n var x = d3.scale.linear()\n .domain([0, max])\n .range([0, width]);\n\n // ordinal scale to space y axis\n var y = d3.scale.ordinal()\n .rangeRoundBands([height, 0], 0.1)\n .domain(ages.map(bucket).reverse());\n\n // create y axis using calculated age buckets\n var yAxis = d3.svg.axis()\n .scale(y)\n .outerTickSize(0)\n .orient(\"left\");\n\n // create y axis using calculated percentage scale\n var xAxis = d3.svg.axis()\n .scale(x)\n .tickFormat(d3.format('%'))\n .outerTickSize(0)\n .ticks(3)\n .orient(\"bottom\");\n\n // space between bars, and bar dimension\n var buffer = 6;\n var barHeight = height / ages.length;\n\n\n // container svg, dynamically sized\n container.classed('chart-svg-container', true)\n\n var svg = self.svg = container.append('svg')\n .attr({\n \"preserveAspectRatio\" : \"xMinYMin meet\",\n \"viewBox\" : \"0 0 \" + full_width + \" \" + full_height,\n \"class\" : \"chart-svg\"\n })\n .append('g')\n .attr(\n 'transform',\n 'translate(' + margin.left + ',' + margin.top + ')'\n );\n\n // title text for bar chart\n svg.append('text')\n .attr({\n \"class\" : \"bar-title\",\n \"y\" : -15\n }).text(capitalize(renderOpts.race));\n\n // y grid lines\n var gridAxis = d3.svg.axis().scale(x)\n .orient(\"bottom\")\n .tickSize(-height, 0, 0)\n .ticks(4)\n .tickFormat(\"\");\n\n var grid_lines = svg.append('g')\n .attr('class', 'y grid')\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(gridAxis);\n\n // bar chart rectangles\n var bar_container = svg.append('g')\n .selectAll('g')\n .data(ages)\n .enter().append('g')\n .attr(\"transform\", function(d, i) {\n return \"translate(0,\"+(i * barHeight + buffer/2)+\")\";\n })\n .attr(\"id\" , function(d) { return race + \",\" + bucket(d); })\n .attr('width', width)\n .attr('height', barHeight + buffer/2);\n\n var bars = bar_container.append('rect')\n .attr({\n \"class\" : function(d) { return 'pyramid bar ' + bucket(d); },\n \"width\" : function(d) { return x(pop_percent(d)); },\n \"height\" : barHeight - buffer / 2,\n });\n\n // render y axis\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n // render x axis\n var x_axis_g = svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n\n var p = d3.format(\".1%\");\n var datalabels = bar_container.append('text')\n .text(function(d) {return p(pop_percent(d));})\n .attr({\n class : function(d) { return 'datalabel ' + bucket(d); },\n x : function(d) { return 5 + x(pop_percent(d)); },\n y : buffer + barHeight / 2\n }).style('opacity', 0);\n\n // highlight all same y-value\n bar_container\n .on('mouseover', function(){\n var selected = this.id.split(\",\")[1];\n d3.selectAll('.pyramid.bar')\n .classed('highlight', function(){\n return d3.select(this).classed(selected);\n });\n d3.selectAll('.datalabel')\n .style('opacity', function() {\n // boolean to number\n return +d3.select(this).classed(selected);\n });\n })\n .on('mouseout', function(){\n d3.selectAll('.pyramid.bar').classed('highlight', false);\n d3.selectAll('.datalabel').style('opacity', 0);\n });\n\n\n // data update\n self.update = function(new_data, maximum) {\n\n var dur = 300;\n\n // bounce back if already loading something\n if (projections.loading_indicator) return self;\n\n // store new data\n self.data = prepData(new_data);\n\n // get population number for age, year, race\n var year = settings.pyramid_abbr();\n var value = function(a){\n return parseFloat(self.data[a][year][race]);\n };\n\n // calculate total for this group\n var total = 0;\n ages.map(function(a) { total += value(a); });\n total = total || 1; // prevent divsion by 0\n\n // generate percentage stat for bar width\n var pop_percent = function(a) {\n return value(a) / total;\n };\n\n maximum = maximum || 0.15;\n\n x.domain([0, maximum]);\n\n bars\n .transition()\n .duration(dur)\n .attr(\"width\" , function(d) {\n return x(pop_percent(d));\n });\n\n x_axis_g\n .transition()\n .duration(dur)\n .call(xAxis);\n\n grid_lines\n .transition()\n .duration(dur)\n .call(gridAxis);\n\n datalabels\n .text(function(d){ return p(pop_percent(d)); })\n .attr(\"x\", function(d){ return 5 + x(pop_percent(d)); } );\n\n return self;\n };\n\n return self;\n }", "function createSimpleBarChart(targetData){\n\t//define chart constants\n\tlet svg = d3.select(\".chart\"),\n\t\tmargin = {top: 70, right: 20, bottom: 40, left: 50},\n\t\twidth = 600 - margin.left - margin.right,\n\t\theight = 300 - margin.top - margin.bottom,\n\t\tg = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" +margin.top + \")\");\n\n\tlet transition = d3.transition()\n\t\t.duration(750)\n\t\t.ease(d3.easeLinear);\n\n\n\t//define scales\n\tlet x = d3.scaleBand().rangeRound([0, width]).padding(0.05),\n\t\t\ty = d3.scaleLinear().rangeRound([height, 0]);\n\tx.domain(targetData.data.map(function(d) { return d.country; }));\n\ty.domain([0, d3.max(targetData.data, function(d) { return +d.value; })]);\n\n\t//define x axis and append to svg\n\tg.append(\"g\")\n\t\t.attr(\"class\", \"x-axis\")\n\t\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t.call(d3.axisBottom(x))\n\t\t.append(\"text\")\n\t\t.attr(\"y\", 30)\n\t\t.attr(\"x\", 400)\n\t\t.attr(\"dy\", \"0.5em\")\n\t\t.style(\"fill\", \"black\");\n\n\tg.append(\"g\")\n\t\t.attr(\"class\", \"axis axis-y\")\n\t\t.style(\"stroke-width\", \"0\")\n\t\t.call(d3.axisLeft(y));\n\n\tg.selectAll(\".bar\")\n\t\t.data(targetData.data)\n\t\t.enter()\n\t\t.append(\"rect\")\n\t\t.attr(\"class\", \"bar\")\n\t\t.attr(\"x\", function(d) { return x(d.country); })\n\t\t.attr(\"y\", function(d) { return y(0); })\n\t\t.attr(\"data-value\", function(d) { return d.value; })\n\t\t.attr(\"height\", 0)\n\t\t.style(\"fill\", targetData.colors[0])\n\t\t.attr(\"width\", x.bandwidth())\n\t\t.transition(transition)\n\t\t.attr(\"y\", function(d) { return y(d.value); })\n\t\t.attr(\"height\", function(d) { return height - y(d.value) ;});\n\n\tg.selectAll(\".x-axis text\")\n\t\t.style(\"transform\", \"translateY(10px) rotate(-15deg)\");\n}", "function bar_charts(count=false,velocity=false,strike=false) {\n var pitch_types_array = Object.keys(types);\n\n if (count) {\n var counts = [];\n\n for (i = 0; i < pitch_types_array.length; i++) {\n counts.push(types[pitch_types_array[i]]['count']);\n };\n\n chart_builder('canvas1', 'bar', \"# of Pitches\", counts, \"Pitch Count\");\n }\n\n if (velocity) {\n var velocities = [];\n\n for (i = 0; i < pitch_types_array.length; i++) {\n velocities.push(Math.round(types[pitch_types_array[i]]['avg_velocity']));\n };\n\n chart_builder('canvas2', 'bar', \"Avg. Velocity\", velocities, \"Average Velocity\");\n }\n\n if (strike) {\n var strikes = [];\n\n for (i = 0; i < pitch_types_array.length; i++) {\n strikes.push(Math.round(types[pitch_types_array[i]]['strike%']));\n };\n\n chart_builder('canvas3', 'bar', \"Strike %\", strikes, \"Strike Percentage\");\n }\n\n\n}", "function barChart(womenOfColorRows) {\n var svgHeight = womenOfColorRows.length * GANTT_BAR_HEIGHT;\n //var svgHeight = 500;\n var svgWidth = 800;\n\n var years = womenOfColorRows.flatMap(function (row) {\n var ranges = row['Dates of Service'].split(';'); \n\n return ranges.flatMap(function(range) { \n var rangeAsArray = range.trim().split('-'); \n return rangeAsArray.map(function(year) { \n if (year.trim().toLowerCase() === 'present') {\n return 2019;\n } else {\n return parseInt(year); \n }\n });\n });\n\n });\n womenOfColorRows.forEach(function (row) {\n var ranges = row['Dates of Service'].split(';'); \n\n var inOfficePeriods = ranges.map(function(range) { \n var rangeAsArray = range.trim().split('-'); \n return rangeAsArray.map(function(year) { \n if (year.trim().toLowerCase() === 'present') {\n return 2019;\n } else {\n return parseInt(year); \n }\n });\n });\n\n var totalYearsInOffice = 0; \n inOfficePeriods.forEach(function(period) { \n var lengthOfPeriod = period[1] - period[0]; \n totalYearsInOffice = totalYearsInOffice + lengthOfPeriod; \n });\n\n // if (row[\"Name\"] === \"Ayanna Pressley\") debugger;\n\n row['Total Years in Office'] = totalYearsInOffice; \n });\n var svg = d3.selectAll('.bar-chart')\n .attr(\"width\", svgWidth)\n .attr(\"height\", svgHeight + 30);\n\n var minYear = d3.min(years)\n\n var maxYear = d3.max(years)\n \n var xScale = d3.scaleLinear()\n .domain([minYear, maxYear])\n .range([0, svgWidth - 15]);\n\n var bars = svg.selectAll('rect')\n .data(womenOfColorRows);\n\n bars.enter().append(\"rect\")\n .attr(\"height\", GANTT_BAR_HEIGHT)\n .attr(\"width\", function(d) {\n \n return xScale(minYear + (d[\"Total Years in Office\"]));\n })\n .attr('y', function(d, i) {\n return i * GANTT_BAR_HEIGHT;\n })\n .attr('x', function(d, i) {\n return xScale(parseInt(d[\"Dates of Service\"]))\n })\n .attr(\"fill\", function(d) {\n return color(d[\"Ethnicity\"]);\n })\n \n .on(\"mousemove\", function(d) {\n var mouse = d3.mouse(document.body);\n d3.select(\".tooltip\")\n .style(\"display\", \"inline-block\")\n .style(\"position\", \"relative\")\n .html(\"<div class='tooltip-title'>\" + d[\"ASSOCIATION\"] + \"<br>\" + \" Association Type: \" + d[\"ASSOCIATION TYPE\"] + \"<br>\" + \" Founding Year: \" + d[\"FOUNDING YEAR\"] + \"<br>\" + \" Ending Year: \" + d[\"ENDING YEAR\"] + \"</br>\" + \"</div>\")\n .style(\"left\", mouse[0] + 20 + \"px\")\n .style(\"top\", mouse[1] - 50 + \"px\");\n })\n .on(\"mouseout\", function(d) {\n d3.select(\".tooltip\")\n .style(\"display\", \"none\")\n })\n \n\n var xAxis = d3.axisBottom(xScale)\n .tickFormat(d3.format(\"d\"));\n\n d3.select(\"#x-axis\").call(xAxis)\n .attr(\"transform\", \"translate(0,\" + (svgHeight + 10) + \")\");\n\n}", "function drawBarChart(data, ctx, can) {\n if (clear) ctx.clearRect(0, 0, can.width, can.height);\n var y, tx, ty, metrics, words, line, testLine, testWidth;\n var dataName = data.name;\n var dataValue = data.value;\n var colHead = 50;\n var rowHead = 30;\n var margin = 10;\n var maxVal = Math.ceil(Math.max.apply(Math, dataValue)/5) * 5;\n var stepSize = 5;\n var yScalar = (can.height - colHead - margin) / (maxVal);\n var xScalar = (can.width - rowHead) / (dataName.length + 1);\n ctx.lineWidth = 0.5;\n ctx.strokeStyle = \"rgba(128,128,255, 0.5)\"; // light blue line\n ctx.beginPath();\n // print row header and draw horizontal grid lines\n ctx.font = \"10pt Open Sans\"\n var count = 0;\n for (scale = maxVal; scale >= 0; scale -= stepSize) {\n y = colHead + (yScalar * count * stepSize);\n ctx.fillText(scale, margin,y + margin);\n ctx.moveTo(rowHead, y + margin - 1)\n ctx.lineTo(can.width, y + margin -1)\n count++;\n }\n ctx.stroke();\n ctx.save();\n // set a color\n ctx.fillStyle = \"rgba(151,187,205,1)\";\n // translate to bottom of graph and scale x,y to match data\n ctx.translate(0, can.height - margin);\n ctx.scale(xScalar, -1 * yScalar);\n // draw bars\n for (i = 0; i < dataName.length; i++) {\n ctx.fillRect(i + 1, -2, 0.5, dataValue[i]);\n }\n ctx.restore();\n \n // label samples\n ctx.font = \"8pt Open Sans\";\n ctx.textAlign = \"center\";\n for (i = 0; i < dataName.length; i++) {\n calcY(dataValue[i]);\n ty = y - margin - 5;\n tx = xScalar * (i + 1) + 14;\n words = dataName[i].split(' ');\n line = '';\n for(var n = 0; n < words.length; n++) {\n testLine = line + words[n] + ' ';\n metrics = ctx.measureText(testLine);\n testWidth = metrics.width;\n if (testWidth > 20 && n > 0) {\n ctx.fillText(line, tx, ty - 8);\n line = words[n] + ' ';\n }\n else {\n line = testLine;\n }\n }\n ctx.fillText(line, tx, ty + 8);\n }\n function calcY(value) {\n y = can.height - value * yScalar;\n } \n}", "constructor(svg, width, height)\n {\n super(svg, width, height);\n this.data = [];\n this.type = \"BarChart\";\n }", "function barChart() {\n\n currentChart = \"bar chart\";\n\n //allows to select the colour scheme depending on selected colour\n var colours;\n if (currentColourScheme == \"colour 1\") {\n colours = ColourOne;\n }\n else if (currentColourScheme == \"colour 2\") {\n colours = ColourTwo;\n }\n else if (currentColourScheme == \"colour 3\") {\n colours = ColourThree;\n }\n \n //function to draw the bar\n function drawBar(context, x, y, width, height, c) {\n context.fillStyle = c;\n context.fillRect(x, HEIGHT-y-height, width, height); \n }\n \n var EDGE = WIDTH*0.02;\n var BAR_WIDTH = (WIDTH-EDGE*2)/27;\n function drawBars(context) {\n\n //multiply each day by 10% of the height to make it bigger\n var ENLARGE = HEIGHT*0.1;\n \n //edges of the graph \n var currentX = EDGE;\n\n //hours for each day and activity in order\n var hours = [5,2,4,6,0,2,8,1,3,9,1,1,8,0,3,5,1,2,6,1,4];\n for (var i = 0; i < hours.length; i++) {\n //creating a gap every three bars o make the data more visible\n if (i>1 && i%3 === 0) {\n currentX += BAR_WIDTH;\n }\n var height = hours[i]*ENLARGE;\n drawBar(context, currentX, EDGE*1.5, BAR_WIDTH, height, colours[i % colours.length]);\n currentX += BAR_WIDTH;\n }\n }\n \n\n //function to draw keys and x-axis for the bar chart\n function drawLabels() {\n \n var activities = ['uni','gym','phone'];\n var days = ['mon','tue','wed','thur','fri','sat','sun'];\n\n //starting points based on the canvas size\n var y = WIDTH*0.85;\n var x = y - 12;\n //making a key on the side of the canvas \n for (var l = 0; l < activities.length; l++) {\n context.fillStyle = 'black';\n context.fillText(activities[l],y,25*l+50);\n }\n \n //the colours to match the words\n for (var s = 0; s < activities.length; s++) {\n context.fillStyle = colours[s % colours.length];\n context.fillRect(x,25*s+40,10,10);\n }\n\n //printing out the days on the x-axis \n //distance between words\n var STEP = WIDTH*0.15;\n //starting point\n var START = HEIGHT*0.033;\n \n //days of the week at the bottom of the chart\n for (var i=0; i < days.length; i++) {\n context.fillStyle = 'black';\n context.fillText(days[i],STEP*i+EDGE,HEIGHT-2);\n }\n\n //drawing a line to separate the bars from words\n context.fillStyle = 'black';\n context.fillRect(0,HEIGHT-START,WIDTH,2);\n \n\n }\n\n //functions to draw the labels and the bar chart\n drawBars(context);\n drawLabels();\n\n}", "function makeSVGBarChart () {\n\n // add svg element\n var svg = d3.select(\"body\")\n .select(\"div#barChart\")\n .append(\"svg\")\n .attr(\"width\", Width)\n .attr(\"height\", Height);\n\n return svg\n} // end makeSVG", "function ChartsBarchart() {\n}", "function barChart(args) {\n this.args = args;\n\n this.init = function(args) {\n this.args = args;\n\n raw_data_transformation(args);\n process_categorical_variables(args);\n init(args);\n\n this.is_vertical = (args.bar_orientation === 'vertical');\n\n if (this.is_vertical) {\n x_axis_categorical(args);\n y_axis(args);\n } else {\n x_axis(args);\n y_axis_categorical(args);\n }\n\n this.mainPlot();\n this.markers();\n this.rollover();\n this.windowListeners();\n\n return this;\n };\n\n this.mainPlot = function() {\n var svg = mg_get_svg_child_of(args.target);\n var data = args.data[0];\n var barplot = svg.select('g.mg-barplot');\n var fresh_render = barplot.empty();\n\n var bars;\n var predictor_bars;\n var pp, pp0;\n var baseline_marks;\n\n var perform_load_animation = fresh_render && args.animate_on_load;\n var should_transition = perform_load_animation || args.transition_on_update;\n var transition_duration = args.transition_duration || 1000;\n\n // draw the plot on first render\n if (fresh_render) {\n barplot = svg.append('g')\n .classed('mg-barplot', true);\n }\n\n bars = bars = barplot.selectAll('.mg-bar')\n .data(data);\n\n bars.exit().remove();\n\n bars.enter().append('rect')\n .classed('mg-bar', true);\n\n if (args.predictor_accessor) {\n predictor_bars = barplot.selectAll('.mg-bar-prediction')\n .data(data);\n\n predictor_bars.exit().remove();\n\n predictor_bars.enter().append('rect')\n .classed('mg-bar-prediction', true);\n }\n\n if (args.baseline_accessor) {\n baseline_marks = barplot.selectAll('.mg-bar-baseline')\n .data(data);\n\n baseline_marks.exit().remove();\n\n baseline_marks.enter().append('line')\n .classed('mg-bar-baseline', true);\n }\n\n var appropriate_size;\n\n // setup transitions\n if (should_transition) {\n bars = bars.transition()\n .duration(transition_duration);\n\n if (predictor_bars) {\n predictor_bars = predictor_bars.transition()\n .duration(transition_duration);\n }\n\n if (baseline_marks) {\n baseline_marks = baseline_marks.transition()\n .duration(transition_duration);\n }\n }\n\n // move the barplot after the axes so it doesn't overlap\n svg.select('.mg-y-axis').node().parentNode.appendChild(barplot.node());\n\n if (this.is_vertical) {\n appropriate_size = args.scales.X.rangeBand()/1.5;\n\n if (perform_load_animation) {\n bars.attr({\n height: 0,\n y: args.scales.Y(0)\n });\n\n if (predictor_bars) {\n predictor_bars.attr({\n height: 0,\n y: args.scales.Y(0)\n });\n }\n\n if (baseline_marks) {\n baseline_marks.attr({\n y1: args.scales.Y(0),\n y2: args.scales.Y(0)\n });\n }\n }\n\n bars.attr('y', args.scalefns.yf)\n .attr('x', function(d) {\n return args.scalefns.xf(d) + appropriate_size/2;\n })\n .attr('width', appropriate_size)\n .attr('height', function(d) {\n return 0 - (args.scalefns.yf(d) - args.scales.Y(0));\n });\n\n\n if (args.predictor_accessor) {\n pp = args.predictor_proportion;\n pp0 = pp-1;\n\n // thick line through bar;\n predictor_bars\n .attr('y', function(d) {\n return args.scales.Y(0) - (args.scales.Y(0) - args.scales.Y(d[args.predictor_accessor]));\n })\n .attr('x', function(d) {\n return args.scalefns.xf(d) + pp0*appropriate_size/(pp*2) + appropriate_size/2;\n })\n .attr('width', appropriate_size/pp)\n .attr('height', function(d) {\n return 0 - (args.scales.Y(d[args.predictor_accessor]) - args.scales.Y(0));\n });\n }\n\n if (args.baseline_accessor) {\n pp = args.predictor_proportion;\n\n baseline_marks\n .attr('x1', function(d) {\n return args.scalefns.xf(d)+appropriate_size/2-appropriate_size/pp + appropriate_size/2;\n })\n .attr('x2', function(d) {\n return args.scalefns.xf(d)+appropriate_size/2+appropriate_size/pp + appropriate_size/2;\n })\n .attr('y1', function(d) { return args.scales.Y(d[args.baseline_accessor]); })\n .attr('y2', function(d) { return args.scales.Y(d[args.baseline_accessor]); });\n }\n } else {\n appropriate_size = args.scales.Y.rangeBand()/1.5;\n\n if (perform_load_animation) {\n bars.attr('width', 0);\n\n if (predictor_bars) {\n predictor_bars.attr('width', 0);\n }\n\n if (baseline_marks) {\n baseline_marks.attr({\n x1: args.scales.X(0),\n x2: args.scales.X(0)\n });\n }\n }\n\n bars.attr('x', args.scales.X(0))\n .attr('y', function(d) {\n return args.scalefns.yf(d) + appropriate_size/2;\n })\n .attr('height', appropriate_size)\n .attr('width', function(d) {\n return args.scalefns.xf(d) - args.scales.X(0);\n });\n\n if (args.predictor_accessor) {\n pp = args.predictor_proportion;\n pp0 = pp-1;\n\n // thick line through bar;\n predictor_bars\n .attr('x', args.scales.X(0))\n .attr('y', function(d) {\n return args.scalefns.yf(d) + pp0 * appropriate_size/(pp*2) + appropriate_size / 2;\n })\n .attr('height', appropriate_size / pp)\n .attr('width', function(d) {\n return args.scales.X(d[args.predictor_accessor]) - args.scales.X(0);\n });\n }\n\n if (args.baseline_accessor) {\n pp = args.predictor_proportion;\n\n baseline_marks\n .attr('x1', function(d) { return args.scales.X(d[args.baseline_accessor]); })\n .attr('x2', function(d) { return args.scales.X(d[args.baseline_accessor]); })\n .attr('y1', function(d) {\n return args.scalefns.yf(d) + appropriate_size / 2 - appropriate_size / pp + appropriate_size / 2;\n })\n .attr('y2', function(d) {\n return args.scalefns.yf(d) + appropriate_size / 2 + appropriate_size / pp + appropriate_size / 2;\n });\n }\n }\n\n return this;\n };\n\n this.markers = function() {\n markers(args);\n return this;\n };\n\n this.rollover = function() {\n var svg = mg_get_svg_child_of(args.target);\n var g;\n\n //remove the old rollovers if they already exist\n svg.selectAll('.mg-rollover-rect').remove();\n svg.selectAll('.mg-active-datapoint').remove();\n\n //rollover text\n svg.append('text')\n .attr('class', 'mg-active-datapoint')\n .attr('xml:space', 'preserve')\n .attr('x', args.width - args.right)\n .attr('y', args.top / 2)\n .attr('dy', '.35em')\n .attr('text-anchor', 'end');\n\n g = svg.append('g')\n .attr('class', 'mg-rollover-rect');\n\n //draw rollover bars\n var bar = g.selectAll(\".mg-bar-rollover\")\n .data(args.data[0]).enter()\n .append(\"rect\")\n .attr('class', 'mg-bar-rollover');\n\n if (this.is_vertical) {\n bar.attr(\"x\", args.scalefns.xf)\n .attr(\"y\", function() {\n return args.scales.Y(0) - args.height;\n })\n .attr('width', args.scales.X.rangeBand())\n .attr('height', args.height)\n .attr('opacity', 0)\n .on('mouseover', this.rolloverOn(args))\n .on('mouseout', this.rolloverOff(args))\n .on('mousemove', this.rolloverMove(args));\n } else {\n bar.attr(\"x\", args.scales.X(0))\n .attr(\"y\", args.scalefns.yf)\n .attr('width', args.width)\n .attr('height', args.scales.Y.rangeBand()+2)\n .attr('opacity', 0)\n .on('mouseover', this.rolloverOn(args))\n .on('mouseout', this.rolloverOff(args))\n .on('mousemove', this.rolloverMove(args));\n }\n return this;\n };\n\n this.rolloverOn = function(args) {\n var svg = mg_get_svg_child_of(args.target);\n var label_accessor = this.is_vertical ? args.x_accessor : args.y_accessor;\n var data_accessor = this.is_vertical ? args.y_accessor : args.x_accessor;\n var label_units = this.is_vertical ? args.yax_units : args.xax_units;\n\n return function(d, i) {\n svg.selectAll('text')\n .filter(function(g, j) {\n return d === g;\n })\n .attr('opacity', 0.3);\n\n var fmt = d3.time.format('%b %e, %Y');\n var num = format_rollover_number(args);\n\n //highlight active bar\n svg.selectAll('g.mg-barplot .mg-bar')\n .filter(function(d, j) {\n return j === i;\n })\n .classed('active', true);\n\n //update rollover text\n if (args.show_rollover_text) {\n svg.select('.mg-active-datapoint')\n .text(function() {\n if (args.time_series) {\n var dd = new Date(+d[data_accessor]);\n dd.setDate(dd.getDate());\n\n return fmt(dd) + ' ' + label_units + num(d[label_accessor]);\n } else {\n return d[label_accessor] + ': ' + num(d[data_accessor]);\n }\n });\n }\n\n if (args.mouseover) {\n args.mouseover(d, i);\n }\n };\n };\n\n this.rolloverOff = function(args) {\n var svg = mg_get_svg_child_of(args.target);\n\n return function(d, i) {\n //reset active bar\n svg.selectAll('g.mg-barplot .mg-bar')\n .classed('active', false);\n\n //reset active data point text\n svg.select('.mg-active-datapoint')\n .text('');\n\n if (args.mouseout) {\n args.mouseout(d, i);\n }\n };\n };\n\n this.rolloverMove = function(args) {\n return function(d, i) {\n if (args.mousemove) {\n args.mousemove(d, i);\n }\n };\n };\n\n this.windowListeners = function() {\n mg_window_listeners(this.args);\n return this;\n };\n\n this.init(args);\n }", "function DrawVerticalBarChart() {\n\n //set width and height of the chart\t\t\t\t\t\t\t\n var width = $(\".chartDivs4\").width(),\n height = $(\".chartDivs4\").height();\n\n //set margins\n var margin = {\n top: 20,\n right: 30,\n bottom: 30,\n left: 40\n };\n\n var width = width - margin.left - margin.right * 2.5;\n var height = height - margin.top - margin.bottom;\n\n\n var data = [{\n country: \"Europe\",\n growth: 5\n }, {\n country: \"Asia\",\n growth: 10\n }, {\n country: \"America\",\n growth: 15\n }, {\n country: \"Australia\",\n growth: 20\n }, {\n country: \"Africa\",\n growth: 25\n }];\n\n //set margins\n var margin = {\n top: 20,\n right: 30,\n bottom: 30,\n left: 40\n };\n\n //set scales and ranges\n var xScale = d3.scaleBand().range([0, width * 1.1]).padding(.1)\n\n var yScale = d3.scaleLinear().range([height, 30])\n\n //append the svg element and central g\n var svg = d3.select(\".chartDivs4\")\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right * 3)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"class\", \"mainSvgG\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n //Add a Title\n svg.append(\"text\")\n .attr(\"x\", (width / 2))\n .attr(\"y\", 11)\n .attr(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"16px\")\n .style(\"text-decoration\", \"underline\")\n .text(\"Title for a vertical bar chart\");\n\n data.forEach(function(d) {\n return d.growth = +d.growth;\n });\n\n //set domains\n xScale.domain(data.map(function(d) {\n return d.country;\n }))\n\n yScale.domain([0, d3.max(data, function(d) {\n return d.growth\n })]).nice();\n\n //set axes\n\n var xAxis = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + 0 + \",\" + height + \")\")\n .call(d3.axisBottom(xScale))\n\n\n svg.selectAll(\"rects\")\n .data(data)\n .enter()\n .append(\"rect\")\n .transition()\n .duration((d, i) => (1 + i) * 1500)\n .delay((d, i) => (1 + i) * 500)\n .attr(\"x\", function(d) {\n return xScale(d.country)\n })\n .attr(\"y\", (d) => height - yScale(d.growth))\n .ease(d3.easeElastic)\n .attr(\"width\", xScale.bandwidth())\n .attr(\"height\", function(d) {\n return yScale(d.growth)\n })\n\n .attr(\"fill\", \"#470A68\")\n\n\n\n var yAxis = svg.append(\"g\")\n .call(d3.axisLeft(yScale));\n\n\n }", "function makeBars(data) {\n\n\t// a bit of data processing here:\n\t// basically just a dictionary for the tvars and their data\n\tvar tvars = d3.map(data[0]);\n\ttvars.remove(\"readings\");\n\tvar tkeys = tvars.keys();\n\tvar datamap = makeMap(data, tkeys);\n\tdatamap = d3.map(datamap);\n\n\t// Add an svg for each element\n\tvar svgs = d3.select(\"#bars\")\n\t\t\t\t.selectAll(\"svg\")\n\t\t\t\t\t.data(datamap.values())\n\n\t\tsvgs.enter()\n\t\t\t.append(\"svg\")\n\t\t\t\t.attr(\"class\", \"bsvgs\")\n\t\t\t\t.attr(\"width\", barcodeWidth)\n\t\t\t\t.attr(\"height\", barcodeHeight)\n\t\t\t\t.style(\"background-color\", \"#e8e8e8\")\n\n\t\tsvgs.exit().remove();\n\n\t//Add little barcode marks per respective svg\n\tvar blips = d3.selectAll(\".bsvgs\").selectAll(\"rect\")\n\t\t\t\t.data(function(d) {\n\t\t\t\t\treturn d;\n\t\t\t\t})\n\n\t\tblips.enter()\n\t\t\t.append(\"rect\")\n\t\t\t\t.attr(\"id\", function(d, i) {\n\t\t\t\t\treturn i;\n\t\t\t\t})\n\t\t\t\t.attr(\"width\", \"3px\")\n\t\t\t\t.attr(\"height\", barcodeHeight)\t\n\t\t\t\t.attr(\"x\", function(d) {\n\t\t\t\t\treturn chartScale(d);\n\t\t\t\t})\n\t\t\t\t.style(\"fill\", function(d) { // fill based on slider vals\n\t\t\t\t\tvar values = stdSlider.noUiSlider.get();\n\t\t\t\t\tleft = values[0];\n\t\t\t\t\tright = values[1];\n\t\t\t\t\tif (((+d) <=left) || ((+d)>=right)) {\n\t\t\t\t\t\treturn \"orange\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn \"#969696\";\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.style(\"stroke-width\", \"1px\")\n\t\t\t\t.style(\"stroke\", \"#ededed\")\n\t\t\t\t.on(\"mouseover\", function(d) {\n\n\t\t\t\t\tvar currid = this.id;\n\t\t\t\t\td3.selectAll(\"rect\").style(\"fill\", function(d) {\n\t\t\t\t\t\tif (this.id == currid) {\n\t\t\t\t\t\t\treturn \"blue\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn colorUp(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.on(\"mouseout\", function() {\n\t\t\t\t\td3.selectAll(\"rect\").style(\"fill\", function(d) {\n\t\t\t\t\t\treturn colorUp(d);\n\t\t\t\t\t});\n\n\t\t\t\t\td3.selectAll(\"circle\").style(\"fill\", \"gray\");\n\t\t\t\t})\n\t\t\t\t.on(\"click\", function() {\n\t\t\t\t\tvar currid = this.id;\n\t\t\t\t\t// interaction for isolating the connected marks\n\t\t\t\t\td3.selectAll(\"rect\").style(\"fill\", function(d) {\n\t\t\t\t\t\tif (this.id == currid) {\n\t\t\t\t\t\t\tif(colorUp(d) == \"orange\") {\n\t\t\t\t\t\t\t\treturn \"orange\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn \"gray\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"blue\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn \"#e8e8e8\";\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t// interaction for hilighting the respective data point circle\n\t\t\t\t\td3.selectAll(\"circle\").style(\"fill\", function(d) {\n\t\t\t\t\t\tif (this.id == currid) {\n\t\t\t\t\t\t\treturn \"gray\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn \"white\";\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t})\n\n}", "function appendBars(paddingGroup, data, scales, plot) {\n const rectWidth = scales.x.bandwidth() * 0.2;\n paddingGroup.append('g')\n .attr('class', 'bars')\n .attr('transform', 'translate(' + (scales.x.bandwidth()/2 - rectWidth/2) + ',0)')\n .selectAll()\n .data(data)\n .enter()\n .append('rect')\n .attr('x', (d) => scales.x(d.name))\n .attr('y', (d) => scales.y(d.scoreToday))\n .attr('width', rectWidth)\n .attr('height', (d) => plot.range.y - scales.y(d.scoreToday))\n .attr('class', (d) => d.name);\n }", "function stackedBarChart(data, options, element) {\n\n // extracts needed information from data\n var values = data.values;\n var scale = data.scale;\n var legend = data.legend;\n\n // extracts needed information from options\n var chartWidth = options.width;\n var chartHeight = options.height;\n var space = options.spacing;\n var labelColour = options.labelColour;\n var labelAlign = options.labelAlign;\n\n // updates the size of the area the the chart is rendered into\n $(element).css({width: (chartWidth + 300) + \"px\", height: (chartHeight + 300) + \"px\"});\n\n // creates the chart area that the bars are rendered to\n var chartArea = $(\"<div>\").attr(\"id\", \"chartArea\");\n $(chartArea).css({width: chartWidth + \"px\", height: chartHeight + \"px\"});\n $(element).append(chartArea);\n\n // determines the maximum value to be displayed on the Y axis of the chart and the width of the bars to be displayed\n var maxY = findMaxY(values, scale);\n var barWidth = (chartWidth / values.length) - space;\n var barHeight;\n var i;\n var j;\n\n for (i = 0; i < values.length; i++) {\n // stackHeight keeps track of the current height of each stack\n var stackHeight = 0;\n\n for (j = 0; j < values[i].length; j++) {\n // creates a bar for each value in each array of values\n var bar = $(\"<div>\").addClass(\"bar\");\n\n // determines the bar's height\n barHeight = values[i][j] / maxY * chartHeight;\n\n // updates the position, colours, and text displayed for the bar\n $(bar).css({width: barWidth + \"px\", height: barHeight + \"px\", marginLeft: (space + i * (barWidth + space)) + \"px\", top: (chartHeight - barHeight - stackHeight) + \"px\", background: legend[j][1], color: labelColour});\n $(bar).text(values[i][j]);\n\n // determines the position of the labels within the bar (\"top\", \"center\", or \"bottom\")\n if (barHeight < 16) {\n $(bar).text(\"\");\n } else if (labelAlign === \"center\") {\n $(bar).css({lineHeight: barHeight + \"px\"});\n } else if (labelAlign === \"bottom\") {\n $(bar).css({lineHeight: (2 * barHeight - 20) + \"px\"});\n } else {\n $(bar).css({lineHeight: 20 + \"px\"});\n }\n\n // increases the height of the stack by the height of the current bar\n stackHeight += barHeight;\n\n // appends the bar to the chart area\n $(chartArea).append(bar);\n }\n }\n}", "function initBarCharts(dataIn){\n\n\t\n\n\tvar lhColStr = '<div class=\"sub-left-col-copy\"></div>'\n\t\n\t\n\tvar htmlStrGraphs = \"\";\n\n\t_.each(dataIn, function(item,i){\n\t\tvar topLineItem = getTopLineItem(item[0].scorer);\n\n\t\tvar topLineStats = topLineItem.goals+\" goals in \"+topLineItem.totalcaps+\" games.\"\n\t\tvar timeStats = getCareerLength(topLineItem)\n\n\t\tvar graphString = \"<div class='subContentBlock'><h4 class='subSectionHeading'>\"+item[0].firstname+\" \"+item[0].scorer+\"</h4><div class='graphStats'>\"+timeStats+\"<br/>\"+topLineStats+\"</div><div class='graph-wrapper'></div></div>\"; \n\t\thtmlStrGraphs+=graphString;\n\t})\n\n\t$( \"#graphsHolder\" ).html(htmlStrGraphs);\t\n\n\t\n\n\t// $(\".bar-chart-title\").each(function(i, e) {\n\t// \t$(e).attr(\"id\", \"bar-chart-title_\" +i);\n\t// });\n\n\t$(\".graph-wrapper\").each(function(i, e) {\n\t\t$(e).attr(\"id\", \"graph-wrapper_\" +i);\n\t});\n\n\tbuildBarGraphView();\n}", "function showBar() {\r\n\r\n\r\n\t$( document ).ready(function() {\r\n\r\n\tvar showData = $('#show-data');\r\n\t\r\n\tif (firstin){\r\n\t\tset_svg();\r\n\t\tfirstin = false;\r\n\t}\r\n\r\n\tvar x = d3.scaleBand().rangeRound([0, width]).padding(0.1),\r\n y = d3.scaleLinear().rangeRound([height, 0]);\r\n\r\n\r\nd3.tsv(\"data.tsv\", function(d) {\r\n d.frequency = +d.frequency;\r\n return d;\r\n}, function(error, data) {\r\n if (error) throw error;\r\n\r\n x.domain(data.map(function(d) { return d.letter; }));\r\n y.domain([0, d3.max(data, function(d) { return d.frequency; })]);\r\n\r\n\r\n//start here\r\n x_axis[chartCount] = group.append(\"g\")\r\n .attr(\"class\", function(){ return \"axis axis--x\"+chartCount;})\t\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(d3.axisBottom(x));\r\n\r\n y_axis[chartCount] = group.append(\"g\")\r\n .attr(\"class\", function(){ return \"axis axis--y\"+chartCount;})\r\n\t .call(d3.axisLeft(y).ticks(10, \"%\"))\r\n \t .append(\"text\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .attr(\"y\", 6)\r\n .attr(\"dy\", \"0.71em\")\r\n .attr(\"text-anchor\", \"end\")\r\n .text(\"Frequency\");\r\n\r\n bar[chartCount] = group.selectAll(\".bar\")\r\n .data(data)\r\n .enter().append(\"rect\")\r\n .attr(\"class\", function() { return \"bar\"+chartCount; })\r\n\t .style(\"fill\",\"steelblue\")\r\n .attr(\"x\", function(d) { return x(d.letter); })\r\n .attr(\"y\", function(d) { return y(d.frequency); })\r\n .attr(\"width\", x.bandwidth())\r\n.call(d3.drag()\r\n \t.on(\"start\", bardragstarted)\r\n \t.on(\"drag\", bardragged)\r\n \t.on(\"end\", bardragended))\r\n\r\n .attr(\"height\", function(d) { return height - y(d.frequency); });\r\n});\r\n\r\n\r\nchartCount++; \r\n\r\n\r\n\r\nfunction bardragged(d) {\t\r\n\t\r\n\tvar x = d3.event.x;\r\n\tvar y = d3.event.y;\r\n\tvar drag_x = \".axis--x\"+chartCount;\r\n\tvar drag_y = \".axis--y\"+chartCount;\r\n\tvar drag_bar = \".bar\"+chartCount;\r\n\r\n\td3.select(\"svg\").selectAll(drag_x)\t\t\r\n\t.attr('transform', 'translate(' + x + ',' + \t(y + height) + ')');\r\n\r\n\td3.select(\"svg\").selectAll(drag_y)\t\t\r\n\t.attr('transform', 'translate(' + x + ',' + \ty + ')');\r\n\r\n\td3.select(\"svg\").selectAll(drag_bar)\t\t\r\n\t.attr('transform', 'translate(' + x + ',' + \ty + ')');\r\n\t\r\n\t\r\n\r\n}\r\n\r\nfunction bardragstarted(d) {\r\n //alert(\"ended\");\r\n} \r\n\r\nfunction bardragended(d) {\r\n //alert(\"ended\");\r\n} \r\n\r\n\r\n\r\nshowData.empty();\r\n\r\n\r\n \t\r\n\r\n\t\r\n\r\n showData.text('Loading the JSON file.');\r\n });\r\n\r\n\r\n}", "function init() {\n data = [{\n x: xBehavior,\n y: yBehavior,\n marker: {\n color: '#A1E8D9'\n },\n type: \"bar\"\n }] \n Plotly.newPlot(\"barchart\", data)\n }", "function generateBarChart(yAxisKey, PRAC_CODE, elementID, denominator) {\n if (denominator != 'raw') {\n generateRelativeNumbers(yAxisKey, denominator)\n yAxisKey = yAxisKey + 'by' + denominator\n }\n tdata = data.filter(x =>\n !isNaN(x[yAxisKey])\n );\n //Sort by the yAxisKey to make chart readable\n tdata.sort(function (a, b) {\n return Number(a[yAxisKey]) - Number(b[yAxisKey]);\n });\n\n backgroundColorArray = backgroundColourGenerator(tdata, PRAC_CODE);\n config = {\n type: 'bar',\n data: {\n datasets: [{\n label: yAxisKey,\n data: tdata,\n backgroundColor: backgroundColorArray,\n parsing: {\n yAxisKey: yAxisKey\n }\n }]\n },\n options: {\n maintainAspectRatio: false,\n plugins: {\n legend: {\n display: false,\n }\n },\n scales: {\n x: {\n ticks: {\n display: false\n }\n }\n }\n }\n };\n\n return new Chart(\n document.getElementById(elementID + '-bar'),\n config\n );\n}", "function makefigure() {\n\n // clear out the previous bar chart\n d3.selectAll('svg > g > *').remove();\n\n // Scale the range of the data in the domains\n x.domain(data.map(function(d) {\n return d.asset; }));\n y.domain([0, d3.max(data, function(d) {\n return d.amount; })]);\n\n // make the title of the figure\n svg.append(\"text\")\n .attr(\"class\", \"title\")\n .attr(\"x\", x(data[0].name))\n .attr(\"y\", -26)\n .text(\"Investment Allocation across Asset Types\");\n\n\n // append the rectangles for the bar chart\n svg.selectAll(\".bar\")\n .data(data)\n .enter().append(\"rect\")\n .transition().duration(200).ease(d3.easeCircleIn)\n .attr(\"class\", \"bar\")\n .attr(\"x\", function(d) {\n return x(d.asset); })\n .attr(\"width\", x.bandwidth())\n .attr(\"y\", function(d) {\n return y(d.amount); })\n .attr(\"height\", function(d) {\n return height - y(d.amount); });\n\n // add asset value annotation at top of bars\n svg.selectAll(\".labels\")\n .data(data)\n .enter().append(\"text\")\n .transition().delay(400).duration(200).ease(d3.easeCircleIn)\n .text(function(d) {\n return d.amount;\n })\n .attr(\"text-anchor\", \"middle\")\n .attr(\"x\", function(d) {\n return x(d.asset) + 50; })\n .attr(\"y\", function(d) {\n return y(d.amount) - 2; })\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"20px\")\n .attr(\"fill\", \"black\");\n\n // add the x Axis\n svg.append(\"g\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x))\n .selectAll(\".tick text\")\n .call(wrap, x.bandwidth());\n\n // add the y Axis\n svg.append(\"g\")\n .call(d3.axisLeft(y));\n\n // text label for the y axis\n svg.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left)\n .attr(\"x\", 0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Investment Portfolio Percentage\");\n }", "function barChart(args) {\n this.args = args;\n\n this.init = function(args) {\n this.args = args;\n\n raw_data_transformation(args);\n process_categorical_variables(args);\n init(args);\n\n this.is_vertical = (args.bar_orientation === 'vertical');\n\n if (this.is_vertical) {\n x_axis_categorical(args);\n y_axis(args);\n } else {\n x_axis(args);\n y_axis_categorical(args);\n }\n\n this.mainPlot();\n this.markers();\n this.rollover();\n this.windowListeners();\n\n return this;\n };\n\n this.mainPlot = function() {\n var svg = mg_get_svg_child_of(args.target);\n var data = args.data[0];\n var barplot = svg.select('g.mg-barplot');\n var fresh_render = barplot.empty();\n\n var bars;\n var predictor_bars;\n var pp, pp0;\n var baseline_marks;\n\n var perform_load_animation = fresh_render && args.animate_on_load;\n var should_transition = perform_load_animation || args.transition_on_update;\n var transition_duration = args.transition_duration || 1000;\n\n // draw the plot on first render\n if (fresh_render) {\n barplot = svg.append('g')\n .classed('mg-barplot', true);\n }\n\n bars = bars = barplot.selectAll('.mg-bar')\n .data(data);\n\n bars.exit().remove();\n\n bars.enter().append('rect')\n .classed('mg-bar', true);\n\n if (args.predictor_accessor) {\n predictor_bars = barplot.selectAll('.mg-bar-prediction')\n .data(data);\n\n predictor_bars.exit().remove();\n\n predictor_bars.enter().append('rect')\n .classed('mg-bar-prediction', true);\n }\n\n if (args.baseline_accessor) {\n baseline_marks = barplot.selectAll('.mg-bar-baseline')\n .data(data);\n\n baseline_marks.exit().remove();\n\n baseline_marks.enter().append('line')\n .classed('mg-bar-baseline', true);\n }\n\n var appropriate_size;\n\n // setup transitions\n if (should_transition) {\n bars = bars.transition()\n .duration(transition_duration);\n\n if (predictor_bars) {\n predictor_bars = predictor_bars.transition()\n .duration(transition_duration);\n }\n\n if (baseline_marks) {\n baseline_marks = baseline_marks.transition()\n .duration(transition_duration);\n }\n }\n\n // move the barplot after the axes so it doesn't overlap\n svg.select('.mg-y-axis').node().parentNode.appendChild(barplot.node());\n\n if (this.is_vertical) {\n appropriate_size = args.scales.X.rangeBand()/1.5;\n\n if (perform_load_animation) {\n bars.attr({\n height: 0,\n y: args.scales.Y(0)\n });\n\n if (predictor_bars) {\n predictor_bars.attr({\n height: 0,\n y: args.scales.Y(0)\n });\n }\n\n if (baseline_marks) {\n baseline_marks.attr({\n y1: args.scales.Y(0),\n y2: args.scales.Y(0)\n });\n }\n }\n\n bars.attr('y', args.scalefns.yf)\n .attr('x', function(d) {\n return args.scalefns.xf(d) + appropriate_size/2;\n })\n .attr('width', appropriate_size)\n .attr('height', function(d) {\n return 0 - (args.scalefns.yf(d) - args.scales.Y(0));\n });\n\n\n if (args.predictor_accessor) {\n pp = args.predictor_proportion;\n pp0 = pp-1;\n\n // thick line through bar;\n predictor_bars\n .attr('y', function(d) {\n return args.scales.Y(0) - (args.scales.Y(0) - args.scales.Y(d[args.predictor_accessor]));\n })\n .attr('x', function(d) {\n return args.scalefns.xf(d) + pp0*appropriate_size/(pp*2) + appropriate_size/2;\n })\n .attr('width', appropriate_size/pp)\n .attr('height', function(d) {\n return 0 - (args.scales.Y(d[args.predictor_accessor]) - args.scales.Y(0));\n });\n }\n\n if (args.baseline_accessor) {\n pp = args.predictor_proportion;\n\n baseline_marks\n .attr('x1', function(d) {\n return args.scalefns.xf(d)+appropriate_size/2-appropriate_size/pp + appropriate_size/2;\n })\n .attr('x2', function(d) {\n return args.scalefns.xf(d)+appropriate_size/2+appropriate_size/pp + appropriate_size/2;\n })\n .attr('y1', function(d) { return args.scales.Y(d[args.baseline_accessor]); })\n .attr('y2', function(d) { return args.scales.Y(d[args.baseline_accessor]); });\n }\n } else {\n appropriate_size = args.scales.Y.rangeBand()/1.5;\n\n if (perform_load_animation) {\n bars.attr('width', 0);\n\n if (predictor_bars) {\n predictor_bars.attr('width', 0);\n }\n\n if (baseline_marks) {\n baseline_marks.attr({\n x1: args.scales.X(0),\n x2: args.scales.X(0)\n });\n }\n }\n\n bars.attr('x', args.scales.X(0))\n .attr('y', function(d) {\n return args.scalefns.yf(d) + appropriate_size/2;\n })\n .attr('height', appropriate_size)\n .attr('width', function(d) {\n return args.scalefns.xf(d) - args.scales.X(0);\n });\n\n if (args.predictor_accessor) {\n pp = args.predictor_proportion;\n pp0 = pp-1;\n\n // thick line through bar;\n predictor_bars\n .attr('x', args.scales.X(0))\n .attr('y', function(d) {\n return args.scalefns.yf(d) + pp0 * appropriate_size/(pp*2) + appropriate_size / 2;\n })\n .attr('height', appropriate_size / pp)\n .attr('width', function(d) {\n return args.scales.X(d[args.predictor_accessor]) - args.scales.X(0);\n });\n }\n\n if (args.baseline_accessor) {\n pp = args.predictor_proportion;\n\n baseline_marks\n .attr('x1', function(d) { return args.scales.X(d[args.baseline_accessor]); })\n .attr('x2', function(d) { return args.scales.X(d[args.baseline_accessor]); })\n .attr('y1', function(d) {\n return args.scalefns.yf(d) + appropriate_size / 2 - appropriate_size / pp + appropriate_size / 2;\n })\n .attr('y2', function(d) {\n return args.scalefns.yf(d) + appropriate_size / 2 + appropriate_size / pp + appropriate_size / 2;\n });\n }\n }\n\n return this;\n };\n\n this.markers = function() {\n markers(args);\n return this;\n };\n\n this.rollover = function() {\n var svg = mg_get_svg_child_of(args.target);\n var g;\n\n //remove the old rollovers if they already exist\n svg.selectAll('.mg-rollover-rect').remove();\n svg.selectAll('.mg-active-datapoint').remove();\n\n //rollover text\n svg.append('text')\n .attr('class', 'mg-active-datapoint')\n .attr('xml:space', 'preserve')\n .attr('x', args.width - args.right)\n .attr('y', args.top * 0.75)\n .attr('dy', '.35em')\n .attr('text-anchor', 'end');\n\n g = svg.append('g')\n .attr('class', 'mg-rollover-rect');\n\n //draw rollover bars\n var bar = g.selectAll(\".mg-bar-rollover\")\n .data(args.data[0]).enter()\n .append(\"rect\")\n .attr('class', 'mg-bar-rollover');\n\n if (this.is_vertical) {\n bar.attr(\"x\", args.scalefns.xf)\n .attr(\"y\", function() {\n return args.scales.Y(0) - args.height;\n })\n .attr('width', args.scales.X.rangeBand())\n .attr('height', args.height)\n .attr('opacity', 0)\n .on('mouseover', this.rolloverOn(args))\n .on('mouseout', this.rolloverOff(args))\n .on('mousemove', this.rolloverMove(args));\n } else {\n bar.attr(\"x\", args.scales.X(0))\n .attr(\"y\", args.scalefns.yf)\n .attr('width', args.width)\n .attr('height', args.scales.Y.rangeBand()+2)\n .attr('opacity', 0)\n .on('mouseover', this.rolloverOn(args))\n .on('mouseout', this.rolloverOff(args))\n .on('mousemove', this.rolloverMove(args));\n }\n return this;\n };\n\n this.rolloverOn = function(args) {\n var svg = mg_get_svg_child_of(args.target);\n var label_accessor = this.is_vertical ? args.x_accessor : args.y_accessor;\n var data_accessor = this.is_vertical ? args.y_accessor : args.x_accessor;\n var label_units = this.is_vertical ? args.yax_units : args.xax_units;\n\n return function(d, i) {\n svg.selectAll('text')\n .filter(function(g, j) {\n return d === g;\n })\n .attr('opacity', 0.3);\n\n var fmt = MG.time_format(args.utc_time, '%b %e, %Y');\n var num = format_rollover_number(args);\n\n //highlight active bar\n svg.selectAll('g.mg-barplot .mg-bar')\n .filter(function(d, j) {\n return j === i;\n })\n .classed('active', true);\n\n //update rollover text\n if (args.show_rollover_text) {\n svg.select('.mg-active-datapoint')\n .text(function() {\n if (args.time_series) {\n var dd = new Date(+d[data_accessor]);\n dd.setDate(dd.getDate());\n\n return fmt(dd) + ' ' + label_units + num(d[label_accessor]);\n } else {\n return d[label_accessor] + ': ' + num(d[data_accessor]);\n }\n });\n }\n\n if (args.mouseover) {\n args.mouseover(d, i);\n }\n };\n };\n\n this.rolloverOff = function(args) {\n var svg = mg_get_svg_child_of(args.target);\n\n return function(d, i) {\n //reset active bar\n svg.selectAll('g.mg-barplot .mg-bar')\n .classed('active', false);\n\n //reset active data point text\n svg.select('.mg-active-datapoint')\n .text('');\n\n if (args.mouseout) {\n args.mouseout(d, i);\n }\n };\n };\n\n this.rolloverMove = function(args) {\n return function(d, i) {\n if (args.mousemove) {\n args.mousemove(d, i);\n }\n };\n };\n\n this.windowListeners = function() {\n mg_window_listeners(this.args);\n return this;\n };\n\n this.init(args);\n }", "function chartBarChartHorizontal () {\n\n /* Default Properties */\n var svg = void 0;\n var chart = void 0;\n var classed = \"barChartHorizontal\";\n var width = 400;\n var height = 300;\n var margin = { top: 20, right: 20, bottom: 20, left: 80 };\n var transition = { ease: d3.easeBounce, duration: 500 };\n var colors = palette.categorical(3);\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n\n /* Chart Dimensions */\n var chartW = void 0;\n var chartH = void 0;\n\n /* Scales */\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = void 0;\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n chartW = width - (margin.left + margin.right);\n chartH = height - (margin.top + margin.bottom);\n\n var _dataTransform$summar = dataTransform(data).summary(),\n columnKeys = _dataTransform$summar.columnKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(columnKeys).range(colors);\n }\n\n yScale = d3.scaleBand().domain(columnKeys).rangeRound([0, chartH]).padding(0.15);\n\n xScale = d3.scaleLinear().domain(valueExtent).range([0, chartW]).nice();\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias barChartHorizontal\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n // Create SVG element (if it does not exist already)\n if (!svg) {\n svg = function (selection) {\n var el = selection._groups[0][0];\n if (!!el.ownerSVGElement || el.tagName === \"svg\") {\n return selection;\n } else {\n return selection.append(\"svg\");\n }\n }(selection);\n\n svg.classed(\"d3ez\", true).attr(\"width\", width).attr(\"height\", height);\n\n chart = svg.append(\"g\").classed(\"chart\", true);\n } else {\n chart = selection.select(\".chart\");\n }\n\n // Update the chart dimensions and add layer groups\n var layers = [\"barChart\", \"xAxis axis\", \"yAxis axis\"];\n chart.classed(classed, true).attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\").attr(\"width\", chartW).attr(\"height\", chartH).selectAll(\"g\").data(layers).enter().append(\"g\").attr(\"class\", function (d) {\n return d;\n });\n\n selection.each(function (data) {\n // Initialise Data\n init(data);\n\n // Horizontal Bars\n var barsHorizontal = component.barsHorizontal().width(chartW).height(chartH).colorScale(colorScale).xScale(xScale).yScale(yScale).dispatch(dispatch);\n\n chart.select(\".barChart\").datum(data).call(barsHorizontal);\n\n // X Axis\n var xAxis = d3.axisBottom(xScale);\n\n chart.select(\".xAxis\").attr(\"transform\", \"translate(0,\" + chartH + \")\").call(xAxis);\n\n // Y Axis\n var yAxis = d3.axisLeft(yScale);\n\n chart.select(\".yAxis\").call(yAxis);\n\n // Y Axis Label\n var yLabel = chart.select(\".yAxis\").selectAll(\".yAxisLabel\").data([data.key]);\n\n yLabel.enter().append(\"text\").classed(\"yAxisLabel\", true).attr(\"y\", -10).attr(\"dy\", \".71em\").attr(\"fill\", \"#000000\").style(\"text-anchor\", \"center\").merge(yLabel).transition().text(function (d) {\n return d;\n });\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return this;\n };\n\n /**\n * Transition Getter / Setter\n *\n * @param {d3.transition} _v - D3 transition style.\n * @returns {*}\n */\n my.transition = function (_v) {\n if (!arguments.length) return transition;\n transition = _v;\n return this;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch on Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Vaccines', 'Pfizer', 'Moderna', 'J&J', { role: 'annotation' } ],\n ['2020', 83, 17, 0, ''],\n ['2021', 38, 25, 37, '']\n ]);\n\n var options_fullStacked = {\n isStacked: 'Percent Used',\n height: 300,\n legend: {position: 'top', maxLines: 3},\n hAxis: {\n minValue: 0,\n ticks: [0, .3, .6, .9, 1]\n }\n };\n\n const chart = new google.visualization.BarChart(\n document.getElementById('chart-container'));\n chart.draw(data, options_fullStacked);\n}", "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Country');\r\n data.addColumn('number', 'Population');\r\n data.addColumn('number', 'Area');\r\n data.addColumn('number', 'Occupancy');\r\n data.addRows([\r\n [cdata.name, cdata.population,cdata.area,(cdata.area/cdata.population)]\r\n \r\n \r\n ]);\r\n\r\n // Set chart options\r\n var options = {'title':'Population Area Ratio of '+cdata.name,\r\n 'width':250,\r\n 'height':300};\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.BarChart(document.getElementById('bc1'));\r\n chart.draw(data, options);\r\n }", "function drawBarChart(data) {\r\n /**\r\n * data is an array containing 275+ arrays \r\n * each data[i] array nests a two dimensional array\r\n * d[i][0] contains information regarding the date of the GDP measurement\r\n * d[i][1] contains information regarding the value of the GDP\r\n */\r\n\r\n // FORMAT DATA\r\n // format the data to have the proper structure, for the time scale and for the linear scale \r\n data.forEach((d) => {\r\n d[0] = parseTime(d[0]);\r\n d[1] = +d[1];\r\n });\r\n\r\n // DOMAIN\r\n // the scales' domains are defined by the minimum and maximum values of each column\r\n xScale\r\n // d3.extent returns the minimum and maximum value\r\n // this is equivalent to \r\n // .domain([d3.min(data, d => d[0]), d3.max(data, d => d[0])]);\r\n .domain(d3.extent(data, d => d[0]));\r\n \r\n yScale\r\n .domain(d3.extent(data, d => d[1]))\r\n // thanks to the nice() function, the scale is set to start at 0 and end at 20.000\r\n // applied to a domain, the function allows to avoid using the precise data points in favour of round, understandable numbers \r\n .nice();\r\n \r\n // AXES \r\n // initialize the axes based on the scales\r\n const xAxis = d3\r\n .axisBottom(xScale);\r\n const yAxis = d3\r\n .axisLeft(yScale);\r\n\r\n // include the axes within group elements\r\n canvasContents\r\n .append(\"g\")\r\n .attr(\"id\", \"x-axis\")\r\n // for the horizontal axis, position it at the bottom of the area defined by the SVG canvas\r\n .attr(\"transform\", `translate(0, ${height})`)\r\n .call(xAxis);\r\n\r\n canvasContents\r\n .append(\"g\")\r\n .attr(\"id\", \"y-axis\")\r\n .call(yAxis);\r\n\r\n // TOOLTIP\r\n // include a tooltip through a div element\r\n const tooltip = container\r\n .append(\"div\")\r\n .attr(\"id\", \"tooltip\");\r\n\r\n // PLOT CHART\r\n // include as many rectangle elements as required by the data array (275 data points)\r\n canvasContents\r\n .selectAll(\"rect\")\r\n .data(data)\r\n .enter()\r\n .append(\"rect\")\r\n // include two listeners for the mouseenter and mouseout events\r\n // as the cursor hovers on a rectangle element, transition the tooltip into view, with the text describing the rectangle element\r\n // as the cursor leaves, transition the tooltip out of sight\r\n // tooltip is defined to store a reference to a div\r\n // important: the event listener accepts as argument the data being processed (d), which is then used in the text of the tooltip\r\n .on(\"mouseenter\", (d) => {\r\n tooltip \r\n // alter the opacity to make the tooltip visible\r\n .style(\"opacity\", 1)\r\n // position the tooltip close to the cursor, using the d3.event object\r\n // console.log() this object to establish which properties are needed\r\n .style(\"left\", `${d3.event.layerX - 150}px`)\r\n .style(\"top\", `${d3.event.layerY - 80}px`)\r\n // include a data-date property which describes the date of the connected rectangle element\r\n // date formatted through the defined format function\r\n .attr(\"data-date\", formatTime(d[0]))\r\n .text(() => {\r\n // d[0], as it is processed through the parse function, represents an instance of the date object\r\n // getFullYear() allows to retrieve the four-digit year \r\n let year = d[0].getFullYear();\r\n let quarter = (d[0].getMonth() == 0) ? \"Q1\" : (d[0].getMonth() == 3) ? \"Q2\" : (d[0].getMonth() == 6) ? \"Q3\" : \"Q4\";\r\n\r\n return `${year} ${quarter} ${d[1]}`;\r\n });\r\n })\r\n .on(\"mouseout\", () => {\r\n tooltip\r\n .style(\"opacity\", 0);\r\n })\r\n // date formatted through the defined format function\r\n .attr(\"data-date\", (d) => formatTime(d[0]))\r\n .attr(\"data-gdp\", (d) => d[1])\r\n // position the rectangle elements with increasing horizontal coordinate, each after the previous rectangle\r\n .attr(\"x\", (d, i) => (width/ data.length) * i)\r\n // give a width equal to the width of the SVG canvas, divided by the number of data points present (this allows each rectangle to take a fraction of the available width)\r\n .attr(\"width\", (width/ data.length))\r\n // position the top left corner of the rectangle elements to the value assumed by the data point, passed in the scale function\r\n .attr(\"y\", (d) => yScale(d[1]))\r\n // give a height equal to the height of the SVG canvas, deducted by the y coordinate assumed by the data point (this roundabout approach is included since SVG elements are drawn top down)\r\n .attr(\"height\", (d) => height - yScale(d[1]))\r\n .attr(\"class\", \"bar\");\r\n}", "function drawBasic() {\n let options = {\n title: 'Stock Prices',\n chartArea: {width: '50%'},\n hAxis: {title: 'Price',minValue: 0},\n legend: { position: \"none\" }\n };\n \n let chart = new google.visualization.BarChart(document.getElementById(\"barchartValues\"));\n chart.draw(dataTable, options);\n}", "function devicesWithMostBookedDays(){\n var data = google.visualization.arrayToDataTable(devicesWithMostBookedDays_arr);\n var height = 100 + 20*devicesWithMostBookedDays_arr.length;\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n height: height,\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.devicesWithMostBookedDays_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-devicesWithMostBookedDays'));\n chart.draw(data, options);\n }", "function bar(d) {\r\n\t\t var bar = svg.insert(\"svg:g\", \".y.barHierAxis\")\r\n\t\t .attr(\"class\", \"enter\")\r\n\t\t .attr(\"transform\",function(){if($.browser.msie){\t\t \t \t\t\t\t\t\t\t\t\t\r\n\t\t \t \t\t\t\t\t\t\t\tif(d.children.length * y*1.6 < h){\r\n\t\t \t \t\t\t\t\t\t\t\t\treturn \"translate(-10,5)\";\r\n\t\t \t \t\t\t\t\t\t\t\t}\r\n\t\t \t \t\t\t\t\t\t\t\telse{\r\n\t\t \t \t\t\t\t\t\t\t\t\t//show scroll, need re-adjust the position in IE9\r\n\t\t \t \t\t\t\t\t\t\t\t\treturn \"translate(-2,5)\";\r\n\t\t \t \t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t else{\r\n\t\t\t\t\t\t\t\t\t\t\t return \"translate(0,5)\"; \r\n\t\t\t\t\t\t\t\t\t\t }})\r\n\t\t .selectAll(\"g\")\r\n\t\t .data(d.children)\r\n\t\t .enter().append(\"svg:g\")\r\n\t\t .style(\"cursor\", function(d) { return !d.children ? null : \"pointer\"; })\t\t \r\n\t\t .on(\"click\", showDetail);\r\n\t\r\n\t\t bar.append(\"svg:text\")\r\n\t\t .attr(\"x\", -6)\r\n\t\t .attr(\"y\", y/2+1)\r\n\t\t .attr(\"dy\", \".35em\")\r\n\t\t .attr(\"text-anchor\", \"end\")\r\n\t\t .text(function(d) { \r\n\t\t \t \t /*for current font size and the whole txt width, the max character number is 20*/\r\n\t\t\t \t if(d.Name.length > 20){\r\n\t\t\t \t\t return d.Name.substr(0,18) + \"...\";\r\n\t\t\t \t }\r\n\t\t\t \t else{\r\n\t\t\t \t\t return d.Name; \r\n\t\t\t \t }\r\n\t\t \t\t});\r\n\t\r\n\t\t bar.append(\"svg:rect\")\r\n\t\t .attr(\"width\", function(d) { return x(value(d)); })\r\n\t\t .style(\"fill\", function(d) { return rs.view.getColorByVariancePercentage(d.VariancePercentage,d.Total); })\r\n\t\t .attr(\"height\", y);\r\n\r\n\t\t \t\r\n\t\t return bar;\r\n\t\t}", "function membersBarChart() {\n let bounds = getBounds();\n let g = addNewSVG(bounds);\n\n let barWidth = bounds.width / membersPerDay.length;\n addMembersBars(bounds, g, barWidth);\n addEventsBars(bounds, g, barWidth);\n}", "function buildBarChartObject(){\n let chartDBObject = {\n \"name\" : barChartProperties[0],\n \"numGates\" : barChartProperties[1],\n \"numReq\" : barChartProperties[2],\n \"gates\" : barGates\n };\n return chartDBObject;\n}", "function BarChart() {\n\n var my = ChiasmComponent({\n\n margin: {\n left: 150,\n top: 30,\n right: 30,\n bottom: 60\n },\n\n sizeColumn: Model.None,\n sizeLabel: Model.None,\n\n idColumn: Model.None,\n idLabel: Model.None,\n\n orientation: \"vertical\",\n\n // These properties adjust spacing between bars.\n // The names correspond to the arguments passed to\n // d3.scale.ordinal.rangeRoundBands(interval[, padding[, outerPadding]])\n // https://github.com/mbostock/d3/wiki/Ordinal-Scales#ordinal_rangeRoundBands\n barPadding: 0.1,\n barOuterPadding: 0.1,\n\n fill: \"black\",\n stroke: \"none\",\n strokeWidth: \"1px\",\n\n // Desired number of pixels between tick marks.\n xAxisTickDensity: 50,\n\n // Translation down from the X axis line (pixels).\n xAxisLabelOffset: 50,\n\n // Desired number of pixels between tick marks.\n yAxisTickDensity: 30,\n\n // Translation left from the X axis line (pixels).\n yAxisLabelOffset: 45\n\n });\n\n // This scale is for the length of the bars.\n var sizeScale = d3.scale.linear();\n\n my.el = document.createElement(\"div\");\n var svg = d3.select(my.el).append(\"svg\");\n var g = svg.append(\"g\");\n\n var xAxis = d3.svg.axis().orient(\"bottom\");\n var xAxisG = g.append(\"g\").attr(\"class\", \"x axis\");\n var xAxisLabel = xAxisG.append(\"text\")\n .style(\"text-anchor\", \"middle\")\n .attr(\"class\", \"label\");\n\n var yAxis = d3.svg.axis().orient(\"left\");\n var yAxisG = g.append(\"g\").attr(\"class\", \"y axis\");\n var yAxisLabel = yAxisG.append(\"text\")\n .style(\"text-anchor\", \"middle\")\n .attr(\"class\", \"label\");\n\n // TODO think about adding this stuff as configurable\n // .tickFormat(d3.format(\"s\"))\n // .outerTickSize(0);\n\n my.when(\"xAxisLabelText\", function (xAxisLabelText) {\n xAxisLabel.text(xAxisLabelText);\n });\n my.when([\"width\", \"xAxisLabelOffset\"], function (width, offset) {\n xAxisLabel.attr(\"x\", width / 2).attr(\"y\", offset);\n });\n\n my.when([\"height\", \"yAxisLabelOffset\"], function (height, offset) {\n yAxisLabel.attr(\"transform\", [\n \"translate(-\" + offset + \",\" + (height / 2) + \") \",\n \"rotate(-90)\"\n ].join(\"\"));\n });\n my.when(\"yAxisLabelText\", function (yAxisLabelText) {\n yAxisLabel.text(yAxisLabelText);\n });\n\n // Respond to changes in size and margin.\n // Inspired by D3 margin convention from http://bl.ocks.org/mbostock/3019563\n my.when(\"box\", function (box) {\n svg.attr(\"width\", box.width)\n .attr(\"height\", box.height);\n });\n my.when([\"box\", \"margin\"], function (box, margin) {\n my.width = box.width - margin.left - margin.right;\n my.height = box.height - margin.top - margin.bottom;\n g.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n });\n\n my.when(\"height\", function (height) {\n xAxisG.attr(\"transform\", \"translate(0,\" + height + \")\");\n });\n\n my.when([\"idColumn\", \"dataset\"],\n function (idColumn, dataset) {\n\n // This metadata is only present for aggregated numeric columns.\n var meta = dataset.metadata[idColumn];\n var idScale;\n\n if (meta) {\n\n // Handle the case of an aggregated numeric column.\n idScale = d3.scale.linear();\n idScale.domain(meta.domain);\n idScale.rangeBand = function () {\n return Math.abs(idScale(meta.step) - idScale(0));\n };\n idScale.rangeBands = function (extent) {\n idScale.range(extent);\n };\n idScale.step = meta.step;\n } else {\n\n // Handle the case of a string (categorical) column.\n idScale = d3.scale.ordinal();\n idScale.domain(dataset.data.map(function (d) {\n return d[idColumn];\n }));\n idScale.step = \"\";\n }\n my.idScale = idScale;\n });\n\n my.when(\"dataset\", function (dataset) {\n my.data = dataset.data;\n my.metadata = dataset.metadata;\n });\n\n my.when([\"data\", \"sizeColumn\", \"idScale\", \"idColumn\", \"width\", \"height\", \"orientation\", \"idLabel\", \"sizeLabel\", \"barPadding\", \"barOuterPadding\"],\n function (data, sizeColumn, idScale, idColumn, width, height, orientation, idLabel, sizeLabel, barPadding, barOuterPadding) {\n\n if (sizeColumn !== Model.None) {\n\n // TODO separate out this logic.\n sizeScale.domain([0, d3.max(data, function (d) {\n return d[sizeColumn];\n })]);\n\n if (orientation === \"vertical\") {\n\n sizeScale.range([height, 0]);\n idScale.rangeBands([0, width], barPadding, barOuterPadding);\n\n my.barsX = function (d) {\n return idScale(d[idColumn]);\n };\n my.barsY = function (d) {\n return sizeScale(d[sizeColumn]);\n };\n my.barsWidth = idScale.rangeBand();\n my.barsHeight = function (d) {\n return height - my.barsY(d);\n };\n\n my.xScale = idScale;\n if (idLabel !== Model.None) {\n my.xAxisLabelText = idLabel;\n }\n\n my.yScale = sizeScale;\n if (sizeLabel !== Model.None) {\n my.yAxisLabelText = sizeLabel;\n }\n\n } else if (orientation === \"horizontal\") {\n\n sizeScale.range([0, width]);\n idScale.rangeBands([height, 0], barPadding, barOuterPadding);\n\n my.barsX = 0;\n my.barsY = function (d) {\n\n // Using idScale.step here is kind of an ugly hack to get the\n // right behavior for both linear and ordinal id scales.\n return idScale(d[idColumn] + idScale.step);\n };\n my.barsWidth = function (d) {\n return sizeScale(d[sizeColumn]);\n };\n my.barsHeight = idScale.rangeBand();\n\n// TODO flip vertically for histogram mode.\n// my.barsX = 0;\n// my.barsWidth = function(d) { return sizeScale(d[sizeColumn]); };\n// my.barsHeight = Math.abs(idScale.rangeBand());\n// my.barsY = function(d) {\n// return idScale(d[idColumn]) - my.barsHeight;\n// };\n\n my.xScale = sizeScale;\n if (sizeLabel !== Model.None) {\n my.xAxisLabelText = sizeLabel;\n }\n\n my.yScale = idScale;\n if (idLabel !== Model.None) {\n my.yAxisLabelText = idLabel;\n }\n\n }\n }\n });\n\n my.when([\"data\", \"barsX\", \"barsWidth\", \"barsY\", \"barsHeight\"],\n function (data, barsX, barsWidth, barsY, barsHeight) {\n\n my.bars = g.selectAll(\"rect\").data(data);\n my.bars.enter().append(\"rect\")\n\n // This makes it so that there are no anti-aliased spaces between the bars.\n .style(\"shape-rendering\", \"crispEdges\");\n\n my.bars.exit().remove();\n //my.bars\n // .attr(\"x\", barsX)\n // .attr(\"width\", barsWidth)\n // .attr(\"y\", barsY)\n // .attr(\"height\", barsHeight);\n my.bars.attr(\"x\", barsX);\n my.bars.attr(\"width\", barsWidth);\n my.bars.attr(\"y\", barsY);\n my.bars.attr(\"height\", barsHeight);\n\n\n // Withouth this line, the bars added in the enter() phase\n // will flash as black for a fraction of a second.\n updateBarStyles();\n\n });\n\n function updateBarStyles() {\n my.bars\n .attr(\"fill\", my.fill)\n .attr(\"stroke\", my.stroke)\n .attr(\"stroke-width\", my.strokeWidth);\n }\n\n my.when([\"bars\", \"fill\", \"stroke\", \"strokeWidth\"], updateBarStyles)\n\n my.when([\"xScale\", \"width\", \"xAxisTickDensity\"],\n function (xScale, width, density) {\n xAxis.scale(xScale).ticks(width / density);\n xAxisG.call(xAxis);\n });\n\n my.when([\"yScale\", \"height\", \"yAxisTickDensity\"],\n function (yScale, height, density) {\n yAxis.scale(yScale).ticks(height / density);\n yAxisG.call(yAxis);\n });\n\n return my;\n }", "function dsBarChartBasics(){\n var margin ={top:30,right:5,bottom:20,left:50},\n width=500-margin.left-margin.right,\n height=250-margin.top-margin.bottom,\n colorBar=d3.scale.category20(),\n barPadding=1\n ;\n\n return{\n margin:margin,\n width:width,\n height:height,\n colorBar:colorBar,\n barPadding:barPadding\n }\n ;\n}", "function makeBarChart(chartConfig) {\n\n var dataURL = chartConfig.dataURL;\n var xVariable = chartConfig.xVariable;\n var yVariable = chartConfig.yVariable;\n var yAxisMin = chartConfig.yAxisMin;\n var yAxisMax = chartConfig.yAxisMax;\n var yDenominator = chartConfig.yDenominator;\n var yLabel = chartConfig.yLabel;\n var divName = chartConfig.divName;\n var height = chartConfig.height;\n var width = chartConfig.width;\n\n var margin = {top: 20, right: 20, bottom: 70, left: 90};\n\n // Parse the Data\n d3.csv(dataURL, function(data) {\n\n // add the SVG element\n var svg = d3.select(\"#\" + divName).append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n // X axis\n var x = d3.scaleBand()\n .range([ 0, width ])\n .domain(data.map(function(d) { return d[xVariable]; }))\n .padding(0.2);\n svg.append(\"g\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x))\n .selectAll(\"text\")\n .attr(\"transform\", \"translate(-10,0)rotate(-45)\")\n .style(\"text-anchor\", \"end\");\n\n // Add Y axis\n var y = d3.scaleLinear()\n .domain([yAxisMin, yAxisMax])\n .range([ height, 0]);\n svg.append(\"g\")\n .call(d3.axisLeft(y))\n svg.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", -62) // offset to left of axis\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(yLabel);;\n\n // Define the tooltop for hover\n var tool_tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) {\n return d[yVariable]/yDenominator;\n })\n\n // Apply the tooltip to the svg\n svg.call(tool_tip);\n\n // Bars\n svg.selectAll(\"mybar\")\n .data(data)\n .enter()\n .append(\"rect\")\n .attr(\"x\", function(d) { return x(d[xVariable]); })\n .attr(\"y\", function(d) { return y(d[yVariable]/yDenominator); })\n .attr(\"width\", x.bandwidth())\n .attr(\"height\", function(d) { return height - y(d[yVariable]/yDenominator); })\n .on('mouseover', tool_tip.show)\n .on('mouseout', tool_tip.hide);\n\n })\n}", "function barUtil () {\n\n var decorate = noop,\n barWidth = fractionalBarWidth(0.75),\n orient = 'vertical',\n pathGenerator = bar();\n\n var base = xyBase().xValue(function (d, i) {\n return orient === 'vertical' ? d.x : d.y;\n }).yValue(function (d, i) {\n return orient === 'vertical' ? d.y : d.x;\n });\n\n var dataJoin$$ = dataJoin().selector('g.bar').element('g');\n\n function containerTranslation(d, i) {\n if (orient === 'vertical') {\n return 'translate(' + base.x1(d, i) + ', ' + base.y0(d, i) + ')';\n } else {\n return 'translate(' + base.x0(d, i) + ', ' + base.y1(d, i) + ')';\n }\n }\n\n function barHeight(d, i) {\n if (orient === 'vertical') {\n return base.y1(d, i) - base.y0(d, i);\n } else {\n return base.x1(d, i) - base.x0(d, i);\n }\n }\n\n function valueAxisDimension(generator) {\n if (orient === 'vertical') {\n return generator.height;\n } else {\n return generator.width;\n }\n }\n\n function crossAxisDimension(generator) {\n if (orient === 'vertical') {\n return generator.width;\n } else {\n return generator.height;\n }\n }\n\n function crossAxisValueFunction() {\n return orient === 'vertical' ? base.x : base.y;\n }\n\n var bar$$ = function bar$$(selection) {\n selection.each(function (data, index) {\n\n if (orient !== 'vertical' && orient !== 'horizontal') {\n throw new Error('The bar series does not support an orientation of ' + orient);\n }\n\n dataJoin$$.attr('class', 'bar ' + orient);\n\n var filteredData = data.filter(base.defined);\n\n pathGenerator.x(0).y(0).width(0).height(0);\n\n if (orient === 'vertical') {\n pathGenerator.verticalAlign('top');\n } else {\n pathGenerator.horizontalAlign('right');\n }\n\n // set the width of the bars\n var width = barWidth(filteredData.map(crossAxisValueFunction()));\n crossAxisDimension(pathGenerator)(width);\n\n var g = dataJoin$$(this, filteredData);\n\n // within the enter selection the pathGenerator creates a zero\n // height bar. As a result, when used with a transition the bar grows\n // from y0 to y1 (y)\n g.enter().attr('transform', containerTranslation).append('path').attr('d', function (d) {\n return pathGenerator([d]);\n });\n\n // set the bar to its correct height\n valueAxisDimension(pathGenerator)(barHeight);\n\n g.attr('transform', containerTranslation).select('path').attr('d', function (d) {\n return pathGenerator([d]);\n });\n\n decorate(g, filteredData, index);\n });\n };\n\n bar$$.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return bar$$;\n };\n bar$$.barWidth = function (x) {\n if (!arguments.length) {\n return barWidth;\n }\n barWidth = d3.functor(x);\n return bar$$;\n };\n bar$$.orient = function (x) {\n if (!arguments.length) {\n return orient;\n }\n orient = x;\n return bar$$;\n };\n\n d3.rebind(bar$$, base, 'xScale', 'xValue', 'x1Value', 'x0Value', 'yScale', 'yValue', 'y1Value', 'y0Value');\n d3.rebind(bar$$, dataJoin$$, 'key');\n\n return bar$$;\n }", "function createBarChart(altWidth, altHeight, data, img, id) {\n var rawWidth, rawHeight;\n\n if (!d3.select('#barChartSpan').empty()) {\n var barChartSpanWidth = $(window).innerWidth() * 0.5;\n rawWidth = barChartSpanWidth;\n rawHeight = 2 / 3 * rawWidth;\n } else {\n rawWidth = altWidth;\n rawHeight = altHeight;\n }\n\n var xValues = [];\n var yValues = [];\n\n // get Data from Json Object\n var bars = data.bars;\n for (var i = 0; i < bars.length; i++) {\n xValues.push(bars[i].name);\n yValues.push(bars[i].weight);\n }\n\n// Defines the margins and the size of the diagram\n var margin = {top: 20, right: 30, bottom: 80, left: 50},\n width = rawWidth - margin.left - margin.right,\n height = rawHeight - margin.top - margin.bottom;\n\n// creates chart with defined height and width\n var selector = \"[id=\" + id + \"]\";\n var chart = d3.select(selector)\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n// barwidth = width of diagram / data count (if there would be no space between them)\n var barWidth = width / bars.length;\n var barSpace = barWidth / 5; // scales spaces between bars\n\n\n// scales data to fit into diagram\n var y = d3.scale.linear()\n .range([height, 0])\n .domain([0, Math.ceil(d3.max(yValues))]); // math.ceil rounds number upward\n var x = d3.scale.ordinal()\n .domain(xValues)\n .rangeBands([0, width]);\n\n\n// defines bars and declares enter function (new data)\n// does mouseOver effect\n var bar = chart.selectAll(\"g\")\n .data(yValues)\n .enter().append(\"g\")\n .attr(\"transform\", function (d, i) {\n return \"translate(\" + (i * barWidth + barSpace / 2 ) + \", 0)\";\n })\n .on(\"mouseover\", function (d) {\n d3.select(this).select(\"text\").text(d)\n })\n .on(\"mouseout\", function (d) {\n d3.select(this).select(\"text\").text(\"\")\n });\n\n// calculates position and size of one rect\n bar.append(\"rect\")\n .attr(\"class\", \"barRect\")\n .attr(\"y\", function (d) {\n return y(d);\n })\n .attr(\"height\", function (d) {\n return height - y(d);\n })\n .attr(\"width\", barWidth - barSpace)\n\n// Textcontainer for mouse over bar\n bar.append(\"text\")\n .attr(\"y\", function (d) {\n return y(d) - 10;\n })\n .attr(\"x\", barWidth / 2)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"middle\")\n .text(\"\");\n\n//Defines X axis\n var xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n\n// Adds axis and moves it down\n var xAxisGroup = chart.append(\"g\")\n .attr(\"class\", \"xAxis\")\n .attr(\"transform\", \"translate(0,\" + (height ) + \")\")\n .call(xAxis);\n\n//Defines Y Axis\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\");\n\n var yAxisGroup = chart.append(\"g\")\n .attr(\"class\", \"yAxis\")\n .call(yAxis);\n\n// Labels for Axis\n chart.append(\"text\")\n .attr(\"class\", \"axisLabel\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left)\n .attr(\"x\", 0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .text(data.yLabel);\n\n chart.append(\"text\")\n .attr(\"class\", \"axisLabel\")\n .attr(\"toSelect\", \"x\")\n .attr(\"y\", height + margin.bottom)\n .attr(\"dy\", \"-0.55em\")\n .attr(\"x\", width)\n .text(data.xLabel);\n\n\n // Create clock icons if img=='clocks'\n if (img.toLowerCase() == \"clocks\") {\n // Images instead of text\n chart.select(\".xAxis\").selectAll(\"text\").remove();\n chart.select(\".xAxis\").selectAll(\"line\").remove();\n chart.selectAll(\".xAxis .tick\").each(function (d) {\n var node = d3.select(this);\n appendClock(node, d, barWidth - 5);\n appendDisplayText(node, d, barWidth - 2);\n });\n // Move xAxis label down\n chart.select(\"[toSelect=x\")\n .attr(\"y\", height + margin.bottom - 5);\n }\n\n}", "function barChartTemplate(myChart, queryResults) {\n\tvar labs = [\"test\", \"test\"];\n\tvar data = [];\n\t\n\tfor (var i=0; i<myChart.measures.length; i++) {\n\t\tvar d = [0, 0];\n\t\tvar newData = new MyDataBar(parseClass(myChart.measures[i]), \n\t\t\t\t\t\t\t\t\t\t colorPal[i].fillColor, \n\t\t\t\t\t\t\t\t\t\t colorPal[i].strokeColor, \n\t\t\t\t\t\t\t\t\t\t colorPal[i].highlightFill, \n\t\t\t\t\t\t\t\t\t\t colorPal[i].highlightStroke, \n\t\t\t\t\t\t\t\t\t\t d);\n\t\tdata.push(newData);\n\t}\n\t\n\tvar barChartData = {\n\t\tlabels: labs,\n\t\tdatasets: data\n\t};\n\t\t\n\t//Get stats\n\tvar st = calculateStats(myChart, queryResults);\n\t\n\t//Create canvas element to put the chart\n\tvar divRef = document.getElementById('myCharts');\n\tvar element = document.createElement('canvas');\n\telement.id = 'myNewCanvas';\n\tdivRef.appendChild(element);\n\t\n\tvar ctx = document.getElementById('myNewCanvas').getContext('2d');\n\tvar barChartTemplate = new Chart(ctx).Bar(barChartData, {\n\t\tresponsive : true,\n\t\tpointHitDetectionRadius : 5,\n\t\tanimation: false,\n\t\t//Set manual scale\n\t\tscaleOverride: true,\n\t\tscaleSteps: Number(st.stepNum),\n\t\tscaleStepWidth: Number(st.step),\n\t\tscaleStartValue: Number(st.min),\n\t});\n\t\n\treturn barChartTemplate;\n}", "function generateBarChart(labels) {\n console.log(labels);\n\n // get label descriptions and scores (just the first 10)\n var descriptions = [];\n var scores = [];\n labels.slice(0, 10).forEach(function(label) {\n descriptions.push(label[\"description\"]);\n scores.push((label[\"score\"] * 100).toFixed(2));\n });\n\n // delete old chart if it exists\n if (chart !== null) {\n chart.destroy();\n }\n\n Chart.Tooltip.positioners.cursor = function(chartElements, coordinates) {\n return coordinates;\n };\n\n var ctx = document.getElementById(\"barChart\").getContext(\"2d\");\n chart = new Chart(ctx, {\n // The type of chart we want to create\n type: \"horizontalBar\",\n\n // The data for our dataset\n data: {\n labels: descriptions,\n datasets: [{\n backgroundColor: \"#3A88C4\",\n borderColor: \"#3A88C4\",\n data: scores\n }]\n },\n\n // Configuration options go here\n options: {\n legend: {\n display: false\n },\n tooltips: {\n position: 'cursor'\n },\n scales: {\n xAxes: [{\n ticks: {\n max: 100,\n min: 0,\n callback: function(value) {\n return value + \"%\";\n }\n }\n }]\n\n }\n }\n });\n}", "function DrawHorizontalBarChart() {\n let chartHeight = (1000/25) * values.length;\n\n\n new Chartist.Bar('#ct-chart-bar', {\n labels: labels,\n series: [values]\n }, {\n axisX: {\n offset: 20,\n position: 'end',\n labelOffset: {\n x: 0,\n y: 0,\n },\n showLabel: true,\n showGrid: true,\n labelInterpolationFnc: Chartist.noop,\n scaleMinSpace: 30,\n onlyInteger: false\n },\n axisY: {\n offset: 100,\n position: 'start',\n labelOffset: {\n x: 0,\n y: 0,\n },\n showLabel: true,\n showGrid: false,\n labelInterpolationFnc: Chartist.noop,\n scaleMinSpace: 30,\n onlyInteger: false\n },\n width: undefined,\n height: chartHeight,\n high: undefined,\n low: undefined,\n referenceValue: 0,\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n seriesBarDistance: 5,\n stackBars: false,\n stackMode: 'accumulate',\n horizontalBars: true,\n distributedSeries: false,\n reverseData: true,\n showGridBackground: false,\n }, {\n //Options\n }, [\n //ResponsiveOptions\n ]);\n}", "function devicesWithMostBookings(){\n var data = google.visualization.arrayToDataTable(devicesWithMostBookings_arr);\n var height = 100 + 20*devicesWithMostBookings_arr.length;\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n height: height,\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.devicesWithMostBookings_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-devicesWithMostBookings'));\n chart.draw(data, options);\n }", "function peopleWithMostBookedDays(){\n var data = google.visualization.arrayToDataTable(peopleWithMostBookedDays_arr);\n var height = 100 + 20*peopleWithMostBookedDays_arr.length;\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n height: height,\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.peopleWithMostBookedDays_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-peopleWithMostBookedDays'));\n chart.draw(data, options);\n }", "function BarDrawUtil() {\n var me = this;\n /****Constants****/\n var BAR_COLOR = /*\"#4A87F8\"*/\"#178FB7\";\n //Layout\n var MAX_BAR_WIDTH = 24;\n var NICE_BAR_WIDTH = 12;\n var MIN_BAR_WIDTH = 2;\n var BEST_PAD_BETWEEN_BARS = 1;\n\n /****Externally set****/\n //Data\n var dataList;\n //Utils\n var yAxis;\n var xAxis;\n //Structure\n var barGroup;\n var concealerGroup;\n //Layout\n var bottomExtraPadding;\n\n /**Internally Set**/\n //Data\n var barCount;\n //Layout\n var barWidth;\n\n\n /**Public Functions***/\n this.setLayoutParams = function (bottomExtraPaddingInput) {\n bottomExtraPadding = bottomExtraPaddingInput;\n };\n\n this.setData = function (dataListInput, xAxisInput, yAxisInput) {\n dataList = dataListInput;\n xAxis = xAxisInput;\n yAxis = yAxisInput;\n };\n\n this.setPapaGroups = function (barGroupInput, concealerGroupInput) {\n barGroup = barGroupInput;\n concealerGroup = concealerGroupInput;\n };\n\n this.drawComponent = function () {\n createAllBars();\n };\n\n /**Construct***/\n function createAllBars() {\n calculateBarWidth();\n for (var i = 0; i < dataList.length; i++) {\n createBar(i);\n }\n }\n\n function createBar(index) {\n var dataPoint = dataList[index];\n var value = dataPoint.close;\n var x = xAxis.scale(index) - barWidth / 2;\n var baseY = yAxis.scale(0);\n var y = yAxis.scale(value);\n var height;\n\n\n\n if (value > 0) {\n height = baseY - y;\n } else {\n height = y - baseY;\n y = baseY;\n }\n\n x = trimToTwoDecimalDigits(x);\n height = trimToTwoDecimalDigits(height);\n y = trimToTwoDecimalDigits(y);\n var bar = barGroup.append(\"rect\")\n .attr({\n x: x,\n y: y,\n height: height,\n width: barWidth\n })\n .style({\n fill: BAR_COLOR\n });\n }\n\n /**Calculate***/\n function calculateBarWidth() {\n var barWithPadWidth = xAxis.scale(1) - xAxis.scale(0);\n barWidth = barWithPadWidth * 0.9;\n barCount = dataList.length;\n\n\n barWidth = trimToTwoDecimalDigits(barWidth);\n }\n}", "function addBarAxis () {\n\t\t\textraChartGroup.append(\"g\")\n\t\t\t .attr(\"class\", \"barYAxis\")\n\t\t\t .style(\"font-size\", 13 * screenRatio + \"px\")\n\t\t\t .call(leftAxis_extraChart);\n\t\t}", "function barChart(sample) {\n d3.json(\"samples.json\").then((data) => {\n var samples = data.samples;\n var resultArray = samples.filter(sampleObj => sampleObj.id == sample);\n var currentSample = resultArray[0];\n var otuids = currentSample.otu_ids;\n var otulabels = currentSample.otu_labels;\n var sample_values = currentSample.sample_values;\n var yticks = otuids.slice(0,10).map(otuid => `OTU${otuid}`).reverse()\n\n var barSamples = {\n x: sample_values.slice(0,10).reverse(),\n y: yticks,\n text: otulabels.slice(0,10).reverse(),\n type: \"bar\",\n orientation: \"h\"\n }\n //var data = [barSamples];\n\n var layout = {\n title: \"Top 10 Species by Type (Found near Belly Button)\",\n showlegend: false\n //xaxis: { title: \"OTU ID\"},\n // yaxis: { title: \"Species Count\"}\n };\n\n Plotly.newPlot(\"bar\", [barSamples], layout);\n });\n }", "function makeBarGraph(viz_data) {\n\n // we define some scales and margins\n var margin = top_margin,\n width = top_width,\n height = top_height; \n\n\n // two axes are used for the x-axis, x1 is nested within x0\n var x0 = d3.scale.ordinal()\n .rangeRoundBands([0, width], .1);\n\n var x1 = d3.scale.ordinal();\n\n var y = d3.scale.linear()\n .range([height, 0]);\n\n//color range of vis1 bars\n var color = d3.scale.ordinal()\n .range([\"#304FFE\", \"#C51162\", \"#1DE9B6\"]);\n\n//X-Axis\n var xAxis = d3.svg.axis()\n .scale(x0)\n .orient(\"bottom\");\n\n\n\tvar ageNames = GLOBALS.selected_fields;\n viz_data.data.forEach(function(d) {\n d.ages = ageNames.map(function(name) { return {name: name, value: +d.values[name], max: viz_data.maxes[\"avg\" + name]}; });\n });\n\n // we define the domain of our axes to match with years and each year is further divided\n // into the different metrics we're interested in looking at\n x0.domain(viz_data.data.map(function(d) { return d.year; }));\n x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]);\n\n //we create an empty selection for the labels, clear out any contentwhich might exist there\n //and then we draw a new axis\n top_svg.select(\".x_axis\").selectAll(\".xAxisLabel\").remove();\n top_svg.select(\".x_axis\")\n .call(xAxis)\n .append(\"text\")\n .attr('id','xAxisLabel')\n .attr('class','xAxisLabel')\n .attr(\"x\", width + 63)\n .attr(\"y\", 8)\n .style(\"text-anchor\", \"end\")\n .text(\"Years\"); //label on x-axis\n\n // we create a selection for our y axis\n var yaxis = top_svg.select(\".y_axis\");\n\n top_svg.selectAll(\".state\").remove();\n\n // this defines a variable that uses a plugin for showing tooltips on data points\n\tvar tip = d3.tip()\n\t .attr('class', 'd3-tip')\n\t .offset([-10, 0])\n\t .html(function(d) {\n return \"Absolute value: \" + Math.round(100*d.value*d.max)/100 ;\n })\n\ttop_svg.call(tip)\n\n \n if (boxCount == 1){\n var index;\n for (i = 0 ; i < clickedData.length; i++){\n if (clickedData[i] == true){\n index = i;\n }\n }\n gen_yaxis(false, yaxis, y, 0, maxes[index], GLOBALS.selected_fields[0])\n\n // we produce a rectangle for each data metric and size it to match the relative\n // value compared to the max provided by the server\n var state = top_svg.selectAll(\".state\")\n .data(viz_data.data)\n .enter().append(\"g\")\n .attr(\"class\", \"state\")\n .attr(\"transform\", function(d) { return \"translate(\" + x0(d.year) + \",0)\"; });\n\n state.selectAll(\"rect\")\n .data(function(d) {\n var new_data = [];\n for (jj = 0; jj < GLOBALS.selected_fields.length; jj++) {\n new_data.push({name: GLOBALS.selected_fields[jj], value: d.values[GLOBALS.selected_fields[jj]]})\n }\n return new_data;\n })\n .enter().append(\"rect\")\n .attr(\"width\", x1.rangeBand())\n .attr(\"x\", function(d) { return x1(d.name); })\n .attr(\"y\", function(d) { return y(d.value); })\n .attr(\"height\", function(d) { return height - y(d.value); })\n // these event handlers show/hide the tooltip\n .on('mouseover',tip.show)\n .on('mouseout',tip.hide)\n .style(\"fill\", function(d) { return color(d.name); });\n\n } else {\n gen_yaxis(true, yaxis, y, 0 , 10)\n\n var state = top_svg.selectAll(\".state\")\n .data(viz_data.data)\n .enter().append(\"g\")\n .attr(\"class\", \"state\")\n .attr(\"transform\", function(d) { return \"translate(\" + x0(d.year) + \",0)\"; });\n\n state.selectAll(\"rect\")\n .data(function(d) {\n //iterate over each individual datapoint\n for (i = 0; i < d.ages.length; i++){\n var index = 0;\n //find correct max to divide by\n for ( j=0 ; j < clickedData.length; j++){\n if (d.ages[i].name == button[j]){\n index = j;\n }\n }\n\n //update value with normalized value\n d.ages[i].value = d.ages[i].value/(d.ages[i].max);\n }\n return d.ages;\n })\n .enter().append(\"rect\")\n .attr(\"width\", x1.rangeBand())\n .attr(\"x\", function(d) { return x1(d.name); })\n .attr(\"y\", function(d) { return y(d.value); })\n .attr(\"height\", function(d) { return height - y(d.value); })\n .on('mouseover',tip.show)\n .on('mouseout',tip.hide)\n .style(\"fill\", function(d) { return color(d.name); });\n\n }\n\n //define behavior of timeline\n // we create drag behaviors for the circles and\n\tvar drag = d3.behavior.drag()\n\t\t\t.on(\"drag\", function(d){if (d3.select(this).attr(\"r\")==11){\n\t\t\t\t\t\t\t\t\t\tif((d3.event.x>=0)&&(d3.event.x<=980)&&(d3.event.x<(GLOBALS.time_frame.end-2002)*95)){\n // the scale is spaced evenly so we determine the selected year with a simple division operation\n\t\t\t\t\t\t\t\t\t\t\tGLOBALS.time_frame.start = Math.floor((d3.event.x/95)+2003);\n\t\t\t\t\t\t\t\t\t\t\tdrawCircles(0.6);\n\t\t\t\t\t\t\t\t\t\t\tdrawYears();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tif((d3.event.x>=95)&&(d3.event.x<=1100)&&(d3.event.x>(GLOBALS.time_frame.start-2002)*95)){\n\t\t\t\t\t\t\t\t\t\t\t\tGLOBALS.time_frame.end = Math.floor((d3.event.x/95)+2002);\n\t\t\t\t\t\t\t\t\t\t\t\tdrawCircles(0.6);\n\t\t\t\t\t\t\t\t\t\t\t\tdrawYears();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t.on(\"dragend\", function(d){\n drawCircles(1);\n update();\n });\n\tvar yheight = 420;\n\tdrawCircles(1);\n\t\n\tvar op;\n //helper function to draw circles on timeline scale\n\tfunction drawCircles(op){\n\t\tif (GLOBALS.time_frame.start == GLOBALS.time_frame.end){\n\t\t\t// update display to single season display\n\t\t}\n\t\ttop_svg.selectAll(\"circle\").remove();\n\t\tvar circle1 = top_svg.append(\"circle\")\n\t\t\t.attr(\"cx\", (GLOBALS.time_frame.start-2003)*95)\n\t\t\t.attr(\"cy\", yheight)\n\t\t\t.attr(\"r\", 11)\n\t\t\t.attr(\"fill\", \"red\")\n\t\t\t.attr(\"opacity\", op)\n\t\t\t.call(drag)\n\t\t\t.on(\"mouseover\", function(d) {\n\t\t\t\td3.select(this)\n\t\t\t\t .attr(\"opacity\", 0.6);\n\t\t\t})\n\t\t\t.on(\"mouseout\", function(d) {\n\t\t\t\td3.select(this)\n\t\t\t\t .attr(\"opacity\", 1);\n\t\t\t});\n\n\t\tvar circle2 = top_svg.append(\"circle\")\n\t\t\t.attr(\"cx\", (GLOBALS.time_frame.end-2002)*95)\n\t\t\t.attr(\"cy\", yheight)\n\t\t\t.attr(\"r\", 10)\n\t\t\t.attr(\"fill\", \"red\")\n\t\t\t.attr(\"opacity\", op)\n\t\t\t.call(drag)\n\t\t\t.on(\"mouseover\", function(d) {\n\t\t\t\td3.select(this)\n\t\t\t\t .attr(\"opacity\", 0.6);\n\t\t\t})\n\t\t\t.on(\"mouseout\", function(d) {\n\t\t\t\td3.select(this)\n\t\t\t\t .attr(\"opacity\", 1);\n\t\t\t});\n\t}\n\n\tvar line = top_svg.append(\"line\")\n\t\t.attr(\"x1\", 0)\n\t\t.attr(\"y1\", yheight)\n\t\t.attr(\"x2\", 1045)\n\t\t.attr(\"y2\", yheight)\n\t\t.attr(\"stroke\", \"black\")\n\t\t;\n\n //helper function to draw timeline base\n\tfunction drawYears(){\n var years = [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\", \"2010\", \"2011\", \"2012\", \"2013\"];\n\n\t\td3.selectAll(\".time_frame_lable\").remove();\n\t\tvar time_frame_label = top_svg.append(\"g\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"time_frame_lable\")\n\t\t\t\t\t\t\t\t .attr(\"x\",0)\n\t\t\t\t\t\t\t\t .attr(\"y\", 360)\n\t\t\t\t\t\t\t\t .selectAll(\"text\")\n\t\t\t\t\t\t\t\t .data(function(){return years;})\n\t\t\t\t\t\t\t\t.enter().append(\"text\")\n\t\t\t\t\t\t\t\t .text(function(d,i){return years[i];})\n\t\t\t\t\t\t\t\t .attr(\"x\", function(d,i) {return i*95 + 40;})\n\t\t\t\t\t\t\t\t .attr(\"y\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return yheight-8}else{return yheight-3}})\n\t\t\t\t\t\t\t\t .attr(\"font-family\", \"sans-serif\")\n\t\t\t\t\t\t\t\t .attr(\"font-size\", 14)\n\t\t\t\t\t\t\t\t .attr(\"fill\", function(d,i){if ((i>=GLOBALS.time_frame.start-2003)&&(i<=GLOBALS.time_frame.end-2003)){return \"red\"}else{return \"black\"}})\n\t\t\t\t\t\t\t\t ;\n\t}\n\n\tdrawYears();\n\n // we draw the legend at the top of the graph and match the colors with\n // the rectangles by using the same ordinal scale\n top_svg.selectAll(\".legend\").remove();\n var legend = top_svg.selectAll(\".legend\")\n .data(ageNames.slice())\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d, i) { return \"translate(\" + i * 20 + \"0)\"; });\n\n //create legend boxes\n legend.append(\"rect\")\n .attr(\"x\", (width/2 - 125) + 3) //width + 32\n .attr(\"y\", -32)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", color);\n //create legend text\n legend.append(\"text\")\n .attr(\"x\", width/2 - 125)\n .attr(\"y\", -24)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d; })\n\n //Should handle highlighting\n .on(\"mouseover\", function (d) {//filtering\n d3.select(this)\n .attr('fill', color);\n var cat_name = d.name;\n state.selectAll(\"rect\").each(function(d){\n d3.select(this)\n .attr('fill', function(d) {\n if (d.name === cat_name){\n return 'black';\n } else {\n return 'green';\n }\n });\n });\n\n })\n\n .on(\"mouseout\", function(d) {\n d3.select(this)\n .attr('fill','black');\n state.selectAll(\"rect\").each(function(d){\n d3.select(this)\n .attr('fill', d.name);\n });\n });\n\n //});\n}", "function createBarChart(graphic_width, graphic_height, graphic_margin, graphic_div) {\n var svg = d3.select(\"#\" + graphic_div).append(\"svg\")\n .attr(\"id\", \"bar_chart_svg\")\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"100%\")\n .attr(\"viewBox\", \"0 0 \" + graphic_width + \" \" + graphic_height)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\");\n\n svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + graphic_margin.left + \",\" + graphic_margin.top + \")\")\n .attr(\"class\", \"bar_chart_g\");\n\n svg.append(\"g\")\n .attr(\"class\", \"bar_chart_legend_g\");\n}", "function startBar(metrics, scales){\n \t//appending the bars\n \tvar chart = canvas.append('g')\n\t\t\t\t\t.attr(\"transform\", \"translate(150,0)\")\n\t\t\t\t\t.attr('id','bars')\n\t\t\t\t\t.selectAll('rect')\n\t\t\t\t\t.data(metrics);\n\t\t\t\t\t\n\t\tchart.enter().append('rect')\n\t\t\t\t\t.attr('height',25)\n\t\t\t\t\t.attr({'x':0,'y':function(d,i){ return scales[0](i)+19; }})\n\t\t\t\t\t.style('fill',function(d,i){ return scales[1](i); })\n\t\t\t\t\t.attr('width',function(d){ return 0; });\n\n\t\t//transition\n\t var transit = d3.select(\"svg\").selectAll(\"rect\")\n\t\t\t .data(metrics) \n\t\t\t .transition()\n\t\t\t .duration(2000) \n\t\t\t .attr(\"width\", function(d) {return scales[2](d);\n\t\t\t \t });\n\n\t\t//appending text to the bars\n\t\tvar transitext = d3.select('#bars')\n\t\t\t\t\t\t.selectAll('text')\n\t\t\t\t\t\t.data(metrics) \n\t\t\t\t\t\t.enter()\n\t\t\t\t\t\t.append('text')\n\t\t\t\t\t\t.attr({'x':function(d) {return scales[2](d)-200; },'y':function(d,i){ return scales[0](i)+35; }})\n\t\t\t\t\t\t.text(function(d,i){ \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tswitch(metrics){\n\t\t\t\t\t\t\t\tcase impressions:\n\t\t\t\t\t\t\t\t\treturn metrics[i];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase clicks:\n\t\t\t\t\t\t\t\t\treturn metrics[i];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase cost:\n\t\t\t\t\t\t\t\t\treturn '$' + metrics[i];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase cpm:\n\t\t\t\t\t\t\t\t\treturn d3.format('$.3f')(metrics[i]);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase cpc:\n\t\t\t\t\t\t\t\t\treturn d3.format('$.4f')(metrics[i]);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}})\n\t\t\t\t\t\t.style({'fill':'#fff','font-size':'14px'});\n }", "function bargraphinitializelist(){\n\t\n\tlist = [\"Process\",\"File\",\"Registry\",\"Memory Section\",\"Virtual Memory\",\"IPC\"];\n\tvar canvas = d3.select(\"#bar-chart\")\n\t\t\t\t.attr(\"width\", width+50)\n\t\t\t\t.attr(\"height\", height)\n\t\t\t\t.append(\"g\")\n\t\t\t\t.attr(\"transform\",\"translate(78,20)\");\n\n\tvar lscaleX=d3.scale.linear()\n\t\t\t\t.range([0,width-50])\n\t\t\t\t.domain([0,d3.max(list_map,function(d){ return d;})]);\n\n\tvar hscale = d3.scale.linear()\n\t\t\t\t.domain([0,120])\n\t\t\t\t.range([0,120]);\n\t\n\tvar xaxis=d3.svg.axis()\n\t\t\t\t.scale(lscaleX)\n\t\t\t\t.ticks(3)\n\t\t\t\t.orient(\"top\");\n\t\t\t\t\n\tvar yaxis=d3.svg.axis()\n\t\t\t\t.scale(hscale)\n\t\t\t\t.ticks(0)\n\t\t\t\t.orient(\"left\");\n\t\t\t\t\n\tcanvas.selectAll(\"rect\")\n\t\t\t\t.data(list_map)\n\t\t\t\t.enter()\n\t\t\t\t\t.append(\"rect\")\n\t\t\t\t\t.attr(\"width\", function(d) { \n\t\t\t\t\t\t\n\t\t\t\t\t\treturn lscaleX(d); \n\t\t\t\t\t})\n\t\t\t\t\t.attr(\"height\", 19)\n\t\t\t\t\t.attr(\"y\", function(d,i){ return i*20; })\n\t\t\t\t\t.attr(\"class\",function(d, i){\n\n\t\t\t\t\t\treturn getClassNameFromDisplayName(list[i]);\n\t\t\t\t\t})\n .style(\"opacity\", function(d, i){\n\n console.log(\"opacity for\"+getClassNameFromDisplayName(list[i]));\n if(active_api.indexOf(getClassNameFromDisplayName(list[i]))==-1)\n return 0.5;\n })\n\t\t\t\t\t.attr(\"id\",function(d,i){ return getClassNameFromDisplayName(list[i]);})\n\t\t\t\t\t.on(\"mouseover\",function(d){\n\t\t\t\t\t\t\n\t\t\t\t\t\td3.select(\"#tooltip\").select(\"#count\").text(\"No. of Calls: \"+d);\n\t\t\t\t\t\td3.select(\"#tooltip\").style({\n \n 'display': 'block',\n 'top': d3.event.y + 10,\n 'left': d3.event.x + 10\n });\n\t\t\t\t\t})\n .on(\"click\", function(d){\n\n th=this;\n\n // console.log(this.id);\n // console.log(\"min time initializelist1:\"+minTime);\n\n d3.select(this).style(\"opacity\",1.0);\n AddApiCalltoMap();\n \n // console.log(\"min time initializelist3:\"+minTime);\n })\n\t\t\t\t\t.on(\"mouseout\",function(d){\n\t\t\t\t\t\t\n\t\t\t\t\t\td3.select(\"#tooltip\").style({\n \n 'display': 'none'\n });\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"contextmenu\",function(d){\n\t\t\t\t\t\t\n\t\t\t\t\t\td3.event.preventDefault();\n\t\t\t\t\t\tth=this;\n\t\t\t\t\t\td3.select(this).style(\"opacity\",0.5);\n\t\t\t\t\t\tRemoveApiCallfromMap();\n\t\t\t\t\t});\n\t\t\t\t\t\n\tcanvas.selectAll(\"text\")\n\t\t\t\t.data(list_map)\n\t\t\t\t.enter()\n\t\t\t\t\t.append(\"text\")\n\t\t\t\t\t.attr(\"y\", function(d,i){ return i*20+10;})\n\t\t\t\t\t.attr(\"x\", function(d,i){ return -75;})\n\t\t\t\t\t.attr(\"font-family\", \"sans-serif\")\n\t\t\t\t\t.attr(\"font-size\", \"10px\")\n\t\t\t\t\t.text(function(d, i){ return list[i]; });\n\t\t\t\t\t\n\tcanvas.append(\"g\")\n\t\t\t\t.attr(\"class\", \"axis\")\n\t\t\t\t.call(xaxis);\n\t\t\t\t\n\tcanvas.append(\"g\")\n\t\t\t\t.attr(\"transform\",\"translate(-1,0)\")\n\t\t\t\t.attr(\"class\", \"axis\")\n\t\t\t\t.call(yaxis);\t\t\t\n}", "function makeBar(sample){\n\t\n\td3.json(file_path).then(function(data){\n\t\tvar samples =data['samples'];\n\t\tvar selectedSamples =samples.filter(bug=>bug['id'] ==sample);\n\t\tvar currentSample =selectedSamples[0]\n\t\t\n\n\t\tvar traceBar={\n\t\t\tx: currentSample['sample_values'].slice(0,10),\n\t\t\ty: currentSample['otu_ids'].map(otu_id=>'OTU ' +otu_id).slice(0,10),\n\t\t\ttype: 'bar',\n\t\t\ttext: currentSample['otu_labels'].slice(0,10),\n\t\t\torientation: 'h'\n\t\t};\n\t\tvar data =[traceBar];\n\t\tvar layout ={\n\t\t\ttitle: \"Abundance of Navel Microbes\",\n\t\t\txaxis: { title: \"Abundance\" },\n\t\t\tyaxis: { title: \"OTU ID\"}\n\t\t};\n\t\tPlotly.newPlot('bar', data, layout);\n\t});\n}", "function build() {\n var margin = {top: 20, right: 20, bottom: 70, left: 40},\n height = 500 - margin.top - margin.bottom,\n width = parseInt(d3.select('#bar_div').style('width'), 10),\n width = width - margin.left - margin.right;\n var parseDate = d3.time.format(\"%Y-%m-%d\").parse;\n var in_pad = .1;\n var out_pad = .25;\n var x = d3.scale.ordinal().rangeRoundBands([0, width], in_pad, out_pad);\n var y = d3.scale.linear().range([height, 0]);\n var xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\")\n .tickFormat(d3.time.format(\"%a %e\"));\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .ticks(10);\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) {\n return \"<strong>Purchases:</strong> <span style='color:red'>\" + d.count + \"</span>\";\n });\n var svg = d3.select(\"#bar_div\").append(\"svg\")\n .attr('id', 'purchase_chart')\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr('id', 'g_element')\n .attr(\"transform\",\n \"translate(\" + margin.left + \",\" + margin.top + \")\");\n svg.call(tip);\n\n d3.json(\"/build_chart/\", function(error, data) {\n data.forEach(function(d) {\n d.date = parseDate(d.date);\n d.count = +d.count;\n });\n x.domain(data.map(function(d) { return d.date; }));\n y.domain([0, d3.max(data, function(d) { return d.count; })]);\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"1.6em\")\n .attr(\"dy\", \"1.45em\");\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\");\n svg.selectAll(\"bar\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .transition()\n .ease(\"elastic\")\n .delay(function (d, i) { return i*180; })\n .attr(\"x\", function(d) { return x(d.date); })\n .attr(\"width\", x.rangeBand())\n .attr(\"y\", function(d) { return y(d.count); })\n .attr(\"height\", function(d) { return height - y(d.count); });\n d3.select(\"#bar_loader\").remove();\n });\n }" ]
[ "0.77163464", "0.7526737", "0.7479934", "0.74186444", "0.73083645", "0.7291003", "0.7275676", "0.7248214", "0.72424597", "0.7237493", "0.7189951", "0.7187999", "0.7186899", "0.7117562", "0.71012074", "0.7046209", "0.7043848", "0.70428026", "0.7034797", "0.7022937", "0.70191365", "0.70181984", "0.70104015", "0.7008208", "0.7004676", "0.698378", "0.6981502", "0.6980083", "0.69782007", "0.6976539", "0.69734067", "0.6949343", "0.69332314", "0.6931114", "0.6929615", "0.69277537", "0.69174486", "0.69132894", "0.690964", "0.6907273", "0.68798834", "0.68785113", "0.6874747", "0.68718433", "0.6871498", "0.68579614", "0.6848965", "0.6840275", "0.6831624", "0.6828875", "0.682835", "0.68274724", "0.68217516", "0.6821393", "0.6821009", "0.6818596", "0.68152666", "0.6813388", "0.6808138", "0.68026596", "0.67962646", "0.6794538", "0.6792461", "0.67870235", "0.67845476", "0.6783417", "0.6774861", "0.677295", "0.67684627", "0.676778", "0.67661464", "0.67603356", "0.6757753", "0.67541975", "0.675206", "0.67405814", "0.67293596", "0.6725965", "0.6722162", "0.6715915", "0.6712312", "0.67118776", "0.67071104", "0.67067784", "0.67064744", "0.6692033", "0.6686119", "0.6676203", "0.6670745", "0.66679823", "0.66471946", "0.66440296", "0.66431123", "0.66346836", "0.66328424", "0.6627598", "0.6626546", "0.6619418", "0.6619093", "0.66182953" ]
0.66483456
90
Creates the popup when hovering over a bar
popUp(d, i) { let popG = this.svg .append("g") // Appending "g" element for both text and rectangle .attr("transform", () => { let height = i * this.barHeight * 2 + 50 + this.barHeight; return "translate(" + this.width * 0.1 + "," + height + ")"; }) .attr("class", "popUpG"); // Adding the white background to display text on popG .append("rect") .attr("fill", "white") .attr("width", this.width * 0.4) .attr("height", this.barHeight * 1.5) .attr("class", "popUpRect"); // Adding the text showing the acceptance rate popG .append("text") .text("Accepted: " + d.num_accepted + " (" + ((d.num_accepted / d.num_suggested) * 100).toFixed(0) + "%)") // Shows in percent with 0 decimals .attr("font-family", this.fontType) .attr("font-size", this.textSize) .attr("y", this.barHeight / 2 + 5) .attr("x", 10); // Adding the text showing the rejection rate popG .append("text") .text("Rejected: " + d.num_rejected + " (" + ((d.num_rejected / d.num_suggested) * 100).toFixed(0) + "%)") // Shows in percent with 0 decimals .attr("font-family", this.fontType) .attr("font-size", this.textSize) .attr("y", this.barHeight + 10) .attr("x", 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addInteractionEvents() {\n\n // bar group hover\n $(\"g.barGroup\").hover(function(e) {\n showInfoBox( e, $(this).attr(\"index\"), $(this).attr(\"membership\") );\n }\n );\n $(\".vis .background, .vis .mouseLine\").hover(function(e) {\n showInfoBox( e, null);\n });\n\n\n\n\n}", "function create_popup(text,target)\n {\n //alert(text);\n var status_window = $('acts_as_monitor_status_window');\n status_window.update(text);\n Position.clone(target,\n status_window, {\n offsetLeft: 20\n });\n new Effect.Appear(status_window);\n //alert(\"Fatto\");\n }", "function hover_popup(tooltip_id, id, data){\n $(tooltip_id).mouseenter(function(){\n $(id).html(data);\n $(id).dialog({ autoOpen: false });\n $(id).dialog({\n open: function(){\n $(this).parents(\".ui-dialog:first\").find(\".ui-widget-header\")\n .removeClass(\"ui-widget-header\");\n }\n });\n $(id).dialog('open'); \n }).mouseleave(function() {\n $(id).dialog('close');\n }); \n}", "_on_button_hover(w_box, window_title) {\n\t\tif (window_title && w_box && w_box.get_hover()) {\n\t\t\tthis.window_tooltip.set_position(w_box.get_transformed_position()[0], Main.layoutManager.primaryMonitor.y + Main.panel.height + TOOLTIP_VERTICAL_PADDING);\n\t\t\tthis.window_tooltip.label.set_text(window_title);\n\t\t\tthis.window_tooltip.show();\n\t\t\tthis.hide_tooltip_timeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 2, () => {\n\t\t\t\tif (!Main.panel.statusArea['babar-workspaces-bar'].get_hover()) {\n\t\t\t\t\tthis.window_tooltip.hide()\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthis.window_tooltip.hide();\n\t\t}\n }", "function drapal_mouseover() {\n if(mass_opener && (max_tab > 1)) {\n this.style.backgroundColor = \"rgba(255,255,255,0.7)\";\n this.style.color = \"black\";\n }\n}", "function createPopUp() {\n\n}", "function popup17(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Hacinamiento Crítico (%):\"+feature.properties.hac_cri+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function ToolBar_Popup_MouseOver(event)\n{\n\t//get the element\n\tvar source = Browser_GetEventSourceElement(event);\n\t//search for the highlights\n\twhile (source && !source.PopupBGColorHighLight && !source.PopupFGColorHighLight)\n\t{\n\t\tsource = source.parentNode;\n\t}\n\t//has valid source?\n\tif (source)\n\t{\n\t\t//highlight it\n\t\tsource.style.backgroundColor = source.PopupBGColorHighLight;\n\t\tsource.style.color = source.PopupFGColorHighLight;\n\t}\n}", "function popup29 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Junio:\"+feature.properties.Tasa_Contagios+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function mouseOver() {\n\t\ttooltip.style(\"display\", \"block\")\n\t\t\t .style(\"visibility\", \"visible\");\n\t}", "function popup19 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de enero:\"+feature.properties.ene+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup27 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Junio:\"+feature.properties.Tasa_Contagios+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "mouseOver(panel) {\n\t}", "function popup22 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de abril:\"+feature.properties.abr+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "handleShowBar(e){\n const bar = document.querySelector(`#bar${this.props.video.uri.split(\"/\")[2]}`);\n if(e.type === 'mouseover'){\n bar.classList.add('hide-bar');\n\n }else if(e.type === 'mouseleave'){\n setTimeout(function() {\n bar.classList.remove('hide-bar');\n }, 500);\n }\n }", "function overSkill0() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = skillsDescArray[0]\r\n}", "function addHover(num) {\n\tmagHolder[num].addEventListener('mouseover', function() {\n\t\tmagText[num].setAttribute(\"style\", \"background-color: white; display: block; border: solid 1px #d5d6d7; z-index: 15; position: absolute; width: 160px; text-align: center; padding: 5px 5px 5px 7px\");\n\t}, false);\n\tmagHolder[num].addEventListener('mouseleave', function() {\n\t\tmagText[num].style.display = 'none';\n\t}, false);\n}", "function popup25 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>índice de aglomeración urbano-poblacional:\"+feature.properties.pce+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup26 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.NOMBRE+\n \"</p> Casos:\"+feature.properties.nuevos_casos+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popupH (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de julio:\"+feature.properties.jul+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function writePopupMenu() {\n\t\tif (document.getElementById(this.id) == null) {\n\t\t\tvar pum = document.createElement(\"span\");\n\t\t\tpum.setAttribute(\"id\", this.id);\n\t\t\tvar pumsp = document.getElementById(MAP).appendChild(pum);\n\t\t\tpumsp.style.position = \"absolute\";\n\t\t\tpumsp.style.top = 0;\n\t\t\tpumsp.style.left = -1;\n\t\t\tpumsp.style.width = 220;\n\t\t\tpumsp.style.zIndex = 500;\n\t\t\tpumsp.style.backgroundColor = \"White\";\n\t\t\tpumsp.style.paddingTop = 2;\n\t\t\tpumsp.style.paddingRight = 10;\n\t\t\tpumsp.style.paddingLeft = 5;\n\t\t\tpumsp.style.visibility = \"hidden\";\n\t\t\tpumsp.style.borderBottomStyle = \"groove\";\n\t\t\tpumsp.style.borderBottomColor = \"Gray\";\n\t\t\tpumsp.style.borderBottomWidth = 3;\n\t\t\tpumsp.style.borderRightColor = \"Gray\";\n\t\t\tpumsp.style.borderRightStyle = \"groove\";\n\t\t\tpumsp.style.borderRightWidth = 3;\n\t\t\tpumsp.style.borderLeftColor = \"Gray\";\n\t\t\tpumsp.style.borderLeftStyle = \"solid\";\n\t\t\tpumsp.style.borderLeftWidth = 1;\n\t\t\tpumsp.style.borderTopColor = \"Gray\";\n\t\t\tpumsp.style.borderTopStyle = \"solid\";\n\t\t\tpumsp.style.borderTopWidth = 1;\n\t\t}\n\t\tvar popupMenuItem = null;\n\t\tvar html = \"\";\n\t\tfor (var i=0; i < this.items.getLength(); i++) {\n\t\t\tpopupMenuItem = this.items.get(i);\n\t\t\thtml += \"<p style=\\\"font-family:Arial,Helvetica,sans-serif; font-size:12px; color:#003366; \";\n\t\t\thtml += \"margin-top:0px; margin-bottom:0px; cursor:hand; \\\" \";\n\t\t\thtml += \"onmouseover=\\\"this.style.textDecoration = 'underline';\\\" onmouseout=\\\"this.style.textDecoration = 'none';\\\">\";\n\t\t\tif (rightClickedElementId.indexOf(CONNECTION) == 0) {\n\t\t\t\thtml += \"<nobr onclick=\\\"document.getElementById(rightClickedElementId).connection.executeAction('\" + popupMenuItem.action + \"');\\\">\";\n\t\t\t} else if (rightClickedElementId.indexOf(NETWORK_ELEMENT) == 0) {\n\t\t\t\thtml += \"<nobr onclick=\\\"document.getElementById(rightClickedElementId).parentObj.executeAction('\" + popupMenuItem.action + \"');\\\">\";\n\t\t\t} else if (rightClickedElementId.indexOf(MAP) == 0) {\n\t\t\t\thtml += \"<nobr onclick=\\\"document.getElementById(rightClickedElementId).map.executeAction('\" + popupMenuItem.action + \"');\\\">\";\n\t\t\t}\n\t\t\thtml += \"&raquo;&nbsp;\";\n\t\t\tif (popupMenuItem.img != null) {\n\t\t\t\thtml += \"<img border=0 src=\\\"\" + popupMenuItem.img + \"\\\">&nbsp;\";\n\t\t\t}\n\t\t\thtml += popupMenuItem.text;\n\t\t\thtml += \"</nobr></p>\";\n\t\t}\n\t\tdocument.getElementById(this.id).innerHTML = html;\n\t}", "function popup20 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de febrero:\"+feature.properties.feb+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function mouseOver() {\n setMouseOver(true);\n }", "function popup21 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de marzo:\"+feature.properties.mar+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup24 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Tasa de mortalidad (cada 100 mil hab.):\"+feature.properties.Tasa_Mortalidad+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function mouseOver() {\n tooltip\n .style(\"opacity\", 1)\n .style(\"display\",\"inherit\");\n}", "function rect_mouseover() {\n\t\t\tpercentText.style(\"opacity\", 1)\n\t\t\tapproveText.style(\"opacity\", 1)\n\t\t\tfocusDate.style(\"opacity\", 1)\n\t\t}", "function mouseOver(e) {\r\n var layer_marker = e.target;\r\n // layer_marker.openPopup();\r\n }", "function popup23 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de mayo:\"+feature.properties.may+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup28 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Tasa de mortalidad (cada 100 mil hab.):\"+feature.properties.Tasa_Mortalidad+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function ToolBarButton_ShowPopup(theMenuButton, theObject)\n{\n\t//has popup?\n\tif (!theObject.HTML.TOOLBAR_MENU)\n\t{\n\t\t//create the popup menu\n\t\tvar popup = document.createElement(\"div\");\n\t\t//set its styles\n\t\tpopup.style.cssText = \"position:absolute;overflow:visible;border:1px solid black;\" + Basic_GetFontStyle(Get_String(theObject.Properties[__NEMESIS_PROPERTY_FONT]));\n\t\t//make it unselectable\n\t\tBrowser_SetSelectable(popup, false);\n\t\t//block mouse down to prevent popup destruction\n\t\tBrowser_AddEvent(popup, __BROWSER_EVENT_MOUSEDOWN, Browser_CancelBubbleOnly);\n\n\t\t//create clone item\n\t\tvar clone = document.createElement(\"div\");\n\t\tclone.style.cssText = \"text-indent:20px;padding:1px 5px 1px 0px;cursor:default;\";\n\n\t\t//get interface look\n\t\tvar nInterfaceLook = theObject.InterfaceLook;\n\t\t//set default look and feel\n\t\tclone.PopupBGColor = Get_Color(theObject.Properties[__NEMESIS_PROPERTY_MENU_BK_COLOR], \"#D4D0C8\", nInterfaceLook);\n\t\tclone.PopupFGColor = Get_Color(theObject.Properties[__NEMESIS_PROPERTY_MENU_TEXT_UNSELECTED_COLOR], \"#000000\", nInterfaceLook);\n\t\tclone.PopupBGColorHighLight = Get_Color(theObject.Properties[__NEMESIS_PROPERTY_MENU_HIGHLIGHT_COLOR], \"#0A246A\", nInterfaceLook);\n\t\tclone.PopupFGColorHighLight = Get_Color(theObject.Properties[__NEMESIS_PROPERTY_MENU_TEXT_SELECTED_COLOR], \"#FFFFFF\", nInterfaceLook);\n\t\t//set initial colours\n\t\tclone.style.backgroundColor = clone.PopupBGColor;\n\t\tclone.style.color = clone.PopupFGColor;\n\n\t\t//now loop through the menu buttons\n\t\tfor (var i = 0, c = theMenuButton.MENU.length; i < c; i++)\n\t\t{\n\t\t\t//create a line item\n\t\t\tvar item = popup.appendChild(clone.cloneNode(true));\n\t\t\t//set text\n\t\t\titem.innerHTML = Browser_InnerText_Get(theMenuButton.MENU[i]); // SAFE BY ENCODING (Just copying from the button panel which was already handled)\n\t\t\t//set special properties (non cloneable)\n\t\t\titem.PopupBGColor = clone.PopupBGColor;\n\t\t\titem.PopupFGColor = clone.PopupFGColor;\n\t\t\titem.PopupBGColorHighLight = clone.PopupBGColorHighLight;\n\t\t\titem.PopupFGColorHighLight = clone.PopupFGColorHighLight;\n\t\t\titem.ToolBarButton = theMenuButton.MENU[i];\n\t\t\ttheMenuButton.MENU[i].MenuItem = item;\n\t\t\t//tabbutton enabled?\n\t\t\tif (!item.ToolBarButton.disabled)\n\t\t\t{\n\t\t\t\t//set handlers\n\t\t\t\tBrowser_AddEvent(item, __BROWSER_EVENT_MOUSEOVER, ToolBar_Popup_MouseOver);\n\t\t\t\tBrowser_AddEvent(item, __BROWSER_EVENT_MOUSEOUT, ToolBar_Popup_MouseOut);\n\t\t\t\tBrowser_AddEvent(item, __BROWSER_EVENT_CLICK, ToolBar_Popup_MouseClick);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//change the color to silver (disabled)\n\t\t\t\titem.style.color = \"Silver\";\n\t\t\t}\n\t\t}\n\t\t//and store it\n\t\ttheObject.HTML.TOOLBAR_MENU = popup;\n\t}\n\t//show the popup\n\t__POPUPS.ShowPopup(theObject.HTML.TOOLBAR_MENU);\n\t//now force its position under us\n\t__POPUPS.PositionLastRelative(theMenuButton, __POSITION_DOWN);\n}", "function mouseOverAndOut(svg, xScale, yScale) {\n var bar = svg.selectAll(\"rect.community\");\n bar.on(\"mouseover\", function(d) {\n d3.select(this)\n .attr(\"fill\", \"red\")\n //Get this bar's x/y values, then augment for the tooltip\n var xPosition = xScale(parseInt(d.population));\n var yPosition = parseFloat(d3.select(this).attr(\"y\")) + 30;\n\n //Update the tooltip position and value\n d3.select(\"#tooltip\")\n .style(\"left\", xPosition + \"px\")\n .style(\"top\", yPosition + \"px\")\n .select(\"#value\")\n .text(\"Population size: \" + d.population);\n d3.select(\"#tooltip\")\n .select(\"#titleSect\")\n .text(d.communityname);\n\n //Show the tooltip\n d3.select(\"#tooltip\").classed(\"hidden\", false);\n })\n .on(\"mouseout\", function(d) {\n d3.select(this)\n .attr(\"fill\", function(d) {\n return \"rgb(0, 0, \" +\n Math.round(parseInt(d.population) * BlueScaling) + \")\";\n });\n //Hide the tooltip\n d3.select(\"#tooltip\").classed(\"hidden\", true);\n });\n}", "function popup35 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Contagios_Jul+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function mouseover() {\n\ttiptool_div.style(\"display\", \"inline\");\n\t}", "function overName() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = \"My name is \" + playerDetails.name + \", that much I remember...\";\r\n}", "function hovering() {\n\n}", "hoverHandler() {\n // Only handle if menu button is not already active button\n if (this.range.openButton !== this) {\n this.range.openButtonAndCloseOthers(this);\n }\n }", "function mouseOver(x) {\r\nvar img = x;\r\n\r\ndocument.body.style.cursor = \"pointer\";\r\npopUpImg.src=\"\";\r\npopUp.style.display = \"hidden\";\r\n\r\n// Pop-up image of board when it is clicked on the image map\r\nimg.onclick = function(){\r\n popUpImg.src = this.alt;\r\n popUp.style.display = \"block\";\r\n}\r\n}", "function popupO(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Superficie urbana (%):\"+feature.properties.indiceurb+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "addHighlighTooltip () {\n }", "onMouseOver_() {\n if (this.isOpenable_()) {\n this.updateHoverStying_(true);\n }\n }", "function popupN(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Proximidad (Distancia) Km.:\"+feature.properties.Distancia+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function popupC (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de marzo:\"+feature.properties.mar+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "showDescription() {\n this.hover = true;\n }", "function popupI (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de agosto:\"+feature.properties.ago+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function popup30 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Mayo:\"+feature.properties.may+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup34 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Mortalidad_Ago+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function showBarClick() {\n fill(currentColor);\n noStroke();\n translate(-25,0);\n for (var i = 0; i < spectrum.length; i++) {\n var x = map(i, 0, spectrum.length, 0, width);\n var h = -height + map(spectrum[i], 0, 255, height, 0);\n rect(x + w, height, width / spectrum.length - 3, h);\n }\n}", "function hoverTip(){\n\t\tvar object = d3.select(this).data()[0];\n\t\tvar objectBox = path.bounds(object);\n\t\tvar objectData = object.properties.values[0];\n\t\tif(HTMLWidgets.shinyMode)var sidebar = d3.select('#sidebarCollapsed').attr('data-collapsed');\n\t\tvar xMove = sidebar == false ? 50 : 0;\n\t\tvar nameFormat = that.options.nameFormat != \"text\" ? d3.format(that.options.nameFormat ? that.options.nameFormat : \"d\") : function(x) {return x;} ;\n\t\tvar valueFormat = d3.format(that.options.valueFormat ? that.options.valueFormat : \"d\");\n\t\tvar toolTipFormat = d3.format(that.options.toolTipFormat ? that.options.toolTipFormat : \"d\");\n\t\t\n\t\td3.select(this).transition()\n\t\t\t.style('fill', function(d){ \n\t\t\t\tvar values = d.properties.values[0];\n\t\t\t\tvar colorValue = values[ly.mapping.dataValue];\n\t\t\t\treturn d3.rgb(that.colorScale(colorValue)).darker(1); \n\t\t\t\t});\n\t\t\n\t\tthat.tooltip\n .style(\"left\", (d3.mouse(this)[0] - xMove) + 'px')\n\t\t\t .style(\"top\", (d3.mouse(this)[0] - 40) + 'px')\n .style(\"display\", \"inline-block\")\n .html(function() {\n\t\t\t\t if(ly.mapping.toolTip){\n\t\t\t\t\treturn ly.mapping.dataKey + \": \" + nameFormat(objectData[ly.mapping.dataKey]) + '<br>' + \n\t\t\t\t\tly.mapping.dataValue + \": \" + valueFormat(objectData[ly.mapping.dataValue]) + '<br>' +\n\t\t\t\t\tly.mapping.toolTip + \": \" + toolTipFormat(objectData[ly.mapping.toolTip])\n\t\t\t\t } else {\n\t\t\t\t\treturn ly.mapping.dataKey + \": \" + nameFormat(objectData[ly.mapping.dataKey]) + '<br>' + \n\t\t\t\t\tly.mapping.dataValue + \": \" + valueFormat(objectData[ly.mapping.dataValue])\n\t\t\t\t }\n\t\t\t });\n\t\t\t \n\t}", "function riverHover(e) {\n map.getCanvas().style.cursor = 'pointer';\n var description = e.features[0].properties.GNIS_NAME;\n\n riverPopup\n .setLngLat(mouseCoord)\n .setHTML(description)\n .addTo(map);\n document.getElementsByClassName('mapboxgl-popup-content')[0].classList.add('riverLabel');\n\n }", "function mouseOver(e) {\r\n\t\t\t\tvar layer_marker = e.target;\r\n\t\t layer_marker.setStyle({\r\n\t\t radius: radius + 1,\r\n\t\t fillColor: fill_color_hover,\r\n\t\t color: border_color_hover,\r\n\t\t weight: 2,\r\n\t\t opacity: 1,\r\n\t\t fillOpacity: 1\r\n\t\t\t\t});\r\n\t\t\t\t// layer_marker.openPopup();\r\n\t\t }", "function popup33 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Agosto:\"+feature.properties.Tasa_Mortalidad_Jul+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function addHover(element, msg, ctx) {\n element.hover(function(evt){\n $('body').append('<div class=\"msg\" style=\"left:' + evt.x + 'px; top:' \n + (evt.y + 20) + 'px; \">' + msg + '</div>')\n }, function(){\n $('.msg').remove();\n }, ctx, ctx);\n }", "function popup32 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Contagios_Ago+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function openTaxesAndFeesToolTip(){\n\t$(\"span[id^='taxesAndFees-']\").hover(function(event) {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseEnterAnchor($(this), packageId,event);\n\t}, function() {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseLeaveAnchor($(this), packageId);\n\t});\n}", "function popup36 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Contagios_Ago+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "showHoverEffect() {\n this._changeShape.showHoverEffect();\n if (this._rangeShape) this._rangeShape.showHoverEffect();\n }", "function addPopup(text,x,y,cutout,name=\"popup\") {\n interface.buttonArray.forEach(function (elem) {\n if (elem.name === \"animal_image\") {\n var currIndex = ui_values.animalAry.indexOf(ui_values.currentAnimal);\n var src = ui_values.animalStaticAry;\n elem.setSrc(src[currIndex], src[currIndex], false);\n }\n });\n\tvar button = new Button(function() {\n\t switch(true){\n\t case(dataObj.tutorialProgress == 0):\n\t addPopup(\"It's your first time here,\\nso I'm going to show\\nyou around the place!\",100, 40);\n\t interface.draw();\n\t break;\n\t case(dataObj.tutorialProgress == 1):\n\t addPopup(\"This is your Nature\\nJournal.\",150, 90);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 2):\n addPopup(\"Here on the left\\npage, you can\\ncall animals to explore\\nthe world.\",150, 90,[20,10,494,580]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 3):\n addPopup(\"On the right\\npage, you can\\nsee your animals as\\nthey explore.\",700, 90,[514,10,494,580]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 4):\n addPopup(\"Your Nature Journal\\nuses two currencies,\\nsteps and tracks.\",150, 90,[71,25,410,60]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 5):\n addPopup(\"These are your Steps.\\nYou get these by walking\\naround with your Fitbit\\nand are used to call animals.\",71, 90, [143,25,113,60]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 6):\n addPopup(\"These are your Tracks.\\nYour animals make these\\nas they explore. You will\\nuse tracks to upgrade\\nyour animals.\",240, 90, [282,27,175,55]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 7):\n addPopup(\"There are four different\\nanimal types you can\\ncall to travel the world.\",150, 200, [79,95,385,105]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 8):\n addPopup(\"Each has their own\\nstrengths and\\nweaknesses.\",150, 200, [79,95,385,105]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 9):\n addPopup(\"You can add an animal\\nby selecting its icon\\nabove, then clicking\\nthe button to the right.\",60, 250, [283,399,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 10):\n addPopup(\"Let's send out\\na new animal so we\\ncan continue!\",60, 250, [283,400,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 11):\n addPopup(\"Choose wisely! This animal\\nwill be with you for your\\nentire nature walk.\",60, 250, [283,400,175,47]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 13):\n addPopup(\"Your animals will face\\na number of harrowing\\nchallenges. Those events\\nwill be shown here.\",300, 200, [533,25,445,207]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 14):\n addPopup(\"Your animal has three\\nstatistics that it will\\nuse to overcome these\\nchallenges.\",260, 220,[72,239,185,127]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 15):\n addPopup(\"Speed, Evasion, and\\nStrength.\",260, 215,[73,239,185,127]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 16):\n addPopup(\"You can increase your \\nanimal's statistics with \\ntracks via the\\nupgrade button.\",250, 300, [63,400,124,50]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 17):\n addPopup(\"Failing these challenges \\ncould slow down, or even \\nkill your animals, so level\\nthem up when you can.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 18):\n addPopup(\"You can select your\\nanimals by clicking on \\ntheir icons down \\nhere.\",150, 300, [83,450,375,100]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 19):\n addPopup(\"Try selecting your\\nfirst animal.\",250, 400, [83,450,375,100]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 21):\n addPopup(\"You can upgrade animals\\nin two ways.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 22):\n addPopup(\"You can upgrade\\nindividual animals or the\\nbase level of animals.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 23):\n addPopup(\"Upgrading individuals\\nis cheaper, but if they\\nleave or die you will have\\nto level them up again\\nfrom the base.\",250, 300, [94,450,52,52]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 24):\n addPopup(\"Upgrading the base\\nlevel changes what level\\nyour animals start at,\\neven through death.\",250, 150,[84,114,71,71]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 25):\n addPopup(\"Keeping a healthy balance\\nof the two will keep your\\nanimals collecting as long\\nas possible.\",250, 300);\n //dataObj.tutorialProgress++;\n break;\n \n case(dataObj.tutorialProgress == 26):\n addPopup(\"Right now you can have\\na maximum of five\\nanimals, and each animal\\nwill only walk with you\\nfor 24 hours before leaving\",250, 300, [83,450,320,55]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 27):\n addPopup(\"But keep exploring and\\nyou will be able to\\nhave more than five!\",300, 250);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 28):\n addPopup(\"Speaking of exploring,\\nyour animals are walking\\nthrough what's called\\nan area.\",700, 300,[600,233,301,52]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 29):\n addPopup(\"If you keep collecting \\nsteps with your Fitbit\\nyou'll unlock more areas.\",700, 300, [600,233,301,52]);\n //dataObj.tutorialProgress++;\n break;\n //Here are 4000 more steps to get you there. You can call more animals with these. \n //When you get to a certain number of steps, this arrow will advance you to the next area. Click it!\n case(dataObj.tutorialProgress == 30):\n addPopup(\"We will give you\\n4000 more steps\\nto get you there.\",700, 300);\n dataObj.steps += 4000;\n stepCount += 4000\n dataObj.totalSteps += 4000;\n dataObj.priorSteps -= 4000;\n\n //dataObj.tutorialProgress++;\n areaNext.update();\n break;\n case(dataObj.tutorialProgress == 31):\n addPopup(\"When a new area is\\navailable, click this\\narrow to move there\\nwith your animals.\",700, 300, [843,238,42,38]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 33):\n addPopup(\"But never fear! If an\\narea proves too hard for\\nyour animals you can go\\nback to an easier one.\",700, 300, [618,238,42,38]);\n //dataObj.tutorialProgress++;\n break;\n case(dataObj.tutorialProgress == 34):\n addPopup(\"That's all you need\\nto know!\",500, 250);\n //dataObj.tutorialProgress++;\n break; \n case(dataObj.tutorialProgress == 35):\n addPopup(\"Now get out there,\\njournal in hand, and\\nget to nature walking!\",500, 250);\n //tutorialProgress++;\n //console.log(dataObj.tutorialProgress);\n break; \n }\n dataObj.tutorialProgress++;\n\t\tremovePopup(this);\n\t});\n\tbutton.setSrc(\"image_resources/Tooltip.png\");\n\tbutton.setSpriteAttributes(x,y,228,150, name)\n if (dataObj.tutorialProgress === 22) {\n button.setSpriteAttributes(x,y,228,170, name)\n }\n\tbutton.hasTextValue = true;\n\tbutton.fontSize = '20px';\n\tcharnum = text.length;\n //console.log(\"Button Created: \" + button.x + \" \" + button.onMouseUpImageSrc);\n\tbutton.setText([text], (button.width / 2) - (6.3 * charnum), 5);\n if (dataObj.tutorialProgress === 11) {\n console.log(\"Check Progress: \" + dataObj.tutorialProgress);\n button.updateText([text], ['red'])\n }\n button.cutout = function (ary) {\n //console.log(ary);\n ctx.globalAlpha = 0.3\n ctx.fillStyle=\"#f0c840\";\n ctx.fillRect(ary[0], ary[1], ary[2], ary[3]);\n ctx.globalAlpha = 1.0\n ctx.fillStyle=\"black\"\n }\n button.draw = function(){\n\t ctx.globalAlpha = 0.3;\n\t ctx.fillRect(0, 0, canvas.width, canvas.height, 'black');\n\t ctx.globalAlpha = 1.0;\n //console.log(this.cutoutParams);\n if (cutout) {\n this.cutout(cutout);\n }\n\t ctx.drawImage(this.image, this.x, this.y, this.width, this.height);\n\t if ((this.hovered && this.text !== undefined) || this.hasTextValue || this.hasTooltip){\n if (this.text === undefined) {\n //console.log(this.name);\n } else {\n var strArray = this.text[0].split(/\\n/);\n //var clrIndex = this.text[0].indexOf(/\\f/);\n //console.log(this.text[0].indexOf('*'));\n for(var s = 0; s < strArray.length; s++){\n //Highlighting code here.\n drawText([strArray[s]], this.x + 3, this.y + this.textOffsetY + (28*s), this.fontSize, this.color);\n }\n }\n if (this.tooltip != undefined && cursor.x != undefined && cursor.y != undefined && this.hovered) {\n drawText(this.tooltip,cursor.x+5,cursor.y+5)\n }\n }\n\t}\n\tpushPopup(button);\n}", "function popupD (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de abril:\"+feature.properties.abr+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function ToolBar_Popup_MouseOut(event)\n{\n\t//get the element\n\tvar source = Browser_GetEventSourceElement(event);\n\t//search for the original colours\n\twhile (source && !source.PopupBGColor && !source.PopupFGColor)\n\t{\n\t\tsource = source.parentNode;\n\t}\n\t//has valid source?\n\tif (source)\n\t{\n\t\t//update it\n\t\tsource.style.backgroundColor = source.PopupBGColor;\n\t\tsource.style.color = source.PopupFGColor;\n\t}\n}", "function onPopupMouseEnter() {\n forceUpdate({});\n }", "function onPopupMouseEnter() {\n forceUpdate({});\n }", "function onPopupMouseEnter() {\n forceUpdate({});\n }", "function onPopupMouseEnter() {\n forceUpdate({});\n }", "function resultItem(bar){\n\tmyMap.removeLayer(markers);\n\n\tvar day = today.getDay();\n\tvar key = bar.key;\n\tvar lat = bar.child(\"lat\").val();\n\tvar lon = bar.child(\"lon\").val();\n\tvar name = bar.child(\"name\").val();\n\tvar address = bar.child(\"address\").val();\n\n\tvar marker = L.marker([lat, lon], {icon: beerIcon});\n\tvar barPopup = document.createElement('div');\n\tbarPopup.innerHTML = \"<div class='barMarker'><div class='barNamePopup'>\" + name + \"</div></div>\"\n\n\tmarker.bindPopup(barPopup);\n\tbarPopup.onclick = function (){\n\t\tpopUp(bar);\n\t}\n\tmarkers.addLayer(marker);\n\tmyMap.addLayer(markers);\n\tvar rating = Math.floor((-1) * bar.child(\"rating\").val())\n\tvar remainderRating = Math.round(10 * ((-1) * bar.child(\"rating\").val() - rating));\n\tvar barContainer = createDiv(\"barContainer\");\n\tvar infoContainer = createDiv(\"infoContainer\");\n\tvar basicInfo = createDiv(\"basicInfo\");\n\t(barPicture = createDiv(\"barPicture\")).innerHTML = \"<img src=\\\"barimages/\" + key + \".jpg\\\" width=\\\"100px\\\" height=\\\"100px\\\">\";\n\tvar barNameContainer = createDiv(\"barNameContainer\");\n\n\t(barName = createDiv(\"barName\")).innerHTML = name;\n\tbarNameContainer.appendChild(barName);\n\t(barAddress = createDiv(\"barAddress\")).innerHTML = bar.child(\"address\").val();\n\t(addressPictogram = createDiv(\"pictogram\")).innerHTML = \"<img src=\\\"pictograms/addressColorRed.png\\\" width=\\\"13px\\\" height=\\\"13px\\\">\";\n\t(webPictogram = createDiv(\"pictogram\")).innerHTML = \"<img src=\\\"pictograms/webColorRed.png\\\" width=\\\"13px\\\" height=\\\"13px\\\">\";\n\t(phonePictogram = createDiv(\"pictogram\")).innerHTML = \"<img src=\\\"pictograms/phoneColorRed.png\\\" width=\\\"13px\\\" height=\\\"13px\\\">\";\n\t(clockPictogram = createDiv(\"pictogram\")).innerHTML = \"<img src=\\\"pictograms/clockColorRed.png\\\" width=\\\"13px\\\" height=\\\"13px\\\">\";\n\t(barWeb = createDiv(\"barWeb\")).innerHTML = bar.child(\"web\").val();;\n\t(barPhone = createDiv(\"barPhone\")).innerHTML = bar.child(\"phone\").val();\n\tvar barAttributes = createDiv(\"barAttributes\");\n\tvar attributesCard = createDiv(\"barAttributesIcon\");\n\n\n\tif(!bar.child(\"attributes\").child(\"card\").val()){\n\t\tattributesCard.style.opacity = 0.3;\n\t}\n\tattributesCard.innerHTML = \"<img src=\\\"pictograms/card.png\\\" width=\\\"22px\\\" height=\\\"22px\\\" title='Platba Kartou'>\"\n\tbarAttributes.appendChild(attributesCard);\n\tvar attributesFood = createDiv(\"barAttributesIcon\");\n\tif(!bar.child(\"attributes\").child(\"food\").val()){\n\t\tattributesFood.style.opacity = 0.3;\n\t}\n\tattributesFood.innerHTML = \"<img src=\\\"pictograms/food.png\\\" width=\\\"22px\\\" height=\\\"22px\\\" title='Varia jedlo'>\"\n\tbarAttributes.appendChild(attributesFood);\n\tvar attributesWifi = createDiv(\"barAttributesIcon\");\n\tif(!bar.child(\"attributes\").child(\"wifi\").val()){\n\t\tattributesWifi.style.opacity = 0.3;\n\t}\n\tattributesWifi.innerHTML = \"<img src=\\\"pictograms/wifi.png\\\" width=\\\"22px\\\" height=\\\"22px\\\" title='Internet'>\"\n\tbarAttributes.appendChild(attributesWifi);\n\tvar attributesDog = createDiv(\"barAttributesIcon\");\n\tif(!bar.child(\"attributes\").child(\"dogs\").val()){\n\t\tattributesDog.style.opacity = 0.3;\n\t}\n\tattributesDog.innerHTML = \"<img src=\\\"pictograms/dog.png\\\" width=\\\"22px\\\" height=\\\"22px\\\" title='Psi su vitané'>\"\n\tbarAttributes.appendChild(attributesDog);\n\n\n\tvar barHours = createDiv(\"barHours\");\n\tif (bar.child(\"hours\").child(day).child(\"opened\").val()){\n\t\tvar from = bar.child(\"hours\").child(day).child(\"from\").val();\n\t\tvar to = bar.child(\"hours\").child(day).child(\"to\").val();\n\t\tbarHours.innerHTML = \"Dnes otvorené \" + from + \" - \" + to +\"\";\n\t} else{\n\t\tbarHours.innerHTML = \"Dnes zatvorené\";\n\t}\n\tvar barRatingContainer = createDiv(\"barRatingContainer\");\n\tvar barRating = createDiv(\"barRating\")\n\tvar barRatingText = createDiv(\"barRatingText\")\n\n\tvar ratingArray = [];\n\tfor (i = 0; i < rating; i++) { \n\t\tvar barFullBeerRating = createDiv(\"beerRatingPictogram\");\n\t\tratingArray.push(barFullBeerRating);\n\t\tbarFullBeerRating.innerHTML = \"<img src=\\\"pictograms/beer10.png\\\" width=\\\"10px\\\" height=\\\"20px\\\">\";\n\t\tbarRating.appendChild(barFullBeerRating);\n\t}\n\n\tvar barRemainderBeerRating = createDiv(\"beerRatingPictogram\");\n\tratingArray.push(barRemainderBeerRating);\n\tbarRemainderBeerRating.innerHTML = \"<img src=\\\"pictograms/beer\" + remainderRating + \".png\\\" width=\\\"10px\\\" height=\\\"20px\\\">\";\n\tbarRating.appendChild(barRemainderBeerRating);\n\n\tfor (i = 0; i < (4 - rating); i++) { \n\t\tvar barEmptyBeerRating = createDiv(\"beerRatingPictogram\");\n\t\tratingArray.push(barEmptyBeerRating);\n\t\tbarEmptyBeerRating.innerHTML = \"<img src=\\\"pictograms/beer0.png\\\" width=\\\"10px\\\" height=\\\"20px\\\">\";\n\t\tbarRating.appendChild(barEmptyBeerRating);\n\t}\n\t//hodnotenie\n\tif(bar.child(\"ratings\").child(IP).val() == null){\n\t\tbarRatingText.innerHTML = \"(nehodnotené)\";\n\t\tratingHover(ratingArray);\n\t\tratingArray[0].onclick = function(){\n\t\t\trater(barRatingText, 1, bar, barRating);\n\t\t}\n\t\tratingArray[1].onclick = function(){\n\t\t\trater(barRatingText, 2, bar, barRating);\n\t\t}\n\t\tratingArray[2].onclick = function(){\n\t\t\trater(barRatingText, 3, bar, barRating);\n\t\t}\n\t\tratingArray[3].onclick = function(){\n\t\t\trater(barRatingText, 4, bar, barRating);\n\t\t}\n\t\tratingArray[4].onclick = function(){\n\t\t\trater(barRatingText, 5, bar, barRating);\n\t\t}\n\t} else{\n\t\tbarRatingText.innerHTML = \"(hodnotené <b>\" + bar.child(\"ratings\").child(IP).child(\"rating\").val() + \"</b>)\";\n\t}\n\tbarRating.appendChild(barRatingText);\n\t(barRatingSquare = createDiv(\"barRatingSquare\")).innerHTML = rating + \",\" + remainderRating;\n\tif(rating >= 4){\n\t\tbarRatingSquare.style.borderColor = \"rgb(55, 145, 27)\"\n\t\tbarRatingSquare.style.color = \"rgb(55, 145, 27)\"\n\t} else if(rating >= 2){\n\t\tbarRatingSquare.style.borderColor = \"rgb(239, 130, 40)\"\n\t\tbarRatingSquare.style.color = \"rgb(239, 130, 40)\"\n\t}\n\tbarRatingContainer.appendChild(barRating);\n\tbarRatingContainer.appendChild(barRatingSquare);\n\n\tvar barPhoneAttributesContainer = createDiv(\"barPhoneAttributesContainer\");\n\n\tbarPhoneAttributesContainer.appendChild(phonePictogram);\n\tbarPhoneAttributesContainer.appendChild(barPhone);\n\tbarPhoneAttributesContainer.appendChild(barAttributes);\t\t\n\tbasicInfo.appendChild(barNameContainer);\t\n\tbasicInfo.appendChild(addressPictogram);\n\tbasicInfo.appendChild(barAddress);\n\tbasicInfo.appendChild(clockPictogram);\n\tbasicInfo.appendChild(barHours);\n\tbasicInfo.appendChild(webPictogram);\n\tbasicInfo.appendChild(barWeb);\n\tbasicInfo.appendChild(barRatingContainer);\n\tbasicInfo.appendChild(barPhoneAttributesContainer);\n\tinfoContainer.appendChild(barPicture);\n\tinfoContainer.appendChild(basicInfo);\n\n\tinfoContainer.onclick = function(){\n\t\tmarkers.zoomToShowLayer(marker, function(){\n\t\t\tmarker.openPopup();\n\t\t});\n\t\tmyMap.panTo(new L.LatLng(lat, lon), {animate: true, duration: 0.7});\n\t}\n\tbarContainer.appendChild(infoContainer);\n\tdocument.getElementById(\"barsResults\").appendChild(barContainer);\n\tbarName.onclick = function (){\n\t\tpopUp(bar);\n\t}\t\t\t\t\n}", "function popup31 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Contagios_Jul+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function CTAhover(gfc){\n var hov = new Square({id:'ctahover',width:150,height:40,color:'green',x:75,y:239});\n var g = gfc;\n hov.opacity=0;\n this.add = function(){\n adstage.stage.add(hov);\n hov.on('click', function(){\n window.open(clickTag,'_blank');\n });\n hov.on('mouseover', function(){\n g.to(0.35, {scale:1.1, transformOrigin:U.torg(300,516), ease:Back.easeOut});\n });\n hov.on('mouseout', function(){\n g.to(0.35, {scale:1, transformOrigin:U.torg(300,516)});\n });\n };\n}", "function moveBarHover(e){\n\t\t\t\te.preventDefault();\n\n\t\t\t\tvar pokeIndex = $(e.target).closest(\".poke.single\").index();\n\t\t\t\tvar selectorIndex = (pokeIndex == 0) ? 1 : 0;\n\t\t\t\tvar subject = pokeSelectors[pokeIndex].getPokemon();\n\t\t\t\tvar target = pokeSelectors[selectorIndex].getPokemon();\n\t\t\t\tvar moveIndex = $(e.target).closest(\".move-bars\").find(\".move-bar\").index($(e.target).closest(\".move-bar\"));\n\t\t\t\tvar move = subject.chargedMoves[moveIndex];\n\t\t\t\tvar effectiveness = target.typeEffectiveness[move.type];\n\n\t\t\t\tdisplayDamage = battle.calculateDamageByStats(subject, target, subject.getEffectiveStat(0, true), target.getEffectiveStat(1, true), effectiveness, move);\n\n\t\t\t\tpokeSelectors[selectorIndex].animateDamage(displayDamage)\n\t\t\t}", "function handleMouseOver(d, i) {\n d3.select(this).style('opacity', 0.85);\n\n var result = 0;\n var desc = '';\n if (score === '4*') {\n result = parseInt(d.properties.scores.overall.fourstar / 5 + 1);\n desc = '4* Score: ';\n } else if (score === 'mean') {\n result = parseInt(d.properties.scores.mean);\n desc = 'All UoAs Mean Score: ';\n }\n\n var self = this;\n var data = d;\n var popup = d3.select(map.getPanes().popupPane).append('div').classed('leaflet-popup', true).style('top', d3.mouse(self)[1] - 90 + 'px').style('left', d3.mouse(self)[0] - 102 + 'px');\n popup.classed('popup', true);\n popup.append('a').classed('leaflet-popup-close-button', true).attr('href', '#close').text('x');\n\n var tip = popup.append('div').classed('leaflet-popup-tip-container', true).style('top', 71 + 'px');\n tip.append('div').classed('leaflet-popup-tip', true);\n\n var wrapper = popup.append('div').classed('leaflet-popup-content-wrapper', true);\n wrapper.append('div').classed('leaflet-popup-content', true).html('<strong>' + data.properties.name + '</strong><br>' + '<span>' + desc + result + '</span>');\n }", "function popupL(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de noviembre:\"+feature.properties.nov+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function handleBarMouseOver(d, i) {\n var group = focus.append('g')\n .attr('id', 'id-name');\n\n var text = group.append('text')\n .attr('x', xScale(d.name))\n .attr('y', yScale(d.percentage)-10)\n .attr('text-anchor', 'middle')\n .text(function() {\n if (typeof d.last_rank != 'undefined') {\n var old_rank = +d.last_rank + 1;\n if (old_rank > 200) {\n old_rank = \">200\";\n }\n var new_rank = i + 1\n var t = d.name + \": rank \" + old_rank + \" to \" + new_rank;\n return t;\n }\n else {\n return d.name\n }\n });\n\n // get the bbox so we can place a background\n var bbox = text.node().getBBox();\n var bboxPadding = 5;\n\n // place the background\n var rect = group.insert('rect', ':first-child')\n .attr('x', bbox.x - bboxPadding/2)\n .attr('y', bbox.y - bboxPadding/2)\n .attr('width', bbox.width + bboxPadding)\n .attr('height', bbox.height + bboxPadding)\n .attr('rx', 10)\n .attr('ry', 10)\n .attr('class', 'label-background');\n }", "function popupF (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de mayo:\"+feature.properties.may+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function highlight (d) {\n //get the second class in the object of svg element that called function, the second class in the list is the county name\n var countyClass = \".\" + d3.select(this).attr(\"class\").split(\" \")[1];\n \n //select both the county geometry and bar elements and color code them\n d3.selectAll(countyClass)\n .transition()\n .style(\"fill\" , \"red\");\n \n var coords = d3.mouse(this);//retrieve the relitive position of the mouse to the svg geometry or bar element\n \n //there are two different divs for popups which are identical. one is for the map and one is for the graph.\n //I tried to have just one and change the poistion but it did not work correctly. The positions are relitive to the object\n //the div is inside. I worked around this by having two divs inside the colums for each svg. for the code to work\n //properly I need to determine which type of object is calling this function, a map geometry or a bar.\n //depending on which is calling I will set up the popup for either the map or graph but not both.\n if (d3.select(this).attr(\"class\").split(\" \")[0] == \"districtGeo\") {\n var divPopup = d3.select(\"#tooltip-popup-map\");\n coords = d3.mouse(d3.select(\"#mapdivCell\").node());\n } else {\n var divPopup = d3.select(\"#tooltip-popup-graph\");\n coords = d3.mouse(d3.select(\"#graphdivCell\").node());\n }\n \n //change the content of the popup header\n divPopup.select(\"h4\")\n .text(d.name);\n \n //change the number values inside of the popup.\n divPopup.select(\"p\")\n .text( selectedLabel + \" is: \" + selectedFormat(d[selectedField]));\n \n //remove the .hidden class so the CSS rules making it not display are removed. Then place according the the mouse position\n divPopup.classed(\"hidden\", false)\n .transition()\n .style(\"left\" , (coords[0] + 20) + \"px\")\n .style(\"top\" , (coords[1] + -80) + \"px\");\n \n }", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function InfoBarWindow(){}", "function ToolBar_Popup_MouseClick(event)\n{\n\t//trigger a mouse out as we will close the popup\n\tToolBar_Popup_MouseOut(event);\n\t//get the element\n\tvar source = Browser_GetEventSourceElement(event);\n\t//search for the tab button\n\twhile (source && !source.ToolBarButton)\n\t{\n\t\tsource = source.parentNode;\n\t}\n\t//found it?\n\tif (source && !source.ToolBarButton.disabled)\n\t{\n\t\t//close all popups\n\t\t__POPUPS.CloseAll();\n\t\t//block the event\n\t\tBrowser_BlockEvent(event);\n\t\t//trigger the action on this\n\t\t__SIMULATOR.ProcessEvent(new Event_Event(source.ToolBarButton.InterpreterObject, __NEMESIS_EVENT_CLICK, new Array(\"\" + source.ToolBarButton.TB_INDEX)));\n\t}\n}", "tooltipClicked() {}", "function popupK(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de octubre:\"+feature.properties.oct+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "mouseover() {\n this.hoverActive = true;\n }", "displayToolTip(item) {\n console.log(\"Hovering Over Item: \", item.name);\n }", "function poShow(x,y){\n\t\t$('#po'+y+'_'+x).popover('show');\n\t}", "function DJUIElementPopover(name, x, y, width, height) {\n\n DJUIElement.call(this, name, x, y, width, height);\n this.visible = false;\n this.UIType =\"popover\";\n this.receivesClickEvent = true;\n}", "createTopBar() {\n\t\t//make the back of the message box\n\t\tvar rec = this.add.rectangle(200, 0, this.game.config.width - 200, 150, 0x001a24).setScrollFactor(0).setDepth(1);\n\t\trec.setOrigin(0, 0);\n\t\tthis.dayCounterText = this.add.text(rec.x + 20, rec.y + 20, 'Day ' + this.game.gameData.turn + ' of outbreak',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '25px', fontWeight: 'bold' }).setScrollFactor(0).setDepth(1);\n\t\tthis.populationText = this.add.text(rec.x + 20, rec.y + 50, 'Population: ' + this.game.city.getPopulation() +\n\t\t\t'\\nConfirmed Infected: ' + this.game.city.getInfected() +\n\t\t\t'\\nDeaths: ' + this.game.city.getDead(),\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\t\tvar logo = this.add.image(this.game.config.width / 2 + 25, 70, 'logo');\n\t\tlogo.setScale(0.1);\n\t\tlogo.setScrollFactor(0).setDepth(1);\n\t\tlogo.setInteractive({ useHandCursor: true }).on('pointerdown', () => this.virusCheatClicked++);\n\n\t\tvar threatText = this.add.text(this.game.config.width - 380, 25, 'Threat:',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\t\tthis.threatPercent = this.add.text(this.game.config.width - 80, 25, Math.floor(this.game.gameData.threatLevel * 100) + '%',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\n\t\tvar progressBoxRed = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBoxRed.lineStyle(4, 0xeeeeee, 1.0);\n\t\tprogressBoxRed.fillStyle(0x8c0000, 1);\n\t\tprogressBoxRed.strokeRect(this.game.config.width - 300, 20, 200, 30);\n\t\tprogressBoxRed.fillRect(this.game.config.width - 300, 20, 200, 30);\n\n\t\tvar progressBarRed = this.game.gameData.progressBarRed = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBarRed.fillStyle(0xff0000, 1);\n\t\tprogressBarRed.fillRect(this.game.config.width - 300, 20, Math.floor(this.game.gameData.threatLevel * 200), 30);\n\n\n\t\tvar moraleText = this.add.text(this.game.config.width - 380, 65, 'Morale:',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\t\tthis.moralePercent = this.add.text(this.game.config.width - 80, 65, Math.floor(this.game.city.getMorale() * 100) + '%',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\n\t\tvar progressBoxGreen = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBoxGreen.lineStyle(4, 0xeeeeee, 1);\n\t\tprogressBoxGreen.fillStyle(0x245f24, 1);\n\t\tprogressBoxGreen.strokeRect(this.game.config.width - 300, 60, 200, 30);\n\t\tprogressBoxGreen.fillRect(this.game.config.width - 300, 60, 200, 30);\n\n\t\tvar progressBarGreen = this.game.gameData.progressBarGreen = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBarGreen.fillStyle(0x00ff00, 1);\n\t\tprogressBarGreen.fillRect(this.game.config.width - 300, 60, Math.floor(this.game.city.getMorale() * 200), 30);\n\n\t\tvar cureText = this.add.text(this.game.config.width - 380, 105, 'Cure:',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\t\tthis.curePercent = this.add.text(this.game.config.width - 80, 105, Math.floor(this.game.gameData.cure * 100) + '%',\n\t\t\t{ fontFamily: '\"Georgia\"', fontSize: '20px' }).setScrollFactor(0).setDepth(1);\n\n\t\tvar progressBoxBlue = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBoxBlue.lineStyle(4, 0xeeeeee, 1);\n\t\tprogressBoxBlue.fillStyle(0x034157, 1);\n\t\tprogressBoxBlue.strokeRect(this.game.config.width - 300, 100, 200, 30);\n\t\tprogressBoxBlue.fillRect(this.game.config.width - 300, 100, 200, 30);\n\n\t\tvar progressBarBlue = this.game.gameData.progressBarBlue = this.add.graphics().setScrollFactor(0).setDepth(1);\n\t\tprogressBarBlue.fillStyle(0x31d5fd, 1);\n\t\tprogressBarBlue.fillRect(this.game.config.width - 300, 100, Math.floor(this.game.gameData.cure * 200), 30, 10);\n\t}", "function pop_facility(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <td colspan=\"2\">' + (feature.properties['name1'] !== null ? autolinker.link(feature.properties['name1'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <td colspan=\"2\">' + (feature.properties['address'] !== null ? autolinker.link(feature.properties['address'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <td colspan=\"2\">' + (feature.properties['city'] !== null ? autolinker.link(feature.properties['city'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <td colspan=\"2\">' + (feature.properties['type'] !== null ? autolinker.link(feature.properties['type'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <td colspan=\"2\">' + (feature.properties['detail1'] !== null ? autolinker.link(feature.properties['detail1'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <td colspan=\"2\">' + (feature.properties['name2'] !== null ? autolinker.link(feature.properties['name2'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <td colspan=\"2\">' + (feature.properties['detail2'] !== null ? autolinker.link(feature.properties['detail2'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function popup() {\r\n$(\".pesolight\").css(\"display\", \"block\");\r\n}", "function showTooltip_onMouseOver(){\n//----------------------------------------------------------------------------------------------------------------------------\t\n\n\n this.dispalyTooltips = function(toolz){ //args(tooplips array)\n // request mousemove events\n $(\"#graph\").mousemove(function (e) {\n\t\t var onMouseOver_file = new onMouseOver();//uses other module in this very file\n onMouseOver_file.handleMouseMoveAction(e, toolz); //args(mouse event, tooplips array)\n });\n\n } \n}", "function mouseout(d) {\n // update frecuency in bar \n leg.update(tF);\n\n } //final de mouse Out", "function barShow(){\n let barX = bgLeft + 800;\n fill(127);\n noStroke();\n rectMode(CORNER);\n\n for(let i = 0; i < 9; i++){\n rect(barX, bar.y, bar.sizeX, bar.sizeY);\n barTouch(barX,bar.sizeY,bar.y);\n barX += 600;\n\n }\n if(bar.sizeY <= bottom && bar.sizeY > cieling){\n shouldGrow();\n }\n\n else if(bar.sizeY <= cieling && bar.sizeY < bottom){\n shouldShrink();\n }\n else if(bar.sizeY == 0){\n cieling = -496;\n }\n}", "function popupG (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de junio:\"+feature.properties.jun+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function createPopup(properties, attribute, layer, radius){\n //add city to popup content string\n var popupContent = \"<p><b>Site ID:</b> \" + properties.DatasetID + \"</p>\";\n //add formatted attribute to panel content string\n var year = attribute.substring(2);\n //Creates spruce data content string\n popupContent += \"<p><b>Oak Percent:</b> \" + Math.floor(properties[attribute]*100) / 100 + \"%</p>\";\n\n //replace the layer popup\n layer.bindPopup(popupContent, {\n offset: new L.Point(0,-radius)\n });\n}", "function mouseOnC(CityName, info){\n $(tooltip).html(CityName + ' ' +info);\n $(tooltip).css('background', '#ddd');\n}", "function showTooltip(d) {\n $(this).popover({\n placement: 'auto top', //place the tooltip above the item\n container: '#chart', //the name (class or id) of the container\n trigger: 'manual',\n html : true,\n content: function() { //the html content to show inside the tooltip\n return \"<span style='font-size: 11px; text-align: center;'>\" + \"sds\" + \"</span>\"; }\n });\n $(this).popover('show'); \n}//function showTooltip", "function popup(msg,bak)\n{\n delay(800);\n\n var content=\"<table class=\\\"tooltip\\\"><tr><td class=\\\"tooltip\\\">\"+msg+\"</td></tr></table>\";\n\n if(old)\n {\n alert(msg);\n return;\n } \n \n yyy=Yoffset; \n skin.width=popwidth;\n\n if(nav)\n { \n skin.document.open();\n skin.document.write(content);\n skin.document.close();\n skin.visibility=\"visible\";\n }\n\n if(iex)\n { \n pup.innerHTML=content;\n skin.visibility=\"visible\";\n } \n\n if(n_6)\n { \n document.getElementById(\"pup\").innerHTML=content;\n skin.visibility=\"visible\";\n }\n}", "function showPopup(hoverItem, divId) {\n\tvar coors = findObjectPosition(hoverItem)\n\tdivElement = document.getElementById(divId)\n\tdivElement.style.visibility=\"visible\";\n\tdivElement.style.display = \"\";\n\tdivElement.style.top = coors[1] + 25 + 'px';\n\tdivElement.style.left = coors[0] + 10 + 'px';\n}", "function pop_Puntos(feature, layer) {\n\tlayer.on({\n\t click: function(e){\n\t console.log(\"CLICK en \"+feature.properties['ID']+\"!\");\n\t $(\"#sidebar\").empty();\n\t mymap.setView(e.target.getLatLng(),13);\n\n\t var info= makeAQIdiv(feature.properties['AQI']);\n\t info+=makeMeteoIcons(feature.properties['TEMP'],feature.properties['RHUM'],feature.properties['WSPD'],feature.properties['WDIR'],);\n\t info+=makePollutsIndicatorBars();\n\t info+='</div> <div id=\"plot-container\"></div>';\n\t\n\t $(\"#sidebar\").append(info);\n\t plotTimeSerie();\n\t addProgressBar(feature.properties['AQI'],feature.properties['NO2'],feature.properties['PM10'],feature.properties['PM25'],feature.properties['SO2'],feature.properties['CO']);\n\t \n\t $(\"#sidebar\").show();\n\n\t $(\"body,html\").animate({scrollTop: $('#sidebar').offset().top},100);\n\n\n\n\t },\n\t //si saco mouse sobre objeto:\n\t mouseout: function(e) {\n\t // for (i in e.target._eventParents) {\n\t // e.target._eventParents[i].resetStyle(e.target);\n\t // }\n\t },\n\t //si apoyo mouse sobre objeto:\n\t mouseover: function(e) {\n\t // if (e.target.feature.geometry.type === 'LineString') {\n\t // e.target.setStyle({\n\t // color: '#ffff00',\n\t // });\n\t // } else {\n\t \t console.log(e.target.feature.geometry.type);\n\t // console.log(e.target.feature.geometry.type);\n\t // e.target.setStyle({\n\t // fillColor: '#ffff00',\n\t // fillOpacity: 1,\n\t // iconSize:50,\n\t // });\n\t // }\n\t },\n\t });\n\t\n\t//Contenido del popUP:\n\tvar popupContent = 'Estación: <br><center><strong>'+ (feature.properties['ID'] !== null ? feature.properties['ID'].toLocaleString() : '')+'</strong></center>';\n// <tr><th scope=\"row\">fid </th><td>'+ (feature.properties['fid'] !== null ? feature.properties['fid'].toLocaleString() : '')+'</td></tr>\\\n\tlayer.bindPopup(popupContent, {maxHeight: 400,maxWidth:1900});\n}", "function makePopupSolicitud(){ \n\n}", "function createPopupBubble(event, acronym, definition) {\n let div = document.createElement('div');\n\n // Add popup box html to the user's current page\n div.setAttribute('id', 'gdx-bubble-host');\n let shadow = div.attachShadow({ mode: 'open' });\n let html = Style;\n html += '<div id=\"gdx-bubble-main\" style=\"left:' + getCoordinate(event.pageX, boxWidth, document.body.clientWidth) +\n 'px; top: ' + getCoordinate(event.pageY, boxHeight, document.body.scrollHeight) + 'px;\">' +\n '<div id=\"gdx-bubble-close\"></div><div id=\"gdx-bubble-query-row\" class=\"\">' +\n '<div id=\"gdx-bubble-query\">' + acronym + '</div>' +\n '<div id=\"gdx-bubble-points\" style=\"float: right; margin-right:8px; font-weight: bold;\"></div>' +\n '<button id=\"gdx-bubble-like\" style=\"float: right; margin-right:5px; display:none;\">Like</button>' +\n '</div>' +\n '<div id=\"gdx-bubble-meaning\">' + definition + '</div>' +\n '<button id=\"gdx-bubble-back\" style=\"display: none;\">«</button>' +\n '<button id=\"gdx-bubble-next\" style=\"display: none;\">»</button>' +\n '<button id=\"gdx-bubble-report\" style=\"float: right; display:none;\">Report</button>' +\n '<button id=\"gdx-bubble-more\" style=\"display: block;\">More »</button>' +\n '</div>';\n shadow.innerHTML = html;\n document.body.appendChild(div);\n}", "function popupJ (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de septiembre:\"+feature.properties.sep+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function popupM(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de diciembre:\"+feature.properties.dic+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function makePopup(detail){\n\tdocument.getElementById('overlay').style.display = \"block\";\n\tdocument.getElementById('content').style.display = \"block\";\n\tdocument.getElementById('content').innerHTML = detail;\n}" ]
[ "0.6595492", "0.65790623", "0.64050937", "0.63626146", "0.6332866", "0.62675226", "0.6227894", "0.6193408", "0.61869437", "0.6184789", "0.6164893", "0.6156323", "0.61546177", "0.6153536", "0.6151304", "0.61465174", "0.61457324", "0.6144028", "0.61330926", "0.6132817", "0.610904", "0.61060834", "0.60999215", "0.60925126", "0.60880524", "0.60872483", "0.6086501", "0.60862494", "0.60639554", "0.6060328", "0.6055528", "0.60528", "0.6042639", "0.6035354", "0.6034613", "0.6034031", "0.60271484", "0.60235095", "0.6022576", "0.60038996", "0.59997016", "0.59996814", "0.5988429", "0.598107", "0.5965709", "0.59642637", "0.5952887", "0.59507734", "0.5939775", "0.593302", "0.5923251", "0.59205985", "0.59152865", "0.5910842", "0.59045243", "0.5903986", "0.5897446", "0.5896662", "0.5896181", "0.5892798", "0.5889178", "0.5889178", "0.5889178", "0.5889178", "0.588855", "0.588596", "0.5880732", "0.58720315", "0.5867172", "0.5862363", "0.58611107", "0.5859972", "0.5852252", "0.58497196", "0.58447236", "0.5839066", "0.58269745", "0.5821528", "0.58181447", "0.58091414", "0.5805065", "0.580191", "0.5798198", "0.5795632", "0.5794998", "0.5787944", "0.57846546", "0.5775652", "0.5771516", "0.5768661", "0.5766009", "0.5762871", "0.57600874", "0.5759971", "0.5750674", "0.57479763", "0.57470286", "0.5743876", "0.57405335", "0.57402986" ]
0.5754574
94
Removes the popup when removing the mouse from a bar
clearPopUp(d, i) { this.svg.selectAll("g.popUpG").remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBarMouseOut(d, i) {\n d3.select('#id-name').remove();\n }", "function removePopupCloseBar() { \n //skyro\n var closeBarTag = document.getElementById(DEFAULT_DIALOG_POPUP_ID+\"skyroscloseBar\");\n //swan\n if(closeBarTag == null) closeBarTag = document.getElementById(DEFAULT_DIALOG_POPUP_ID+\"closeBar\"); \n if(closeBarTag != null )\n closeBarTag.parentNode.removeChild(closeBarTag);\n}", "function mouseOut(){\n d3.select(this)\n\t .classed(\"mouseover\", false)\n\t .attr(\"r\", 3);\n bar_svg.style(\"display\", \"none\");\n svg.select(\".barSVG\").remove(); \n d3.select(\"#barTitle\").remove(); \n }", "function disable() {\n mouse_highlight.destroy();\n}", "onBrushDeleteButtonOut() {\n this.mouseOverDeleteButton = false;\n }", "_mouseOut () {\n this.hide();\n this.html.remove.defer(this.html);\n }", "cancelXPointerEntry() {\n this.$el.find(\".cb-xf-xpointer\").removeClass('active');\n this.toggleXPointer();\n }", "function removeSelectedBar() {\n if (!chosenBar) throw new Error(\"Attempted to remove selected bar when none were selected!\");\n removeBar(chosenBar);\n\n // Clear selection as the previously selected bar is no more.\n chosenBar = null;\n\n show();\n}", "function unfocusBars() {\r\n // Return all bars and logos to full opacity\r\n G_BARS.selectAll(\".data-bar\")\r\n .classed(\"focused\", false)\r\n .transition()\r\n .duration(HOVER_TRANS_TIME)\r\n .style(\"opacity\", 1);\r\n\r\n G_BARS.selectAll(\".data-image\")\r\n .classed(\"focused\", false)\r\n .transition()\r\n .duration(HOVER_TRANS_TIME)\r\n .style(\"opacity\", 1);\r\n\r\n // Hide tooltip\r\n TIP.hide();\r\n }", "function dehookGUI() {\n var elmts = [ 'btn-minimize' ];\n\n for (var i = 0, elmts_len = elmts.length; i < elmts_len; i++) {\n var elmt = document.getElementById(elmts[i]);\n elmt.onchange = elmt.ondblclick = elmt.onclick = null;\n }\n\n /* Force the bottom bar to be visible once the CSS GUI has been\n immobilized. */\n var btn_minimize = document.getElementById('btn-minimize');\n btn_minimize.style.cssText = '';\n var bbwrap = document.getElementById('bbwrap');\n bbwrap.onmouseover = null;\n bbwrap.onmouseout = null;\n document.getElementById('bottomBar').style.cssText = '';\n}", "remove() { this.tooltip.remove(); this.element.remove(); }", "resetMouseTimeout() {\n\t\tclearTimeout(this.$powerUi.tmp.bar.timeout);\n\t\tthis.$powerUi.tmp.bar.timeout = setTimeout(this.$powerUi.tmp.bar._onmousestop, 120);\n\t}", "function mouseUpHandler(e) {\n //middle button\n if (e.which == 2) {\n container.off('mousemove');\n }\n }", "function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.off('mousemove');\r\n }\r\n }", "function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.off('mousemove');\r\n }\r\n }", "function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.off('mousemove');\r\n }\r\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.off('mousemove');\n }\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.off('mousemove');\n }\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.off('mousemove');\n }\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.off('mousemove');\n }\n }", "function cancelCallback()\n {\n deactivateInspectionToolButton();\n clearUndoBuffer();\n _layoutFunctions.enableToolbarMenu();\n }", "function removeMouseClick() {\n click_active = false;\n current_click = null;\n nodes_selected = nodes; //Re-instate the mouse events\n\n mouse_zoom_rect.on('mouseout', function (d) {\n if (current_hover !== null) mouseOutNode();\n }); //Release click\n\n mouseOutNode();\n hideTooltip(); //Hide the rotating circle\n\n node_hover.style('display', 'none'); //Hide the icon to the bottom right of a clicked node\n\n node_modal_group.style('display', 'none');\n } //function removeMouseClick", "function removeMouseClick() {\n click_active = false;\n current_click = null;\n nodes_selected = nodes; //Re-instate the mouse events\n\n mouse_zoom_rect.on('mouseout', function (d) {\n if (current_hover !== null) mouseOutNode();\n }); //Release click\n\n mouseOutNode();\n hideTooltip(); //Hide the rotating circle\n\n node_hover.style('display', 'none'); //Hide the icon to the bottom right of a clicked node\n\n node_modal_group.style('display', 'none');\n } //function removeMouseClick", "function unbind_article_scrollbar_mousemove()\n\t\t\t{\n\t\t\t\t\t $('.scroll-bar-container').off('mousemove',article_scrollbar_mousemove_handler);\t\n\t\t\t}", "function deactivateInspectionToolButton(){\n clearUndoBuffer();\n updateUndoButton();\n var inspectorButton = $(\"#perc-region-tool-inspector\");\n inspectorButton.removeClass('buttonPressed');\n inspectorButton.css(\"background-position\", \"0px -34px\");\n _iframe.contents().find(\".perc-itool-custom-cursor\").removeClass('perc-itool-custom-cursor');\n _layoutFunctions.widgetDecorator.addClicks();\n _layoutFunctions.regionDecorator.addClicks();\n clearItoolMarkup();\n updateInspectToolMenu(false);\n _layoutFunctions.removeDropsSortingResizing(false);\n\n }", "function removeTooltip() {\t\t\t\r\n\t\t\t$('.popover').each(function() { $(this).remove(); });\r\n\t\t\treturn;\r\n\r\n\t\t}//end function removeTooltip ", "function handleMouseOut(d, i) {\n d3.select(this).style('opacity', 0.65);\n d3.select(map.getPanes().popupPane).html(null);\n }", "_onPointerOut() {\n this.removeState(\"hovered\");\n }", "function mouseUp()\n {\n ThemerService.mouseDown = false;\n $document.unbind('mouseup', mouseUp);\n }", "function spaceBar(e) { defDemo.currentPart().abort(); }", "function mouseUp(e) {\n clickObj.mouseDown = false;\n $(window).unbind('mousemove');\n }", "function mouseReleased() {\r\n mouseIsDown = false;\r\n}", "handleMouseOut() {\n this.IsHover = false;\n }", "function removeOverlay() {\n if (!getCurrentOpen()) {\n removeClass(overlay, fadeClass);\n overlay.remove();\n resetScrollbar();\n }\n}", "function removeHoverState(){\n\t\t\t\t\n\t\tg_objHandleTip.removeClass(\"ug-button-hover\");\n\t}", "function _destroy()\n {\n if(bars===false)\n {\n resetTimer();\n }\n\n selected = null;\n }", "deselectUITools() {\n $('.toolBtn').removeClass('active');\n $(this.app.canvas).removeClass('crosshair');\n }", "function handleMouseOut(d, i) {\n tooltip.style('display', 'none');\n }", "function o(){document.removeEventListener(\"mousemove\",i),H=null}", "function geoButtonMouseOutHandler(event) {\r\n\r\n unsafeWindow.ButtonHoverOff(this);\r\n\r\n}", "function mouseUp(){\r\n isDown = false;\r\n box.style.border = 'none';\r\n }", "function mouse_up_handler() {\n mouse.down = false; \n }", "function deactivate() {\n populationApp.toolbar.deactivate();\n clearMap();\n }", "function resetMouseHighlighter() {\n const prevTarget = document.querySelector(\".c8a11y-mouse-target\");\n\n if (prevTarget) {\n bodyEl.removeChild(prevTarget);\n }\n }", "function hidePopup () {\n editor.popups.hide('customPlugin.popup');\n }", "function hidePopup () {\n editor.popups.hide('customPlugin.popup');\n }", "function endCanvasMouseEvent(event){\r\n if((typeof clickeventFlag !== 'undefined') && clickeventFlag){\r\n return;\r\n }else{\r\n clickeventFlag = false;\r\n }\r\n //Suppression de l'infobulle existant\r\n if(document.getElementById(\"tooltip\"))\r\n document.getElementById(\"tooltip\").remove();\r\n}", "function removeOpenArrowBox(){\n const openChart=document.querySelector(\".arrow_box\");\n if(openChart)\n document.body.removeChild(openChart);\n }", "function MouseUp(e){\n document.body.removeChild(pre);\n}", "function mouseReleased() {\n stamped =false;\n}", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "destroy() {\n const bar = this.items[this.index][0];\n const content = this.items[this.index][1];\n hide(content);\n bar.removeAttribute(ATTRIBUTE_ACTIVE);\n content.removeAttribute(ATTRIBUTE_ACTIVE);\n }", "function unhoverizer() {\n\tclearInterval(interval);\n\t$(\".hoverizer\").remove();\n}", "function windowMouseupListener () {\n if (!tryDestroy()) {\n selectionMgr.saveSelectionState(true, false)\n }\n }", "function unregisterTrackPos(handle) {\n $(handle.currentTarget).unbind('mousemove')\n}", "function mouseOutGraphic(ev) {\n map.setMapCursor(\"default\");\n\n //mouseDragConnection = null;\n}", "async mouseAway() {\n await this._actions().mouseMove(this.element(), { x: -1, y: -1 }).perform();\n await this._stabilize();\n }", "function ToolBar_Popup_MouseOut(event)\n{\n\t//get the element\n\tvar source = Browser_GetEventSourceElement(event);\n\t//search for the original colours\n\twhile (source && !source.PopupBGColor && !source.PopupFGColor)\n\t{\n\t\tsource = source.parentNode;\n\t}\n\t//has valid source?\n\tif (source)\n\t{\n\t\t//update it\n\t\tsource.style.backgroundColor = source.PopupBGColor;\n\t\tsource.style.color = source.PopupFGColor;\n\t}\n}", "function mouseOut(e) {\r\n var layer_marker = e.target;\r\n // layer_marker.closePopup();\r\n }", "exitDock() {\n this._qs(\".container\").style.opacity = \"0\";\n this._qs(\".container\").style.pointerEvents = \"none\";\n }", "handlePopoverMouseUp() {\n this.allowBlur();\n }", "__unhighlight(e) {\n this.__dropArea.classList.remove('highlight');\n }", "function disablePopupM() {\n try {\n //blink();\n $(\"#mcPopWindow\").empty().remove();\n $(\"#overLay\").hide();\n\n popupStatus = 0;\n\n }\n catch (e) { }\n}", "function PushButton_OnMouseOut(theObject)\n{\n\t//remove its border\n\ttheObject.HTML.style.border = \"none\";\n}", "_stop_mouse_track() {\n\t\t\tif (this.track_id) {\n\t\t\t\tthis.track_id = clearInterval(this.track_id);\n\t\t\t}\n\t\t\tthis.add_info('movement', this.current_mouse_movement, 'shape');\n\t\t}", "mouseUp(event) {\n var button = event.which || event.button;\n delete this.activeCommands[button];\n }", "mouseUp(event) {\n var button = event.which || event.button;\n delete this.activeCommands[button];\n }", "function mouseout(d) {\n // update frecuency in bar \n leg.update(tF);\n\n } //final de mouse Out", "function remove(e) {\n // e.target contains the specific element moused over so let's\n // save that into a variable for clarity.\n let pixel = e.target;\n // Change the opacity value to 0\n pixel.style.opacity = \"0\";\n}", "disableActiveTool() {\n this.project.view.off('mousedown');\n this.project.view.off('mousemove');\n this.project.view.off('mouseup');\n this.project.view.off('click');\n this.project.view.off('mousedrag');\n }", "function OnMouseExit() {\n\tisMouseEnter = false;\n\t\n}", "hideBook() {\n\t\t$('#scatterplot-mouse-over').hide();\n\t}", "function endHover() {\r\n\t\t$('#map-hover-box').hide();\r\n\t\t$(document).unbind('mousemove', getPosition);\r\n\t}", "function mouseup(event) {\n current_slider = null;\n}", "function mup(e,editor) {\n\t\t//remove event handler\n\t\t$(editor.$main).off(\"mousemove\");\n\t\t$(editor.$main).off(\"mouseleave\");\n\t\t$(editor.$main).off(\"mouseup\");\n\t}", "function destroyInfoBox() {\n\t\tsvg.selectAll(\".popup\").remove()\n\t}", "function setMouseOut(){\n\t\tglobals.mouseCoords.x = -1;\n\t\tglobals.mouseCoords.y = -1;\n\t}", "handlePopoverMouseDown(event) {\n const mainButton = 0;\n if (event.button === mainButton) {\n this.cancelBlur();\n }\n }", "function closeSideBar(){\n setVideochat(false);\n setPeoples(false);\n }", "function clearVerticalPositionPopupButtonState() {\n let threadDictionary = NSThread.mainThread().threadDictionary()\n let verticalPositionPopupButton = threadDictionary[verticalPositionPopupButtonID]\n verticalPositionPopupButton.itemWithTitle('Default Position').setState(NSControlStateValueOff)\n verticalPositionPopupButton.itemWithTitle('Superscript').setState(NSControlStateValueOff)\n verticalPositionPopupButton.itemWithTitle('Subscript').setState(NSControlStateValueOff)\n verticalPositionPopupButton.itemWithTitle('Ordinals').setState(NSControlStateValueOff)\n verticalPositionPopupButton.itemWithTitle('Scientific Notation').setState(NSControlStateValueOff)\n}", "function removeTooltip() { \n element.removeAttribute( ariaDescribedBy )\n ops.container.removeChild( tooltip )\n timer = null\n }", "_onMouseMove()\n {\n this.deactivate();\n }", "function unannotateToolbarIcon() {\n $(\".toolbar-icon-tooltip\").remove();\n}", "function hide() {\n if (tooltip) {\n tooltip.parentNode.removeChild(tooltip);\n tooltip = null;\n }\n }", "function mouseReleased(){\n\tdrawing = false;\n}", "uiEvtMouseOutPerformed() {\r\n if (this.m_headerTree.uiEvtMouseOutPerformed()) {\r\n return true;\r\n }\r\n this.m_mosPushStat = false;\r\n this.m_mosPushPrvX = 0;\r\n return false;\r\n }", "function deActivate() { \n\tdocument.getElementById('ToolTip').style.display = \"none\"; \n}", "function hideGUIForever () {\r\n $('#buttonsPanel')\r\n .add('#player-logo')\r\n .add('#presentation-info')\r\n .add('.leftButton')\r\n .add('.rightButton')\r\n .add('#menu-container')\r\n .add('#timelinebutton').removeClass('show').addClass('hidden');\r\n\r\n // Disable all GUI handlers\r\n $('html').off(\"mouseenter\", showGUI);\r\n $('html').off(\"mouseleave\", hideGUI);\r\n $('#scene').off('mousemove');\r\n }", "function mouseup(){\n mouse_down = false;\n}", "function hideAsyncEventQueuePopup() {\n\n // Hide Pop up\n $(\"#tooltip\").hide();\n\n destroyScrollPane('gview_idAsynchEventQueueGrid') ;\n}", "function hideTooltips() {\n\t\t\t\t\ttooltipObject.remove();\n\t\t\t\t}", "closeOptionsBar() {\n document.getElementById('optionsBar').style.width = \"0px\";\n }", "function removeTooltip() {\n //Hide the tooltip\n $('.popover').each(function() {\n $(this).remove();\n }); \n}//function removeTooltip", "function removeOverlay( e ) {\n //console.debug( \"removing overlay\" );\n $(\"overlay\").hide();\n}", "clearHoverIcons() {\n this.nativeElement.removeAttribute(CONSTANTS.DROP_HOVER_ATTR);\n }", "function unfocus() {\n overlay.setFocus( false );\n}", "function removeClosedState(){\n\t\tg_objHandleTip.removeClass(\"ug-button-closed\");\t\t\n\t}", "function removeSpecialButton() {\n playerHitCounter = 0;\n specialBar(playerSpecialBar, playerHitCounter);\n if (buttonWrapper.contains(specialButton)) {\n buttonWrapper.removeChild(specialButton);\n } else {\n return\n }\n}", "function cancelMouseOut (evt) {\n\t\t\ttimer.clear(pane+\"_closeSlider\");\n\t\t\tevt.stopPropagation();\n\t\t}", "function bgClicked(e) {\n setNewSource(null);\n setTempLine(null);\n setMouseListenerOn(false);\n }" ]
[ "0.71298915", "0.7129802", "0.68721306", "0.68204534", "0.67693007", "0.6747195", "0.6672235", "0.66662806", "0.6660013", "0.66590595", "0.6629238", "0.6616812", "0.6602794", "0.6595134", "0.6595134", "0.6595134", "0.65803236", "0.65803236", "0.65803236", "0.65803236", "0.6573305", "0.6562897", "0.6562897", "0.6555428", "0.6533015", "0.6517096", "0.6514579", "0.64926815", "0.64895564", "0.6481593", "0.64519095", "0.64495075", "0.64375365", "0.6419296", "0.6418493", "0.64177316", "0.64167726", "0.6416583", "0.64042526", "0.6404036", "0.640247", "0.6388307", "0.6381747", "0.6376058", "0.6374462", "0.6374462", "0.6369474", "0.6359042", "0.6341714", "0.6339", "0.63343364", "0.6328127", "0.631422", "0.6310416", "0.62984115", "0.62979406", "0.6282462", "0.62710065", "0.62660843", "0.62617266", "0.62575155", "0.6247442", "0.62458163", "0.62434745", "0.6240923", "0.624067", "0.624067", "0.62377584", "0.623015", "0.62283844", "0.6228017", "0.6225571", "0.62246794", "0.62206376", "0.6220275", "0.62076396", "0.6207538", "0.6205062", "0.62021357", "0.6200517", "0.61994076", "0.61936915", "0.61933196", "0.61899275", "0.61878794", "0.6185998", "0.61857426", "0.6184866", "0.6181754", "0.6170618", "0.61674166", "0.6165808", "0.61540556", "0.6148396", "0.61399835", "0.61378664", "0.61376214", "0.6136673", "0.61359495", "0.61352396" ]
0.62392485
67
Renders the bar chart
render() { const style = { height: this.divHeight, // Takes up this much space on the screen overflowY: "scroll" // The rest of the chart can be seen by scrolling }; return <div id={"bar" + this.props.id} className={this.barClass} style={style} />; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderBarChart() {\n drawAxisCalibrations();\n var i, j, p, a, x, y, w, h, len;\n\n if (opts.orient === \"horiz\") {\n rotate();\n }\n\n drawAxis();\n\n ctx.lineWidth = opts.stroke || 1;\n ctx.lineJoin = \"miter\";\n\n len = sets[0].length;\n\n // TODO fix right pad\n for (i = 0; i < sets.length; i++) {\n for (j = 0; j < len; j++) {\n p = 1;\n a = rotated ? height : width;\n w = ((a / len) / sets.length) - ((p / sets.length) * i) - 1;\n x = (p / 2) + getXForIndex(j, len + 1) + (w * i) + 1;\n y = getYForValue(sets[i][j]);\n h = y - getYForValue(0) || !isNaN(opts.mapZeroValueTo) && +opts.mapZeroValueTo || 0;\n\n if (isStacked()) {\n // TODO account for negative and positive values in same stack\n w = (a / len) - 2;\n x = getXForIndex(j, len + 1);\n //y = getYForValue(sumY(sets.slice(0, i + 1), j));\n \n // Accounting for negative and positive values in same stack\n y = getYForValue(sumYSigned(sets, i, j));\n }\n\n drawRect(colorOf(i), x, y, w, h);\n }\n }\n }", "function render_barBijzonder() {\n var plotBar = hgiBar().margin({\n 'top': 20,\n 'right': 20,\n 'bottom': 40,\n 'left': 110\n }).mapping(['name', 'value']).errorMapping('sd').freqMapping('frequency').title('Is er iets bijzonders gebeurd?').xDomain([0, 100]).xLabel('Ik ben van slag').addError(true).addFrequencies(true);\n d3.select('#barBijzonder').datum(data_vanslag).call(plotBar);\n}", "function drawBarChart() {\n console.log(\"CALL: drawBarChart\");\n\n if($AZbutton.hasClass(\"active\"))\n filteredUserData = _.sortBy(filteredUserData, function(obj) { return obj.data; });\n else\n {\n filteredUserData = _.sortBy(filteredUserData, function(obj) { return obj.data; });\n filteredUserData.reverse();\n }\n\n var data = google.visualization.arrayToDataTable(buildBarData());\n\n var chartAreaHeight = data.getNumberOfRows() * 30;\n var chartHeight = chartAreaHeight + 150;\n var heightBar = 60;\n\n var options = {\n title: \"User tags\",\n width: \"100%\",\n height: data.Gf.length == 1? \"100%\" : chartHeight,\n bar: { groupWidth: heightBar + \"%\" },\n legend: { position: 'top', maxLines: 3, textStyle: {fontSize: 13}},\n isStacked: true,\n backgroundColor: 'transparent',\n annotations: {\n alwaysOutside: false,\n textStyle: { color: \"black\"}\n },\n chartArea: {'height': chartAreaHeight, 'right':0, 'top': 100, 'left':150 },\n hAxis: {\n title: \"Number of tagged data\",\n titleTextStyle: { fontSize: 14 },\n textStyle: { fontSize: 13 }},\n vAxis: {\n title: \"User\",\n titleTextStyle: { fontSize: 14 },\n textStyle: { fontSize: 13 }},\n tooltip: { textStyle: {fontSize: 13}}\n };\n var chart = new google.visualization.BarChart(document.getElementById(barChartID));\n chart.draw(data, options);\n }", "function drawBar() {\n\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'Date');\n data.addColumn('number', 'Issues');\n\n data.addRows(self.charts.bars.rows);\n\n var options = self.charts.bars.options;\n\n var chart2 = new google.visualization.ColumnChart(\n document.getElementById('chart_div2'));\n\n chart2.draw(data, options);\n }", "function drawBarChart(data) {\n\tvar chartData = convertToChartData(data);\n\ttypes = [];\n\tfor (t in accidentTypes) types.push(t);\n\t$(\"#chart\").empty();\n\t$(\"#chart\").jqBarGraph( {\n\t\tdata: chartData,\t// (array) data to show. e.g [ [[5,2,3,1,...,3],'Jan.'], [[2,..,5],'Feb.'], ... [[...],'Dec.']]\n\t\tlegends: types,\t\t// (array) text for each colors in legend \n\t\tlegend: true,\t\t\n\t\tlegendWidth:150,\n\t\tcolors: colors,\t\t// (array) color information for each type\n\t\ttype:false,\t\t\t// stacked bar chart \n\t\twidth:500,\t\t\t\n\t\theight:200,\n\t\tanimate:false, showValues:false\n\t});\n\tattachChartEvents();\n}", "plotBarChart(data) {\n this.graph.xAxis('Story')\n .yAxis('Memory used (MiB)')\n .title('Labels')\n .setData(data, story => app.$emit('bar_clicked', story))\n .plotBar();\n }", "function render_barBeweging() {\n var plotHist = hgiHistogram().mapping(['name', 'value']).errorMapping('sd').yDomain([0, 100]).addLabels(false).addError(true).yTicks(5).yLabel('Beweging');\n d3.select('#barBeweging').datum(data_beweging).call(plotHist);\n}", "function chartBar(){//creating a function which draws the chart when it is called (the code in the function is ran)\n\t\tvar chart = new Chart(ctx, {//creating a new chart\n\t\t type: 'bar',//selecting the type of chart wanted\n\t\t data: dataForChart, //calling dataset\n\t\t\t options:{\n\t\t\t \ttitle:{//adding a title\n\t\t\t \t\tdisplay: true,//displaying a title\n\t\t\t \t\ttext: \"Inquest Conclusions Recorded in England and Wales 2010-2015\",//choosing the text for the title\n\t\t\t \t\tfontSize:20,//changing the font size of the title\n\t\t\t \t}\n\t\t\t },\n\t\t});\n\t}", "function render_barOpgewektheid() {\n var plotBar = hgiBar().mapping(['name', 'value']).errorMapping('sd').freqMapping('frequency').xDomain([0, 100]).addError(true).addFrequencies(true).xLabel('Opgewektheid');\n d3.select('#barOpgewektheid').datum(data_opgewektheid).call(plotBar);\n}", "function drawBars() {\n\n xScale.domain(d3.range(actividades_jaca.length));\n yScale.domain([0, d3.max(actividades_jaca, function(d) {\n return +d.value;\n })]);\n\n bar_color.domain(d3.range(function(d) {\n return d.act_descripcion;\n }));\n var myBars = svgBar.selectAll('svgBar').data(actividades_jaca);\n\n myBars.enter()\n .append('rect')\n .attr('class', 'addon')\n .attr('x', function(d, i) {\n return xScale(i);\n })\n .attr('y', function(d) {\n return height - yScale(d.value);\n })\n .attr('width', xScale.rangeBand())\n .attr('height', function(d) {\n return yScale(d.value);\n })\n .attr('fill', function(d) {\n return bar_color(d.act_descripcion);\n })\n .on('mouseover', function(d) {\n d3.select(this)\n .style('stroke-width', 0.5)\n .style('stroke', 'red');\n tooltipTitle.html(d.act_descripcion);\n tooltipTotal.html(d.value);\n })\n .on('mouseout', function() {\n d3.select(this)\n .style('stroke-width', 0);\n tooltipTitle.html('Número de empresas');\n tooltipTotal.html(totalActividades);\n });\n }", "function drawBarChart(){\n if(barChartData.length != 0){\n google.charts.load('current', {'packages':['bar']});\n google.charts.setOnLoadCallback(drawChart2);\n function drawChart2(){\n var data = google.visualization.arrayToDataTable(barChartData);\n var options = {\n chart: {\n title: 'Algorithm Performance Comparision',\n vAxis: { title: \"Time taken (in ms)\" },\n hAxis: { title: \"Algorithm\" },\n legend: { position: 'bottom' },\n colors: ['blue','red','green','yellow'],\n }\n };\n var chart = new google.charts.Bar(document.getElementById('algograph'));\n chart.draw(data, google.charts.Bar.convertOptions(options));\n }\n }\n}", "function render_barTekortSchieten() {\n var plotBar = hgiBar().mapping(['name', 'value']).errorMapping('sd').freqMapping('frequency').xDomain([0, 100]).addError(true).addFrequencies(true).xLabel('Ik heb het gevoel tekort te schieten');\n d3.select('#barTekortSchieten').datum(data_tekort_schieten).call(plotBar);\n}", "function renderBars() {\n return sortEnergy().map( (item,i)=>{\n return <Bar \n bar={item} \n key={i} \n select={select} \n index={i} \n onClick={()=>setSelect(i)} \n onMouseLeave={()=>setSelect(-1)}>\n {item.name} { parseInt((item.value*100).toString()) }%\n </Bar>\n })\n }", "function bar(renderOpts) {\n // create object to hold chart updating function\n // as well as current data\n var\n self = {data : start_data},\n container = d3.select(renderOpts.renderTo),\n race = projections.raceAbbr(renderOpts.race),\n margin = self.margin = { top: 50, right: 40, bottom: 40, left: 65 },\n // chart h/w vs full svg h/w\n width = 300 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom,\n full_width = self.width = width + margin.left + margin.right,\n full_height = self.height = height + margin.top + margin.bottom,\n total = 0;\n\n // get population number for age, year, race\n function value(a){\n return self.data[a][0][race];\n }\n\n // generate percentage stat for bar width\n function pop_percent(a) {\n return value(a) / total;\n }\n\n ages.map(function(a) { total += value(a); });\n total = total || 1; // to avoid division by 0\n\n var max = 0.15;\n\n // scale for bar width\n var x = d3.scale.linear()\n .domain([0, max])\n .range([0, width]);\n\n // ordinal scale to space y axis\n var y = d3.scale.ordinal()\n .rangeRoundBands([height, 0], 0.1)\n .domain(ages.map(bucket).reverse());\n\n // create y axis using calculated age buckets\n var yAxis = d3.svg.axis()\n .scale(y)\n .outerTickSize(0)\n .orient(\"left\");\n\n // create y axis using calculated percentage scale\n var xAxis = d3.svg.axis()\n .scale(x)\n .tickFormat(d3.format('%'))\n .outerTickSize(0)\n .ticks(3)\n .orient(\"bottom\");\n\n // space between bars, and bar dimension\n var buffer = 6;\n var barHeight = height / ages.length;\n\n\n // container svg, dynamically sized\n container.classed('chart-svg-container', true)\n\n var svg = self.svg = container.append('svg')\n .attr({\n \"preserveAspectRatio\" : \"xMinYMin meet\",\n \"viewBox\" : \"0 0 \" + full_width + \" \" + full_height,\n \"class\" : \"chart-svg\"\n })\n .append('g')\n .attr(\n 'transform',\n 'translate(' + margin.left + ',' + margin.top + ')'\n );\n\n // title text for bar chart\n svg.append('text')\n .attr({\n \"class\" : \"bar-title\",\n \"y\" : -15\n }).text(capitalize(renderOpts.race));\n\n // y grid lines\n var gridAxis = d3.svg.axis().scale(x)\n .orient(\"bottom\")\n .tickSize(-height, 0, 0)\n .ticks(4)\n .tickFormat(\"\");\n\n var grid_lines = svg.append('g')\n .attr('class', 'y grid')\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(gridAxis);\n\n // bar chart rectangles\n var bar_container = svg.append('g')\n .selectAll('g')\n .data(ages)\n .enter().append('g')\n .attr(\"transform\", function(d, i) {\n return \"translate(0,\"+(i * barHeight + buffer/2)+\")\";\n })\n .attr(\"id\" , function(d) { return race + \",\" + bucket(d); })\n .attr('width', width)\n .attr('height', barHeight + buffer/2);\n\n var bars = bar_container.append('rect')\n .attr({\n \"class\" : function(d) { return 'pyramid bar ' + bucket(d); },\n \"width\" : function(d) { return x(pop_percent(d)); },\n \"height\" : barHeight - buffer / 2,\n });\n\n // render y axis\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n // render x axis\n var x_axis_g = svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n\n var p = d3.format(\".1%\");\n var datalabels = bar_container.append('text')\n .text(function(d) {return p(pop_percent(d));})\n .attr({\n class : function(d) { return 'datalabel ' + bucket(d); },\n x : function(d) { return 5 + x(pop_percent(d)); },\n y : buffer + barHeight / 2\n }).style('opacity', 0);\n\n // highlight all same y-value\n bar_container\n .on('mouseover', function(){\n var selected = this.id.split(\",\")[1];\n d3.selectAll('.pyramid.bar')\n .classed('highlight', function(){\n return d3.select(this).classed(selected);\n });\n d3.selectAll('.datalabel')\n .style('opacity', function() {\n // boolean to number\n return +d3.select(this).classed(selected);\n });\n })\n .on('mouseout', function(){\n d3.selectAll('.pyramid.bar').classed('highlight', false);\n d3.selectAll('.datalabel').style('opacity', 0);\n });\n\n\n // data update\n self.update = function(new_data, maximum) {\n\n var dur = 300;\n\n // bounce back if already loading something\n if (projections.loading_indicator) return self;\n\n // store new data\n self.data = prepData(new_data);\n\n // get population number for age, year, race\n var year = settings.pyramid_abbr();\n var value = function(a){\n return parseFloat(self.data[a][year][race]);\n };\n\n // calculate total for this group\n var total = 0;\n ages.map(function(a) { total += value(a); });\n total = total || 1; // prevent divsion by 0\n\n // generate percentage stat for bar width\n var pop_percent = function(a) {\n return value(a) / total;\n };\n\n maximum = maximum || 0.15;\n\n x.domain([0, maximum]);\n\n bars\n .transition()\n .duration(dur)\n .attr(\"width\" , function(d) {\n return x(pop_percent(d));\n });\n\n x_axis_g\n .transition()\n .duration(dur)\n .call(xAxis);\n\n grid_lines\n .transition()\n .duration(dur)\n .call(gridAxis);\n\n datalabels\n .text(function(d){ return p(pop_percent(d)); })\n .attr(\"x\", function(d){ return 5 + x(pop_percent(d)); } );\n\n return self;\n };\n\n return self;\n }", "function drawBars() {\n var isStacked = graph.allSeries[seriesIndex].options.type ==='stackedBar',\n seriesSum = [],\n color,\n i=0,\n j = 0;\n\n if(isStacked) {\n for (j = 0; j < graph.numPoints; j++) {\n seriesSum.push(0);\n }\n for (j = 0; j < series.length; j++) {\n color = graph.options.colors[j];\n seriesSum = drawStackedBar(series[j], seriesSum, j+1, graph.yTicks[seriesIndex], color);\n }\n } else {\n barWidth = barWidth/series.length;\n\n for (i = 0; i < graph.numPoints; i++) {\n for(j=0; j < series.length; j++) {\n color = graph.options.colors[j];\n drawBar(series[j][i], i, j, graph.yTicks[seriesIndex], color);\n }\n }\n }\n\n graph.$el.bind('barDrawn', function(){$('.point-flag').fadeIn();});\n for (j = 0; j < series.length; j++) {\n drawPointFlags(series[j], seriesSum, j+1, graph.yTicks[seriesIndex]);\n }\n\n if (graph.tooltips && graph.tooltips.length) {\n for (j = 0; j < graph.numPoints; j++) {\n if (graph.tooltips[j] || graph.tooltips[j] === 0) {\n barHover(series, graph.yTicks[seriesIndex], j, isStacked);\n }\n }\n }\n\n }", "function renderBarChart(x_values, y1, y2, barname) {\n var trace1 = {\n x: x_values,\n y: y1,\n text: y1,\n name: 'Total Positions',\n type: 'bar',\n textposition: 'auto',\n hoverinfo: 'none'\n };\n\n var trace2 = {\n x: x_values,\n y: y2,\n text: y2,\n name: 'Total Companies',\n type: 'bar',\n textposition: 'auto',\n hoverinfo: 'none'\n };\n\n var data = [trace1, trace2];\n\n var layout = {\n barmode: 'group',\n title: '# of Companies vs # of Positions Available per State'\n };\n\n Plotly.newPlot(barname, data, layout);\n}", "render() {\n const $barCont = $chart.selectAll('.year__barCont');\n\n const bar = $barCont\n .selectAll('.bar')\n .data(d => {\n return d.censored;\n })\n .join(enter =>\n enter.append('div').attr('class', d => `bar bar--${d.key}`)\n );\n\n bar.style('width', d => `${scaleX(d.value)}px`).style('height', '10px');\n\n return Chart;\n }", "function barChart(a, b) {\n\n var data = new google.visualization.arrayToDataTable(barArray, false);\n var chartOptions = {\n title: a,\n width: 400,\n height: 300,\n\n };\n\n var chart = new google.visualization.BarChart(document.getElementById(b));\n\n chart.draw(data, chartOptions);\n }", "function render(data) {\n // function(d, i) { return d }\n // (d, i) => d\n bars = g.selectAll('rect')\n .data(data)\n\n bars.enter()\n .append('rect')\n .style('width', d => `${x.bandwidth()}px`)\n .style('height', d => (alto - y(d.MONTO_IMPUESTOS)) + 'px')\n .style('x', d => x(d.ENTIDAD_FEDERATIVA) + 'px')\n .style('y', d => (y(d.MONTO_IMPUESTOS)) + 'px')\n .style('fill', d => color(d.ENTIDAD_FEDERATIVA))\n\n // j. call que sirve para crear los ejes\n yAxisCall = d3.axisLeft(y)\n .ticks(5)\n .tickFormat(d3.format(',.0d'))\n yAxisGroup.call(yAxisCall)\n\n xAxisCall = d3.axisBottom(x)\n xAxisGroup.call(xAxisCall)\n .selectAll('text')\n .attr('x', '-8px')\n .attr('y', '-5px')\n .attr('text-anchor', 'end')\n .attr('transform', 'rotate(-70)')\n}", "function drawBar()\n{\n\n\n/*var Barview = new google.visualization.DataView(data);\nBarview.setColumns([0, 1,\n { calc: \"stringify\",\n sourceColumn: 1,\n type: \"string\",\n role: \"annotation\" },\n 2]);*/\n\nvar options = {\n title: \"Bar Chart\",\n width: 600,\n height: 400,\n bar: {groupWidth: \"95%\"},\n legend: { position: \"none\" },\n};\nvar Barchart = new google.visualization.BarChart(document.getElementById(\"barDiv\"));\nBarchart.draw(data, options);\n}", "render() {\n\n\n return (\n <section className=\"bar-graph-contain\">\n\n <div className=\"graph\">\n <Bar\n width={450}\n\t height={200}\n \tdata={this.state.chartData}\n \toptions={{title:{display:true, text:\"Price Versus Simple Moving Average (SMA)\", fontSize: 20}, legend: {display: false}, responsive: true}}\n redraw\n />\n </div>\n\n </section>\n );\n }", "render( props ) {\n\t\t// FIXME: This line seems redundant. Please document if there's a reason behind this.\n\t\tprops[\"use_percentages\"] = (props.use_percentages && (props.use_percentages == true));\n\n\t\tlet {labels, values, use_percentages, hideLegend} = props;\n\t\tif ( !((labels || hideLegend) && values) ) {\n\t\t\tconsole.warn(\"BarChart was created with invalid props\", props);\n\t\t\treturn <div>No Data!</div>;\n\t\t}\n\n\t\tconst padTop = 0;\n\t\tconst padBottom = 0;\n\t\tconst padLeft = 0;\n\t\tconst padRight = 0;\n\n\t\tlet minYZeroPos = 0;\n\t\tlet xZeroPos = 0;\n\t\tconst xAxisHeight = props.xAxisHeight ? props.xAxisHeight : AXIS_RESERVATION;\n\t\tconst yAxisWidth = props.yAxisWidth ? props.yAxisWidth : AXIS_RESERVATION;\n\n\t\tlet firstBarXStart = 0;\n\t\tif ( props.showXAxis ) {\n\t\t\tminYZeroPos = xAxisHeight;\n\t\t}\n\t\tif ( props.showYAxis ) {\n\t\t\txZeroPos = yAxisWidth;\n\t\t\tfirstBarXStart = 0.2;\n\t\t}\n\t\tconst xMaxValue = firstBarXStart + values.length;\n\n\t\tconst {valuesYPos, yZeroPos, yOnePos} = this.scaleValues(values, minYZeroPos, padBottom, 100 - padTop);\n\n\t\tlet ShowXAxis = null;\n\t\tif ( props.showXAxis ) {\n\t\t\tShowXAxis = <XAxis padLeft={padLeft} padRight={padRight} height={xAxisHeight} yZeroPos={yZeroPos} />;\n\t\t}\n\t\tlet ShowYAxis = null;\n\t\tif ( props.showYAxis ) {\n\t\t\tShowYAxis = <YAxis yZeroPos={yZeroPos} yOnePos={yOnePos} xZeroPos={xZeroPos} padTop={padTop} padBottom={padBottom} width={yAxisWidth} showTicks={props.showYTicks} />;\n\t\t}\n\n\t\tlet barWidth = this.scale(1, xMaxValue, xZeroPos, 100 - padRight) - xZeroPos;\n\n\t\tlet total = values.reduce((a, b) => (a + b), 0);\n\t\tlet percentages = values.map((x) => (Math.round((100 * (x / total)) * 100) / 100));\n\n\t\tlet Bars = [];\n\t\tlet Names = [];\n\t\tlet Colors = [];\n\n\t\tlet ShowLegend = null;\n\t\tfor ( let i = 0; i < values.length; i++ ) {\n\t\t\t// FIXME: This doesn't seem to do anything.\n\t\t\tif ( (valuesYPos[i] == yZeroPos) || isNaN(valuesYPos[i]) ) {\n\t\t\t\t//continue;\n\t\t\t}\n\n\t\t\tlet color = 1 + (i % 6);\n\t\t\tBars.push(<Bar valuePos={valuesYPos[i]} zero={yZeroPos} width={barWidth} left={this.scale(firstBarXStart + i, xMaxValue, xZeroPos, 100)} index={i} color={color} />);\n\n\t\t\tif ( !hideLegend ) {\n\t\t\t\tif ( use_percentages ) {\n\t\t\t\t\tNames.push(labels[i] +\" (\" + values[i] + \" : \" + percentages[i] + \"%)\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tNames.push(labels[i] +\" (\" + values[i] + \")\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tColors.push(color);\n\t\t}\n\t\tif ( !hideLegend ) {\n\t\t\tShowLegend = <Legend names={Names} colors={Colors} />;\n\t\t}\n\n\t\treturn (\n\t\t\t<div class=\"chart\">\n\t\t\t\t<div class=\"-bar\">\n\t\t\t\t\t<svg class=\"-svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\n\t\t\t\t\t\t<g transform=\"translate(0,100) scale(1,-1)\">\n\t\t\t\t\t\t\t{Bars}\n\t\t\t\t\t\t\t{ShowYAxis}\n\t\t\t\t\t\t\t{ShowXAxis}\n\t\t\t\t\t\t</g>\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t\t{ShowLegend}\n\t\t\t</div>\n\t\t);\n\t}", "function showBarChart() {\n var chartObj = buildBarChartObject();\n sendBarChartToDB(chartObj);\n $(\"#barchart_gate_values\").addClass(\"hidden_toggle\");\n $(\"#barchart_gate_chart\").removeClass(\"hidden_toggle\");\n showGateBarChart(chartObj);\n}", "function dosBars() {\n var barChart1 = document.querySelector('#dos-chart').getContext('2d');\n var dataChart = new Chart(barChart1).Bar(dosBar, {\n scaleBeginAtZero : true,\n scaleShowGridLines : true,\n scaleGridLineWidth : 1,\n scaleShowHorizontalLines: true,\n legendTemplate : \"<ul class=\\\"<%=name.toLowerCase()%>-legend\\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\\"background-color:<%=datasets[i].strokeColor%>\\\"></span><%if(datasets[i].label){%><%=datasets[i].labels%><%}%></li><%}%></ul>\"\n\n });\n //document.querySelector('#item3-6 #legend-container').innerHTML = dataChart.generateLegend();\n }", "function renderBarLineChart() {\n var elem = ctx.canvas;\n \n // Retrieving and calculating height ratio of Line Chart to the Bar Chart\n var heightRatio = parseFloat(elem.getAttribute(\"data-height-ratio\") || 1);\n var heightProportions = height / (heightRatio + 1);\n height = Math.round(heightProportions * heightRatio);\n var barChartHeight = Math.round(heightProportions);\n\n var defaultOpts = parseOptsWithStrings(elem, \"data-opts\") || {};\n \n // Line Chart Definition Override's\n sets = elem.getAttribute(\"data-line-sets\") !== null ? parseSets(elem.getAttribute(\"data-line-sets\")) : sets;\n opts = parseAttr(elem, \"data-line-opts\") !== null ? parseOptsPairs(parseAttr(elem, \"data-line-opts\") || []) : opts;\n colors = themes[opts.theme] || parseAttr(elem, \"data-line-colors\") || parseAttr(elem, \"data-colors\") || themes[defaultOpts.theme] || themes.basic;\n range = parseAttr(elem, \"data-line-range\") || parseAttr(elem, \"data-range\") || getRange(sets, isStacked());\n rotated = false;\n \n renderLineChart();\n \n // Drawing separator, line chart portion\n if(defaultOpts.separator && defaultOpts.separator || false)\n drawRect(defaultOpts.separatorStyle || '#000', 0, height, width, defaultOpts.separatorWidth && defaultOpts.separatorWidth/2 || 0.5);\n\n // Requesting separate context for Bar Portion\n ctx = ctx.canvas.getContext(\"2d\");\n ctx.translate(0, height);\n \n height = barChartHeight;\n\n // Line Chart Definition Override's\n sets = elem.getAttribute(\"data-bar-sets\") !== null ? parseSets(elem.getAttribute(\"data-bar-sets\")) : parseSets(elem.getAttribute(\"data-sets\"));\n opts = parseAttr(elem, \"data-bar-opts\") !== null ? parseOptsPairs(parseAttr(elem, \"data-bar-opts\") || []) : parseOpts(elem);\n colors = themes[opts.theme] || parseAttr(elem, \"data-bar-colors\") || parseAttr(elem, \"data-colors\") || themes[defaultOpts.theme] || themes.basic;\n range = parseAttr(elem, \"data-bar-range\") || parseAttr(elem, \"data-range\") || getRange(sets, isStacked());\n rotated = false;\n\n renderBarChart();\n\n // Drawing separator, line chart portion\n if(defaultOpts.separator && defaultOpts.separator || false)\n drawRect(defaultOpts.separatorStyle || '#000', 0, defaultOpts.separatorWidth && defaultOpts.separatorWidth/2 || 0.5, width, defaultOpts.separatorWidth && defaultOpts.separatorWidth/2);\n }", "function drawBarChart(data, options, element) {\n\n // adds default values to any options that were not specified by the user\n if (!(\"width\" in options)) {\n options.width = 500;\n }\n if (!(\"height\" in options)) {\n options.height = 300;\n }\n if (!(\"spacing\" in options)) {\n options.spacing = 5;\n }\n if (!(\"colour\" in options)) {\n options.colour = \"#008000\";\n }\n if (!(\"labelColour\" in options)) {\n options.labelColour = \"#FFFFFF\";\n }\n if (!(\"labelAlign\" in options)) {\n options.labelAlign = \"top\";\n }\n if (!(\"titleColour\" in options)) {\n options.titleColour = \"#000000\";\n }\n if (!(\"titleSize\" in options)) {\n options.titleSize = \"14\";\n }\n\n // extracts values from data\n var values = data.values;\n\n // draws a single bar chart if values is a list of numbers, or draws a stacked bar chart if values is a list of list of numbers\n if (typeof(values[0]) === typeof(1)) {\n singleBarChart(data, options, element);\n }else if (typeof(values[0]) === typeof([])) {\n stackedBarChart(data, options, element);\n drawLegend(data.legend, options, element);\n }\n\n // draws the labels on the X and Y axes and the chart title\n drawXlabels(data.labels, options, element);\n drawYlabels(data, options.height, element);\n drawTitle(data.title, options, element);\n}", "function drawBarChart(evt) {\n //this prevents from touch and click working simultaneously \n evt.preventDefault();\n context.clearRect(0, 0, WIDTH, HEIGHT);\n barChart();\n}", "function drawBars(target) {\n const bars = target\n .selectAll('.bar')\n .data(data)\n .enter()\n .append('rect')\n .attr('class', 'bar')\n .attr('x', d => x(d.description))\n .attr('y', d => y(d.capacity))\n .attr('width', x.bandwidth())\n .attr('height', d => height - y(d.capacity));\n }", "function drawBars(data, xScaleFn, yScaleFn) {\n select(\".chart-group\")\n .selectAll(\".bar\")\n .data(data)\n .join(\"rect\")\n .transition()\n .attr(\"class\", \"bar\")\n .attr(\"x\", d => xScaleFn(d.letter))\n .attr(\"y\", d => yScaleFn(d.frequency))\n .attr(\"width\", xScaleFn.bandwidth())\n .attr(\"height\", d => chartHeight - yScaleFn(d.frequency));\n }", "function singleBarChart(data, options, element) {\n\n // extracts needed information from data\n var values = data.values;\n var scale = data.scale;\n\n // extracts needed information from options\n var chartWidth = options.width;\n var chartHeight = options.height;\n var space = options.spacing;\n var colour = options.colour;\n var labelColour = options.labelColour;\n var labelAlign = options.labelAlign;\n\n // updates the size of the area the the chart is rendered into\n $(element).css({width: (chartWidth + 100) + \"px\", height: (chartHeight + 300) + \"px\"});\n\n // creates the chart area that the bars are rendered to\n var chartArea = $(\"<div>\").attr(\"id\", \"chartArea\");\n $(chartArea).css({width: chartWidth + \"px\", height: chartHeight + \"px\"});\n $(element).append(chartArea);\n\n // determines the maximum value to be displayed on the Y axis of the chart and the width of the bars to be displayed\n var maxY = findMaxY(values, scale);\n var barWidth = (chartWidth / values.length) - space;\n var barHeight;\n var i;\n\n for (i = 0; i < values.length; i++) {\n // creates a bar for each value in values\n var bar = $(\"<div>\").addClass(\"bar\");\n\n // determines the bar's height\n barHeight = values[i] / maxY * chartHeight;\n\n // updates the position, colours, and text displayed for the bar\n $(bar).css({width: barWidth + \"px\", height: barHeight + \"px\", marginLeft: (space + i * (barWidth + space)) + \"px\", top: (chartHeight - barHeight) + \"px\", background: colour, color: labelColour});\n $(bar).text(values[i]);\n\n // determines the position of the labels within the bar (\"top\", \"center\", or \"bottom\")\n if (barHeight < 16) {\n $(bar).text(\"\");\n } else if (labelAlign === \"center\") {\n $(bar).css({lineHeight: barHeight + \"px\"});\n } else if (labelAlign === \"bottom\") {\n $(bar).css({lineHeight: (2 * barHeight - 20) + \"px\"});\n } else {\n $(bar).css({lineHeight: 20 + \"px\"});\n }\n\n // appends the bar to the chart area\n $(chartArea).append(bar);\n }\n}", "function drawBarChart() {\n d3.select('#bars').selectAll('rect').remove();\n\t // majors for the x axis\n let xScale = d3.scaleBand()\n .domain(selectedMajors.map(x => x['data']['data']['Undergraduate Major']))\n .range([0, 400])\n\n\t // dollar amount for the y axis\n let yScale = d3.scaleLinear()\n .domain([0, 200000])\n .range([450, 0 ]);\n\n\t // align the axis\n let xAxis = d3.axisBottom(xScale);\n d3.select('#xAxis')\n .attr(\"transform\", `translate(${50}, ${475})`)\n .call(xAxis)\n .selectAll(\"text\")\n .attr(\"transform\", \"rotate(90)\")\n .attr(\"x\", 9)\n .attr(\"dy\", \"-.35em\")\n .style(\"text-anchor\", \"start\");\n\n\t // titles\n d3.select('#barChartSvg').append('text').attr('x', 0).attr('y', 10).text('Yearly Salary($)').style('font-size', '11').style('font-weight', 'bold')\n d3.select('#barChartSvg').append('text').attr('x', 440).attr('y', 495).text('Degree').style('font-size', '11').style('font-weight', 'bold')\n\n\t // align the y axis\n let yAxis = d3.axisLeft(yScale);\n d3.select('#yAxis')\n .attr(\"transform\", `translate(${50}, 25)`)\n .call(yAxis)\n .selectAll(\"text\");\n\n\t // g's for every gorup - starting, 10th, 25th, median, etc.\n let bars = d3.select('#bars');\n let g1 = bars.append('g');\n let g2 = bars.append('g');\n let g3 = bars.append('g');\n let g4 = bars.append('g');\n let g5 = bars.append('g');\n let g6 = bars.append('g');\n\n // display the starting median bars\n g1.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 50))\n .attr('x', (d,i) => 30 -1 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {return 450-yScale(d['data']['data']['Starting Median Salary']); }) // always equal to 0\n .attr(\"y\", function(d) { return 25 + yScale(d['data']['data']['Starting Median Salary']); })\n .append('title')\n .text((d) => `Starting Median Salary\\n${formatter.format(d['data']['data']['data']['Starting Median Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n // display the stacked mid career bars\n // let tenthbars = d3.select('#bars').selectAll('rect')\n g2.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 40))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-yScale(Number(d['data']['data']['data']['Mid-Career 10th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career 10th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career 10th Percentile\\n${formatter.format(d['data']['data']['data']['Mid-Career 10th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n\t // 25th percentile salaries\n g3.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 30))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-1-yScale(Number(d['data']['data']['data']['Mid-Career 25th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))-Number(d['data']['data']['data']['Mid-Career 10th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career 25th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career 25th Percentile\\n${formatter.format(d['data']['data']['data']['Mid-Career 25th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n\n\t // median salaries\n g4.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 20))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-1-yScale(Number(d['data']['data']['data']['Mid-Career Median Salary'].replace(/[^0-9.-]+/g,\"\"))-Number(d['data']['data']['data']['Mid-Career 25th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career Median Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career Median\\n${formatter.format(d['data']['data']['data']['Mid-Career Median Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n\n\t // 75th percentile\n g5.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), 10))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-1-yScale(Number(d['data']['data']['data']['Mid-Career 75th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))-Number(d['data']['data']['data']['Mid-Career Median Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career 75th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career 75th Percentile\\n${formatter.format(d['data']['data']['data']['Mid-Career 75th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n\n\n\t // 90th percentile bars\n g6.selectAll('rect')\n .data(selectedMajors).enter().append('rect')\n .attr('width', 20)\n .attr('fill', (d) => lightenDarkenColor(color(d['index']), -5))\n .attr('x', (d,i) => 50 + xScale.bandwidth()/2+ xScale.bandwidth()*i)\n .attr(\"height\", function(d) {\n return 450-1-yScale(Number(d['data']['data']['data']['Mid-Career 90th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))-Number(d['data']['data']['data']['Mid-Career 75th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); }) // always equal to 0\n .attr(\"y\", function(d) {return 25 + yScale(Number(d['data']['data']['data']['Mid-Career 90th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))); })\n .append('title')\n .text((d) => `Mid Career 90th Percentile\\n${formatter.format(d['data']['data']['data']['Mid-Career 90th Percentile Salary'].replace(/[^0-9.-]+/g,\"\"))}`)\n }", "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Country');\r\n data.addColumn('number', 'Population');\r\n data.addColumn('number', 'Area');\r\n data.addColumn('number', 'Occupancy');\r\n data.addRows([\r\n [cdata.name, cdata.population,cdata.area,(cdata.area/cdata.population)]\r\n \r\n \r\n ]);\r\n\r\n // Set chart options\r\n var options = {'title':'Population Area Ratio of '+cdata.name,\r\n 'width':250,\r\n 'height':300};\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.BarChart(document.getElementById('bc1'));\r\n chart.draw(data, options);\r\n }", "function bar(d) {\r\n\t\t var bar = svg.insert(\"svg:g\", \".y.barHierAxis\")\r\n\t\t .attr(\"class\", \"enter\")\r\n\t\t .attr(\"transform\",function(){if($.browser.msie){\t\t \t \t\t\t\t\t\t\t\t\t\r\n\t\t \t \t\t\t\t\t\t\t\tif(d.children.length * y*1.6 < h){\r\n\t\t \t \t\t\t\t\t\t\t\t\treturn \"translate(-10,5)\";\r\n\t\t \t \t\t\t\t\t\t\t\t}\r\n\t\t \t \t\t\t\t\t\t\t\telse{\r\n\t\t \t \t\t\t\t\t\t\t\t\t//show scroll, need re-adjust the position in IE9\r\n\t\t \t \t\t\t\t\t\t\t\t\treturn \"translate(-2,5)\";\r\n\t\t \t \t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t else{\r\n\t\t\t\t\t\t\t\t\t\t\t return \"translate(0,5)\"; \r\n\t\t\t\t\t\t\t\t\t\t }})\r\n\t\t .selectAll(\"g\")\r\n\t\t .data(d.children)\r\n\t\t .enter().append(\"svg:g\")\r\n\t\t .style(\"cursor\", function(d) { return !d.children ? null : \"pointer\"; })\t\t \r\n\t\t .on(\"click\", showDetail);\r\n\t\r\n\t\t bar.append(\"svg:text\")\r\n\t\t .attr(\"x\", -6)\r\n\t\t .attr(\"y\", y/2+1)\r\n\t\t .attr(\"dy\", \".35em\")\r\n\t\t .attr(\"text-anchor\", \"end\")\r\n\t\t .text(function(d) { \r\n\t\t \t \t /*for current font size and the whole txt width, the max character number is 20*/\r\n\t\t\t \t if(d.Name.length > 20){\r\n\t\t\t \t\t return d.Name.substr(0,18) + \"...\";\r\n\t\t\t \t }\r\n\t\t\t \t else{\r\n\t\t\t \t\t return d.Name; \r\n\t\t\t \t }\r\n\t\t \t\t});\r\n\t\r\n\t\t bar.append(\"svg:rect\")\r\n\t\t .attr(\"width\", function(d) { return x(value(d)); })\r\n\t\t .style(\"fill\", function(d) { return rs.view.getColorByVariancePercentage(d.VariancePercentage,d.Total); })\r\n\t\t .attr(\"height\", y);\r\n\r\n\t\t \t\r\n\t\t return bar;\r\n\t\t}", "function initBarCharts(dataIn){\n\n\t\n\n\tvar lhColStr = '<div class=\"sub-left-col-copy\"></div>'\n\t\n\t\n\tvar htmlStrGraphs = \"\";\n\n\t_.each(dataIn, function(item,i){\n\t\tvar topLineItem = getTopLineItem(item[0].scorer);\n\n\t\tvar topLineStats = topLineItem.goals+\" goals in \"+topLineItem.totalcaps+\" games.\"\n\t\tvar timeStats = getCareerLength(topLineItem)\n\n\t\tvar graphString = \"<div class='subContentBlock'><h4 class='subSectionHeading'>\"+item[0].firstname+\" \"+item[0].scorer+\"</h4><div class='graphStats'>\"+timeStats+\"<br/>\"+topLineStats+\"</div><div class='graph-wrapper'></div></div>\"; \n\t\thtmlStrGraphs+=graphString;\n\t})\n\n\t$( \"#graphsHolder\" ).html(htmlStrGraphs);\t\n\n\t\n\n\t// $(\".bar-chart-title\").each(function(i, e) {\n\t// \t$(e).attr(\"id\", \"bar-chart-title_\" +i);\n\t// });\n\n\t$(\".graph-wrapper\").each(function(i, e) {\n\t\t$(e).attr(\"id\", \"graph-wrapper_\" +i);\n\t});\n\n\tbuildBarGraphView();\n}", "function displayBarGraph(e,percentData,head,labelsData,colors)\n{\nlet myPieChrtForBatch = document.getElementById(e).getContext('2d');\n//global options\nvar ctx = $('#myPieChrtForBatch');\n ctx.height = 200;\nChart.defaults.global.defaultFontFamily = 'Open sans';\nChart.defaults.global.defaultFontSize = 14;\nChart.defaults.global.defaultFontColor = '#777';\n\nlet myPieChrtBatch = new Chart(myPieChrtForBatch, {\n type:'horizontalBar',\n data:{\n labels:labelsData,\n datasets:[{\n label:'In %',\n data:percentData,\n //backgroundColor:'green'\n backgroundColor:colors,\n borderWidth:2,\n borderColor:'#4e4e4e',\n hoverBorderWidth:1,\n hoverBorderColor:'#777'\n }]\n },\n options:{\n title:{\n display : true,\n text : head,\n fontSize:25\n },\n legend:{\n display:true,\n position:'right',\n labels:{\n fontColor:'#000'\n }\n },\n layouts:{\n padding:{\n left:50,\n right:0,\n bottum:0,\n top:0\n }\n },\n tooltips:{\n enabled:true\n }\n }\n\n\n});\n\n}", "function barchart(listValues) {\n\n // make rectangles for barchart\n var rects = svg.selectAll(\"rect\")\n .data(listValues)\n .enter()\n .append(\"rect\")\n rects.attr(\"x\", function(d, i) {\n return i * ((width - padding)/ listValues.length) + padding;\n })\n .attr(\"y\", function(d) {\n return scaleY(d);\n })\n .attr(\"width\", width / listValues.length - barPadding)\n .attr(\"height\", function(d) {\n return (height - scaleY(d) - padding);\n })\n .attr(\"fill\", function(d) {\n return \"rgb(0, 0, \" + (d * 0.027) + \")\";\n })\n\n // make barchart interactive\n .on('mouseout', function(d) {\n tooltip.style(\"display\", \"none\")\n d3.select(this).attr(\"fill\", function(d) {\n return \"rgb(0,0, \" + (d * 0.027) + \")\"\n });\n })\n .on('mousemove', function(d, i) {\n d3.select(this).attr(\"fill\", \"orange\")\n tooltip.style(\"display\", null);\n tooltip.select(\"text\").text(\"Value: \" + (d) +\n \" thousand toe\" + \", Year: \" + years[i]);\n });\n\n // make x and y axis\n var xAxis = d3.axisBottom(scaleX)\n var yAxis = d3.axisLeft(scaleY)\n\n // append ticks to x-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0,\" + (height - padding) + \")\")\n .call(xAxis);\n\n // append x-label\n svg.append(\"text\")\n .attr(\"class\", \"myLabel\")\n .attr(\"y\", height - 10)\n .attr(\"x\", width / 2)\n .attr('text-anchor', 'middle')\n .text(\"Years\");\n\n // append ticks to y-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + padding + \",0)\")\n .call(yAxis);\n\n // append y-label\n svg.append(\"text\")\n .attr(\"class\", \"myLabel\")\n .attr(\"y\", 10)\n .attr(\"x\", -150)\n .attr('transform', 'rotate(-90)')\n .attr('text-anchor', 'middle')\n .text(\"Values (in thousand toe)\")\n }", "function chartRender() {\n ctx = document.getElementById('myChart').getContext('2d');\n let myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: productsNames,\n datasets: [{\n label: '# of Votes',\n data: votesArr,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)'\n ],\n borderWidth: 1\n }, {\n label: '# of views',\n data: viewsArr,\n backgroundColor: [\n 'rgba(54, 162, 235, 0.2)'\n ],\n borderColor: [\n 'rgba(54, 162, 235, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n });\n}", "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Vaccines', 'Pfizer', 'Moderna', 'J&J', { role: 'annotation' } ],\n ['2020', 83, 17, 0, ''],\n ['2021', 38, 25, 37, '']\n ]);\n\n var options_fullStacked = {\n isStacked: 'Percent Used',\n height: 300,\n legend: {position: 'top', maxLines: 3},\n hAxis: {\n minValue: 0,\n ticks: [0, .3, .6, .9, 1]\n }\n };\n\n const chart = new google.visualization.BarChart(\n document.getElementById('chart-container'));\n chart.draw(data, options_fullStacked);\n}", "function initBarGenderView(BarData){\n google.charts.load('current', {packages: ['corechart', 'bar']});\n google.charts.setOnLoadCallback(drawChart);\n\n function drawChart() {\n var Bardata = new google.visualization.arrayToDataTable(BarData);\n\n var options = {\n height: 240,\n width:'100%',\n legend: {position: 'bottom'},\n backgroundColor:\"#FFF\",\n colors: ['#e66368', '#300204'],\n hAxis: {\n textStyle: {\n color: '#000'\n }\n },\n vAxis: {\n textStyle: {\n color: '#000'\n }\n },\n legend: {\n position: 'top'\n },\n titleTextStyle: {\n color: '#000'\n },\n chartArea: {\n left: \"17%\",\n top: \"10%\",\n right: \"10%\",\n bottom:\"10%\",\n height: \"94%\",\n width: \"94%\"\n }\n\n };\n\n var Barchart = new google.visualization.ColumnChart(document.getElementById('Gender_Charts'));\n\n Barchart.draw(Bardata, options);\n }\n}", "function render_histo_bars(nBin){\n\n\n d3.select('#ref-line').remove();\n d3.select('#ref-text').remove();\n d3.select('.d3-tip').remove();\n\n var chart = d3.select('svg').select('g');\n keyValueMapper = [];\n for(i=0;i<valuesX.length;i++){\n keyValueMapper[i] = {};\n keyValueMapper[i].key = valuesX[i]; \n keyValueMapper[i].value = valuesY[valuesX[i]];\n }\n\n // Color schema for the bars\n var colorSchema = d3.scaleOrdinal()\n .domain(valuesX)\n .range(d3.schemeSet3);\n\n var rectWidth;\n if(nBin == 1){\n // Width of a bar is maximum X value for nBin = 1\n rectWidth = Math.ceil(parseInt(enhanced_xscale(maximumX)));\n }\n else {\n // Width of a bar is the xScale value for nBin > 1\n rectWidth = Math.ceil(enhanced_xscale(valuesX[1]));\n }\n\n var x_bar_val = {};\n var nextVal = 0;\n for(i=0;i<valuesX.length;i++){\n x_bar_val[valuesX[i]] = nextVal;\n nextVal += rectWidth;\n }\n\n\n // Tip on the bar when hovered upon\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) { \n return \"<span style='color:\"+colorSchema(d.key)+\"'> Range - [\" + d.key + \", \" + (parseInt(d.key) + parseInt(bandwidth)) + \") <br> Frequency - \" + d.value + \"</span>\";\n })\n \n chart.call(tip);\n\n\n // Remove the existing bars\n d3.selectAll(\"rect\").remove();\n\n // Render the bars\n chart.selectAll()\n .data(keyValueMapper)\n .enter()\n .append('rect')\n .attr('x', (s) => enhanced_xscale(s.key)+margin)\n .attr('y', (s) => height)\n .attr('height', 0)\n .attr(\"opacity\", 0.8)\n .attr('width', rectWidth)\n .attr(\"fill\", (s) => colorSchema(s.key))\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .on('mouseenter', function (s, i) {\n d3.select(this).raise();\n\n // Increase width and make it higher\n d3.select(this)\n .transition()\n .duration(200)\n .attr('opacity', 1)\n .attr('x', (s) => enhanced_xscale(s.key) + margin -5)\n .attr('y', (s) => yScale(s.value))\n .attr('width', rectWidth + 10)\n .attr('height', (s) => height - yScale(s.value) + 10)\n .style(\"transform\", \"scale(1,0.979)\"); \n\n // Reference line for y values of rect \n d3.select('svg').select('g')\n .append('line')\n .attr('id','ref-line')\n .attr('x1', 0)\n .attr('y1', yScale(s.value))\n .attr('x2', width)\n .attr('y2', yScale(s.value))\n .attr('transform','translate('+margin+',0)')\n .attr(\"stroke-width\", 1)\n .attr(\"stroke\", \"red\");\n\n // Y value for hovered bar on the right\n d3.select('svg').select('g')\n .append('text')\n .attr('id','ref-text')\n .attr('x', width + margin + 5)\n .attr('y', yScale(s.value))\n .style('fill','white')\n .text(s.value);\n \n })\n .on('mouseleave', function (actual, i) {\n\n // Reset the bar width and height\n d3.select(this)\n .attr(\"opacity\", 0.8)\n .transition()\n .duration(200)\n .attr('x', (s) => enhanced_xscale(s.key) + margin)\n .attr('y', (s) => yScale(s.value))\n .attr('width',rectWidth)\n .attr('height', (s) => height - yScale(s.value))\n .style(\"transform\", \"scale(1,1)\");\n\n // Remove ref line\n d3.select('#ref-line').remove();\n d3.select('#ref-text').remove();\n \n })\n\n // Add transition when rendering the bars\n const t = d3.transition()\n .duration(axis_transition_time);\n\n chart.selectAll('rect')\n .transition(t)\n .attr('height', (s) => height - yScale(s.value))\n .attr('y', (s) => yScale(s.value));\n }", "function showBar() {\r\n\r\n\r\n\t$( document ).ready(function() {\r\n\r\n\tvar showData = $('#show-data');\r\n\t\r\n\tif (firstin){\r\n\t\tset_svg();\r\n\t\tfirstin = false;\r\n\t}\r\n\r\n\tvar x = d3.scaleBand().rangeRound([0, width]).padding(0.1),\r\n y = d3.scaleLinear().rangeRound([height, 0]);\r\n\r\n\r\nd3.tsv(\"data.tsv\", function(d) {\r\n d.frequency = +d.frequency;\r\n return d;\r\n}, function(error, data) {\r\n if (error) throw error;\r\n\r\n x.domain(data.map(function(d) { return d.letter; }));\r\n y.domain([0, d3.max(data, function(d) { return d.frequency; })]);\r\n\r\n\r\n//start here\r\n x_axis[chartCount] = group.append(\"g\")\r\n .attr(\"class\", function(){ return \"axis axis--x\"+chartCount;})\t\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(d3.axisBottom(x));\r\n\r\n y_axis[chartCount] = group.append(\"g\")\r\n .attr(\"class\", function(){ return \"axis axis--y\"+chartCount;})\r\n\t .call(d3.axisLeft(y).ticks(10, \"%\"))\r\n \t .append(\"text\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .attr(\"y\", 6)\r\n .attr(\"dy\", \"0.71em\")\r\n .attr(\"text-anchor\", \"end\")\r\n .text(\"Frequency\");\r\n\r\n bar[chartCount] = group.selectAll(\".bar\")\r\n .data(data)\r\n .enter().append(\"rect\")\r\n .attr(\"class\", function() { return \"bar\"+chartCount; })\r\n\t .style(\"fill\",\"steelblue\")\r\n .attr(\"x\", function(d) { return x(d.letter); })\r\n .attr(\"y\", function(d) { return y(d.frequency); })\r\n .attr(\"width\", x.bandwidth())\r\n.call(d3.drag()\r\n \t.on(\"start\", bardragstarted)\r\n \t.on(\"drag\", bardragged)\r\n \t.on(\"end\", bardragended))\r\n\r\n .attr(\"height\", function(d) { return height - y(d.frequency); });\r\n});\r\n\r\n\r\nchartCount++; \r\n\r\n\r\n\r\nfunction bardragged(d) {\t\r\n\t\r\n\tvar x = d3.event.x;\r\n\tvar y = d3.event.y;\r\n\tvar drag_x = \".axis--x\"+chartCount;\r\n\tvar drag_y = \".axis--y\"+chartCount;\r\n\tvar drag_bar = \".bar\"+chartCount;\r\n\r\n\td3.select(\"svg\").selectAll(drag_x)\t\t\r\n\t.attr('transform', 'translate(' + x + ',' + \t(y + height) + ')');\r\n\r\n\td3.select(\"svg\").selectAll(drag_y)\t\t\r\n\t.attr('transform', 'translate(' + x + ',' + \ty + ')');\r\n\r\n\td3.select(\"svg\").selectAll(drag_bar)\t\t\r\n\t.attr('transform', 'translate(' + x + ',' + \ty + ')');\r\n\t\r\n\t\r\n\r\n}\r\n\r\nfunction bardragstarted(d) {\r\n //alert(\"ended\");\r\n} \r\n\r\nfunction bardragended(d) {\r\n //alert(\"ended\");\r\n} \r\n\r\n\r\n\r\nshowData.empty();\r\n\r\n\r\n \t\r\n\r\n\t\r\n\r\n showData.text('Loading the JSON file.');\r\n });\r\n\r\n\r\n}", "function bar_load() {\n var barctx = document.getElementById(\"MyBar\").getContext('2d');\n var barchart = new Chart(barctx, {\n // The type of chart we want to create\n type: 'bar',\n data: {\n labels: dataset_global['state_district'],\n datasets: [{\n label: 'Total Population',\n backgroundColor: 'rgb(255, 99, 132)',\n borderColor: 'rgb(255, 99, 132)',\n data: totalpop,\n }]\n },\n\n // Configuration options go here\n options: {\n title: {\n\t\t\t\tdisplay: true,\n\t\t\t\ttext: \"Total Population by Congressional District\",\n\t\t\t\tfontsize: 14,\n\t\t\t},\n tooltips: {\n\t\t\t\tcallbacks: {\n\t\t\t\t label: function(tooltipItems, data) {\n\t\t\t\t\treturn data.datasets[0].data[tooltipItems.index].toLocaleString();;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t },\n responsive: true,\n maintainAspectRatio: true,\n legend: {\n position: 'right',\n display: true,\n },\n scales: {\n yAxes: [{\n position: 'left',\n ticks: {\n beginAtZero: true,\n callback: function (value, index, values) {\n return value.toLocaleString();\n }\n // minBarThickness: 500,\n // categoryPercentage:500,\n // barPercentage:500,\n\n }\n }]\n }\n }\n });\n}", "function drawBarChart(obj,container)\n{\n\tvar chart = Highcharts.chart(container, {\n title: {\n text: obj.title.text\n },\n subtitle:{\n text: obj.title.subtitle\n },\n tooltip: {\n pointFormat: '{series.name}: <b>{point.y:.1f}%</b>'\n },\n xAxis: {\n categories: obj.XAxis.categories\n },\n yAxis:{\n title: {text:'Percentage (%)'},\n max:100\n },\n series: [{\n type: 'column',\n colorByPoint: true,\n data: obj.barChartData.data,\n showInLegend: false\n }]\n\n});\n}", "function BarElement(label, value, x, y, width, height){\n ChartElement.call(this,label, value, x, y, width, height );\n \n}", "function DrawHorizontalBarChart() {\n let chartHeight = (1000/25) * values.length;\n\n\n new Chartist.Bar('#ct-chart-bar', {\n labels: labels,\n series: [values]\n }, {\n axisX: {\n offset: 20,\n position: 'end',\n labelOffset: {\n x: 0,\n y: 0,\n },\n showLabel: true,\n showGrid: true,\n labelInterpolationFnc: Chartist.noop,\n scaleMinSpace: 30,\n onlyInteger: false\n },\n axisY: {\n offset: 100,\n position: 'start',\n labelOffset: {\n x: 0,\n y: 0,\n },\n showLabel: true,\n showGrid: false,\n labelInterpolationFnc: Chartist.noop,\n scaleMinSpace: 30,\n onlyInteger: false\n },\n width: undefined,\n height: chartHeight,\n high: undefined,\n low: undefined,\n referenceValue: 0,\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n seriesBarDistance: 5,\n stackBars: false,\n stackMode: 'accumulate',\n horizontalBars: true,\n distributedSeries: false,\n reverseData: true,\n showGridBackground: false,\n }, {\n //Options\n }, [\n //ResponsiveOptions\n ]);\n}", "function barChartPlotter(e) {\n var ctx = e.drawingContext;\n var points = e.points;\n var y_bottom = e.dygraph.toDomYCoord(0);\n\n // This should really be based on the minimum gap\n var bar_width = 2/3 * (points[1].canvasx - points[0].canvasx);\n ctx.fillStyle = e.color;\n\n // Do the actual plotting.\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n var center_x = p.canvasx; // center of the bar\n ctx.fillRect(center_x - bar_width / 2, p.canvasy, bar_width, y_bottom - p.canvasy);\n ctx.strokeRect(center_x - bar_width / 2, p.canvasy, bar_width, y_bottom - p.canvasy);\n }\n }", "function barChart(bcData){\n var bC={}, \n bcSizes = {t: 60, r: 0, b: 30, l: 0};\n bcSizes.w = 500 - bcSizes.l - bcSizes.r, \n bcSizes.h = 300 - bcSizes.t - bcSizes.b;\n \n// create the svg for barChart inside the div\n// for the width, put .width + length + radius\n// for height. put height + \n var bCsvg = d3.select(id).append(\"svg\")\n .attr(\"class\", \"barChart\")\n .attr(\"width\", bcSizes.w + bcSizes.l + bcSizes.r)\n .attr(\"height\", bcSizes.h + bcSizes.t + bcSizes.b)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + bcSizes.l + \",\" + bcSizes.t + \")\");\n\n// for the x variable, use map to \n var x = d3.scaleBand()\n // .rangeRoundBands([0, bcSizes.w], 0.1)\n .range([0, bcSizes.w])\n .round(0.1)\n .domain(bcData.map(function(d) { \n return d[0]; \n }));\n\n // Add x-axis to the barChart svg.\n bCsvg.append(\"g\").attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + bcSizes.h + \")\")\n .call(d3.axisBottom(x));\n\n // Create function for y-axis map.\n var y = d3.scaleLinear().rangeRound([bcSizes.h, 0])\n .domain([0, d3.max(bcData, function(d) { return d[1]; })]);\n\n // Create bars for barChart to contain rectangles and sentiment labels.\n var bars = bCsvg.selectAll(\".bar\")\n .data(bcData)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"bar\");\n\n \n// create the bars\n// for x, use return x variable with (d[0]) to determine the location on x axis\n// for y, use function return the y variable width (d[1]) to determine the height (this is still undefined)\n// for the width, use x variable with rageband to use the same width\n// for height, use a function to return bcSizes.height - the height of the negative space due to (d[1])\n bars.append(\"rect\")\n .attr(\"x\", function(d) { \n return x(d[0]); \n })\n .attr(\"y\", function(d) { \n return y(d[1]); \n })\n .attr(\"width\", 40)\n .attr(\"height\", function(d) { \n return bcSizes.h - y(d[1]); \n })\n .attr('fill', \"#8DD4F4\")\n .on(\"mouseover\",mouseover)\n .on(\"mouseout\",mouseout);\n\n// another mouseover function, this time on the bar chart \n// store the selected year in a variable with a function\n// first, filter the year out of the data with a comparison\n// the mouseover year has to be true, all the others are false\n// return the comparison between s.year (selected year) and d[0] (the years) \n// after this function, add the [0] to refer to the sentiment in the data\n// then in another variable, store the selected year variable and sentiment in a new\n// object with .key and use .map to make an object with the selected year and sentiment\n function mouseover(d){ \n var selectedYear = myData.filter(function(s){ \n return s.year == d[0]\n ;})[0];\n var yearSentiment = d3\n .keys(selectedYear.sentiment)\n .map(function(s){ \n return {type:s, sentiment:selectedYear.sentiment[s]};\n });\n \n// call the functions that update the pie chart and legend, to connect this to the mouseover of bar chart\n// refer to the yearSentiment, becaue this new variable tells what data is selected \n pC.update(yearSentiment);\n leg.update(yearSentiment);\n }\n\n// in a function for mouseout, reset the pie chart and legend by refering to \n// the update function before the bar chart was touched \n function mouseout(d){ \n pC.update(updatePC);\n leg.update(updatePC);\n }\n \n// after the bar chart can alter the pie chart, now write a function to make\n// the pie chart update the bar chart\n// in the y domain, use yearSentiment to sort the sentiments in the years\n// and eliminate the bar height for other sentiments\n// give parameter color to change the color of the bars to the selected pie chart slice\n bC.update = function(yearSentiment, color){\n y.domain([0, d3.max(yearSentiment, function(d) { \n return d[1]; \n })]);\n \n// recreate the bars with the new data\n// only the data in the selected sentiment is added now\n var bars = bCsvg.selectAll(\".bar\")\n .data(yearSentiment);\n \n// with a transition, create the y, height, and color over again\n// this is a copy of the attributes as they were in the creation of the bars\n// only attribute fill is different, this refers to the parameter in this function\n bars.select(\"rect\").transition().duration(400)\n .attr(\"y\", function(d) {\n return y(d[1]); \n })\n .attr(\"height\", function(d) { \n return bcSizes.h - y(d[1]); \n })\n .attr(\"fill\", color);\n \n } \n\n// return the bar chart with the new data \n return bC;\n }", "drawBarChart() {\n this.recalculateSizes(); // calculate sizes before drawing\n\n // Remove existing bar chart svg\n d3.select(\"div.\" + this.barClass)\n .select(\"svg\")\n .remove();\n\n // Create new svg for the bar chart\n this.svg = d3\n .select(\"div.\" + this.barClass)\n .append(\"svg\")\n .attr(\"width\", this.width)\n .attr(\"height\", this.height); // alter this dynamically\n\n // Finding the maximum number of times a rule has been suggested.\n // Used to calculate bar width later\n this.maxSuggested = 0;\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i].num_suggested > this.maxSuggested) {\n this.maxSuggested = this.data[i].num_suggested;\n }\n }\n\n // Sorting data to display it in descending order\n this.data.sort((a, b) => (a.num_suggested < b.num_suggested ? 1 : -1));\n\n // Drawing the rectangles based on times the rule has been suggested\n this.svg\n .selectAll(\"rect.totalRect\")\n .data(this.data)\n .enter()\n .append(\"rect\")\n .attr(\"fill\", \"white\")\n .style(\"fill-opacity\", 1e-6)\n .attr(\"stroke\", \"black\")\n .attr(\"x\", this.width * 0.1)\n .attr(\"y\", (d, i) => {\n return i * this.barHeight * 2 + 50;\n })\n .attr(\"height\", this.barHeight)\n .attr(\"width\", d => (d.num_suggested / this.maxSuggested) * 0.8 * this.width)\n .attr(\"class\", \"totalRect\")\n .on(\"mouseover\", (d, i) => {\n // Shows more statistics when mousing over\n this.popUp(d, i);\n })\n .on(\"mouseout\", (d, i) => {\n // Removes the popup from mouseover\n this.clearPopUp(d, i);\n });\n\n // Drawing the rectanbles for number of times the rule has been accepted\n this.svg\n .selectAll(\"rect.acceptedRect\")\n .data(this.data)\n .enter()\n .append(\"rect\")\n .attr(\"fill\", \"green\")\n .attr(\"stroke\", \"black\")\n .attr(\"x\", this.width * 0.1)\n .attr(\"y\", (d, i) => {\n return i * this.barHeight * 2 + 50;\n })\n .attr(\"height\", this.barHeight)\n .attr(\"width\", d => (d.num_accepted / this.maxSuggested) * 0.8 * this.width)\n .attr(\"class\", \"acceptedRect\")\n .on(\"mouseover\", (d, i) => {\n // Shows more statistics when mousing over\n this.popUp(d, i);\n })\n .on(\"mouseout\", (d, i) => {\n // Removes the popup from mouseover\n this.clearPopUp(d, i);\n });\n\n // Drawing the rectangles for number of times the rule has been rejected\n this.svg\n .selectAll(\"rect.rejectedRect\")\n .data(this.data)\n .enter()\n .append(\"rect\")\n .attr(\"fill\", \"red\")\n .attr(\"stroke\", \"black\")\n .attr(\"x\", d => {\n // Starting where the accepted rectangle ends\n return this.width * 0.1 + (d.num_accepted / this.maxSuggested) * 0.8 * this.width;\n })\n .attr(\"y\", (d, i) => {\n return i * this.barHeight * 2 + 50;\n })\n .attr(\"height\", this.barHeight)\n .attr(\"width\", d => (d.num_rejected / this.maxSuggested) * 0.8 * this.width)\n .attr(\"class\", \"rejectedRect\")\n .on(\"mouseover\", (d, i) => {\n // Shows more statistics when mousing over\n this.popUp(d, i);\n })\n .on(\"mouseout\", (d, i) => {\n // Removes the popup from mouseover\n this.clearPopUp(d, i);\n });\n\n // Displaying information about the rule above each bar\n this.svg\n .selectAll(\"text.ruleText\")\n .data(this.data)\n .enter()\n .append(\"text\")\n .text(d => {\n // LHS -> RHS - confidence: 0.xx (2 decimal places)\n return d.lhs + \" \\u2192 \" + d.rhs + \" - confidence: \" + d.confidence.toFixed(2);\n })\n .attr(\"font-family\", this.fontType)\n .attr(\"font-size\", this.textSize)\n .attr(\"y\", (d, i) => {\n return i * this.barHeight * 2 + 45;\n })\n .attr(\"x\", this.width * 0.1)\n .attr(\"class\", \"ruleText\");\n\n // Displaying the number of times the rule has been suggested to the right of the bar\n this.svg\n .selectAll(\"text.numText\")\n .data(this.data)\n .enter()\n .append(\"text\")\n .text(d => d.num_suggested)\n .attr(\"font-family\", this.fontType)\n .attr(\"font-size\", this.textSize)\n .attr(\"y\", (d, i) => {\n return i * this.barHeight * 2 + 50 + (this.barHeight * 3) / 4;\n })\n .attr(\"x\", d => {\n return this.width * 0.1 + (d.num_suggested / this.maxSuggested) * 0.8 * this.width + 5;\n })\n .attr(\"class\", \"numText\");\n }", "function getBarChartOverView() {\n dailyTimeStatsData = [0, 0, 0, 0, 0, 0];\n dailyTimeStatsPercentData = [0, 0, 0, 0, 0, 0];\n\n var updateAllPercents = function () {\n for (var count = 0; count < dailyTimeStatsPercentData.length; count++) {\n dailyTimeStatsPercentData[count] = parseFloat((dailyTimeStatsData[count] / chartData.length) * 100).toFixed(0);\n }\n }\n for (var count = 0; count < chartData.length; count++) {\n var createdTime;\n var hourCreated;\n\n createdTime = chartData[count].created_time;\n hourCreated = createdTime.getHours();\n if ((hourCreated >= 0) && (hourCreated < 4)) {\n dailyTimeStatsData[0] += 1;\n }\n else if ((hourCreated >= 4) && (hourCreated < 8)) {\n dailyTimeStatsData[1] += 1;\n }\n else if ((hourCreated >= 8) && (hourCreated < 12)) {\n dailyTimeStatsData[2] += 1;\n }\n else if ((hourCreated >= 12) && (hourCreated < 16)) {\n dailyTimeStatsData[3] += 1;\n }\n else if ((hourCreated >= 16) && (hourCreated < 20)) {\n dailyTimeStatsData[4] += 1;\n }\n else if ((hourCreated >= 20) && (hourCreated < 24)) {\n dailyTimeStatsData[5] += 1;\n }\n }\n updateAllPercents();\n dailyStats.updateRectangles(dailyTimeStatsPercentData);\n }", "function drawBarGraph(sampleID) {\n\n // Verify drawBarGraph function has been called\n // console.log(`Draw bar graph plot(${sampleID}).`);\n\n // Read data and arrange for bar graph plotting\n d3.json(\"./data/samples.json\").then(data => {\n var samples = data.samples;\n var resultArray = samples.filter(s => s.id == sampleID);\n var result = resultArray[0];\n var otu_ids = result.otu_ids;\n var otu_labels = result.otu_labels;\n var sample_values = result.sample_values;\n\n // Define horizontal bar chart y labels\n yticks = otu_ids.slice(0, 10).map(otuId => `OTU ${otuId}`).reverse();\n\n // Define horizontal bar chart and x and y values\n var barData = {\n x: sample_values.slice(0, 10).reverse(),\n y: yticks,\n type: \"bar\",\n text: otu_labels.slice(0, 10).reverse(),\n orientation: \"h\"\n }\n\n // Declare variable to store object data\n var barArray = [barData];\n\n // Define horizontal bar chart layout and title\n var barLayout = {\n title: \"Top 10 Bacteria Cultures Found\",\n margin: {t: 30, l: 150}\n }\n\n // Make plot responsive within Bootstrap container\n var config = {responsive: true}\n\n // Plot horizontal bar chart\n Plotly.newPlot(\"bar\", barArray, barLayout, config);\n\n });\n\n}", "function createBars(data, options) {\n // Calculating bar width given the spacing of the bars\n var numberOfBars = data.length;\n var xAxisLength = $(\"#chartarea\").width();\n var barWidth = (xAxisLength - ((numberOfBars + 1) * parseInt(options.barspacing)))/numberOfBars;\n barWidth = Math.floor(barWidth);\n var yScale = yAxis(data, options)[1];\n var barHeight;\n var barColour;\n var barStartPosition;\n\n //for loop that creates the bars for each of the data\n for (var i = 0; i < data.length; i++) {\n barStartPosition = 0;\n //Calculate x offset from y axis\n var xOffset = (i * barWidth) + ((i + 1) * parseInt(options.barspacing));\n var barId = \"bar\" + i;\n for ( var j = 0; j < data[i].length; j++) {\n barId = barId + j;\n barHeight = data[i][j] * yScale;\n drawBar(data, options, barId, xOffset, barHeight, barWidth, options.barcolour[j], barStartPosition, i, j);\n barStartPosition += barHeight;\n if(j === 0) {\n xAxisLabels(options.datalabels[i], barId);\n }\n }\n\n }\n\n // sets CSS formatting options for all bars, data and labels\n $(\".bar\").css({\n \"width\": barWidth,\n \"margin\": 0,\n \"padding\": 0,\n \"border\": 0\n });\n\n // formats the x labels in the color defined in options\n $(\".xaxislabels\").css({\"color\": options.datalabelcolor,\n \"top\": \"100%\",\n \"padding\": \"5%\"\n });\n\n $(\".xaxislabels, .xaxisdata\").css({ \"border\": \"0\",\n \"margin-bottom\": \"2%\",\n \"margin-top\": \"2%\",\n \"padding\": \"0\",\n \"position\": \"absolute\",\n \"text-align\": \"center\",\n \"width\": \"100%\",\n \"font-size\": \"small\"\n })\n}", "function createBarChart(container, data, graphColor, formatComma) {\r\n\r\n var margin = { top: 20, right: 30, bottom: 40, left: 90 };\r\n var axis_margin = 90\r\n\r\n var x = d3.scaleLinear()\r\n .domain([0, d3.max(data, d => d.n)])\r\n .range([0, 0.65 * container.attr('width')]);\r\n\r\n var y = d3.scaleBand()\r\n .range([20, container.attr('height')])\r\n .domain(data.map(d => d.nameCat))\r\n .padding(0.2)\r\n\r\n container.append(\"g\")\r\n .call(d3.axisLeft(y))\r\n .attr(\"transform\", \"translate(\" + axis_margin + \",\" + 0 + \")\")\r\n .attr(\"font-weight\", \"normal\")\r\n\r\n container.selectAll(\"myRect\")\r\n .data(data)\r\n .enter()\r\n .append(\"rect\")\r\n .attr(\"x\", x(0) + axis_margin)\r\n .attr(\"y\", d => y(d.nameCat))\r\n .transition()\r\n .duration(800)\r\n .attr(\"width\", d => x(d.n))\r\n .attr(\"height\", y.bandwidth())\r\n .attr(\"fill\", graphColor)\r\n\r\n // Adds the numbers at the end of the bars\r\n container.selectAll(\"rectText\")\r\n .data(data)\r\n .enter()\r\n .append('text')\r\n .text(d => formatComma(d.n))\r\n .attr(\"x\", d => x(0) + 100)\r\n .attr(\"y\", d => y(d.nameCat) + y.bandwidth() - 0.5)\r\n .transition()\r\n .duration(800)\r\n .attr(\"x\", d => x(d.n) + axis_margin + 8)\r\n .attr(\"y\", d => y(d.nameCat) + y.bandwidth() - 0.5)\r\n\r\n .attr(\"font-size\", 10)\r\n .attr(\"font-weight\", \"normal\")\r\n .attr(\"text-anchor\", \"start\")\r\n\r\n}", "function drawBarData(request) {\n $.getJSON('/charts/api/get_bar_data/', request, function(data) {\n console.log(data);\n if (!data.error) {\n data = transformBarData(data.data);\n drawBarChart(data);\n } else {\n alert(data.error);\n }\n });\n}", "function drawBarChart(data, ctx, can) {\n if (clear) ctx.clearRect(0, 0, can.width, can.height);\n var y, tx, ty, metrics, words, line, testLine, testWidth;\n var dataName = data.name;\n var dataValue = data.value;\n var colHead = 50;\n var rowHead = 30;\n var margin = 10;\n var maxVal = Math.ceil(Math.max.apply(Math, dataValue)/5) * 5;\n var stepSize = 5;\n var yScalar = (can.height - colHead - margin) / (maxVal);\n var xScalar = (can.width - rowHead) / (dataName.length + 1);\n ctx.lineWidth = 0.5;\n ctx.strokeStyle = \"rgba(128,128,255, 0.5)\"; // light blue line\n ctx.beginPath();\n // print row header and draw horizontal grid lines\n ctx.font = \"10pt Open Sans\"\n var count = 0;\n for (scale = maxVal; scale >= 0; scale -= stepSize) {\n y = colHead + (yScalar * count * stepSize);\n ctx.fillText(scale, margin,y + margin);\n ctx.moveTo(rowHead, y + margin - 1)\n ctx.lineTo(can.width, y + margin -1)\n count++;\n }\n ctx.stroke();\n ctx.save();\n // set a color\n ctx.fillStyle = \"rgba(151,187,205,1)\";\n // translate to bottom of graph and scale x,y to match data\n ctx.translate(0, can.height - margin);\n ctx.scale(xScalar, -1 * yScalar);\n // draw bars\n for (i = 0; i < dataName.length; i++) {\n ctx.fillRect(i + 1, -2, 0.5, dataValue[i]);\n }\n ctx.restore();\n \n // label samples\n ctx.font = \"8pt Open Sans\";\n ctx.textAlign = \"center\";\n for (i = 0; i < dataName.length; i++) {\n calcY(dataValue[i]);\n ty = y - margin - 5;\n tx = xScalar * (i + 1) + 14;\n words = dataName[i].split(' ');\n line = '';\n for(var n = 0; n < words.length; n++) {\n testLine = line + words[n] + ' ';\n metrics = ctx.measureText(testLine);\n testWidth = metrics.width;\n if (testWidth > 20 && n > 0) {\n ctx.fillText(line, tx, ty - 8);\n line = words[n] + ' ';\n }\n else {\n line = testLine;\n }\n }\n ctx.fillText(line, tx, ty + 8);\n }\n function calcY(value) {\n y = can.height - value * yScalar;\n } \n}", "function draw(mindata, maxy, align) {\n var svg = d3.select('#graph svg');\n var height = $('#graph svg').height();\n var barheight_factor = height*0.9/maxy;\n svg.selectAll('rect.'+align)\n .data(data)\n .enter()\n .append('rect').attr('class', align)\n // y labels\n svg.selectAll('text.y'+align)\n .data(data)\n .enter()\n .append('text').attr('class', 'y'+align)\n // x axis\n svg.selectAll('text.x')\n .data(data)\n .enter()\n .append('text').attr('class', 'x');\n barGraph(svg, mindata, align, barheight_factor);\n }", "function drawChart() {\n\t\n\t// Create the data table.\n\t// 테이블 column, row 생성 및 설정\n\tvar data = new google.visualization.arrayToDataTable([\n\t\t['', 'stars', 'remain', {role: 'none'}],\n\t\t['', stars, remain, '']\n\t]);\n\t\n\t// chart 옵션 설정\n\tvar options = {\n\t\tlegend: 'none',\n\t hAxis: {\n\t \tbaseline: 0,\n\t \tbaselineColor: 'white',\n\t minValue: 0,\n\t maxValue: maxValue,\n\t viewWindow: {\n\t \tmin: 0,\n\t \tmax: maxValue,\n\t },\n\t ticks: [0],\n\t textPosition: 'none',\n },\n\t vAxis:{\n\t \tgridlines: {\n\t \t\tcolor: '#ffffff'\n\t \t},\n\t },\n\t chartArea:{left:0,top:0,width:'100%',height:'100%'},\n\t colors: [color, '#dddcdc'],\n\t fontSize: 0,\n\t isStacked: true,\n\t tooltip: {\n\t \ttrigger: 'none'\n\t },\n\t enableInteractivity: false,\n\t animation: {\n\t \tduration: 1000,\n\t \teasing: 'out',\n\t \tstartup: true\n\t }\n\t};\n\t\n\t// 테이블 생성 -> 화면\n\tvar table = new google.visualization.BarChart(document.getElementById('chart'));\n table.draw(data, options);\n}", "function drawBarChart(data,container)\n{\n\tHighcharts.chart(container, {\n title: {\n text: data.title.text\n },\n tooltip: {\n pointFormat: '{series.name}: <b>{point.y}</b>'\n },\n xAxis: {\n categories: data.XAxis.categories\n },\n yAxis:{\n title: {text:'Percentage (%)'},\n max:100\n },\n labels: {\n items: [{\n html: data.piChart.html,\n style: {\n left: '60px',\n top: '0px',\n color: ( // theme\n Highcharts.defaultOptions.title.style &&\n Highcharts.defaultOptions.title.style.color\n ) || 'black'\n }\n }]\n },\n series: [{\n type: 'column',\n name: 'Male',\n data: data.barChartData.maleData\n }, {\n type: 'column',\n name: 'Female',\n data: data.barChartData.femaleData\n }, {\n type: 'column',\n name: 'Other',\n data: data.barChartData.otherData\n }, \n {\n type: 'pie',\n name: data.piChart.html,\n data: [{\n name: 'Male',\n y: data.piChart.participantCount.male,\n color: Highcharts.getOptions().colors[0] // Jane's color\n }, {\n name: 'Female',\n y: data.piChart.participantCount.female,\n color: Highcharts.getOptions().colors[1] // John's color\n }, {\n name: 'Other',\n y: data.piChart.participantCount.other,\n color: Highcharts.getOptions().colors[2] // Joe's color\n }],\n center: [90, 25],\n size: 60,\n showInLegend: false,\n dataLabels: {\n enabled: false\n }\n }]\n});\n}", "function bar(d) {\n var bar = svg.insert(\"g\", \".y.axis\")\n .attr(\"class\", \"enter\")\n .attr(\"transform\", \"translate(0,5)\")\n .selectAll(\"g\")\n .data(d.children)\n .enter().append(\"g\")\n .style(\"cursor\", function (d) {\n return !d.children ? null : \"pointer\";\n })\n .on(\"click\", downstep);\n // .append('title') // Tooltip\n // .text(function (d) {\n // return 'No of games won by '+d.key + ' is ' + d.value + ' for ' +group\n // });\n\n\n bar.append(\"text\")\n .attr(\"y\", barHeight / 2)\n .style(\"text-anchor\", \"end\")\n .attr(\"dy\", \".35em\")\n .attr(\"x\", -6)\n .text(function (d) {\n return d.name;\n });\n\n bar.append(\"rect\")\n .attr(\"height\", barHeight)\n .attr(\"width\", function (d) {\n return x(d.value);\n });\n\n return bar;\n}", "function buildCharts() {\n var myChart = Highcharts.chart('barChart', {\n chart: {\n type: 'column'\n },\n title: {\n text: 'So You Think <em> Your </em> Airport Is Crowded?'\n },\n subtitle: {\n text: 'Source: CIA World Factbook'\n },\n xAxis: {\n categories: xCat\n },\n yAxis: {\n title: {\n text: 'Number of People for Every One Airport'\n }\n },\n series: [{\n name: 'Number of People at Every Airport',\n data: numAirports\n }]\n }); //end of Highcharts.chart\n }", "function barChart1() {\n var barChart1 = document.querySelector('#bar-chart1').getContext('2d');\n var dataChart = new Chart(barChart1).Bar(dataBar, {\n scaleBeginAtZero : true,\n scaleShowGridLines : true,\n scaleGridLineWidth : 1,\n scaleShowHorizontalLines: true,\n legendTemplate : \"<ul class=\\\"<%=name.toLowerCase()%>-legend\\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\\"background-color:<%=datasets[i].strokeColor%>\\\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>\"\n\n });\n document.querySelector('#interr #legend-container').innerHTML = dataChart.generateLegend();\n }", "function stackedBarChart(data, options, element) {\n\n // extracts needed information from data\n var values = data.values;\n var scale = data.scale;\n var legend = data.legend;\n\n // extracts needed information from options\n var chartWidth = options.width;\n var chartHeight = options.height;\n var space = options.spacing;\n var labelColour = options.labelColour;\n var labelAlign = options.labelAlign;\n\n // updates the size of the area the the chart is rendered into\n $(element).css({width: (chartWidth + 300) + \"px\", height: (chartHeight + 300) + \"px\"});\n\n // creates the chart area that the bars are rendered to\n var chartArea = $(\"<div>\").attr(\"id\", \"chartArea\");\n $(chartArea).css({width: chartWidth + \"px\", height: chartHeight + \"px\"});\n $(element).append(chartArea);\n\n // determines the maximum value to be displayed on the Y axis of the chart and the width of the bars to be displayed\n var maxY = findMaxY(values, scale);\n var barWidth = (chartWidth / values.length) - space;\n var barHeight;\n var i;\n var j;\n\n for (i = 0; i < values.length; i++) {\n // stackHeight keeps track of the current height of each stack\n var stackHeight = 0;\n\n for (j = 0; j < values[i].length; j++) {\n // creates a bar for each value in each array of values\n var bar = $(\"<div>\").addClass(\"bar\");\n\n // determines the bar's height\n barHeight = values[i][j] / maxY * chartHeight;\n\n // updates the position, colours, and text displayed for the bar\n $(bar).css({width: barWidth + \"px\", height: barHeight + \"px\", marginLeft: (space + i * (barWidth + space)) + \"px\", top: (chartHeight - barHeight - stackHeight) + \"px\", background: legend[j][1], color: labelColour});\n $(bar).text(values[i][j]);\n\n // determines the position of the labels within the bar (\"top\", \"center\", or \"bottom\")\n if (barHeight < 16) {\n $(bar).text(\"\");\n } else if (labelAlign === \"center\") {\n $(bar).css({lineHeight: barHeight + \"px\"});\n } else if (labelAlign === \"bottom\") {\n $(bar).css({lineHeight: (2 * barHeight - 20) + \"px\"});\n } else {\n $(bar).css({lineHeight: 20 + \"px\"});\n }\n\n // increases the height of the stack by the height of the current bar\n stackHeight += barHeight;\n\n // appends the bar to the chart area\n $(chartArea).append(bar);\n }\n }\n}", "function plotdata(chartdata) {\n let chartformat = {};\n chartformat.type = 'bar';\n chartformat.data = chartdata;\n chartdata.datasets[0].label = 'Total games';\n\n let options = chartformat.options = {}; \n options.title = {};\n options.title.display = true;\n options.title.text = 'Total produced games between 1980 - 2015';\n options.title.fontSize = 24;\n options.title.fontColor = '#ff0000'\n\n new Chart($('#barChart'), chartformat, options );\n}", "function drawChart() {\n\n // Crea la grafica a partir de la tabla\n var data = google.visualization.arrayToDataTable([\n ['Actividades', 'Actividades Esperadas', 'Actividades Presentes'],\n ['1', 33, 40],\n ['2', 117, 96],\n ['3', 166, 210],\n ['4', 117, 66],\n ['5', 66, 21],\n ['6', 33, 40],\n ['7', 117, 96],\n ['8', 150, 190],\n ['9', 103, 50],\n ['10', 200, 210]\n ]);\n\n // Opciones de la grafica\n var options = {\n chart: {\n title: 'Porcentaje de avance',\n subtitle: 'Cantidad',\n },\n bars: 'vertical',\n vAxis: {\n format: 'decimal'\n },\n height: 400,\n width: 1000,\n colors: ['#ffac19', '#63a537']\n };\n\n // Instancia de la grafica a nivel del html para dibujarla\n var chart = new google.charts.Bar(document.getElementById('chart_div'));\n chart.draw(data, google.charts.Bar.convertOptions(options));\n }", "function createBar(){\n\t\t\n\t\t/*get the # of values in the clicked dataset*/\n\t\tvalueCount = clickedData.map(d=>d.value).length;\n\n\t\t/*define margins around extra chart area*/\n\t\tvar margin_extraChart = {\n\t\t top: 60 * screenRatio,\n\t\t right: 90 * screenRatio,\n\t\t bottom: 100 * screenRatio,\n\t\t left: 100 * screenRatio\n\t\t};\n\n\t\t/*calculate extra chart area dimensions*/\n\t\tvar width_extraChart = svgWidth_extraChart - margin_extraChart.left - margin_extraChart.right;\n\t\tvar height_extraChart = svgHeight_extraChart - margin_extraChart.top - margin_extraChart.bottom;\n\n\t\t/*create the SVG container and set the origin point of extra chart*/\n\t\tvar svg_extraChart = d3.select(\"#extraChartSection\").append(\"svg\")\n\t\t .attr(\"id\",\"barChart\")\n\t\t .attr(\"width\", svgWidth_extraChart)\n\t\t .attr(\"height\", svgHeight_extraChart);\n\n\t\tvar extraChartGroup = svg_extraChart.append(\"g\")\n\t\t .attr(\"transform\", `translate(${margin_extraChart.left}, ${margin_extraChart.top})`)\n\t\t .attr(\"class\",\"extraChart\"); \n\n\t\t/*add titles to the extra chart area*/\n\t\tvar extraTitle = svg_extraChart.append(\"g\").append(\"text\")\n\t\t .attr(\"class\", \"extra title\")\n\t\t .attr(\"text-anchor\", \"middle\")\n\t\t .attr(\"x\", (width_extraChart + margin_extraChart.left) / 2 + 50 * screenRatio)\n\t\t .attr(\"y\", 20 * screenRatio)\n\t\t .style(\"font-weight\", \"bold\")\n\t\t .style(\"font-size\", 20 * screenRatio + \"px\")\n\t\t .text(\"Breakdown of Violent Crimes\");\n\n\t\tvar extraTitle = svg_extraChart.append(\"g\").append(\"text\")\n\t\t .attr(\"class\", \"extra title\")\n\t\t .attr(\"text-anchor\", \"middle\")\n\t\t .attr(\"x\", (width_extraChart + margin_extraChart.left) / 2 + 50 * screenRatio)\n\t\t .attr(\"y\", 40 * screenRatio)\n\t\t .style(\"font-weight\", \"bold\")\n\t\t .style(\"font-size\", 16 * screenRatio + \"px\")\n\t\t .text(`${clickedState}, Year ${clickedYear}`);\n\t\t\t \n\t\t\n\n\n\t\t/*configure a band scale for the y axis with a padding of 0.1 (10%)*/\n\t\tvar yBandScale_extraChart = d3.scaleBand()\n\t\t\t.domain(clickedData.map(d => d.type).reverse())\n\t\t\t.range([height_extraChart,0])\n\t\t\t.paddingInner(0.01);\n\n\n\t\t/*create a linear scale for the x axis*/\n\t\tvar xLinearScale_extraChart = d3.scaleLinear()\n\t\t\t.domain([0, d3.max(clickedData.map(d => d.value))])\n\t\t\t.range([0,width_extraChart]);\n\n\t\t/*add y axis*/\n\t\tvar leftAxis_extraChart = d3.axisLeft(yBandScale_extraChart);\n\n\t\t/*assign data to donut(pie) chart*/\n\t\tvar pie = d3.pie()\n\t .value(d => d.value)\n\n\t /*define arc to create the donut chart*/\n\t var arc = d3.arc()\n\t \t.cornerRadius(3)\n\n\t\t/*create color scale for extra charts */\n\t\tvar colorScale_extraChart = d3.scaleOrdinal()\n\t\t\t.range([\"#98abc5\", \"#7b6888\", \"#a05d56\", \"#ff8c00\"]);\n\n\t\t/*bind data to bars*/\n\t\tvar bars = extraChartGroup.selectAll(\".barGroup\")\n\t\t .data(function() {\n\t return pie(clickedData);\n\t \t})\n\t\t .enter()\n\t\t .append(\"g\")\n\t\t .attr(\"class\", \"barGroup\");\n\n\t\t/*create bars*/\n\t\tbars.append(\"rect\")\n\t\t .attr(\"width\", 0)\n\t\t .attr(\"height\", yBandScale_extraChart.bandwidth())\n\t\t .attr(\"x\", 0)\n\t\t .attr(\"y\", function(data,index) {\t\t \n\t\t \treturn index * (yBandScale_extraChart.bandwidth() + 1);\n\t\t \t})\n\t\t .attr(\"rx\",5)\n\t\t .attr(\"yx\",5)\n\t\t .style(\"fill\",function(d) {\n\t\t return colorScale_extraChart(d.data.type);\n\t\t })\n\t\t .attr(\"class\",\"bar\")\n\t\t .on(\"mouseover\", function() {highlight(d3.select(this))} )\n\t\t .on(\"mouseout\", function() {unhighlight(d3.select(this))} )\n\t\t .transition()\n\t\t \t.duration(500)\n\t\t \t.attr(\"width\", d => xLinearScale_extraChart(d.data.value))\n\n\t\t/*add the path of the bars and use it to draw donut chart*/\n\t\textraChartGroup.selectAll(\".barGroup\")\n\t\t\t.append(\"path\")\n\t .style(\"fill\",function(d) {\n\t\t return colorScale_extraChart(d.data.type);\n\t\t })\n\n\t\taddBarAxis();\n\n\t\t/*define a function to add y axis to the bar chart*/\n\t\tfunction addBarAxis () {\n\t\t\textraChartGroup.append(\"g\")\n\t\t\t .attr(\"class\", \"barYAxis\")\n\t\t\t .style(\"font-size\", 13 * screenRatio + \"px\")\n\t\t\t .call(leftAxis_extraChart);\n\t\t}\n\t\t\t\n\t\t/*show bar values half second later after the bars are created*/\n\t\tsetTimeout(addBarValues, 500);\n\n\t\t/*define a function to add values to the bar chart*/\n\t\tfunction addBarValues () {\n\t\t\textraChartGroup.append(\"g\").selectAll(\"text\")\n\t\t\t .data(clickedData)\n\t\t\t .enter()\n\t\t\t .append(\"text\")\n\t\t \t\t .attr(\"class\",\"barValues\")\n\t\t\t \t .style(\"font-size\", 11 * screenRatio + \"px\")\n\t\t\t \t .attr(\"x\",d => xLinearScale_extraChart(d.value) + 5)\n\t\t\t \t .attr(\"y\",function(data,index) {\n\t\t\t\t\t return index * height_extraChart / valueCount + 5 + yBandScale_extraChart.bandwidth() / 2;\n\t\t\t\t\t })\n\t\t\t \t .text(d=>d.value + \" per 100K\")\n\t\t}\n\t\t\t\n\t\t/*define a function to switch to donut(pie) chart when the Pie button is clicked*/\n\t\tfunction toPie() {\n\t\t\t/*remove bar chart if it exists*/\n\t\t\tif (document.querySelector(\"#barChart\")) {\n\t\t\t\td3.selectAll(\".bar\").remove();\n\t\t\t\td3.selectAll(\".barYAxis\").remove();\n\t\t\t\td3.selectAll(\".barValues\").remove();\n\t\t\t\t\n\t\t\t\t/*use the bar chart's path to start the transition to donut(pie) chart*/\n\t\t\t\textraChartGroup.selectAll(\"path\")\n\t\t\t .transition()\n\t\t\t .duration(500)\n\t\t\t .tween(\"arc\", arcTween);\n\n\t\t\t /*\n\t\t\t define the function used to do tween on arc.\n\t\t\t \n\t\t\t credits to https://bl.ocks.org/LiangGou/30e9af0d54e1d5287199, codes have been modified.\n\n\t\t\t the idea here is to first draw an arc like a bar,\n\t\t\t then tween the bar-like arc to the donut arc. \n\t\t\t\tThus, the key is to find the initial bar size and position:\n\t\t\t\tThe initial bar width is approximated by the length of \n\t\t\t\toutside arc: barWidth = OuterRadius * startAngle. \n\t\t\t\tSo we can get the startAngle shown in arcArguments below;\n\t\t\t\t(Note that: the measure of angle in d3 starts from vertical y:\n\t\t\t\t y angle\n\t\t\t\t | / \n\t\t\t\t | / \n\t\t\t\t | / \n\t\t\t\t |o/\n\t\t\t\t |/ \n\t\t\t\t ) \n\n\t\t\t\t*/\n\t\t\t function arcTween(d) {\t\t\t \n\t\t\t /*define the path of each tween*/\n\t\t\t var path = d3.select(this);\n\t\t\t /*get the starting y position of each bar*/\n\t\t\t var y0 = d.index * yBandScale_extraChart.bandwidth();\n\t\t\t \n\t\t\t return function(t) {\n\t\t\t /*t starts from 0 and ends with 1. Use cosine to calculate a, a stepping factor that changes from 1 to 0*/\n\t\t\t var a = Math.cos(t * Math.PI / 2);\n\t\t\t /*define radius r as a function of chart height. at the beginning, t is 0 so r is very big, which can render \n\t\t\t the arc like a bar. when t changes to 1, r is reduced to chart height or 1/2 of height based on device screen size*/\n\t\t\t var r = (1 + a) * height_extraChart / (windowWidth > 992? 1 : 2) / Math.min(1, t + .005);\n\t\t\t /*define xx and yy as the central position of arc, and xx and yy change with stepping factor a, until it becomes\n\t\t\t (1/2 of width, height)*/\n\t\t\t var yy = r + a * y0;\n\t\t\t var xx = ((1 - a) * width_extraChart / 2);\n\t\t\t \n\t\t\t /*define arguments used to create arc*/\n\t\t\t var arcArguments = {\n\t\t\t /*inially the delta between inner and outer radius is the bandwidth or height of bar */\n\t\t\t innerRadius: (1-a) * r * .5 + a * (r - yBandScale_extraChart.bandwidth()),\n\t\t\t outerRadius: r,\n\t\t\t /*start and end angle come from d3.pie() created earlier when data was bound to bars, and keeps changing \n\t\t\t with stepping factor a*/\n\t\t\t startAngle: (1 - a) * d.startAngle,\n\t\t\t endAngle: a * (Math.PI / 2) + (1 - a) * d.endAngle\n\t\t\t };\n\n\t\t\t /*shift the central locations of the arc and generate the arc*/\n\t\t\t path.attr(\"transform\", `translate(${xx},${yy})`);\n\t\t\t console.log(xx,yy,r);\n\t\t\t path.attr(\"d\", arc(arcArguments));\n\t\t\t \n\t\t\t /*create events on the path*/\n\t\t\t path.on(\"mouseover\",showSliceInfo);\n\t\t\t path.on(\"mouseout\",hideSliceInfo);\n\n\t\t\t\t\t /*define a function to highlight and display info of each bar or slice of donut chart when moused over*/\n\t\t\t\t\t function showSliceInfo() {\n\t\t\t\t\t\t\t/*for donut/pie chart, highlight the selection and show relevant info*/\n\t\t\t\t\t\t\tconsole.log(\"check\",xx,yy,r);\n\t\t\t\t\t\t\tif(document.querySelector(\"#pieChart\")) {\n\t\t\t\t\t\t\t\tvar slice = d3.select(this)\n\t\t\t\t\t\t\t\t\t.attr(\"stroke\",\"#fff\")\n\t\t \t\t\t\t.attr(\"stroke-width\",\"2px\");\n\t\t\t\t\t\t\t\t/*get the index of which slice has been selected*/\n\t\t\t\t\t\t\t\tvar sliceIndex = (slice._groups[0][0].__data__.index);\n\t\t\t\t\t\t\t\tvar sliceType = clickedData[sliceIndex].type;\n\t\t\t\t\t\t\t\tvar slicePercent = clickedData[sliceIndex].percent;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/*display info of highlighted slice*/\n\t\t\t\t\t\t\t\tsvg_extraChart.append(\"g\").append(\"text\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"crimeType\")\n\t\t\t\t\t\t\t\t .attr(\"text-anchor\", \"middle\")\n\t\t\t\t\t\t\t\t .style(\"font-size\", 18 * screenRatio + \"px\")\n\t\t\t\t\t\t\t\t .attr(\"x\",xx + margin_extraChart.left) /*from the arc center, add the same margin as bar chart and its path shifted*/\n\t\t\t\t\t\t\t\t .attr(\"y\",yy + margin_extraChart.top - 5 * screenRatio) /*from the arc center, add the same margin as bar chart and its path shifted*/\n\t\t\t\t\t\t\t\t .text(`${sliceType}`);\n\n\t\t\t\t\t\t\t\tsvg_extraChart.append(\"g\").append(\"text\")\n\t\t\t\t\t\t\t\t .attr(\"class\", \"crimePercent\")\n\t\t\t\t\t\t\t\t .attr(\"text-anchor\", \"middle\")\n\t\t\t\t\t\t\t\t .style(\"font-size\", 14 * screenRatio + \"px\")\n\t\t\t\t\t\t\t\t .attr(\"x\",xx + margin_extraChart.left) /*from the arc center, add the same margin as bar chart and its path shifted*/\n\t\t\t\t\t\t\t\t .attr(\"y\",yy + margin_extraChart.top + 20 * screenRatio) /*from the arc center, add the same margin as bar chart and its path shifted*/\n\t\t\t\t\t\t\t\t .text(function () {\n\t\t\t\t\t\t\t\t \treturn d3.format(\".1%\")(`${slicePercent}`);\n\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t/*for bar charts, just highlight the selected bar*/\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar selection = d3.select(this);\n\t\t\t\t\t\t\t\thighlight(selection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*define a function to remove highlight and info when mouse out*/\n\t\t\t\t\t\tfunction hideSliceInfo() {\n\t\t\t\t\t\t\tif(document.querySelector(\"#pieChart\")) {\n\t\t\t\t\t\t\t\tvar slice = d3.select(this)\n\t\t\t\t\t\t\t\t\t.attr(\"stroke\",\"none\");\n\n\t\t \t\t\td3.select(\".crimeType\").remove();\t\n\t\t \t\t\td3.select(\".crimePercent\").remove();\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar selection = d3.select(this);\n\t\t\t\t\t\t\t\tunhighlight(selection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t };\n\t\t\t }\n\t\t\t}\n\n\t\t\t/*after pie chart is created, change the chart ID to pieChart*/\n\t\t\td3.select(\"#extraChartSection\").select(\"svg\")\n\t\t\t\t\t.attr(\"id\",\"pieChart\");\n\t\t\t}\n\n\t\t\t/*define a function to switch to bar chart when the Bar button is clicked*/\n\t\t\tfunction toBar() {\t\t\t\t\n\t\t\t\tif (document.querySelector(\"#pieChart\")) {\n\t\t\t\t\textraChartGroup.selectAll(\"path\")\n\t\t\t\t .transition()\n\t\t\t\t .duration(500)\n\t\t\t\t .tween(\"arc\", arcTween);\t\t\t\t \n\n\t\t\t\t function arcTween(d) {\n\t\t\t\t \n\t\t\t\t var path = d3.select(this);\n\t\t\t\t \n\t\t\t\t /*define the original y position and width of bars so that when arc is created, the finishing position\n\t\t\t\t and length of arc will be the same as the bars*/\n\t\t\t\t var y0 = d.index * yBandScale_extraChart.bandwidth();\n\t\t\t\t var x0 = xLinearScale_extraChart(d.data.value);\n\t\t\t\t \n\t\t\t\t return function(t) {\t\t\t\t \n\t\t\t\t /*reverse the t so that it changes from 1 to 0, and a changes from 0 to 1.\n\t\t\t\t the donut chart is generated backwards until it appears like a bar chart*/\n\t\t\t\t t = 1 - t;\n\t\t\t\t var a = Math.cos(t * Math.PI / 2);\n\t\t\t\t var r = (1 + a) * height_extraChart / Math.min(1, t + .005);\n\t\t\t\t var yy = r + a * y0;\n\t\t\t\t var xx = (1 - a) * width_extraChart / 2;\n\t\t\t\t var arcArguments = {\n\t\t\t\t innerRadius: r - yBandScale_extraChart.bandwidth() + 1,\n\t\t\t\t outerRadius: r,\n\t\t\t\t startAngle: (1 - a) * d.startAngle,\n\t\t\t\t endAngle: a * (x0 / r) + (1 - a) * d.endAngle\n\t\t\t\t };\n\n\t\t\t\t path.attr(\"transform\", `translate(${xx},${yy})`);\n\t\t\t\t path.attr(\"d\", arc(arcArguments));\n\t\t\t\t };\t\t\t\t \n\t\t\t\t }\n\n\t\t\t\t /*create the y axis and values for the bar chart with some time delays*/\n\t\t\t\t setTimeout(addBarAxis, 600);\n\t\t\t\t setTimeout(addBarValues, 600);\n\n\t\t\t\t /*change the chart ID to barChart*/\n\t\t\t\t d3.select(\"#extraChartSection\").select(\"svg\")\n\t\t\t\t\t.attr(\"id\",\"barChart\");\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t/*create click event for bar button and pie button*/\n\t\t\td3.select(\"#barButton\").on(\"click\",toBar);\n\t\t\td3.select(\"#pieButton\").on(\"click\",toPie);\n\t\t}", "function createBarChart(debits_by_councilman) {\n var data = [];\n var labels = [];\n var backgroundcolor = [];\n var bordercolor = [];\n\n $.each(debits_by_councilman, function (key, val) {\n data.push(val.toFixed(2));\n labels.push(key);\n backgroundcolor.push(get_rgb_randon())\n bordercolor.push(get_rgb_randon_border())\n });\n\n var ctx = document.getElementById(\"barChart\");\n var stackedBar = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: 'R$ ',\n data: data,\n backgroundColor: backgroundcolor,\n borderColor: bordercolor,\n borderWidth: 1\n }],\n },\n options:[]\n });\n}", "function devicesWithMostBookings(){\n var data = google.visualization.arrayToDataTable(devicesWithMostBookings_arr);\n var height = 100 + 20*devicesWithMostBookings_arr.length;\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n height: height,\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.devicesWithMostBookings_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-devicesWithMostBookings'));\n chart.draw(data, options);\n }", "function drawChart() {\n listParks = data\n //console.log(listParks)\n // Create the data table.\n var table = google.visualization.arrayToDataTable([\n ['Places', 'Places Available', 'Places Ocupied', { role: 'annotation' }],\n [data[0].name, data[0].placesFreeTotal, data[0].placesTotal - data[0].placesFreeTotal / data[0].placesTotal, ''],\n [data[1].name, data[1].placesFreeTotal, data[1].placesTotal - data[1].placesFreeTotal, ''],\n [data[2].name, data[2].placesFreeTotal, data[2].placesTotal - data[2].placesFreeTotal, ''],\n ]);\n\n var view = new google.visualization.DataView(table);\n view.setColumns([0, 1,\n {\n calc: \"stringify\",\n sourceColumn: 1,\n type: \"string\",\n role: \"annotation\"\n },\n 2\n ]);\n\n // Set chart options\n var options = {\n isStacked: true,\n width: screen.width,\n height: 400,\n legend: { position: 'top', maxLines: 3 },\n bar: { groupWidth: '75%' },\n };\n\n\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n chart.draw(view, options);\n }", "renderBar(studentCount, options = {}) {\n const scaleFactor = options.scaleFactor || 0.5;\n const percentage = (studentCount === 0)\n ? 0\n : studentCount * scaleFactor;\n const width = (percentage > 100)\n ? '100%'\n : percentage + '%';\n const padding = percentage === 0 ? 0 : 3;\n const backgroundColor = options.backgroundColor || (percentage > 100 ? '#666' : '#ccc');\n const color = percentage > 100 ? 'white' : 'black';\n const text = percentage === 0 ? '\\u00A0' : studentCount;\n\n return <div style={{...styles.bar, padding, width, color, backgroundColor}}>{text}</div>;\n }", "renderBar(studentCount, options = {}) {\n const scaleFactor = options.scaleFactor || 0.5;\n const percentage = (studentCount === 0)\n ? 0\n : studentCount * scaleFactor;\n const width = (percentage > 100)\n ? '100%'\n : percentage + '%';\n const padding = percentage === 0 ? 0 : 3;\n const backgroundColor = options.backgroundColor || (percentage > 100 ? '#666' : '#ccc');\n const color = percentage > 100 ? 'white' : 'black';\n const text = percentage === 0 ? '\\u00A0' : studentCount;\n\n return <div style={{...styles.bar, padding, width, color, backgroundColor}}>{text}</div>;\n }", "function drawBarGraph(selectedSampleID) { \n console.log(\"drawBarGraph: sample = \", selectedSampleID);\n\n // Create barData and assign values to specify x values, y values, type, orientation\n // Filter the json on samples to get data out of it (in the sample there is an id, otu_ids, sample values, labels)\n // Locate the ID that was selected\n // Display the results for that ID - ids, labels, sample values\n d3.json(\"samples.json\").then((data) => {\n \n var sampleBacteria = data.samples;\n \n var resultArray = sampleBacteria.filter(sampleObj => sampleObj.id == selectedSampleID);\n var result = resultArray[0];\n console.log(result)\n\n var otu_ids = result.otu_ids;\n var otu_labels = result.otu_labels;\n var sample_values = result.sample_values;\n \n var yticks = otu_ids.slice(0, 10).map(otuID => `OTU ${otuID}`).reverse();\n\n var barData = [\n {\n x: sample_values.slice(0, 10).reverse(),\n y: yticks,\n type: \"bar\",\n text: otu_labels.slice(0, 10).reverse(),\n orientation: \"h\" \n }\n ];\n \n // Create barLayout and assign values to specify x values, y values, type, orientation\n var barLayout = {\n title: \"Top Ten Bacteria Cultures Found\",\n margin: {t: 30, l: 100}\n };\n \n // Use Plotly to draw the bar graph, use div to determine where this plot should be drawn and provide it with some data\n Plotly.newPlot(\"bar\", barData, barLayout);\n\n });\n}", "function barChartData(){\n barChartConfig = {\n\ttype: 'bar',\n\n\tdata: {\n\t\tlabels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n\t\tdatasets: [{\n\t\t\tlabel: 'Orders',\n\t\t\tbackgroundColor: window.chartColors.green,\n\t\t\tborderColor: window.chartColors.green,\n\t\t\tborderWidth: 1,\n\t\t\tmaxBarThickness: 16,\n\t\t\t\n\t\t\tdata: [\n\t\t\t\tview2[0],\n\t\t\t\tview2[1],\n\t\t\t\tview2[2],\n\t\t\t\tview2[3],\n\t\t\t\tview2[4],\n\t\t\t\tview2[5],\n\t\t\t\tview2[6]\n\t\t\t]\n\t\t}]\n\t},\n\toptions: {\n\t\tresponsive: true,\n\t\taspectRatio: 1.5,\n\t\tlegend: {\n\t\t\tposition: 'bottom',\n\t\t\talign: 'end',\n\t\t},\n\t\ttitle: {\n\t\t\tdisplay: true,\n\t\t\ttext: 'View Bar'\n\t\t},\n\t\ttooltips: {\n\t\t\tmode: 'index',\n\t\t\tintersect: false,\n\t\t\ttitleMarginBottom: 10,\n\t\t\tbodySpacing: 10,\n\t\t\txPadding: 16,\n\t\t\tyPadding: 16,\n\t\t\tborderColor: window.chartColors.border,\n\t\t\tborderWidth: 1,\n\t\t\tbackgroundColor: '#fff',\n\t\t\tbodyFontColor: window.chartColors.text,\n\t\t\ttitleFontColor: window.chartColors.text,\n\n\t\t},\n\t\tscales: {\n\t\t\txAxes: [{\n\t\t\t\tdisplay: true,\n\t\t\t\tgridLines: {\n\t\t\t\t\tdrawBorder: false,\n\t\t\t\t\tcolor: window.chartColors.border,\n\t\t\t\t},\n\n\t\t\t}],\n\t\t\tyAxes: [{\n\t\t\t\tdisplay: true,\n\t\t\t\tgridLines: {\n\t\t\t\t\tdrawBorder: false,\n\t\t\t\t\tcolor: window.chartColors.borders,\n\t\t\t\t},\n\n\t\t\t\t\n\t\t\t}]\n\t\t}\n\t\t\n\t}\n}\n}", "function ChartsBarchart() {\n}", "function render(subject) {\n const bars = d3.select('#chart')\n .selectAll('div')\n .data(data, function(d) {\n return d.name\n })\n \n bars.enter()\n .append('div')\n .attr('class', 'bar')\n .style('width', 0)\n .style('height', function(d) {\n // use the height calculated by the band scale\n return yScale.bandwidth() + 'px'\n })\n .merge(bars)\n .transition()\n .style('width', function(d) {\n // pass the score through the linear scale function\n return xScale(d[subject]) + 'px'\n })\n}", "function renderBars(data, barsGroup, yLinearScale, chosenYAxis, xLinearScale) {\n\n // append initial rect\n var barsGroup = chartGroup.selectAll(\"rect\")\n .data(data)\n\n //enter\n barsGroup.enter()\n .append(\"rect\")\n\n //exit\n barsGroup\n .exit()\n .transition()\n .delay(100)\n .duration(300)\n .remove();\n\n //update\n barsGroup\n .transition()\n .duration(300)\n // .ease('bounce')\n .attr(\"height\", d => height - yLinearScale(d[chosenYAxis]))\n .attr(\"x\", d => xLinearScale(d.month))\n .attr(\"width\", xLinearScale.bandwidth())\n .attr(\"y\", d => yLinearScale(d[chosenYAxis]))\n\n return barsGroup}", "function barChart() {\n\n currentChart = \"bar chart\";\n\n //allows to select the colour scheme depending on selected colour\n var colours;\n if (currentColourScheme == \"colour 1\") {\n colours = ColourOne;\n }\n else if (currentColourScheme == \"colour 2\") {\n colours = ColourTwo;\n }\n else if (currentColourScheme == \"colour 3\") {\n colours = ColourThree;\n }\n \n //function to draw the bar\n function drawBar(context, x, y, width, height, c) {\n context.fillStyle = c;\n context.fillRect(x, HEIGHT-y-height, width, height); \n }\n \n var EDGE = WIDTH*0.02;\n var BAR_WIDTH = (WIDTH-EDGE*2)/27;\n function drawBars(context) {\n\n //multiply each day by 10% of the height to make it bigger\n var ENLARGE = HEIGHT*0.1;\n \n //edges of the graph \n var currentX = EDGE;\n\n //hours for each day and activity in order\n var hours = [5,2,4,6,0,2,8,1,3,9,1,1,8,0,3,5,1,2,6,1,4];\n for (var i = 0; i < hours.length; i++) {\n //creating a gap every three bars o make the data more visible\n if (i>1 && i%3 === 0) {\n currentX += BAR_WIDTH;\n }\n var height = hours[i]*ENLARGE;\n drawBar(context, currentX, EDGE*1.5, BAR_WIDTH, height, colours[i % colours.length]);\n currentX += BAR_WIDTH;\n }\n }\n \n\n //function to draw keys and x-axis for the bar chart\n function drawLabels() {\n \n var activities = ['uni','gym','phone'];\n var days = ['mon','tue','wed','thur','fri','sat','sun'];\n\n //starting points based on the canvas size\n var y = WIDTH*0.85;\n var x = y - 12;\n //making a key on the side of the canvas \n for (var l = 0; l < activities.length; l++) {\n context.fillStyle = 'black';\n context.fillText(activities[l],y,25*l+50);\n }\n \n //the colours to match the words\n for (var s = 0; s < activities.length; s++) {\n context.fillStyle = colours[s % colours.length];\n context.fillRect(x,25*s+40,10,10);\n }\n\n //printing out the days on the x-axis \n //distance between words\n var STEP = WIDTH*0.15;\n //starting point\n var START = HEIGHT*0.033;\n \n //days of the week at the bottom of the chart\n for (var i=0; i < days.length; i++) {\n context.fillStyle = 'black';\n context.fillText(days[i],STEP*i+EDGE,HEIGHT-2);\n }\n\n //drawing a line to separate the bars from words\n context.fillStyle = 'black';\n context.fillRect(0,HEIGHT-START,WIDTH,2);\n \n\n }\n\n //functions to draw the labels and the bar chart\n drawBars(context);\n drawLabels();\n\n}", "function chartBarChartVertical () {\n\n /* Default Properties */\n var svg = void 0;\n var chart = void 0;\n var classed = \"barChartVertical\";\n var width = 400;\n var height = 300;\n var margin = { top: 20, right: 20, bottom: 20, left: 40 };\n var transition = { ease: d3.easeBounce, duration: 500 };\n var colors = palette.categorical(3);\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n\n /* Chart Dimensions */\n var chartW = void 0;\n var chartH = void 0;\n\n /* Scales */\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = void 0;\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n chartW = width - (margin.left + margin.right);\n chartH = height - (margin.top + margin.bottom);\n\n var _dataTransform$summar = dataTransform(data).summary(),\n seriesNames = _dataTransform$summar.seriesNames,\n columnKeys = _dataTransform$summar.columnKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(columnKeys).range(colors);\n }\n\n xScale = d3.scaleBand().domain(columnKeys).rangeRound([0, chartW]).padding(0.15);\n\n yScale = d3.scaleLinear().domain(valueExtent).range([chartH, 0]).nice();\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias barChartVertical\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n // Create SVG element (if it does not exist already)\n if (!svg) {\n svg = function (selection) {\n var el = selection._groups[0][0];\n if (!!el.ownerSVGElement || el.tagName === \"svg\") {\n return selection;\n } else {\n return selection.append(\"svg\");\n }\n }(selection);\n\n svg.classed(\"d3ez\", true).attr(\"width\", width).attr(\"height\", height);\n\n chart = svg.append(\"g\").classed(\"chart\", true);\n } else {\n chart = selection.select(\".chart\");\n }\n\n // Update the chart dimensions and add layer groups\n var layers = [\"barChart\", \"xAxis axis\", \"yAxis axis\"];\n chart.classed(classed, true).attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\").attr(\"width\", chartW).attr(\"height\", chartH).selectAll(\"g\").data(layers).enter().append(\"g\").attr(\"class\", function (d) {\n return d;\n });\n\n selection.each(function (data) {\n // Initialise Data\n init(data);\n\n // Vertical Bars\n var barsVertical = component.barsVertical().width(chartW).height(chartH).colorScale(colorScale).xScale(xScale).dispatch(dispatch);\n\n chart.select(\".barChart\").datum(data).call(barsVertical);\n\n // X Axis\n var xAxis = d3.axisBottom(xScale);\n\n chart.select(\".xAxis\").attr(\"transform\", \"translate(0,\" + chartH + \")\").call(xAxis);\n\n // Y Axis\n var yAxis = d3.axisLeft(yScale);\n\n chart.select(\".yAxis\").call(yAxis);\n\n // Y Axis Label\n var yLabel = chart.select(\".yAxis\").selectAll(\".yAxisLabel\").data([data.key]);\n\n yLabel.enter().append(\"text\").classed(\"yAxisLabel\", true).attr(\"transform\", \"rotate(-90)\").attr(\"y\", -40).attr(\"dy\", \".71em\").attr(\"fill\", \"#000000\").style(\"text-anchor\", \"end\").merge(yLabel).transition().text(function (d) {\n return d;\n });\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return this;\n };\n\n /**\n * Transition Getter / Setter\n *\n * @param {d3.transition} _v - D3 transition style.\n * @returns {*}\n */\n my.transition = function (_v) {\n if (!arguments.length) return transition;\n transition = _v;\n return this;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function drawBarVis(type) {\r\n const BINS = canvas.width / 3;\r\n const BAR_WIDTH = canvas.width / BINS;\r\n const HALF_CANVAS_HEIGHT = canvas.height / 2;\r\n\r\n let x_coord = 0;\r\n\r\n // Draw bars\r\n for (var i = 0; i < BINS; i++) {\r\n let barLength = Math.pow(frequencyData[i + Math.ceil(i / 90)], 3) / Math.pow(255, 3);\r\n\r\n switch(type) {\r\n // === Spaced Mirrored Bars ===\r\n case \"spacedMirrored\":\r\n canvasContext.beginPath();\r\n canvasContext.moveTo(0, HALF_CANVAS_HEIGHT);\r\n canvasContext.lineTo(canvas.width, HALF_CANVAS_HEIGHT);\r\n canvasContext.stroke();\r\n // Top Half\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 - barLength * SPACING),\r\n BAR_WIDTH,\r\n -HALF_CANVAS_HEIGHT * barLength * SPACE_MIRR_SIZE\r\n );\r\n // Bottom Half\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 + barLength * SPACING),\r\n BAR_WIDTH,\r\n HALF_CANVAS_HEIGHT * barLength * SPACE_MIRR_SIZE\r\n );\r\n break; \r\n // === Full Bars === \r\n case \"full\":\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT,\r\n BAR_WIDTH,\r\n -HALF_CANVAS_HEIGHT * barLength\r\n );\r\n break;\r\n // === Mirrored Bars ===\r\n default:\r\n canvasContext.beginPath();\r\n canvasContext.moveTo(0, HALF_CANVAS_HEIGHT);\r\n canvasContext.lineTo(canvas.width, HALF_CANVAS_HEIGHT);\r\n canvasContext.stroke();\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 - barLength * MIRR_SIZE),\r\n BAR_WIDTH,\r\n canvas.height * barLength * MIRR_SIZE\r\n ); \r\n }\r\n //Set new starting x-coordinate for next bar\r\n x_coord += BAR_WIDTH + 1;\r\n }\r\n }", "function devicesWithMostBookedDays(){\n var data = google.visualization.arrayToDataTable(devicesWithMostBookedDays_arr);\n var height = 100 + 20*devicesWithMostBookedDays_arr.length;\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n height: height,\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.devicesWithMostBookedDays_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-devicesWithMostBookedDays'));\n chart.draw(data, options);\n }", "function viewChartBar(jData) {\n var ctx = $('#views-bar');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: jData.months,\n datasets: [{\n label: 'Visite',\n data: jData.views_count_data,\n backgroundColor: [\n '#62CB76',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n '#62CB76',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function drawBargraph (sampleId) {\n console.log(`drawBargraph(${sampleId})`);\n\n // read in the data \n d3.json(\"data/samples.json\").then(data => {\n //console.log(data);\n\n var samples = data.samples;\n var resultArray = samples.filter(s => s.id == sampleId);\n\n var result = resultArray[0];\n\n\n // use otu_ids as the labels for the bar chart\n var otu_ids = result.otu_ids;\n\n // use otu_labels as the hovertext for the chart\n var otu_labels = result.otu_labels;\n \n // use sample_values as the values for the barchart\n var sample_values = result.sample_values;\n\n // .slice is used per the instructions display the top 10 OTUs for the individual\n yticks = otu_ids.slice(0, 10).map(otuId => `OTU ${otuId}`).reverse(); //TBD\n\n var barData = {\n x: sample_values.slice(0,10).reverse(), // tbd\n y: yticks,\n type: \"bar\",\n text: otu_labels.slice(0,10).reverse(), //tbd\n orientation: \"h\"\n }\n\n var barArray = [barData];\n var barLayout = {\n title: \"Top 10 Bacteria Cultures Found\",\n margin: {t: 30, l: 150}\n }\n\n Plotly.newPlot(\"bar\", barArray, barLayout);\n\n });\n\n}", "renderBarGraph() {\n let data = this.addNumDrawingsToData() \n return (\n <ResponsiveBar\n data={data}\n keys={['numDrawings']}\n indexBy={indexFunc}\n margin={{ top: 50, right: 130, bottom: 50, left: 60 }}\n padding={0.3}\n colors={{ scheme: 'nivo' }}\n borderColor={{ from: 'color', modifiers: [ [ 'darker', 1.6 ] ] }}\n axisTop={null}\n axisRight={null}\n axisBottom={{\n tickSize: 5,\n tickPadding: 5,\n tickRotation: 0,\n legend: 'country',\n legendPosition: 'middle',\n legendOffset: 32\n }}\n axisLeft={{\n tickSize: 5,\n tickPadding: 5,\n tickRotation: 0,\n legend: 'numDrawings',\n legendPosition: 'middle',\n legendOffset: -40\n }}\n labelSkipWidth={12}\n labelSkipHeight={12}\n enableGridY={true}\n labelTextColor={{ from: 'color', modifiers: [ [ 'darker', 1.6 ] ] }}\n legends={[\n {\n dataFrom: 'keys',\n anchor: 'bottom-right',\n direction: 'column',\n justify: false,\n translateX: 120,\n translateY: 0,\n itemsSpacing: 2,\n itemWidth: 100,\n itemHeight: 20,\n itemDirection: 'left-to-right',\n itemOpacity: 0.85,\n symbolSize: 20,\n effects: [\n {\n on: 'hover',\n style: {\n itemOpacity: 1\n }\n }\n ]\n }\n ]}\n animate={true}\n motionStiffness={90}\n motionDamping={15}\n />\n )\n }", "function drawChart() {\n\t\t\n \n\t\tvar data = new google.visualization.DataTable();\n data.addColumn('string', 'Device');\n data.addColumn('number', 'Device Count');\n data.addRows(5);\n data.setValue(0, 0, 'Android');\n data.setValue(0, 1, parseInt(num1));\n data.setValue(1, 0, 'iPhone');\n data.setValue(1, 1, parseInt(num2));\n\t\t\t\t\tdata.setValue(2, 0, 'Windows');\n data.setValue(2, 1, parseInt(num3));\n\t\t\t\t\tdata.setValue(3, 0, 'Web');\n data.setValue(3, 1, parseInt(num4));\n \n\t\t\n\n var options = {\n title: 'Device',\n is3D: true,\n\t\t \n };\n\n var chart = new google.visualization.BarChart(document.getElementById('bar_3d'));\n chart.draw(data, options);\n }", "function showBarGraphNumBytes() {\n var margin = {top: 20, right: 20, bottom: 100, left: 100},\n width = 600 - margin.left - margin.right,\n height = 300 - margin.top - margin.bottom;\n\nvar x = d3.scale.ordinal().rangeRoundBands([0, width], .05);\nvar y = d3.scale.linear().range([height, 0]);\n\nvar xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n\nvar yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .ticks(6);\n\nvar svg = d3.select(\"#bar-graph\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \n \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n// load the data\nd3.json(\"data.json\", function(error, data) {\n\nvar freqTotal = d3.nest()\n .key(function(d) { return d.current_page; })\n .rollup(function(v) { return d3.mean(v, function(d) { return d.bytes_used; }); })\n .entries(data);\n //console.log(JSON.stringify(freqTotal));\n\ndata = freqTotal;\n\n x.domain(data.map(function(d) { return d.key; }));\n y.domain([0, d3.max(data, function(d) { return d.values; })]);\n\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"-.8em\")\n .attr(\"dy\", \"-.55em\")\n .attr(\"transform\", \"rotate(-90)\" );\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", -margin.left)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Average bytes used\");\n\n svg.selectAll(\"bar\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function(d) { return x(d.key); })\n .attr(\"width\", x.rangeBand())\n .attr(\"y\", function(d) { return y(d.values); })\n .attr(\"height\", function(d) { return height - y(d.values); })\n .attr(\"fill\", function(d, i) {\n return colors(i);\n });;\n\n});\n\n}", "function drawBar(x, y, width, data, color) {\n ctx.beginPath();\n ctx.rect(x, y, width, data, color);\n ctx.fillStyle = \"#ff3300\";\n ctx.fill();\n }", "function drawBarGraph(svg, coords, data, yAttrs, attributes) {\n var barSize = get(attributes, 'barSize', style('barSize'));\n\n // compute the axes\n var xData = data.map(function(elt) { return elt[0]; });\n var xAxis = createBarAxisX(\n xData, // domain, possible x values\n [coords['x'], coords['x'] + coords['width']], // range, coordinate locations\n coords['axisPadding']); // padding\n xAxis.scale().padding(1 - barSize);\n var yAxis = createLinearAxisY(\n [yAttrs['min'], yAttrs['max']], // domain, possible y values\n [coords['y'] + coords['height'], coords['y']], // range, coordinate locations\n yAttrs['ticks'], coords['axisPadding']); // ticks and padding\n \n // draw gridlines\n if (style('barGraphGridlines'))\n drawYGridlines(svg, yAxis, coords['width'] - 2 * coords['axisPadding'],\n yAttrs['ticks'], coords['x'] + coords['axisPadding'], {});\n\n // draw axes\n drawAxisX(svg, xAxis, coords['y'] + coords['height'], coords['axisPadding']);\n drawAxisY(svg, yAxis, coords['x'], coords['axisPadding']);\n labelAxes(svg, coords, attributes);\n\n // draw each bar\n barColor = get(attributes, 'color', style('barColor'));\n for (var i = 0; i < data.length; i++) {\n var bar = svg.append('rect')\n .attr('x', xAxis.scale()(data[i][0]))\n .attr('y', yAxis.scale()(data[i][1]))\n .attr('width', xAxis.scale().bandwidth())\n .attr('height', coords['y'] + coords['height']\n - coords['axisPadding'] - yAxis.scale()(data[i][1]))\n .style('fill', barColor);\n\n if (style('showTooltips')) {\n var contents = data[i][1];\n if ('tooltipFunction' in attributes)\n contents = attributes['tooltipFunction'](data[i]);\n addTooltipToPoint(svg, bar, contents, attributes);\n }\n }\n\n return [xAxis, yAxis];\n}", "function BarChart() {\n\n var my = ChiasmComponent({\n\n margin: {\n left: 150,\n top: 30,\n right: 30,\n bottom: 60\n },\n\n sizeColumn: Model.None,\n sizeLabel: Model.None,\n\n idColumn: Model.None,\n idLabel: Model.None,\n\n orientation: \"vertical\",\n\n // These properties adjust spacing between bars.\n // The names correspond to the arguments passed to\n // d3.scale.ordinal.rangeRoundBands(interval[, padding[, outerPadding]])\n // https://github.com/mbostock/d3/wiki/Ordinal-Scales#ordinal_rangeRoundBands\n barPadding: 0.1,\n barOuterPadding: 0.1,\n\n fill: \"black\",\n stroke: \"none\",\n strokeWidth: \"1px\",\n\n // Desired number of pixels between tick marks.\n xAxisTickDensity: 50,\n\n // Translation down from the X axis line (pixels).\n xAxisLabelOffset: 50,\n\n // Desired number of pixels between tick marks.\n yAxisTickDensity: 30,\n\n // Translation left from the X axis line (pixels).\n yAxisLabelOffset: 45\n\n });\n\n // This scale is for the length of the bars.\n var sizeScale = d3.scale.linear();\n\n my.el = document.createElement(\"div\");\n var svg = d3.select(my.el).append(\"svg\");\n var g = svg.append(\"g\");\n\n var xAxis = d3.svg.axis().orient(\"bottom\");\n var xAxisG = g.append(\"g\").attr(\"class\", \"x axis\");\n var xAxisLabel = xAxisG.append(\"text\")\n .style(\"text-anchor\", \"middle\")\n .attr(\"class\", \"label\");\n\n var yAxis = d3.svg.axis().orient(\"left\");\n var yAxisG = g.append(\"g\").attr(\"class\", \"y axis\");\n var yAxisLabel = yAxisG.append(\"text\")\n .style(\"text-anchor\", \"middle\")\n .attr(\"class\", \"label\");\n\n // TODO think about adding this stuff as configurable\n // .tickFormat(d3.format(\"s\"))\n // .outerTickSize(0);\n\n my.when(\"xAxisLabelText\", function (xAxisLabelText) {\n xAxisLabel.text(xAxisLabelText);\n });\n my.when([\"width\", \"xAxisLabelOffset\"], function (width, offset) {\n xAxisLabel.attr(\"x\", width / 2).attr(\"y\", offset);\n });\n\n my.when([\"height\", \"yAxisLabelOffset\"], function (height, offset) {\n yAxisLabel.attr(\"transform\", [\n \"translate(-\" + offset + \",\" + (height / 2) + \") \",\n \"rotate(-90)\"\n ].join(\"\"));\n });\n my.when(\"yAxisLabelText\", function (yAxisLabelText) {\n yAxisLabel.text(yAxisLabelText);\n });\n\n // Respond to changes in size and margin.\n // Inspired by D3 margin convention from http://bl.ocks.org/mbostock/3019563\n my.when(\"box\", function (box) {\n svg.attr(\"width\", box.width)\n .attr(\"height\", box.height);\n });\n my.when([\"box\", \"margin\"], function (box, margin) {\n my.width = box.width - margin.left - margin.right;\n my.height = box.height - margin.top - margin.bottom;\n g.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n });\n\n my.when(\"height\", function (height) {\n xAxisG.attr(\"transform\", \"translate(0,\" + height + \")\");\n });\n\n my.when([\"idColumn\", \"dataset\"],\n function (idColumn, dataset) {\n\n // This metadata is only present for aggregated numeric columns.\n var meta = dataset.metadata[idColumn];\n var idScale;\n\n if (meta) {\n\n // Handle the case of an aggregated numeric column.\n idScale = d3.scale.linear();\n idScale.domain(meta.domain);\n idScale.rangeBand = function () {\n return Math.abs(idScale(meta.step) - idScale(0));\n };\n idScale.rangeBands = function (extent) {\n idScale.range(extent);\n };\n idScale.step = meta.step;\n } else {\n\n // Handle the case of a string (categorical) column.\n idScale = d3.scale.ordinal();\n idScale.domain(dataset.data.map(function (d) {\n return d[idColumn];\n }));\n idScale.step = \"\";\n }\n my.idScale = idScale;\n });\n\n my.when(\"dataset\", function (dataset) {\n my.data = dataset.data;\n my.metadata = dataset.metadata;\n });\n\n my.when([\"data\", \"sizeColumn\", \"idScale\", \"idColumn\", \"width\", \"height\", \"orientation\", \"idLabel\", \"sizeLabel\", \"barPadding\", \"barOuterPadding\"],\n function (data, sizeColumn, idScale, idColumn, width, height, orientation, idLabel, sizeLabel, barPadding, barOuterPadding) {\n\n if (sizeColumn !== Model.None) {\n\n // TODO separate out this logic.\n sizeScale.domain([0, d3.max(data, function (d) {\n return d[sizeColumn];\n })]);\n\n if (orientation === \"vertical\") {\n\n sizeScale.range([height, 0]);\n idScale.rangeBands([0, width], barPadding, barOuterPadding);\n\n my.barsX = function (d) {\n return idScale(d[idColumn]);\n };\n my.barsY = function (d) {\n return sizeScale(d[sizeColumn]);\n };\n my.barsWidth = idScale.rangeBand();\n my.barsHeight = function (d) {\n return height - my.barsY(d);\n };\n\n my.xScale = idScale;\n if (idLabel !== Model.None) {\n my.xAxisLabelText = idLabel;\n }\n\n my.yScale = sizeScale;\n if (sizeLabel !== Model.None) {\n my.yAxisLabelText = sizeLabel;\n }\n\n } else if (orientation === \"horizontal\") {\n\n sizeScale.range([0, width]);\n idScale.rangeBands([height, 0], barPadding, barOuterPadding);\n\n my.barsX = 0;\n my.barsY = function (d) {\n\n // Using idScale.step here is kind of an ugly hack to get the\n // right behavior for both linear and ordinal id scales.\n return idScale(d[idColumn] + idScale.step);\n };\n my.barsWidth = function (d) {\n return sizeScale(d[sizeColumn]);\n };\n my.barsHeight = idScale.rangeBand();\n\n// TODO flip vertically for histogram mode.\n// my.barsX = 0;\n// my.barsWidth = function(d) { return sizeScale(d[sizeColumn]); };\n// my.barsHeight = Math.abs(idScale.rangeBand());\n// my.barsY = function(d) {\n// return idScale(d[idColumn]) - my.barsHeight;\n// };\n\n my.xScale = sizeScale;\n if (sizeLabel !== Model.None) {\n my.xAxisLabelText = sizeLabel;\n }\n\n my.yScale = idScale;\n if (idLabel !== Model.None) {\n my.yAxisLabelText = idLabel;\n }\n\n }\n }\n });\n\n my.when([\"data\", \"barsX\", \"barsWidth\", \"barsY\", \"barsHeight\"],\n function (data, barsX, barsWidth, barsY, barsHeight) {\n\n my.bars = g.selectAll(\"rect\").data(data);\n my.bars.enter().append(\"rect\")\n\n // This makes it so that there are no anti-aliased spaces between the bars.\n .style(\"shape-rendering\", \"crispEdges\");\n\n my.bars.exit().remove();\n //my.bars\n // .attr(\"x\", barsX)\n // .attr(\"width\", barsWidth)\n // .attr(\"y\", barsY)\n // .attr(\"height\", barsHeight);\n my.bars.attr(\"x\", barsX);\n my.bars.attr(\"width\", barsWidth);\n my.bars.attr(\"y\", barsY);\n my.bars.attr(\"height\", barsHeight);\n\n\n // Withouth this line, the bars added in the enter() phase\n // will flash as black for a fraction of a second.\n updateBarStyles();\n\n });\n\n function updateBarStyles() {\n my.bars\n .attr(\"fill\", my.fill)\n .attr(\"stroke\", my.stroke)\n .attr(\"stroke-width\", my.strokeWidth);\n }\n\n my.when([\"bars\", \"fill\", \"stroke\", \"strokeWidth\"], updateBarStyles)\n\n my.when([\"xScale\", \"width\", \"xAxisTickDensity\"],\n function (xScale, width, density) {\n xAxis.scale(xScale).ticks(width / density);\n xAxisG.call(xAxis);\n });\n\n my.when([\"yScale\", \"height\", \"yAxisTickDensity\"],\n function (yScale, height, density) {\n yAxis.scale(yScale).ticks(height / density);\n yAxisG.call(yAxis);\n });\n\n return my;\n }", "function BarDrawUtil() {\n var me = this;\n /****Constants****/\n var BAR_COLOR = /*\"#4A87F8\"*/\"#178FB7\";\n //Layout\n var MAX_BAR_WIDTH = 24;\n var NICE_BAR_WIDTH = 12;\n var MIN_BAR_WIDTH = 2;\n var BEST_PAD_BETWEEN_BARS = 1;\n\n /****Externally set****/\n //Data\n var dataList;\n //Utils\n var yAxis;\n var xAxis;\n //Structure\n var barGroup;\n var concealerGroup;\n //Layout\n var bottomExtraPadding;\n\n /**Internally Set**/\n //Data\n var barCount;\n //Layout\n var barWidth;\n\n\n /**Public Functions***/\n this.setLayoutParams = function (bottomExtraPaddingInput) {\n bottomExtraPadding = bottomExtraPaddingInput;\n };\n\n this.setData = function (dataListInput, xAxisInput, yAxisInput) {\n dataList = dataListInput;\n xAxis = xAxisInput;\n yAxis = yAxisInput;\n };\n\n this.setPapaGroups = function (barGroupInput, concealerGroupInput) {\n barGroup = barGroupInput;\n concealerGroup = concealerGroupInput;\n };\n\n this.drawComponent = function () {\n createAllBars();\n };\n\n /**Construct***/\n function createAllBars() {\n calculateBarWidth();\n for (var i = 0; i < dataList.length; i++) {\n createBar(i);\n }\n }\n\n function createBar(index) {\n var dataPoint = dataList[index];\n var value = dataPoint.close;\n var x = xAxis.scale(index) - barWidth / 2;\n var baseY = yAxis.scale(0);\n var y = yAxis.scale(value);\n var height;\n\n\n\n if (value > 0) {\n height = baseY - y;\n } else {\n height = y - baseY;\n y = baseY;\n }\n\n x = trimToTwoDecimalDigits(x);\n height = trimToTwoDecimalDigits(height);\n y = trimToTwoDecimalDigits(y);\n var bar = barGroup.append(\"rect\")\n .attr({\n x: x,\n y: y,\n height: height,\n width: barWidth\n })\n .style({\n fill: BAR_COLOR\n });\n }\n\n /**Calculate***/\n function calculateBarWidth() {\n var barWithPadWidth = xAxis.scale(1) - xAxis.scale(0);\n barWidth = barWithPadWidth * 0.9;\n barCount = dataList.length;\n\n\n barWidth = trimToTwoDecimalDigits(barWidth);\n }\n}", "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barChart.draw();\n // scatterplot\n // this.scatter.draw();\n }", "function renderChart() {\n //access the canvas element from the dom\n var context = document.getElementById(\"merchandiseChart\").getContext('2d');\n \n var merchandiseChart = new Chart(context, {\n type: 'bar',\n data: {\n labels: merchNames, //array of merchanise names\n datasets: [{\n label: 'Votes per product',\n data: merchVotes,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n stepSize:1,\n beginAtZero:true\n }\n }]\n }\n }\n });\n}", "function barChart(args) {\n this.args = args;\n\n this.init = function(args) {\n this.args = args;\n\n raw_data_transformation(args);\n process_categorical_variables(args);\n init(args);\n\n this.is_vertical = (args.bar_orientation === 'vertical');\n\n if (this.is_vertical) {\n x_axis_categorical(args);\n y_axis(args);\n } else {\n x_axis(args);\n y_axis_categorical(args);\n }\n\n this.mainPlot();\n this.markers();\n this.rollover();\n this.windowListeners();\n\n return this;\n };\n\n this.mainPlot = function() {\n var svg = mg_get_svg_child_of(args.target);\n var data = args.data[0];\n var barplot = svg.select('g.mg-barplot');\n var fresh_render = barplot.empty();\n\n var bars;\n var predictor_bars;\n var pp, pp0;\n var baseline_marks;\n\n var perform_load_animation = fresh_render && args.animate_on_load;\n var should_transition = perform_load_animation || args.transition_on_update;\n var transition_duration = args.transition_duration || 1000;\n\n // draw the plot on first render\n if (fresh_render) {\n barplot = svg.append('g')\n .classed('mg-barplot', true);\n }\n\n bars = bars = barplot.selectAll('.mg-bar')\n .data(data);\n\n bars.exit().remove();\n\n bars.enter().append('rect')\n .classed('mg-bar', true);\n\n if (args.predictor_accessor) {\n predictor_bars = barplot.selectAll('.mg-bar-prediction')\n .data(data);\n\n predictor_bars.exit().remove();\n\n predictor_bars.enter().append('rect')\n .classed('mg-bar-prediction', true);\n }\n\n if (args.baseline_accessor) {\n baseline_marks = barplot.selectAll('.mg-bar-baseline')\n .data(data);\n\n baseline_marks.exit().remove();\n\n baseline_marks.enter().append('line')\n .classed('mg-bar-baseline', true);\n }\n\n var appropriate_size;\n\n // setup transitions\n if (should_transition) {\n bars = bars.transition()\n .duration(transition_duration);\n\n if (predictor_bars) {\n predictor_bars = predictor_bars.transition()\n .duration(transition_duration);\n }\n\n if (baseline_marks) {\n baseline_marks = baseline_marks.transition()\n .duration(transition_duration);\n }\n }\n\n // move the barplot after the axes so it doesn't overlap\n svg.select('.mg-y-axis').node().parentNode.appendChild(barplot.node());\n\n if (this.is_vertical) {\n appropriate_size = args.scales.X.rangeBand()/1.5;\n\n if (perform_load_animation) {\n bars.attr({\n height: 0,\n y: args.scales.Y(0)\n });\n\n if (predictor_bars) {\n predictor_bars.attr({\n height: 0,\n y: args.scales.Y(0)\n });\n }\n\n if (baseline_marks) {\n baseline_marks.attr({\n y1: args.scales.Y(0),\n y2: args.scales.Y(0)\n });\n }\n }\n\n bars.attr('y', args.scalefns.yf)\n .attr('x', function(d) {\n return args.scalefns.xf(d) + appropriate_size/2;\n })\n .attr('width', appropriate_size)\n .attr('height', function(d) {\n return 0 - (args.scalefns.yf(d) - args.scales.Y(0));\n });\n\n\n if (args.predictor_accessor) {\n pp = args.predictor_proportion;\n pp0 = pp-1;\n\n // thick line through bar;\n predictor_bars\n .attr('y', function(d) {\n return args.scales.Y(0) - (args.scales.Y(0) - args.scales.Y(d[args.predictor_accessor]));\n })\n .attr('x', function(d) {\n return args.scalefns.xf(d) + pp0*appropriate_size/(pp*2) + appropriate_size/2;\n })\n .attr('width', appropriate_size/pp)\n .attr('height', function(d) {\n return 0 - (args.scales.Y(d[args.predictor_accessor]) - args.scales.Y(0));\n });\n }\n\n if (args.baseline_accessor) {\n pp = args.predictor_proportion;\n\n baseline_marks\n .attr('x1', function(d) {\n return args.scalefns.xf(d)+appropriate_size/2-appropriate_size/pp + appropriate_size/2;\n })\n .attr('x2', function(d) {\n return args.scalefns.xf(d)+appropriate_size/2+appropriate_size/pp + appropriate_size/2;\n })\n .attr('y1', function(d) { return args.scales.Y(d[args.baseline_accessor]); })\n .attr('y2', function(d) { return args.scales.Y(d[args.baseline_accessor]); });\n }\n } else {\n appropriate_size = args.scales.Y.rangeBand()/1.5;\n\n if (perform_load_animation) {\n bars.attr('width', 0);\n\n if (predictor_bars) {\n predictor_bars.attr('width', 0);\n }\n\n if (baseline_marks) {\n baseline_marks.attr({\n x1: args.scales.X(0),\n x2: args.scales.X(0)\n });\n }\n }\n\n bars.attr('x', args.scales.X(0))\n .attr('y', function(d) {\n return args.scalefns.yf(d) + appropriate_size/2;\n })\n .attr('height', appropriate_size)\n .attr('width', function(d) {\n return args.scalefns.xf(d) - args.scales.X(0);\n });\n\n if (args.predictor_accessor) {\n pp = args.predictor_proportion;\n pp0 = pp-1;\n\n // thick line through bar;\n predictor_bars\n .attr('x', args.scales.X(0))\n .attr('y', function(d) {\n return args.scalefns.yf(d) + pp0 * appropriate_size/(pp*2) + appropriate_size / 2;\n })\n .attr('height', appropriate_size / pp)\n .attr('width', function(d) {\n return args.scales.X(d[args.predictor_accessor]) - args.scales.X(0);\n });\n }\n\n if (args.baseline_accessor) {\n pp = args.predictor_proportion;\n\n baseline_marks\n .attr('x1', function(d) { return args.scales.X(d[args.baseline_accessor]); })\n .attr('x2', function(d) { return args.scales.X(d[args.baseline_accessor]); })\n .attr('y1', function(d) {\n return args.scalefns.yf(d) + appropriate_size / 2 - appropriate_size / pp + appropriate_size / 2;\n })\n .attr('y2', function(d) {\n return args.scalefns.yf(d) + appropriate_size / 2 + appropriate_size / pp + appropriate_size / 2;\n });\n }\n }\n\n return this;\n };\n\n this.markers = function() {\n markers(args);\n return this;\n };\n\n this.rollover = function() {\n var svg = mg_get_svg_child_of(args.target);\n var g;\n\n //remove the old rollovers if they already exist\n svg.selectAll('.mg-rollover-rect').remove();\n svg.selectAll('.mg-active-datapoint').remove();\n\n //rollover text\n svg.append('text')\n .attr('class', 'mg-active-datapoint')\n .attr('xml:space', 'preserve')\n .attr('x', args.width - args.right)\n .attr('y', args.top * 0.75)\n .attr('dy', '.35em')\n .attr('text-anchor', 'end');\n\n g = svg.append('g')\n .attr('class', 'mg-rollover-rect');\n\n //draw rollover bars\n var bar = g.selectAll(\".mg-bar-rollover\")\n .data(args.data[0]).enter()\n .append(\"rect\")\n .attr('class', 'mg-bar-rollover');\n\n if (this.is_vertical) {\n bar.attr(\"x\", args.scalefns.xf)\n .attr(\"y\", function() {\n return args.scales.Y(0) - args.height;\n })\n .attr('width', args.scales.X.rangeBand())\n .attr('height', args.height)\n .attr('opacity', 0)\n .on('mouseover', this.rolloverOn(args))\n .on('mouseout', this.rolloverOff(args))\n .on('mousemove', this.rolloverMove(args));\n } else {\n bar.attr(\"x\", args.scales.X(0))\n .attr(\"y\", args.scalefns.yf)\n .attr('width', args.width)\n .attr('height', args.scales.Y.rangeBand()+2)\n .attr('opacity', 0)\n .on('mouseover', this.rolloverOn(args))\n .on('mouseout', this.rolloverOff(args))\n .on('mousemove', this.rolloverMove(args));\n }\n return this;\n };\n\n this.rolloverOn = function(args) {\n var svg = mg_get_svg_child_of(args.target);\n var label_accessor = this.is_vertical ? args.x_accessor : args.y_accessor;\n var data_accessor = this.is_vertical ? args.y_accessor : args.x_accessor;\n var label_units = this.is_vertical ? args.yax_units : args.xax_units;\n\n return function(d, i) {\n svg.selectAll('text')\n .filter(function(g, j) {\n return d === g;\n })\n .attr('opacity', 0.3);\n\n var fmt = MG.time_format(args.utc_time, '%b %e, %Y');\n var num = format_rollover_number(args);\n\n //highlight active bar\n svg.selectAll('g.mg-barplot .mg-bar')\n .filter(function(d, j) {\n return j === i;\n })\n .classed('active', true);\n\n //update rollover text\n if (args.show_rollover_text) {\n svg.select('.mg-active-datapoint')\n .text(function() {\n if (args.time_series) {\n var dd = new Date(+d[data_accessor]);\n dd.setDate(dd.getDate());\n\n return fmt(dd) + ' ' + label_units + num(d[label_accessor]);\n } else {\n return d[label_accessor] + ': ' + num(d[data_accessor]);\n }\n });\n }\n\n if (args.mouseover) {\n args.mouseover(d, i);\n }\n };\n };\n\n this.rolloverOff = function(args) {\n var svg = mg_get_svg_child_of(args.target);\n\n return function(d, i) {\n //reset active bar\n svg.selectAll('g.mg-barplot .mg-bar')\n .classed('active', false);\n\n //reset active data point text\n svg.select('.mg-active-datapoint')\n .text('');\n\n if (args.mouseout) {\n args.mouseout(d, i);\n }\n };\n };\n\n this.rolloverMove = function(args) {\n return function(d, i) {\n if (args.mousemove) {\n args.mousemove(d, i);\n }\n };\n };\n\n this.windowListeners = function() {\n mg_window_listeners(this.args);\n return this;\n };\n\n this.init(args);\n }", "function createBars(vals) {\n var barLeft;\n if (that.model.get(\"columnShift\")) {\n barLeft = \" style=left:\" + that.model.get(\"columnShift\") + \"px\";\n }\n var html = [\"<div class='bars'\" + barLeft + \">\"];\n for (var i = 0; i < vals.length; i++) {\n html.push(\"<div class='bar bar\" + (i + 1) + \"' style='height:\" + Math.round(100 * vals[i]) + \"%'></div>\");\n }\n html.push(\"</div>\");\n return html.join(\"\");\n }", "function barChart(args) {\n this.args = args;\n\n this.init = function(args) {\n this.args = args;\n\n raw_data_transformation(args);\n process_categorical_variables(args);\n init(args);\n\n this.is_vertical = (args.bar_orientation === 'vertical');\n\n if (this.is_vertical) {\n x_axis_categorical(args);\n y_axis(args);\n } else {\n x_axis(args);\n y_axis_categorical(args);\n }\n\n this.mainPlot();\n this.markers();\n this.rollover();\n this.windowListeners();\n\n return this;\n };\n\n this.mainPlot = function() {\n var svg = mg_get_svg_child_of(args.target);\n var data = args.data[0];\n var barplot = svg.select('g.mg-barplot');\n var fresh_render = barplot.empty();\n\n var bars;\n var predictor_bars;\n var pp, pp0;\n var baseline_marks;\n\n var perform_load_animation = fresh_render && args.animate_on_load;\n var should_transition = perform_load_animation || args.transition_on_update;\n var transition_duration = args.transition_duration || 1000;\n\n // draw the plot on first render\n if (fresh_render) {\n barplot = svg.append('g')\n .classed('mg-barplot', true);\n }\n\n bars = bars = barplot.selectAll('.mg-bar')\n .data(data);\n\n bars.exit().remove();\n\n bars.enter().append('rect')\n .classed('mg-bar', true);\n\n if (args.predictor_accessor) {\n predictor_bars = barplot.selectAll('.mg-bar-prediction')\n .data(data);\n\n predictor_bars.exit().remove();\n\n predictor_bars.enter().append('rect')\n .classed('mg-bar-prediction', true);\n }\n\n if (args.baseline_accessor) {\n baseline_marks = barplot.selectAll('.mg-bar-baseline')\n .data(data);\n\n baseline_marks.exit().remove();\n\n baseline_marks.enter().append('line')\n .classed('mg-bar-baseline', true);\n }\n\n var appropriate_size;\n\n // setup transitions\n if (should_transition) {\n bars = bars.transition()\n .duration(transition_duration);\n\n if (predictor_bars) {\n predictor_bars = predictor_bars.transition()\n .duration(transition_duration);\n }\n\n if (baseline_marks) {\n baseline_marks = baseline_marks.transition()\n .duration(transition_duration);\n }\n }\n\n // move the barplot after the axes so it doesn't overlap\n svg.select('.mg-y-axis').node().parentNode.appendChild(barplot.node());\n\n if (this.is_vertical) {\n appropriate_size = args.scales.X.rangeBand()/1.5;\n\n if (perform_load_animation) {\n bars.attr({\n height: 0,\n y: args.scales.Y(0)\n });\n\n if (predictor_bars) {\n predictor_bars.attr({\n height: 0,\n y: args.scales.Y(0)\n });\n }\n\n if (baseline_marks) {\n baseline_marks.attr({\n y1: args.scales.Y(0),\n y2: args.scales.Y(0)\n });\n }\n }\n\n bars.attr('y', args.scalefns.yf)\n .attr('x', function(d) {\n return args.scalefns.xf(d) + appropriate_size/2;\n })\n .attr('width', appropriate_size)\n .attr('height', function(d) {\n return 0 - (args.scalefns.yf(d) - args.scales.Y(0));\n });\n\n\n if (args.predictor_accessor) {\n pp = args.predictor_proportion;\n pp0 = pp-1;\n\n // thick line through bar;\n predictor_bars\n .attr('y', function(d) {\n return args.scales.Y(0) - (args.scales.Y(0) - args.scales.Y(d[args.predictor_accessor]));\n })\n .attr('x', function(d) {\n return args.scalefns.xf(d) + pp0*appropriate_size/(pp*2) + appropriate_size/2;\n })\n .attr('width', appropriate_size/pp)\n .attr('height', function(d) {\n return 0 - (args.scales.Y(d[args.predictor_accessor]) - args.scales.Y(0));\n });\n }\n\n if (args.baseline_accessor) {\n pp = args.predictor_proportion;\n\n baseline_marks\n .attr('x1', function(d) {\n return args.scalefns.xf(d)+appropriate_size/2-appropriate_size/pp + appropriate_size/2;\n })\n .attr('x2', function(d) {\n return args.scalefns.xf(d)+appropriate_size/2+appropriate_size/pp + appropriate_size/2;\n })\n .attr('y1', function(d) { return args.scales.Y(d[args.baseline_accessor]); })\n .attr('y2', function(d) { return args.scales.Y(d[args.baseline_accessor]); });\n }\n } else {\n appropriate_size = args.scales.Y.rangeBand()/1.5;\n\n if (perform_load_animation) {\n bars.attr('width', 0);\n\n if (predictor_bars) {\n predictor_bars.attr('width', 0);\n }\n\n if (baseline_marks) {\n baseline_marks.attr({\n x1: args.scales.X(0),\n x2: args.scales.X(0)\n });\n }\n }\n\n bars.attr('x', args.scales.X(0))\n .attr('y', function(d) {\n return args.scalefns.yf(d) + appropriate_size/2;\n })\n .attr('height', appropriate_size)\n .attr('width', function(d) {\n return args.scalefns.xf(d) - args.scales.X(0);\n });\n\n if (args.predictor_accessor) {\n pp = args.predictor_proportion;\n pp0 = pp-1;\n\n // thick line through bar;\n predictor_bars\n .attr('x', args.scales.X(0))\n .attr('y', function(d) {\n return args.scalefns.yf(d) + pp0 * appropriate_size/(pp*2) + appropriate_size / 2;\n })\n .attr('height', appropriate_size / pp)\n .attr('width', function(d) {\n return args.scales.X(d[args.predictor_accessor]) - args.scales.X(0);\n });\n }\n\n if (args.baseline_accessor) {\n pp = args.predictor_proportion;\n\n baseline_marks\n .attr('x1', function(d) { return args.scales.X(d[args.baseline_accessor]); })\n .attr('x2', function(d) { return args.scales.X(d[args.baseline_accessor]); })\n .attr('y1', function(d) {\n return args.scalefns.yf(d) + appropriate_size / 2 - appropriate_size / pp + appropriate_size / 2;\n })\n .attr('y2', function(d) {\n return args.scalefns.yf(d) + appropriate_size / 2 + appropriate_size / pp + appropriate_size / 2;\n });\n }\n }\n\n return this;\n };\n\n this.markers = function() {\n markers(args);\n return this;\n };\n\n this.rollover = function() {\n var svg = mg_get_svg_child_of(args.target);\n var g;\n\n //remove the old rollovers if they already exist\n svg.selectAll('.mg-rollover-rect').remove();\n svg.selectAll('.mg-active-datapoint').remove();\n\n //rollover text\n svg.append('text')\n .attr('class', 'mg-active-datapoint')\n .attr('xml:space', 'preserve')\n .attr('x', args.width - args.right)\n .attr('y', args.top / 2)\n .attr('dy', '.35em')\n .attr('text-anchor', 'end');\n\n g = svg.append('g')\n .attr('class', 'mg-rollover-rect');\n\n //draw rollover bars\n var bar = g.selectAll(\".mg-bar-rollover\")\n .data(args.data[0]).enter()\n .append(\"rect\")\n .attr('class', 'mg-bar-rollover');\n\n if (this.is_vertical) {\n bar.attr(\"x\", args.scalefns.xf)\n .attr(\"y\", function() {\n return args.scales.Y(0) - args.height;\n })\n .attr('width', args.scales.X.rangeBand())\n .attr('height', args.height)\n .attr('opacity', 0)\n .on('mouseover', this.rolloverOn(args))\n .on('mouseout', this.rolloverOff(args))\n .on('mousemove', this.rolloverMove(args));\n } else {\n bar.attr(\"x\", args.scales.X(0))\n .attr(\"y\", args.scalefns.yf)\n .attr('width', args.width)\n .attr('height', args.scales.Y.rangeBand()+2)\n .attr('opacity', 0)\n .on('mouseover', this.rolloverOn(args))\n .on('mouseout', this.rolloverOff(args))\n .on('mousemove', this.rolloverMove(args));\n }\n return this;\n };\n\n this.rolloverOn = function(args) {\n var svg = mg_get_svg_child_of(args.target);\n var label_accessor = this.is_vertical ? args.x_accessor : args.y_accessor;\n var data_accessor = this.is_vertical ? args.y_accessor : args.x_accessor;\n var label_units = this.is_vertical ? args.yax_units : args.xax_units;\n\n return function(d, i) {\n svg.selectAll('text')\n .filter(function(g, j) {\n return d === g;\n })\n .attr('opacity', 0.3);\n\n var fmt = d3.time.format('%b %e, %Y');\n var num = format_rollover_number(args);\n\n //highlight active bar\n svg.selectAll('g.mg-barplot .mg-bar')\n .filter(function(d, j) {\n return j === i;\n })\n .classed('active', true);\n\n //update rollover text\n if (args.show_rollover_text) {\n svg.select('.mg-active-datapoint')\n .text(function() {\n if (args.time_series) {\n var dd = new Date(+d[data_accessor]);\n dd.setDate(dd.getDate());\n\n return fmt(dd) + ' ' + label_units + num(d[label_accessor]);\n } else {\n return d[label_accessor] + ': ' + num(d[data_accessor]);\n }\n });\n }\n\n if (args.mouseover) {\n args.mouseover(d, i);\n }\n };\n };\n\n this.rolloverOff = function(args) {\n var svg = mg_get_svg_child_of(args.target);\n\n return function(d, i) {\n //reset active bar\n svg.selectAll('g.mg-barplot .mg-bar')\n .classed('active', false);\n\n //reset active data point text\n svg.select('.mg-active-datapoint')\n .text('');\n\n if (args.mouseout) {\n args.mouseout(d, i);\n }\n };\n };\n\n this.rolloverMove = function(args) {\n return function(d, i) {\n if (args.mousemove) {\n args.mousemove(d, i);\n }\n };\n };\n\n this.windowListeners = function() {\n mg_window_listeners(this.args);\n return this;\n };\n\n this.init(args);\n }", "function drawBasic() {\n let options = {\n title: 'Stock Prices',\n chartArea: {width: '50%'},\n hAxis: {title: 'Price',minValue: 0},\n legend: { position: \"none\" }\n };\n \n let chart = new google.visualization.BarChart(document.getElementById(\"barchartValues\"));\n chart.draw(dataTable, options);\n}", "function startBar(metrics, scales){\n \t//appending the bars\n \tvar chart = canvas.append('g')\n\t\t\t\t\t.attr(\"transform\", \"translate(150,0)\")\n\t\t\t\t\t.attr('id','bars')\n\t\t\t\t\t.selectAll('rect')\n\t\t\t\t\t.data(metrics);\n\t\t\t\t\t\n\t\tchart.enter().append('rect')\n\t\t\t\t\t.attr('height',25)\n\t\t\t\t\t.attr({'x':0,'y':function(d,i){ return scales[0](i)+19; }})\n\t\t\t\t\t.style('fill',function(d,i){ return scales[1](i); })\n\t\t\t\t\t.attr('width',function(d){ return 0; });\n\n\t\t//transition\n\t var transit = d3.select(\"svg\").selectAll(\"rect\")\n\t\t\t .data(metrics) \n\t\t\t .transition()\n\t\t\t .duration(2000) \n\t\t\t .attr(\"width\", function(d) {return scales[2](d);\n\t\t\t \t });\n\n\t\t//appending text to the bars\n\t\tvar transitext = d3.select('#bars')\n\t\t\t\t\t\t.selectAll('text')\n\t\t\t\t\t\t.data(metrics) \n\t\t\t\t\t\t.enter()\n\t\t\t\t\t\t.append('text')\n\t\t\t\t\t\t.attr({'x':function(d) {return scales[2](d)-200; },'y':function(d,i){ return scales[0](i)+35; }})\n\t\t\t\t\t\t.text(function(d,i){ \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tswitch(metrics){\n\t\t\t\t\t\t\t\tcase impressions:\n\t\t\t\t\t\t\t\t\treturn metrics[i];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase clicks:\n\t\t\t\t\t\t\t\t\treturn metrics[i];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase cost:\n\t\t\t\t\t\t\t\t\treturn '$' + metrics[i];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase cpm:\n\t\t\t\t\t\t\t\t\treturn d3.format('$.3f')(metrics[i]);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase cpc:\n\t\t\t\t\t\t\t\t\treturn d3.format('$.4f')(metrics[i]);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}})\n\t\t\t\t\t\t.style({'fill':'#fff','font-size':'14px'});\n }", "displayChart() {\n //var test = this.sendData(this.datasetName)\n divTestID = this.divID;\n getData = this.gotDataFromFilter;\n var labelArray = [];\n var dataArray = [];\n var backgroundColorArray = [];\n var borderColorArray = [];\n for (var i = 0; i < getData[0].length; i++) {\n labelArray.push(getData[0][i]);\n dataArray.push(getData[1][i]);\n var color1 = Math.ceil(Math.random() * 255);\n var color2 = Math.ceil(Math.random() * 255);\n var color3 = Math.ceil(Math.random() * 255);\n backgroundColorArray.push(\"rgba(\" + color1 + \",\" + color2 + \",\" + color3 + \",\" + 0.6 + \")\");\n borderColorArray.push(\"rgba(\" + color1 + \",\" + color2 + \",\" + color3 + \",\" + 1 + \")\");\n }\n $(\".bar_chart_div\").find(\"#\" + divTestID).remove();\n var canvas = '<canvas id=\"dataset1BarChart\" width=\"400\" height=\"auto\"></canvas>';\n $(\".bar_chart_div\").append(canvas);\n var ctxBar = document.getElementById(divTestID);\n barChart = new Chart(ctxBar, {\n type: 'bar',\n data: {\n labels: labelArray,\n datasets: [{\n label: 'Bar Chart',\n data: dataArray,\n backgroundColor: backgroundColorArray,\n borderColor: borderColorArray,\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n\n }", "function drawChart() {\n var ctx = canvas.getContext('2d');\n var myBarChart = new Chart(ctx, {\n type: 'bar',\n data: data,\n // options: {\n // responsive: false\n // }\n });\n}", "function barChart(selector, data) {\n nv.addGraph(function() {\n var chart = nv.models.multiBarHorizontalChart()\n .x(function(d) { return d.label })\n .y(function(d) { return d.value })\n .margin({top: 0, right: 20, bottom: 50, left: 115})\n .showValues(false)\n .tooltips(true)\n .showLegend(false)\n .showControls(false)\n .color(keyColor);\n\n chart.yAxis\n .tickFormat(d3.format(',d'));\n\n var ds = d3.select(selector);\n ds.selectAll('div.bar').remove();\n ds.append('div').attr('class', 'bar').append('svg')\n .datum(data)\n .transition().duration(500)\n .call(chart);\n\n var labels = ds.selectAll('.nv-x text');\n labels.append('text');\n acronymizeBars(labels);\n\n nv.utils.windowResize(function() {\n chart.update;\n acronymizeBars(labels);\n });\n return chart;\n });\n}", "function renderBarGraph(feature_name, data){\n\n // Clear existing graph\n d3.selectAll(\"svg\").remove();\n\n const width = 800;\n const height = 600 - 2 * margin;\n\n // Getting counts for unique values of features\n var sample = d3.nest()\n .key(function(d) { return d[feature_name]; })\n .sortKeys(d3.ascending)\n .rollup(function(leaves) { return leaves.length; })\n .entries(data)\n\n var max_val_x= d3.max(sample, function(d) { return d.value;} );\n\n // Append svg in graph area\n var which = 0;\n var svg = d3.select(\"#graph_area\")\n .append(\"svg\")\n .attr(\"width\", \"73.75em\")\n .style(\"height\", \"42em\") \n .style(\"border\", \"1px solid\")\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin + \",\" + margin + \")\"); \n\n // Mouse drag prevent in bar graph\n d3.select(\"svg\")\n .on(\"mousedown\", function() {\n which = 1;\n })\n .on(\"mouseup\", function() {\n document.body.style.cursor = \"initial\";\n which = 0;\n })\n .on(\"mouseout\", function() {\n document.body.style.cursor = \"initial\";\n which = 0;\n })\n .on(\"mousemove\", function(){\n // Left click\n if(which == 1)\n document.body.style.cursor = \"not-allowed\";\n \n });\n \n // Color schema for the bars\n var colorSchema = d3.scaleOrdinal()\n .domain(sample.map((s) => s.key))\n .range(d3.schemeSet3);\n\n // Tip added on bar hover\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) { \n return \"<span style='text-align:center;color:\"+colorSchema(d.key)+\"'> Value<sub>x</sub> - \" + d.key + \"<br> Frequency - \" + d.value + \"</span>\";\n })\n\n svg.call(tip);\n\n // Linear y scale \n yScale = d3.scaleLinear()\n .range([height, 0])\n .domain([0, max_val_x+ 50]);\n\n // Y scale append\n svg.append('g')\n .attr(\"transform\", \"translate(\" + margin + \", 0)\")\n .transition()\n .duration(axis_transition_time)\n .call(d3.axisLeft(yScale));\n\n // Scale banding the x scale for categorical data\n xScale = d3.scaleBand()\n .range([0, width])\n .domain(sample.map((s) => s.key))\n .padding(0.2)\n\n // Append the x axis\n svg.append('g')\n .attr('transform', `translate(`+margin+`, ${height})`)\n .transition().duration(axis_transition_time)\n .call(d3.axisBottom(xScale))\n .selectAll('text')\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"-1em\")\n .attr(\"dy\", \"-.3em\")\n .attr(\"transform\", \"rotate(-65)\");\n\n\n // Append bars on svg\n var bars = svg.selectAll()\n .data(sample)\n .enter()\n .append('rect')\n .attr('x', (s) => xScale(s.key)+margin)\n .attr('y', height)\n .attr('height', 0)\n .attr('width', xScale.bandwidth())\n .attr(\"fill\", (s) => colorSchema(s.key))\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .on('mouseenter', function (s, i) {\n\n d3.select(this)\n .transition()\n .duration(200)\n .attr('opacity', 0.6)\n .attr('x', (s) => xScale(s.key) +margin -5)\n .attr('y', (s) => yScale(s.value))\n .attr('width', xScale.bandwidth() + 10)\n .attr('height', (s) => height - yScale(s.value) + 10)\n .style(\"transform\", \"scale(1,0.979)\"); \n\n // Reference line for y values of rect \n d3.select('svg').select('g')\n .append('line')\n .attr('id','ref-line')\n .attr('x1', 0)\n .attr('y1', yScale(s.value))\n .attr('x2', width)\n .attr('y2', yScale(s.value))\n .attr('transform','translate('+margin+',0)')\n .attr(\"stroke-width\", 1)\n .attr(\"stroke\", \"red\");\n\n d3.select('svg').select('g')\n .append('text')\n .attr('id','ref-text')\n .attr('x', width + margin + 5)\n .attr('y', yScale(s.value))\n .style('fill','white')\n .text(s.value);\n\n })\n .on('mouseleave', function (actual, i) {\n d3.select(this)\n .attr(\"opacity\", 1)\n .transition()\n .duration(200)\n .attr('x', (s) => xScale(s.key) +margin)\n .attr('y', (s) => yScale(s.value))\n .attr('opacity', 1)\n .attr('width', xScale.bandwidth())\n .attr('height', (s) => height - yScale(s.value))\n .style(\"transform\", \"scale(1,1)\")\n\n // Remove ref line\n d3.select('#ref-line').remove();\n d3.select('#ref-text').remove();\n })\n\n const t = d3.transition()\n .duration(axis_transition_time);\n\n svg.selectAll('rect')\n .transition(t)\n .attr('height', (s) => height - yScale(s.value))\n .attr('y', (s) => yScale(s.value));\n\n // Labels on axis\n\n \n // x-axis label\n svg.append('text')\n .attr('y', (height) + margin + 20)\n .attr('x', width / 2 + margin)\n .attr('text-anchor', 'middle')\n .attr('fill','white')\n .style('stroke','white')\n .style('font-size',label_size)\n .style('letter-spacing',letter_spacing)\n .text(labels[feature_name]['x']);\n\n // title\n svg.append('text')\n .attr('x', width / 2 + margin)\n .attr('y', -20)\n .attr('text-anchor', 'middle')\n .attr('fill','white')\n .style('stroke','white')\n .style('font-size',label_size)\n .style('letter-spacing',letter_spacing)\n .text(labels[feature_name]['title'])\n\n // y-axis label\n svg.append('text')\n .attr('x', - height/2)\n .attr('y', margin / 2.5 )\n .attr('transform', 'rotate(-90)')\n .attr('text-anchor', 'middle')\n .attr('fill','white')\n .style('stroke','white')\n .style('font-size',label_size)\n .style('letter-spacing','3')\n .text(labels[feature_name]['y']);\n\n\n // y axis marker\n svg.append('text')\n .attr('y', 20 )\n .attr('x', -20) \n .attr('transform', 'rotate(-90)')\n .attr('fill','white')\n .style('stroke','white')\n .style('font-size',\"10px\")\n .text('y -->')\n\n // x axis marker\n svg.append('text')\n .attr('x', width + 40)\n .attr('y', height + 50) \n .attr('fill','white')\n .style('stroke','white')\n .style('font-size',\"10px\")\n .text('x -->')\n \n}", "function bar_charts(count=false,velocity=false,strike=false) {\n var pitch_types_array = Object.keys(types);\n\n if (count) {\n var counts = [];\n\n for (i = 0; i < pitch_types_array.length; i++) {\n counts.push(types[pitch_types_array[i]]['count']);\n };\n\n chart_builder('canvas1', 'bar', \"# of Pitches\", counts, \"Pitch Count\");\n }\n\n if (velocity) {\n var velocities = [];\n\n for (i = 0; i < pitch_types_array.length; i++) {\n velocities.push(Math.round(types[pitch_types_array[i]]['avg_velocity']));\n };\n\n chart_builder('canvas2', 'bar', \"Avg. Velocity\", velocities, \"Average Velocity\");\n }\n\n if (strike) {\n var strikes = [];\n\n for (i = 0; i < pitch_types_array.length; i++) {\n strikes.push(Math.round(types[pitch_types_array[i]]['strike%']));\n };\n\n chart_builder('canvas3', 'bar', \"Strike %\", strikes, \"Strike Percentage\");\n }\n\n\n}", "function drawChart(data,selector,padding){\n var max = Math.max.apply(Math, data);\n var chart = document.querySelector(selector);\n var barwidth = ((chart.offsetWidth-(values.length-1)*padding-(data.length)*10)/data.length);\n var sum = data.reduce(function(pv, cv) { return pv + cv; }, 0);\n var left = 0;\n for (var i in data){\n var newbar = document.createElement('div');\n newbar.setAttribute(\"class\", \"bar\");\n newbar.style.width=barwidth+\"px\";\n newbar.style.height=((data[i]/max)*100)+\"%\";\n newbar.style.left=left+\"px\";\n chart.appendChild(newbar);\n left += (barwidth+padding+10);\n }\n}", "function displaySavedBarCharts(){\n var chartsObj = getAllBarChartObjects();\n displayListOfCharts(chartsObj);\n}" ]
[ "0.78678536", "0.7800753", "0.7373784", "0.72033334", "0.7177757", "0.7111624", "0.71062815", "0.7093427", "0.7078036", "0.70710635", "0.70667", "0.69942605", "0.6988119", "0.69647324", "0.6939461", "0.6921477", "0.6888767", "0.68878615", "0.6878645", "0.68233407", "0.6739321", "0.6735642", "0.67314535", "0.6712537", "0.6679385", "0.6677706", "0.6673632", "0.6672609", "0.66668564", "0.6656445", "0.66488075", "0.66483784", "0.6642746", "0.6636403", "0.6625338", "0.6619563", "0.66057116", "0.65919596", "0.6590153", "0.6572067", "0.6555911", "0.65453833", "0.6539715", "0.6538953", "0.65374935", "0.6505583", "0.64982295", "0.6475789", "0.6474276", "0.64573586", "0.6456589", "0.64508754", "0.6445701", "0.64417773", "0.64412004", "0.64353067", "0.64341027", "0.6429063", "0.64243054", "0.6412253", "0.640957", "0.6409038", "0.640629", "0.640176", "0.6399011", "0.639821", "0.639721", "0.63770235", "0.63770235", "0.63733375", "0.63706356", "0.6367121", "0.6366078", "0.6362618", "0.6350711", "0.63482636", "0.6343342", "0.6338447", "0.63370425", "0.63345623", "0.6330754", "0.63262486", "0.63260573", "0.6323346", "0.63162124", "0.63138944", "0.6307932", "0.6305854", "0.6304691", "0.63019377", "0.63008946", "0.6300706", "0.62970316", "0.6294205", "0.628871", "0.62866616", "0.62866175", "0.62865865", "0.6285947", "0.6281637", "0.6279573" ]
0.0
-1
This resizes the blanket to fit the height of the page because there is not height=100% attribute. This also centers the popUp vertically.
function blanket_size(popUpDivVar){ if(typeof window.innerWidth!='undefined'){ viewportheight=window.innerHeight; } else{ viewportheight=document.documentElement.clientHeight; } if((viewportheight>document.body.parentNode.scrollHeight)&&(viewportheight>document.body.parentNode.clientHeight)){ blanket_height=viewportheight; } else{ if(document.body.parentNode.clientHeight>document.body.parentNode.scrollHeight){ blanket_height=document.body.parentNode.clientHeight; } else{ blanket_height=document.body.parentNode.scrollHeight; } } var blanket=document.getElementById('blanket');blanket.style.height=blanket_height+'px'; var popUpDiv=document.getElementById(popUpDivVar); popUpDiv_height=blanket_height/1.5; popUpDiv.style.top=popUpDiv_height+'px'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoResize() {\n var h = $(window).height() - 120;\n if (hasFooter) h -= 90;\n if (h < 400) h = 400;\n popup.height(h);\n popup.trigger('aweresize');\n }", "function setPopupMaxHeight() {\n $(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));\n $(modalPopupContainer).css('margin-top', (-($(modalPopupContainer).height() / 2)));\n}", "function setPopupMaxHeight() {\n var maxHeight = \"max-height\";\n var marginTop = \"margin-top\";\n var body = \"body\";\n $(modalPopupContent).css(maxHeight, ($(body).height() - ($(body).height() / 100 * 30)));\n $(modalPopupContainer).css(marginTop, (-($(modalPopupContainer).height() / 2)));\n}", "function setHeight() {\r\n\t\twindowHeight = jQuery(window).innerHeight();\r\n\t\tjQuery('.content-admin-wraper , .aon-custo-map-iner , .full-screen-content').css('min-height', windowHeight);\r\n\t}", "function setHeiHeight() {\n\t $('.full__height').css({\n\t minHeight: $(window).height() + 'px'\n\t });\n\t}", "function setHeiHeight() {\n\t $('.full__height').css({\n\t minHeight: $(window).height() + 'px'\n\t });\n\t}", "function setOverlayHeight() {\n if ($(window).height() < $(document).height()) {\n $overlay.css({height: $(document).height() + 'px'});\n $iframe.css({height: $(document).height() + 'px'});\n } else {\n $overlay.css({height: '100%'});\n }\n }", "function fitDialog(ob) {\r\n\tvar winh = $(window).height();\r\n\tvar thisHeight = $(ob).height();\r\n\tvar dialogCollapsedOnMobile = (isMobileDevice && thisHeight < 50);\r\n\tif ((thisHeight+110) >= winh || dialogCollapsedOnMobile) {\r\n\t\t// Set new height to be slightly smaller than window size\r\n\t\t$(ob).dialog('option', 'height', winh-30);\r\n\t\t// If height somehow ends up as 0 (tends to happen on mobile devices)\r\n\t\tif (dialogCollapsedOnMobile) {\r\n\t\t\t$(ob).height(winh - 85);\r\n\t\t}\r\n\t\t// Center it\r\n\t\t$(ob).dialog('option', 'position', [\"center\",10]);\r\n\t}\r\n}", "function setInfoPaneHeight() {\n var tabBarHeight = $(\".tabBar\").outerHeight(true);\n var regimenTitleBarHeight = $(\".regimenTitleBar\").outerHeight(true);\n var pageTitleRowHeight = 0;\n var $comparePage = $(\".comparePage\");\n var $resizeTarget = -1;\n if ($comparePage.css(\"display\") != \"none\") {\n pageTitleRowHeight = $comparePage.children(\".comparePageTitles\").outerHeight(true);\n } else {\n $.each($(\".page\"), function () {\n var $page = $(this);\n if ($page.css(\"display\") != \"none\") {\n pageTitleRowHeight = $page.children(\".pageTitles\").outerHeight(true);\n }\n });\n }\n\n var height = (currentWindowHeight - tabBarHeight - regimenTitleBarHeight - pageTitleRowHeight) + \"px\";\n $comparePage.children(\".compareRows\").css(\"height\", height);\n $(\".pageRowScrollContainer\").css(\"height\", height);\n\n adjustPagesForScrollBar();\n }", "function aonResizeBody(){\r\n\t\r\n\tif (document.body) {\r\n\t\ty = document.body.clientHeight;\r\n\t}else if (document.documentElement && document.documentElement.clientHeight) {\r\n\t\ty = document.documentElement.clientHeight;\t\t\r\n\t}\r\n\tif (self.innerHeight) {\r\n\t\t//FF\r\n\t\ty = self.innerHeight;\r\n\t}\r\n\t\r\n\tvar headerHeight=0;\r\n\tvar toolbarHeight=0;\r\n\r\n\tvar subtitleHeight=0;\r\n\tvar footerHeight=0;\r\n\tvar errorsHeight=0;\r\n\tvar windowPopUpHeaderHeight=0;\r\n\tvar windowPopUpFooterHeight=0;\r\n\tvar windowPopUpTitleHeight=0;\r\n\tvar hpHypercubeHeight=0;\r\n\tvar titleHeight=0;\r\n\tvar hpHypercube=0;\r\n\t\r\n\tvar headerRegion=document.getElementById(\"aon-header-container\");\t\r\n\tvar toolbarRegion=document.getElementById(\"aon-general-toolbar\");\r\n\tvar subtitleRegion=document.getElementById(\"aon-content-subtitle\");\r\n\t\r\n\tvar footerRegion=document.getElementById(\"aon-footer-container\");\r\n\tvar windowPopUpTitle=document.getElementById(\"aon-window-popup-title\");\r\n\tvar hpTitle=document.getElementById(\"aon-general-title\");\r\n\tvar hpHypercube=document.getElementById(\"aon-hypercube-item\");\r\n\t\r\n\t\r\n\tif(headerRegion!=null){\r\n\t\tvar headerHeight=headerRegion.offsetHeight;\r\n\r\n\t}\r\n\tif(toolbarRegion!=null){\r\n\t\tvar toolbarHeight=toolbarRegion.offsetHeight;\t\r\n\t\t}\r\n\tif(hpTitle!=null){\r\n\t\tvar titleHeight=hpTitle.offsetHeight;\r\n\r\n\t}\r\n\tif(subtitleRegion!=null){\r\n\t\tvar subtitleHeight=subtitleRegion.offsetHeight;\t\r\n\t\r\n\t}\r\n\tif(footerRegion!=null){\r\n\t\tvar footerHeight=footerRegion.offsetHeight;\t\r\n\r\n\t}\r\n\tif(windowPopUpTitle!=null){\r\n\t\tvar windowPopUpTitleHeight=windowPopUpTitle.offsetHeight;\t\t\t\r\n\r\n\t}\r\n\r\n\tvar remain_height = headerHeight + toolbarHeight + titleHeight + subtitleHeight + footerHeight + windowPopUpTitleHeight ;\r\n\tvar el = document.getElementById(\"aon-scroll-area\");\r\n\tvar sidebar=document.getElementById(\"aon-sidebar-region\");\r\n\r\n\tif(el){\t\r\n\t\tif((y-remain_height)>0){\r\n\t\t\tel.style.height= (y-remain_height) + \"px\";\t\t\t\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tel.style.height=\"0px\";\r\n\t\t}\r\n\r\n\t}\r\n\tif(sidebar){\t\r\n\t\t\r\n\t\tif((y-remain_height)>0){\r\n\t\t\tsidebar.style.height= (y-remain_height) + \"px\";\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsidebar.style.height=\"0px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\telem = document.getElementById(\"actual_tree_node\");\r\n\tif (elem) {\r\n\t\tdocument.location = \"#actual_tree_node\";\r\n\t}\r\n\r\n\treturn false;\r\n}", "function maintain_popup_size_position(){ \n\tvar hero_width = jQuery(window).width();\n\tvar hero_height = jQuery(window).height();\n\tvar popup_resize_height = (hero_height - 200);\n\tvar popup_inner_height = (popup_resize_height - 50);\n\tvar popup_top_margin_offset = (popup_inner_height / 2);\n\tjQuery('.hero_popup_resize').css({\n\t\t'height': popup_resize_height +'px',\n\t\t'margin-top': '-'+ popup_top_margin_offset +'px'\n\t});\n\tjQuery('.hero_popup_inner').css({\n\t\t'height': popup_inner_height +'px'\n\t});\n\tjQuery('.hero_popup_main').css({\n\t\t'height': hero_height +'px'\n\t});\n}", "function resizeHeightPage() {\n\t\tvar newSizeH = sizeWin-recalculPadding(pages);\n\t\tconsole.log(newSizeH);\n\t\tpages.css({\"min-height\":sizeWin});\n\t}", "autoIFrameHeight() {\n let iframe = $(parent.document).find('iframe.bsw-iframe-modal');\n if (iframe.length === 0) {\n return;\n }\n\n let minHeight = parseInt(iframe.data('min-height'));\n let maxHeight = parseInt(iframe.data('max-height'));\n let overOffset = iframe.data('over-offset');\n let debugHeight = iframe.data('debug-height');\n\n minHeight = minHeight ? minHeight : 0;\n maxHeight = maxHeight ? maxHeight : 0;\n if (!minHeight && !maxHeight) {\n return;\n }\n\n let content = $('.bsw-content');\n let height = content.height() + bsw.pam(content.parent(), content).column;\n height = Math.ceil(height);\n if (debugHeight) {\n bsw.info(`Real iframe height: ${height}`);\n }\n\n if (!maxHeight) {\n maxHeight = bsw.popupCosySize(false, parent.document).height;\n }\n if (minHeight > maxHeight) {\n minHeight = maxHeight;\n }\n\n let latest = height;\n if (height < minHeight) {\n latest = minHeight;\n } else if (height > maxHeight) {\n latest = maxHeight;\n }\n\n if (overOffset === 'no' && Math.abs(height - latest) > bsw.cnf.autoHeightOffset) {\n return;\n }\n\n iframe.animate({height: latest}, bsw.cnf.autoHeightDuration);\n }", "function popupAutoResize4Param(lloutputVisi){\n if(popupDiv == null || popupDiv.style.display == \"hidden\") return;\n \n var popupIframe = document.getElementById(iframeid);\n var paramPopupframe = popupIframe.contentDocument.getElementsByTagName('frame')[0]\n var popupBody =paramPopupframe.contentDocument.body;\n var paramPopDoc =paramPopupframe.contentDocument.documentElement;\n popupBody.style.display=\"inline-block\";\n \n var contentHeight = popupBody.clientHeight\n var contentWidth = popupBody.clientWidth\n //22621017 22622613 \n var savedOverflow = popupBody.style.overflow;\n popupBody.style.overflow=\"hidden\";\n var widthGap = 0;\n if('visible' == lloutputVisi)\n {\n //21361323\n contentHeight = (popupBody.scrollHeight>paramPopDoc.scrollHeight?popupBody.scrollHeight:paramPopDoc.scrollHeight);\n contentWidth= (popupBody.scrollWidth>paramPopDoc.scrollWidth?popupBody.scrollWidth:paramPopDoc.scrollWidth) ;\n }\n //Bug 20452417:haiyulin Popup double scroll bar\n //bug 20900392 scroll bar issue\n var newHeight = contentHeight+5;\n contentWidth+=2;\n //The auto resize functionality should ensure that the popup size should be \n //atleast 10%px lesser than the browser boundary 20415059\n var windowSize = getWindowSize();\n if(contentWidth > windowSize.width) contentWidth = parseInt(windowSize.width*0.9); \n if(contentHeight > windowSize.height) newHeight = parseInt(windowSize.height*0.9)-50;\n \n popupIframe.style.width = \"100%\";\n popupIframe.style.height = \"100%\";\n //popupContent div\n var popupContentDiv = popupIframe.parentNode;\n popupContentDiv.style.height = newHeight+_PX;\n\n var popupWrapper = popupDiv.firstChild;\n var contentPadding = getPadding(popupWrapper.lastChild);\n newHeight += contentPadding[\"paddingHeight\"];\n contentWidth += contentPadding[\"paddingWidth\"];\n \n //calculate the contentsize base on the title size\n var contentSize = _pGetContentSize(popupDiv,contentWidth,newHeight);\n contentWidth = contentSize[0];\n newHeight = contentSize[1];\n widthGap = contentWidth-parseInt(popupDiv.style.width);\n //resize the popupDiv\n pChangeSize(popupWrapper,contentWidth, newHeight);\n pChangeSize(popupDiv,contentWidth, newHeight);\n \n //get the final position[top,left] when popupDiv resize to the content size \n var postion = _pGetPostionOfPopupDiv(contentWidth,newHeight);\n //change popupDiv position\n pChangePostion(popupDiv,postion.aimLeft,postion.aimTop);\n //Bug 21384348\n popupContentDiv.style.overflow=\"hidden\";\n //we need to position popup agian after the size change.\n //if popup is dragged ,leave it in the same position.\n var lookaheadEvent = ('visible' == lloutputVisi || 'hidden' == lloutputVisi);\n if(!(isPopupDrag || lookaheadEvent))\n positionPopupDiv();\n //22570403 lookahead coming within the param popup\n else if(lookaheadEvent && isBiDi() && popupDiv.xDir ==\"right\")\n popupDiv.style.left = (parseInt(popupDiv.style.left)-widthGap)+_PX\n \n //revert;\n popupDiv.style.zIndex = popupDiv.savedZIndex;\n popupDiv.savedZIndex = undefined;\n popupBody.style.overflow=savedOverflow;\n \n //register resize event on paramPopupframe to handle submit in popup.\n pAttachEvent(paramPopupframe,[\"onload\",\"load\"], popupAutoResize4Param,false);\n \n //register resize event on pprIframe within popup to handle ppr happens in popup.\n var pprIframe= paramPopupframe.contentDocument.getElementById(\"_pprIFrame\");\n pAttachEvent(pprIframe,[\"onload\",\"load\"], popupAutoResize4Param,false);\n \n}", "updateSizeConstraints_() {\n if (this.element_) {\n var headerEl = this.element_.find('.modal-header');\n var bodyEl = this.element_.find('.modal-body');\n var footerEl = this.element_.find('.modal-footer');\n\n var windowHeight = $(window).height() || 0;\n var padding = this.element_.hasClass('modal-huge') ? 12 : Math.floor(windowHeight * 0.1);\n var headerHeight = headerEl.outerHeight() || 0;\n var footerHeight = footerEl.outerHeight() || 0;\n var bodyOffset = (parseInt($('body').css('margin-top'), 10) || 0) +\n (parseInt($('body').css('padding-top'), 10) || 0);\n var maxBodyHeight = (windowHeight - (bodyOffset + padding * 2 + footerHeight + headerHeight));\n\n bodyEl.css({\n 'max-height': maxBodyHeight + 'px'\n });\n }\n }", "function body_resize() {\r\n\t\t\t\tvar height = $(window).height();\r\n\t\t\t\tif(height >854) {\r\n\t\t\t\t//calculate the height of the rest of visible components\r\n\t\t\t\tvar subtract = parseInt($(\"#body_main\").css(\"height\"),10)+parseInt($(\"#body_main\").css(\"margin-top\"),10)+134;\r\n\t\t\t\tvar div_height = (height - subtract) + 'px';\r\n\t\t\t\t$(\"#body_bottom\").css('height',div_height);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}", "function getNewHeight(){\r\n\tvar top=dojo.style(\"details_land\",\"height\");\r\n\tvar title=dojo.style(\"pageHeader\",\"height\");\r\n\tvar newHeight=top-title;\r\n\tdojo.style(\"pageBottom\",\"maxHeight\",newHeight + \"px\");\r\n}", "function setHeight(){\r\n var windowHeight = $(window).height();\r\n if($('.gallery-wrapper').length > 0) {\r\n $('.gallery-wrapper').css('height', windowHeight)\r\n } else {\r\n var footerHeight = $('.footer').css('height').replace(/[^-\\d\\.]/g, '')\r\n windowHeight = windowHeight - footerHeight\r\n $('.error-wrapper').css('height', windowHeight)\r\n }\r\n\r\n $('.gallery-wrapper').css('opacity', '1')\r\n }", "function doResizeStuff() {\n checkTextWidths();\n $('#mainwindow').height($(document).height() -35);\n}", "function rescale(modalId) {\r\n\r\n var size = {\r\n height: $(window).height()\r\n };\r\n\r\n // CALCULATE SIZE\r\n var offset = 20;\r\n var offsetBody = 300;\r\n\r\n // SET SIZE\r\n\r\n $('.modal-body').css('max-height', size.height - (offset + offsetBody));\r\n\r\n // only use the appropriate height\r\n if ($('.modal-body').height() < size.height - 100) {\r\n $(modalId).css('height', $('.modal-body').css('max-height') + 100);\r\n }\r\n\r\n // \r\n else {\r\n $(modalId).css('height', size.height - offset);\r\n $(modalId).css('top', 0);\r\n }\r\n//\t}\r\n }", "function initialSize() {\r\n let iwidth = $('#iframe').width();\r\n let iheight = iwidth * (0.5625); // 16:9 ratio //\r\n $('#iframe').height(iheight);\r\n }", "function setHeight() {\n\t\t\tvar vph = $(window).height();\n\t\t\t$('#tg-main.tg-searchlist-v2 .tg-map, #tg-main.tg-searchlist-v2 .tg-search-result').css('height', vph);\n\t\t}", "function adjustscIframeH(contentDocument) {\n try {\n //$('#ifrm-sc').height(contentDocument.body.scrollHeight);\n\n $('#ifrm-sc').height(contentDocument.body.offsetHeight);\n\n $('#modSC .modal-body').height(Math.min($(window).height() - $('.modal-header').outerHeight() - 15, contentDocument.body.scrollHeight));\n // $('#modSC .modal-body').height($(window).height() - $('.modal-header').outerHeight() - 15);\n // $('#ifrm-sc').iFrameResize();\n } catch (e) {\n console.log(e);\n }\n}", "function reportSize() {\n var height = document.body.clientHeight;\n window.parent.postMessage(JSON.stringify({\n type: 'height',\n height: height\n }), '*');\n }", "function setHeight() {\n\n\n $('.js-head-height').css('height', 'auto');\n var maxHeight2 = Math.max.apply(null, $(\".js-head-height\").map(function() {\n return $(this).height();\n }).get());\n $('.js-head-height').height(maxHeight2);\n\n\n }", "function adjustHeight(){\n\t\t\t\t\t\t var viewportHeight = jQuery(window).height();\n\t\t\t\t\t var canvasHeight = jQuery('nav.full_vertical').height(); \n\t\t\t\t\t\t var newHeight = canvasHeight;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(canvasHeight < viewportHeight) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t var newHeight = viewportHeight\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t jQuery(\"body, .off-canvas, #responsive-nav-overlay\").css({'height': newHeight, 'overflow': 'hidden'});\n\t\t\t\t\t }", "function resizeReportFrame() {\r\n\tvar frame = jQuery(\"#birtViewer\");\r\n\tframe.height(frame.contents().find(\".style_0\").height() + 170);\r\n}", "function fitToPage(){\n\t$('#textContainer').height($(window).height() - ($('#toolBar').height()*2) - 20);\n}", "function fix_height() {\n\t\tvar heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n\t\t$(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\t\tvar windowWidth = $( window ).height();\n\t\t$(\"#page-wrapper\").css(\"min-height\", windowWidth + 'px');\n\t}", "function onIFrameResize(frm) {\n frm.height($(window).height() - frm.offset().top - 10);\n }", "function resetReportFrame() {\r\n\tjQuery(\"#birtViewer\").height(650);\r\n}", "function onepage_questions() {\n\t windowHeight = $(window).innerHeight();\n\n\t $('#surveyform > div').css('min-height', windowHeight);\n\t\t$('#surveyform > div:first-child').css('min-height', windowHeight-$(\"#headtitle\").outerHeight());\n\n\t }", "function heightDetect() {\n $(\".main_head\").css(\"height\", $(window).height());\n }", "function help_resize() {\n\t\tvar h_height = inner_size()[1];\n\t\tdocument.getElementById('general').style.height = h_height-45;\n\t\tdocument.getElementById('chat').style.height = h_height-45;\n\t\tdocument.getElementById('calendar').style.height = h_height-45;\n\t\tdocument.getElementById('inbox').style.height = h_height-45;\n\t\tdocument.getElementById('compose').style.height = h_height-45;\n\t\tdocument.getElementById('address').style.height = h_height-45;\n\t\tdocument.getElementById('folders').style.height = h_height-45;\n\t\tdocument.getElementById('search').style.height = h_height-45;\n\t\tdocument.getElementById('preferences').style.height = h_height-45;\n\t\tdocument.getElementById('credits').style.height = h_height-45;\n\t}", "function openaboutus() {\r\n document.getElementById(\"aboutus\").style.height = \"100%\";\r\n }", "function SWEPopupNNSize() \n{ \n var popWin=Top().SWEPopupWin;\n if((popWin == null) || (popWin.closed))\n popWin = window;\n\t\t\n popWin.scrollTo(10000, 10000);\n setTimeout(\"NNResize()\", 10);\n}", "orderSummaryHeightAdjust() {\n if (this.page === pageType.cart) {\n if (this.isMobile() || this.isTablet()) {\n document.querySelector('.vx-order-summary').style.maxHeight = (window.innerHeight - 186) + 'px';\n } else {\n document.querySelector('.vx-order-summary').style.maxHeight = '';\n }\n }\n }", "function getHeight(){\n\tvar usersHeight = screen.height;\n\tvar uHeight = usersHeight - 300;\n\t\t\tdocument.getElementById('container').style.minHeight=uHeight+10+\"px\";\n}", "function setSizeForPages(){\n var screen_height=$(window).height();\n $(\".fullPage\").css({\n \"position\":\"relative\",\n \"height\":screen_height+\"px\",\n \"width\":\"100%\",\n });\n $(\".fullPage-Container\").css({\n \"width\":\"100%\",\n \"position\":\"relative\",\n \"height\":_num*screen_height+\"px\",\n \"top\":-_index*screen_height+\"px\"\n });\n }", "function adjust() {\n // adjust the width:\n adjust_main_width();\n // close the popup\n $part_popup.slideUp(0);\n }", "function setHeiHeight() {\n\t $('.first__screen').css({\n\t minHeight: $(window).height() + 'px'\n\t });\n\t}", "function modalHeight() {\n console.log('*+*+*+*+*+*+*+*+ MODAL HEIGHT FUNCTION EXECUTED');\n var contentHeight = $(\".modal-content form:visible\").height(),\n pageHeight = $(window).outerHeight(),\n maxContentHeight = pageHeight - 100;\n\n if($(window).height() > contentHeight) {\n $(\".modal-content\").css({\n 'max-height' : maxContentHeight + 'px',\n 'min-height' : contentHeight + 'px'\n });\n } else {\n $(\".modal-content\").css({\n 'max-height' : '500px',\n 'min-height' : maxContentHeight + 'px'\n });\n }\n}", "function setHeight() {\n var windowHeight = $(window).innerHeight();\n $('body').css('min-height', windowHeight);\n $('#tasks_div').css('min-height', windowHeight);\n}", "setRoomSize(){\n $('#roomHolder').height(document.body.offsetHeight-60);\n }", "function _fit() {\n\t\t\t// size panels to fit window height\n\t\t\t$( \".panel\", _context ).each( function ( i ) {\n\t\t\t\tvar h = $( window ).height() - 76;\n\t\t\t\t$( this ).height( h );\n\t\t\t});\n\t\t\t$( \"section\", _context ).each( function ( i ) {\n\t\t\t\tvar h = this.parentNode.id != \"trees\" ? $( window ).height() - 111 : $( window ).height() - 101;\n\t\t\t\t$( this ).height( h );\n\t\t\t});\n\t\t\t$( \".handle > div\", _context ).each( function ( i ) {\n\t\t\t\tvar h = $( window ).height() - 101;\n\t\t\t\t$( this ).height( h );\n\t\t\t});\n\t\t\t$( \".handle > div > img\", _context ).each( function ( i ) {\n\t\t\t\tvar t = ( $( window ).height() - 125 ) / 2;\n\t\t\t\t$( this ).css( \"top\", t );\n\t\t\t});\n\t\t\t// show body if 1st time\n\t\t\tif ( ! _inited ) {\n\t\t\t\t_context.show();\n\t\t\t\t_inited = true;\n\t\t\t}\n\t\t}", "function setHeight() {\n $('.voyage').css('height', 'auto');\n var maxHeight = Math.max.apply(null, $(\".voyage\").map(function() {\n return $(this).height();\n }).get());\n $('.voyage').height(maxHeight);\n }", "function calcHeight()\n{\n\t //Cojo la altura en nuestra página\n\t var the_height=\n\t document.getElementById\n\t('iframe').contentWindow.\n\t document.body.scrollHeight;\n\t//Cambio la altura del iframe\n\t document.getElementById('iframe')\n\t.height= the_height;\n}", "function heightAdjust(ele) {\n var screenWidth = window.innerWidth; //get screen width\n if (screenWidth >= 1000) {\n ele.style.height = \"auto\";\n } else {\n ele.style.height = 0;\n }\n }", "function heightDetect() {\n\t\t$(\".main_head\").css(\"height\", $(window).height());\n\t}", "_setOverlaySize() {\r\n const overlayWidth = this.embedconsentOverlay.offsetWidth;\r\n const height = overlayWidth / (this.options.width / this.options.height);\r\n if (overlayWidth > 500) {\r\n this.embedconsentOverlay.style.height = `${parseInt(height)}px`;\r\n } else {\r\n this.embedconsentOverlay.style.height = `auto`;\r\n }\r\n }", "function setModalMaxHeight(element) {\r\r\n this.$element = $(element);\r\r\n this.$content = this.$element.find('.modal-content');\r\r\n var borderWidth = this.$content.outerHeight() - this.$content.innerHeight();\r\r\n var dialogMargin = $(window).width() < 768 ? 20 : 60;\r\r\n var contentHeight = $(window).height() - (dialogMargin + borderWidth);\r\r\n var headerHeight = this.$element.find('.modal-header').outerHeight() || 0;\r\r\n var footerHeight = this.$element.find('.modal-footer').outerHeight() || 0;\r\r\n var maxHeight = contentHeight - (headerHeight + footerHeight);\r\r\n\r\r\n this.$content.css({\r\r\n overflow: 'hidden',\r\r\n });\r\r\n\r\r\n this.$element.find('.modal-body').css({\r\r\n 'max-height': maxHeight,\r\r\n 'overflow-y': 'auto',\r\r\n });\r\r\n}", "function resizePackageFrames(){\n var listframeheight, selector, dummyheight;\n selector = $('.package_explorer');\n\n dummyheight = selector.find('.dummydiv').height()*100/selector.height();\n listframeheight = (selector.height()/3 - selector.find('.dummydiv').height())*100/selector.height();\n $('.packageListFrame').height(String(listframeheight) + '%');\n //Leave all the rest for the packageFrame\n $('.packageFrame').height(String(100 - listframeheight - dummyheight -1) + '%');\n}", "function centeredPopup(url, name, noChrome, width, height)\n{\n\tvar features;\n\tvar popupDimensions=defaultPopupDims(); //obj holds the default popuDimensions, based on Parent Window\n\t\n\t//availheight and width mostly for Opera interoperability \n\tvar myAvailWidth=getAvailWidth();\n\tvar myAvailHeight=getAvailHeight();\n\n\tif( url )\n\t{\n\t\t//handle calls using the old Mplus popup window javascript\n\t\tif(url==\"#\")\n\t\t{\n\t\t\turl='';\n\t\t}\n\t\t\n\t\tif(!name)\n\t\t{\n\t\t\tname=\"TheNewWin\";\n\t\t}\n\n\t\t//ensure width bounds checking, if it doesn't have a value, give it the default\n\t\tif( isNaN(width) )\n\t\t{\n\t\t\twidth=popupDimensions.width;\n\t\t}\n\n\t\tif(width > myAvailWidth || width < 0)\n\t\t{\n\t\t\twidth=parseInt(myAvailWidth * HSCALE);\n\t\t}\n\t\t\n\t\t//check whether this will be a chromeless window \n\t\tif( noChrome == true \n\t\t|| noChrome == \"true\" \n\t\t|| noChrome == \"True\" \n\t\t)\n\t\t{\n\t\t\t//alert(\"(\" + noChrome + \")\");\n\t\t\tfeatures='toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + width + ',';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfeatures='toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + width+ ',';\n\t\t}\n\t\t\n\t\t//if height wasn't defined get default\n\t\t//note: default height for IE will be 0, IE doesn't give us sufficient info\n\t\t//to calculate parent window dimensions\n\t\tif(!height)\n\t\t{\n\t\t\theight=popupDimensions.height;\n\t\t\t//alert(height);\n\t\t}\n\n\t\t//check the height attrib, ensure it doesn't exceed viewable real estate\n\t\t//if so, the reduce it to VSCALE set by script designer.\n\t\tif(height > myAvailHeight || height < 1)\n\t\t{\n\t\t\theight=parseInt(myAvailHeight * VSCALE -100)\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Opera 6.x Macintosh PPC requires a height value when rendering a new window (if you specify width)\n\t\t\tif( isOperaMac )\n\t\t\t{\n\t\t\t\t//alert(\"detected Macintosh Opera!\");\n\t\t\t\theight=parseInt(myAvailHeight *VSCALE);\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tfeatures+='height='+height+',';\n\t\tfeatures += getCenteredCoords(myAvailWidth,myAvailHeight,width,height);\n\t\t//alert(\"Features: \" + features);\n\t\t\n\t\tpopUpWin = window.open(url, name, features);\n\n\t\tif( window.focus && !isOperaMac)\n\t\t{\n\t\t\tpopUpWin.focus();\n\t\t}\n\t\treturn false;\n\t}\n\treturn true;\n}", "function setHeight() {\n windowHeight = $(window).innerHeight();\n $('#task-details').css('height', windowHeight - 64);\n $(\"#scroll-wrap\").css('height', windowHeight - 480);\n}", "function setFullHeight() {\n\t\tvar viewHeight = $(window).height();\n\t\tvar footerHeight = $(\"#footer\").outerHeight();\n\t\tvar codeTop = $(\".CodeMirror\").offset().top;\n\n\t\tvar availableHeight = viewHeight - footerHeight - codeTop;\n\t\tif(availableHeight < 200) {\n\t\t\tavailableHeight = 200;\n\t\t}\n\n\t\t$(\".CodeMirror\").height(availableHeight);\n\t\t$(\".full-height\").height(availableHeight);\n\t}", "function SetSize()\n\t{\n\t\tif(0 < (document.body.clientHeight - (document.all(\"RPSTopPage_tblOuter\").clientHeight + document.all(\"RPSBottomPage_lblFooter\").clientHeight +30 )))\n\t\t\tdocument.all(\"tblContainer\").height = document.body.clientHeight - (document.all(\"RPSTopPage_tblOuter\").clientHeight + document.all(\"RPSBottomPage_lblFooter\").clientHeight + 40 );\n\t\tif(0 < (document.all(\"tblContainer\").height - (document.all(\"tblButtons\").height +35 )))\n\t\t\tdocument.all(\"divglobal\").style.height = document.all(\"tblContainer\").height - (document.all(\"tblButtons\").height+10);\t\t\t\n\t\t//This is for horizontal scroll\n\t\tdocument.all(\"divglobal\").style.width = document.body.clientWidth;\n\t}", "function resizeBox() {\n\t\tvar divHeight = $('.projects.latest a img, .project-category img, .full-width.projects a img').height(); \n\t\t$('.see-all').css('min-height', divHeight+'px');\n\t}", "function popupCenter(url, width, height, name) {\n var left = (screen.width/2)-(width/2);\n var top = (screen.height/2)-(height/2);\n return window.open(url, name, \"menubar=no,toolbar=no,status=no,width=\"+width+\",height=\"+height+\",toolbar=no,left=\"+left+\",top=\"+top);\n}", "function popupAutoResize4Emb(){ \n if(popupDiv == null || popupDiv.style.display == \"hidden\") return;\n var contentDiv;\n //Bug 20428370 - NOTCH IS NOT SHOWING WHEN AUTORESIZE ENABLED\n if(document.getElementById(closeBarId) != null)\n contentDiv = _findNextElem(document.getElementById(closeBarId));\n else\n contentDiv = popupDiv.firstChild.firstChild;//21454014\n \n contentDiv.style.height = \"\";\n contentDiv.style.display=\"inline-block\";\n \n //calculate the actual size\n //Bug 20157500 - EDGE OF POPUP CLIPS OFF THE POPUP CONTENT IN AUTO RESIZE MODE \n var contentHeight = contentDiv.clientHeight;\n var contentWidth = contentDiv.scrollWidth > contentDiv.clientWidth?contentDiv.scrollWidth:contentDiv.clientWidth;\n //The auto resize functionality should ensure that the popup size should be \n //atleast 10%px lesser than the browser boundary 20415059\n var windowSize = getWindowSize();\n if(contentWidth > windowSize.width) contentWidth = parseInt(windowSize.width*0.9); \n if(contentHeight > windowSize.height) contentHeight = parseInt(windowSize.height*0.9)-50;\n \n contentDiv.style.height=contentHeight+_PX;\n contentDiv.style.display=\"\";\n //browser use Math.round to calculate the the widht and height,which is not precision in chrome.\n //add 1 px\n var contentSize = _pGetContentSize(popupDiv,contentWidth+1,contentHeight+1);\n contentWidth = contentSize[0];\n contentHeight = contentSize[1];\n //get the final position[top,left] when popupDiv resize to the content size\n var postion = _pGetPostionOfPopupDiv(contentWidth,contentHeight);\n \n //change popupDiv position\n pChangePostion(popupDiv,postion.aimLeft,postion.aimTop);\n \n var popupWrapper = popupDiv.firstChild; \n //resize the popup \n pChangeSize(popupDiv,contentWidth,contentHeight);\n pChangeSize(popupWrapper,contentWidth,contentHeight);\n //still see the scroll bar in popupDIV RTL session, Bug 21384348\n //we caculated the size ,it's fine setting it to hidden.\n popupWrapper.style.overflow=\"hidden\";\n popupDiv.style.zIndex = popupDiv.savedZIndex;\n popupDiv.savedZIndex = undefined;\n //if popup is dragged ,leave it in the same position.\n if(!isPopupDrag) \n positionPopupDiv();\n}", "function resize() {\n\t\tlet [width, height] = getScreenSize();\n\n\t\tlet pw = CS.popup.width || 300;\n\t\t$scope.style.popup.width = pw + 'px';\n\t\t$scope.style.popup.top = (height/3) + 'px';\n\t\t$scope.style.popup.left = (width - pw)/2 + 'px';\n\n\t\tlet hAdv = 101 * (CS.enableDetails && S && !S.tutorial); //height of advanced stats\n\t\t//height of canvas: (available height) - stats - ?advanced? - controls - margin\n\t\tlet hMap = height - 141 - hAdv - 241 - 10;\n\t\thMap = CS.enableGraphics ? Math.max(200, hMap) : 40;\n\n\t\tlet m = geto('map');\n\t\tif (m && m.width !== width - 2) {\n\t\t\tm.width = width - 2;\n\t\t}\n\t\tif (m && m.height !== hMap) {\n\t\t\tm.height = hMap;\n\t\t}\n\n\t\t$scope.style.stats .top = (hMap+1) + 'px';\n\t\t$scope.style.advanced.top = (hMap+142) + 'px';\n\t\t$scope.style.controls.top = (hMap+142+hAdv) + 'px';\n\t}", "function fullscreen(){\n\t\tjQuery('header').css({\n\t\t\theight: jQuery(window).height()-58+'px'\n\t\t});\n\t}", "function resizebanner() {\n $(\".fullscreen\").css(\"height\", $(window).height());\n }", "function SetHeight(){\n var h = $(window).height();\n $(\"#files-table\").height(h-200); \n}", "function preparePopupObject() {\n var height = $( window ).height() * 9 / 10; //90% with limit on 700px\n if (height > 700) {\n height = 700;\n }\n return {\n file : IMAGES_URL,\n title : \"Insert image\",\n width : $( window ).width() * 9 / 10, //90%\n height : height,\n close_previous : \"no\",\n resizable: \"yes\",\n onInit: function(e) {\n init();\n }\n };\n }", "function enlarge () {\n var ventana_ancho = $(window).height();\n $('#ingresos').css('height', ventana_ancho + 'px');\n}", "function resize() {\n\t\tself.wz.height($(window).height()-self.delta);\n\t\tself.rte.updateHeight();\n\t}", "function SWEPopupSize(bHide)\n{\n var deltaX;\n var deltaY;\n\n if (bHide && \n SWEGetPopupResizeNoHide())\n {\n return;\n }\n \n var body = document.body;\n var popWin = Top().SWEPopupWin;\n\n if (popWin == null || popWin.closed)\n {\n popWin = window;\n }\n \n if (popWin != null && !popWin.closed)\n {\n if (bHide)\n {\n //With XP SP2 it is no loger allowed to move popup offscreen\n //So we make the window of minimum possible allowed size (100,100)\n //and move it to the top left corner of the screen and using\n //alwaysLowered flag put it last in the z order \n popWin.innerWidth = 100;\n popWin.innerHeight = 100;\n popWin.screenX = 0;\n popWin.screenY = 0;\n popWin.alwaysLowered = true;\n }\n else\n {\n //reset the flag which puts popup window last in the z order\n popWin.alwaysLowered = false;\n var screenX = SWEGetAvailScreenWidth();\n var screenY = SWEGetAvailScreenHeight();\n \n if (typeof Top().SWEPopupResizeNoAuto != \"undefined\" && Top().SWEPopupResizeNoAuto)\n {\n Top().SWEPopupResizeNoAuto = false;\n //As XP SP2 does not allow popup window going offscreen which might \n //happen if the window size is larger than half of the screen size\n //we now first move the window to appropriate position and then\n //resize it\n popWin.moveTo (Math.floor((screenX-Top().SWEPopupWidth) / 2), \n Math.floor((screenY-Top().SWEPopupHeight) / 2 ));\n popWin.resizeTo (Top().SWEPopupWidth, \n Top().SWEPopupHeight);\n \n }\n else \n {\n if (SWEGetPopupResizeNoHide())\n { // 12-HJKXEX: Do not resize and hide the popup.\n SWESetPopupResizeNoHide (false);\n return;\n }\n \n var minX = (body.minWidth != null) ? body.minWidth : 0;\n var bodyX = (body.scrollWidth > minX) ? body.scrollWidth : minX;\n var bodyY = body.scrollHeight;\n var maxX = (bodyX < screenX) ? bodyX : screenX;\n var maxY = (bodyY < screenY - 0x20) ? bodyY : screenY - 0x20;\n \n deltaX = maxX - body.clientWidth;\n deltaY = maxY - body.offsetHeight+0x10; //12-DGRML5\n \n //As XP SP2 does not allow popup window going offscreen which might \n //happen if the window size is larger than half of the screen size\n //we now first move the window to appropriate position and then\n //resize it\n //FR#12-1U0A8YD - Internet Explorer hangs when user fast clicks on MVG Applet\n //Below try block is added to handle any exceptions when the user fast clicks on MVG Applet\n try\n {\n popWin.moveTo (Math.floor((screenX-maxX) / 2), \n Math.floor((screenY-maxY) / 2) );\n popWin.resizeBy (deltaX, deltaY);\n }\n catch(err)\n {\n }\n }\n }\n }\n}", "function windowSize() {\n if ($(window).width() > 750) {\n var height = $('#yui_3_17_2_1_1537367486882_130').height() + $('#header').height() + $('#footer').height(),\n exceptHeight = $('#header').height() + $('#footer').height() + 23,\n value = '100%';\n\n if (height < $(window).height()) {\n value = 'calc(100vh - ' + exceptHeight + 'px)';\n }\n\n $('.thumbnail-layout-autocolumns #projectThumbs > .wrapper').css({\n 'min-height': value\n });\n }\n}", "function setSquareHeight(){\n var windowWidth = $(window).width();\n $('.j-square').height(windowWidth);\n}", "function windowsize(){\n$(window).height(); // New height // New width \n$(\"#frame\").css(\"max-width\",$(window).width());\n$(\"#frame\").css(\"height\",$(window).height()-60);\n}", "function adjustIframeHeight(oFrm)\n {\n oFrm.style.height=oFrm.contentWindow.document.body.scrollHeight+30;\n }", "function resize() {\n const h = window.innerHeight;\n const minHeight = window.innerWidth / MIN_RATIO;\n if (h < minHeight) {\n const scale = h / minHeight;\n document.body.style.transform = 'scale(' + scale + ',' + scale + ')';\n\tdocument.body.style.height = (100/scale).toString() + '%';\n\tdocument.body.style.top = ((100-100/scale)/2).toString() + '%';\n } else if (document.body.style.transform != '') {\n document.body.style.transform = '';\n\tdocument.body.style.height = '';\n\tdocument.body.style.top = '';\n }\n}", "function resizeModalSharePoint() {\n if (SP.UI.ModalDialog != undefined) {\n var dlg = SP.UI.ModalDialog.get_childDialog();\n if (dlg != null) {\n dlg.autoSize();\n }\n }\n}", "function resizePage() {\n\tvar doRecenter = resizeFramecount == 1 ? false : true;\n\tresizeFrames();\n\tif (doRecenter) {\n\t\tif (dhxWins && dhxWins.getTopmostWindow(true))\n\t\t\tdhxWins.getTopmostWindow(true).center();\n\t\telse if (window.frames[\"resultFrame\"].dhxWins && window.frames[\"resultFrame\"].dhxWins.getTopmostWindow(true))\n\t\t\twindow.frames[\"resultFrame\"].dhxWins.getTopmostWindow(true).center();\n\t}\n}", "function Popups_PopupData_WrapPopupForHeight(parent, popup, size, maxHeight)\n{\n\t//create a div to be our wrapper\n\tvar wrapper = parent.appendChild(document.createElement(\"div\"));\n\t//set our styles\n\twrapper.style.cssText = \"position:absolute;overflow-x:visible;overflow-y:hidden;\";\n\twrapper.style.width = size.width + \"px\";\n\twrapper.style.height = maxHeight + \"px\";\n\t//add our buttons\n\twrapper.ScrollUp = wrapper.appendChild(document.createElement(\"button\"));\n\twrapper.ScrollUp.style.cssText = \"position:absolute;top:0px;left:0px;height:10px;width:100%;background-position:center;background-repeat:no-repeat;\";\n\twrapper.ScrollUp.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_scroll_up.png')\";\n\twrapper.ScrollUp.SCROLL = true;\n\t//add down button\n\twrapper.ScrollDown = wrapper.appendChild(document.createElement(\"button\"));\n\twrapper.ScrollDown.style.cssText = \"position:absolute;bottom:0px;left:0px;height:10px;width:100%;background-position:center;background-repeat:no-repeat;\";\n\twrapper.ScrollDown.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_scroll_down.png')\";\n\twrapper.ScrollDown.SCROLL = true;\n\n\t//add scrollpane\n\twrapper.ScrollPane = wrapper.appendChild(document.createElement(\"div\"));\n\twrapper.ScrollPane.style.cssText = \"position:absolute;width:100%;overflow:hidden;\";\n\twrapper.ScrollPane.style.top = wrapper.ScrollUp.offsetHeight + \"px\";\n\twrapper.ScrollPane.style.bottom = wrapper.ScrollDown.offsetHeight + \"px\";\n\t//add the popup to the scrollpane\n\twrapper.Popup = wrapper.ScrollPane.appendChild(parent.removeChild(popup));\n\t//make sure its correctly positioned\n\tpopup.style.left = \"0px\";\n\tpopup.style.top = \"0px\";\n\t//calculate scroll modifier\n\twrapper.ScrollModifier = popup.rows ? Math.ceil(size.height / popup.rows.length) : 10;\n\t//set events\n\tBrowser_AddEvent(wrapper.ScrollUp, __BROWSER_EVENT_MOUSEDOWN, Browser_BlockEvent);\n\tBrowser_AddEvent(wrapper.ScrollDown, __BROWSER_EVENT_MOUSEDOWN, Browser_BlockEvent);\n\tBrowser_AddEvent(wrapper.ScrollUp, __BROWSER_EVENT_CLICK, function () { wrapper.ScrollPane.scrollTop -= wrapper.ScrollModifier; });\n\tBrowser_AddEvent(wrapper.ScrollDown, __BROWSER_EVENT_CLICK, function () { wrapper.ScrollPane.scrollTop += wrapper.ScrollModifier; });\n\t//finally mark us on the popup itself\n\tpopup.WRAPPER = wrapper;\n\twrapper.IsWrapper = true;\n\t//return our wrapper\n\treturn wrapper;\n}", "adjustIframe(size) {\n if (this.state.fullScreen) {\n return\n }\n\n this.iFrameWindow.setAttribute('width', size.width + '')\n this.iFrameWindow.setAttribute('height', size.height + '')\n // const bounds = this.wrapper.getBoundingClientRect()\n const w = Math.min(window.innerWidth * SpecialGlobals.editCode.popup.maxWidth, size.width)\n const h = Math.min(window.innerHeight * SpecialGlobals.editCode.popup.maxHeight, size.height)\n if (this.props.isPopup && this.props.isPlaying) {\n this.wrapper.style.width = w + 'px'\n this.wrapper.style.height = h + 'px'\n } else this.wrapper.style.width = '100%'\n // height will break minimize\n // this.wrapper.style.height = size.height + \"px\"\n // this.wrapper.style.height = \"initial\"\n\n const dx = w - this.iFrameWindow.innerWidth\n const dy = h - this.iFrameWindow.innerHeight\n this.clientX += dx\n this.clientY += dy\n this.forceUpdate()\n }", "function adaptLandingPage(){\n\t\t\n\t\t$('.landingPageWrapper').css('height', $(window).height() - headerHeight - footerHeight - 3);\n\t\n\t}", "function SetResizeContent() {\r\n var minheight = $(window).height();\r\n $(\".full-screen\").css('min-height', minheight);\r\n}", "function resizeMainFrame() {\n\t\tvar isIE = navigator.userAgent.toLowerCase().indexOf(\"msie\") > -1;\n\t\tvar iframe = document.getElementById(elemParams.CONTENTIFRAME);\n\t\tvar bodyHeight = (isIE ? document.body.clientHeight : window.innerHeight);\n\t\tvar newHeight = bodyHeight - (elemParams.scrollContent < 0 ? 0 : elemParams.scrollContent);\n\n\t\tiframe.style.height = newHeight + \"px\";\n\t}", "function heightFullscreen() {\n if ($('#jarviswidget-fullscreen-mode')\n .length) {\n\n /**\n * Setting height variables.\n **/\n var heightWindow = $(window)\n .height();\n var heightHeader = $('#jarviswidget-fullscreen-mode')\n .find(self.o.widgets)\n .children('header')\n .height();\n\n /**\n * Setting the height to the right widget.\n **/\n $('#jarviswidget-fullscreen-mode')\n .find(self.o.widgets)\n .children('div')\n .height(heightWindow - heightHeader - 15);\n }\n }", "function initializePage(){\n //GLOBALS pageHeight and sensitivity. Initialized in inputreader.js.\n //gotta fix this... this is terrible style.\n pageHeight = window.innerHeight + (svpArray.length * sensitivity) - 1;\n document.getElementById('container').style.height = pageHeight+\"px\";\n }", "function introHeight() {\n var wh = $(window).height();\n $('#intro').css({height: wh});\n }", "function heightFullscreen() {\n if ($('#jarviswidget-fullscreen-mode')\n .length) {\n\n /**\n * Setting height variables.\n **/\n var heightWindow = $(window)\n .height();\n var heightHeader = $('#jarviswidget-fullscreen-mode')\n .children(self.o.widgets)\n .children('header')\n .height();\n\n /**\n * Setting the height to the right widget.\n **/\n $('#jarviswidget-fullscreen-mode')\n .children(self.o.widgets)\n .children('div')\n .height(heightWindow - heightHeader - 15);\n }\n }", "function SetSize()\n{\n\tif(0 < (document.body.clientHeight - (document.all(\"RPSTopPage_tblOuter\").clientHeight + document.all(\"RPSBottomPage_lblFooter\").clientHeight + 5)))\n\t\tdocument.all(\"tblContent\").height = document.body.clientHeight - (document.all(\"RPSTopPage_tblOuter\").clientHeight + document.all(\"RPSBottomPage_lblFooter\").clientHeight + 5);\n\tif(0 < (document.all(\"tblContent\").height - (document.all(\"tblButtons\").height + 25)))\n\t\tdocument.all(\"divPagePermissions\").style.height = document.all(\"tblContent\").height - (document.all(\"tblButtons\").height + 25);\n\t\t\n\t//This is for horizontal scroll\n\tdocument.all(\"divPagePermissions\").style.width = document.body.clientWidth;\n}", "function awSizerMouseUp() {\n kAddressingHeaderHeight =\n document.getElementById(\"headers-box\").clientHeight >\n window.outerHeight * 0.3\n ? Number(document.getElementById(\"recipientsContainer\").clientHeight)\n : null;\n}", "function setModalMaxHeight(element) {\n this.$element = $(element);\n this.$content = this.$element.find('.modal-content');\n var borderWidth = this.$content.outerHeight() - this.$content.innerHeight();\n var dialogMargin = $(window).width() < 768 ? 20 : 60;\n var contentHeight = $(window).height() - (dialogMargin + borderWidth);\n var headerHeight = this.$element.find('.modal-header').outerHeight() || 0;\n var footerHeight = this.$element.find('.modal-footer').outerHeight() || 0;\n var maxHeight = contentHeight - (headerHeight + footerHeight);\n\n this.$content.css({\n 'overflow': 'hidden'\n });\n\n this.$element\n .find('.modal-body').css({\n 'max-height': maxHeight,\n 'overflow-y': 'auto'\n });\n}", "setBottomColapsedMenuSize() {\n\t\t// When counting position we need compensate a pixel\n\t\tconst fixOffsetPosition = 1;\n\t\tif (this.isWindowFixed && this._window) {\n\t\t\tconst diff = this.element.offsetTop - this._window._dialog.offsetTop;\n\t\t\tlet height = diff - this._window.defaultBorderSize - this._window.defaultBorderSize + fixOffsetPosition;\n\t\t\tthis.element.style['max-height'] = height + 'px';\n\t\t\tthis.element.style['min-width'] = this._currentWidth + 'px';\n\t\t}\n\t}", "function openPropertiesBox() {\n $('div#properties-overlay').css('height', $(document).height() + 500);\n $('div#properties-overlay').show('slow');\n}", "function resize() {\n var ps = ws.dom.size(parent),\n hs = ws.dom.size(topBar);\n //tb = ws.dom.size(toolbar.container);\n \n ws.dom.style(frame, {\n height: ps.h - hs.h - 55 - 17 + 'px' //55 is padding from top for data column and letter\n });\n\n ws.dom.style([container, gsheetFrame, liveDataFrame], {\n height: ps.h - hs.h - 22 /*- tb.h*/ + 'px'\n });\n\n\n ws.dom.style(table, {\n width: ps.w + 'px'\n });\n\n }", "function heightses(){\n\t\t$('.page__catalog .catalog-products-list__title').height('auto').equalHeights();\n\t}", "setFullHeight() {\n this.fullHeight = `${window.innerHeight - this.$el.getBoundingClientRect().top}px`;\n }", "function alturaMaxima() {\n var altura = $(window).height();\n $(\".full-screen\").css('min-height',altura);\n\n}", "function setHeights() {\n halfWindow = $(window).height() / 2;\n nHeight = $(\"#name\").height() - 40;\n rHeight = $(\"#role\").height() - 29;\n tCHeight = $(\"#topContacts\").height() - 19;\n scene2Height = $(\"#workExperience\").height() * 2.5;\n scene3Height = $(\"#projects\").height() * 1.5;\n scene4Height = $(\"#education\").height() * 2;\n}", "function setBookendSize () {\n\t\t// Set header height\n\t\tvar $windowHeight = $(window).height(),\n\t\t\t$wrapper = $(\".container.is-top\"),\n\t\t\t$footer = $(\".post-footer\");\n\t\t$wrapper.css({\n\t\t\t\"padding-bottom\": $windowHeight\n\t\t});\n\t\t$footer.css({\n\t\t\t\"height\": $windowHeight\n\t\t});\n\t}", "set minHeight(value) {}", "function updatePortalSize() {\n abrController.setElementSize();\n abrController.setWindowResizeEventCalled(true);\n }", "function UpdateHeadingSize () {\n $('#heading').height(window.innerHeight - 40)\n }", "function fixEditorHeight() {\n var height = $(window).height() - $('#afGuiEditor').offset().top;\n $('#afGuiEditor').height(Math.floor(height));\n }", "function setSizes() {\n var containerHeight = $(\".landing-cont\").height();\n $(\".landing-cont\").height(containerHeight - 200);\n}", "function centerVertically() {\n\t\tjQuery('.formOverlay').css({\n\t\t\t'top' : '50%',\n\t\t\t'margin-top' : -jQuery('.formOverlay').height()/2\n\t\t});\n\t}" ]
[ "0.66757894", "0.65208757", "0.63072705", "0.6275321", "0.6264929", "0.6264929", "0.62403154", "0.62109715", "0.6169411", "0.61307764", "0.61140543", "0.60465795", "0.6003051", "0.59819645", "0.5977626", "0.5962041", "0.5881093", "0.5871994", "0.5851368", "0.58437186", "0.583586", "0.5811151", "0.58082545", "0.5807777", "0.579352", "0.5784531", "0.57801086", "0.5773419", "0.5770335", "0.57536787", "0.57363164", "0.5733335", "0.573206", "0.5723457", "0.57169455", "0.5712143", "0.57079", "0.5706857", "0.5705667", "0.5691686", "0.5686576", "0.5681836", "0.5665986", "0.5664525", "0.5660084", "0.5647791", "0.56378335", "0.56261843", "0.5621552", "0.56157273", "0.56098294", "0.5604973", "0.55995166", "0.5596408", "0.5595001", "0.5591629", "0.55900174", "0.55792105", "0.5576278", "0.555486", "0.5550317", "0.554787", "0.55477166", "0.55405086", "0.5539028", "0.5528629", "0.55279845", "0.55267423", "0.55202603", "0.5518125", "0.5515324", "0.55117506", "0.5504012", "0.55017835", "0.549932", "0.5490049", "0.54876256", "0.54865056", "0.54756", "0.5474719", "0.5465904", "0.54657286", "0.5462019", "0.54561096", "0.5455732", "0.5455233", "0.5447461", "0.54450476", "0.5443987", "0.54420835", "0.5434752", "0.5429739", "0.54266036", "0.5422979", "0.5422119", "0.5421327", "0.54183656", "0.54150033", "0.54130906", "0.54120165" ]
0.69576627
0
This centers the popUp vertically.
function window_pos(popUpDivVar){ if(typeof window.innerWidth!='undefined'){ viewportwidth=window.innerHeight; } else{ viewportwidth=document.documentElement.clientHeight; } if((viewportwidth>document.body.parentNode.scrollWidth)&&(viewportwidth>document.body.parentNode.clientWidth)){ window_width=viewportwidth; } else{ if(document.body.parentNode.clientWidth>document.body.parentNode.scrollWidth){ window_width=document.body.parentNode.clientWidth; } else{ window_width=document.body.parentNode.scrollWidth; } } var popUpDiv=document.getElementById(popUpDivVar); window_width=window_width/2-260; popUpDiv.style.left=window_width+'px'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function centerVertically() {\n\t\tjQuery('.formOverlay').css({\n\t\t\t'top' : '50%',\n\t\t\t'margin-top' : -jQuery('.formOverlay').height()/2\n\t\t});\n\t}", "function centerVertically() {\n\n\tjQuery('.formOverlay').css({\n\t\t'top' : '50%',\n\t\t'margin-top' : -jQuery('.formOverlay').height()/2\n\t});\n}", "function centerPopup(popup){\n var windowWidth = document.documentElement.clientWidth;\n var windowHeight = document.documentElement.clientHeight;\n var popupHeight = jQuery(\"#\" + popup).height();\n var popupWidth = jQuery(\"#\" + popup).width();\n \n jQuery(\"#\" + popup).css({ //Look at adjusting popup positioning\n \"position\" : \"absolute\",\n \"bottom\" : windowHeight / 2 - popupHeight /2,\n \"right\" : windowWidth /2 - popupWidth /2,\n //\t\"top\" : \"0%\",\n//\t\"left\" : \"10%\"\n });\n}", "set TopCenter(value) {}", "function centralizar() {\r\n $(\".popup\").css(\"position\",\"absolute\");\r\n $(\".popup\").css(\"top\", Math.max(0, (($(window).height() - $(\".popup\").outerHeight()) / 2) + $(window).scrollTop()) + \"px\");\r\n $(\".popup\").css(\"left\", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + \"px\");\r\n\r\n}", "function popupCenter(url, width, height, name) {\n var left = (screen.width/2)-(width/2);\n var top = (screen.height/2)-(height/2);\n return window.open(url, name, \"menubar=no,toolbar=no,status=no,width=\"+width+\",height=\"+height+\",toolbar=no,left=\"+left+\",top=\"+top);\n}", "function screen_center_pos(PopUpWidth, PopUpHeight)\n{\n\tvar Width = $(window).width()\n\n\tvar Height = $(window).height()\n\n\treturn({\n\t\tx : (Width/2 - PopUpWidth/2) , \n\t\ty : (Height/2 - PopUpHeight/2)\n\t})\n}", "set BottomCenter(value) {}", "set VerticalCentered(value) {\n this._centeredVertically = value;\n }", "function alignModal() {\n var modalDialog = $(this).find(\".modal-dialog\");\n modalDialog.css(\"margin-top\", Math.max(0,\n ($(window).height() - modalDialog.height()) / 2));\n }", "function reposition() {\r\n\tvar modal = jQuery(this),\r\n\tdialog = modal.find('.modal-dialog');\r\n\tmodal.css('display', 'block');\r\n\t\r\n\t/* Dividing by two centers the modal exactly, but dividing by three \r\n\t or four works better for larger screens. */\r\n\tdialog.css(\"margin-top\", Math.max(0, (jQuery(window).height() - dialog.height()) / 2));\r\n}", "function reposition() {\n var modal = $(this),\n dialog = modal.find('.modal-dialog');\n modal.css('display', 'block');\n \n // Dividing by two centers the modal exactly, but dividing by three \n // or four works better for larger screens.\n dialog.css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n}", "function ui_popupCenter(str_url,str_winname,str_winparms){\n\tvar _screen_ht = screen.availHeight;\n\tvar _screen_wd = screen.availWidth;\n\tvar _win_ht = 480;\n\tvar _win_wd = 600;\n\tw_top = Math.round((_screen_ht - _win_ht)*0.5);\n\tw_left= Math.round((_screen_wd - _win_wd)*0.5);\n\tstr_winparms = ( ui_trim(str_winparms).length==0)?\"scrollbars=yes,resizable=yes,status=yes,location=no,menubar=no,toolbar=no,width=\" +_win_wd+ \",height=\" +_win_ht+ \",\":\"scrollbars=yes,resizable=yes,status=yes,location=no,menubar=no,toolbar=no,width=\" +_win_wd+ \",height=\" +_win_ht+ \",\" + str_winparms;\n\tstr_winparms += \"left=\" + w_left + \",top=\" + w_top;\n\t_win=window.open(str_url, str_winname, str_winparms);\n\t_win.focus();\n}", "function centralize(param){\n \t\t\tvar elementWidth, elementHeight;\n \t\t\tif(param == 'email'){\n\t \t\t\tvar elementHeight = 447;\n\t \t\t\tvar div = document.getElementById(\"writePop\");\n \t\t\t} else if(param == 'call'){\n \t\t\t\tvar elementHeight = 318;\n\t \t\t\tvar div = document.getElementById(\"callPop\");\n \t\t\t}\n \t\t\tvar totalWidth = window.innerWidth;\n\t \t\tvar totalHeight = window.innerHeight;\n\t\t \tvar elementWidth = 540;\n\t\t\tdiv.style.top = (totalHeight - elementHeight)/2 + \"px\";\n\t\t\tdiv.style.left = (totalWidth - elementWidth)/2 + \"px\";\n\t\t}", "function reposition() {\n\t\tvar modal = $(this),\n\t\t\tdialog = modal.find('.modal-dialog');\n\t\t\tmodal.css('display', 'block');\n\t\t\tdialog.css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n\t\t\t$(\".modal .actions\").css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n\t}", "function fixVerticalPosition() {\n var modal = getModal();\n\n modal.style.marginTop = getTopMargin(getModal());\n }", "function positionPopup() {\n if (!$('#MainContent_overlay').is(':visible')) {\n return;\n }\n $('#MainContent_overlay').css({\n left: ($(window).width() - $('#MainContent_overlay').width()) / 2,\n top: ($(window).width() - $('#MainContent_overlay').width()) / 7,\n position: 'absolute'\n });\n }", "function maintain_popup_size_position(){ \n\tvar hero_width = jQuery(window).width();\n\tvar hero_height = jQuery(window).height();\n\tvar popup_resize_height = (hero_height - 200);\n\tvar popup_inner_height = (popup_resize_height - 50);\n\tvar popup_top_margin_offset = (popup_inner_height / 2);\n\tjQuery('.hero_popup_resize').css({\n\t\t'height': popup_resize_height +'px',\n\t\t'margin-top': '-'+ popup_top_margin_offset +'px'\n\t});\n\tjQuery('.hero_popup_inner').css({\n\t\t'height': popup_inner_height +'px'\n\t});\n\tjQuery('.hero_popup_main').css({\n\t\t'height': hero_height +'px'\n\t});\n}", "function setPopupMaxHeight() {\n $(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));\n $(modalPopupContainer).css('margin-top', (-($(modalPopupContainer).height() / 2)));\n}", "set Center(value) {}", "function setPopupMaxHeight() {\n var maxHeight = \"max-height\";\n var marginTop = \"margin-top\";\n var body = \"body\";\n $(modalPopupContent).css(maxHeight, ($(body).height() - ($(body).height() / 100 * 30)));\n $(modalPopupContainer).css(marginTop, (-($(modalPopupContainer).height() / 2)));\n}", "function center()\n\t{\n\t\tfw.dock(wid, {\n\t\t\twid: that,\n\t\t\tmy: 'center left',\n\t\t\tat: 'center left'\n\t\t});\n\t}", "function PopupCenter(url, title, w, h) {\n // Fixes dual-screen position Most browsers Firefox\n var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;\n var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;\n\n var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;\n var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;\n\n var left = ((width / 2) - (w / 2)) + dualScreenLeft;\n var top = ((height / 2) - (h / 2)) + dualScreenTop;\n var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\n\n // Puts focus on the newWindow\n if (window.focus) {\n newWindow.focus();\n }\n}", "function verticalCenter() {\n\t$('.work_desc').each(function(i) {\n\t\tvar $this \t\t= $(this);\n\t\tvar descHeight \t= $this.height() / 2;\n\t\t\n\t\t$this.css('margin-top', parseFloat('-'+descHeight));\n\t});\n}", "function popupCenter(url, title, w, h) {\n // Fixes dual-screen position Most browsers Firefox\n const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screen.left;\n const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screen.top;\n\n /* eslint-disable max-len, no-nested-ternary */\n const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : window.screen.width;\n const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : window.screen.height;\n /* eslint-enable max-len, no-nested-ternary */\n\n const left = ((width / 2) - (w / 2)) + dualScreenLeft;\n const top = ((height / 3) - (h / 3)) + dualScreenTop;\n\n return window.open(url, title, `scrollbars=yes, location=no, width=${w}, height=${h}, top=${top}, left=${left}`);\n}", "function centerDiv(divId) {\t\r\n\tjQuery(function($){\r\n\t\t//request data for centering\r\n\t\tvar popupHeight = $(\"#\" + divId).height();\r\n\t\tvar popupWidth = $(\"#\" + divId).width();\r\n\t\t//centering\r\n\t\t$(\"#\" + divId).css({\r\n\t\t\t//\"top\": windowHeight/2-popupHeight/2,\r\n\t\t\t//\"left\": windowWidth/2-popupWidth/2\r\n\t\t\t\"top\": document.documentElement.clientHeight/2-popupHeight/2,\r\n\t\t\t\"left\": document.documentElement.clientWidth/2-popupWidth/2\r\n\t\t});\r\n\t});\t\r\n}", "centerVertically(offset = '') {\n this.top(offset);\n this._alignItems = 'center';\n return this;\n }", "function _center() {\n\t\tif (data.isMobile) {\n\t\t\tvar newLeft = 0,\n\t\t\t\tnewTop = 0;\n\t\t} else {\n\t\t\tvar newLeft = ($(window).width() - data.$boxer.width() - data.padding) / 2,\n\t\t\t\tnewTop = (data.options.top <= 0) ? (($(window).height() - data.$boxer.height() - data.padding) / 2) : data.options.top;\n\t\t\t\n\t\t\tif (data.options.fixed !== true) {\n\t\t\t\tnewTop += $(window).scrollTop();\n\t\t\t}\n\t\t}\n\t\t\n\t\tdata.$boxer.css({ \n\t\t\tleft: newLeft, \n\t\t\ttop: newTop \n\t\t});\n\t}", "function popOpen () {\nsetTimeout(function() {//지정시간 뒤 내용을 실행. display:none이면 css자체도 적용을 안시키는 거 같다..(무시)\n\t$(\".popup-bg\").css(\"display\",\"flex\"); //두가지를 같이 진행시키면 위에거가 시작할때 같이 시작되면서 결과에 translate가 안먹힌다.\n\tsetTimeout(function() {//그래서 setTimeout을 두번돌려서 위에 작업 후에 진행이 된다.\n\t\t$(\".popup-wrap\").css({\"opacity\": 1, \"transform\":\"translateY(0)\"});\n\t},100);\n}, 500);\n}", "function centerView() {\n ggbApplet.evalCommand('CenterView((0, 0))');\n }", "alignCenter() {\n this.setAnchor(0.5);\n this.setStyle({ align: 'center' });\n }", "set center(value) {}", "function getCenterY()/*:Number*/ {\n return this.getUpperY() + this.getMyHeight() / 2;\n }", "function setEastSize(p){\r\n if (!p) return;\r\n var _opts = p.getOptions();\r\n p.size({\r\n width : _opts.width,\r\n height: centerPos.height,\r\n left: layout.width() - _opts.width,\r\n top: centerPos.top\r\n });\r\n centerPos.width -= _opts.width;\r\n }", "function PSC_Layout_Center_CustomResize() {}", "resizePopup () {\n const width = $window.innerWidth || (document.documentElement.clientWidth || $window.screenX)\n const height = $window.innerHeight || (document.documentElement.clientHeight || $window.screenY)\n const systemZoom = width / $window.screen.availWidth\n\n this.popup.left = (width - this.popup.width) / 2 / systemZoom + ($window.screenLeft !== undefined ? $window.screenLeft : $window.screenX)\n this.popup.top = (height - this.popup.height) / 2 / systemZoom + ($window.screenTop !== undefined ? $window.screenTop : $window.screenY)\n }", "function getPopperRererenceCenter(element) {\n var modWidth = -element.clientWidth / 2,\n modHeight = -element.clientHeight / 2;\n return {\n \"guidemeCenter\": true,\n \"clientWidth\": 1,\n \"clientHeight\": 1,\n \"getBoundingClientRect\": function() {\n var size = getWindowSize();\n return {\n \"bottom\": size.height / 2 + modHeight,\n \"height\": 1,\n \"left\": size.width / 2 + modWidth,\n \"right\": size.width / 2 + modWidth,\n \"top\": size.height / 2 + modHeight,\n \"width\": 1\n };\n }\n }\n }", "function displayBox() \n{\t\n\tjQuery.fn.center = function (absolute) {\n\t\treturn this.each(function () {\n\t\t\tvar t = jQuery(this);\n\t\t\n\t\t\tt.css({\n\t\t\t\tposition: absolute ? 'absolute' : 'fixed', \n\t\t\t\tleft: '50%', \n\t\t\t\ttop: '50%', \n\t\t\t\tzIndex: '200000'\n\t\t\t}).css({\n\t\t\t\tmarginLeft: '-' + (t.outerWidth() / 2) + 'px', \n\t\t\t\tmarginTop: '-' + (t.outerHeight() / 2) + 'px'\n\t\t\t});\n\t\t\n\t\t\tif (absolute) {\n\t\t\t\tt.css({\n\t\t\t\t\tmarginTop: parseInt(t.css('marginTop'), 10) + jQuery(window).scrollTop(), \n\t\t\t\t\tmarginLeft: parseInt(t.css('marginLeft'), 10) + jQuery(window).scrollLeft()\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t};\n\tjQuery('#garden_fence_modal').center();\n}", "get BottomCenter() {}", "_resizeCallback () {\n this.resizePreserveCenter()\n }", "function MyVerticallyCenteredModal(props) {\n return (\n <Modal\n {...props}\n size=\"lg\"\n aria-labelledby=\"contained-modal-title-vcenter\"\n centered\n >\n <Modal.Header closeButton>\n <Modal.Title id=\"contained-modal-title-vcenter\">\n <strong>Apa Itu SmartQ?</strong> \n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <p>\n SmartQ merupakan sebuah aplikasi booking dan atau antrian yang dilakukan secara online \n dengan tujuan memberikan konsumen kemudahan, efisiensi, dan efektivitas waktu yang lebih \n baik. Selain itu SmartQ juga memberikan profitabilitas lebih bagi UMKM yang sampai hari \n ini masih memiliki kendala mengenai system antrian. Dengan adanya perbaikan system antrian \n yang ada di Indonesia diharapkan mampu menciptakan, menumbuhkan dan menerapkan kembali \n budaya antri yang sudah mulai menghilang di lingkungan masyarakat saat ini. Selain itu \n budaya antri merupakan sebuah kegiatan yang seharusnya diterapkan oleh setiap orang pada \n tempat dan waktu tertentu. Usaha layanan ini juga dapat mengintegrasikan UMKM yang \n membutuhkan solusi mengenai system antrian yang masih belum berjalan dengan baik sehingga \n dapat meningkatkan pelayanannya terhadap konsumen yang ada pada suatu tempat tersebut, \n sehingga mampu meningkatkan pelayanan yang jauh lebih baik dibandingkan dengan sebelumnya.\n </p>\n </Modal.Body>\n <Modal.Footer>\n <Button variant=\"primary\" onClick={props.onHide}>Close</Button>\n </Modal.Footer>\n </Modal>\n );\n}", "function centerName() {\n // top box is approx half, minus a little for visual reasons\n nameContainer.style.top = `${((screenSize.height - nameBoxRect.height) / 2) - 60}px`\n nameContainer.style.left = `${(screenSize.width - nameBoxRect.width) / 2}px`\n}", "function displayInsfcntPopup(){\n $(insufficientCardPopup).css({\n \"display\" : \"flex\"\n })\n }", "_resizeCallback() {\n this.resizePreserveCenter()\n }", "function modalCentering() {\r\n $('.modal').each(function(){\r\n \r\n if($(this).hasClass('in') === false){\r\n $(this).show();\r\n }\r\n \r\n var contentHeight = $(window.parent, window.parent.document).height() - 60;\r\n var headerHeight = $(this).find('.modal-header').outerHeight() || 2;\r\n var footerHeight = $(this).find('.modal-footer').outerHeight() || 2;\r\n var modalHeight = $(this).find('.modal-content').outerHeight();\r\n var modalYPosition = $(this).find('.modal-dialog').offset().top;\r\n var windowPageYOffset = window.top.pageYOffset;\r\n var windowHeight = $(window).height();\r\n \r\n $(this).find('.modal-dialog').addClass('modal-dialog-center').css({\r\n 'margin-top': function () {\r\n \r\n if ( (((contentHeight - modalHeight) / 2) + windowPageYOffset - 230) < 0) {\r\n return 0;\r\n } else if((((contentHeight - modalHeight) / 2) + windowPageYOffset - 230) < $(window).height() - modalHeight ) {\r\n return (( (contentHeight - modalHeight) / 2) + windowPageYOffset - 230);\r\n }\r\n \r\n },\r\n 'top': '',\r\n 'left': ''\r\n });\r\n if($(this).hasClass('in') === false){\r\n $(this).hide();\r\n }\r\n });\r\n }", "_updateCollapseButtonPos() {\n this._centered.updatePosition();\n }", "alignCenter() {\n this.setAnchor(0.5);\n this.setStyle({ textAlign: 'center' });\n }", "_centerVertically() {\n\n // We prob don't need this anymore we render loader as fixed, we can just use CSS\n /*\n let loaderElement = document.getElementById(this.id);\n const viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n const parentHeight = Math.max(this.parent.clientHeight, this.parent.innerHeight || 0);\n const loaderHeight = loaderElement.offsetHeight;\n const loaderWidth = loaderElement.offsetWidth;\n const scrollPosition = window.scrollY;\n\n // Center vertically in parent container\n let topLoaderDiv = (parentHeight / 2) - (loaderHeight / 2);\n\n // If parentHeight is >= viewportHeight, we need to use viewportHeight instead\n if (parentHeight > viewportHeight) {\n topLoaderDiv = (viewportHeight / 2) - (loaderHeight / 2);\n\n // If user is scrolled down at all, we need to adjust to make sure loader\n // is displayed within current viewport\n if (scrollPosition > 0) {\n topLoaderDiv += scrollPosition;\n }\n }\n\n loaderElement.style.top = topLoaderDiv + \"px\";\n loaderElement.style.left = 'calc(50% - ' + (loaderWidth/2) + 'px)';\n */\n\n }", "function setEastSize(pp) {\n if (!pp.length) return;\n var ppopts = pp.panel('options');\n pp.panel('resize', {\n width: ppopts.width,\n height: cpos.height,\n left: cc.width() - ppopts.width,\n top: cpos.top\n });\n cpos.width -= ppopts.width;\n }", "function panelOnPopupShowing(window) {\n var container = window.document.getElementById(\"social-statusarea-popup\");\n var panel = container;\n var arrowbox = window.document.getElementById(\"social-panel-arrowbox\");\n var arrow = window.document.getElementById(\"social-panel-arrow\");\n\n var anchor = panel.anchorNode;\n if (!anchor) {\n arrow.hidden = true;\n return;\n }\n\n // Returns whether the first float is smaller than the second float or\n // equals to it in a range of epsilon.\n function smallerTo(aFloat1, aFloat2, aEpsilon)\n {\n return aFloat1 <= (aFloat2 + aEpsilon);\n }\n\n let popupRect = panel.getBoundingClientRect();\n let popupLeft = window.mozInnerScreenX + popupRect.left;\n let popupTop = window.mozInnerScreenY + popupRect.top;\n let popupRight = popupLeft + popupRect.width;\n let popupBottom = popupTop + popupRect.height;\n\n let anchorRect = anchor.getBoundingClientRect();\n let anchorLeft = anchor.ownerDocument.defaultView.mozInnerScreenX + anchorRect.left;\n let anchorTop = anchor.ownerDocument.defaultView.mozInnerScreenY + anchorRect.top;\n let anchorRight = anchorLeft + anchorRect.width;\n let anchorBottom = anchorTop + anchorRect.height;\n\n try {\n let anchorWindow = anchor.ownerDocument.defaultView;\n if (anchorWindow != window) {\n let utils = anchorWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor).\n getInterface(Components.interfaces.nsIDOMWindowUtils);\n let spp = utils.screenPixelsPerCSSPixel;\n anchorLeft *= spp;\n anchorRight *= spp;\n anchorTop *= spp;\n anchorBottom *= spp;\n }\n } catch(ex) { }\n\n let pack = smallerTo(popupLeft, anchorLeft, 26) && smallerTo(popupRight, anchorRight, 26) ? \"end\" : \"start\";\n arrowbox.setAttribute(\"pack\", pack);\n}", "function jcent() {\n\treachtext.document.execCommand('justifyCenter',false,null);\n \n}", "function cierraPop() {\n document.getElementById(\"popUp\").style.transform = 'translateY(-270%)';\n document.getElementById(\"membrana\").style.visibility = 'hidden';\n}", "function update_position() {\n var dlgLeft = ($(document).width()/2) - ($('#dlg-box-content-container').width()/2) - 20;\n $('#dlg-box-content-container').css('left', dlgLeft);\n $('#dlg-box-content-container').css('top', '8%');\n }", "setCenter() {\n this.cx = this.x + this.width / 2;\n this.cy = this.y + this.height / 2;\n }", "function centralize () {\n $(\"#main\").position({\n of: \"body\"\n });\n }", "get TopCenter() {}", "function adjustCurrentPopup () {\n \n // no popup open\n var box = ae.currentPopup;\n if (!box)\n return;\n \n var li = box.retrieve('li');\n var rect = li.getBoundingClientRect();\n \n // adjust top no matter what\n box.setStyle('top', rect.top + li.offsetHeight);\n \n // this is a fixed box; don't change left or right\n if (box.hasClass('fixed'))\n return;\n \n // set left or right\n box.setStyle('left',\n box.hasClass('right') ?\n rect.right - 300 :\n rect.left\n );\n}", "calculateAndSetPopupPosition() {\n this.measureDOMNodes();\n\n const { selfWidth, selfHeight, targetWidth, targetHeight, targetLeft, targetTop, viewportWidth, viewportHeight } = this;\n\n const newPositions = this.props.positionFunction(\n selfWidth,\n selfHeight,\n targetWidth,\n targetHeight,\n targetLeft,\n targetTop,\n viewportWidth,\n viewportHeight\n );\n\n const { newLeft, newTop } = newPositions;\n\n this.movePopover(newLeft, newTop);\n this.positioningValid = true;\n }", "function centeredPopup(url, name, noChrome, width, height)\n{\n\tvar features;\n\tvar popupDimensions=defaultPopupDims(); //obj holds the default popuDimensions, based on Parent Window\n\t\n\t//availheight and width mostly for Opera interoperability \n\tvar myAvailWidth=getAvailWidth();\n\tvar myAvailHeight=getAvailHeight();\n\n\tif( url )\n\t{\n\t\t//handle calls using the old Mplus popup window javascript\n\t\tif(url==\"#\")\n\t\t{\n\t\t\turl='';\n\t\t}\n\t\t\n\t\tif(!name)\n\t\t{\n\t\t\tname=\"TheNewWin\";\n\t\t}\n\n\t\t//ensure width bounds checking, if it doesn't have a value, give it the default\n\t\tif( isNaN(width) )\n\t\t{\n\t\t\twidth=popupDimensions.width;\n\t\t}\n\n\t\tif(width > myAvailWidth || width < 0)\n\t\t{\n\t\t\twidth=parseInt(myAvailWidth * HSCALE);\n\t\t}\n\t\t\n\t\t//check whether this will be a chromeless window \n\t\tif( noChrome == true \n\t\t|| noChrome == \"true\" \n\t\t|| noChrome == \"True\" \n\t\t)\n\t\t{\n\t\t\t//alert(\"(\" + noChrome + \")\");\n\t\t\tfeatures='toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + width + ',';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfeatures='toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + width+ ',';\n\t\t}\n\t\t\n\t\t//if height wasn't defined get default\n\t\t//note: default height for IE will be 0, IE doesn't give us sufficient info\n\t\t//to calculate parent window dimensions\n\t\tif(!height)\n\t\t{\n\t\t\theight=popupDimensions.height;\n\t\t\t//alert(height);\n\t\t}\n\n\t\t//check the height attrib, ensure it doesn't exceed viewable real estate\n\t\t//if so, the reduce it to VSCALE set by script designer.\n\t\tif(height > myAvailHeight || height < 1)\n\t\t{\n\t\t\theight=parseInt(myAvailHeight * VSCALE -100)\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Opera 6.x Macintosh PPC requires a height value when rendering a new window (if you specify width)\n\t\t\tif( isOperaMac )\n\t\t\t{\n\t\t\t\t//alert(\"detected Macintosh Opera!\");\n\t\t\t\theight=parseInt(myAvailHeight *VSCALE);\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tfeatures+='height='+height+',';\n\t\tfeatures += getCenteredCoords(myAvailWidth,myAvailHeight,width,height);\n\t\t//alert(\"Features: \" + features);\n\t\t\n\t\tpopUpWin = window.open(url, name, features);\n\n\t\tif( window.focus && !isOperaMac)\n\t\t{\n\t\t\tpopUpWin.focus();\n\t\t}\n\t\treturn false;\n\t}\n\treturn true;\n}", "function centeringLayout() {\n\t\t\tvar wH = $(\"html\").outerHeight(),\n\t\t\t\tcontH = $masonryGrid.outerHeight();\n\n\t\t\t$masonryGrid.css(\"margin-top\", Math.abs(wH/2 - contH/2));\n\t\t}", "function setVerticalCenter(parent, self, useOuter) {\n\tvar th = parent.height();\n\tvar h = (useOuter ? self.outerHeight() : self.height());\n\t\n\tth = ( th - h ) * 0.5;\n\t\n\tself.css('top', th);\n\t\n\treturn th;\n}", "function positionPopup(){\r\n if(!$(\"#overlay_form\").is(':visible')){\r\n return;\r\n }\r\n $(\"#overlay_form\").css({\r\n left: ($(window).width() - $('#overlay_form').width()) / 2,\r\n top: ($(window).width() - $('#overlay_form').width()) / 7,\r\n position:'absolute'\r\n });\r\n}", "function autoResize() {\n var h = $(window).height() - 120;\n if (hasFooter) h -= 90;\n if (h < 400) h = 400;\n popup.height(h);\n popup.trigger('aweresize');\n }", "function centerModals(){\r\n $('.modal').each(function(i){\r\n var $clone = $(this).clone().css('display', 'block').appendTo('body');\r\n var top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);\r\n top = top > 0 ? top : 0;\r\n $clone.remove();\r\n $(this).find('.modal-content').css(\"margin-top\", top);\r\n });\r\n }", "function PosCenterTop() {\n var top = M.R((va.hRuby - M.OuterHeight($imgItem, true)) / 2);\n if (top == 0)\n top = '';\n $imgItem.css('top', top);\n }", "set Centered(value) {\n this._centered = value;\n }", "function positionmodal() {\n\n // Half the width of the modal\n var left = modalwidth / 2;\n\n // Half the width of the mask\n var halfmaskwidth = windowwidth / 2;\n\n // Location of the left side of the popup\n var popupleft = halfmaskwidth - left;\n\n // Top stays static\n popup.css('top', 30);\n\n // Set the left\n popup.css('left', popupleft);\n\n }", "function centerModals(){\n\t $('.modal').each(function(i){\n\t\tvar $clone = $(this).clone().css('display', 'block').appendTo('body');\n\t\tvar top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);\n\t\ttop = top > 0 ? top : 0;\n\t\t$clone.remove();\n\t\t$(this).find('.modal-content').css(\"margin-top\", top);\n\t });\n\t}", "function updateSuccessMsg(dpEntryId, prevCode){\r\n\tvar offsetTop = $('#codePagePopup_' + dpEntryId + '_' + prevCode).offset().top + 50;\r\n\tvar offsetLeft = $('#codePagePopup_' + dpEntryId + '_' + prevCode).offset().left;\r\n\t$('#update_message_popup').offset({top: offsetTop, left: offsetLeft});\r\n\t$('#update_message_popup').css(\"height\",\"25px\");\r\n\t$('#update_message_popup').css('display','block');\r\n}", "function makePopUpVisible(i) {\n\n var w = $(window).width(); \n var h = $(window).height();\n var d = document.getElementById('resize_div'+ i);\n var divW = $(d).width();\n var divH = $(d).height();\n \n if(i=='_Desktop')\n d.style.top = (h / 2) - (divH / 2) - 80 + \"px\";\n else\n d.style.top = (h / 2) - (divH / 2) - 50 + \"px\";\n\n d.style.left = (w / 2) - (divW / 2) + \"px\"; \n d.style.visibility = \"visible\"; \n }", "showOptions () {\n this.optionsWrapper.show();\n const position = this.html.getBoundingClientRect();\n this.optionsWrapper.style.top = `${position.top + position.height}px`;\n this.optionsWrapper.style.left = `${position.left}px`;\n }", "function centerModals(){\r\n\t $('.modal').each(function(i){\r\n\t\tvar $clone = $(this).clone().css('display', 'block').appendTo('body');\r\n\t\tvar top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);\r\n\t\ttop = top > 0 ? top : 0;\r\n\t\t$clone.remove();\r\n\t\t$(this).find('.modal-content').css(\"margin-top\", top);\r\n\t });\r\n\t}", "center() {\n this.move(this.getWorkspaceCenter().neg());\n }", "function centerModals() {\r\n\t$('.modal').each(function(i) {\r\n\t\tvar $clone = $(this).clone().css('display', 'block').appendTo('body');\r\n\t\tvar top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);\r\n\t\ttop = top > 0 ? top : 0;\r\n\t\t$clone.remove();\r\n\t\t$(this).find('.modal-content').css('margin-top', top);\r\n\t});\r\n}", "AddNewProductPopUp() {\n $(\".add-product-full-popup\").css(\"display\", \"flex\");\n }", "function resize() {\n\t\tlet [width, height] = getScreenSize();\n\n\t\tlet pw = CS.popup.width || 300;\n\t\t$scope.style.popup.width = pw + 'px';\n\t\t$scope.style.popup.top = (height/3) + 'px';\n\t\t$scope.style.popup.left = (width - pw)/2 + 'px';\n\n\t\tlet hAdv = 101 * (CS.enableDetails && S && !S.tutorial); //height of advanced stats\n\t\t//height of canvas: (available height) - stats - ?advanced? - controls - margin\n\t\tlet hMap = height - 141 - hAdv - 241 - 10;\n\t\thMap = CS.enableGraphics ? Math.max(200, hMap) : 40;\n\n\t\tlet m = geto('map');\n\t\tif (m && m.width !== width - 2) {\n\t\t\tm.width = width - 2;\n\t\t}\n\t\tif (m && m.height !== hMap) {\n\t\t\tm.height = hMap;\n\t\t}\n\n\t\t$scope.style.stats .top = (hMap+1) + 'px';\n\t\t$scope.style.advanced.top = (hMap+142) + 'px';\n\t\t$scope.style.controls.top = (hMap+142+hAdv) + 'px';\n\t}", "centerScreen() {\n self.moveCenter(0,0);\n }", "function SWEPopupSize(bHide)\n{\n var deltaX;\n var deltaY;\n\n if (bHide && \n SWEGetPopupResizeNoHide())\n {\n return;\n }\n \n var body = document.body;\n var popWin = Top().SWEPopupWin;\n\n if (popWin == null || popWin.closed)\n {\n popWin = window;\n }\n \n if (popWin != null && !popWin.closed)\n {\n if (bHide)\n {\n //With XP SP2 it is no loger allowed to move popup offscreen\n //So we make the window of minimum possible allowed size (100,100)\n //and move it to the top left corner of the screen and using\n //alwaysLowered flag put it last in the z order \n popWin.innerWidth = 100;\n popWin.innerHeight = 100;\n popWin.screenX = 0;\n popWin.screenY = 0;\n popWin.alwaysLowered = true;\n }\n else\n {\n //reset the flag which puts popup window last in the z order\n popWin.alwaysLowered = false;\n var screenX = SWEGetAvailScreenWidth();\n var screenY = SWEGetAvailScreenHeight();\n \n if (typeof Top().SWEPopupResizeNoAuto != \"undefined\" && Top().SWEPopupResizeNoAuto)\n {\n Top().SWEPopupResizeNoAuto = false;\n //As XP SP2 does not allow popup window going offscreen which might \n //happen if the window size is larger than half of the screen size\n //we now first move the window to appropriate position and then\n //resize it\n popWin.moveTo (Math.floor((screenX-Top().SWEPopupWidth) / 2), \n Math.floor((screenY-Top().SWEPopupHeight) / 2 ));\n popWin.resizeTo (Top().SWEPopupWidth, \n Top().SWEPopupHeight);\n \n }\n else \n {\n if (SWEGetPopupResizeNoHide())\n { // 12-HJKXEX: Do not resize and hide the popup.\n SWESetPopupResizeNoHide (false);\n return;\n }\n \n var minX = (body.minWidth != null) ? body.minWidth : 0;\n var bodyX = (body.scrollWidth > minX) ? body.scrollWidth : minX;\n var bodyY = body.scrollHeight;\n var maxX = (bodyX < screenX) ? bodyX : screenX;\n var maxY = (bodyY < screenY - 0x20) ? bodyY : screenY - 0x20;\n \n deltaX = maxX - body.clientWidth;\n deltaY = maxY - body.offsetHeight+0x10; //12-DGRML5\n \n //As XP SP2 does not allow popup window going offscreen which might \n //happen if the window size is larger than half of the screen size\n //we now first move the window to appropriate position and then\n //resize it\n //FR#12-1U0A8YD - Internet Explorer hangs when user fast clicks on MVG Applet\n //Below try block is added to handle any exceptions when the user fast clicks on MVG Applet\n try\n {\n popWin.moveTo (Math.floor((screenX-maxX) / 2), \n Math.floor((screenY-maxY) / 2) );\n popWin.resizeBy (deltaX, deltaY);\n }\n catch(err)\n {\n }\n }\n }\n }\n}", "function centerHomeCaption() {\n\tjQuery('.home .slideshow .details').each(function(id){\n\t\tjQuery(this).css('margin-top','-'+((jQuery(this).actual('height')/2)-catptionOffset)+'px');\n\t\tjQuery(this).show();\n\t});\n}", "center() {\n this.panTo(this.graphDims.width / 2, this.graphDims.height / 2);\n }", "static calculateVerticalAlignment(elDimensions, popoverDimensions, alignment) {\n let result = verticalPosition(elDimensions, popoverDimensions, alignment);\n if (result + popoverDimensions.height > window.innerHeight) {\n result = window.innerHeight - popoverDimensions.height;\n }\n return result;\n }", "static calculateVerticalAlignment(elDimensions, popoverDimensions, alignment) {\n let result = verticalPosition(elDimensions, popoverDimensions, alignment);\n if (result + popoverDimensions.height > window.innerHeight) {\n result = window.innerHeight - popoverDimensions.height;\n }\n return result;\n }", "function editor_tools_handle_center() {\n editor_tools_add_tags('[center]', '[/center]');\n editor_tools_focus_textarea();\n}", "setTopColapsedMenuSize() {\n\t\t// When counting position we need compensate a pixel\n\t\tconst fixOffsetPosition = 1;\n\t\tif (this.isWindowFixed && this._window) {\n\t\t\tconst bodyHeight = this._window.bodyEl.offsetHeight;\n\t\t\tconst diff = this.element.offsetTop - this._window._dialog.offsetTop - this._window.defaultBorderSize - this._window.bodyEl.offsetTop + fixOffsetPosition;\n\t\t\tlet height = bodyHeight + diff + this._window.titleBarEl.offsetHeight + this.element.offsetHeight;\n\t\t\tif (this._window.isMaximized || this.$powerUi.componentsManager.smallWindowMode) {\n\t\t\t\theight = height - this._window.defaultBorderSize;\n\t\t\t}\n\t\t\tthis.element.style['max-height'] = height + 'px';\n\t\t\tthis.element.style['min-width'] = this._currentWidth + 'px';\n\t\t}\n\t}", "function verticalCenter(elem) {\n var elemHeight = elem.clientHeight;\n var containerHeight = elem.parentElement.clientHeight;\n elem.style.marginTop = ( containerHeight - elemHeight ) / 2 + \"px\";\n}", "function v_center (){\n var main_scroll_area_height = $('.scroll_area').height(),\n scroll_area = $('.scroll_area .common_scroll_content'),\n content_height = scroll_area.height();\n\n if(main_scroll_area_height > content_height ){\n scroll_area.parent('div').addClass('v_center');\n } else {\n scroll_area.parent('div').removeClass('v_center');\n }\n }", "updatePopup() {\n let winX = this.game.root.offsetWidth;\n let winY = this.game.root.offsetHeight;\n let displayX = parseInt(this.popup.style.left, 10);\n let displayY = parseInt(this.popup.style.top, 10);\n\n if (displayX > winX || displayY > winY) {\n this.resetPopupPosition();\n }\n\n let vpip = 0;\n let pfr = 0;\n let bet3 = 0;\n if (this.nhands > 0) {\n vpip = Math.round(100*this.nvpip/this.nhands);\n pfr = Math.round(100*this.npfr/this.nhands);\n bet3 = Math.round(100*this.n3bet/this.nhands);\n }\n let displayStr = `Stats for Player ${this.seatID}</br>VPIP: ${vpip}%</br>PFR: ${pfr}%</br>3bet: ${bet3}%</br>Hands: ${this.nhands}`;\n this.popup.innerHTML = displayStr;\n }", "function centerOnGraph(){\r\n\t//fit viewport to all elements with padding of 50\r\n\tcy.fit( cy.$(), 50 );\r\n}", "function alignDialog() {\n const dialog = document.querySelector(`${dialogSelector}`);\n if (dialog === null) return;\n\n const styleLeft = parseInt(dialog.style.left);\n const styleTop = parseInt(dialog.style.top);\n const boundingWidth = dialog.getBoundingClientRect().width;\n const boundingHeight = dialog.getBoundingClientRect().height;\n\n const left = Math.min(styleLeft, window.innerWidth - (offWindow ? border : boundingWidth));\n const top = Math.min(styleTop, window.innerHeight - (offWindow ? border : boundingHeight));\n\n let borderLeft = 0;\n let borderTop = 0;\n\n // we need to add some borders to center the dialog once the window has resized\n if (offWindow) {\n if (styleLeft < (border - boundingWidth)) {\n borderLeft = styleLeft - (border - boundingWidth);\n }\n } else {\n if (styleLeft > window.innerWidth) {\n borderLeft = left / 2;\n }\n\n if (styleTop + boundingHeight > window.innerHeight) {\n borderTop = (window.innerHeight - boundingHeight) / 2;\n }\n }\n\n dialog.style.left = (left - borderLeft) + 'px';\n dialog.style.top = (top - borderTop) + 'px';\n}", "function setPosition (x, y, width, height) {\n if (x == 'fullscreen') {\n svl.ui.popUpMessage.box.css({\n left: 0,\n top: 0,\n width: '960px',\n height: '680px',\n zIndex: 1000\n });\n } else if (x == 'canvas-top-left') {\n svl.ui.popUpMessage.box.css({\n left: 365,\n top: 122,\n width: '360px',\n height: '',\n zIndex: 1000\n });\n } else {\n svl.ui.popUpMessage.box.css({\n left: x,\n top: y,\n width: width,\n height: height,\n zIndex: 1000\n });\n }\n\n return this;\n }", "function Popups_PopupData_WrapPopupForHeight(parent, popup, size, maxHeight)\n{\n\t//create a div to be our wrapper\n\tvar wrapper = parent.appendChild(document.createElement(\"div\"));\n\t//set our styles\n\twrapper.style.cssText = \"position:absolute;overflow-x:visible;overflow-y:hidden;\";\n\twrapper.style.width = size.width + \"px\";\n\twrapper.style.height = maxHeight + \"px\";\n\t//add our buttons\n\twrapper.ScrollUp = wrapper.appendChild(document.createElement(\"button\"));\n\twrapper.ScrollUp.style.cssText = \"position:absolute;top:0px;left:0px;height:10px;width:100%;background-position:center;background-repeat:no-repeat;\";\n\twrapper.ScrollUp.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_scroll_up.png')\";\n\twrapper.ScrollUp.SCROLL = true;\n\t//add down button\n\twrapper.ScrollDown = wrapper.appendChild(document.createElement(\"button\"));\n\twrapper.ScrollDown.style.cssText = \"position:absolute;bottom:0px;left:0px;height:10px;width:100%;background-position:center;background-repeat:no-repeat;\";\n\twrapper.ScrollDown.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_scroll_down.png')\";\n\twrapper.ScrollDown.SCROLL = true;\n\n\t//add scrollpane\n\twrapper.ScrollPane = wrapper.appendChild(document.createElement(\"div\"));\n\twrapper.ScrollPane.style.cssText = \"position:absolute;width:100%;overflow:hidden;\";\n\twrapper.ScrollPane.style.top = wrapper.ScrollUp.offsetHeight + \"px\";\n\twrapper.ScrollPane.style.bottom = wrapper.ScrollDown.offsetHeight + \"px\";\n\t//add the popup to the scrollpane\n\twrapper.Popup = wrapper.ScrollPane.appendChild(parent.removeChild(popup));\n\t//make sure its correctly positioned\n\tpopup.style.left = \"0px\";\n\tpopup.style.top = \"0px\";\n\t//calculate scroll modifier\n\twrapper.ScrollModifier = popup.rows ? Math.ceil(size.height / popup.rows.length) : 10;\n\t//set events\n\tBrowser_AddEvent(wrapper.ScrollUp, __BROWSER_EVENT_MOUSEDOWN, Browser_BlockEvent);\n\tBrowser_AddEvent(wrapper.ScrollDown, __BROWSER_EVENT_MOUSEDOWN, Browser_BlockEvent);\n\tBrowser_AddEvent(wrapper.ScrollUp, __BROWSER_EVENT_CLICK, function () { wrapper.ScrollPane.scrollTop -= wrapper.ScrollModifier; });\n\tBrowser_AddEvent(wrapper.ScrollDown, __BROWSER_EVENT_CLICK, function () { wrapper.ScrollPane.scrollTop += wrapper.ScrollModifier; });\n\t//finally mark us on the popup itself\n\tpopup.WRAPPER = wrapper;\n\twrapper.IsWrapper = true;\n\t//return our wrapper\n\treturn wrapper;\n}", "function posCenterInCenter(d) { d.classList.add('centerCentered'); }", "function closeStatsPopup(){\n\tstatsBackgroundImage.transform = SCALE_ZERO;\n\tdestroyStatsPopup();\n}", "function SWEPopupNNSize() \n{ \n var popWin=Top().SWEPopupWin;\n if((popWin == null) || (popWin.closed))\n popWin = window;\n\t\t\n popWin.scrollTo(10000, 10000);\n setTimeout(\"NNResize()\", 10);\n}", "function centerFancybox()\n {\n \tif (settings.centerFancybox && typeof $.fancybox === 'function' && typeof $.fancybox.center === 'function' && $('#fancybox-wrap').length && $('#fancybox-wrap').is(':visible')) {\n $.fancybox.center(settings.centerFancyboxSpeed);\n \t}\n }", "setBottomColapsedMenuSize() {\n\t\t// When counting position we need compensate a pixel\n\t\tconst fixOffsetPosition = 1;\n\t\tif (this.isWindowFixed && this._window) {\n\t\t\tconst diff = this.element.offsetTop - this._window._dialog.offsetTop;\n\t\t\tlet height = diff - this._window.defaultBorderSize - this._window.defaultBorderSize + fixOffsetPosition;\n\t\t\tthis.element.style['max-height'] = height + 'px';\n\t\t\tthis.element.style['min-width'] = this._currentWidth + 'px';\n\t\t}\n\t}", "function adjust() {\n // adjust the width:\n adjust_main_width();\n // close the popup\n $part_popup.slideUp(0);\n }", "function fixPopupLayoutTables() {\n\t\t\t//global popups overlay element\n\t\t\tvar $rootPopUp = $(\"#popup-active-overlay\");\n\t\t\t//check if exists\n\t\t\tif ($rootPopUp.length > 0) {\n\t\t\t\t//hide it before clicking it to hide the effect hack\n\t\t\t\t$rootPopUp.css(\"opacity\",0);\n\t\t\t\t//click the popup links to load their content to get computed height\n\t\t\t\t$(\".popup-element-title\").click();\n\n\t\t\t\t//the middle row of the layout table where the height for left and right columns need setting\n\t\t\t\tvar midTable = $rootPopUp.find(\".popup-element-body .center td\");\n\t\t\t\tvar midTableHeight = $(midTable.get(1)).css(\"height\");\n\t\t\t\tmidTable.each(function(){\n\t\t\t\t\t$(this).css(\"height\", midTableHeight);\n\t\t\t\t});\n\n\t\t\t\t//click again to close the popups\n\t\t\t\t$(\".popup-element-title\").click();\n\t\t\t\t//show the overlay again\n\t\t\t\t$rootPopUp.css(\"opacity\",1);\n\t\t\t}\n\t\t}", "function fixPopupLayoutTables() {\n\t\t\t//global popups overlay element\n\t\t\tvar $rootPopUp = $(\"#popup-active-overlay\");\n\t\t\t//check if exists\n\t\t\tif ($rootPopUp.length > 0) {\n\t\t\t\t//hide it before clicking it to hide the effect hack\n\t\t\t\t$rootPopUp.css(\"opacity\",0);\n\t\t\t\t//click the popup links to load their content to get computed height\n\t\t\t\t$(\".popup-element-title\").click();\n\n\t\t\t\t//the middle row of the layout table where the height for left and right columns need setting\n\t\t\t\tvar midTable = $rootPopUp.find(\".popup-element-body .center td\");\n\t\t\t\tvar midTableHeight = $(midTable.get(1)).css(\"height\");\n\t\t\t\tmidTable.each(function(){\n\t\t\t\t\t$(this).css(\"height\", midTableHeight);\n\t\t\t\t});\n\n\t\t\t\t//click again to close the popups\n\t\t\t\t$(\".popup-element-title\").click();\n\t\t\t\t//show the overlay again\n\t\t\t\t$rootPopUp.css(\"opacity\",1);\n\t\t\t}\n\t\t}", "function setupLayout(element) {\n\n var popupDiv = document.getElementById(element + '_ModalPopupDiv');\n var foregroundElement = document.getElementById(element + '_ForeGround');\n\n if (popupDiv == null || foregroundElement == null) {\n return;\n }\n \n // Position the modal dialog \n var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);\n var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);\n\n if (scrollTop && scrollTop == 0) {\n scrollTop = getScrollHeight();\n }\n\n var clientWidth = -1;\n var clientHeight = -1;\n \n // getClientBounds must return dimensions excluding scrollbars, so cannot use window.innerWidth and window.innerHeight.\n if (document.compatMode == \"CSS1Compat\") {\n // Standards-compliant mode\n clientWidth = document.documentElement.clientWidth;\n clientHeight = document.documentElement.clientHeight;\n }\n else {\n // Quirks mode\n clientWidth = document.body.clientWidth;\n clientHeight = document.body.clientHeight;\n }\n\n layoutBackgroundElement(element);\n foregroundElementClientRect = foregroundElement.getBoundingClientRect();\n\n var xCoord = 0;\n var yCoord = 0;\n \n // Setting the left for the foreground element\n var foregroundelementwidth = foregroundElement.offsetWidth ? foregroundElement.offsetWidth : foregroundElement.scrollWidth;\n xCoord = ((clientWidth - foregroundelementwidth) / 2);\n \n if (foregroundElement.style.position == 'absolute') {\n xCoord += scrollLeft;\n }\n foregroundElement.style.left = xCoord + 'px';\n\n \n // Setting the right for the foreground element\n var foregroundelementheight = foregroundElement.offsetHeight ? foregroundElement.offsetHeight : foregroundElement.scrollHeight;\n yCoord = ((clientHeight - foregroundelementheight) / 2);\n \n //if (foregroundElement.style.position == 'absolute') {\n yCoord += scrollTop;\n //}\n foregroundElement.style.top = yCoord + 'px';\n\n \n // layout background element again to make sure it covers the whole background \n // in case things moved around when laying out the foreground element\n layoutBackgroundElement(element);\n}", "function resizePopup() {\n\tvar popImage = document.getElementById(\"popImage\");\n\tif (popImage != null) {\n\t\tvar maxWidth = 800;\n\t\tvar maxHeight = 800;\n\t\tvar width = popImage.width + 20;\n\t\tvar height = popImage.height + 20;\n\t\tif (popImage.width > 0) {\n\t\t\tif (width > height) {\n\t\t\t\tif (width > maxWidth) {\n\t\t\t\t\tvar ratio = maxWidth / width;\n\t\t\t\t\twidth = maxWidth;\n\t\t\t\t\theight = ratio * height;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (height > maxHeight) {\n\t\t\t\t\tvar ratio = maxHeight / height;\n\t\t\t\t\theight = maxHeight;\n\t\t\t\t\twidth = ratio * width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpopImage.width = width - 20;\n\t\t\tpopImage.height = height - 20;\n\t\t\twindow.resizeTo(width, height);\n\t\t\tself.focus();\n\t\t} else {\n\t\t\timgWindow.close(); // close window as the image can't be shown.\n\t\t}\n\t}\n}" ]
[ "0.70235914", "0.68569136", "0.6525881", "0.6350007", "0.6336411", "0.62905973", "0.619759", "0.6031462", "0.5965502", "0.59488547", "0.59030074", "0.58725643", "0.5865487", "0.58460826", "0.5823242", "0.5805242", "0.57774776", "0.57330513", "0.56705767", "0.5670379", "0.5589504", "0.5579845", "0.5575977", "0.5555716", "0.5554645", "0.5536996", "0.55316126", "0.55306953", "0.5502244", "0.54957074", "0.5493569", "0.54890746", "0.5477134", "0.5460988", "0.54177564", "0.5401761", "0.5392495", "0.5386185", "0.53748214", "0.53748214", "0.5368634", "0.5358323", "0.5357403", "0.5357346", "0.5353624", "0.53212005", "0.5309538", "0.5291918", "0.5291239", "0.52837306", "0.52735114", "0.5264704", "0.5263061", "0.52614963", "0.5245583", "0.5244834", "0.5228628", "0.5227083", "0.522615", "0.5195655", "0.5190237", "0.51872814", "0.5184641", "0.5182444", "0.5180582", "0.5178068", "0.5169273", "0.51652086", "0.5153391", "0.51488227", "0.51362795", "0.5134721", "0.5096382", "0.50937676", "0.5082249", "0.50798845", "0.507603", "0.5056543", "0.5054823", "0.50513476", "0.5049428", "0.5049428", "0.50367516", "0.50183356", "0.5003515", "0.5003245", "0.49831992", "0.49805817", "0.49744782", "0.49722975", "0.4961437", "0.49549568", "0.49530736", "0.4940469", "0.49380502", "0.49361804", "0.49315923", "0.49282184", "0.49282184", "0.4927671", "0.4923189" ]
0.0
-1
This function contains the other three to make life simple in the HTML file.
function popup(windowname){ blanket_size(windowname); window_pos(windowname); toggle('blanket'); toggle(windowname); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function htmlWriter() {\n \n //writes the html for introduction\n htmlIntro();\n \n //creates the event functionality for example 1 and example 2\n exampleSetEvents();\n \n //writes the html for the game\n htmlGame();\n }", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "function html() {\n\t// Your code here\n}", "function makehtml(fi) {//makes an html file which will contain the lyrics for the song designated by the file named 'fi' a string of html code\n var ht=\"<!DOCTYPE html>\\n<html>\\n<head lang=\\\"en\\\">\\n<meta charset=\\\"UTF-8\\\">\\n<title>\"+ fi + \"</title>\\n</head>\\\"\\n<body>\\n<p id=\\\"demo\\\"></p>\";\n ht+=formatlyrics(fi);\n ht+= \"</body>\\n</html>\";\n return ht;\n\n}", "function buildHtml(title, description, fileselect, uploaderName) {\r\n var header = '';\r\n //var body = '<h1>Hello World! retest</h1>';\r\n var currentPath = process.cwd();\r\n\r\n\r\n var fs = require('fs'); //Filesystem \r\n\r\n var content = fs.readFileSync(currentPath + '/public/activities/test/dummypage.html',\"utf-8\");\r\n \r\n var content2 = content.replace('Dummy Results##1title', title);\r\n var content3 = content2.replace('Description##1', description);\r\n var content4 = content3.replace(\"https://studybreaks.com/wp-content/uploads/2017/08/books.jpg\", fileselect);\r\n var content4 = content4.replace(\"Example content####Uploadername\", 'Activity by: ' + uploaderName);\r\n //console.log(content4);\r\n\r\n\r\n return content4;\r\n}", "function main() {\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'End of js_css_chooser.js';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n\n // Font\n prependDiv('font_test');\n prependDiv('font_solarized');\n prependDiv('font_cursive_hard');\n prependDiv('font_cursive_soft');\n prependDiv('font_safe');\n\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'Font';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n\n // Css\n prependDiv('layout');\n prependDiv('color_light');\n prependDiv('color_dark');\n\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'Color';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n}", "function htmlLoad() {\n}", "function allHtmlFn(){\n\tcompileAllPugFiles(pugDocDitectory);\n}", "function main() {\n addHeadings();\n styleTutorialsAndArticles();\n separateAllTutorials();\n}", "function htmlIntro() {\n \n document.writeln(\"<div class = title>Prescriber Portal</div>\");\n document.writeln(\"<div class = subtitle>Created By: GunaCode </div>\");\n /* game rules and examples */\n //button\n document.writeln(\"<button type=\\\"button\\\" class=\\\"collapsible\\\">\" + gameHeader[0] + \"</button>\")\n \n //content\n document.writeln(\"<div class=\\\"content\\\">\");\n htmlDescript(0);\n document.writeln(\"</div>\");\n \n /* header for game setup */\n //button\n document.writeln(\"<button type=\\\"button\\\" class=\\\"collapsible\\\">\" + gameHeader[1] + \"</button>\")\n // document.writeln(\"<canvas id=\\\"myChart\\\" style=\\\"width:100%;max-width:700px\\\"></canvas>\");\n // document.writeln(\"<p>\"+displayValue+\"</p>\");\n // makeChart();\n // document.writeln(\"<p>\"+displayValue+\"</p>\");\n // document.writeln(\"<p>\"+printValue+\"</p>\");\n \n \n \n //content\n document.writeln(\"<div class=\\\"content\\\">\");\n htmlDescript(1);\n document.writeln(\"</div>\");\n \n //header for game\n //htmlHeaders(2);\n collapsibleStyling();\n \n }", "display() {\n fs.writeFile(outputFile, makeHtml(this.team), function (err){\n if (err) {\n console.log(err)\n } else {\n console.log(\"Made file!\");\n }\n });\n }", "function TML2HTML() {\n \n /* Constants */\n var startww = \"(^|\\\\s|\\\\()\";\n var endww = \"($|(?=[\\\\s\\\\,\\\\.\\\\;\\\\:\\\\!\\\\?\\\\)]))\";\n var PLINGWW =\n new RegExp(startww+\"!([\\\\w*=])\", \"gm\");\n var TWIKIVAR =\n new RegExp(\"^%(<nop(?:result| *\\\\/)?>)?([A-Z0-9_:]+)({.*})?$\", \"\");\n var MARKER =\n new RegExp(\"\\u0001([0-9]+)\\u0001\", \"\");\n var protocol = \"(file|ftp|gopher|https|http|irc|news|nntp|telnet|mailto)\";\n var ISLINK =\n new RegExp(\"^\"+protocol+\":|/\");\n var HEADINGDA =\n new RegExp('^---+(\\\\++|#+)(.*)$', \"m\");\n var HEADINGHT =\n new RegExp('^<h([1-6])>(.+?)</h\\\\1>', \"i\");\n var HEADINGNOTOC =\n new RegExp('(!!+|%NOTOC%)');\n var wikiword = \"[A-Z]+[a-z0-9]+[A-Z]+[a-zA-Z0-9]*\";\n var WIKIWORD =\n new RegExp(wikiword);\n var webname = \"[A-Z]+[A-Za-z0-9_]*(?:(?:[\\\\./][A-Z]+[A-Za-z0-9_]*)+)*\";\n var WEBNAME =\n new RegExp(webname);\n var anchor = \"#[A-Za-z_]+\";\n var ANCHOR =\n new RegExp(anchor);\n var abbrev = \"[A-Z]{3,}s?\\\\b\";\n var ABBREV =\n new RegExp(abbrev);\n var ISWIKILINK =\n new RegExp( \"^(?:(\"+webname+\")\\\\.)?(\"+wikiword+\")(\"+anchor+\")?\");\n var WW =\n new RegExp(startww+\"((?:(\"+webname+\")\\\\.)?(\"+wikiword+\"))\", \"gm\");\n var ITALICODE =\n new RegExp(startww+\"==(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)==\"+endww, \"gm\");\n var BOLDI =\n new RegExp(startww+\"__(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)__\"+endww, \"gm\");\n var CODE =\n new RegExp(startww+\"\\\\=(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\=\"+endww, \"gm\");\n var ITALIC =\n new RegExp(startww+\"\\\\_(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\_\"+endww, \"gm\");\n var BOLD =\n new RegExp(startww+\"\\\\*(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\*\"+endww, \"gm\");\n var NOPWW =\n new RegExp(\"<nop(?: *\\/)?>(\"+wikiword+\"|\"+abbrev+\")\", \"g\");\n var URI =\n new RegExp(\"(^|[-*\\\\s(])(\"+protocol+\":([^\\\\s<>\\\"]+[^\\s*.,!?;:)<]))\");\n\n /*\n * Main entry point, and only external function. 'options' is an object\n * that must provide the following method:\n * getViewUrl(web,topic) -> url (where topic may include an anchor)\n * and may optionally provide\n * expandVarsInURL(url, options) -> url\n * getViewUrl must generate a URL for the given web and topic.\n * expandVarsinURL gives an opportunity for a caller to expand selected\n * Macros embedded in URLs\n */\n this.convert = function(content, options) {\n this.opts = options;\n\n content = content.replace(/\\\\\\n/g, \" \");\n \n content = content.replace(/\\u0000/g, \"!\");\t\n content = content.replace(/\\u0001/g, \"!\");\t\n content = content.replace(/\\u0002/g, \"!\");\t\n \n this.refs = new Array();\n\n // Render TML constructs to tagged HTML\n return this._getRenderedVersion(content);\n };\n \n this._liftOut = function(text) {\n index = '\\u0001' + this.refs.length + '\\u0001';\n this.refs.push(text);\n return index;\n }\n \n this._dropBack = function(text) {\n var match;\n \n while (match = MARKER.exec(text)) {\n var newtext = this.refs[match[1]];\n if (newtext != match[0]) {\n var i = match.index;\n var l = match[0].length;\n text = text.substr(0, match.index) +\n newtext +\n text.substr(match.index + match[0].length);\n }\n MARKER.lastIndex = 0;\n }\n return text;\n };\n \n // Parse twiki variables.\n //for InlineEdit, would like to not nest them, and to surround entire html entities where needed\n this._processTags = function(text) {\n \n var queue = text.split(/%/);\n var stack = new Array();\n var stackTop = '';\n var prev = '';\n \n while (queue.length) {\n var token = queue.shift();\n if (stackTop.substring(-1) == '}') {\n while (stack.length && !TWIKIVAR.match(stackTop)) {\n stackTop = stack.pop() + stackTop;\n }\n }\n \n var match = TWIKIVAR.exec(stackTop);\n if (match) {\n var nop = match[1];\n var args = match[3];\n if (!args)\n args = '';\n // You can always replace the %'s here with a construct e.g.\n // html spans; however be very careful of variables that are\n // used in the context of parameters to HTML tags e.g.\n // <img src=\"%ATTACHURL%...\">\n var tag = '%' + match[2] + args + '%';\n if (nop) {\n nop = nop.replace(/[<>]/g, '');\n tag = \"<span class='TML'\"+nop+\">\"+tag+\"</span>\";\n }\n stackTop = stack.pop() + this._liftOut(tag) + token;\n } else {\n stack.push(stackTop);\n stackTop = prev + token;\n }\n prev = '%';\n }\n // Run out of input. Gather up everything in the stack.\n while (stack.length) {\n stackTop = stack.pop(stack) + stackTop;\n }\n \n return stackTop;\n };\n \n this._makeLink = function(url, text) {\n if (!text || text == '')\n text = url;\n url = this._liftOut(url);\n return \"<a href='\"+url+\"'>\" + text + \"</a>\";\n };\n \n this._expandRef = function(ref) {\n if (this.opts['expandVarsInURL']) {\n var origtxt = this.refs[ref];\n var newtxt = this.opts['expandVarsInURL'](origtxt, this.opts);\n if (newTxt != origTxt)\n return newtxt;\n }\n return '\\u0001'+ref+'\\u0001';\n };\n \n this._expandURL = function(url) {\n if (this.opts['expandVarsInURL'])\n return this.opts['expandVarsInURL'](url, this.opts);\n return url;\n };\n \n this._makeSquab = function(url, text) {\n url = _sg(MARKER, url, function(match) {\n this._expandRef(match[1]);\n }, this);\n \n if (url.test(/[<>\\\"\\x00-\\x1f]/)) {\n // we didn't manage to expand some variables in the url\n // path. Give up.\n // If we can't completely expand the URL, then don't expand\n // *any* of it (hence save)\n return text ? \"[[save][text]]\" : \"[[save]]\";\n }\n \n if (!text) {\n // forced link [[Word]] or [[url]]\n text = url;\n if (url.test(ISLINK)) {\n var wurl = url;\n wurl.replace(/(^|)(.)/g,$2.toUpperCase());\n var match = wurl.exec(ISWEB);\n if (match) {\n url = this.opts['getViewUrl'](match[1], match[2] + match[3]);\n } else {\n url = this.opts['getViewUrl'](null, wurl);\n }\n }\n } else if (match = url.exec(ISWIKILINK)) {\n // Valid wikiword expression\n url = this.optsgetViewUrl(match[1], match[2]) + match[3];\n }\n \n text.replace(WW, \"$1<nop>$2\");\n \n return this._makeLink(url, text);\n };\n \n // Lifted straight out of DevelopBranch Render.pm\n this._getRenderedVersion = function(text, refs) {\n if (!text)\n return '';\n \n this.LIST = new Array();\n this.refs = new Array();\n \n // Initial cleanup\n text = text.replace(/\\r/g, \"\");\n text = text.replace(/^\\n+/, \"\");\n text = text.replace(/\\n+$/, \"\");\n\n var removed = new BlockSafe();\n \n text = removed.takeOut(text, 'verbatim', true);\n\n // Remove PRE to prevent TML interpretation of text inside it\n text = removed.takeOut(text, 'pre', false);\n \n // change !%XXX to %<nop>XXX\n text = text.replace(/!%([A-Za-z_]+(\\{|%))/g, \"%<nop>$1\");\n\n // change <nop>%XXX to %<nopresult>XXX. A nop before th % indicates\n // that the result of the tag expansion is to be nopped\n text = text.replace(/<nop>%(?=[A-Z]+(\\{|%))/g, \"%<nopresult>\");\n \n // Pull comments\n text = _sg(/(<!--.*?-->)/, text,\n function(match) {\n this._liftOut(match[1]);\n }, this);\n \n // Remove TML pseudo-tags so they don't get protected like HTML tags\n text = text.replace(/<(.?(noautolink|nop|nopresult).*?)>/gi,\n \"\\u0001($1)\\u0001\");\n \n // Expand selected TWiki variables in IMG tags so that images appear in the\n // editor as images\n text = _sg(/(<img [^>]*src=)([\\\"\\'])(.*?)\\2/i, text,\n function(match) {\n return match[1]+match[2]+this._expandURL(match[3])+match[2];\n }, this);\n \n // protect HTML tags by pulling them out\n text = _sg(/(<\\/?[a-z]+(\\s[^>]*)?>)/i, text,\n function(match) {\n return this._liftOut(match[1]);\n }, this);\n \n var pseud = new RegExp(\"\\u0001\\((.*?)\\)\\u0001\", \"g\");\n // Replace TML pseudo-tags\n text = text.replace(pseud, \"<$1>\");\n \n // Convert TWiki tags to spans outside parameters\n text = this._processTags(text);\n \n // Change ' !AnyWord' to ' <nop>AnyWord',\n text = text.replace(PLINGWW, \"$1<nop>$2\");\n \n text = text.replace(/\\\\\\n/g, \"\"); // Join lines ending in '\\'\n \n // Blockquoted email (indented with '> ')\n text = text.replace(/^>(.*?)/gm,\n '&gt;<cite class=TMLcite>$1<br /></cite>');\n \n // locate isolated < and > and translate to entities\n // Protect isolated <!-- and -->\n text = text.replace(/<!--/g, \"\\u0000{!--\");\n text = text.replace(/-->/g, \"--}\\u0000\");\n // SMELL: this next fragment is a frightful hack, to handle the\n // case where simple HTML tags (i.e. without values) are embedded\n // in the values provided to other tags. The only way to do this\n // correctly (i.e. handle HTML tags with values as well) is to\n // parse the HTML (bleagh!)\n text = text.replace(/<(\\/[A-Za-z]+)>/g, \"{\\u0000$1}\\u0000\");\n text = text.replace(/<([A-Za-z]+(\\s+\\/)?)>/g, \"{\\u0000$1}\\u0000\");\n text = text.replace(/<(\\S.*?)>/g, \"{\\u0000$1}\\u0000\");\n // entitify lone < and >, praying that we haven't screwed up :-(\n text = text.replace(/</g, \"&lt;\");\n text = text.replace(/>/g, \"&gt;\");\n text = text.replace(/{\\u0000/g, \"<\");\n text = text.replace(/}\\u0000/g, \">\");\n \n // standard URI\n text = _sg(URI, text,\n function(match) {\n return match[1] + this._makeLink(match[2],match[2]);\n }, this);\n \n // Headings\n // '----+++++++' rule\n text = _sg(HEADINGDA, text, function(match) {\n return this._makeHeading(match[2],match[1].length);\n }, this);\n \n // Horizontal rule\n var hr = \"<hr class='TMLhr' />\";\n text = text.replace(/^---+/gm, hr);\n \n // Now we really _do_ need a line loop, to process TML\n // line-oriented stuff.\n var isList = false;\t\t// True when within a list\n var insideTABLE = false;\n this.result = new Array();\n\n var lines = text.split(/\\n/);\n for (var i in lines) {\n var line = lines[i];\n // Table: | cell | cell |\n // allow trailing white space after the last |\n if (line.match(/^(\\s*\\|.*\\|\\s*)/)) {\n if (!insideTABLE) {\n result.push(\"<table border=1 cellpadding=0 cellspacing=1>\");\n }\n result.push(this._emitTR(match[1]));\n insideTABLE = true;\n continue;\n } else if (insideTABLE) {\n result.push(\"</table>\");\n insideTABLE = false;\n }\n // Lists and paragraphs\n if (line.match(/^\\s*$/)) {\n isList = false;\n line = \"<p />\";\n }\n else if (line.match(/^\\S+?/)) {\n isList = false;\n }\n else if (line.match(/^(\\t| )+\\S/)) {\n var match;\n if (match = line.match(/^((\\t| )+)\\$\\s(([^:]+|:[^\\s]+)+?):\\s(.*)$/)) {\n // Definition list\n line = \"<dt> \"+match[3]+\" </dt><dd> \"+match[5];\n this._addListItem('dl', 'dd', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)(\\S+?):\\s(.*)$/)) {\n // Definition list\n line = \"<dt> \"+match[3]+\" </dt><dd> \"+match[4];\n this._addListItem('dl', 'dd', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)\\* (.*)$/)) {\n // Unnumbered list\n line = \"<li> \"+match[3];\n this._addListItem('ul', 'li', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)([1AaIi]\\.|\\d+\\.?) ?/)) {\n // Numbered list\n var ot = $3;\n ot = ot.replace(/^(.).*/, \"$1\");\n if (!ot.match(/^\\d/)) {\n ot = ' type=\"'+ot+'\"';\n } else {\n ot = '';\n }\n line.replace(/^((\\t| )+)([1AaIi]\\.|\\d+\\.?) ?/,\n \"<li\"+ot+\"> \");\n this._addListItem('ol', 'li', match[1]);\n isList = true;\n }\n } else {\n isList = false;\n }\n \n // Finish the list\n if (!isList) {\n this._addListItem('', '', '');\n }\n \n this.result.push(line);\n }\n \n if (insideTABLE) {\n this.result.push('</table>');\n }\n this._addListItem('', '', '');\n \n text = this.result.join(\"\\n\");\n text = text.replace(ITALICODE, \"$1<b><code>$2</code></b>\")\n text = text.replace(BOLDI, \"$1<b><i>$2</i></b>\");\n text = text.replace(BOLD, \"$1<b>$2</b>\")\n text = text.replace(ITALIC, \"$1<i>$2</i>\")\n text = text.replace(CODE, \"$1<code>$2</code>\");\n \n // Handle [[][] and [[]] links\n text = text.replace(/(^|\\s)\\!\\[\\[/gm, \"$1[<nop>[\");\n \n // We _not_ support [[http://link text]] syntax\n \n // detect and escape nopped [[][]]\n text = text.replace(/\\[<nop(?: *\\/)?>(\\[.*?\\](?:\\[.*?\\])?)\\]/g,\n '[<span class=\"TMLnop\">$1</span>]');\n text.replace(/!\\[(\\[.*?\\])(\\[.*?\\])?\\]/g,\n '[<span class=\"TMLnop\">$1$2</span>]');\n \n // Spaced-out Wiki words with alternative link text\n // i.e. [[1][3]]\n\n text = _sg(/\\[\\[([^\\]]*)\\](?:\\[([^\\]]+)\\])?\\]/, text,\n function(match) {\n return this._makeSquab(match[1],match[2]);\n }, this);\n \n // Handle WikiWords\n text = removed.takeOut(text, 'noautolink', true);\n \n text = text.replace(NOPWW, '<span class=\"TMLnop\">$1</span>');\n \n text = _sg(WW, text,\n function(match) {\n var url = this.opts['getViewUrl'](match[3], match[4]);\n if (match[5])\n url += match[5];\n return match[1]+this._makeLink(url, match[2]);\n }, this);\n\n text = removed.putBack(text, 'noautolink', 'div');\n \n text = removed.putBack(text, 'pre');\n \n // replace verbatim with pre in the final output\n text = removed.putBack(text, 'verbatim', 'pre',\n function(text) {\n // use escape to URL encode, then JS encode\n return HTMLEncode(text);\n });\n \n // There shouldn't be any lingering <nopresult>s, but just\n // in case there are, convert them to <nop>s so they get removed.\n text = text.replace(/<nopresult>/g, \"<nop>\");\n \n return this._dropBack(text);\n }\n \n // Make the html for a heading\n this._makeHeading = function(heading, level) {\n var notoc = '';\n if (heading.match(HEADINGNOTOC)) {\n heading = heading.substring(0, match.index) +\n heading.substring(match.index + match[0].length);\n notoc = ' notoc';\n }\n return \"<h\"+level+\" class='TML\"+notoc+\"'>\"+heading+\"</h\"+level+\">\";\n };\n\n\n this._addListItem = function(type, tag, indent) {\n indent = indent.replace(/\\t/g, \" \");\n var depth = indent.length / 3;\n var size = this.LIST.length;\n\n if (size < depth) {\n var firstTime = true;\n while (size < depth) {\n var obj = new Object();\n obj['type'] = type;\n obj['tag'] = tag;\n this.LIST.push(obj);\n if (!firstTime)\n this.result.push(\"<\"+tag+\">\");\n this.result.push(\"<\"+type+\">\");\n firstTime = false;\n size++;\n }\n } else {\n while (size > depth) {\n var types = this.LIST.pop();\n this.result.push(\"</\"+types['tag']+\">\");\n this.result.push(\"</\"+types['type']+\">\");\n size--;\n }\n if (size) {\n this.result.push(\"</this.{LIST}.[size-1].{element}>\");\n }\n }\n \n if (size) {\n var oldt = this.LIST[size-1];\n if (oldt['type'] != type) {\n this.result.push(\"</\"+oldt['type']+\">\\n<type>\");\n this.LIST.pop();\n var obj = new Object();\n obj['type'] = type;\n obj['tag'] = tag;\n this.LIST.push(obj);\n }\n }\n }\n \n this._emitTR = function(row) {\n \n row.replace(/^(\\s*)\\|/, \"\");\n var pre = 1;\n \n var tr = new Array();\n \n while (match = row.match(/^(.*?)\\|/)) {\n row = row.substring(match[0].length);\n var cell = 1;\n \n if (cell == '') {\n cell = '%SPAN%';\n }\n \n var attr = new Attrs();\n \n my (left, right) = (0, 0);\n if (cell.match(/^(\\s*).*?(\\s*)/)) {\n left = length (1);\n right = length (2);\n }\n \n if (left > right) {\n attr.set('class', 'align-right');\n attr.set('style', 'text-align: right');\n } else if (left < right) {\n attr.set('class', 'align-left');\n attr.set('style', 'text-align: left');\n } else if (left > 1) {\n attr.set('class', 'align-center');\n attr.set('style', 'text-align: center');\n }\n \n // make sure there's something there in empty cells. Otherwise\n // the editor will compress it to (visual) nothing.\n cell.replace(/^\\s*/g, \"&nbsp;\");\n \n // Removed TH to avoid problems with handling table headers. TWiki\n // allows TH anywhere, but Kupu assumes top row only, mostly.\n // See Item1185\n tr.push(\"<td \"+attr+\"> \"+cell+\" </td>\");\n }\n return pre+\"<tr>\" + tr.join('')+\"</tr>\";\n }\n}", "function buildWebPage(result){\n document.getElementById('article').innerHTML = result.description;\n document.getElementById('article-title').innerHTML = result.title;\n}", "function main(){\n // 1\n changeTitle('index.html', 'Webprogramming (LIX019P05) - Index');\n changeTitle('second.html', 'Webprogramming (LIX019P05) - Second');\n\n // 2\n const mainCol = document.getElementsByClassName('col-md-12');\n const newArticleHeader = 'This is my second article';\n const newArticleText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eget eros ultrices, dapibus lacus ultrices, ultrices tortor. Nam tincidunt blandit neque, at ornare sapien ultricies ut. Integer eget ultricies velit. Cras eu tellus ex. Integer bibendum nisi neque, sed auctor odio blandit sit amet. Aenean augue tellus, tincidunt vel commodo bibendum, rutrum nec augue. Donec pulvinar sem in purus congue sodales. Nam magna urna, maximus ut eros vel, rutrum semper sem. Duis a efficitur mauris. Nunc a aliquam nisi, vel iaculis justo. Donec lacus nulla, sollicitudin vitae lectus vel, tempus vestibulum ipsum. In dignissim consequat pellentesque. Pellentesque eget eleifend velit. Aenean aliquam auctor nibh vitae tristique. Nulla facilisi.';\n addArticle(mainCol, newArticleHeader, newArticleText, 'index.html');\n\n // 3\n const link = changeLink();\n\n // 4\n linkBlank(link);\n\n // 5\n redMaker('nav-link');\n\n // 6\n // insertTable();\n\n // 7\n addSidebar();\n}", "function processHTML(){\n\n let htmlProfileArray = generateHTML.itterateProfiles(teamArray);\n let profilesHTML = htmlProfileArray.join('');\n let finishedHTML = generateHTML.finishedHTML(profilesHTML);\n \n writeHTMLToFile(finishedHTML);\n\n}", "function writeHTML() {\n let html = starterCode.getStarterCode();\n fs.writeFile(\"./output/index.html\", html, (err) => {\n if (err) throw err;\n });\n}", "function buildPage(file, data) {\n // Create a file called teamprofilepage.html, adding the input data transformed by generateHTML.js formatting.\n fs.writeFile(\"./dist/teampage.html\", generateHTML(data), function (error) {\n // If file created successfull, notify user of success in the command line interface. If error, notify user in the command line interface.\n if(error) {\n console.log(\"An unknown error occurred.\")\n }\n else {\n console.log(\"Your teampage.html file has been created successfully!\")\n }\n })\n}", "function generatePage(tab){\n\t\t\tif (tab == \"education\"){\n\t\t\t\tcurrent_embedded_tab = \"total\";\n\t\t\t\ttyperfunction(defaultuniversity, 'university', 2, function() {\n\t\t\t\t\tregister_embeddedevents(module_results)\n\t\t\t\t})();\n\t\t\t\ttyperfunction(alevels, 'alevel',10)();\n\t\t\t\ttyperfunction(gcses, 'gcses',10)();\n\t\t\t}\n\t\t\telse if (tab == \"about\"){\n\t\t\t\ttyperfunction(about, 'about-info',5)();\n\t\t\t\ttyperfunction(biography, 'biography', 5)();\n\t\t\t}\n\t\t\telse if (tab == \"contact\"){\n\t\t\t\ttyperfunction(contact, 'contact-info',5,register_contactevents)();\n\t\t\t}\n\t\t\telse if (tab == \"experience\"){\n\t\t\t\tcurrent_embedded_tab = \"warwicktech\";\n\t\t\t\ttyperfunction(defaultexperience, 'experience-content', 1, function(){\n\t\t\t\t\tregister_embeddedevents(experiences)\n\t\t\t\t})();\n\t\t\t}\n\t\t\telse if (tab == \"projects\"){\n\t\t\t\tcurrent_embedded_tab = \"year4\";\n\t\t\t\ttyperfunction(defaultproject, 'project-content', 1, function(){\n\t\t\t\t\tregister_embeddedevents(projects)\n\t\t\t\t})();\n\t\t\t}\n\t\t\telse if (tab == \"loading\"){\n\t\t\t\tfillLoadingBar(34,100)();\n\t\t\t\ttyperfunction(terminal_info, 'terminal-info', 10)();\n\t\t\t\ttyperfunction(boot_text,'boot-loading', 10)();\n\t\t\t\ttyperfunction(boot_progress, 'boot-progress',100, loadSplashScreen)();\n\t\t\t}\n\t\t\telse if (tab == \"splash\"){\n\t\t\t\ttyperfunction(splash_text, \"splash-text\",50)();\n\t\t\t}\n\t\t}", "renderHTML() {\n \n }", "function parseSimplePageHtml({\n title, mainText, link, linkText,\n}) {\n let html = simplePage;\n\n html = html.replace(/###TITLE###/g, title);\n html = html.replace(/###MAINTEXT###/g, mainText);\n html = html.replace(/###LINK###/g, link);\n html = html.replace(/###LINKTEXT###/g, linkText);\n\n return html;\n}", "function writeHTML() {\n\n const html = generateHTML(employees);\n\n writeFileAsync(\"./output/team.html\", html);\n\n console.log(\"team page built!\")\n\n}", "function renderHTML()\n {\n \n\n fs.writeFile('result/index.html', getTemplate(renderScript()), (err) => {\n \n if (err) throw err;\n \n console.log('HTML generated!');\n });\n \n\n }", "GetInitialHTML(AppIsSecured){\n let fs = require('fs')\n let os = require('os')\n\n let HTMLStart =`\n<!doctype html>\n<html>\n <head>\n <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'/>\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\">\n <meta name=\"apple-mobile-web-app-title\" content=\"` + this._AppName + `\">\n <link rel=\"apple-touch-icon\" href=\"apple-icon.png\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>` + this._AppName + `</title>\n <style>\n :root {\n --CoreX-color: `+ this._CSS.Color.Normale +`;\n \n --CoreX-font-size : 1.5vw;\n --TexteNomrale : `+ this._CSS.FontSize.TexteNomrale +`;\n\n --CoreX-Iphone-font-size :3vw;\n --TexteIphone : `+ this._CSS.FontSize.TexteIphone +`;\n\n --CoreX-Max-font-size : 18px;\n --TexteMax : `+ this._CSS.FontSize.TexteMax +`;\n\n --CoreX-Titrefont-size : 4vw;\n --TitreNormale : `+ this._CSS.FontSize.TitreNormale +`;\n\n --CoreX-TitreIphone-font-size : 7vw;\n --TitreIphone : `+ this._CSS.FontSize.TitreIphone +`;\n \n --CoreX-TitreMax-font-size : 50px;\n --TitreMax : `+ this._CSS.FontSize.TitreMax +`;\n }\n body{\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none; \n -webkit-user-select: none; \n -khtml-user-select: none; \n -moz-user-select: none; \n -ms-user-select: none; \n user-select: none; \n cursor: default;\n font-family: 'Myriad Set Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n font-synthesis: none;\n letter-spacing: normal;\n text-rendering: optimizelegibility;\n width: 100%;\n height: 100%;\n }\n .CoreXAppContent{\n padding: 1px;\n margin: 20px auto 10px auto;\n width: `+ this._CSS.AppContent.WidthNormale +`;\n margin-left: auto;\n margin-right: auto;\n }\n @media only screen and (min-device-width: 375px) and (max-device-width: 667px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait),\n only screen and (min-device-width: 414px) and (max-device-width: 736px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: portrait),\n screen and (max-width: 700px)\n {\n .CoreXAppContent{width: `+ this._CSS.AppContent.WidthIphone +`;}\n }\n @media screen and (min-width: 1200px)\n {\n .CoreXAppContent{width: `+ this._CSS.AppContent.WidthMax +`;}\n }\n </style>` \n\n let SocketIO = \"\"\n if (this._Usesocketio) { SocketIO = `<script src=\"/socket.io/socket.io.js\"></script>`}\n \n let HTML1 = `<script>`\n let CoreXLoaderJsScript = fs.readFileSync(__dirname + \"/Client_CoreX_Loader.js\", 'utf8')\n let CoreXLoginJsScript = fs.readFileSync(__dirname + \"/Client_CoreX_Login.js\", 'utf8')\n \n let GlobalCallApiPromise = `\n let TokenApp = localStorage.getItem(\"CoreXApp\")\n if(TokenApp == null){\n TokenApp =\"App\"\n localStorage.setItem(\"CoreXApp\", \"App\")\n }\n let apiurl = \"api\"\n function GlobalCallApiPromise(FctName, FctData, UploadProgress, DownloadProgress){\n return new Promise((resolve, reject)=>{\n var xhttp = new XMLHttpRequest()\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n let reponse = JSON.parse(this.responseText)\n if (reponse.Error) {\n console.log('GlobalCallApiPromise Error : ' + reponse.ErrorMsg)\n reject(reponse.ErrorMsg)\n } else {\n resolve(reponse.Data) \n }\n } else if (this.readyState == 4 && this.status != 200){\n reject(this.response)\n }\n }\n xhttp.onprogress = function (event) {\n if(DownloadProgress){DownloadProgress(event)}\n //console.log(\"Download => Loaded: \" + event.loaded + \" Total: \" +event.total)\n }\n xhttp.upload.onprogress= function (event){\n if(UploadProgress){UploadProgress(event)}\n //console.log(\"Upload => Loaded: \" + event.loaded + \" Total: \" + event.total)\n }\n xhttp.open(\"POST\", apiurl , true)\n xhttp.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\")\n xhttp.send(JSON.stringify({Token:MyCoreXLoader.GetTokenLogin(), FctName:FctName, FctData:FctData}))\n })\n }`\n \n let HTML2 = `</script>`\n \n let MySplashScreen = null\n if (this._SplashScreen != null){\n MySplashScreen = `'` + this._SplashScreen + `'`\n }\n let MySplashScreenBackgroundColor = null\n if (this._SplashScreenBackgroundColor != null){\n MySplashScreenBackgroundColor = `'` + this._SplashScreenBackgroundColor + `'`\n }\n let LoadScript = ` \n <script>\n let OptionCoreXLoader = {Color: \"`+ this._CSS.Color.Normale +`\", AppIsSecured: \"`+ AppIsSecured +`\", AllowSignUp:`+ this._AllowSignUp +`, SplashScreen: `+ MySplashScreen +`, SplashScreenBackgroundColor: `+ MySplashScreenBackgroundColor +`}\n var MyCoreXLoader = new CoreXLoader(OptionCoreXLoader)\n function GlobalLogout(){MyCoreXLoader.LogOut()}\n function GlobalGetToken(){return MyCoreXLoader.GetTokenLogin()}\n onload = function() {\n MyCoreXLoader.Site = TokenApp\n MyCoreXLoader.Start()\n }\n </script>`\n\n let HTMLEnd = ` \n </head>\n <body>\n </body>\n</html>`\n return HTMLStart + SocketIO + HTML1 + CoreXLoaderJsScript + os.EOL + CoreXLoginJsScript + os.EOL + GlobalCallApiPromise + os.EOL + HTML2 + LoadScript + HTMLEnd\n }", "function create_MPLI_page()\n{\n empty_content('content');\n\n const MPLI_project_page = document.createElement('div');\n MPLI_project_page.setAttribute('id','MPLI_project_page');\n\n MPLI_project_page.innerHTML = create_page_title(\"MPLI aujourd'hui\") +\n `\n <div class=\"boxTopRed\">\n <i>Merci pour l'invit'</i> est le premier \n réseau d'hébergement citoyen permettant la réinsertion de femmes en difficulté.\n <br><br>\n L’hébergeur solidaire s’engage à accueillir sur une période pouvant aller de 2 \n semaines à 9 mois. Il est accompagné tout au long de sa démarche par <i>Merci pour l'invit'</i> \n (mise en contact, présence lors de la première rencontre, Charte de \n cohabitation, formation à l’accueil, médiation...).\n <br><br>\n Les femmes en difficulté nous sont adressées par des associations partenaires, \n qui garantissent la relation de confiance entre l’hébergé et l’hébergeur et \n l’inscription dans un parcours de réinsertion.\n <br><br>\n <i>Merci pour l'invit'</i> assure durant la durée de l’hébergement un accompagnement \n social permettant d’inscrire l’accueilli dans un parcours de réinsertion.\n <br><br>\n </div>\n <span class=\"emphasize\"> L'hébergement solidaire se déroule donc en 6 étapes : </span>\n <img id=\"etapes_hebergement\" src=\"Images/etapes_hebergement.png\"></img>\n <div class=\"boxTopRed\">\n <img id=\"key_passing\" src=\"Images/key_passing.png\" align=\"right\"></img>\n Pour devenir hébergeur solidaire, il vous suffit de remplir de clicker sur le \n button ci-dessous:\n <br>\n <button onclick=\"create_form_page()\"> Offrir un hebergement </button>\n <br> <br>\n <i> Merci pour l’invit’ </i> en action :\n <br><br>\n A titre d'exemple, une jeune femme est hébergée depuis maintenant \n 6 mois chez une hébergeuse solidaire. Malgré son emploi en intérim, \n elle s’est retrouvée à la rue et a été orientée vers nous par une \n association via cette page.\n <br><br>\n Aujourd’hui, elle a pu refaire son CV grâce à l’association qui \n l’accompagne, elle a obtenu un CDD qui va bientôt devenir un CDI.\n <br><br>\n Au-delà de l’hébergement, c’est aussi un lien social durable et \n des mises en réseaux qui sont permises par l’hébergement l’habitant.\n </div>\n `;\n\n const content = document.querySelector('#content');\n content.appendChild(MPLI_project_page);\n}", "function pagehtml(){\treturn pageholder();}", "function htmlInit() {\n\t// initializes body\n\thtmlBody = document.body;\n\n\t// initializes table\n\ttable44 = document.createElement('table');\n\n\t// initializes header row\n\tvar thRow = document.createElement('tr');\n\t// uses iteration to assign 4 header row elements\n\tfor (var i=1; i<5; i++) {\n\t\tthRow.appendChild(createHeaderCell('Header '+ i))\n\t}\n\t// appends created header row to table\n\ttable44.appendChild(thRow);\n\n\t// uses iteration to assign the next 3 non-header rows of 4 elements\n\tfor (var i=1; i<4; i++) {\n\t\tvar tdRow = document.createElement('tr');\n\t\tfor (var j=1; j<5; j++) {\n\t\t\ttdRow.appendChild(createNonHeaderCell(j+','+i));\n\t\t}\n\t\ttable44.appendChild(tdRow);\n\t}\n\n\t// appends finished table44 to body && adds a view lines before buttons\n\thtmlBody.appendChild(table44);\n\thtmlBody.appendChild(document.createElement('br'));\n\n\t// creates all of the buttons\n\tupButton = createButton('Up');\n\tdownButton = createButton('Down');\n\tleftButton = createButton('Left');\n\trightButton = createButton('Right');\n\tmarkButton = createButton('Mark Cells');\n\n\t// creates a row of the directional buttons\n\thtmlBody.appendChild(upButton);\n\thtmlBody.appendChild(downButton);\n\thtmlBody.appendChild(leftButton);\n\thtmlBody.appendChild(rightButton);\n\n\t// adds a line after the directional buttons\n\thtmlBody.appendChild(document.createElement('br'));\n\n\t// creates a row with just the Mark Cells button\n\thtmlBody.appendChild(markButton);\n}", "function writeHtml() {\n fs.writeFile('team.html', Html.createHtml(team), function (err) {\n if (err) return console.log(err);\n });\n}", "function genFinalHtml() {\r\n ` </div> \r\n\r\n </body>\r\n </html`;\r\n}", "function readHtmls(request, response) {\r\n\tvar pathName = url.parse(request.url).pathname;\r\n\r\n\t// get the suffix of files\r\n var suffix = pathName.match(/(\\.[^.]+|)$/)[0];\r\n\r\n // read html(with userName or not), css and js\r\n switch(suffix) {\r\n \tcase\".css\":\r\n \tcase\".js\":\r\n\t \treadCss(request, response, suffix);\r\n \t\tbreak;\r\n\r\n \tdefault:\r\n \t readIsExist(request,response);\r\n }\r\n}", "function generateHTML() {\n\n \n fs.writeFile(outputPath, render(members), \"UTF-8\", (err) => {\n \n\n \n if (err) throw err;\n \n });\n \n console.log(members);\n\n }", "function render(html) {\n $(\"main\").html(html);\n \n // this is the general render function that will be at the end of all above functions\n}", "function getPicsPage(pic1, pic2, pic3, pic4, pic5, pic6, pic7, pic8) {\r\n\r\nvar text= \"Which picture comes before the other chronologically? (Type 'Left' or 'Right')\"\r\n\r\n// TO-DO: Expand on our HTML design. Do you think a different design could better?\r\n// Provide evidence.\r\nvar webpage = createWebpageFromTemplate(<div>\r\n <img src={pic1} width=\"45%\" alt=\"Image 1\"></img>\r\n <img src={pic2} width=\"45%\" alt=\"Image 2\"></img>\r\n <br></br>\r\n <img src={pic3} width=\"45%\" alt=\"Image 3\"></img>\r\n <img src={pic4} width=\"45%\" alt=\"Image 2\"></img>\r\n\r\n\r\n <ul>\r\n <li>People will vote whether to approve your work.</li>\r\n </ul>\r\n <textarea style=\"width:500px;height:50px\" name=\"newText\">{text}</textarea>\r\n <input type=\"submit\" value=\"Submit\"></input>\r\n </div>);\r\n\r\n\treturn webpage;\r\n}", "function ibdof_tweaks() {\r\n \r\n // tweak the formatting for the forum listing on Index.php\r\n if (/index/i.test(window.location.pathname))\r\n formatIndexPage();\r\n \r\n // set a class-name for the genre description cell\r\n if (/IBDOF-genrelist/i.test(window.location.pathname)) {\r\n dev = document.evaluate(\r\n \"//table[2]/tbody/tr/td[3]\", \r\n document, \r\n null, \r\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n \r\n for (i = 0; i < dev.snapshotLength; i++)\r\n dev.snapshotItem(i).className += ' genre';\r\n }\r\n\r\n // alphabetic letter links in author/series table header - remove the font color override from the html code\r\n if (/IBDOF-authorlist|IBDOF-serieslist/i.test(window.location.pathname)) {\r\n dev = document.evaluate(\r\n \"//table[2]/tbody/tr[1]/th//font\", \r\n document, \r\n null, \r\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n \r\n for (i = 0; i < dev.snapshotLength; i++)\r\n dev.snapshotItem(i).color = '';\r\n }\r\n}", "function create_main_page()\n{\n empty_content('content');\n\n const content = document.querySelector('#content');\n content.innerHTML = \n `\n <img id=\"project_MPLI\" src=\"Images/project_MPLI.png\"></img>\n <p>\n <i>Merci pour l'invit'</i> est le <b>premier réseau d'hébergement</b> \n citoyen permettant la réinsertion de femmes en difficulté.\n <br> <br>\n Le sans abrisme féminin est peu connu, pourtant sur les <b>200 000 \n personnes</b> sans domicile fixe en France (Estimation de la FNARS en 2017), \n <b>40% sont des femmes.</b>\n <br> <br>\n Pour venir en aide à ces femmes et pallier la saturation actuelle de \n l’hébergement d’urgence, notre solution est simple : <b>héberger chez l’habitant.</b>\n <br> <br>\n De nombreuses études sur le « housing first » l’ont prouvé, la condition n°1 \n vers la réinsertion est la <b>tranquillité</b> permise par un <b>hébergement stable.</b>\n <br> <br>\n </p>\n `;\n}", "function initHtmlPage() {\n // make a string of cards for each employee\n let allTeamMembers = \"\";\n teamArr.forEach(employee => {\n let title = \"\";\n let specialProperty = \"\";\n if (\"github\" in employee) {\n title = \"Engineer\";\n specialProperty = `<a target=\"_blank\" href=\"https://www.github.com/${employee.github}\"> Github: ${employee.github}</a>`\n } else if\n (\"school\" in employee) {\n title = \"Intern\"\n specialProperty = `School Name: ${employee.school}`\n } else if \n (\"officeNumber\" in employee) {\n title = \"Manager\"\n specialProperty = `OfficeNumber: ${employee.officeNumber}`\n }\n\n // create card html card templates\n allTeamMembers += `\n <div class=\"col\">\n <div class=\"card\" style=\"width: 18rem\">\n <div class=\"card-header\">\n <h3>${employee.name}</h3>\n <h4>${title}</h4>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item employeeProperties\"> Employee ID: <span>${employee.id}</span></li>\n <a href=\"mailto:${employee.email}\" class=\"list-group-item employeeProperties\"> Email: <span>${employee.email}</span></a>\n <li class=\"list-group-item employeeProperties\"> <span>${specialProperty}</span></li>\n </ul>\n </div>\n </div>\n `\n })\n return allTeamMembers;\n}", "function buildHTML() {\n //initialize html\n html = \"\";\n\n for(var i=0; i<elements.length; i++) {\n switch(elements[i].type) {\n case 'title':\n buildTitle(elements[i].options);\n break;\n case 'header':\n buildHeader(elements[i].options);\n break;\n case 'img-one':\n buildImageOne(elements[i].options);\n break;\n case 'img-two':\n buildImageTwo(elements[i].options);\n break;\n case 'img-three':\n buildImageThree(elements[i].options);\n break;\n case 'article-right':\n buildArticleRight(elements[i].options);\n break;\n case 'article-left':\n buildArticleLeft(elements[i].options);\n break;\n case 'text' :\n buildText(elements[i].options);\n break;\n \n }\n }\n buildEnd();\n\n document.getElementById('HTML').innerText = `${html}`;\n}", "function updatePage(x) {\n var html = \"\";\n \n switch (x) {\n case 1: //Represents initial stage (starting homepage)\n html = \"<h1>Stage Two</h1>\" + //Stage two html\n \"<h2>One exquisitely ordinary day, \" + name +\n \" was taking a walk, when suddenly, the King appears!</h2>\" + \n \"<h3>\" + name + \" chooses to:</h3><br>\" +\n \"<button id=\\\"correctAnswer\\\">Bow like an obedient pansy</button><button>Ignore him</button><button>Throw tomatoes</button>\"; \n break;\n case 2:\n html = \"This is stage three\";\n break;\n }\n \n return html;\n}", "function buildHTMLPage() {\n\n buildFooter();\n buildNavbar();\n checkRes();\n checkTheme();\n frameshiftNotice();\n //setTimeout(() => noAds(), 5000);\n\n}", "function genStartHtml() {\r\n return `<!DOCTYPE html>\r\n <html lang=\"en\">\r\n <head>\r\n <meta charset=\"UTF-8\">\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\">\r\n \r\n \r\n <title>Team Profile</title>\r\n <link rel=\"stylesheet\" href =\"./profile.css\">\r\n </head>\r\n <body>\r\n <div class=\"head\">\r\n <h1>Team Profile</h1>\r\n </div>\r\n <div class = \"page-box\">`;\r\n}", "function Content(){\n return (\n\n \n <article id=\"article\">\n \n <center>\n <section id=\"section_1\">\n <div> \n <h1>MY DEV PAGE</h1>\n <p>Welcome to my DEV page. I build bots!</p>\n <p>I work with: Javascript, C++ and Python</p>\n <p>Find me on Discord!</p>\n <Image_0/>\n <a href=\"https://www.freecodecamp.org/a_i\">On Codecamp</a>\n \n <a href=\"https://github.com/AIZuerich\">My Github</a>\n \n <a href=\"https://gist.github.com/c1t\">Old Gists</a>\n\n </div>\n </section>\n </center> \n\n <br/>\n <br/>\n <br/>\n <br/>\n <center>\n \n <section id=\"section_3\">\n \n <div id=\"Projekte_\">\n <Projekt_1/>\n \n </div>\n \n </section>\n </center>\n \n <section id=\"foot_notes\">\n <div id=\"footer\">\n <p>Support:</p>\n <p>[email protected]</p> \n </div>\n </section>\n \n \n </article>\n )\n }", "function RDVariableInitialize(){\n /* Get the html file name */\n var path = window.location.pathname;\n pageName = path.split(\"/\").pop();\n\n /* Create artwork array data */\n ArtworkArray = [\n new Artwork(\"media/image/Testing.jpg\", \"待更新\", \n \"標題\", \"內容\", \"https://www.youtube.com/embed/pJ_m5lDftYc\", \"HOMEPAGE:VFX\"),\n new Artwork(\"media/image/Testing.jpg\", \"待更新\", \n \"標題\", \"內容\", \"https://www.youtube.com/embed/pJ_m5lDftYc\", \"VFX\"),\n ];\n\n /* Create profile array data */\n ProfileArray = [\n new Profile(\"media/image/profile.png\", \"奇昌\", \"平面網頁工程師\"),\n new Profile(\"media/image/profile.png\", \"君昊\", \"特效合成師\"),\n new Profile(\"media/image/profile.png\", \"文杰\", \"建模與材質設計師\"),\n new Profile(\"media/image/profile.png\", \"昱安\", \"後端工程與遊戲工程師\"),\n new Profile(\"media/image/profile.png\", \"宥宇\", \"建模師\"),\n new Profile(\"media/image/profile.png\", \"冠宇\", \"角色設計師\"),\n new Profile(\"media/image/profile.png\", \"沅叡\", \"待更新\")\n ];\n\n /* Create patterm that use for index webpage animation */\n IndexArtworkPatterm = [\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:4:4\", \"fade-up:fade-up:fade-up\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"12\", \"fade-up\")\n ];\n\n /* Create patterm that use for work webpage animation */\n WorkArtworkPatterm = [\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:4:4\", \"fade-up:fade-up:fade-up\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"12\", \"fade-up\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:4:4\", \"fade-up:fade-up:fade-up\")\n ];\n\n /* Create carousel data set for about */\n MyAboutCarousel = [\n new AboutCarousel(\"media/image/TitleImage.jpg\", \"Test1\", \"Test Text\"),\n new AboutCarousel(\"media/image/TitleImage.jpg\", \"Test2\", \"Test Text\"),\n new AboutCarousel(\"media/image/TitleImage.jpg\", \"Test3\", \"Test Text\")\n ];\n\n /* Specifie the top title image or video path and type */\n IndexHomePageFilePath = \"media/video/HomeTitle.mp4\";\n AboutPageFilePath = \"media/image/TitleImage.jpg\";\n\n /* The title backgound color */\n IndexHomePageBackground = \"#000000\";\n AboutPageBackground = \"#000000\";\n\n $(\"#RDTitle\").text(\"Result\");\n $(\"#RDDescription\").html(\"我們結合了跨領域的人才 <br > 負責的項目從遊戲、 動畫, 到特效、後製合成製作\");\n $(\"#Introducing\").find('h4').html(\"Result Design 是因興趣而聚集起來創作的工作室.\");\n}", "function buckyHTML() {\n\t// Set element ID.\n\tvar id = \"bucky-html\";\n\n\t// Create an array-like object for titles.\n\tvar links = {\n\t\t\"12: Making Everything Pretty\": \"https://www.youtube.com/watch?v=yNtIO4X6cag&index=12&list=PL081AC329706B2953&ab_channel=thenewboston\",\n\t\t\"13: Finishing The Layout\": \"https://www.youtube.com/watch?v=tzAEGnBNAn0&index=13&list=PL081AC329706B2953&ab_channel=thenewboston\",\n\t\t\"14: Flexible Box Model\": \"https://www.youtube.com/watch?v=xgYmccJ61eA&list=PL081AC329706B2953&index=14&frags=wn&ab_channel=thenewboston\",\n\t\t\"15: Styling the Header and Navigation\": \"https://www.youtube.com/watch?v=bi7ccKky8JU&list=PL081AC329706B2953&index=15&frags=wn&ab_channel=thenewboston\"\n\t};\n\n\t// Call dropdownList with titles.\n\tgenerateListItems(id, links);\n}", "function main() {\n\t\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\t\tmsg = htmlModule.msg; // Logging\n\t\t\tmsg.set(\"Starting Module\");\n\n\t\t\t// Setup Form.\n\t\t\ttempForm();\n\t\t}", "async function main() {\n try {\n await prompt()\n // for i to teamArray.length => \n\n for (let i = 0; i < teamArray.length; i++) {\n //template literal=``\n teamstr = teamstr + html.generateCard(teamArray[i]);\n }\n\n let finalHTML = html.generateHTML(teamstr)\n\n console.log(teamstr)\n\n //call generate function to generate the html template literal\n\n //write file \n writeFileAsync(\"./output/index.html\", finalHTML)\n\n\n } catch (err) {\n return console.log(err);\n }\n}", "function generateHtml(toBeCreated) {\n //console.log('generateHtml function ran'); \n if (currentPage === 'startPage') {\n return startPage();\n } else if (currentPage === 'questionPage') {\n return questionPage();\n } else if (currentPage === 'resultsPage') {\n return resultsPage();\n } else if (currentPage === 'feedbackPage') { \n return feedbackPage();\n }\n}", "function preview_page(e1,e2) {\r\n var caret = get_caret(e1);\r\n var edits = document.getElementById(e1);\r\n var preview = document.getElementById(e2);\r\n preview.innerHTML = edits.value;\r\n /* manage URLS */\r\n preview.innerHTML = preview.innerHTML.replace(/\\[url\\](.+?)\\[\\/url]/gi,'<a href=\"$1\">$1</a>');\r\n preview.innerHTML = preview.innerHTML.replace(/\\[url\\=([^\\]]+)](.+?)\\[\\/url]/gi,'<a href=\"$1\">$2</a>');\r\n /* manage images */\r\n preview.innerHTML = preview.innerHTML.replace(/\\[img](.+?)\\[\\/img]/gi, '<img src=$1 />'); /* TODO: img h,w limit */\r\n /* manage font sizes -- TODO editor button */\r\n preview.innerHTML = preview.innerHTML.replace(/\\[size=([1-9][0-9]+?)](.+?)\\[\\/size]/gi,'<span style=\"font-size: $1\">$2</span>');\r\n /* manage strong tags */\r\n preview.innerHTML = preview.innerHTML.replace(/\\[b\\](.+?)\\[\\/b]/gi,'<strong>$1</strong>');\r\n /* manage emphasize tags */\r\n preview.innerHTML = preview.innerHTML.replace(/\\[i\\](.+?)\\[\\/i]/gi,'<i>$1</i>');\r\n /* manage code blocks -- see jsed.css */\r\n preview.innerHTML = preview.innerHTML.replace(/\\[code\\](.+?)\\[\\/code]/gi,'<div class=\"code\"><code>$1</code></div>');\r\n /* manage quote blocks -- see jsed.css */\r\n preview.innerHTML = preview.innerHTML.replace( /\\[quote\\](.+?)\\[\\/quote]/gi, '<div class=\"quote\">$1</div>');\r\n /* table stuff -- I'm still thinking about this */\r\n /* preview.innerHTML = preview.innerHTML.replace( /\\[table\\](.+?)\\[\\/table]/gi, '<table>$1</table>' );\r\n preview.innerHTML = preview.innerHTML.replace( /\\[tr\\](.+?)\\[\\/tr]/gi, '<tr>$1</tr>' );\r\n preview.innerHTML = preview.innerHTML.replace( /\\[td\\](.+?)\\[\\/td]/gi, '<td>$1</td>' ); */\r\n /* list stuff */\r\n preview.innerHTML = preview.innerHTML.replace(/\\[ol\\]/gi,'<ol>');\r\n preview.innerHTML = preview.innerHTML.replace(/\\[ul\\]/gi,'<ul>');\r\n preview.innerHTML = preview.innerHTML.replace(/\\[\\/ol]/gi,'</ol>');\r\n preview.innerHTML = preview.innerHTML.replace(/\\[\\/ul]/gi,'</ul>');\r\n preview.innerHTML = preview.innerHTML.replace(/\\[\\*\\]/gi,'<li>');\r\n /* convert linebreaks */\r\n preview.innerHTML = preview.innerHTML.replace( /(?:\\r\\n|\\n|\\r)/g, '<br />' );\r\n set_caret(edits,caret);\r\n}", "renderHTML() {\n fs.readFile('template/main.html', 'utf8', (err, htmlString) => {\n \n htmlString = htmlString.split(\"<script></script>\").join(this.getScript());\n\n fs.writeFile('output/index.html', htmlString, (err) => {\n // throws an error, you could also catch it here\n if (err) throw err;\n // success case, the file was saved\n \n });\n \n });\n\n }", "function webPageElements() { \n \t pageElements.input = document.getElementById('input');\n \t pageElements.output = document.getElementById('output');\n \t pageElements.linksCount = document.getElementById('linksCount');\n \t pageElements.alertText = document.getElementById('alertText');\n \t pageElements.authorSelect = document.getElementById('authorSelect');\n \t pageElements.tagSelect = document.getElementById('tagSelect');\n \t pageElements.saveBtn = document.getElementById('saveBtn');\n \t pageElements.addBtn = document.getElementById('addBtn');\n \t pageElements.getAllBtn = document.getElementById('getAllBtn');\n \t pageElements.deleteBtn = document.getElementById('deleteBtn');\n\n \t assignEventListeners() \n }", "function createHTML(data, appdataFolder) {\n\t// find out what we should do with something (just an example)\n\task(\"Enter something we can use\", /.+/, function(something) {\n\t\tvar html = \"<html><head><title>Title</title></head><body><h1>Click the link!</h1>\";\n\n\t\t// more html goes here\n\t\t// parse the data\n\n\t\thtml += \"</body></html>\";\n\n\t\t// write the file\n\t var tempFile = \"temp.html\";\n\t\tfs.writeFile(appdataFolder + tempFile, html, function(error) {\n\t if(error) {\n\t console.log(error);\n\t quit();\n\t } \n\n\t // wrote successfully\n\t else {\n\t launchInChrome(appdataFolder + tempFile);\n\t\t\t}\n\t\t});\n\t});\n}", "function metaCreationAndTitle(){\n document.getElementsByTagName(\"HEAD\")[0].innerHTML =\n `\n <title> To Do List </title>\n <meta charset=\"ut-8\">\n <link rel=\"stylesheet\" href=\"style.css\">\n `;\n}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "function printHTML() {\n const html = render(employeeArr);\n fs.writeFile(outputPath, html, (err) => {\n if (err) throw err;\n console.log(\"HTML successfully generated and saved to ./output.\");\n return;\n });\n}", "function makeTeamHTML(emplyArr) {\n fs.writeFile(outputPath, render(emplyArr), function(err) {\n err?console.log(err):console.log(\"Team html rendered. Have a look!\");\n })\n}", "function html(data) {\n if (data.type == \"heading\") {\n $(\"div\")\n .add(\"<h1>\" + data.model.text + \"</h1>\")\n .appendTo(document.getElementById(\"one\"));\n } else if (data.type == \"paragraph\") {\n $(\"div\")\n .add(\"<p>\" + data.model.text + \"</p>\")\n .appendTo(document.getElementById(\"one\"));\n } else if (data.type == \"image\") {\n $(\"div\")\n .add(\n \"<img src=\" +\n data.model.url +\n \" alt=\" +\n data.model.altText +\n \" height=\" +\n data.model.height +\n \" width=\" +\n data.model.width +\n \"/>\"\n )\n .appendTo(document.getElementById(\"one\"));\n } else if (data.type == \"list\") {\n if (data.model.type == \"unordered\") {\n $(\"div\")\n .add(\"<ul>\")\n .appendTo(document.getElementById(\"one\"));\n $.each(data.model.items, function(i, dat) {\n $(\"div\")\n .add(\"<li>\" + dat + \"</li>\")\n .appendTo(document.getElementById(\"one\"));\n });\n $(\"div\")\n .add(\"</ul>\")\n .appendTo(document.getElementById(\"one\"));\n } else {\n //works if the json file contains ordered lists\n $(\"div\")\n .add(\"<ol>\")\n .appendTo(document.getElementById(\"one\"));\n $.each(data.model.items, function(i, dat) {\n $(\"div\")\n .add(\"<li>\" + dat + \"</li>\")\n .appendTo(document.getElementById(\"one\"));\n });\n $(\"div\")\n .add(\"</ol>\")\n .appendTo(document.getElementById(\"one\"));\n }\n }\n}", "function init_html(){\n\t\t// create [R] buttons next to usernames\n\t\tvar button = $(\"<a class='user-review-button tb-bracket-button' href='#' title='Review post history' style='margin-left:3px'>R</a>\");\n\t\tif (button.is(\"div\")) button = $(button.get(1)); // fix for a weird bug where <a> gets wrapped in a <div>\n\t\t\n\t\t$(\".tagline .author\").each(function(){\n\t\t\tvar user = $(this).text().trim();\n\t\t\tif (!user || user == \"[deleted]\") return;\n\t\t\tvar b = button.clone();\n\t\t\t$(this).parent().find(\".userattrs\").after(b);\n\t\t});\n\t}", "function viewHtml() {\n var entry = ProjectManager.getSelectedItem();\n if (entry === undefined) {\n entry = DocumentManager.getCurrentDocument().file;\n }\n var path = entry.fullPath;\n var w = window.open(path);\n w.focus();\n }", "function domHelp() {\n\n // high-level helpers for HTML-DOM\n function para(args) {\n var p;\n \n p = node(\"p\");\n p.className = args.className||\"\";\n p.innerHTML = args.text||\"\";\n\n return p; \n }\n\n function option(args) {\n var opt;\n\n opt = node(\"option\");\n opt.text = args.text||\"item\";\n opt.value = args.value||\"\";\n opt.className = args.className||\"\";\n\n return opt;\n }\n \n function input(args) {\n var p, lbl, inp;\n\n p = node(\"p\");\n lbl = node(\"label\");\n inp = node(\"input\");\n lbl.className = \"data\";\n lbl.innerHTML = args.prompt||\"\";\n inp.name = args.name||\"\";\n inp.className = \"value\";\n inp.value = args.value.toString()||\"\";\n inp.required = (args.required||false);\n inp.readOnly = (args.readOnly||false);\n push(lbl,p);\n push(inp,p);\n \n return p;\n }\n \n function data(args) {\n var p, s1, s2;\n\n p = node(\"p\");\n p.className = args.className||\"\";\n s1 = node('span');\n s1.className = \"prompt\";\n s1.innerHTML = args.text||\"\";;\n s2 = node(\"span\");\n s2.className = \"value\";\n s2.innerHTML = args.value||\"\";\n push(s1,p);\n push(s2,p);\n\n return p;\n }\n \n function anchor(args) {\n var a;\n\n a = node(\"a\");\n a.rel = args.rel||\"\";\n a.href = args.href||\"\";\n a.className = args.className||\"\";\n a.title = args.text||\"link\";\n a.type = args.type||\"\";\n push(text(args.text||\"link\"), a);\n\n return a;\n }\n \n function image(args) {\n var img;\n\n img = node(\"img\")\n img.src = args.href||\"\";\n img.className = args.rel||\"\";\n img.title = args.title||\"\";\n\n return img;\n }\n \n function link(args) {\n var lnk; \n\n lnk = node(\"link\");\n lnk.rel = args.rel||\"\";\n lnk.href = args.href||\"\";\n lnk.title = args.title||\"\";\n lnk.className = args.className||\"\";\n\n return lnk;\n }\n \n // low-level helpers for DOM\n function push(source,target) {\n target.appendChild(source);\n }\n\n function tags(tag,elm) {\n var rtn;\n \n if(elm) {\n rtn = elm.getElementsByTagName(tag);\n }\n else {\n rtn = document.getElementsByTagName(tag);\n }\n return rtn;\n }\n\n function find(id) {\n return document.getElementById(id);\n }\n\n function text(txt) {\n return document.createTextNode(txt);\n }\n\n function node(type) {\n return document.createElement(type);\n }\n\n function clear(elm) {\n while (elm.firstChild) {\n elm.removeChild(elm.firstChild);\n }\n }\n\n // publish functions\n that = {};\n that.push = push;\n that.tags = tags;\n that.find = find;\n that.text = text;\n that.node = node;\n that.clear = clear;\n that.link = link;\n that.image = image;\n that.anchor = anchor;\n that.data = data; \n that.input = input;\n that.para = para;\n that.option = option;\n \n return that;\n}", "function displayHTML(){\n\t\tdom.name.innerHTML = \"1. Name: \"+studentArray[position].name;\n\t\tdom.address.innerHTML = \"2. Address: \"+studentArray[position].street+\n\t\t\", \"+studentArray[position].city+\n\t\t\", \"+studentArray[position].state;\n\t\tdom.grades.innerHTML = \"3. Grades: \"+studentArray[position].grades;\n\t\tdom.date.innerHTML = \"4. Date: \"+studentArray[position].getDate();\n\t\tdom.gpaAvg.innerHTML = \"5. Average GPA: \"+studentArray[position].getAverage(studentArray[position].grades).toFixed(2);\n\t}//close displayHTML function", "function info_html(alist){\n\n var output = '';\n// output = output + '<div class=\"block\">';\n// output = output + '<h2>Intersection Information</h2>';\n output = output + group_info_html(alist); \n output = output + term_info_html(alist); \n output = output + gp_info_html(alist);\n// output = output + '</div>';\n return output;\n}", "async buildHTML() {\n const readFileAsync = util.promisify(fs.readFile);\n const writeFileAsync = util.promisify(fs.writeFile);\n try{\n let mainHTML = await readFileAsync(\"./templates/main.html\", \"utf8\");\n const managerHTML = await this.employees[0].getHTML();\n const engineerHTMLarr = [];\n const internHTMLarr = [];\n for(const employee of this.employees) {\n let role = employee.getRole();\n let html = \"\";\n if(role === \"Engineer\") {\n html = await employee.getHTML();\n engineerHTMLarr.push(html);\n }\n else if(role === \"Intern\") {\n html = await employee.getHTML();\n internHTMLarr.push(html);\n }\n } \n \n const engineerHTML = engineerHTMLarr.join(\"\\n\");\n const internHTML = internHTMLarr.join(\"\\n\");\n mainHTML = mainHTML.replace(/%manager%/, managerHTML);\n mainHTML = mainHTML.replace(/%engineers%/, engineerHTML);\n mainHTML = mainHTML.replace(/%interns%/, internHTML);\n \n await writeFileAsync(\"./output/team.html\", mainHTML);\n }\n catch(err) {\n console.log(err);\n }\n console.log(\"File written! Goodbye!\");\n process.exit(0);\n }", "render(){return html``}", "function buckyTutorials() {\n\tbuckyHTML();\n\tbuckyAngularJS();\n}", "function getHTMLForFile(fileObj, ignorePrivate) {\n \n var txt = \"\";\n \n txt += \"<a name=\\\"\" + fileObj.shortName + \"\\\"></a><article>\" + le;\n txt += \"<p class=\\\"path\\\">\" + fileObj.path + \"</p>\" + le;\n// txt += \"<p>\" + toHTML(fileObj.desc) + \"</p>\" + le;\n \n var i;\n for (i = 0; i < fileObj.entries.length; i++) {\n \n var entry = fileObj.entries[i];\n \n if (entry.code === null) {\n console.log(\"Ignoring entry for unknown context\", entry);\n totalUnprocessed++;\n continue;\n }\n else if (entry.code.type == \"comment\") {\n console.log(\"Ignoring entry for comment\", entry);\n totalUnprocessed++;\n continue;\n }\n else if (ignorePrivate && entry.comment.access == \"private\") {\n continue; \n }\n else {\n \n var printName = entry.code.string;\n \n if (entry.code.type == \"module\") {\n txt += \"<h1>\" + fileObj.shortName + \" module</h1>\" + le;\n // txt += \"<pre><code><h2>\" + printName + \"</h2></code></pre>\"; \n } \n else {\n if (entry.comment.isClass) {\n printName = entry.code.name + \" Class\";\n entry.comment.returns = entry.code.name;\n }\n \n txt += \"<pre><code><h2>\" + printName + \"</h2></code></pre>\";\n txt += \"<p><strong>type/returns: </strong><code>\" + toHTML(entry.comment.returns) + \"</code></p>\" + le;\n txt += \"<p><strong>access: </strong><code>\" + entry.comment.access + \"</code></p>\" + le; \n }\n \n txt += \"<p>\" + toHTML(entry.comment.body) + \"</p>\" + le;\n txt += \"<hr>\" + le; \n \n } \n }\n \n txt += \"</article>\" + le;\n txt += \"<hr>\" + le;\n txt += \"<hr>\" + le;\n \n return txt;\n \n }", "function createHTML (data, startsWith) {\n let html;\n if (data.length) {\n html = fs.readFileSync('./templates/template.html');\n data.forEach(element => {\n const description = (element.description && element.description.length > 5) ? `<audio controls=\"controls\"><source src=\"./mp3/${startsWith}/${(element.name).replace('/', ' ')}.mp3\" type=\"audio/mpeg\"></audio>` : 'none';\n html += `<td>${element.id}</td><td>${element.name}</td><td>${description}</td><td><a href=\"${element.wiki}\">${element.name} wiki</a></td><td><a href=\"${element.comics}\">${element.name} comics</a></td></tr>`;\n });\n html += '</table></body></html>';\n } else {\n html = fs.readFileSync('./templates/blank.html');\n html += `<td>Hero starts with ${startsWith} wasn't found</td>`;\n html += '</table></body></html>';\n }\n fs.writeFileSync(`./result/${startsWith}-Marvel_Heroes.html`, html);\n console.log(`./result/${startsWith}-Marvel_Heroes.html succesfully created.`);\n}", "function generateHTML(data) {\n const section = document.createElement('section');\n peopleList.appendChild(section);\n // Check if request returns a 'standard' page from Wiki\n if (data.type === 'standard') {\n section.innerHTML = `\n <img src=${data.thumbnail.source}>\n <h2>${data.title}</h2>\n <p>${data.description}</p>\n <p>${data.extract}</p>\n `;\n } else {\n section.innerHTML = `\n <img src=\"img/profile.jpg\" alt=\"ocean clouds seen from space\">\n <h2>${data.title}</h2>\n <p>Results unavailable for ${data.title}</p>\n ${data.extract_html}\n `;\n }\n}", "function generateHtml() {\n const folder = fs.readdirSync(`${__dirname}/projects`);\n let myHtml = \" \";\n folder.forEach((arg) => {\n myHtml += `<p><a href=\"/${arg}/\">${arg}</a></p>`;\n });\n return myHtml;\n}", "function display_default() {\n\n // YOUR CODE GOES HERE\n let random_num = Math.floor(Math.random() * 2);\n // console.log(random_num);\n\n let gender_list = stars_dataset[random_num];\n // console.log(gender_list);\n\n gender_list = Object.entries(gender_list);\n let count = 0;\n\n for(person of gender_list){\n console.log(person);\n let new_website_link = person[1][2];\n // console.log(website);\n count++;\n let name = person[0];\n \n let wiki_id = 'wiki' + count;\n // console.log(wiki_id);\n\n // New website link at navbar here\n let node = document.getElementById(wiki_id);\n node.innerText = name;\n // console.log(node.innerText);\n node.setAttribute('href',new_website_link);\n\n // Get image_id\n let image_id = 'image' + count;\n // console.log(person[1][0]);\n // New carousell items here.\n let new_image_link = \"images/\" + person[1][0]; \n document.getElementById(image_id).setAttribute(\"src\", new_image_link); \n\n let heading_id = \"slide_heading\"+count;\n document.getElementById(heading_id).innerText=name\n \n let quote = person[1][1];\n let slide_title = \"slide_title\"+count;\n document.getElementById(slide_title).innerText=quote\n }\n // Look for \"[IMPORTANT]\" inside challenge10.html file.\n // It tells you what elements need to be updated by JavaScript functions.\n\n // [IMPORTANT] Buttons\n //\n // When displaying \"male\" stars:\n // - \"Show Male Stars\" button must be \"disabled\" (the user cannot click on it)\n // - \"Show Female Stars\" button must be activated (the user should be able to click on it)\n //\n // When displaying \"female\" stars:\n // - \"Show Male Stars\" button must be activated (the user should be able to click on it)\n // - \"Show Female Stars\" button must be \"disabled\" (the user cannot click on it)\n}", "function handleHTMLFileInput(_data){\n\t$ = cheerio.load(_data);\n\tfs.removeSync(htmlFile);\n\tif(fs.existsSync('export/index.html')){\n\t\tfs.removeSync('export/index.html');\n\t}\n\tvar newURL = process.argv[2];\n\tif(newURL != undefined){ \n\t\tif(newURL.slice(0,1) ==\"'\" || newURL.slice(0,1) ==='\"'){\n\t\tnewURL = newURL.slice(1,newURL.length-1);\n\t\t}\n\t} else {\n\t\tconsole.log(\"You must enter a URL after the file location! ex. node script.js www.google.com\");\n\t\tprocess.exit();\n\t}\n\n\tvar bodyContent;\n\tvar mraid = false;\n\tvar scriptExists = false;\n\t//===== Checks to see if script exists on page ======\n\t// ===== if script doesn't exist then prints script =====\n\t// ===== loops through array and removes all matching script tags ===\n\t\t//checkScript(['ebloader.js']);\n\t\tcheckStructure();\n\t\t// insertContent();\n\t\t// insertMRAID();\n\t\t// removeOnclick();\n\t\t// render();\n\n\n\t//======= prints script to page =======\n\tfunction checkScript(arr){\n\t\t\n\t\tvar mraidScript = '\\n' + '<script type=\"text/javascript\">' + '\\n' +\n\t\t' (function(){' + '\\n' +\n\t\t' var wrapper = document.getElementById(\"wrapper\"); ' + '\\n' +\n\t\t' var MRAID = window[\"mraid\"];' + '\\n' +\n\t\t' var url=' +\"'\" + encodeURIComponent(process.argv[2]) + \"';\" + '\\n' +\n\t\t' function init(){' + '\\n' +\n\t\t' if (MRAID){' + '\\n' +\n\t\t' MRAID.removeEventListener(\"ready\", init);' + '\\n' +\n\t\t' } else {' + '\\n' +\n\t\t\" window.removeEventListener('load', init);\" + '\\n' +\n\t\t' }' + '\\n' +\n\t\t\" wrapper.addEventListener('click', function(){\" + '\\n' + \n\t\t' if (MRAID && MRAID.open){' + '\\n' +\n\t\t' MRAID.open( url );' + '\\n' +\n\t\t' } else {' + '\\n' +\n\t\t' window.open( url );' + '\\n' +\n\t\t' }' + '\\n' +\n\t\t' },false);' + '\\n' +\n\t\t' }' + '\\n' +\n\t\t' function checkEnvironment(){' + '\\n' +\n\t\t' if (MRAID){' + '\\n' +\n\t\t\" if (MRAID.getState() == 'loading'){\" + '\\n' +\n\t\t' MRAID.addEventListener(\"ready\", init);' + '\\n' +\n\t\t' } else {' + '\\n' +\n\t\t' init();' + '\\n' +\n\t\t' }' + '\\n' +\n\t\t' } else {' + '\\n' +\n\t\t' if(document.readyState === \"complete\"){' + '\\n' +\n\t\t' init()' + '\\n' +\n\t\t' }else{' + '\\n' +\n\t\t\" window.addEventListener('load', init, false);\" + '\\n' +\n\t\t' }' + '\\n' +\n\t\t' }'+ '\\n' +\n\t\t' }' + '\\n' +\n\t\t' checkEnvironment();' + '\\n' +\n\t\t' })()' + '\\n' +\n\t\t'</script>'\n\n\t\t$('script').each(function(elmt){\n\t\t\t//check to see if MRAID code already exists\n\t\t\tif($(this).text().indexOf('var MRAID = window[\"mraid\"]' != -1)){\n\t\t\t\tscriptExists = true;\n\t\t\t}\n\t\t\tvar loopObj = $(this)\n\t\t\t//====== check to see if ebloader is pulled in and remove it ====\n\t\t\tarr.forEach(function(scrpt){\n\t\t\t\tif(fs.existsSync('export/' + scrpt)){\n\t\t\t\t\tfs.removeSync('export/' + scrpt);\n\t\t\t\t}\n\t\t\t\tif(loopObj.attr('src') != undefined){\n\t\t\t\t\t//console.log(loopObj.attr('src'));\n\t\t\t\t\tif(loopObj.attr('src').toLowerCase().indexOf(scrpt) != -1){\n\t\t\t\t\t\t//console.log(loopObj.attr('src'), \"should have been removed\");\n\t\t\t\t\t\tloopObj.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\t\n\t\t})\n\t\tif(scriptExists && doc_root[doc_root.length-1] != 'root'){\n\t\t\tconsole.log(doc_root[0])\n\t\t\tconsole.log('checkscript done');\n\t\t\t$(doc_root[doc_root.length-1]).append(mraidScript);\n\t\t} else {\n\t\t\t$.root().append(mraidScript);\n\t\t}\t\n\t\tinsertContent();\n\t\tinsertMRAID();\n\t\tremoveOnclick();\n\t\trender();\n\t}\n\n\t//Insert MRAID call\n\tfunction insertMRAID(){\n\t\t$('head').replaceWith(\"\");\n\t\t$.root().prepend('<script src=\"mraid.js\"></script>')\n\t}\n\n\t//========== Replaces all nested filepaths to snippet root directory ========\n\tfunction changeFilePaths(arr, str){\n\t\tvar _str = str;\n\t\tarr.forEach(function(path){\n\t\t\tvar replace = path.replace(base, '').split('/')[path.replace(base, '').split('/').length-1];\n\t\t\tvar search = path.replace(base, '').split('/').join('/').slice(1);\n\t\t\t_str = _str.replace(search, replace);\n\t\t})\n\t\treturn _str;\n\t}\n\n\t//check if a body tag exists on the page. If true then grab all the children of that element\n\t//removes all inline onclick attributes\n\n\tfunction removeOnclick(){\n\t\t$('*').each(function(){\n\t\t\t$(this).removeAttr('onclick');\n\t\t})\n\t}\n\n\tfunction checkStructure(){\n\t\tif($('body').length){\n\t\t\tconsole.log(\"body element exists\");\n\t\t\tbodyContent = $('body').children();\n\t\t\tdoc_root.push('body');\n\t\t\tif($('html').length){\n\t\t\t\tdoc_root.push('html');\n\t\t\t\tconsole.log('checkStructure done');\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"there is no body\");\n\t\t\tif($('html').length){\n\t\t\t//if body doesn't exist then search for an html tag\n\t\t\t\tbodyContent = $('html').children('div');\n\t\t\t\t$('html').children('div').remove();\n\t\t\t\tconsole.log('html element exists');\n\n\t\t\t} else if($.root().first('div')){\n\t\t\t\tdoc_root.push('root');\n\t\t\t\tconsole.log(\"there's no html element.\")\n\t\t\t\tbodyContent = $('div').get(0);\n\t\t\t\tbodyContent = $.root().children('div');\n\t\t\t\t$.root().children('div').remove();\n\t\t\t}\n\t\t}\n\t\tcheckScript(badScripts);\n\t}\n\n\t//========= remove body,meta, and title tags=======\n\t//====create wrapper div and place body content inside====\n\n\tfunction insertContent(){\n\t\tvar allContent;\n\t\tif(doc_root[doc_root.length-1] != 'root'){\n\t\t\tallContent = $(doc_root[doc_root.length-1]).children();\n\t\t} else {\n\t\t\tallContent = $.root().append(mraidScript);\n\t\t}\t\n\t\tvar style = $('style');\n\t\tvar styles = $('style').html();\n\t\t//console.log(style.html());\n\t\tvar styling = css.parse(styles);\n\n\t\t\tfor(var i = 0; i< styling.stylesheet.rules.length; i++){\n\t\t\t\tcheckProp(styling.stylesheet.rules[i])\n\t\t\t}\n\n\t\t\t//========= remove global div declarations that access elements above stage ======\n\t\t\tfunction checkProp(obj){\n\t\t\t\tif(obj.type == 'rule'){\n\t\t\t\t\tif(obj.selectors.indexOf('div') > -1){\n\t\t\t\t\t\tfor(var j = 0; j < obj.declarations.length; j++){\n\t\t\t\t\t\t\tif(obj.declarations[j].property == 'position' && obj.declarations[j].value == 'absolute'){\n\t\t\t\t\t\t\t\t obj.selectors.splice(obj.selectors.indexOf('div'),1, '#wrapper div :not(script)');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tstyles = css.stringify(styling);\n\t\t\t//console.log(style);\n\n\n\n\n\t\t$.root().prepend('\\n' + '\\n' + '<div id=\"wrapper\"></div>')\n\t\t$('#wrapper').append('\\n' + '\\t' + bodyContent + '\\n');\n\t\t$('html').replaceWith(allContent);\n\t\t$('body').remove();\n\t\t$('meta').remove();\n\t\t$('title').remove();\n\t\t$('doctype').remove();\n\n\t\t$.root().prepend('\\n' + '<style>' + '\\n' +\n\t\t\t\t' #wrapper {' + '\\n' +\n\t\t\t\t' width: 100%;' + '\\n' +\n\t\t\t\t' height: 100%;' + '\\n' +\n\t\t\t\t' position: relative;' + '\\n' +\n\t\t\t\t' top: 0; left: 0;' + '\\n' +\n\t\t\t\t' z-index: 90;' + '\\n' +\n\t\t\t\t' }' + '\\n' + styles + '\\n' + '</style>');\n\t\tstyle.remove();\n\t\twhile($('head').children().length>0){\n\t\t\tvar headContent = $('head').children().last();\n\t\t\t\t$.root().prepend('\\n' + headContent);\n\t\t\t\t$('head').children().last().remove();\n\t\t}\n\t}\n\n\tfunction render(){\n\t\t//=== convert virtual dom into string=====\n\t\tvar renderedDom = $.html();\n\t\t//==========replace old file paths will flatten paths======\n\t\trenderedDom = changeFilePaths(filePaths, renderedDom);\n\t\t//======= search for doctype and remove========\n\t\tif(renderedDom.toLowerCase().indexOf('<!doctype html>')== -1){\n\t\t\tconsole.log(\"File has been created 'snippet.html'\");\n\t\t\tfs.writeFile('export/snippet.html', renderedDom, function (err) {\n\t\t \t\tif (err) return console.log(err);\n\t\t\t});\n\t\t} else {\n\t\t\trenderedDom = renderedDom.replace(/<!doctype html>/gi,'');\n\t\t\trenderedDom = renderedDom.replace(/<html>/gi,'');\n\t\t\trenderedDom = renderedDom.replace(/<\\/html>/gi,'');\n\t\t\tconsole.log(\"File has been created: 'snippet.html'\");\n\t\t\tfs.writeFile( inputFile.split('/').slice(0, -1).join('/') + '/snippet.html', renderedDom, function (err) {\n\t\t \t\tif (err) return console.log(err);\n\t\t\t});\n\t\t}\n\t}\n}", "function createHTMLLayout(data) {\n createSearch();\n personData = data.results;\n createGallery(data.results,'');\n}", "function construct_html(href, title, describe,tags) {\n url1 = '<article class=\"post tag-sync_sulab post__wrapper\" data-cols=\"4\">' + '<div class=\"post__wrapper_helper post__wrapper_helper--notloaded el__transition post__wrapper_helper--hover\">' + '<div class=\"post__preview el__transition\">' + '<header class=\"post__header\">' + '<h2 class=\"post__title\">' + '<a href='\n\n url2 = ' class=\"post__link post__title_link\"><span>'\n\n url3 = '</span></a></h2></header><p class=\"post__excerpt\"><a href='\n url4 = ' class=\"post__link post__readmore\">'\n\n url5 = '</a></p></div><footer class=\"post__meta\"><ul class=\"post__tags\">'\n url6 = '</ul></footer></div></article>'\n html = url1 + href + url2 + title + url3 + href + url4 + describe + url5\n for(var i=0; i < tags.length; i++) {\n if (tags[i] != 'sync_sulab') { // skip internal sync_sulab tag\n html += construct_tag(tags[i]);\n }\n };\n html += url6;\n return html\n}", "function easterEgg() {\n if (window.eggIndex === undefined) {\n window.eggIndex = 0;\n }\n\n if (window.eggTitles === undefined) {\n window.eggTitles = [\"New New New Tab Page\", \"2new4me Tab Page\", \"#yeya\", \"Page Tab New New\", \"<pre>new NewTabPage();</pre>\", \"Neue Neue Tab Page\", \"Tab Page &Uuml;berneue\", \"New-ish Tab Page\", \"&Uuml;berneue Registerkarte\", \"Not a New Tab Page\", \"<span>(n) A doubly recently developed HTML document designed to start out multiple browsing contexts on the World Wide Web.</span>\", \"N3W N3W 74B P493\", \"&#9731;\", \"n3w n3w 7@b p493\", \"#nntp4lyf\", \"#yolo #sweg\", \"<span>New New Tab Page, now available for Internet Explorer</span>\", \"#b0rnInab4rn\", \"<span>lul pc peasents #consolemasturraic</span>\", \"<span>Smosh isn't funny anymore</span>\", \"#sherlock2016\", \"<span>lol u use an iphone? #iSheep</span>\", \"<span>Don't you have better things to do?</span>\", \"&nbsp;\", \"&nbsp;\", \"&nbsp;\", \"boo\", \"LOL U JUST GOT PRANKD\", \"Hey Scotty\", \"#jesusman\", \"What are you still doing here?\", \"Go play Flappy Bird\"];\n }\n\n if (eggIndex === eggTitles.length) {\n document.querySelector(\"h1\").innerHTML = \"New New Tab Page\";\n } else {\n document.querySelector(\"h1\").innerHTML = eggTitles[eggIndex];\n eggIndex += 1;\n }\n}", "function html() {\n // Gets .html and .nunjucks files in pages\n return gulp.src('src/pages/**/*.+(html|nunjucks)')\n // Renders template with nunjucks\n .pipe(nunjucksRender({\n path: ['src/templates']\n }))\n // output files in src folder\n .pipe(gulp.dest('app'));\n}", "function startHtml() {\n const html = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl\" crossorigin=\"anonymous\">\n <script src=\"https://kit.fontawesome.com/a695a3856f.js\" crossorigin=\"anonymous\"></script>\n <link rel=\"stylesheet\" href=\"/dist/styles.css\">\n <title>Team Profile Generator</title>\n </head>\n <body>\n <nav class=\"navbar navbar-dark mb-5\">\n <span class=\"navbar-brand mb-3 mt-3 h1 w-100 text-center\">My Team</span>\n </nav>\n <div class=\"container\">\n <div class=\"row\">`;\n fs.writeFile('./dist/index.html', html, function (err) {\n if (err) {\n console.log(err);\n }\n });\n console.log('Enter Team Member Information');\n}", "function main() {\n\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\tmsg = htmlModule.msg; // Logging\n\t\tmsg.set(\"Starting Module\");\n\t\thtmlModule.outputToContentDiv(\"Primes by Sieve of Erathosthenes.\");\n\t\t// Setup Form.\n\t\tvar numArray = sieveModule(1000);\n\t\tfor (var i = 0; i < numArray.length; i++) {\n\t\t\tif (numArray[i] == 1) {\n\t\t\t\thtmlModule.outputToContentDiv(\"Prime: \" + i);\n\t\t\t}\n\t\t}\n\n\t}", "function openHTML(response, filename){\n\tcontent = fs.readFileSync(\"./PUBLIC/\" + filename );\n\tresponse.end(content);\n}", "function generate_html_for_programme(j,n,id){\n\n var pid=j[\"pid\"];\n var video = j[\"video\"];\n var title=j[\"title\"];\n if(!title){\n title = j[\"core_title\"];\n }\n var img=j[\"image\"];\n if(!img){\n img=j[\"depiction\"];\n }\n var manifest=j[\"manifest\"];\n var more=j[\"more\"];\n var explanation=j[\"explanation\"];\n var desc=j[\"description\"];\n var classes= j[\"classes\"];\n var is_live = false;\n if(j[\"live\"]==true || j[\"live\"]==\"true\" || j[\"is_live\"]==true || j[\"is_live\"]==\"true\"){\n is_live = true;\n }\n var service = j[\"service\"];\n//@@not sure about this\n var channel = j[\"channel\"];\n if(channel && is_live){\n img = \"channel_images/\"+channel.replace(\" \",\"_\")+\".png\";\n }\n\n\n var html = [];\n html.push(\"<div id=\\\"\"+id+\"\\\" pid=\\\"\"+pid+\"\\\"\");\n html.push(\" is_live=\\\"\"+is_live+\"\\\"\");\n\n if(video){\n html.push(\" href=\\\"\"+video+\"\\\"\");\n }\n if(service){\n html.push(\" service=\\\"\"+service+\"\\\"\");\n }\n if(manifest){\n html.push(\" manifest=\\\"\"+manifest+\"\\\"\");\n }\n if(classes){\n html.push(\"class=\\\"\"+classes+\"\\\">\");\n }else{\n html.push(\"class=\\\"ui-widget-content button programme open_win\\\">\");\n }\n html.push(\"<div class='img_container'><img class=\\\"img\\\" src=\\\"\"+img+\"\\\" />\");\n html.push(\"</div>\");\n if(is_live){\n html.push(\"Live: \");\n\n }else{\n }\n html.push(\"<span class=\\\"p_title p_title_small\\\"><a href='http://www.bbc.co.uk/programmes/\"+pid+\"'>\"+title+\"</a></span>\");\n html.push(\"<br /><div clear=\\\"both\\\"></div>\");\n if(n){\n html.push(\"<span class=\\\"shared_by\\\">Shared by \"+n+\"</span>\");\n }\n if(desc){\n html.push(\"<span class=\\\"description large\\\">\"+desc+\"</span>\");\n }\n\n if(explanation){\n\n //string.charAt(0).toUpperCase() + string.slice(1);\n explanation = explanation.replace(/_/g,\" \");\n var exp = explanation.replace(/,/g,\" and \");\n\n html.push(\"<br /><span class=\\\"explain_small\\\">Matches <i>\"+exp+\"</i> in your Beancounter profile</span>\");\n\n }\n html.push(\"</div>\");\n return html\n}", "function Start() {\n // local variable\n let title = document.title;\n\n ///Displaying to console to confirm that the javascript file works.\n console.log(\n \"%c javascript works, Nice\",\n \"font-weight:bold; font-size: 20px;\"\n );\n console.log(\n \"%c ----------------------------\",\n \"font-weight:bold; font-size: 20px;\"\n );\n console.log(\"Title: \" + title);\n console.log();\n\n ///try catch any possible error!\n //Try various functions and if any of them doesn't exists, \n //it skips to catch block and then displays the content from the catch block.\n try {\n switch (title) {\n case \"COMP125 - Home\":\n content.HomeContent();\n\n break;\n\n case \"COMP125 - About\":\n content.AboutContent();\n break;\n\n case \"COMP125 - Contact\":\n content.ContactContent();\n break;\n\n default:\n throw \"Title not Defined\";\n break;\n }\n } catch (err) {\n console.log(err);\n console.warn(\"Oops\");\n }\n\n //injecting files by calling function\n insertHTML(\"../Scripts/View/content/header.html\", \"header\");\n insertHTML(\"../Scripts/View/content/footer.html\", \"footer\");\n }", "function myFunction() {\n \n let elmt = document.querySelector(\"body\");\n elmt.style.backgroundColor= \"magenta\";\n \n let p = document.querySelector(\"body\");\n elmt = p.getElementsByTagName(\"p\");\n elmt[0].style.color = \"blue\";\n elmt[1].style.color = \"blue\";\n elmt[2].style.color = \"blue\";\n elmt[3].style.color = \"blue\";\n elmt[4].style.color = \"blue\";\n elmt[5].style.color = \"blue\";\n elmt[6].style.color = \"blue\";\n elmt[7].style.color = \"blue\";\n elmt[8].style.color = \"blue\";\n elmt[9].style.color = \"blue\";\n\n let pbis = document.querySelector(\"body\");\n elmt = pbis.getElementsByTagName(\"p\");\n elmt[0].style.fontFamily = 'Helvetica';\n elmt[1].style.fontFamily = 'papyrus';\n elmt[2].style.fontFamily = 'papyrus';\n elmt[3].style.fontFamily = 'papyrus';\n elmt[4].style.fontFamily = 'papyrus';\n elmt[5].style.fontFamily = 'papyrus';\n elmt[6].style.fontFamily = 'papyrus';\n elmt[7].style.fontFamily = 'papyrus';\n elmt[8].style.fontFamily = 'papyrus';\n elmt[9].style.fontFamily = 'papyrus';\n\n let H1 = document.querySelector(\"body\"); \n elmt = H1.getElementsByTagName(\"h1\");\n elmt[0].style.color = \"green\";\n elmt[0].style.fontFamily = 'Comic Sans';\n \n let H2 = document.querySelector(\"body\"); \n elmt = H2.getElementsByTagName(\"h2\");\n elmt[0].style.color = \"green\";\n elmt[1].style.color = \"green\";\n elmt[2].style.color = \"green\";\n elmt[3].style.color = \"green\";\n elmt[4].style.color = \"green\";\n elmt[5].style.color = \"green\";\n\n elmt[0].style.fontFamily = 'Comic Sans';\n elmt[1].style.fontFamily = 'Comic Sans';\n elmt[2].style.fontFamily = 'Comic Sans';\n elmt[3].style.fontFamily = 'Comic Sans';\n elmt[4].style.fontFamily = 'Comic Sans';\n elmt[5].style.fontFamily = 'Comic Sans';\n\n let H3 = document.querySelector(\"body\"); \n elmt = H3.getElementsByTagName(\"h3\");\n elmt[0].style.color = \"green\";\n elmt[1].style.color = \"green\";\n elmt[2].style.color = \"green\";\n\n elmt[0].style.fontFamily = 'Comic Sans';\n elmt[1].style.fontFamily = 'Comic Sans';\n elmt[2].style.fontFamily = 'Comic Sans';\n \n\n \n }", "function setHtml() {\n\n\t\tvar div = document.createElement('div');\n\t\tdiv.id = \"box-window\";\n\t\tdiv.innerHTML =\n\t\t\t\t'<header>' +\n\t\t\t\t\t'<p id=\"close-btn\"></p><p id=\"storage-btn\"></p><p id=\"wide-btn\"></p>' +\n\t\t\t\t'</header>' +\n\t\t\t\t'<div id=\"content\">' +\n\t\t\t\t\t'<nav>' +\n\t\t\t\t\t\t'<ol>' +\n\t\t\t\t\t\t\t'<li><p id=\"nav-home\" class=\"active\">HOME</p></li>' +\n\t\t\t\t\t\t\t'<li><p id=\"nav-about\">ABOUT</p></li>' +\n\t\t\t\t\t\t\t'<li><p id=\"nav-work\">WORK</p></li>' +\n\t\t\t\t\t\t\t'<li><p id=\"nav-board\">BOARD</p></li>' +\n\t\t\t\t\t\t'</ol>' +\n\t\t\t\t\t'</nav>' +\n\t\t\t\t\t'<div class=\"inner\">' +\n\t\t\t\t\t\t'<div id=\"contet-home\" class=\"show contents\">' +\n\t\t\t\t\t\t\t'<p>サイトタイトル : ' + document.title + '</p>' +\n\t\t\t\t\t\t\t'<p>最終更新日時 : ' + document.lastModified + '</p>' +\n\t\t\t\t\t\t\t'<p>画像数 : ' + document.images.length + '</p>' +\n\t\t\t\t\t\t\t'<p>リンク数 : ' + document.links.length + '</p>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'<div id=\"contet-about\" class=\"contents\">' +\n\t\t\t\t\t\t\t'<p id=\"status-image-size\">画像の大きさ : <span>なし</span></p>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'<div id=\"contet-work\" class=\"contents\">' +\n\t\t\t\t\t\t\t'<iframe id=\"desk-nets\" src=\"http://graphic-tokyo.dn-cloud.com/cgi-bin/dneo/dneo.cgi?\" width=\"100%\" height=\"300px\"></iframe>' +\n\t\t\t\t\t\t\t'<p id=\"open-secretWindow\">シークレットウィンドウで開く</p>' +\n\t\t\t\t\t\t\t'<p id=\"mail-auto-reload\">Mail自動更新</p>' +\n\t\t\t\t\t\t\t'<p id=\"test\"><' + '?' + ' php echo 11111; ?' + '></p>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'<div id=\"contet-board\" class=\"contents\">' +\n\t\t\t\t\t\t\t'<div id=\"board-area\">' +\n\t\t\t\t\t\t\t\t'<input id=\"board-input\" type=\"text\" name=\"name\" size=\"30\" maxlength=\"20\" ></input>' +\n\t\t\t\t\t\t\t\t'<p id=\"board-write\">投稿する</p>' +\n\t\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t'</div>' +\n\t\t\t\t'</div>';\n\n\t\tdocument.body.appendChild(div);\n\n\t\treturn false;\n\t}", "function createHtml (){\n fs.writeFileSync(outputPath, render(teamTotal), \"utf-8\");\n console.log(\"Your Team html has been created. Go to the output folder to see your creation.\")\n}", "function generateTeamProfile() {\n startHTML();\n addNewEmployee();\n}", "function htmlHeader() {\nconst htmlHeader = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Member-Profile-Generator</title>\n <link rel=\"stylesheet\" href=\"https://use.fontawesome.com/releases/v5.15.1/css/all.css\" integrity=\"sha384-vp86vTRFVJgpjF9jiIGPEEqYqlDwgyBgEF109VFjmqGmIY/Y4HV4d3Gp2irVfcrp\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css\">\n</head>\n<body>\n <nav class=\"navbar is-primary\" role=\"navigation\" aria-label=\"main navigation\">\n <div id=\"navbarBasicExample\" class=\"navbar-menu\">\n <div class=\"navbar-start\">\n <a class=\"navbar-item\">\n Home\n </a>\n </div>\n </nav>`;\n //write the file write when the function is called\n fs.writeFile('./output/team.html', htmlHeader, (err)=>{if (err) {\n console.error(err)\n return\n }})\n }", "function spmHTML(forrigeTekstInnA, nyTekstInnA, forrigeTekstInnB, nyTekstInnB, forrigeOverskrift, nyOverskrift){\n\n\t\tvar strengA = document.getElementById(\"spmSvarA\").innerHTML; \n\t\tvar endraTekstA = strengA.replace(forrigeTekstInnA,nyTekstInnA);\n\t\tdocument.getElementById(\"spmSvarA\").innerHTML=endraTekstA;\n\n\t\tvar strengB = document.getElementById(\"spmSvarB\").innerHTML; \n\t\tvar endraTekstB = strengB.replace(forrigeTekstInnB,nyTekstInnB);\n\t\tdocument.getElementById(\"spmSvarB\").innerHTML=endraTekstB;\n\n\t\tvar strengC = document.getElementById(\"testOverskrift\").innerHTML; \n\t\tvar endraTekstA = strengC.replace(forrigeOverskrift,nyOverskrift);\n\t\tdocument.getElementById(\"testOverskrift\").innerHTML=endraTekstA;\t\t\n\t\t}", "function wrapHtml() {\n let page = \"\";\n return page = `<!doctype html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta content=\"ie=edge\" http-equiv=\"X-UA-Compatible\">\n <meta content=\"width=device-width, initial-scale=1\" name=\"viewport\">\n <!--suppress SpellCheckingInspection -->\n <link crossorigin=\"anonymous\" href=\"https://unpkg.com/[email protected]/build/pure-min.css\"\n integrity=\"sha384-Uu6IeWbM+gzNVXJcM9XV3SohHtmWE+3VGi496jvgX1jyvDTXfdK+rfZc8C1Aehk5\" rel=\"stylesheet\">\n <link href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css\" rel=\"stylesheet\">\n <link href=\"./assets/css/purecssframework.css\" rel=\"stylesheet\">\n <link href=\"./assets/css/theme-colors.css\" rel=\"stylesheet\">\n <link href=\"./assets/css/myTeam.css\" rel=\"stylesheet\">\n <link href=\"https://fonts.googleapis.com/css?family=Open+Sans\" rel=\"stylesheet\">\n <title>Document</title>\n </head>\n <body style=\"background-color: #eee;\">\n <h1 class=\"danger spacer-xl text-center mt-0 bold\"><br>My Team</h1>\n <div class=\"flex-grid\">\n ${cards} \n </div>\n </body>\n </html>`;\n\n }", "function writeEktronCMSInfo()\r\n{\r\n\twith (document)\r\n\t{\r\n\t\twrite(\"<br><hr width='80%'>\");\r\n\t\twrite(\"<h2><a name='Ektron'>Ektron's Other Products</a></h2>\");\r\n\t\twrite('<a href=\"' + g_sCMS300Page + '\" target=\"_blank\"><img src=\"cms300.gif\" border=\"1\"></a>');\r\n\t\twrite('<li><a href=\"' + g_sCMS300Page + '\" target=\"_blank\">Ektron CMS300 Home Page</a><br>');\r\n\t\twrite('<li><a href=\"' + g_sCMS400Page + '\" target=\"_blank\">Ektron CMS400 Home Page</a><br>');\r\n\t\twrite('<li><a href=\"' + g_sDMS400Page + '\" target=\"_blank\">Ektron DMS400 Home Page</a><br>');\r\n\t\t/*write('<li><a href=\"' + GetAddress(sProduct) + '\" target=\"_blank\">Web Content Editors Home Page</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com/webimagefx.aspx\" target=\"_blank\">Web Image Editor Home Page</a><br>');*/\r\n\t\twrite('<li><a href=\"http://www.ektron.com/support/index.aspx\" target=\"_blank\">Ektron Support Site</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com/developers/index.cfm\" target=\"_blank\">Ektron Developers Site</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com\" target=\"_blank\">Ektron Site</a><br>');\r\n\t\twriteln(\"<br>\");\r\n\t}\r\n}", "function testFunctions(str) {\n const shoutedStr = shout(str);\n const yelledStr = yell(shoutedStr);\n const htmlStr = html(yelledStr);\n console.log(htmlStr);\n }", "function processFileHTML(doc){\n // parse out into blocks\n // re-assemble with new paragraph numbering\n // add style sheet\n // move assets to the assets folder\n return doc;\n}", "async function create_html(team_name) {\n // Try creating html file\n try {\n // Aassign Header html that goes above employee information\n const header_html = `\n<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <script src=\"https://kit.fontawesome.com/cc10a71280.js\" crossorigin=\"anonymous\"></script>\n <link rel=\"stylesheet\" href=\"../css/style.css\">\n <title>Team Profile Generator</title>\n</head>\n\n<body>\n<header>\n <h1>Team: ${team_name}</h1> \n</header>\n<main>`\n // Create html file with header html string\n await fs.writeFile('output/team.html', header_html, (error) => {\n if (error) {\n print(error)\n }\n });\n // If there is an error catch it\n } catch (e) {\n print(e);\n }\n}", "function verse1() {\n let output = ''\n output = '<p>In the heart of Holy See</p>' +\n '<p>In the home of Christianity</p>' +\n '<p>The Seat of power is in danger</p>'\n\n return output\n}", "getResponseHtml(heading, errors, displayBack) {\n const styles = require(\"fs\").readFileSync(\n __dirname + \"/../css/main.css\",\n \"utf-8\"\n );\n const minifyOptions = {\n collapseWhitespace: true,\n removeComments: true,\n collapseInlineTagWhitespace: true,\n minifyCSS: true\n };\n\n return minify(\n `\n <!doctype html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title></title>\n <style>${styles}</style>\n <meta name=\"robots\" content=\"noindex,nofollow\">\n </head>\n <body>\n <div class=\"wrapper\">\n <div class=\"little-box\">\n ${this.getHeadingMarkup(heading)}\n ${this.getErrorsMarkup(errors)}\n ${this.getBackMarkup(displayBack)}\n </div>\n </div>\n </body>\n </html>\n `,\n minifyOptions\n );\n }", "function createHTML (studentSet) {\n\tvar frame = '';\n\tfor (var i=0; i < studentSet.length; i++) {\n\t\tframe += \"<li class='list-group-item body-text'>\"; \n\t\tframe += \"<b>\" + studentSet[i].studentName + \"</b> - \";\n\t\tframe += studentSet[i].description + \"</li>\";\n\t}\n\treturn frame;\n}", "function generateWebpage() {\n\t// Check if the inputs are even showing, if not display them\n\tif (document.getElementById('input-hider').style.display == '' || document.getElementById('input-hider').style.display == 'none') {\n\t\tdocument.getElementById('input-hider').style.display = 'block';\n\t\tdocument.getElementById('input-hider-button').style.display = 'inline-flex';\n\t} else {\n\t\t// Grab the entered info\n\t\tvar name = document.getElementById('enter-name').value\n\t\tvar dob = document.getElementById('dob').value.split('-');\n\n\t\t// Validate that all information is added\n\t\t// If any information is missing, change that input slot to red and exit the function\n\t\tif (!validateInfo([name, ...dob])) {\n\t\t\tArray.from(document.getElementsByTagName('input')).forEach(element => {\n\t\t\t\tif (element.value == '')\n\t\t\t\t\telement.style.borderColor = 'red';\n\t\t\t\telse\n\t\t\t\t\telement.style.borderColor = 'rgb(66,66,66)';\n\t\t\t});\n\t\t\treturn;\n\t\t} \n\n\t\t// Redirect to the custom page\n\t\twindow.location.href = `?name=${name}&date=${dob[1]}%${dob[2]}%${dob[0]}`;\n\t}\n}", "function createHTML (courseSet) {\n\tvar frame = '';\n\tfor (var j=0; j < courseSet.length;\t j ++) {\n\t\tif (courseSet[j].filename != \"na\") {\n\t\t\tframe += \"<li class='list-group-item body-text'><b>\" + courseSet[j].courseCode + \" \" + courseSet[j].courseNum + \"</b> - \" + courseSet[j].title + \" (\" + courseSet[j].quarter + \" \" + courseSet[j].year + \") \" + \"<a href='documents/syllabi/\" + courseSet[j].filename + \"''>\" + \"[syllabus]\" + \"</a></li>\";\n\t\t}\n\t\telse {\n\t\tframe += \"<li class='list-group-item body-text'><b>\" + courseSet[j].courseCode + \" \" + courseSet[j].courseNum + \"</b> - \" + courseSet[j].title + \" (\" + courseSet[j].quarter + \" \" + courseSet[j].year + \") \" + \"</li>\";\n\t\t}\n\t}\n\treturn frame;\n}", "function showPage() {\n htmlPage = \"\"; // reset html code in every function calls\n for(let i = start; i <= end; i++){\n generateHTML(objArray[i]); // populate html code with the data\n }\n studentList.innerHTML = htmlPage;\n}", "function siki22(){\n \tSkHead22=document.getElementById(\"SkRez22\"); \nSkHead22.innerHTML= '<h3 class=\"mbr-section-title mbr-fonts-style align-center mb-4 display-5\"><strong>What is WomCalculator</strong></h3>'+\n '<h4 class=\"mbr-section-subtitle align-center mbr-fonts-style mb-4 display-7\">Wom Calculator is a free online math calculator that is used to find the'+\n $url2('vector and cartesian equations of lines','vectors/equation-of-a-line/index.html')+' &amp;'+$url2(' planes','vectors/equation-of-a-plane/index.html')+','+\n $url2('intersection of lines &amp; planes','vectors/points-of-intersection-of-lines-and-planes/index.html')+','+$url2('shortest distances between points, lines &amp; planes','vectors/shortest-distance-between-points-lines-and-planes/index.html')+','+$url2('determinants, inverses, eigenvalues, eigeinvalues','matrices/determinant-inverse-eigenvalues-and-eigenvectors/index.html')+','+\n $url2('modulus &amp; arguments, nth roots &amp; powers of a complex numbers','complex-numbers/modulus-arguments-powers-and-nth-root-of-a-complex-number/index.html')+', '+$url2('trigonometric identities for sinkx &amp; coskx','complex-numbers/identities-for-sinkx-and-coskx-using-complex-numbers/index.html')+','+\n $url2('solve simultaneous equations &amp; system of equations with 3 variables','matrices/solve-system-of-equations-using-matrices/index.html')+', '+$url2('equation of a circle(with graphs)','coordinate-geometry/equation-of-a-circle/index.html')+','+\n $url2('solve linear, quadratic, cubic &amp; quartic equations','polynomial-equations/using-substitutions/index.html#pelinear')+', '+$url2('quadratic inequalities','quadratic/quadratic-inequalities/index.html')+', '+$url2('parabola','quadratic/parabola/index.html')+', '+$url('regression equations','$REGRESSION')+','+\n $url('discrete probabity distributions','$DPDistributions')+', '+$url2('create amortization','financial-mathematics/amortisation-schedule/index.html')+' &amp; '+$url2('sinking fund schedules','financial-mathematics/sinking-fund-schedule/index.html')+', '+$url2('find payback, npv, irr,','financial-mathematics/investment-appraisal/index.html')+$url(' etc.','$info')+\n ' It has step by step solutions and you can also download your solution in Pdf.</h4>';\n\t\t}", "function _page1_page() {\n}", "generateHtmlOutput() {\n let html = \"\";\n const stateSections = this.state.assignment.sections;\n const outSections = stateSections.custom.concat(stateSections.compulsory);\n\n for (let i = 0; i < outSections.length; i++) {\n if (outSections[i].value != \"\") {\n html += \"<h1>\" + outSections[i].title + \"</h1>\";\n html += outSections[i].value;\n }\n }\n\n return html;\n }", "function fnc_child_set_html() {\n\n}", "function renderStartPage(){\n const setHtml = generateIntro();\n $('main').html(setHtml);\n}", "function textSection1() {\r\n const t = `The full name is ${messi.fullName} an ${messi.nationality} ${messi.positions} soccer player. He was born in ${messi.dateOfBirth} as the third child of 4. His father Jorge Messi was a steel factory manager and his mother was working in a magnet manufacturing workshop.\r\n His career started with ${messi.youthClubs[0]} in the duration ${messi.youthClubsDurations[0]} then moved to ${messi.youthClubs[0]} starting from ${messi.youthClubsDurations[1]}.\r\n If we dug up a little further through Lionel's personality, we will find that is calm and concentrating in the field. Not only just in the field, but also outside of the football field, which means he cares so much about the style of management of the club he plays for.\r\n Until this very moment, ${messi.fullName} still plays for ${messi.youthClubs[1]}. However, his future with the club is a mystery in the moment due to the instabilty of the club's management.`;\r\n //Text to be added to section 1\r\n addTextToSection(t,0); \r\n}//This function is used to add the data of the first section about the player from the js file to the html file.", "function loadDemoPage_1 () {\n console.log ('\\n ====== loadDemoPage_1 ..3 =======\\n');\n\n \n fetch ('https://jsonplaceholder.typicode.com')\n // input = the fetch reponse which is an html page content\n // output to the next then() ==>> we convert it to text\n .then (response => response.text())\n // input text, which represnts html page\n // & we assign it to the page body\n .then (htmlAsText => {\n document.body.innerHTML = htmlAsText;\n });\n}" ]
[ "0.70121616", "0.6308024", "0.628527", "0.62637013", "0.62441903", "0.61575997", "0.6140361", "0.6114862", "0.5997205", "0.598447", "0.5963262", "0.5934411", "0.59086347", "0.5878245", "0.5878179", "0.58699495", "0.5855572", "0.58399355", "0.5829063", "0.58289486", "0.58169425", "0.5812887", "0.5810117", "0.580881", "0.579407", "0.579056", "0.5786274", "0.5778486", "0.57724875", "0.57709694", "0.5761331", "0.57532275", "0.5735993", "0.57338554", "0.5731517", "0.5730989", "0.57302886", "0.57258147", "0.5714099", "0.5710503", "0.57023144", "0.5678756", "0.5677652", "0.56627065", "0.566101", "0.5652003", "0.5647266", "0.5643933", "0.5633421", "0.56326586", "0.56255955", "0.5623211", "0.5618588", "0.56185496", "0.56105363", "0.5607876", "0.5604982", "0.55893975", "0.5567328", "0.55664366", "0.55608785", "0.5558604", "0.5555709", "0.55453354", "0.5538631", "0.5537225", "0.5533451", "0.553028", "0.5525984", "0.55249435", "0.55231756", "0.55231315", "0.55208874", "0.5513528", "0.55042946", "0.5497798", "0.54967", "0.5495964", "0.54954904", "0.5494767", "0.54940134", "0.54903775", "0.5485591", "0.5481395", "0.5479968", "0.5475487", "0.5474725", "0.5474478", "0.5471457", "0.54685605", "0.5468118", "0.5465436", "0.5462707", "0.5455381", "0.54550123", "0.5453114", "0.54525864", "0.54376054", "0.5437237", "0.5435269", "0.5433032" ]
0.0
-1
creation de la function d affichage avec un number
function affichage(array) { const nb = document.createElement('input'); nb.type = 'number' nb.value = 0; nb.max = 12; nb.min = 0; const div = document.createElement('div'); div.className = 'row py-3' let last = 0; nb.addEventListener('change', () => { const nouveau = parseInt(nb.value); for (let i = nouveau; i < last; i++) //pour enlever un select si l utilisateur decide d enlever une pizza div.removeChild(div.lastChild); for (let i = last; i < nouveau; i++) // pour ajouter un select si l utilisateur decide d ajouter une pizza div.append(createSelect(array)) last = nb.valueAsNumber; //pour redefinir last au nb choisit }) document.getElementById('commande').append(nb, div); //endroit ou l on place }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createExpFunc(num) {\n\n}", "function miFuncion(x) {\n\n return this.numero + x;\n\n}", "function createFareMultiplier(integar){\nreturn function (Multiplier) {\n return Multiplier * integar;\n }}", "function funcion() {\n return numeracion;\n}", "function createBase (num) {\n return function (n) {\n return (n + num);\n };\n }", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "function alCubo(numero)\r\n{\r\n return numero * numero;\r\n}", "function multiplier_factory(num1){\n\tnum1 = num1||0;\n\t//enter your code here\n\treturn function mult(num2){\n\t\tnum2 = num2||0;\n\t\tif (typeof num2 == \"function\"){\n\t\t\treturn num1*num2(num1);\n\t\t}\n\t\telse {\n\t\t\treturn num1*num2;\n\t\t}\n\t}\n\treturn multiplier_factory(0);\n}", "function createBase(n){\n return function(m){\n return n+m;\n };\n}", "function numeroAlCuadrado (numero) {\n var calculo;\n calculo = numero*numero;\n\n return calculo;\n}", "function numfunc(num) {\n // Defines a function - with one arguement that ust be a number and must returna number\n return num + 1;\n}", "function MyNumber()\n{\n}", "function newNumber(number){\n formula += number\n}", "function fatorial(numero) {\n return 0\n}", "function newfunc(num){\n return num + 1;\n}", "function n(n) {}", "function createExpFunc(num) {\n return function(num2){\n return Math.pow(num2, num);\n }\n}", "function newFunc(num){\n return num + 1;\n}", "function num(){ var x = 0}", "function add1Functional(number) {\n return number + 1;\n}", "function createBase(integer) {\n const addNum = num => {\n return integer + num;\n };\n return addNum;\n}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function n(){}", "function getFuncion(num) {\n if (num === void 0) { num = 1; }\n return 'Función normal de JS';\n}", "function CriaInputNumerico(numero, id, classe, funcao) {\n var input = CriaDom('input', id, classe);\n input.type = 'number';\n if (numero) {\n input.value = numero;\n }\n if (funcao) {\n input.addEventListener('input', funcao, false);\n }\n return input;\n}", "function dobro(numero) {\n return numero * 2;\n}", "plus(number) {\n\n }", "function duplicarTreinta(){\n return 30*2;\n}", "function agregarNumero(num){\n opActual = opActual + num; \n actualizarDisplay();\n}", "function num(number) {\n return () => number;\n}", "function crear(numero) {\n return {\n porDos: function() {\n const resultado = numero * 2;\n console.log('el numero es', resultado);\n return resultado;\n }\n };\n}", "function potencia(base){\n return function(exp){\n return Math.pow(base, exp)\n }\n}", "function createNumberFactory(name, fn) {\r\n return factory(name, ['typed'], _ref => {\r\n var {\r\n typed\r\n } = _ref;\r\n return typed(fn);\r\n });\r\n}", "function factorial(num){\n \n}", "function factorial(num){\n \n}", "function makeNumBig(num){\n\tvar multiply = num*10;\n\tvar add = num+999;\n\tvar sub = num-109;\n\tvar result = function() {\n\t\treturn multiply+add+sub;\n\t}\n\treturn result;\n}", "function Numeric() {}", "constructor (number) {\n this.number = number\n }", "function getNum1() {\n return 4;\n}", "function makepower(power){\n function powerfn(base){\n return Math.pow(base, power) ;\n }\n return powerfn\n}", "function newNum(num) {\n\tif (num < 2) {\n\t\treturn num * 2;\n\t}\n\treturn num;\n}", "function multiplicaPor7() {\n return function(n) { return n*7 }\n}", "function numberFact(num, fn) {\n return fn(num);\n}", "function n(e,a){0}", "function Multiplicar(valor){\n return valor * 2;\n}", "function potencia(base) {\n return function (expoente) {\n return Math.pow(base, expoente);\n };\n}", "function cuadrado(num1) {\n return num1 * num1;\n}", "function add(n) {\n let fn = function(x) {\n return add(n + x);\n };\n\n fn.valueOf = function() {\n return n;\n }\n return fn;\n }", "function multiplica(numero, numero2)\n{\n return numero * numero2;\n}", "function a(n,t){0}", "function n(e,n){return n}", "function duplicar(numero){\n return numero*2;\n}", "function num1() {\n return 10;\n}", "function getNum(val) {\n return function() {\n return val;\n };\n}", "function factorial(num) {\n \n}", "function prix() {\n return 50 * (nbMultiplicateur * nbMultiplicateur * 0.2);\n}", "function amelioration(){\n return nbMultiplicateurAmelioAutoclick +9;\n}", "function Numeral(number){this._value=number;}", "function n(a,t){0}", "function getNewNumber(x) {\n setNewNumber(x);\n }", "function myFunction (num) {\n return num * 3;\n}", "function add(n) {\r\n var fn = function(x) {\r\n return add(n + x);\r\n };\r\n\r\n fn.valueOf = function() {\r\n return n;\r\n };\r\n\r\n return fn;\r\n}", "function getNumber(){\n\treturn;\n}", "function e(t,n){0}", "function e(t,n){0}", "function counterGen(num) {\n var localNum = num;\n return {\n val: localNum, // copy by value\n\n increment: function () {\n localNum;\n },\n\n decrement: function () {\n localNum;\n },\n\n getValue: function () {\n return localNum;\n }\n }\n} // end of the function counterGen", "function dynamicMultiply(num) {\n let multiplier = num;\n\n return function (factor) {\n return multiplier * factor;\n };\n}", "function createAddByFunction(firstNumber) {\n const someThing = 'something';\n return function(secondNumber) {\n console.log(someThing);\n return firstNumber + secondNumber;\n }\n}", "function operacion(){\n valor=0;\n var incrementar = function(){\n return valor += 3;\n }\n return incrementar;\n}", "function addBy(firstNumber) {\n return function (secondNumber) {\n return firstNumber + secondNumber;\n }\n}", "function generateNumber() {\n return 5;\n}", "function cuadradoR(num) {\n return num * num;\n}", "function multiplier(n1,n2){\n ajouterHistorique(n1 + ' x ' + n2);\n return n1 * n2;\n}", "function miFuncion (){}", "function MyNewFunction(number1, number2) {\r\n let result = number1 + number2;\r\n return result;\r\n }", "function nombreFuncion(){\n \n}", "function addTen(num) {\n return function addNum(n) {\n return num + n;\n }\n}", "function pret_a_la_banque(numero)\n{\n\tthis.money += numero * 5;\n}" ]
[ "0.71254164", "0.70957863", "0.6981608", "0.6817879", "0.677229", "0.6743852", "0.66902727", "0.66752297", "0.64784896", "0.64726025", "0.64650244", "0.6461294", "0.64417815", "0.6438037", "0.6417279", "0.63921463", "0.636289", "0.63433266", "0.62147784", "0.6190905", "0.6174896", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.613899", "0.6119133", "0.6107333", "0.6099588", "0.6091401", "0.60830003", "0.60817593", "0.60765296", "0.6071448", "0.60544497", "0.60499716", "0.6046393", "0.6046393", "0.6041597", "0.60330373", "0.60294634", "0.60110533", "0.5991916", "0.5991527", "0.5981884", "0.5964892", "0.5962562", "0.59556514", "0.5951685", "0.59459275", "0.59443074", "0.59373456", "0.5934884", "0.59348494", "0.59245354", "0.5919116", "0.5912919", "0.5911814", "0.59094656", "0.5909115", "0.5895468", "0.58948463", "0.5853851", "0.58524853", "0.5847122", "0.5844578", "0.5844352", "0.5844352", "0.5837727", "0.58344615", "0.58328754", "0.58288443", "0.58198696", "0.5814756", "0.58137953", "0.5803115", "0.5802751", "0.57876027", "0.57807916", "0.57692903", "0.57687104" ]
0.0
-1
Highest Level Component that oversees the React Routing Setup
function App() { return ( <Router> <header> <div className="nav-bar"> <Toolbar className="tool-bar"> <h1 className="baseCheck"><Link className="baseCheckLink" to="/">BaseCheck</Link></h1> </Toolbar> </div> </header> <Switch> <Route exact path='/'><HomePage/></Route> <Route path='/county/:county/:state'><CountyDetail/></Route> <Route path='/search/:county'><SearchPage/></Route> <Redirect to='/'/> </Switch> </Router> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n const routes = (\n <Switch>\n <Route\n path=\"/\"\n exact\n render={() => (\n <AsyncMarketOverview\n rowCount={this.props.rowCount}\n currencyData={this.props.currencyData}\n showLoader={this.props.showLoader}\n showError={this.props.showError}\n />\n )}\n />\n <Route\n path=\"/liquidity\"\n render={() => (\n <AsyncScatterChart\n rowCount={this.props.rowCount}\n currencyData={this.props.currencyData}\n />\n )}\n />\n <Route component={() => <h1>404 - Page not found</h1>} />\n </Switch>\n );\n return (\n <div>\n <Header dropdownChange={this.dropdownChange} />\n {this.props.showLoader && <p>Loading...</p>}\n {this.props.showError && <p>Error fetching data from server></p>}\n <main>{routes}</main>\n </div>\n );\n }", "render() {\n \n return (\n <React.Fragment>\n\n <Route\n exact\n path=\"/home\"\n render={(props) => {\n return <Home {...props} />;\n }}\n />\n\n <Route\n exact\n path=\"/plan\"\n render={(props) => {\n return <Map {...props} />;\n }}\n />\n\n <Route\n exact\n path=\"/explore\"\n render={(props) => {\n return <ExploreList {...props} />;\n }}\n />\n\n <Route\n exact\n path=\"/mytrips\"\n render={(props) => {\n return <MyTripsList {...props} />;\n }}\n />\n\n <Route\n exact\n path=\"/help\"\n render={(props) => {\n return <Help {...props} />;\n }}\n /> \n\n </React.Fragment>\n );\n }", "render(){\n return(\n\n // Routing works for all the sub components in the BrowserRouter component\n <BrowserRouter>\n\n {/* <Layout> handles the toolbar and the sidedrawers.\n props sent to component - \n username: taken from the redux state\n */}\n <Layout username = {this.props.username} >\n\n {/* Only one of the routes is selected at a time declared within <Switch> */}\n <Switch>\n { /*if user is authenticated then go to the home page otherwise to the login page when \"<baseurl>/\" is typed in url bar*/\n this.props.isAuthenticated ?\n <Route path =\"/\" exact render = {() => (<Redirect to={'/' + this.props.username + \"/home\"} />)} />\n :\n <Route path =\"/\" exact render = {() => (<Redirect to='/login' />)} />\n }\n \n { /* \n following proxyhome concept is used because the <Home> does no rerender otherwise if \n we search for a new user in the toolbar search box\n */}\n <Redirect exact from=\"/:urlUsername/proxyhome\" to='/:urlUsername/home' />\n <Route path= '/:urlUsername/home' exact component = {Home} />\n \n <Route path='/aboutapp' exact component = {AboutApp} />\n <Route path='/signup' exact component = {SignUp} />\n { /* \n if user is authenticated then go to home page otherwise go to login page when user \n types <baseurl>/login in url bar \n */\n this.props.isAuthenticated ?\n <Route path='/login' exact render = {() => (<Redirect to={'/' + this.props.username + \"/home\"} />)} />\n :\n <Route path='/login' exact component = {Auth} />\n }\n \n <Route path='/logout' exact component = {Logout} /> \n\n {/* All the other unmatched urls request will be given response of 404 page not found by the below route */}\n <Route \n render = {() => \n <div className = \"PageNotFound\">\n Error 404: Page not found\n </div> \n } \n />\n </Switch>\n </Layout> \n </BrowserRouter>\n );\n }", "function App(){\n return(\n <div>\n <S>\n <R path=\"/info\">\n <Detail/>\n </R>\n <R path='/login'>\n <Login/>\n </R>\n <R path=\"/\">\n <Home/> \n </R>\n </S>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Headernav />\n <Switch>\n <Route path=\"/\" exact component = {ProductListing}/>\n <Route path=\"/Crypto\" component = {CryptoListing}/>\n <Route path=\"/Bigchart\" render={() => <Bigchart legendPosition=\"bottom\"/>}/>\n </Switch>\n </Router>\n </div>\n );\n}", "render(){\t\t\n\t\treturn (\n\t\t<main><Switch>\n\t\t\t<Route exact path='/' render={() => (<div>home</div>)} />\n\t\t\t<Route path='/test' render={() => (<div>test</div>)} />\n\t\t\t<Redirect to='/' from='/test2' />\n\t\t</Switch></main>\n\t\t);\n\t}", "function App() {\n return (\n <>\n <Router>\n <>\n <Menu />\n <Switch>\n <Route path=\"/restaurants\">\n <Restaurants />\n </Route>\n {/* <Route path=\"/reslist\">\n <ResList />\n </Route> */}\n <Route path=\"/resmap\">\n <ResMap />\n </Route>\n <Route path=\"/resprdoucts/:id\" component={ResProducts} />\n {/* <Route path=\"/custom-meal\">\n <CustomMeal />\n </Route>\n <Route path=\"/shop\">\n <Shop />\n </Route>\n <Route path=\"/food-shot\">\n <FoodShot />\n </Route> */}\n <Route exact path=\"/\">\n <Home />\n </Route>\n </Switch>\n </>\n </Router>\n </>\n )\n}", "function App() {\n\n return (\n <div className=\"App\">\n <Router>\n <Home path=\"/\"/>\n <Main path=\"/admin\"/>\n {/* <AdminHome path=\"/login/hi\"/> */}\n <BuyTicket path=\"/tickets/:id\"/>\n <BuyersList path=\"/admin/info\"/>\n <MoviesAdmin path=\"/admin/movies\"/>\n </Router>\n </div>\n );\n}", "render() {\n\n return (\n\n <div className=\"app\">\n\n <Switch>\n\n\n{/* Base Page Route */}\n <Route exact path=\"/\" render={() => (\n <BookListing bookInventory={this.state.bookInventory} changeShelf={this.changeShelf} />\n )}/>\n\n{/* Search Page Route */}\n <Route exact path=\"/search\" render={() => (\n <SearchBooks bookInventory={this.state.bookInventory} changeShelf={this.changeShelf} />\n )}/>\n\n{/* Bad URL */}\n <Route component={Error404} />\n\n </Switch>\n\n\n </div>\n )\n }", "render() {\n\n return (\n <div>\n {/* ROUTE: This component is for creating and linking pages with each other. Passing props to cummunicate between parent and chideren. */}\n <Route exact path=\"/\" render={() => (\n <BookShelfs\n books={this.state.books}\n selectHandler={this.selectHandler}\n />\n )} />\n\n <Route exact path=\"/search\" render={() => (\n <BookSearch \n searchResult={this.state.searchResult}\n searchQuery={this.searchQuery}\n selectHandler={this.selectHandler}\n books={this.state.books}\n />\n )} />\n </div>\n )\n }", "function App() {\n return (\n <Router>\n <div className=\"App\">\n {/* <Navbarcomponent /> */}\n <Route exact path=\"/Users\" component={Users} />\n <Route exact path=\"/Profile\" component={Profile} />\n <Route exact path=\"/Landing\" component={Landing} />\n {/* <Route path=\"/SMS/:number\" component={SmsDetails} /> */}\n\n </div>\n </Router>\n );\n}", "function RoutePath() {\r\n return (\r\n\r\n <div id=\"main-outer\">\r\n <Route path=\"/\" exact strict render = {\r\n () => {\r\n return (\r\n <Home />\r\n );\r\n }\r\n }/>\r\n\r\n <Route path=\"/products\" exact strict render = {\r\n () => {\r\n return (\r\n <Products />\r\n );\r\n }\r\n }/>\r\n\r\n <Route path=\"/myproducts\" exact strict render = {\r\n () => {\r\n return (\r\n <MyProducts />\r\n );\r\n }\r\n }/>\r\n\r\n <Route path=\"/product/add\" exact strict render = {\r\n () => {\r\n return (\r\n <AddProduct />\r\n );\r\n }\r\n }/>\r\n\r\n <Route path=\"/product-detail/:id\" exact strict render = {\r\n () => {\r\n return (\r\n <ProductDetailedView />\r\n );\r\n }\r\n }/>\r\n\r\n <Route path=\"/admin/dashboard\" exact strict render = {\r\n () => {\r\n return (\r\n <AdminDashBoard />\r\n );\r\n }\r\n }/>\r\n </div> \r\n );\r\n}", "render() {\n return (\n <Router history={this.props.history}>\n <Route path=\"/\" component={App}/>\n <Route path=\"/register\" component={Register}/>\n <Route path=\"/home\" component={Home}>\n <Route path=\"/profile\" component={Profile}/>\n <Route path=\"/slides\" component={Slides}/>\n </Route>\n </Router>\n );\n }", "function App() {\n return (<div className=\"app\">\n <Route\n path=\"/home\"\n exact\n render={routerProps=> (\n <Home></Home>\n )}\n ></Route>\n <Route\n path=\"/\"\n exact\n render={routerProps=> (\n <Onboarding>\n\n </Onboarding>\n )}>\n\n </Route>\n </div>\n )\n}", "function App() {\n return (\n <div className=\"App Container\">\n <Aside/>\n <Routes>\n <Route path= '/' exact element={<Main/>}/>\n <Route path= '/post' element={<Input/>}/>\n <Route path= '/register' element={<Register/>}/>\n <Route path= '/login' element={<Login/>}/>\n <Route path= '/profile' element={<Profile email=\"[email protected]\" numPosts=\"9\"/>}/>\n <Route path= '*' element={<Error/>}/>\n </Routes>\n </div>\n );\n}", "render() {\n return (\n <div className=\"app\">\n <Switch>\n <Route\n exact\n path=\"/\"\n render={() => (\n <BookManager\n books={this.state.books}\n createBooks={this.createBooks}\n />\n )}\n />\n <Route\n exact\n path=\"/search\"\n render={() => (\n <Search\n books={this.state.searchBooks}\n query={this.state.query}\n createBooks={this.createBooks}\n handleSearch={this.handleSearch}\n />\n )}\n />\n <Route component={NoMatch}/>\n </Switch>\n </div>\n );\n }", "render(){\n return (\n <div className=\"App\">\n <Navbar>\n <Route path=\"/\" exact component={HomeContainer} />\n <Route exact path=\"/tools/new\" component={AddToolContainer} />\n <Route exact path=\"/tools\" component={SavedTools} />\n <HangForm />\n <HangBoardSession />\n </Navbar>\n </div>\n )\n }", "render() {\n return (\n <div className=\"container-fluid\">\n <Router>\n <div>\n <Route path='/' exact\n render={() =>\n <LandingPage/>\n }/>\n <Route path='/search' exact\n render={() =>\n <SearchDoctor/>\n }/>\n <Route path='/search/:criteria' exact\n component={ResultsPage} />\n <Route path='/details/:location/practice/:practiceId' exact\n component={DetailsPage} />\n <Route path='/profile/:profileId' exact\n component={UserProfile} />\n <Route path='/profile' exact\n component={PersonalProfile} />\n <Route path='/article/:articleId' exact\n component={Article} />\n <Route path='/login' exact\n component={Login} />\n <Route path='/register' exact\n component={Register} />\n </div>\n </Router>\n </div>\n )\n }", "render() {\n const {route} = this.props;\n return (\n <div className=\"app route-container\">\n <h1>Layout!</h1>\n <p>Just s demo page!!</p>\n <ul>\n <li><NavLink activeClassName='active' exact to=\"/\">Home</NavLink></li>\n <li><NavLink activeClassName='active' to=\"/test\">Test</NavLink></li>\n </ul>\n {renderRoutes(route.routes)}\n </div>\n );\n }", "function Main(){\n return(\n <Switch>\n <Route exact path=\"/\" component={Landing} />\n <Route exact path=\"/aboutme\" component={About} />\n <Route exact path=\"/resume\" component={Resume} />\n <Route exact path=\"/contact\" component={Contact} />\n <Route component={Error}></Route>\n {/* <Route exact path=\"/projects\" component={Project} /> */}\n </Switch>\n )\n}", "render(){\n\n\nreturn(\n<Router>\n<div className=\"main-container\">\n<Route exact path='/' render={(props) => <Login {...props} baseUrl={this.baseUrl} /> } />\n<Route exact path='/home' render={(props) => <Home {...props} baseUrl={this.baseUrl} /> } />\n<Route exact path='/profile' render={(props) => <Profile {...props} baseUrl={this.baseUrl} /> } />\n</div>\n\n</Router>\n) \n\n}", "function App() {\n return (\n <Router>\n <div className=\"App\">\n <Header />\n <Route\n exact\n path=\"/\"\n render={() => <div>Get home page from svyat</div>}\n />\n <Route\n path=\"/about\"\n render={() => <div>Get about page from svyat</div>}\n />\n\n <Route exact path=\"/account\" component={Account} />\n\n <Route path=\"/login\" component={LoginForm} />\n <Route path=\"/signup\" component={Form} />\n\n {/* change url to match endpoint for imageid, change prop picURL to match endpoint for image source */}\n {/* <Route\n path={`/account/image/${clicked.id}`}\n component={() => <ImagePage picURL={clicked.src} />}\n /> */}\n </div>\n </Router>\n );\n}", "render(){\n return (\n <div className=\"container\">\n <Switch>\n <Route exact path='/' render={(props)=><InventoryDisplay inventoryList={this.state.inventory}\n currentRouterPath={props.location.pathname} onBuyingItem={this.handleBuyingItem} />} />\n <Route exact path='/employees' render={(props)=><EmployeeDisplay onNewItemAdd={this.handleAddingNewItemToInventory} inventoryList={this.state.inventory}\n onDeletingItem={this.handleDeletingItem} onEditingItem={this.handleEditingItem} currentRouterPath={props.location.pathname} />} />\n <Route component={Error404} />\n <Route component={InventoryProps} />\n </Switch>\n </div>\n );\n }", "function App() {\n\n\n return (\n\n <div className=\"App\">\n\n <Home />\n {/* <Switch>\n <Route path=\"/Home\" component={Home}></Route>\n <Route path=\"/Calendar\" component={Calendar} />\n <Route path='/EventDetails/:id' exact strict component={EventDetails} />\n <Route path=\"/login\" component={Login} />\n <Route path='/Properties' component={Properties} />\n <Route path='/PropertyOwner' component={PropertyOwner} />\n <Route path='/Rentals' component={Rentals} />\n <Route path='/Tasks' component={Tasks} />\n <Route path='/SubProperties' component={SubProperties} />\n <Route path='/Form' component={Form} />\n <Route path='/Renter' component={Renter} />\n <Route path='/Details' component={Details}></Route>\n <Route path='/TasksPopUp' component={TasksPopUp}></Route>\n <Route path='/Search' component={Search}></Route>\n <Route path='/PopUpForProperties' component={PopUpForProperties}></Route>\n <Route path=\"/PropertyForRenter\" component={PropertyForRenter}></Route>\n </Switch> */}\n </div>\n\n );\n}", "route(props){\n if(props.path == \"/dynamic\"){\n return (\n <PropsRoute exact path={props.path} component={props.component} navData={this.state.navBarObj} content={this.state.dynamicContent}/>\n );\n }\n else if(props.path == \"budgetrequests\"){\n return(\n <PropsRoute exact path={props.path} component={DynamicScreen} navData={this.state.navBarObj} content={this.state.budgetrequests}/>\n );\n }\n return(\n <PropsRoute exact path={props.path} component={props.component} navData={this.state.navBarObj}/>\n );\n }", "render() {\n\n return (\n\n <div>\n <Router>\n\n <>\n \n \n <NavigationComponent/>\n\n {/* Adding the URL paths for each component */}\n\n <Switch>\n <Route path=\"/\" exact component={RegistrationSelection}/>\n <Route path=\"/signup\" exact component={RegistrationSelection}/>\n <Route path=\"/nr\" exact component={NurseryRegistration}/>\n <Route path=\"/pr\" exact component={ParentRegistration}/>\n <Route path=\"/ns\" exact component={NurserySearch}/>\n <Route path=\"/nsr\" exact component={SearchNurseryResults}/>\n <Route path=\"/single\" exact component={SingleNursery}/>\n <Route path=\"/login\" exact component={Login}/>\n <Route path=\"/ps\" exact component={PaymentSetup}/>\n <Route path=\"/p\" exact component={Prices}/>\n <Route path=\"/sn\" exact component={SendNotification}/>\n <Route path=\"/ans\" exact component={RegistrationRequestsSearch}/>\n <Route path=\"/ansr\" exact component={RegistrationRequests}/>\n <Route path=\"/ana\" exact component={NurseryApplication}/>\n <Route path=\"/add-child\" exact component={AddChild}/>\n <Route path=\"/my-children\" exact component={ViewChild}/>\n <Route path=\"/nursery-send\" exact component={NurseryNotification}/>\n <Route path=\"/view-requests\" exact component={ChildrenRequests}/>\n <Route path=\"/set-meeting\" exact component={Meeting}/>\n <Route path=\"/apply\" exact component={ApplyNursery}/>\n <Route path=\"/confirmation\" exact component={ApplyConfirmation}/>\n\n {/* <Route component={Error}/> WILL BE USED FOR ERROR PATHS*/}\n\n </Switch>\n\n </>\n\n </Router>\n\n </div>\n\n )\n\n }", "function AppRouter() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"ProvideAuth\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"BrowserRouter\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Switch\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Dashboard\",\n path: \"/dashboard\",\n exact: true,\n meta: {\n permissions: ['dashboard.general.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_dashboard_list_dashboard_list_component__WEBPACK_IMPORTED_MODULE_6__[\"DashboardComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"COD\",\n path: \"/cod/transfer-credit-cod\",\n exact: true,\n meta: {\n permissions: ['cod.transfer_credit.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_cod_transfer_credit_cod_list_transfer_credit_cod_list_component__WEBPACK_IMPORTED_MODULE_8__[\"TransferCreditCodListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"COD\",\n path: \"/cod/tracking-number\",\n exact: true,\n meta: {\n permissions: ['cod.transfer_credit.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_cod_cod_receipt_number_list_cod_receipt_number_list_component__WEBPACK_IMPORTED_MODULE_7__[\"CodReceiptNumberListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Pengiriman\",\n path: \"/shipment/monitoring-pickup\",\n exact: true,\n meta: {\n permissions: ['tenant.pickup_monitoring.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_shipments_monitoring_pickup_list_monitoring_pickup_list_component__WEBPACK_IMPORTED_MODULE_9__[\"MonitoringPickUpListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Pengiriman\",\n path: \"/shipment/request-cancel\",\n exact: true,\n meta: {\n permissions: ['tenant.cancel_pickup.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_shipments_request_cancel_list_request_cancel_list_component__WEBPACK_IMPORTED_MODULE_10__[\"RequestCancelListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Pengiriman\",\n path: \"/shipment/request-pickup\",\n exact: true,\n meta: {\n permissions: ['tenant.request_pickup.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_shipments_send_request_pickup_list_send_request_pickup_list_component__WEBPACK_IMPORTED_MODULE_11__[\"SendRequestPickupListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"E-wallet\",\n path: \"/e-wallet/tenants-bank\",\n exact: true,\n meta: {\n permissions: ['wallet.tenant_bank.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_e_wallet_tenants_bank_list_tenants_bank_list_component__WEBPACK_IMPORTED_MODULE_12__[\"TenantsBankListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"E-wallet\",\n path: \"/e-wallet/wallet-transactions\",\n exact: true,\n meta: {\n permissions: ['wallet.tenant_wallet.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_e_wallet_tenant_wallet_list_tenant_wallet_list_component__WEBPACK_IMPORTED_MODULE_13__[\"TenantWalletListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"E-wallet\",\n path: \"/e-wallet/request-withdraw-funds\",\n exact: true,\n meta: {\n permissions: ['wallet.withdrawal.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_e_wallet_request_withdraw_funds_list_request_withdraw_funds_list_component__WEBPACK_IMPORTED_MODULE_14__[\"RequestWithdrawFundsListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"E-wallet\",\n path: \"/e-wallet/debit-cod/\",\n exact: true,\n meta: {\n permissions: ['wallet.withdrawal_history.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_e_wallet_debit_cod_list_debit_cod_list_component__WEBPACK_IMPORTED_MODULE_16__[\"DebitCodListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"E-wallet\",\n path: \"/e-wallet/withdraw-of-tenant-funds\",\n exact: true,\n meta: {\n permissions: ['wallet.withdrawal_history.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_e_wallet_withdraw_of_tenant_funds_list_withdraw_of_tenant_funds_list_component__WEBPACK_IMPORTED_MODULE_15__[\"WithdrawOfTenantFunds\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Tenants\",\n path: \"/tenant/list\",\n exact: true,\n meta: {\n permissions: ['tenant.tenant_list.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_tenants_tenant_list_tenants_list_component__WEBPACK_IMPORTED_MODULE_17__[\"TenantListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Tenants\",\n path: \"/tenant/training-schedule\",\n exact: true,\n meta: {\n permissions: ['tenant.shipping_integration.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_tenants_training_schedule_list_training_schedule_list_component__WEBPACK_IMPORTED_MODULE_18__[\"TrainingScheduleListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Tenants\",\n path: \"/tenant/custom-training-schedule\",\n exact: true,\n meta: {\n permissions: ['tenant.shipping_integration.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_tenants_custom_training_schedule_list_custom_training_schedule_list_component__WEBPACK_IMPORTED_MODULE_19__[\"CustomTrainingScheduleListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Tenants\",\n path: \"/tenant/verification-request\",\n exact: true,\n meta: {\n permissions: ['tenant.shipping_integration.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_tenants_verification_request_list_verification_request_list_component__WEBPACK_IMPORTED_MODULE_20__[\"VerificationRequestListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Users\",\n path: \"/users\",\n exact: true,\n meta: {\n permissions: ['admin.user_admin.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_users_users_list_users_list_component__WEBPACK_IMPORTED_MODULE_21__[\"UsersListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Users\",\n path: \"/users/permissions\",\n exact: true,\n meta: {\n permissions: ['admin.permission_admin.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_users_permissions_list_user_permissions_list_component__WEBPACK_IMPORTED_MODULE_22__[\"UserPermissionListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Users\",\n path: \"/users/access-roles\",\n exact: true,\n meta: {\n permissions: ['admin.role_admin.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_users_roles_list_user_roles_list_component__WEBPACK_IMPORTED_MODULE_23__[\"UserRolesListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Subscription\",\n path: \"/subscription/coupon\",\n exact: true,\n meta: {\n permissions: ['tenant.general_coupon.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_subcriptions_coupon_list_coupon_list_component__WEBPACK_IMPORTED_MODULE_25__[\"CouponListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Coupon: Create\",\n path: \"/subscription/coupon/create\",\n exact: true,\n meta: {\n permissions: ['tenant.general_coupon.create']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_subcriptions_coupon_create_coupon_create_component__WEBPACK_IMPORTED_MODULE_26__[\"CouponCreateComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Coupon: Update\",\n path: \"/subscription/coupon/:id/update\",\n exact: true,\n meta: {\n permissions: ['tenant.general_coupon.edit']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_subcriptions_coupon_update_coupon_update_component__WEBPACK_IMPORTED_MODULE_27__[\"CouponUpdateComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Subscription\",\n path: \"/subscription/billing\",\n exact: true,\n meta: {\n permissions: ['tenant.subscription.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_subcriptions_billing_list_billing_list_component__WEBPACK_IMPORTED_MODULE_28__[\"BillingListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Subscription\",\n path: \"/subscription/billing/upgrade-renew/:id\",\n exact: true,\n meta: {\n permissions: ['tenant.subscription.edit']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_subcriptions_billing_upgrade_renew_upgrade_renew_component__WEBPACK_IMPORTED_MODULE_29__[\"UpgradeRenewComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Subscription\",\n path: \"/subscription/history-transaction\",\n exact: true,\n meta: {\n permissions: ['tenant.subscription.view']\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_subcriptions_history_transaction_list_history_transaction_list_component__WEBPACK_IMPORTED_MODULE_24__[\"HystoryTransactionListComponent\"], null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n title: \"Admin Notifications\",\n path: \"/notifications\",\n exact: true\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_features_main_admin_notifications_list_admin_notifications_list_component__WEBPACK_IMPORTED_MODULE_30__[\"AdminNotificationComponent\"], {\n isSummary: false\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_guard_route_guard_route_component__WEBPACK_IMPORTED_MODULE_3__[\"GuardRoute\"], {\n path: \"/\",\n exact: true\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n path: \"/login\",\n exact: true,\n component: _features_login_login_component__WEBPACK_IMPORTED_MODULE_2__[\"LoginComponent\"]\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n path: \"/404\",\n component: _features_not_found_not_found_component__WEBPACK_IMPORTED_MODULE_4__[\"NotFoundComponent\"]\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n path: \"/403\",\n component: _features_forbidden_access_forbidden_access_component__WEBPACK_IMPORTED_MODULE_5__[\"ForbiddenAccessComponent\"]\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Route\"], {\n path: \"*\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Redirect\"], {\n to: \"/404\"\n }))))));\n}", "function RoutesConfig(){\n return(<div>\n <BrowserRouter>\n <Switch>\n <PrivateRoutes path='/admin' component={Admin}/>\n <PrivateRoutes path='/user' component={User}/>\n <Route path=\"/\"> <Home></Home> </Route>\n </Switch>\n </BrowserRouter>\n </div>);\n}", "function App() {\n return (\n <div className=\"App\">\n <BrowserRouter>\n <Switch>\n <Route path=\"/login\">\n <Login />\n </Route>\n <Route path=\"/signup\">\n <Signup />\n </Route>\n <Route exact={true} path=\"/\">\n <Login />\n </Route>\n <Route path=\"/signup\">\n <Signup />\n </Route>\n <Route exact={true} path=\"/\">\n <Login />\n </Route>\n <Route path=\"/updateProfile\">\n <UpdateProfile />\n </Route>\n <Route path=\"/findfamilies\">\n <ShowFamilies />\n </Route>\n <Route path=\"/viewmatches\">\n <Match />\n </Route>\n </Switch>\n </BrowserRouter>\n </div>\n );\n}", "render() {\n return (\n <Switch>\n <Route path=\"/\" exact>\n <Menu />\n </Route>\n <Route path=\"/app\">\n <Redirect to=\"/\" />\n </Route>\n <Route path=\"/about\">\n <About />\n </Route>\n <Route path=\"/browser\">\n <Browser />\n </Route>\n <Route path=\"/sign-up\">\n <SignUp />\n </Route>\n <Route path=\"/login\">\n <SignIn />\n </Route>\n <Route path=\"/recover-psw\">\n <RecoverPsw />\n </Route>\n <Route path=\"/recovered\">\n <Recovered />\n </Route>\n <Route>\n <NotFound />\n </Route>\n </Switch>\n );\n }", "function App() {\n return (\n <div>\n <Switch>\n <Route exact path=\"/\" component={Chat}></Route>\n <Route exact path=\"/dashboard/admin\" component={Dashboard}></Route>\n <Route exact path=\"/dashboard/admin/bot\" component={Bot}></Route>\n <Route\n exact\n path=\"/dashboard/admin/user/:id\"\n component={UserSettings}\n ></Route>\n <Route\n exact\n path=\"/dashboard/admin/bot/:id\"\n component={ManageBot}\n ></Route>\n <Route exact path=\"/dashboard/admin/user\" component={UserList}></Route>\n <Route\n exact\n path=\"/dashboard/admin/company\"\n component={CompaniesComponent}\n ></Route>\n <Route exact path=\"/auth/register\" component={Register}></Route>\n <Route exact path=\"/auth/login\" component={Login}></Route>\n <Route exact path=\"/auth/verify_email\" component={VerifyEmail}></Route>\n <Route exact path=\"/preview\" component={EmbedCode}></Route>\n <Route component={Error}></Route>\n </Switch>\n </div>\n );\n}", "render() {\n return (\n <div className=\"container\">\n <Switch>\n <Route exact path=\"/\" component ={ List }/>\n <Route path=\"/add-item\" component = { AddItem }/>\n <Route path=\"/item/:itemId\" component={ Details }/>\n <Route component={ NotFound }/>\n </Switch>\n </div>\n );\n }", "function Routing() {\n return (\n <Router>\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route path=\"/puppy\" component={Puppy} />\n <Route path=\"/form\" component={Form} />\n </Switch>\n </Router>\n );\n}", "function App() {\n return (\n <Router>\n <div>\n {/* <Navbar /> */}\n {/* <Wrapper> */}\n <Route exact path=\"/\" component={Search_page} />\n <Route exact path=\"/search\" component={Search_page} />\n <Route exact path=\"/:food_name_short\" component={Food} />\n {/* <Route exact path=\"/api/food\" component={Food} /> */}\n {/* </Wrapper> */}\n {/* <Footer /> */}\n </div>\n </Router>\n );\n}", "function Router() {\n return (\n <BrowserRouter>\n <LayoutApp>\n <Switch>\n <Route component={Home} path='/' exact />\n <LoggedOutRoute component={Signup} path='/signup' />\n <LoggedOutRoute component={Login} path='/login' />\n <PrivateRoute component={Profile} path='/profile' />\n <Route\n component={ResourceDetail}\n path='/resource/:resourceId'\n exact\n />\n </Switch>\n </LayoutApp>\n </BrowserRouter>\n )\n}", "function App() {\n return (\n <div className=\"App\">\n <Switch>\n <Route exact path=\"/\" render={props => <Home {...props} />} />\n <Route exact path=\"/Contact\" render={props => <Contact {...props} />} />\n <Route exact path=\"/About\" render={props => <About {...props} />} />\n <Route exact path=\"/Roadmap\" render={props => <Roadmap {...props} />} />\n </Switch>\n </div>\n );\n}", "function App() {\n return (\n <BrowserRouter>\n <Switch>\n <Route path=\"/\" exact={true} component={Home} />\n <Route path=\"/OurHistory\" component={OurHistory} />\n <Route path=\"/Blog\" component={Blog} />\n <Route path=\"/Partners\" component={Partners} />\n <Route path=\"/Contacts\" component={Contacts} />\n <Route path=\"/Market\" component={Market} />\n <Route path=\"/Products\" component={Products} />\n {/* <Route path=\"/SingUp\" component={SingUp} /> */}\n\n </Switch>\n </BrowserRouter>\n );\n}", "function App(){\n\n return (\n\n <Router>\n <div className=\"App\">\n\n <Switch>\n <Route path=\"/\" exact component={NavBar} />\n <Route path=\"/login\" component={Login} />\n <Route path=\"/reg\" component={Registration} />\n <Route path=\"/search\" component={Search} />\n <Route path=\"/questions\" component={SecurityQuestions} />\n <Route path=\"/pay\" component={Pay} />\n <Route path=\"/usertable\" component={UserTable} />\n <Route path=\"/cartable\" component={CarTable} />\n </Switch>\n </div>\n </Router>\n\n );\n}", "render() {\n return (\n <Router>\n <div>\n <Navbar />\n\n <div className=\"container\" style={{ paddingBottom: \"50px\" }}>\n <Switch>\n <Route path=\"/student\" exact component={StudentHome} />\n <Route\n path=\"/student/assignments\"\n exact\n component={StudentAssignments}\n />\n <Route\n path=\"/student/assignments/uploadassignment/:id\"\n exact\n component={UploadAssignment}\n />\n <Route\n path=\"/student/feedback\"\n exact\n component={StudentFeedback}\n />\n <Route\n path=\"/student/feedback/viewfeedback/:id\"\n exact\n component={ViewFeedback}\n />\n <Route path=\"/student/uploads\" exact component={StudentUploads} />\n <Route\n path=\"/student/settings\"\n exact\n component={StudentSettings}\n />\n </Switch>\n </div>\n </div>\n </Router>\n );\n }", "function App() {\n\n const showMenuHome = (routers) => {\n if (routers && routers.length > 0) {\n return routers.map((item, index) => {\n return (\n <HomeTemplate\n key={index}\n exact={item.exact}\n path={item.path}\n Component={item.component}\n\n />\n\n )\n\n })\n }\n }\n var Snow = require(\"react-snow-effect\")\n return (\n <BrowserRouter history={history}>\n <Snow />\n <Switch>\n <Suspense fallback={Loading}>\n {showMenuHome(routerHome)}\n <Route exact path=\"/detail/:id\" Component={DetailMovie} />\n <Route path=\"/admin\" exact component={AdminTemplate}></Route>\n <Route path=\"/user\" exact component={UserTemplate}></Route>\n\n </Suspense>\n\n\n </Switch>\n </BrowserRouter>\n );\n}", "render() {\n return (\n <div className=\"app\">\n <Route exact path=\"/\" render={() => (\n <ListBooks books={this.state.books} changeShelf={this.changeShelf} />\n )}\n />\n <Route path=\"/search\" render={({ history }) => (\n <SearchBooks books={this.state.books} changeShelf={this.changeShelf} />\n )} />\n <div className=\"open-search\">\n <Link to=\"/search\">Search</Link>\n </div>\n </div> \n )\n }", "function App() {\n var dir = window.location.pathname;\n // console.log(dir);\n return (\n <>\n <div >\n <Navbar />\n </div>\n <div className=\"row\">\n <Sidebar />\n <div className=\"col-md-10\" style={{marginTop: '58px'}}>\n <Switch>\n <Route path=\"/:id\" children={<Child />} />\n </Switch>\n <Switch>\n <Route exact path=\"/\" component={Home} />\n\n <Route exact path=\"/documentation/:slug\" component={Documentation} />\n <Route exact path=\"/requests/:slug\" component={HTTPRequests} />\n <Route exact path=\"/about/\" component={About} />\n <Route component={ErrorPage} />\n </Switch>\n </div>\n </div>\n </>\n );\n}", "render(){\n return(\n <div>\n {/* exact keyword here denotes the fact that we want to exactly match the routes, had there been no\n *exact keyword here, then 'slash' after path will match both the url \"/\" and also \"/AddPhoto\" which\n * wouldn't have rendered our pages in right way\n * */}\n <Route exact path=\"/\" render={()=> <div>\n <Title title={\"Instawall\"}/>\n <Instawall\n posts={this.state.posts}\n onRemovePhoto={this.removePhoto}\n onNavigate={this.navigate}\n />\n </div>\n }/>\n\n {/*component based render method*/}\n <Route path=\"/AddPhoto\" component={AddPhoto}/>\n </div>\n );\n }", "function App(props) {\n return (\n <div>\n <Switch>\n <Route path=\"/\" exact component={DegenerativeTriangle}/>\n <Route path=\"/results\" exact component={DegenerativeTriangleResults}/>\n <Route path=\"**\" render={() => <h1>Page Not Found!</h1>} />\n </Switch>\n </div>\n );\n}", "render(){\n return(\n <Router history={hashHistory}>\n <Layout>\n <Switch>\n\n <Route exact path=\"/\" component={Home}/>\n \n <Route path=\"/eventLog\" component={EventLog}/>\n \n\n\n\n <Route render={function(){\n return <p> not found</p>\n }\n } />\n </Switch>\n </Layout>\n </Router>\n \n )\n }", "function App() {\n return (\n <Router>\n <Switch>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route path=\"/why\">\n <Why />\n </Route>\n <Route path=\"/pass\">\n <ParentComp />\n </Route>\n <Route path=\"/comments\">\n <CommentsSec />\n </Route>\n </Switch>\n </Router>\n );\n}", "function App() {\n return (\n <Router history={hist}>\n <Switch>\n <Route path=\"/login\" component={Login} />\n <Route path=\"/register\" component={Register} />\n <Route path=\"/dashboard/:subPage\" component={Dashboard} />\n <Redirect from=\"/\" to=\"/dashboard/home\" />\n </Switch>\n </Router>\n );\n}", "function App() {\n return (\n\n <div className = {classes.app}>\n <Router>\n <Switch>\n <Route path = \"/\" exact component = {Home}/>\n <Route path = \"/contact\" exact component = {Contact}/>\n <Route path = \"/access/:type\" exact component = {CustomerAccess}/>\n <Route path = \"/account\" exact component = {Account}/>\n </Switch>\n </Router>\n </div>\n );\n}", "render() {\n return (\n <Router>\n <div className=\"App\">\n <div className=\"container\">\n <Header />\n <Route exact path=\"/\" render={props => (\n < React.Fragment >\n <AddTodo addTodo={this.addTodo} />\n <Todos todos={this.state.todos} markComplete={this.markComplete} delTodo={this.delTodo} />\n </React.Fragment>\n )} />\n <Route path=\"/about\" component={About} />\n </div>\n </div>\n </Router >\n );\n }", "render() {\n return(\n <div>\n {/* {this is the router for changing pages on the site} */}\n <BrowserRouter history={history}>\n {/* The Main Context Providers */}\n <UserProvider>\n <OrganizationProvider>\n <VerifyStatusProvider>\n <PrimaryNavSelectedProvider>\n <OpenTicketContextProvider>\n <StatusListProvider>\n <PriorityListProvider>\n <TicketColumnsContextProvider>\n <TicketProvider>\n {/* {Navbar component to navigate} */}\n {/* <Navbar/> */}\n \n \n {/* TicketTabContext to hold the ticket tabs*/}\n <TicketTabContextProvider>\n <SelectedOrgProvider>\n \n\n \n {/* {creating a switch to swap out the component to show when on different pages} */}\n \n {/* {pages and the component assgined to them} */}\n \n <Route component={AllRoutes}/>\n\n </SelectedOrgProvider>\n \n </TicketTabContextProvider>\n \n </TicketProvider>\n </TicketColumnsContextProvider>\n </PriorityListProvider>\n </StatusListProvider>\n </OpenTicketContextProvider>\n </PrimaryNavSelectedProvider>\n </VerifyStatusProvider>\n </OrganizationProvider>\n </UserProvider>\n </BrowserRouter>\n </div>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n\t\t<MyRouter router={router}></MyRouter>\n\t\t\n\t\t{/*\n\t\t// <Switch>\n\t\t// \t{\n\t\t// \t\trouter.map(v=>(\n\t\t// \t\t\t<Route path={v.path} component={v.component}></Route>\n\t\t// \t\t))\n\t\t// \t}\n\t\t// \t// <Route path={\"/login\"} component={Login}></Route>\n\t\t// \t// <Route path={\"/showlist\"} component={Showlist}></Route>\n\t\t// \t// <Route path={\"/detail\"} component={Detail}></Route>\n\t\t// \t// <Route path={\"/thelist\"} component={Thelist}></Route>\n\t\t// \t// <Route path={\"/\"} component={Index}></Route>\n\t\t// </Switch>\n\t\t\n\t\t*/}\n </div>\n );\n}", "render(){ \n return ( \n <div>\n <NavBar/>\n <Switch>\n <Route path='/navigation' component={NavBar}/>\n <Route path=\"/movie/:id\" component={movieId}/> \n <Route path=\"/tv/:id\" component={seriesId}/> \n <Route path=\"/trending\" component={trending}/>\n <Route path=\"/movies\" component={movies}/> \n <Route path=\"/series\" component={series}/>\n <Route path=\"/search\" component={search}/>\n <Redirect from=\"/\" exact to=\"/trending\"/>\n <Route path=\"/not-found\" component={NotFound}/>\n <Redirect to=\"/not-found\"/>\n </Switch>\n </div>\n );\n }", "function ReactRouterDom() {\n return (\n <Router>\n <NavBar />\n <Switch>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route path=\"/about\"> {/* /about in the link will lead us to \"About\" component*/}\n <About />\n </Route>\n <Route path=\"/people\">\n <People />\n </Route>\n <Route path=\"/person/:id\" children={<Person />}></Route>\n <Route path=\"*\"> {/* * means this page will open no matter from what page i try to access invalid link*/}\n <Error />\n </Route>\n\n </Switch>\n </Router>\n )\n}", "function App() {\n return (\n <div className=\"App\">\n \n <Router>\n <Navigation />\n <Switch>\n <Route path=\"/housedetails/:id\" component={HouseDetails} />\n <Route path=\"/:page\" component={PageRenderer} />\n <Route path=\"/\" render={() => <Redirect to=\"/Home\" />} />\n <Route component={() => 404} /> \n </Switch>\n </Router>\n \n <Footer />\n </div>\n );\n}", "function App() {\n return (\n <>\n <Navbar />\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/recipes\" component={Recipes} />\n {/* <Route exact path=\"/others\" component={Others} /> */}\n <Route exact path=\"/recipes/:slug\" component={SingleRecipe} />\n <Route component={Error} />\n </Switch>\n <Footer />\n </>\n );\n}", "function App() {\n return (\n <BrowserRouter>\n <Switch>\n <Route exact path=\"/\" component={ Home } />\n <Route exact path=\"/cart\" component={ Cart } />\n <Route exact path=\"/details/:id\" component={ ProductDetails } />\n {/* <Route\n exact\n path=\"/busca/:id\"\n render={ (props) => <ListerProduct { ...props } /> }\n /> */}\n </Switch>\n </BrowserRouter>\n );\n}", "function App() {\r\n return (\r\n <Router>\r\n <div className=\"background\"> \r\n <Navbar /> \r\n\r\n <Route path=\"/\" exact component= {Home} />\r\n <Route path=\"/inventory\" component={withAuth(Inventory)} />\r\n <div className=\"components\">\r\n <Route path=\"/login\" component= {Login} />\r\n <Route path=\"/signup\" component= {Signup} />\r\n <Route path=\"/register\" component= {Register} />\r\n <Route path=\"/recipe\" component= {withAuth(Recipe)} />\r\n\r\n <Route path=\"/GetRecipe/:id\" component={withAuth(GetRecipe)} />\r\n </div>\r\n <div className=\"container content\">\r\n </div>\r\n <Footer />\r\n </div>\r\n </Router>\r\n );\r\n}", "function Main() {\n return (\n <Router>\n <div>\n <Switch>\n <Route path='/' exact component={Home} />\n <Route path='/blackjack' component={Blackjack} />\n <Route path='*' component={NoPage} />\n </Switch>\n </div>\n </Router>\n );\n}", "function App() {\n return (\n <Provider store={Store}>\n <BrowserRouter>\n <div>\n <Navbar />\n <Switch>\n {/* <Route exact path=\"/\" component={Home}></Route>\n <Route path=\"/about\" component={About}></Route>\n <Route path=\"/contact\" component={Contactus}></Route> */}\n <Route exact path=\"/\" component={Employent}></Route>\n <Route path=\"/SpredSheet\" component={SpredSheet}></Route>\n {/* <Route path=\"/:post_id\" component={Post}></Route> */}\n </Switch>\n </div>\n </BrowserRouter>\n {/* <SpredSheet /> */}\n {/* <Employent /> */}\n </Provider>\n );\n}", "render() {\n const { isAuthenticated, user } = this.state;\n return (\n <BrowserRouter>\n <Header auraLogo={auraLogo} isAuthenticated={isAuthenticated} />\n <Switch>\n {/* <Route path=\"/\" exact component={Home} /> */}\n <Route\n path=\"/\"\n exact\n render={props => (\n <Home\n {...props}\n isAuthenticated={isAuthenticated}\n modalDetails={this.state.modalDetails}\n voteAuraDetails={this.state.voteAuraDetails}\n voteActivityDetails={this.state.voteActivityDetails}\n isShowing={this.state.isModalShowing}\n openModal={this.openModalHandler}\n closeModal={this.closeModalHandler}\n openFeedback={this.openFeedbackhandler}\n handleAuraVote={this.handleAuraVote}\n handleActivityVote={this.handleActivityVote}\n likeBusiness={this.likeBusinessHandler}\n user={this.state.user}\n />\n )}\n />\n <Route path=\"/about\" component={About} />\n <Route path=\"/contact\" component={Contact} />\n <Route\n path=\"/login\"\n render={props => (\n <Login\n {...props}\n handleLogin={this.handleLogin}\n // handleSwitch={this.handleSwitchToSignup}\n />\n )}\n />\n <ProtectedRoute\n path=\"/dashboard\"\n isAuthenticated={isAuthenticated}\n user={user}\n component={Dashboard}\n modalDetails={this.state.modalDetails}\n isModalShowing={this.state.isModalShowing}\n openModal={this.openModalHandler}\n closeModal={this.closeModalHandler}\n logout={this.handleLogout}\n />\n <Route component={FourOhFour} />\n </Switch>\n <Footer />\n </BrowserRouter>\n );\n }", "render() {\n return (\n <div>\n <BrowserRouter>\n <div>\n <Route exact path=\"/\" component={Home} />\n </div>\n <div>\n <Route exact path=\"/employeesList\" component={Container} />\n </div>\n <div>\n <Route exact path=\"/salesList\" component={Sales} />\n </div>\n </BrowserRouter>\n </div>\n );\n }", "render () {\r\n const { authenticated } = this.state;\r\n return (\r\n <Router history={history}>\r\n <div>\r\n <Switch>\r\n <Route exact path=\"/\" render={() => (\r\n authenticated ? (<Redirect to=\"/rooms\"/> ) : ( <HomepageLayout />)\r\n )}\r\n />\r\n <Route exact path=\"/register\" render={() => (<Register history={history}/>)}/>\r\n <Route exact path=\"/login\" render={() => (<Login history={history} isAuthenticated={this.isAuthenticated} />)} />\r\n <Route exact path=\"/rooms\" component={Rooms} />\r\n <Route exact path=\"/rooms/:id\" component={Tasks} />\r\n <Route exact path=\"/tasks/:id\" component={Description} />\r\n <Route component={NoMatch} />\r\n </Switch>\r\n </div>\r\n </Router>\r\n );\r\n}", "render() {\n return (\n <Router>\n <Switch>\n <Route exact path='/service' component={ServiceAvailable}/>\n <Route exact path='/admin' component={Admin}/>\n <Route exact path='/adminlog' component={AdminFront}/>\n <Route exact path='/previousbooking' component={Previous}/>\n <Route exact path='/' component={Homei}/>\n <Route exact path='/404' component={ErrorPage}/>\n <Redirect to=\"/404\"/>\n </Switch>\n </Router>\n \n \n );\n }", "render() {\n return (\n <div className=\"App\">\n <Header clearListName={this.clearListName} />\n <Nav\n backendUrl={backendUrl}\n logings={this.logings}\n isLoggedIn={this.state.isLoggedIn}\n />\n <Switch>\n <Route exact path=\"/\">\n <Main userId={this.state.userId} />\n </Route>\n <Route path=\"/SelectStore\">\n <ListStore\n populateStore={this.populateStore}\n getListHeader={this.getListHeader}\n handleCreateListButton={this.handleCreateListButton}\n listName={this.state.listName}\n />\n </Route>\n <Route path=\"/CreateList\">\n <CreateList\n populateCategory={this.populateCategory}\n populateProduct={this.populateProduct}\n listHeader={this.state.listHeader}\n getProductsByStore={this.getProductsByStore}\n productsByStore={this.state.productsByStore}\n userId={this.state.userId}\n backendUrl={backendUrl}\n clearListName={this.clearListName}\n />\n </Route>\n {/*emdlr*/}\n <Route\n path={\"/user/:id\"}\n render={(routerProps) => (\n <User\n {...routerProps}\n backendUrl={backendUrl}\n logings={this.logings}\n isLoggedIn={this.state.isLoggedIn}\n />\n )}\n />\n </Switch>\n <Footer />\n </div>\n );\n }", "render() {\n return (\n <Router history={history}>\n <Header user={this.state.user} userType={this.state.userRole} loggedIn={this.state.loggedIn} updateUser={this.updateUser} logout={this.logout}/>\n <Switch>\n <Route\n exact path=\"/home\" \n render={() => <Home userType={this.state.userRole} user={this.state.user} />}\n />\n <Route exact path=\"/\"><Redirect to=\"/home\"/></Route>\n <Route path=\"/success\" render={() => <LoadingPaypal/>}/>\n <Route path=\"/failure\" render={() => <p>Payment failed.</p>}/>\n <Route exact path=\"/register\" render={() => <Register loggedIn={this.state.loggedIn}/>}/>\n <Route exact path=\"/login\" render={() => <Login setUserRole={this.setUserRole} loggedIn={this.state.loggedIn} login={this.login}/>}/>\n <AuthenticatedComponent verify={this.verify}>\n <Switch>\n <Route\n path=\"/users\"\n render={() => (\n <User\n loggedIn={this.state.loggedIn}\n user={this.state.user}\n logout={this.logout}\n />\n )}\n />\n <Route\n path=\"/vendors\"\n render={() => (\n <Vendor\n loggedIn={this.state.loggedIn}\n vendor={this.state.user}\n logout={this.logout}\n />\n )}\n />\n <Route path=\"/protected\" component={Protected} />\n <Route component={NotFound} />\n </Switch>\n </AuthenticatedComponent>\n </Switch>\n </Router>\n );\n }", "function App() {\n return (\n <>\n <Router>\n <Header />\n <Switch>\n <PrivateRoute path=\"/dashboard\" component={Dashboard} />\n <PrivateRoute path=\"/add-activity\" component={ActivityForm} />\n <PrivateRoute\n path=\"/update-activity/:id\"\n component={UpdateActivityForm}\n />\n\n <Route path=\"/sign-up\" component={Signup} />\n <Route exact path=\"/\" component={Login} />\n </Switch>\n </Router>\n </>\n );\n}", "render() {\n\t\treturn (\n\t\t\t<div className=\"App\">\n\t\t\t\t<h1>Hello</h1>\n\t\t\t\t<p>{this.state.username}</p>\n\t\t\t\t<button onClick={() => this.setState({ username: \"Vivek\" })}>Update</button>\n\t\t\t\t<Header />\n\n\t\t\t\t{/* Based on location particular component should render */}\n\t\t\t\t{/* {location === \"/\" && <Content />}\n\t\t\t{location === \"/about\" && <About />} */}\n\n\t\t\t\t{/* React Routing with Lazy Loading */}\n\t\t\t\t<Suspense fallback={<h1>Loading...</h1>}>\n\t\t\t\t\t<Switch>\n\t\t\t\t\t\t<Redirect from=\"/todoappv1\" to=\"/todoappv2\" />\n\t\t\t\t\t\t<Route path=\"/about\">\n\t\t\t\t\t\t\t<About />\n\t\t\t\t\t\t</Route>\n\t\t\t\t\t\t<Route path=\"/about-lazy-load\">\n\t\t\t\t\t\t\t<AboutLazyLoading />\n\t\t\t\t\t\t</Route>\n\t\t\t\t\t\t<Route path=\"/contact\">\n\t\t\t\t\t\t\t<Contact />\n\t\t\t\t\t\t</Route>\n\t\t\t\t\t\t<PrivateRoute path=\"/dashboard\" component={Dashboard} />\n\t\t\t\t\t\t<PrivateRoute path=\"/projects/:id\" component={Project} />\n\t\t\t\t\t\t<PrivateRoute path=\"/projects\" component={Projects} />\n\t\t\t\t\t\t<PrivateRoute path=\"/topics\" component={Topics} />\n\t\t\t\t\t\t<Route path=\"/login\">\n\t\t\t\t\t\t\t<Login />\n\t\t\t\t\t\t</Route>\n\t\t\t\t\t\t<PrivateRoute path=\"/menu\" component={SidebarExample} />\n\t\t\t\t\t\t<Route path=\"/logout\">\n\t\t\t\t\t\t\t<Redirect to=\"/login\" />\n\t\t\t\t\t\t</Route>\n\t\t\t\t\t\t<Route path=\"/\" exact>\n\t\t\t\t\t\t\t<Content />\n\t\t\t\t\t\t</Route>\n\t\t\t\t\t\t<Route path=\"*\">\n\t\t\t\t\t\t\t<h1>404 Not Found!</h1>\n\t\t\t\t\t\t</Route>\n\t\t\t\t\t</Switch>\n\t\t\t\t</Suspense>\n\t\t\t</div>\n\t\t);\n\t}", "function App() {\n return (\n <div className=\"App\">\n <Router>\n <NavBar/>\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/home\" component={Home} />\n <Route exact path=\"/products\" component={FetchProducts} />\n <Route exact path=\"/new\" component={CreateProduct} />\n \n </Switch>\n </Router>\n </div>\n );\n}", "render() {\n return (\n <Router>\n <>\n <Header />\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route\n exact\n path=\"/trials\"\n render={props => <Results {...props} userInfo={this.state.userInfo} />}\n />\n\n <Route\n path=\"/basic-info\"\n render={props => <BasicInfo {...props} onSubmit={this.handleSubmit} />}\n />\n <Route path=\"/trials/:trial\" component={SingleResult} />\n <Route path=\"/about\" component={About} />\n <Route path=\"/faq\" component={Faq} />\n <Route path=\"*\" component={NotFound} />\n </Switch>\n </>\n </Router>\n );\n }", "function AnyPage() {\n return (\n <BrowserRouter>\n <div>\n <Link to=\"/\">\n <button>VOLTAR</button>\n </Link>\n\n <h2>AnyPage</h2>\n <NavSide />\n <p>\n Cras facilisis urna ornare ex volutpat, et convallis erat elementum.\n Ut aliquam, ipsum vitae gravida suscipit, metus dui bibendum est, eget\n rhoncus nibh metus nec massa. Maecenas hendrerit laoreet augue nec\n molestie. Cum sociis natoque penatibus et magnis dis parturient\n montes, nascetur ridiculus mus.\n </p>\n\n <p>Duis a turpis sed lacus dapibus elementum sed eu lectus.</p>\n <main>\n <Switch>\n <Route path=\"/child\" component={Child} />\n {/* <Route path=\"/\" component={App} /> */}\n </Switch>\n </main>\n </div>\n </BrowserRouter>\n );\n}", "function App() {\n return (\n <Router>\n <Header />\n <main className=\"py-3\">\n <Container>\n\n <Route path='/' component={ HomeScreen } exact />\n <Route path='/signin' component={ SignInScreen } />\n <Route path='/signup' component={ SignUpScreen } />\n\n <Route path='/galleries' component={ GalleriesScreen } />\n {/*<Route path='/artists' component={ Galleries }/>*/}\n <Route path='/asset/:id' component={ AssetScreen } />\n\n <Route path='/gallery/:slug' component={ GalleryDetailScreen } />\n <Route path='/artist/:slug' component={ AssetDetail } />\n\n <Route path=':user/assets' component={ AssetDetail } />\n <Route path=':user/assets/create' component={ AssetDetail } />\n\n </Container>\n </main>\n <Footer />\n </Router>\n );\n}", "function App() {\n return <div ClassName=\"App\">\n <Route exact path=\"/\" component={Home} />\n <Route path=\"/projects\" component={Projects} />\n <Route path=\"/about\" component={About} />\n </div>;\n}", "function App() {\n return (\n <Router>\n <div>\n <Route path=\"/\" exact component={Vehicle} />\n <Route path=\"/create\" component={create} />\n {/* <Route path=\"/update\" component={updates} /> */}\n {<Route path = \"/update\" component={()=> <Updates title={\"\"}/> } />}\n {/* <Route path=\"/update\" render={(props)=> <updates text=\"HelloWorld\" {...props}/> } /> */}\n {/* <Route path=\"/delete\" component={deletes} /> */}\n </div>\n </Router>\n );\n}", "render() {\n return (\n <div className=\"App\"> \n <Router>\n\n <Route path=\"/\" exact>\n <Slideshowa/>\n </Route>\n <Route path=\"/signin\">\n <Signin></Signin>\n </Route>\n <Route path=\"/login\">\n <Login></Login>\n </Route>\n <Route path=\"/form\">\n <Form></Form>\n </Route>\n <Footer/>\n\n </Router> \n </div>\n )\n }", "render() {\n return (\n <div>\n <Router>\n <AuthProvider>\n <Navbar/>\n <Switch>\n <Route path=\"/signup\" component={Signup} />\n <Route path=\"/login\" component={Login} />\n <Route path='/' exact component={GoogleMap}/>\n {/* <Route path='/feed' component={Feed}/> */}\n <Route path='/about' component={About}/>\n </Switch>\n </AuthProvider>\n </Router>\n <p className=\"App-intro\">{this.state.apiResponse}</p>\n </div>\n );\n }", "render() {\n\n return (\n <Routes/> \n )\n }", "function App() {\n return (\n<Router>\n <Header />\n {/* <main \n className=\"py-3\"\n > */}\n {/* <Container> */}\n <Route path='/' component={Home} exact/>\n <Route path='/about' component={About} />\n <Route path='/skills' component={Skills} />\n <Route path='/works' component={Works} />\n <Route path='/contact' component={Contact} />\n {/* <Route path='/product/:id' component={ProductScreen} /> */}\n {/* </Container> */}\n {/* </main> */}\n {/* <Footer /> */}\n </Router> );\n}", "function App() {\n return (\n <Switch>\n <Route path='/code-page' component={CodePage} />\n <Route path='/color-guess' component={ColorGuess} />\n <Route path='/js-games' component={Games} />\n <Route path='/game-page' component={GamePage} />\n <Route path='/snake' component={SnakeGame} />\n <Route path='/' component={Home} />\n\n {/* <Route path='todo-functionality' component={TodoFunctionality} /> */}\n {/* <Route path='/aboutus' component={MenuHome} /> */}\n {/* <Route path='/menu-home' component={MenuHome} /> */}\n </Switch>\n );\n}", "function Routes(){\n return(\n <Switch>\n <Route path='/login' component={Login}/>\n <Route path='/forgotPassword' component={Login}/>\n <Route path='/newUser' component={NewUser}/>\n <Route path='/forgotPassword' component={ForgotPassword}/>\n <Route path='/vogais' component={HomeVogais} />\n \n <Route path='/telaE' component={TelaE} />\n <Route path='/telaI' component={TelaI} />\n <Route path='/telaO' component={TelaO} />\n <Route path='/telaU' component={TelaU} />\n\n <Route path='/clickImageA' component={ClickImageA} />\n <Route path='/clickImageE' component={ClickImageE} />\n <Route path='/clickImageI' component={ClickImageI} />\n <Route path='/clickImageO' component={ClickImageO} />\n <Route path='/clickImageU' component={ClickImageU} /> \n <Route path='/clickImageAO' component={ClickImageAO} />\n <Route path='/clickImageF' component={ClickImageF} />\n <Route path='/clickImageJ' component={ClickImageJ} />\n <Route path='/clickImageM' component={ClickImageM} />\n \n <Route path='/cloudA' component={CloudA} />\n <Route path='/cloudE' component={CloudE} /> \n <Route path='/cloudI' component={CloudI} /> \n <Route path='/cloudO' component={CloudO} /> \n <Route path='/cloudU' component={CloudU} /> \n\n <Route path='/clickLetterA' component={ClickLetterA} /> \n <Route path='/clickLetterE' component={ClickLetterE} />\n <Route path='/clickLetterI' component={ClickLetterI} />\n <Route path='/clickLetterO' component={ClickLetterO} />\n <Route path='/clickLetterU' component={ClickLetterU} />\n <Route path='/clickWordsF' component={ClickWordsF} />\n <Route path='/clickWordsJ' component={ClickWordsJ} />\n <Route path='/clickWordsM' component={ClickWordsM} />\n\n <Route path='/typeLetterA' component={TypeLetterA} />\n <Route path='/typeLetterE' component={TypeLetterE} />\n <Route path='/typeLetterI' component={TypeLetterI} />\n <Route path='/typeLetterO' component={TypeLetterO} />\n <Route path='/typeLetterU' component={TypeLetterU} />\n <Route path='/typeLetterAO' component={TypeLetterAO} />\n\n <Route path='/typeConsonantsF' component={TypeConsonantsF} />\n <Route path='/typeConsonantsJ' component={TypeConsonantsJ} />\n <Route path='/typeConsonantsM' component={TypeConsonantsM} />\n\n <Route path='/testVowels' component={TestVowels} />\n <Route path='/testFJM' component={TestFJM} />\n {/* <Route path='/testReadFJM' component={TestReadFJM} /> */}\n \n <Route path='/consonants' component={HomeConsonants} />\n <Route path='/fMenu' component={fMenu} />\n <Route path='/jMenu' component={jMenu} />\n <Route path='/mMenu' component={mMenu} />\n <Route path='/nMenu' component={nMenu} />\n \n <Route path='/readF' component={ReadF} />\n <Route path='/readJ' component={ReadJ} />\n <Route path='/readM' component={ReadM} />\n\n <Route path='/' component={Home} />\n </Switch> \n ); \n}", "function App() {\n return (\n <Router>\n <div className=\"container\">\n <Navbar />\n <br/>\n <Route path=\"/\" exact component={TodoList} />\n <Route path=\"/edit/:id\" component={EditTodo} />\n <Route path=\"/create\" component={CreateTodo} />\n </div>\n </Router>\n );\n}", "function App() {\n return (\n <div className={'container'}>\n <Router>\n <Switch>\n <Route exact path=\"/\" component={Signup} />\n <Route exact path=\"/login\" component={Login} />\n <Route exact path=\"/story/:StoryId\" component={ReadStory} />\n <Route eaxt path=\"/storiesList\" component={StoriesCollection} />\n <Redirect to={'/'} />\n </Switch>\n </Router>\n </div>\n\n );\n}", "render() {\n return (\n <div className=\"Routes\">\n <Switch>\n <Route exact path=\"/\" \n render={() => \n <PostList />} />\n \n <Route exact path=\"/new\" \n render={(rtProps) => \n <NewPostForm { ...rtProps } />} />\n \n <Route exact path=\"/:postId\" \n render={(rtProps) => \n <PostDetail { ...rtProps }\n postId = { rtProps.match.params.postId }/>} /> \n\n <Redirect to=\"/\" />\n </Switch>\n </div>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Switch>\n <Route path=\"/\">\n <AuthDashboard />\n </Route>\n </Switch>\n </Router>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"container\">\n <Router>\n <Header />\n <Switch>\n {/* <Route exact path=\"/\" component ={Login}/> */}\n <Route exact path=\"/\" component={HeroListing}/>\n <Route exact path=\"/hero/:heroId\" component={HeroDetail}/>\n <Route exact path=\"/team\" component={Team}/>\n <Route>404 not found!</Route>\n </Switch>\n </Router>\n </div>\n );}", "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Route path='/' exact component={OverviewDashboard} />\n <Route path='/overview' exact component={OverviewDashboard} />\n </Router>\n </div>\n );\n}", "function App() {\n let routes = (\n <Switch>\n <Route exact path=\"/\" component={Dashboard} />\n {/* <Route path=\"/sign-up\" component={SignUp} />\n <Route path=\"/sign-in\" component={SignIn} />\n <Route path=\"/hall/:hall_id\" component={Hall} />\n <Route path=\"/statistics\" component={Statistics} /> */}\n </Switch>\n )\n return (\n <div>\n {routes}\n </div>\n );\n}", "function App() {\n return (\n\n <div className=\"App\">\n <Router>\n <AppRoutes />\n </Router>\n </div>\n\n );\n}", "render()\n\t{\n\t\treturn (\n\t\t\t <Router>\n\t\t\t\t <Switch>\n\t\t\t\t\t <Route path=\"/Search\">\n\t\t\t\t\t\t <Header/>\n\t\t\t\t\t\t <Search loggedin={this.state.loggedin}/>\n\t\t\t\t\t </Route>\n\t\t\t\t\t <Route path=\"/LogIn\"> \n\t\t\t\t\t\t <Header/>\n\t\t\t\t\t\t <LogInApp handle_login={this.handle_login}/> \n\t\t\t\t\t </Route>\n\t\t\t\t\t <Route path=\"/LogOut\"> \n\t\t\t\t\t\t <Header/>\n\t\t\t\t\t\t <LogOutApp handle_logout={this.handle_logout}/> \n\t\t\t\t\t </Route>\n\t\t\t\t\t <Route path=\"/\">\n\t\t\t\t\t\t <Header/>\n\t\t\t\t\t\t <Home/>\n\t\t\t\t\t </Route>\n\t\t\t\t </Switch>\n\t\t\t </Router>\n\t\t);\n\t}", "render() {\n return (\n \n <React.Fragment>\n <NavigationBar/>\n <Wrapper>\n <Router>\n <Switch>\n <Route exact path =\"/\" component = {Home} />\n <Route exact path =\"/SignIn\" component = {ExistingUser} />\n <Route exact path = \"/SignUp\" component = {NewUser}/>\n <Route exact path =\"/Matches\" component = {Gallery} />\n <Route exact path =\"/About\" component = {About} />\n <Route exact path =\"/Contact\" component = {Contact} />\n <Route component= {NoMatch} />\n </Switch>\n </Router>\n </Wrapper>\n </React.Fragment>\n \n );\n }", "function Routing() {\r\n return (\r\n <>\r\n <Router>\r\n <Nav />\r\n <Switch>\r\n <Route path='/' exact component={Dashboard} />\r\n <Route path='/reports' exact component={Reports} />\r\n <Route path='/products' exact component={Product} />\r\n <Route path='/services' exact component={Services}/>\r\n <Route path='/dashboard/users' exact component={User}/>\r\n <Route path='/dashboard/revenue' exact component={Revenue}/>\r\n <Route path='/products/mens' exact component={Mens}/>\r\n <Route path='/products/womens' exact component={Womens}/>\r\n <Route path='/reports/report1' exact component={Report1}/>\r\n </Switch>\r\n </Router>\r\n </>\r\n );\r\n}", "function App() {\n return (\n <div> \n <Routes />\n </div>);\n}", "function App() {\n return (\n <BrowserRouter>\n <Switch>\n <Route component={Login} exact path=\"/\" />\n <Route component={Register} path=\"/register\" />\n <Route component={Login} path=\"/login\" />\n <Route component={Home} path=\"/home\" />\n <Route component={HooksC} path=\"/hooks\" />\n <Route component={HooksC2} path=\"/hook2\" />\n <Route component={test} path=\"/test\" />\n {/* <Route component={ReduxPage} path=\"/ReduxPage\" /> */}\n <Route component={ReduxPage2} path=\"/ReduxPage2\" />\n <Route component={FormRender} path=\"/FormRender\" />\n {/* <Route component={MyProgress} path=\"/progress\" /> */}\n {/* <Route component={New} path=\"/new\" /> */}\n {/* <Route component={About} path=\"/about\" /> */}\n </Switch>\n </BrowserRouter>\n );\n}", "function App() {\n return (\n <div className='app-container'>\n <NavBar />\n <BufferDiv />\n <Header />\n <div className='components-container' >\n <Route exact path='/' render={props => (<Carousel {...props} />)} />\n <Route exact path='/shop' render={props => (<Shop {...props} items={items} />)} />\n <Route path='/shop/:id' render={props => (<Contact {...props} items={items} />)} />\n <Route path='/follow' render={props => (<Follow {...props} />)} />\n </div>\n <Footer />\n </div>\n );\n}", "function App() {\n return (\n <Router>\n <Header/>\n <Switch>\n <Route path={'/'} exact component={Home}/>\n <Route path={'/about'} component={About}/>\n <Route path={'/project'} component={Project}/>\n <Route component={(props) => <div>404 Not found</div>}/>\n {/*<Route path={'/project/:id'} component={ProjectDetails}/>*/}\n </Switch>\n </Router>\n );\n}", "render() {\n return (\n <Router>\n <div className='App'>\n <Route path='/' exact component={Header} />\n <Route\n path='/results'\n exact\n render={() => {\n return (\n <Results\n userSearchResult={this.state.searchResults}\n onFilterSubmit={this.onFilterSubmit}\n />\n );\n }}\n />\n <Route path='/movies/:movieId' component={MoreInfo} />\n <Route path='/lists' exact component={ListPage} />\n <Route path='/lists/:listName' component={SpecificList} />\n </div>\n </Router>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n <div>\n <Switch>\n <Route exact path=\"/\" render={() => <MainPage />} />\n {/* <Route exact path=\"/\" render={() => <Home />} /> */}\n\n {/* <Route\n exact\n path=\"/:id\"\n render={(props) => <SingleProject {...props} />}\n /> */}\n </Switch>\n </div>\n <footer>\n &copy;2020 developed by Katerina Matveeva\n <div> Enthusiastic and Passionate about what I do</div>\n </footer>\n </div>\n );\n}", "function App() {\n return (\n // React Router used for correct routing of components and dynamic routing\n <Router>\n <div className=\"App\">\n <Nav />\n <Switch>\n <Route path=\"/airports\" exact component={airports} />\n <Route path=\"/airlines\" exact component={Airlines} />\n <Route path=\"/airports/:id\" component={itemDetail} />\n <Route path=\"/airlines/:id\" exact component={airlineDetails} />\n <Route path=\"/news/:id\" component={News} />\n <Route path=\"/advisory/:countryCode\" component={Advisory} />\n <Route path=\"/arrivals\" component={Arrivals} />\n <Route path=\"/covidDetail/:countryName\" component={CovidDetail} />\n <Route path=\"/ER\" component={ER} />\n <Route component={homePage} />\n </Switch>\n </div>\n {/* Div below acts a footer */}\n <div className=\"App\">\n <p>\n <b>Developed by Jaykumar Halpati</b>\n </p>\n <footer />\n </div>\n </Router>\n );\n}", "function App() {\n return (\n <>\n <Nav/>\n <Router>\n <Home path=\"/\"/>\n <RepoHome path=\"search-repo\"/>\n </Router>\n </>\n );\n}", "function App() {\n return (\n <Router>\n <Switch>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route path=\"/booking\">\n <Booking />\n </Route>\n {/* <Route path=\"/bookingconfirmation\">\n <BookingConfirmation />\n </Route> */}\n </Switch>\n </Router>\n );\n}", "render(){\n return (\n <Router>\n <main>\n <Header/>\n <Switch>\n <Route path=\"/home\" render={ (props) => <Home {...props} /> } />\n <Route path=\"/register\" render={ (props) => <Register {...props} setUserInfo={this.setUserInfo} /> } />\n <Route path=\"/login\" render={ (props) => <Login {...props} setUserInfo={this.setUserInfo} /> } />\n <Route path=\"/index\" component={ CountrySearch } />\n \n </Switch>\n </main>\n </Router>\n );\n }", "function App() {\n return (\n <Router> \n \n <div className=\"container\">\n<Topbar/>\n<Sidebar/> \n <Switch>\n <Route path='/dashboard' >\n <Home/>\n </Route> \n <Route path='/post'>\n <Post/>\n </Route>\n <Route path='/newpost'>\n <NewPost/>\n </Route> \n <Route path='/table'>\n <Formtable/>\n </Route> \n <Route path='/error'>\n <Error/>\n </Route> \n <Route path='/profile'>\n <Profile/>\n </Route> \n </Switch> \n</div>\n<Footer />\n </Router>\n );\n}" ]
[ "0.7471299", "0.72514266", "0.71519035", "0.71105695", "0.71049553", "0.7076688", "0.7071293", "0.70368457", "0.7021053", "0.7019338", "0.7004927", "0.7000449", "0.6998639", "0.6987305", "0.6979963", "0.6944773", "0.6943733", "0.69436044", "0.69263834", "0.69157463", "0.69075525", "0.688303", "0.68798983", "0.6875616", "0.68631744", "0.685893", "0.6856299", "0.68532217", "0.6852259", "0.6851933", "0.6850462", "0.68496996", "0.6834166", "0.68337446", "0.68329996", "0.68276614", "0.68259937", "0.6818052", "0.6815262", "0.68136746", "0.6807711", "0.6795543", "0.6785424", "0.67828137", "0.6780692", "0.67795384", "0.6778591", "0.6778498", "0.6773556", "0.6769563", "0.6767479", "0.67583513", "0.6758191", "0.6756734", "0.6756218", "0.67527944", "0.6748575", "0.6743788", "0.67418796", "0.67368937", "0.6729219", "0.6728847", "0.67279154", "0.67270756", "0.672656", "0.67252433", "0.67235553", "0.6718969", "0.6717476", "0.67169183", "0.6712095", "0.6711437", "0.6710339", "0.67064744", "0.67060524", "0.6704321", "0.6703924", "0.66998327", "0.6698947", "0.66940284", "0.66935974", "0.6690353", "0.6688894", "0.66888916", "0.6684573", "0.6684191", "0.66826665", "0.6679971", "0.6671343", "0.6669102", "0.66684973", "0.6664181", "0.6663589", "0.66632324", "0.6662803", "0.6661386", "0.6661181", "0.66603196", "0.6657735", "0.66567993", "0.66566634" ]
0.0
-1
Component representing the full Home Page
function HomePage() { let baseUri = "https://cors-anywhere.gradyt.com/https://covercovid-19.com/saved?"; const savedLocations = JSON.parse(localStorage.getItem("counties")); document.title = "BaseCheck"; // Track the previous URL accessed let prevUrl = useLocation().pathname; localStorage.setItem("prevUrl", prevUrl); if (savedLocations) { savedLocations.map((id) => { return baseUri += "ids[]=" + id + "&"; }); } baseUri = baseUri.slice(0, -1); const [counties, setCounties] = useState([]); const [loaded, setLoaded] = useState(false); useEffect(() => { fetch(baseUri, { method: 'GET', mode: 'cors', cache: 'default', headers: { 'Access-Control-Allow-Origin': '*', 'Origin': 'http://localhost:3000' } }) .then((response) => response.json()) .then((responseData) => { setCounties(responseData); }) .then(() => { setLoaded(true); }) .catch((err) => { console.log(err); }); }, []); // If there are locations saved, will load the savedCounties on the Home Page Dashboard // If not, will inform the user that there are no saved locations. if (savedLocations && savedLocations.length > 0) { return ( <main className="home-page"> <SearchBar/> <UsDashboard/> {loaded ? <SavedCardList counties={counties}/> : <div className="margin-top"><Ring/></div>} </main> ); } else { return ( <main className="home-page"> <SearchBar/> <UsDashboard/> <div className="empty-list"> <h2>No Saved Locations</h2> </div> </main> ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "function Home() {\n return(\n <div>\n <Navbar></Navbar>\n\n <h1>temporary homepage</h1>\n\n {/* add link to other pages here for now */}\n <a href=\"/ticket\">ticket</a>\n <br/>\n <a href=\"/enclosure\">enclosure</a>\n <br/>\n\n\n </div>\n \n ); \n}", "getHomePage() {\n return <Home\n isNewAccount={this.state.isNewAccount}\n client={this.props.client}\n searchQuery={this.state.searchQuery}\n />;\n }", "function displayHome(ctx) {\n if (!auth.isAuth()) {\n ctx.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs',\n loginForm: './templates/forms/loginForm.hbs',\n registerForm: './templates/forms/registerForm.hbs'\n }).then(function () {\n this.partial('./templates/welcome.hbs');\n })\n } else {\n ctx.redirect('#/catalog');\n }\n }", "function Home(path, layContent) {\n //Get page states.\n this.IsVisible = function() {\n return lay.IsVisible()\n }\n this.IsChanged = function() {\n return false\n }\n\n //Show or hide this page.\n this.Show = function(show) {\n\n layMain.Show();\n if (show) {\n lay.Animate(\"FadeIn\");\n } else {\n lay.Animate(\"FadeOut\");\n }\n }\n\n //Create layout for app controls.\n lay = app.CreateLayout(\"Linear\", \"FillXY,VCenter\");\n lay.SetPadding(0, 0, 0, 0.04);\n lay.Hide();\n layScroll = app.CreateScroller(1, 1);\n layContent.AddChild(layScroll);\n layScroll.AddChild(lay);\n\n //Add a logo.\n var img = app.CreateImage(\"Img/Heroes Evolved Bugs.png\", 0.25);\n lay.AddChild(img);\n\n //Create a text with formatting.\n txt = app.CreateText(text, 1, 1, \"Html,bold,Link\");\n txt.SetPadding(0.03, 0.03, 0.03, 0.03);\n txt.SetTextSize(18);\n\n lay.AddChild(txt);\n}", "function HomeContent() {}", "function renderHome(){\n \n const content = document.getElementById('tab-content');\n content.classList.add('flex-lay');\n content.classList.remove('grid-lay');\n \n content.textContent = '';\n \n const aboutSection = createAboutSection();\n \n setBtnActive('home');\n \n content.appendChild(aboutSection);\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\treturn (\n\t\t<div className=\"text-center\">\n\t\t\t<Header />\n\t\t\t<img src=\"/static/okane.png\" alt=\"my image\" />\n\t\t\t<p className=\"text-center\">歡迎使用匯率計算機</p>\n\t\t</div>\n\t)\n}", "function renderHomePage() {\n var items = $('.cvt-report li');\n if (items) {\n items.remove();\n }\n \n var page = $('.home');\n page.addClass('visible');\n }", "function Home(props){\n\n\treturn(\n\t\t<div>\n\t\t\t<h1>This is the Home Page of {props.route.name}</h1>\n\t\t\t<p>\n\t\t\t\tHELLOOOEEOOEEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO\n \t</p>\n </div>\n\t)\n}", "function Home(){\n return (<h2>这是主页页面</h2>)\n}", "function Home(){\n return <body>\n <div>\n <Logotipo />\n <p></p>\n <Contador />\n <p></p>\n <Link href=\"/sobre\">\n <a>Sobre</a>\n </Link>\n <p></p>\n <div>\n <Link href=\"/tempo\">\n <a>Tempo</a>\n </Link>\n </div>\n\n </div>\n\n <footer>\n <p> Em desenvolvimento ~ by JC</p>\n <a href=\"http://www.fip.com.br\" target=\"blank\">fip.com.br</a>\n </footer>\n\n </body>\n}", "function App() {\n // this.state = { homeShow: true };\n\n\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n\n <MainHome />\n\n\n <h2 className=\"headerFooter\">Sarah Lois Thompson\n </h2>\n\n </header>\n </div>\n );\n}", "function HomeView()\n{\n\n\n return (\n <div>\n <div className=\"mainPage row\" >\n <h1 className=\"text-center col-12 align-self-center\">Partnering with employees and employers to match them according to\n their preferences since 2020</h1>\n </div>\n </div>\n );\n}", "function showHomePage(page_name) {\n var root = $('<div>').addClass(_classes[page_name]).height(window.innerHeight);\n\n /* Title */\n //$('<figure>').append($('<img>').attr('src', 'resources/images/splash_title.png')).appendTo(root);\n /* Landing Logo */\n $('<div>').addClass('landing-logo fadeMe').appendTo(root).attr(\"style\", \"display:none\");\n /* Bottom */\n var qLandingBottom = $('<div>').addClass('landing-bottom fadeMe').attr(\"style\", \"display:none\").append($('<span>').html('Loading...'));\n qLandingBottom.appendTo(root);\n /* Loading Image */\n //$('<div>').addClass('landing-loader').append($('<img>').attr('src', 'resources/images/landig_loader.png')).appendTo(qLandingBottom);\n\n /* Google Anlytics */\n ga('send', 'screenview', {'screenName': 'Home'});\n\n return root;\n }", "function Home() {\n \n return (\n <div>\n <h1>Home</h1>\n </div>\n );\n}", "function showHome(request){\n\trequest.respond(\"This is the home page.\");\n}", "function Home () {\n return (\n\t\t<body className=\"Home\">\n\n\t\t\t<div className=\"home-grid\">\n\t\t\t\t<div banner__text>\n\t\t\t\t\t<h1 className=\"banner__text--main\">\n\t\t\t\t\t\t<span>Victory Esim</span>\n\t\t\t\t\t</h1>\n\t\t\t\t\t<h1 className=\"banner__text--sub\">\n\t\t\t\t\t\t<span className=\"banner__text--sub-1\">Developer </span>\n\t\t\t\t\t\t<span className=\"banner__text--sub-2\"> + </span>\n\t\t\t\t\t\t<span className=\"banner__text--sub-3\"> Designer</span>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t{/*----------Clicking on this should link to resume page-----------*/}\n\t\t\t\t\t{/*<a href=\"components/resume.js\" class=\"btn btn--white btn--animated\">View My Resume</a>*/}\n\t\t\t\t\t<Link to=\"/resume\" className=\"btn btn--white btn--animated\">View My Resume</Link>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"social-links\">\n\t\t\t\t\t{/*LinkedIn*/}\n\t\t\t\t\t<a href=\"https://www.linkedin.com/feed/\" rel=\"noopener noreferrer\" target=\"_blank\">\n\t\t\t\t\t\t<i className=\"fa fa-linkedin-square\" aria-hidden=\"true\" />\n\t\t\t\t\t</a>\n\n\t\t\t\t\t{/*Github*/}\n\t\t\t\t\t<a href=\"https://github.com/OhVickie?tab=repositories\" rel=\"noopener noreferrer\" target=\"_blank\">\n\t\t\t\t\t\t<i className=\"fa fa-github-square\" aria-hidden=\"true\" />\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\n\t\t\t</div>\n\n\t\t</body>\n );\n}", "function Home() {\n return (\n <div>\n <h1>Home</h1>\n </div>\n );\n}", "function renderHomePage(context) {\n ctxHandler(context);\n\n this.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs',\n login: './templates/welcome/login.hbs',\n register: './templates/welcome/register.hbs',\n }).then(function () {\n this.partial('./templates/welcome/welcome.hbs');\n })\n }", "function home() {\n\t\t\tself.searchText('');\n\t\t\tconfigData.page = 1;\n\t\t\tgetPhotos();\n\t\t}", "function loadHome() {\n\tapp.innerHTML = nav + homepage;\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}", "home() {\n if (this.isHomePrivate) {\n return (\n <PrivateRoute exact path={this.homePath}>\n {this.homeInstance.render()}\n </PrivateRoute>\n );\n }\n return (\n <Route exact path={this.homePath}>\n {this.homeInstance.render()}\n </Route>\n );\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}", "@appRoute(\"(/)\")\n startIndexRoute () {\n System.import(\"../views/home\").then(View => App.getContentContainer().show(new View.default()) );\n }", "function showHomePage() {\n $('#greet-user').text('Bookmarks');\n $('#logout-button').hide();\n $('#login-div').show();\n $('#register-div').hide();\n $('#bookmarks-view').hide();\n }", "function Homepage() {\r\n\r\n return (\r\n <div className='Homepage'>\r\n <div className='container text-center'>\r\n <h1>Pirate Chicks Vintage</h1>\r\n <p>Welcome to Our Vintage Treasure Chest!</p>\r\n </div>\r\n </div>\r\n )\r\n}", "render() {\n\t\t// preserve context\n\t\tconst _this = this;\n\t\t\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<AppHeader links={_this.state.links} />\n\n\t\t\t\t<Switch>\n\t\t\t\t\t<Route exact path=\"/\" component={Home} />\n\t\t\t\t\t<Route path=\"/datagrid\" component={DataGrid} />\n\t\t\t\t\t<Route path=\"/form\" component={Form} />\n\t\t\t\t\t<Route component={NoRoute} />\n\t\t\t\t</Switch>\n\t\t\t</div>\n\t\t);\n\t}", "function home(req,res){\n query.getAll().then(function(resultat,err){\n if(err) throw err;\n res.render('home', {home:resultat});\n });\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 Home() {\n return (\n <div className=\"home\">\n <div className=\"home-background\">\n <div>\n <img src={RBC} className='home-img'/>\n </div>\n <div className=\"home-set\">\n <div className=\"home-title\">\n You've graduated, now what?\n </div>\n\n <div className=\"home-description\">\n Tell us a bit about yourself and your financial goals, and we'll tell you how to get there!\n </div>\n </div>\n \n <div>\n <Link to='/situation'>\n <button className='home-next'>\n <div className='home-next-text'>\n Let's go!\n </div>\n </button>\n </Link>\n </div>\n </div>\n </div>\n )\n}", "function home() {\n return (\n <div>\n \n </div>\n )\n}", "function drawHomePage(req, res) {\n var db = req.db;\n var collection = db.get('pageContent');\n\n var data = collection.find({}, {}, function(e, docs) {\n var homeIntro = docs[0].homeIntro;\n var homeTitle = docs[0].homeTitle;\n var usrname = loggedInUser(req);\n\n if (usrname) {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Logout',\n username: usrname });\n }\n else {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Login',\n username: usrname });\n }\n });\n}", "function createHomePage() {\n // Ensures that the choices are hidden\n btnGroup.addClass(\"hide\");\n\n // Hides the home button\n homeBtn.addClass(\"hide\");\n\n // Unhides the highscores button\n highscoresBtn.removeClass(\"hide\");\n\n // Changes header\n $(\"#header\").text(\"Coding Quiz Challenge\");\n\n // Empties content element\n contentEl.empty();\n\n // Creates paragraph element\n var introParagraph = $(\"<p>\").addClass(\"intro-paragraph\");\n\n // Adds text to paragraph element\n introParagraph.text(\"Try to answer the following code-related question within the time limit. Keep in mind that incorrect answers will penalize your score/time by ten seconds!\");\n\n // Creates start button element\n var startButton = $(\"<button>\").addClass(\"start-button\");\n\n // Adds text to start button element\n startButton.text(\"Start\");\n\n // Appends both elements to the content div\n contentEl.append(introParagraph);\n contentEl.append(startButton);\n }", "function home(req, res) {\n return res.render('index', {\n ENV: JSON.stringify(ENV), // pass environment variables to html\n title: 'Hack University',\n page: 'home',\n url: `${HOST}`,\n layout: 'layout' // change layout\n });\n}", "_homeRoute () {\n this.currentView = views.HOME\n }", "function Index() {\n return <Homepage />;\n}", "function Homepage() {\n return (\n <div >\n <Navbar />\n <Entryform />\n <Displayform />\n </div>\n )\n}", "function pageHome(request, response) {\r\n response.send('<h1>Welcome to Phonebook</h1>')\r\n}", "function Home() {\n return (\n <div className=\"pageContent\">\n <h2>Home</h2>\n </div>\n );\n}", "function HomePanel() {\n Panel.call(this, $('<section class=\"home container-fluid\">'\n +'<div class=\"row\">'\n + '<div class=\"col-6 sm-col-4 margin-top\">'\n + '<h3>Welcome, <span></span>!</h3>'\n + '</div>'\n + '<div class=\"col-4 sm-col-4 text-right\">'\n + '<button class=\"btn btn-xs margin-top margin-bottom\">Logout</button>'\n + '</div>'\n +'</div>'\n +'</section>'));\n\n var $container = this.$element;\n\n var $title = $container.find('h3');\n\n var $div = $container.children('div');\n\n var $userSpan = $title.find('span');\n this.__$userSpan__ = $userSpan;\n\n var $logoutButton = $container.find('button');\n $div.append($logoutButton);\n this.__$logoutButton__ = $logoutButton;\n}", "function Home() {\n return (\n <Fragment> {/* Using it because id of this tag will be 'root'. So adding title to the game will be easier hear. */}\n <Helmet> {/* Using for custom font stylr for title of the app. */}\n <title>\n Quiz App - Home\n </title>\n </Helmet>\n <div id='home'>\n <section>\n <div style={{textAlign: 'center'}}>\n <span>\n <CubeOutlineIcon className=\"cube\" size={96}/>\n </span>\n </div>\n <h1>Quiz App</h1>\n <div className=\"play-button-container\">\n <ul>\n <li>\n <Link className=\"play-button\" to=\"/play/quiz\">Play</Link>\n </li>\n </ul>\n </div>\n <div className=\"auth-container\">\n <Link to=\"/login\" className=\"auth-buttons\" id=\"login-button\">Login</Link>\n <Link to=\"/register\" className=\"auth-buttons\" id=\"signup-button\">Register</Link>\n </div>\n </section> \n </div>\n </Fragment>\n \n )\n}", "function Home(props) {\n return (\n <Card title=\"Home page\" level={3}>\n <p>Please go to the Jobs section.</p>\n </Card>\n );\n}", "function Homepage() {\n return (\n <div className=\"Home\">\n \n <Hero />\n <Featured />\n <Footer />\n </div>\n );\n}", "function HomeCtrl () {\n const app = this;\n app.stats = {};\n app.nodeDiscovery = false;\n app.message = '';\n\n }", "function Home() {\n return (\n <div className=\"App\">\n <ul>\n <li>\n <Link to=\"/\">Home</Link>\n </li>\n <li>\n <Link to=\"/play\">Play</Link>\n </li>\n </ul>\n <header className=\"App-header\">\n <div style={{ width: '80%' }}>\n <TopBarGame userDetails={['Reeve', 'Civilian']} showTimer showRole />\n <GameEnv />\n <BottomBar />\n </div>\n </header>\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}", "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}", "render() {\n return (\n <h1>This is a placeholder for another page</h1>\n )\n }", "render() {\n return (\n <div id=\"body\">\n <Header\n currentPage={this.state.currentPage}\n handleLink={this.handleLink}\n />\n <div>\n <Route exact path=\"/\">\n <HomeNav\n handleNavLink={this.handleNavLink}\n leaveHome={this.state.leaveHome}\n />\n </Route>\n <Route path=\"/about\">\n <About animationClass=\"animate-div-load\" />\n </Route>\n <Route path=\"/code\">\n <Code animationClass=\"animate-div-load\" />\n </Route>\n <Route path=\"/art\">\n <Art animationClass=\"animate-div-load\" />\n </Route>\n <Route path=\"/blog\">\n <Blog animationClass=\"animate-div-load\" />\n </Route>\n <Route path=\"/contact\">\n <Contact animationClass=\"animate-div-load\" />\n </Route>\n </div>\n </div>\n );\n }", "function HomeScreen() {\n return (\n <div className=\"App\">\n\n <TeQuestHeader></TeQuestHeader>\n \n <MyCarousel></MyCarousel>\n\n <BoxLabelsPart></BoxLabelsPart>\n\n <CallForAction></CallForAction>\n\n <FeaturedSPs></FeaturedSPs>\n\n <NewsletterSubscribe></NewsletterSubscribe>\n\n <FooterMenuItems></FooterMenuItems>\n </div>\n );\n}", "function Home() {\n \n return (\n <section>\n <Hero/>\n <Categories/>\n <Recomendaciones/>\n <Descuentos/>\n </section>\n )\n}", "function Home() {\n return (\n <p> This is the Home Page. This route is not protected. </p>\n );\n}", "@action route() {\n this.currentPage = Home\n }", "function loadHomePage(){\n\tloadNavbar();\n\tloadJumbotron();\n\tgenerateCarousels();\t\n}", "function loadHome() {\r\n hideall();\r\n\r\n var top = document.getElementById(\"Welcome\");\r\n\r\n top.innerHTML=(\"Weclome Home \" + user);\r\n \r\n $(\"#home\").show();\r\n $(\"#sidebar\").show();\r\n deactiveAll();\r\n $(\"#side-home\").addClass(\"active\");\r\n $(\"#navbar\").show();\r\n\r\n // Additonal calls \r\n clearCalendar();\r\n makeCalander();\r\n}", "function Home(){\n return(\n <>\n <MainFrame />\n <Cards />\n {/* <Footer /> */}\n </>\n )\n}", "function displayHome() {\n\tvar message = HomeServices.generateHome();\n\tdisplay = document.getElementById(\"displayWindow\");\n\tif(message) {\n\t\tdisplay.innerHTML = message;\n\t}\n\telse {\n\t\tdisplay.innerHTML = \"<h1>The 'generate home' message returned was NULL</h1>\";\n\t}\n\n\t$('#displayWindow').trigger(\"create\");\n}", "function App() {\n return (\n<div>\n\n<Homepage />\n\n</div>\n\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}", "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 Home() {\n //create an if statement to check if on the landing page or not\n return (\n <div>\n <h2>Biz Wiz</h2>\n <h3>For Small Businesses</h3>\n <div>\n <Router>\n <Navbar bg=\"light\" expand=\"lg\">\n <Navbar.Brand href=\"#home\">Biz Wiz</Navbar.Brand>\n <Navbar.Toggle aria-controls=\"basic-navbar-nav\" />\n <Navbar.Collapse id=\"basic-navbar-nav\">\n <Nav className=\"mr-auto\">\n <Nav.Link href=\"#home\"><Link to=\"/SearchBusinesses\">Search for Businesses</Link></Nav.Link>\n </Nav>\n </Navbar.Collapse>\n </Navbar>\n <Switch>\n <Route path=\"/SearchBusinesses\"><SearchBusiness /></Route>\n </Switch>\n </Router>\n </div>\n </div>\n );\n }", "function Home(homeService, MenuService) {\n\t\t/*jshint validthis: true */\n\t\tvar vm = this;\n\t\tvm.title = \"GitHub Analysis\";\n\t\tvm.version = \"1.0.0\";\n\t\tvm.listFeatures = homeService.getFeaturesList();\n\t\tvm.menu = MenuService.listMenu();\n\n\t\tinitThemeJs();\n\t}", "function Home() {\n\n\n \n\n return (\n <div>\n <Navbar/>\n <h1>THIS IS MY HOME</h1>\n {/* <Cities/> */}\n <div className=\"homeContainer\">\n <Feed/> \n </div>\n </div>\n );\n}", "function Home(props) {\n return <h1>Home</h1>;\n}", "function homeController()\r\n {\r\n var self = this;\r\n }", "render() {\n return (\n <div class=\"home-container\">\n <div>Home</div>\n {this.renderAddTopicButton()}\n {this.renderAddTopic()}\n {this.renderTopics()}\n </div>\n );\n }", "function backToHomeView () {\n currentFolder = -1\n showOneContainer(homeContain)\n fetchSingleUser(currentUser)\n }", "render() {\n return (\n <div className={s.root}>\n <div className={s.container}>\n <Home />\n </div>\n </div>\n );\n }", "render() {\n return (\n <div>\n <h3>Home Page</h3>\n <p>\n Intro to concept\n </p>\n </div>\n );\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}", "function render(st = state.Home) {\n document.querySelector(\"#root\").innerHTML = `\n ${Header(st)}\n ${Nav(state.Links)}\n ${Main(st)}\n ${Footer()}\n `;\n\n router.updatePageLinks();\n addEventListeners(st);\n\n}", "function Home(props) {\r\n console.log('this is Home - props', props);\r\n return ( <>\r\n <img src='https://i.kym-cdn.com/entries/icons/facebook/000/029/959/Screen_Shot_2019-06-05_at_1.26.32_PM.jpg' />\r\n <h1>Welcome to the Home of Stocks...iStonks...</h1>\r\n </>)\r\n}", "function renderHome(req, res) {\n var users = Room.getRoom('').getUsernames()\n , room_state = { users: users };\n //console.log('rendering home; user is', req.user);\n\n if (_.isObject(req.user)) { \n if ( _.isString(req.query.joined_table_name) ) {\n req.user.current_table_names.push(req.query.joined_table_name);\n }\n res.render('index', _.extend(req.user, {\n title: 'Bitcoin Poker'\n , room_state: JSON.stringify(room_state)\n , user: req.user\n , message: getFlashFromReq(req)\n }));\n }\n else {\n console.log('user is not logged in. rendering welcome environment');\n res.redirect('/welcome');\n }\n}", "function HomeHandler (request, reply) {\n reply.view('views/home.html');\n}", "function Pages() {\n return (\n <main role=\"application\">\n {/* <Header /> */}\n\n {/* Home */}\n <Match\n pattern=\"/\"\n exactly\n component={Home}\n />\n {/* quienes somos */}\n <Match\n pattern=\"/about\"\n exactly\n component={About}\n />\n {/* servicios */}\n <Match\n pattern=\"/services\"\n exactly\n component={Services}\n />\n {/* Contacto */}\n <Match\n pattern=\"/contact\"\n exactly\n component={Contact}\n />\n {/* Error 404 */}\n <Miss component={Error404}\n />\n </main>\n )\n}", "index() {\n new IndexView({ el: '.pages-wrapper' });\n }", "function renderHomePage(name) {\n\tres.write(\"<html><head><title>Home</title></head>\");\n\tres.write(\"<body>\")\n\tres.write(\"<h1>This is the home page</h1>\");\n\tres.write(\"<h2>Welcome \" + name + \"</h2>\");\n\tres.write(\"</body></html>\");\n\tres.end();\n\t\n}", "render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"Home\">\r\n\t\t\t{this.props.isAuthenticated ? this.renderUser() : this.renderLander()}\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "_renderMainContent () {\n switch (this.currentView) {\n case views.HOME:\n return lazyLoad(\n import('./views/view-home'),\n html`\n <view-home \n ._hasPendingChildren=\"${this._hasPendingChildren}\"\n ._pendingCount=\"${this._pendingCount}\">\n </view-home>\n `\n )\n case views.ONE:\n return lazyLoad(\n import('./views/view-one'),\n html`<view-one></view-one>`\n )\n case views.TWO:\n return lazyLoad(\n import('./views/view-two'),\n html`<view-two></view-two>`\n )\n case views.THREE:\n return lazyLoad(\n import('./views/view-three'),\n html`<view-three></view-three>`\n )\n default:\n return lazyLoad(\n import('./views/view-notfound'),\n html`<view-notfound></view-notfound>`\n )\n }\n }", "function Landing() {\n return(<div>This is the landing page, welcome!! CHECK OUT CAR PAGE</div>);\n}", "function Home() {\n return (\n <>\n <div className=\"wrapper\">\n <Header />\n <About />\n <Signup />\n <FootNotes />\n </div>\n </>\n );\n}", "function initializeWebsite() {\n const content = document.querySelector(\"#content\");\n content.prepend(generateHeader());\n content.appendChild(generateHome());\n content.appendChild(generateFooter());\n\n // Set home button as active on default\n const activeBtn = document.querySelector('button[data-id=\"Home\"]');\n activeBtn.classList.add(\"nav-btn_active\");\n}", "function setHomeScreen(){\n var main = Ext.getCmp('MainPanel');\n var calendarButton = FRIENDAPP.app.getController('DashboardController').getCalendarButton();\n calendarButton.addCls('activeCls');\n FRIENDAPP.app.getController('DashboardController').activeButton = calendarButton;\n main.setActiveItem(1);\n return;\n }", "function homePage() {\n const tl = new TimelineMax({ delay: 0.5 });\n tl.from(\"#logo\", {\n y: -500,\n scale: 0.1,\n ease: \"back\",\n duration: 1.5,\n }).from(\n \"#hamburger-menu\",\n {\n opacity: 0,\n scale: 0.6,\n ease: \"back\",\n duration: 1.2,\n },\n \"-=0.3\"\n );\n}", "function Home() {\n const router = useRouter()\n return(\n <div>\n <Pixel name='FACEBOOK_PIXEL_1' />\n <Header/>\n <HomePage/>\n <Footer/>\n </div>\n )\n}", "goToHome() {\n ReactDOM.render(\n <App user={this.state.currentUser}/>,\n document.getElementById('root')\n );\n }", "function loadInitialPage() {\n var props = new Object();\n\n // when the user first opens the website\n props[\"loadType\"] = \"defaultLoad\";\n props[\"pageExtension\"] = \"/\";\n\n ReactDOM.render(React.createElement(Home, props), document.getElementById(\"root\"));\n}", "genPrimaryContent(page) {\n switch (page) {\n\n case 'EXPLORER':\n return (\n <Explorer\n position={this.state.position}\n getPosition={this.getPosition}\n />\n );\n\n default:\n return (\n <Welcome\n title={Texts.title}\n label={Texts.titleButtonLabel}\n onClick={this.handleAuthSubmit}\n />\n );\n }\n }", "function HomeButton() {\n\treturn <button><Link exact to=\"/\">Go Back</Link></button>\n}", "function initHome() {\n\tgetCurrentUser();\n\tinitializeStudentInfo();\n\tloadCourses(buildCourseContent);\n\tprogressBarFunc();\n\tw3_open(); \n}", "function Home() {\n return (\n <div className=\"wrapp\">\n <div className=\"wrapper-container\">\n <Header />\n <Banner />\n <Work />\n <Introl />\n <Feedback />\n <Footer />\n </div>\n </div>\n );\n}", "onNobodyHome() {\n throw new NotImplementedException();\n }", "render() {\n\t\treturn (\n\t\t\t<div id=\"banner\" className=\"page\">\n\t\t\t\t<Link to=\"/\" className=\"bannerSelector\">\n\t\t\t\t\t<div>Home</div>\n\t\t\t\t</Link>\n\n\t\t\t\t<Link to=\"/about\" className=\"bannerSelector\">\n\t\t\t\t\t<div>About Me</div>\n\t\t\t\t</Link>\n\n\t\t\t\t<Link to=\"/projects\" className=\"bannerSelector\">\n\t\t\t\t\t<div>Projects</div>\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t);\n\t}", "function Home() {\n\treturn (\n <div className=\"container\">\n\t\t\t\t<Hello />\n\t\t\t\t\n \n </div>\n );\t\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 }", "render() {\n\t\tconst basename = process.env.BASENAME || \"\";\n\t\treturn (\n\t\t\t<div className=\"d-flex flex-column h-100\">\n\t\t\t\t<BrowserRouter basename={basename}>\n\t\t\t\t\t<ScrollToTop>\n\t\t\t\t\t\t<Navbar />\n\t\t\t\t\t\t<Switch>\n\t\t\t\t\t\t\t<Route exact path=\"/\" component={Home} />\n\t\t\t\t\t\t\t<Route exact path=\"/home\" component={Home} />\n\t\t\t\t\t\t\t<Route exact path=\"/planets\" component={PlanetHome} />\n\t\t\t\t\t\t\t<Route exact path=\"/characters\" component={CharacterHome} />\n\t\t\t\t\t\t\t<Route exact path=\"/planetdetails/:id\" component={PlanetDetails} />\n\t\t\t\t\t\t\t<Route exact path=\"/characterdetails/:id\" component={CharacterDetails} />\n\t\t\t\t\t\t</Switch>\n\t\t\t\t\t\t<Footer />\n\t\t\t\t\t</ScrollToTop>\n\t\t\t\t</BrowserRouter>\n\t\t\t</div>\n\t\t);\n\t}", "render () {\n\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}" ]
[ "0.7484706", "0.7205797", "0.71785885", "0.71783334", "0.7078643", "0.7073782", "0.69430816", "0.69089407", "0.6898658", "0.68250626", "0.6795143", "0.6721337", "0.66872907", "0.66780806", "0.66696405", "0.66564596", "0.6634378", "0.6633857", "0.6629965", "0.662977", "0.662205", "0.66202", "0.6609498", "0.66078246", "0.66078246", "0.6591491", "0.6575465", "0.6573272", "0.6547612", "0.65435815", "0.65379757", "0.6536547", "0.6534557", "0.6526267", "0.65249354", "0.6507393", "0.64961493", "0.64918107", "0.6476885", "0.64668614", "0.6446249", "0.64433295", "0.6442115", "0.6432111", "0.64245886", "0.64159274", "0.6405531", "0.6400576", "0.63907", "0.6388522", "0.6383857", "0.63805085", "0.6376934", "0.637286", "0.63708144", "0.6341832", "0.6339769", "0.6339113", "0.6334091", "0.63297164", "0.63287085", "0.6320977", "0.631932", "0.63188016", "0.63133055", "0.6313222", "0.6307486", "0.6306151", "0.630462", "0.6287476", "0.62814546", "0.6274163", "0.6256266", "0.62560976", "0.6254792", "0.6248679", "0.62469727", "0.624096", "0.6230515", "0.62282234", "0.6222665", "0.6221487", "0.6220856", "0.6209093", "0.62084544", "0.6191767", "0.6189115", "0.6184209", "0.6178801", "0.61755925", "0.6172673", "0.61724484", "0.6171604", "0.6171232", "0.6165475", "0.61616325", "0.61587816", "0.6152218", "0.61334", "0.6131036", "0.61250216" ]
0.0
-1
Component representing the search page
function SearchPage() { document.title = "Search | BaseCheck"; let { county } = useParams(); const baseUri = "https://cors-anywhere.gradyt.com/https://covercovid-19.com/search/" + county; const [counties, setCounties] = useState([]); const [loaded, setLoaded] = useState(false); // Track the previous URL accessed let prevUrl = useLocation().pathname; localStorage.setItem("prevUrl", prevUrl); useEffect(() => { fetch(baseUri, { method: 'GET', mode: 'cors', cache: 'default', headers: { 'Access-Control-Allow-Origin': '*', 'Origin': 'http://localhost:3000' } }) .then((response) => response.json()) .then((responseData) => { setCounties(responseData); }) .then(() => { setLoaded(true); }) .catch((err) => { console.log(err); }); }, []); if (counties) { return ( <main className="home-page"> <SearchBar/> <UsDashboard/> <CountyCardList counties={counties} loaded={loaded} search={county}/> <div> </div> </main> ); } else { return <div></div> } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "search() {\n let location = ReactDOM.findDOMNode(this.refs.Search).value;\n if (location !== '') {\n let path = `/search?location=${location}`;\n makeHTTPRequest(this.props.updateSearchResults, path);\n }\n }", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "function Search(props){\n return (\n <div className=\"search-cont side-content\">\n <h1>Search</h1>\n <form>\n <label htmlFor=\"search-name\">Title</label>\n <input id=\"search-name\" onChange={(ev) => props.changeFilter(ev, 'title')}></input>\n <label htmlFor=\"search-studio\">Studio</label>\n <input id=\"search-studio\" onChange={(ev) => props.changeFilter(ev, 'studio')}></input>\n <label htmlFor=\"search-content\">Content</label>\n <input id=\"search-content\" onChange={(ev) => props.changeFilter(ev, 'synopsis')}></input>\n </form>\n </div>\n )\n }", "search() {\n let self = this;\n let inputField = self.getEl('search_field');\n window.location = window.location.origin + `/search/${inputField.value}`;\n }", "function search(){\n let query;\n if(searchLocation===\"location\"){\n searchLocation(\"\")\n }\n query=`https://ontrack-team3.herokuapp.com/students/search?location=${searchLocation}&className=${searchClass}&term=${searchName}` \n prop.urlFunc(query);\n }", "function search(){\r\n if (!searchField.value)\r\n return;\r\n\r\n let results = searchEngine.search(searchField.value,{\r\n fields: {\r\n tags: { boost: 3 },\r\n title: { boost: 2 },\r\n body: { boost: 1 }\r\n }\r\n }); \r\n\r\n searchResults.classList.add('header-searchResults--show')\r\n\r\n let resultsHtml = '';\r\n if (results.length){\r\n \r\n resultsHtml = `Found ${results.length} post(s).`;\r\n for(let result of results){\r\n let doc = searchEngine.documentStore.getDoc(result.ref);\r\n resultsHtml += `\r\n <div class=\"header-searchResult\">\r\n <a href=\"${doc.id}\">${doc.title}</a>\r\n </div>`;\r\n\r\n }\r\n } else{\r\n resultsHtml = `<div class=\"header-searchResult\">\r\n No results found for ${searchField.value}\r\n </div>`;\r\n }\r\n\r\n searchResults.innerHTML = resultsHtml;\r\n}", "function handleSearchEvent() {\n const newData = filterStudents(searchValue);\n showPage(newData, 1);\n addPagination(newData);\n}", "function newSearch(req,res){\n // console.log(req.query );\n res.render('pages/index');\n}", "function opensearch(){\n\tsummer.openWin({\n\t\tid : \"search\",\n\t\turl : \"comps/summer-component-contacts/www/html/search.html\"\n\t});\n}", "function SearchPanel() {\n Component.call(this, 'form');\n\n var $element = $(this.element);\n var $input = $('<input type=\"search\" placeholder=\"Input a text...\">');\n var $button = $('<button type=\"submit\">Search</button>');\n\n $element.submit(function(event){\n event.preventDefault();\n var query = $input.val();\n if (query && _callback) _callback(query);\n }.bind(this));\n \n $element.append([$input, $button]);\n \n var _callback;\n this.onSearch = function (callback) {\n _callback = callback;\n };\n}", "function SearchWrapper () {}", "_onSearch(event) {\n const searchDetails = event.detail;\n Object.assign(this.searchDetails, searchDetails);\n this.render();\n }", "render() {\n return (\n\n <div>\n This is React search Component !\n </div>\n );\n }", "static get tag(){return\"site-search\"}", "get search () {\n\t\treturn this._search;\n\t}", "function search(value){\n\n // Call parent search method\n props.action(value);\n }", "search(params) {\n let query = params;\n this.set('query', query);\n this.transitionToRoute('search', {queryParams: {q: query, p: this.page }});\n }", "function search(_event) {\r\n let inputName = document.getElementById(\"searchname\");\r\n let inputMatrikel = document.getElementById(\"searchmatrikel\");\r\n let query = \"command=search\";\r\n query += \"&nameSearch=\" + inputName.value;\r\n query += \"&matrikelSearch=\" + inputMatrikel.value;\r\n console.log(query);\r\n sendRequest(query, handleSearchResponse);\r\n }", "function search() {\n\t\n}", "function search(value){\n\t// console.log(\"search: \" + value);\n\tshowSection(null, '#section-searchresults');\n\t$('#section-searchresults h1').html(\"Results for: '\" + value + \"'\");\n\tcontroller.search(value);\n}", "function basicsearch() {\n searchString = document.basicForm.basicText.value;\n searchTerms = searchString.split(/\\s/);\n\n putHeader();\n\n findResults();\n putResults();\n\n putFooter();\n\n writeResultsPage();\n}", "render() {\n let filteredData = this.state.data.filter(this.searchDetails);\n let displayResults = \"\"\n if (this.state.query !== \"\") {\n displayResults = (\n <div class=\"searchContainer\">\n <ul>{\n filteredData.map((details, i) => (\n <div key={i} className=\"searchResults\">\n\n <button>\n <Link to={`/movie_details/${details.id}`}>\n <li>{details.original_title}</li>\n </Link>\n </button>\n\n </div>\n ))}</ul></div>)\n } else {\n displayResults = \"\";\n }\n\n return (\n <div className=\"searchBar\">\n <Search query={this.state.query} handleSearch={this.handleSearch} className=\"searchBox\" />\n {displayResults}\n </div>\n );\n }", "function search() {\n var currentForms = session.forms;\n\n\n var SearchProductListsResult = new Pipelet('SearchProductLists', {\n PublicOnly: true\n }).execute({\n EventType: currentForms.giftregistry.search.simple.eventType.value,\n EventCity: currentForms.giftregistry.search.advanced.eventCity.value,\n EventState: currentForms.giftregistry.search.advanced.eventAddress.states.state.value,\n EventCountry: currentForms.giftregistry.search.advanced.eventAddress.country.value,\n RegistrantFirstName: currentForms.giftregistry.search.simple.registrantFirstName.value,\n RegistrantLastName: currentForms.giftregistry.search.simple.registrantLastName.value,\n Type: ProductList.TYPE_GIFT_REGISTRY,\n EventMonth: currentForms.giftregistry.search.advanced.eventMonth.value,\n EventYear: currentForms.giftregistry.search.advanced.eventYear.value,\n EventName: currentForms.giftregistry.search.advanced.eventName.value\n });\n var ProductLists = SearchProductListsResult.ProductLists;\n/**\n * TODO\n */\n showSearch({\n ProductLists: ProductLists\n });\n}", "get materialSearch() {}", "function renderUnifiedSearchPanel() {\n\t\tvar searchCities = App.SearchCities();\n \t\tvar searchZip = App.ZipSearch();\n\n\t\tgetTemplateAjax('UnifiedSearch', '#content-area', null, function(){\n\n\n\t\t\tconsole.log('here.');\n\n\t\t\tvar $tmSearch = $('.tm-search');\n\t\t\tvar $goBtn = $('.goBtn');\n\t\t\tvar $submit = $('#submit');\n\n\t\t\t/* When search input is clicked, expand the width */\n\t\t\t$tmSearch.on('click', function(event) {\n\t\t\t\t$tmSearch.addClass('search--expanded');\n\t\t\t\t$goBtn.addClass('goBtn--expanded');\n\t\t\t});\n\t\t\t/* Enter key should search as well */\n\t\t\t$tmSearch.on('keyup', function(event) {\n\n\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\t$submit.click();\n\t\t\t\t}\n\t\t\t});\n\n\t\t //Listen to event handlers\n\t\t // uniSearch click event.\n\t\t $submit.on('click', function(event){\n\t\t event.preventDefault();\n\n\t\t var userInput = $('#q').val();\n\t\t if ( Number(userInput) ) {\n\n\t\t \t// Is zip\n\t\t \tconsole.log('zip = ', userInput);\n\t\t \tsearchZip.search(userInput);\n\n\t\t } else {\n\n\t\t \t// Is city\n\t\t \tconsole.log('city = ', userInput);\n\t\t \tsearchCities.search(userInput);\n\n\t\t }\n\t\t });\n\t\t});\n\n\t}", "onActionClickSearchBar() {\n this.search(this.state.search)\n }", "search() {\n this.props.onSearch(this.state.searchValue);\n }", "function newSearch(request, response) {\n response.render(\"pages/index\");\n}", "index(req, res) {\n res.render('search');\n }", "search() {\n // If the search base is the id, just load the right card.\n if (this.queryData['searchBase'] == 'id' && this.queryData['search']) {\n this.selectItem(this.queryData['search']);\n } else {\n this.loadData();\n }\n }", "searchBlog(e) {\n e.preventDefault();\n this.renderBlogs(this.state.search);\n }", "render(){\n\t\t// every class must have a render method \n\t\treturn(\n\t\t\t<div className=\"search-bar\">\n\t\t \t\t<input \n\t\t \t\t\tvalue = {this.state.term} // this turns into controlled component\n\t\t \t\t\tonChange={(event) => this.onInputChange(event.target.value)} />\n\t\t \t</div>\n\t\t );\n\t}", "function search(data){\n setSearch(data); \n }", "searchContent(){\n if(this.state.results.length === 0){\n return(<h1>NO RESULTS</h1>);\n }\n else{\n return(\n <Items results={this.state.results} />\n )\n }\n }", "function Search(props) {\n return (\n <div className=\"form-group\">\n <label >Search Name:</label>\n <input\n type = \"search\"\n onChange={event => props.getFilterEmployees(event)}\n />\n </div>\n );\n}", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function studentSearch(list) {\r\n //Create Search Element\r\n const containerDiv = document.createElement('div');\r\n containerDiv.className='student-search';\r\n const input = document.createElement('input');\r\n input.placeholder='Search for students...';\r\n const button = document.createElement('button');\r\n button.textContent=\"Search\";\r\n //Create Search function\r\n function searchAction(){\r\n noResultContainer.style.display='none';\r\n const searchTerm = input.value;\r\n const searchedArray = [];\r\n for(let i=0; i <list.length; i++){\r\n const name = studentList.children[i].querySelector('h3').textContent;\r\n if(name.indexOf(searchTerm)> -1){\r\n searchedArray.push(list[i]);\r\n }\r\n }\r\n if(searchedArray.length ===0){\r\n hidePage();\r\n noResultContainer.style.display='block';\r\n if(document.querySelector('.pagination')){\r\n document.querySelector('.pagination').remove();\r\n }\r\n } else {\r\n pageNumber = 1;\r\n pagination(searchedArray, pageNumber);\r\n }\r\n }\r\n //Add functionality to input element\r\n input.addEventListener('keyup', () =>{\r\n searchAction();\r\n });\r\n\r\n //Add functionality to button element\r\n button.addEventListener('click', ()=> {\r\n searchAction();\r\n });\r\n\r\n containerDiv.appendChild(input);\r\n containerDiv.appendChild(button);\r\n pageHeader.appendChild(containerDiv);\r\n}", "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "function getSearch(request, response) {\n response.render('pages/searches/new.ejs')\n}", "function SearchPanel() {\n Component.call(this, 'form');\n //Llamamos al componente ubicado en (web-components....)\n //Pasando el this(obligatorio para el call) y form que llegará \n //al componente como tag\n // var input = document.createElement('input');\n // input.type = 'search';\n // input.placeholder = 'Input a text...';\n // var button = document.createElement('button');\n // button.type = 'submit';\n // button.innerHTML = 'Search';\n var $form = $(this.element);\n\n var $input = $('<input type=\"search\" placeholder=\"Input a text...\"></a>');\n var $button = $('<button type=\"submit\">Search</button>');\n\n //Añadimos a SearchPanel.form.appendChild(input)\n $form.append($input);\n $form.append($button);\n\n //Declara una variable interna llamada callback\n var _callback;\n\n this.element.addEventListener('submit', function (event) {\n //Para que no te redirija a otro sitio\n event.preventDefault();\n\n var query = $input.val();\n\n if (query && _callback) _callback(query);\n //Bind hace referencia a su scope. En este caso a SearchPanel \n }.bind(this));\n\n //El this hace referencia al que hace la llamada ya que en este caso hay dos search(dos buscadores)\n this.onSearch = function (callback) {\n _callback = callback;\n };\n}", "render(){\n\t\tconst searchTerm = this.props.searchTerm\n\t\treturn(\n\t\t\t<form className=\"search-bar\">\n\t\t\t\t<input value={searchTerm} onChange={this.handleChange} type=\"text\" placeholder=\"Search...\" />\n\t\t\t\t<div>\n\t\t\t\t\t<input id=\"in-stock\" type=\"checkbox\" /> Only show products in stock\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t)\n\t}", "search() {\n\t\tthis.props.onSearch(this.state.term);\n\t}", "function onShowSearchResultPanel() {\n mediator.getView('searchResult');\n }", "onSearch() {\n try {\n const searchText = this.getSearchHash();\n if (searchText === this.priorSearchText)\n return;\n this.engine.search(searchText);\n this.priorSearchText = searchText;\n }\n catch (ex) {\n this.publish(\"error\", ex.message);\n }\n }", "function search() {\r\n let searchTerm = id(\"search-term\").value.trim();\r\n if (searchTerm !== \"\") {\r\n id(\"home\").disabled = false;\r\n loadBooks(\"&search=\" + searchTerm);\r\n }\r\n }", "render() {\n\t\tconst searchResults = this.state.searchresults;\n\t\tlet results = <div className=\"recipe-not-found\"><h3>Sorry, there were no results found.</h3></div>;\n\t\tif (searchResults.length > 0) {\n\t\t\tresults = <SearchResults searchresults={searchResults}/>\n\t\t}\n\t\treturn(\n\t\t\t<div className=\"searchbox\">\n\t\t\t\t<div style={{marginBottom: '70px'}}>\n\t\t\t\t\t<SearchBox \n\t\t\t\t\t\tonSearchClick={this.handleSearchClick}/>\n\t\t\t\t</div>\n\t\t\t\t<br />\n\t\t\t\t<div className=\"center-contents-div\">\n\t\t\t\t\t{results}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "function search()\n{\n\tvar query = ($(\"#search\")[0]).value;\n\tcreateCookie('search', query, 1); /// Save the search query\n\tgoTo('index'); /// Go to index (search) page\n}", "render() {\n\t\treturn(\n\t\t\t<section className='search-bar'>\n\t\t\t\t<label>Search</label>\n\t\t\t\t<input\n\t\t\t\t\tvalue = {this.state.term}\n\t\t\t\t\t// rather than calling directly to the SearchBar props,\n\t\t\t\t\t// call a separate method (below)\n\t\t\t\t\tonChange={ event => this.onInputChange(event.target.value) }\n\t\t\t\t/>\n\t\t\t\t<br/>\n\t\t\t</section>\n\t\t);\n\t}", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n _showLoading()\n try {\n SongService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "onSearch(e) {\n e.preventDefault();\n this.setState({ searchTerm: e.target.value });\n\n // TODO refactor this and just call a search method in a 'Products' service that handles all the API calls\n if (e.target.value && e.target.value.length > 2) {\n fetch(`http://localhost:3035/products?q=${e.target.value}`)\n .then(res => res.json())\n .then(searchResults => {\n this.setState({ searchResults })\n });\n } else {\n this.setState({ searchResults: {items: [], total: 0} });\n }\n }", "constructor() {\n super();\n this.state = {\n data: [],\n filtered_data: [],\n showResults: false\n }\n this.search = this.search.bind(this);\n }", "searchFilter(e) {\n this.getSearchResults(formData)\n }", "handleAdvancedSearch(event) { \n this.closeModal();\n var searchParameters = [\"subject\", \"rights\", \"title\", \"format\", \"collection\", \"state\", \"university\", \"language\", \"creator\", \"date\"];\n var searchType;\n var userInput;\n var formData = {\n subject: \"\",\n rights: \"\",\n title: \"\",\n format: \"\",\n collection: \"\",\n state: \"\",\n university: \"\",\n language: \"\",\n creator: \"\",\n date: \"\",\n page_size: \"30\",\n page: \"1\"\n };\n \n for (var i = 0; i < searchParameters.length; i++)\n {\n searchType = searchParameters[i]\n userInput = this.state[searchType]; \n this.setState({ [searchType]: '' });\n if (userInput !== \"\" && userInput !== undefined && userInput !== 'ALL')\n formData[searchType] = userInput;\n }\n \n var results = ApiWrapper.makeCall({subject: formData.subject, \n rights: formData.rights, \n title: formData.title, \n format: formData.format, \n collection: formData.collection, \n state: formData.state, \n university: formData.university,\n language: formData.language, \n creator: formData.creator,\n date: formData.date, \n page_size: formData.page_size,\n page: formData.page,\n });\n \n ReactDOM.render(<Books view=\"componentView\" results={results} pageSize= \"30\" />, document.getElementById('root')); \n event.preventDefault();\n }", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function clickSearchBox(object){\n let searchText = document.querySelector(\".form-inline input[type='text']\").value;\n document.location = page.RESULT + '?searchWords='+searchText.toLowerCase();\n}", "function search() {\r\n const h2 = document.getElementsByTagName('h2')[0] \r\n const label = document.createElement('label')\r\n const input = document.createElement('input')\r\n const button = document.createElement('button')\r\n const img = document.createElement('img')\r\n label.className = 'student-search'\r\n label.setAttribute('for', 'label')\r\n h2.insertAdjacentElement('afterend', label)\r\n input.placeholder = 'Search by name...'\r\n input.id = 'search'\r\n label.appendChild(input)\r\n button.type = 'button'\r\n label.appendChild(button)\r\n img.src = 'img/icn-search.svg'\r\n img.alt = 'Search icon'\r\n button.appendChild(img)\r\n\r\n // Completes search after clicking on Search button\r\n button.addEventListener('click', (e) => {\r\n let searchValue = input.value\r\n console.log('Value of Search: ', searchValue)\r\n const results = []\r\n for(let i = 0; i < data.length; i++) {\r\n const firstName = data[i].name.first.toUpperCase()\r\n const lastName = data[i].name.last.toUpperCase()\r\n if(searchValue.toUpperCase() === firstName || searchValue.toUpperCase() === lastName) {\r\n results.push(data[i])\r\n } \r\n }\r\n input.value = ''\r\n if(results.length > 0) {\r\n showPage(results, 1)\r\n addPagination(results)\r\n } else {\r\n student_list.innerHTML = ''\r\n link_list.innerHTML = ''\r\n student_list.insertAdjacentHTML('beforeend', '<h2>No results found</h2>')\r\n }\r\n })\r\n\r\n // Completes search with each key-up\r\n input.addEventListener('keyup', (e) => {\r\n let searchValue = (e.target.value).toUpperCase()\r\n const results = []\r\n for(let i = 0; i < data.length; i++) {\r\n let firstName = data[i].name.first.toUpperCase()\r\n let lastName = data[i].name.last.toUpperCase()\r\n if(firstName.includes(searchValue) || lastName.includes(searchValue)) {\r\n results.push(data[i])\r\n }\r\n if(results.length > 0) {\r\n showPage(results, 1)\r\n addPagination(results)\r\n }\r\n // console.log('From within keyup: ', results)\r\n }\r\n if(results.length === 0) {\r\n student_list.innerHTML = ''\r\n link_list.innerHTML = ''\r\n student_list.insertAdjacentHTML('beforeend', '<h2>No results found</h2>')\r\n }\r\n })\r\n}", "AddSearchProvider() {}", "function renderSearchFromState() {\n\tconst state = JSON.parse(sessionStorage.getItem(SEARCH_STATE_KEY));\n\n\tif (state) {\n\t\tconst searchResults = document.querySelector('#search-results');\n\t\tconst searchInput = document.querySelector('#search-input');\n\n\t\tsearchInput.value = state.searchTerm;\n\t\tsearchResults.classList.add('visible');\n\t\tsearchResults.classList.add('no-transition');\n\t\tsearchResults.innerHTML = state.resultsMarkup;\n\n\t\t// remove class which prevents transition on page move\n\t\tsetTimeout(() => searchResults.classList.remove('no-transition'), 100);\n\t}\n}", "function getSearchResults(request) {\n return \"Search Results.\";\n}", "function Search() {\n const {\n ready,\n value,\n suggestions: { status, data },\n setValue,\n clearSuggestion,\n } = usePlacesAutoComplete({\n requestOptions: {\n location: { lat: () => 61.24677, lng: () => -149.92566 },\n radius: 200 * 1000,\n },\n });\n\n return (\n <div className=\"search\">\n \n </div>\n );\n }", "get searchParam () {\n\t\treturn this._searchParam;\n\t}", "function search(e) {\n let searchResult = []\n for (i = 0; i < list.length; i++) {\n if (list[i].firstElementChild.firstElementChild.nextElementSibling.innerText.toUpperCase().split(\" \").join(\"\").indexOf(search_box.value.toUpperCase()) > -1) {\n searchResult.push(list[i])\n }\n }\n\n if (searchResult.length < 1) {\n\n showPages(searchResult, 0)\n if (containerPage[0].lastElementChild.tagName == \"DIV\") {\n containerPage[0].lastElementChild.remove()\n }\n\n let notFound = document.createElement(\"h2\")\n notFound.innerText = \"Sorry student not found\"\n if (containerPage[0].lastElementChild.tagName != \"H2\") {\n containerPage[0].appendChild(notFound)\n }\n } else {\n createPaginationLinks(searchResult)\n }\n\n}", "function NetworkSearch(props) {\n\n\t//calls handleSearch callback using search input and re-renders the content being display\n function handleSearch(e) {\n e.preventDefault();\n let input = document.getElementById('networkSearch');\n\t\tlet search = input.value;\n\t\tprops.handleSearch(search);\n\t\tinput.value = '';\n }\n\n\treturn (\n\t\t<div className=\"c-network-form\">\n\t\t\t<form onSubmit={ (e) => handleSearch(e)} className=\"[ form-inline ] c-network-search\">\n\t\t\t\t<input id=\"networkSearch\" className=\"form-control mr-sm-2\" type=\"search\" placeholder=\"Search...\" aria-label=\"Search\"/>\n\t\t\t\t<Button className=\"btn btn-outline-success my-2 my-sm-0 c-network-button\" onClick={(e) => handleSearch(e)}>\n\t\t\t\t\t<Glyphicon glyph=\"search\" /> \n\t\t\t\t</Button>\n\t\t\t\t{\n\t\t\t\t\tprops.location.pathname.includes(\"contacts\") &&\n\t\t\t\t\t<Link to=\"/network/contacts/connect\">\n\t\t\t\t\t\t<Button className=\"btn btn-outline-success my-2 my-sm-0 plus c-network-button\">\n\t\t\t\t\t\t\t<Glyphicon glyph=\"plus\" /> \n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Link>\n\t\t\t\t}\n\t\t\t\t{\n\t\t\t\t\tprops.location.pathname.includes(\"messages\") && \n\t\t\t\t\t<Link to='/network/messages/new'>\n\t\t\t\t\t\t<Button className=\"btn btn-outline-success my-2 my-sm-0 plus c-network-button\">\n\t\t\t\t\t\t\t<Glyphicon glyph=\"plus\" /> \n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Link>\n\t\t\t\t}\n\t\t\t</form>\n\t\t</div>\n\t);\n}", "renderSearchPage() {\n\t\tfor (let iter = 0; iter < this.sidebarOptions.length; iter++)\n\t\t\tif (\n\t\t\t\tthis.optionRefs[iter].current.classList.contains(\n\t\t\t\t\t\"sidebar-button-active\"\n\t\t\t\t)\n\t\t\t)\n\t\t\t\tthis.optionRefs[iter].current.classList.remove(\n\t\t\t\t\t\"sidebar-button-active\"\n\t\t\t\t);\n\t\tthis.setState({ ...this.state, sidebarOptionSelected: 9 });\n\t}", "function search() {\t\t\t\t\n\t\t\tconsole.log(vm.apiDomain);\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n\t\t\tAlleleFearSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.selectedIndex = 0;\n\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tclear();\n\t\t\t\t pageScope.loadingEnd();\n\t\t\t\t}\n\t\t\t\tsetFocus();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: AlleleFearSearchAPI.search\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "_actionSearch(q) {\n\t\tthis.context.executeAction(SearchAction.getSearchChild, {\n\t\t\tapi: this.context.api,\n\t\t\tcdnom: this.props.cdnom,\n\t\t\toptions: { q: q }\n\t\t});\n\t}", "handleClickEvent() {\n this.props.fetchSearch(this.state.search)\n }", "render(){\n return (\n <div className=\"container\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /> \n <div id=\"search\" className=\"search\">\n <input \n type=\"text\" \n name=\"search\" \n id=\"search-input\" \n className=\"search-input\" \n placeholder=\"Search movie by title...\"\n ref={input => this.search = input} \n onChange={this.changeInput} /> \n\n <br /><br /> \n </div>\n <LoadingIndicator />\n <br /> \n <ResultsContainer results={this.state.results} query={this.state.query}/> \n </div>\n );\n }", "handleSearchBar()\n {\n this._page = 1;\n this._searchBar = $(\"#searchBar\").val();\n this.getBooks();\n }", "function Search(props) {\n return (\n <div className=\"Search\">\n <label id=\"searchBar\">\n <input id=\"searchInput\" placeholder=\"Enter your search here...\" onChange={(event) => props.searchContent(event)}></input>\n <select id=\"media\" onChange={(event) => props.searchMedia(event)}>\n <option>--Media--</option>\n <option>music</option>\n <option>movie</option>\n <option>podcast</option>\n <option>musicVideo</option>\n <option>audiobook</option>\n <option>shortFilm</option>\n <option>tvShow</option>\n <option>software</option>\n <option>ebook</option>\n </select>\n <button id=\"searchButton\" type=\"submit\" onClick={props.search}>Search</button>\n </label>\n </div>\n );\n}", "openPageSearch() {\n this.currentPage = \"search\";\n }", "function displaySearchField() {\n clearElements();\n const searchField = document.getElementById(\"search-field\");\n const template = document.getElementById(\"search-template\");\n const inputField = template.content.cloneNode(true);\n const btn = inputField.getElementById(\"submit-search-btn\");\n btn.addEventListener(\"click\", () => fetchOneItem());\n searchField.append(inputField);\n}", "render() {\n const {shows, search, info} = this.props;\n return <div className=\"SearchForm\">\n <input type=\"search\" placeholder=\"Search...\"\n ref={input => this.search = input} onChange={this.handleInputChange} onKeyPress={this.handleKeyPressed}/>\n <select value={info.searchMode} onChange={this.handleModeChange}>\n <option value=\"title\">by title</option>\n <option value=\"anyLangTitle\">by title (any language)</option>\n <option value=\"overview\">by overview</option>\n </select>\n <button onClick={this.handleSearch}>Find!</button>\n </div>;\n }", "render() {\n return (\n <div>\n <center>\n <div className=\"Item-List\">\n <div style={{\"width\": \"100%\", \"textAlign\": \"center\"}}>\n <span>Results for&nbsp;\n {this.props.search.length === 0 ? \"''\" : \"'\" + this.props.search + \"'\"}.\n </span>\n </div>\n <br/>\n\n {((this.props.search === '' || this.props.start_search === false) && !this.state.loading) ?\n // Gif when results are empty\n (<div>\n <p>Search someone.</p>\n </div>) :\n\n // Condition that checks if the results are finished loading\n (this.props.start_search !== '' && this.state.loading) ?\n // Loading gif when waiting for the fetch results\n (<img src=\"/loading.gif\" alt=\"\"/>) :\n // Function call that will return an appropriate render object\n (this.renderResults())}\n </div>\n </center>\n </div>\n );\n }", "triggersearch(){\r\n\t\t\tlet query='';\r\n\t\t\tif(this.props.keyword){\r\n\t\t\t\tquery=this.props.keyword\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tquery=this.props.query\r\n\t\t\t}\r\n\t\t\tthis.props.fetchSearchResults(query);\r\n\t}", "clickSearch() {\n this.set('loading', true);\n this.elasticSearch.setFilterString(\"\");\n this.elasticSearch.clearUserSearch();\n this.elasticSearch.queryUsers();\n }", "function post_search(req, res) {\n console.log(req.body);\n Model3d.find_by_string(req.body.search_bar, function(err, docs) {\n if (err) {\n res.send(\"something went wrong\");\n }\n else {\n res.render('navigation/search', {models: docs, selected: \"Search Results\" });\n }\n });\n}", "displaySearch() {\n\n //first retrieve all docs again, to reverse any filters\n db.allDocs({\n include_docs: true\n }, (err, doc) => {\n if (err) {\n return this.error(err);\n }\n if (doc.rows.length > 0) {\n this.setState({\n pageLoading: false\n });\n this.redrawResources(doc.rows);\n }\n });\n this.setState({\n appbarTitle: 'ShoutHealth'\n });\n this.setState({\n appbarSubtitle: 'Find Accessible Healthcare.'\n });\n this.setState({\n appbarState: false\n });\n this.setState({\n appbarIcon: <NavigationMenu />\n });\n this.setState({\n searchBar: <SearchInputs container={this.refs.content}\n getSearchstring={()=>this.state.searchString}\n filterResources={(searchString)=>this.filterResources(searchString)}\n searchString={this.state.searchString}\n getselectedIndex={()=>this.state.selectedIndex}\n onSelect={(index) => this.footerSelect(index)}/>\n });\n this.setState({\n screen: <Search container={this.refs.content}\n footer={this.refs.footer}\n displayResult={(result) => this.displayResult(result)}\n displaySearch={() => this.displaySearch()}\n filterResources={(string) => this.filterResources(string)}\n displayAddResource={() => this.displayAddResource()}\n getFilteredResources={() => this.state.filteredResources}\n getPageLoading={() => this.state.pageLoading}\n onGoogleApiLoad={(map, maps) => this.onGoogleApiLoad(map, maps)}\n userLat={this.state.userLat} userLng={this.state.userLng}\n getSearchstring={()=>this.state.searchString} />\n });\n\n }", "onSearch(value) {\n this.model.query = value;\n }", "onSearch(value) {\n this.model.query = value;\n }", "function search() {\n\tvar search_val = document.getElementById('search').value;\n\tvar queryString = \"?media_type=image&year_start=1920&year_end=2019&page=1&q=\" + search_val;\t\n\twindow.location.href = \"search.html\" + queryString;\n}", "render() {\n return (\n <div className=\"list-view\">\n <header><h1>Theatres in Leeds</h1></header>\n <div className='search'>\n <input\n aria-label='Filter input field'\n role='Search'\n type='text'\n placeholder='Search Theatres'\n value={this.state.query}\n onChange={(queryText) => {this.updateQuery(queryText.target.value)}}\n />\n </div>\n <nav className='list-container'>\n {this.props.theatres && (\n <section className='list' role='list'>\n {this.props.theatres.map((t, inx) =>\n <button key={inx} role='listitem' onClick={evt => this.props.itemClickHandler(inx)}>{t.name}</button>\n )}\n </section>\n )}\n </nav>\n </div>\n );\n }", "search() {\n friendsDOM.buildSearchFields()\n\n }", "function initializePage() {\n document.getElementById('close_tags').style.display = 'none';\n document.getElementById('clear_search_results').style.display = 'none';\n\n document.getElementById('search').addEventListener('input', doSearch);\n document.getElementById('search').style.display = 'block';\n\n const searchTerm = getSetValue('searchTerm');\n const ourCategory = getSetValue('category');\n const ourTag = getSetValue('tag');\n if (searchTerm) {\n hideNav();\n document.getElementById('search').value =\n decodeURI(getSetValue('searchTerm'));\n doSearch({target: {value: searchTerm}}); // This is the expected format\n } else if (ourCategory) {\n displayCategory(decodeURI(ourCategory));\n } else if (ourTag) {\n displayTag(decodeURI(ourTag));\n } else {\n displayTen();\n }\n}", "render(props){\n\n return(\n <Router>\n <div className=\"container\">\n <Search onSearch={this.performSearch} />\n <Navigation onClick={this.performSearch} />\n {this.state.isLoading ? (<p>Loading...</p>) : (\n <Switch>\n <Route exact path=\"/\" render={ (props) => <Redirect to=\"/search/art\" />} />\n <Route path=\"/search/:searchword\" exact component={(props) => {\n const searchWord = props.match.params.searchword;\n if(searchWord !== this.state.searchWord) {\n this.performSearch(searchWord);\n }\n return(\n <React.Fragment>\n <Gallery photos={this.state.images} {...props}/>\n </React.Fragment> \n )\n }}/>\n <Route component={ FileNotFound } />\n </Switch>\n )}\n </div>\n </Router>\n );\n }", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n try {\n SongsService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "render() {\n const filteredRobots = this.state.robots.filter(robots => {\n return robots.name.toLowerCase().includes(this.state.searchfield.toLowerCase());\n })\n return (\n <div className='tc'>\n <h1 className=\"f2\">Current Porfolio Skills</h1>\n <SearchBox searchChange={this.onSearchChange} />\n {/* <Scroll> */}\n <CardList robots={filteredRobots} />\n {/* </Scroll> */}\n </div >\n );\n }", "function getSearchResults() {\n var searchString = getSearchBoxValue();\n var url = getPageBaseURL() + '/results/' + searchString;\n window.location = url;\n}", "function searchBook() {\n setSearchTerm(searchValue.current.value)\n }", "render() {\n return (\n <div className=\"ui container\" style={{ marginTop: '10px' }}>\n <Header />\n <Route path=\"/\">\n <Home />\n </Route>\n <Route path=\"/search\">\n <SearchBar onSubmit={this.onSearchSubmit} />\n {!this.state.results.length ? (\n <div>Waiting for Search Parameter</div>\n ) : (\n <ResultList results={this.state.results} />\n )}\n </Route>\n <Route path=\"/history\">\n <History history={history} />\n </Route>\n </div>\n );\n }", "render() {\n\n // Canviem els this.states per this.props en el cas de fer servir l'store\n return <main className=\"container\">\n <SearchForm onSubmit={this.onSubmit} search={this.props.search}/>\n <RepositoryList\n data={this.props.results} search={this.props.search}\n loading={this.props.loading} queried={this.props.queried}/>\n </main>;\n }", "function _renderSearch() {\n _$navbar.setMod(_B_BAR, _M_SEARCH, false);\n setTimeout(function() {\n _$navbar.setMod(_B_BAR, _M_SEARCH, _searchIsActive);\n }, CFG.TIME.ANIMATION);\n }", "onSearch() {\n const {\n onBarsSearch,\n location\n } = this.props;\n onBarsSearch(location);\n }", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "render()\n {\n return (\n <Router>\n <div className=\"container\">\n <Header />\n <SearchForm onSearch={this.performSearch} />\n <Nav navSearch={this.performSearch} />\n\n {/* Write routes here... */}\n <Switch>\n <Route exact path=\"/\" render={() => <Redirect to=\"/search/soccer\" />} />\n <Route path=\"/search/:query\" render={({match}) => \n (\n <PhotoResults \n data={this.state.images} \n match={match}\n getResults={this.performSearch}\n isLoading={this.state.loading}\n /> \n )} \n />\n <Route component={Error} />\n </Switch>\n </div>\n </Router>\n );\n }", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n try {\n songService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "function Search(data,type){\n\n router.push({ pathname: 'http://localhost:3000/search', query: { search: data, type:type }})\n }", "function searchHandler(e) {\n \"use strict\";\n // Prevent default form action\n e.preventDefault();\n showFilteredBreeds();\n}", "function SearchResults(){\n\n let {name} = useParams();//get the name from the url using useParams()\n return (\n <>\n <h1>Displaying results for \"{name}\":</h1>\n {/* render search results */}\n <List/>\n\n </>\n )\n}", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "function getSearchObj(){\n return searchObj;\n }" ]
[ "0.7439431", "0.71394867", "0.71268225", "0.69284594", "0.6850917", "0.6790371", "0.67758965", "0.6753482", "0.67338157", "0.6659519", "0.6647506", "0.6641174", "0.65809566", "0.6564233", "0.6549926", "0.6538047", "0.6534458", "0.6528409", "0.65151507", "0.6503617", "0.64982826", "0.649826", "0.6468748", "0.6460847", "0.6449567", "0.6441405", "0.6437417", "0.6435919", "0.64351225", "0.6430128", "0.6425906", "0.64137423", "0.64102304", "0.640359", "0.64019233", "0.63930506", "0.63912773", "0.6390658", "0.63794523", "0.6375813", "0.63739896", "0.6352622", "0.6351256", "0.6348808", "0.63401264", "0.6336338", "0.6331076", "0.6317564", "0.631737", "0.6316959", "0.63155985", "0.63088953", "0.63060004", "0.629584", "0.6283456", "0.6278271", "0.62715745", "0.6266814", "0.6266172", "0.6265735", "0.626167", "0.6258342", "0.62579775", "0.624918", "0.6244368", "0.6242482", "0.6241827", "0.62414217", "0.6240907", "0.62350357", "0.6223296", "0.6213916", "0.6208067", "0.6197097", "0.61936164", "0.6187142", "0.6179926", "0.6167952", "0.6165093", "0.6165093", "0.6148832", "0.61482036", "0.61462784", "0.61430496", "0.6140608", "0.61354524", "0.61299235", "0.61283326", "0.61282706", "0.612742", "0.61271286", "0.6122542", "0.61124915", "0.6112027", "0.6109708", "0.61092883", "0.6108357", "0.61076367", "0.61013234", "0.6094545", "0.609109" ]
0.0
-1
Send any uncaught error to the default error handler
function asyncHandler(fn) { return function(req, res, next) { return Promise.resolve(fn(req, res, next).catch(next)); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ErrorHandler() {}", "_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "setOnErrorHandler(handler) { return; }", "callUnhandledRejectionHandler(error) {\n const errHandler = window.onunhandledrejection;\n\n if (!errHandler) {\n return;\n }\n\n errHandler(error);\n }", "function defaultErrorHandler(error) {\n // Throw so we don't silently swallow async errors.\n throw error; // This error probably originated in a transition hook.\n}", "function errorHandler(error) { console.log('Error: ' + error.message); }", "function JitsiGlobalUnhandledRejection(event) {\n handlers.forEach(handler => handler(null, null, null, null, event.reason));\n oldOnUnhandledRejection && oldOnUnhandledRejection(event);\n} // Setting the custom error handlers.", "function setErrorHandled () {\n errorHandled = true;\n}", "function dummy_error_handler(error)\n{\n\talert(\"ERROR:\\n\"+error);\n}", "function JitsiGlobalErrorHandler(...args) {\n handlers.forEach(handler => handler(...args));\n oldOnErrorHandler && oldOnErrorHandler(...args);\n} // If an old handler exists, also fire its events.", "function genericErrorHandler(error) {\n if (error) {\n console.log(\"genericErrorHandler: Unhandled Error: %o\", error);\n }\n }", "callErrorHandler(error) {\n const errHandler = window.onerror;\n\n if (!errHandler) {\n return;\n }\n\n errHandler(null, null, null, null, error);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "function handleErrors () {\n const args = Array.prototype.slice.call(arguments);\n\n notify.onError({\n 'title': 'Task Failed [<%= error.message %>',\n 'message': 'See console.',\n 'sound': 'Sosumi' // See: https://github.com/mikaelbr/node-notifier#all-notification-options-with-their-defaults\n }).apply(this, args);\n\n beeper(); // Beep\n\n // Prevent the 'watch' task from stopping.\n this.emit('end');\n}", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "function addErrorHandlers() {\n\n\t\twindow.addEventListener(\"error\", function(error) {\n\t\t\terror.preventDefault();\n\t\t\tvar oErrorOutput = document.createElement(\"span\");\n\t\t\toErrorOutput.innerText = error.message; // use save API\n\t\t\toErrorOutput.style.cssText = \"position:absolute; top:1rem; left:1rem\";\n\t\t\tif (!document.body) {\n\t\t\t\tdocument.write(\"<span></span>\"); // add content via document.write to ensure document.body is created;\n\t\t\t}\n\t\t\tdocument.body.appendChild(oErrorOutput);\n\t\t});\n\t\twindow.addEventListener(\"unhandledrejection\", function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvar oErrorOutput = document.createElement(\"span\");\n\t\t\toErrorOutput.innerText = event.reason && event.reason.message; // use save API\n\t\t\toErrorOutput.style.cssText = \"position:absolute; top:1rem; left:1rem\";\n\t\t\tif (!document.body) {\n\t\t\t\tdocument.write(\"<span></span>\"); // add content via document.write to ensure document.body is created;\n\t\t\t}\n\t\t\tdocument.body.appendChild(oErrorOutput);\n\t\t});\n\t}", "function onErrorHandler (error) {\n console.log(error);\n this.emit('end');\n}", "function BaseErrorHandler() {\n\n }", "function defaultErrorHandler(e) {\n console.warn('Unhandled rejection: ' + (e.stack || e));\n}", "function handlerErroe(error){\r\n console.error(error.toString())\r\n this.emit('end');\r\n}", "function handleError() {\n // TODO handle errors\n // var message = 'Something went wrong...';\n }", "errorHandler(error) {\n console.log(error);\n }", "function handleErrors () {\n\tvar args = Array.prototype.slice.call(arguments);\n\n\tnotify.onError({\n\t\ttitle: 'Task Failed [<%= error.message %>',\n\t\tmessage: 'See console.',\n\t\tsound: 'Sosumi' // See: https://github.com/mikaelbr/node-notifier#all-notification-options-with-their-defaults\n\t}).apply(this, args);\n\n\tgutil.beep(); // Beep 'sosumi' again\n\n\t// Prevent the 'watch' task from stopping\n\tthis.emit('end');\n}", "function onError(error) { handleError.call(this, 'error', error);}", "function defaultErrorHandler(e) {\r\n console.warn(`Uncaught Promise: ${messageAndStack(e)}`);\r\n}", "function errorHandler (error) {\n console.error(error)\n throw new Error('Failed at server side')\n}", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "function errorHandler(error) {\n console.log(error);\n }", "function attachErrorHandlerIfApplicable() {\n if (window.onerror !== exceptionHandler) {\n previousErrorHandler = window.onerror;\n window.onerror = exceptionHandler;\n }\n }", "onerror(err) {\n this.emitReserved(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function handleErrors(error) {\n console.log('Please try again problem occured!');\n}", "function _resetHandler () {\n errorHandled = false;\n}", "function errorHandler(data) {\n console.log(\"error: \" + JSON.stringify(data));\n }", "function errorHandler(error) {\n console.log(error);\n}", "function errorHandler(error) {\n console.log(error);\n}", "function _installGlobalUnhandledRejectionHandler() {\r\n window.onunhandledrejection = _traceKitWindowOnUnhandledRejection;\r\n }", "function onUncaughtException(err) {\n console.log('Uncaught exception:', err);\n }", "onUnexpectedExternalError(e) {\n this.unexpectedErrorHandler(e);\n }", "function swallowError(error)\n{\n // If you want details of the error in the console\n console.log(error.toString());\n this.emit('end');\n}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "error(error) {\n this.__processEvent('error', error);\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)errorOrDestroy(dest,er);}// Make sure our error handler is attached before userland ones.", "gotError (error) {\n\t\tthis.handlers.onError(error) // tell the handler, we got an error\n\t}", "function commonErrorHandler (err) {\n console.log(err); \n resetToLibraryIndexPage();\n }", "function errorHandler(error, request, response) {\n response.status(500).send(error);\n}", "function errorHandler(error, request, response) {\n response.status(500).send(error);\n}", "handleGlobalErrors() {\n process.on('unhandledRejection', (reason, p) => {\n console.error(reason, 'Unhandled Rejection at Promise', p);\n });\n }", "onerror() {}", "onerror() {}", "function swallowError(error) {\n\n console.log(error.toString());\n this.emit('end');\n\n}", "function errorHandler(error, request, response, next) {\n console.error(error.message);\n console.error(error.stack);\n response.status(500).render('error_template', { error: error });\n}", "function request_error_handler(error, script_name)\n{\n\t// Handle individual errors here.\n\tif ( error == 'db_connect' )\n\t\talert('ERROR: Could not process request at this time. Database unavailable.');\n\telse if ( error == 'script_not_found' )\n\t\talert('ERROR: The script specified to handle this request does not exist.');\n\telse if ( error == 'login_required' )\n\t\talert('ERROR: Your session has timed out. Please log in again.');\n\telse if ( error == 'dirty_script_name' )\n\t\talert('ERROR: Invalid characters in script name: '+ script_name);\n\telse if ( error == 'AJAX_failed' )\n\t\talert('ERROR: The AJAX request could not be completed: '+ script_name);\n\telse\n\t\talert('ERROR: '+ error);\n}", "handleError(error) {\n throw error.response.data;\n }", "function esconderError() {\n setError(null);\n }", "function CustomError() {}", "function errorHandler(error) {\r\n showNotification(\"Error\", error.responseText);\r\n RecordError(46,JSON.stringify(error),'');\r\n}", "function handleError (err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info);\n } else {\n if (inBrowser && typeof console !== 'undefined') {\n console.error(err);\n } else {\n throw err\n }\n }\n}", "function onUncaughtException(err) {\n var err = \"uncaught exception: \" + err;\n console.log(err);\n}", "function handleError(error){\n\t\tconsole.error(\"[ERROR] \", error);\n\t}", "function installGlobalUnhandledRejectionHandler() {\n if (_onUnhandledRejectionHandlerInstalled === true) {\n return;\n }\n\n _oldOnunhandledrejectionHandler = window.onunhandledrejection;\n window.onunhandledrejection = traceKitWindowOnUnhandledRejection;\n _onUnhandledRejectionHandlerInstalled = true;\n }", "function handleError(_e,_xhr,_custom) {\n\t\t\tif (_custom) {\n\t\t\t\t_custom(e,xhr);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tTi.API.error('Error: '+JSON.stringify(_e)+'\\nServer response: '+_xhr.responseText);\n\t\t\t\tapp.ui.alert(L('error'), L('error_general'));\n\t\t\t\tTi.App.fireEvent('app:hide.loader');\n\t\t\t}\n\t\t}", "function defaultOnError (err) {\n throw err\n}", "function defaultOnError (err) {\n throw err\n}", "function addOneErrorEvent() {\n window.onerror = function (message, url, lineNo, columnNo, errorObj) {\n console.log(message, url, lineNo, columnNo, errorObj);\n var oneErrorParams = {\n message: (errorObj === null || errorObj === void 0 ? void 0 : errorObj.message) || message,\n lineNo: lineNo,\n columnNo: columnNo,\n url: url,\n type: getOnerrorType(message)\n };\n computedErrorObject(oneErrorParams);\n };\n}", "function swallowError (error) {\n\n // If you want details of the error in the console\n console.log(error.toString());\n\n this.emit('end');\n}", "error(error) {}", "function swallowError(error) {\n\n // If you want details of the error in the console\n console.log(error.toString())\n\n this.emit('end')\n}", "function handleError(err) {\n\tif (err) throw err;\n}", "function installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n\n _oldOnerrorHandler = window.onerror;\n window.onerror = traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }", "function OnErr() {\r\n}", "function errorHandler (error) {\n alert('error = ' + error);\n }", "_stopErrorHandling() {\n\t\twindow.removeEventListener( 'error', this._boundErrorHandler );\n\t\twindow.removeEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "$errorHandler(e, url, config, request) {\r\n if (e instanceof ResponseError) {\r\n throw e;\r\n }\r\n else {\r\n // Network error!\r\n throw new ResponseError('Unkown Error: ', ResponseErrors.UnknownError, e, {\r\n url, config, request\r\n });\r\n }\r\n }", "function stdErrorHandler(request, context, exception, clearRequestQueue = false) {\n //newer browsers do not allow to hold additional values on native objects like exceptions\n //we hence capsule it into the request, which is gced automatically\n //on ie as well, since the stdErrorHandler usually is called between requests\n //this is a valid approach\n try {\n if (threshold == \"ERROR\") {\n let errorData = ErrorData_1.ErrorData.fromClient(exception);\n sendError(errorData);\n }\n }\n finally {\n if (clearRequestQueue) {\n Implementation.requestQueue.clear();\n }\n }\n }", "function handleError() {\n var args = Array.prototype.slice.call(arguments);\n\n notify.onError({\n title: 'Gulp Error',\n message: '<%= error.message %>'\n }).apply(this, args);\n\n // Required, else gulp will crash after errors\n this.emit('end');\n}", "function errorHandler () {\n\t\tif ( !document.querySelector( '#zemez-core-error' ) ) {\n\t\t\tlet node = document.createElement( 'div' );\n\t\t\tnode.setAttribute( 'id', 'zemez-core-error' );\n\t\t\tnode.setAttribute( 'style', 'position: fixed; bottom: 1vh; left: 1vw; z-index: 1000; max-width: 98vw; padding: 10px 15px; border-radius: 4px; font-family: monospace; background: #f2564d; color: white;' );\n\t\t\tnode.innerText = 'There was an error on this page, please try again later.';\n\t\t\tdocument.body.appendChild( node );\n\t\t}\n\t}", "function errorHandler(error) {\n console.log(\"error occured\", error);\n alert(\"server not responding, try again later!\")\n}", "function OnErrorCallMaladie(jqXHR, status) {\n\t\t}", "function handle_error(error) {\n console.log(\"Error from server\", error);\n}", "setupErrorHandler() {\n if (this.config.errorHandler) {\n errorHandler = this.config.errorHandler;\n }\n }", "function onError(error) {\n throw error;\n}", "function generalHandler(error) {\n // TODO - Handle variety of errors properly.\n console.log(error);\n\n if ($.isEmptyObject(error.errorMsg)) {\n Notification.notifyFailure('INTERNAL_ERROR');\n }\n else {\n Notification.notifyFailure(error.errorMsg, error.prefix, error.suffix);\n }\n\n Status.resetStatus();\n\n return $q.reject('Internal error');\n }", "function sc_errorHookSet( h ) {\n __sc_errorHook = h;\n}", "function _errorHandler(request, errorText) {\n console.error((errorText || 'asyncStorage error') + ': ',\n request.error.name);\n }", "function on_error(e) {\n\tconsole.error(e, e.stack); // eslint-disable-line no-console\n\tvar div = document.createElement('div');\n\tdiv.appendChild(document.createTextNode(e.message));\n\tdocument.querySelector('.error').appendChild(div);\n}", "function defaultHandleError(err) {\n\tlogs(chalk.bold.red('\\x1b[31m Error:', err, '\\x1b[0m' )) ;\n}", "function handlerError(token, ex) {\n //store the exception\n token.result.exception = ex;\n finalizeTest(token, ex);\n }", "function on_error(e) {\n\tconsole.error(e, e.stack); // eslint-disable-line no-console\n\tvar div = document.createElement('div');\n\tdiv.appendChild(document.createTextNode(e.message));\n\tdocument.querySelector('.error').appendChild(div);\n}", "function handleError(jqXHR, textStatus, error){\n console.log(error);\n }", "onError() {}", "errorHandler(error) {\n console.log('%cError', 'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;', error.message)\n }", "function genericError(){\n output('Fatal error. Open the browser\\'s developer console for more details.');\n}", "function handleError(error) {\n console.log(error);\n}", "handleError(error) {\n return __awaiter(this, void 0, void 0, function* () {\n console.log('Default error handler caught an error');\n console.log(error);\n if (this.config.production === false) {\n yield this.errorDialogService.openErrorDialog('Unexpected Error', 'An unexpected error occurred: ' + error.message);\n }\n const errorReport = new ClientErrorReport('unknown', error.message, error.status, error.statusText, error.url);\n const clientErrorReport = yield this.reportClientError(errorReport);\n document.location.href =\n this.config.errorRoute + '?errorReportId=' + clientErrorReport._id;\n return null;\n });\n }", "onChildError(error) {\n this.emit('error', error);\n }" ]
[ "0.749333", "0.6940096", "0.68918085", "0.68904907", "0.68207073", "0.6814079", "0.67585284", "0.674889", "0.6747471", "0.67302215", "0.67267144", "0.67072356", "0.6689278", "0.6672737", "0.6672737", "0.6655419", "0.6655259", "0.6646841", "0.66360486", "0.6618822", "0.6611017", "0.6599321", "0.6559309", "0.65586144", "0.65440744", "0.6543947", "0.65355307", "0.65260804", "0.6514606", "0.6508311", "0.6471755", "0.6434104", "0.6432215", "0.6432052", "0.6432052", "0.6432052", "0.6430222", "0.6425074", "0.64158833", "0.6409568", "0.6409568", "0.6391796", "0.63872606", "0.6379954", "0.6377459", "0.63484764", "0.6339802", "0.6336727", "0.63225716", "0.63157004", "0.63056266", "0.63056266", "0.6303221", "0.63029075", "0.63029075", "0.63011956", "0.6295564", "0.6295207", "0.62890357", "0.62852204", "0.6282794", "0.6282201", "0.6263001", "0.6262926", "0.62572837", "0.62564045", "0.62483937", "0.6232157", "0.6232157", "0.6230334", "0.62252474", "0.6223354", "0.6223251", "0.6215986", "0.620631", "0.6205412", "0.62010705", "0.61955047", "0.61906767", "0.6184779", "0.6179815", "0.61634713", "0.6162521", "0.61620975", "0.6159755", "0.61565983", "0.61443377", "0.614382", "0.6129184", "0.61217093", "0.6120131", "0.6118685", "0.6114722", "0.61078787", "0.6107447", "0.61040056", "0.61008596", "0.6099389", "0.6098256", "0.60967165", "0.6091123" ]
0.0
-1
Fetches the locations, converts it to GeoJSON and renders the home view
async function renderMap(req, res) { // The only things we need to render the dots on the map is the lat long and // an identifier. We can later use this identifier to fetch the full info of a // point const locations = await database .select("id", "latitude", "longitude") .from("locations"); // Convert the raw locations to GeoJSON. Mapbox on the front-end will use this as // the initial dataset const geojson = { type: "FeatureCollection", features: locations.map(l => ({ id: l.id, type: "Feature", geometry: { type: "Point", coordinates: [l.longitude, l.latitude] } })) }; res.render("index", { locations: geojson }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadLocations() {\n fetch(\"http://localhost:3000/location/load\", {\n method: \"GET\",\n })\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n locations = data.locations;\n })\n .catch((err) => {\n console.log(`Error looking up the location, ${err}`);\n });\n }", "function loadLocations() {\n\t$.ajax({\n\t\turl: '/location',\n\t\ttype: 'GET',\n\t\tdataType: 'json',\n\t\tsuccess: function(response) { \n\t\t\tlet locations = response.locations;\t\t\t\n\t\t\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\t\t zoom: 11,\n\t\t\t center: startPosition\n\t\t\t});\n\t\t\n\t\t\tfor(var i=0; i<locations.length; i++) {\n\t\t\t\tvar newMarker = new google.maps.Marker({\n\t\t\t\t\tposition: {lat: parseFloat(locations[i].lat), lng: parseFloat(locations[i].lng)},\n\t\t\t\t\tmap: map,\n\t\t\t\t\ttitle: locations[i].title,\n\t\t\t\t\tid: locations[i].id\n\t\t\t\t});\t\t\n\t\t\t\tmarkers.push(newMarker);\n\t\t\t}\n\t\t\tupdateMarkers();\n\t\t},\n\t\tcomplete: function(xhr, status) { \n\n\t\t},\n\t\terror: function(xhr, status) { \n\n\t\t}\n\t}); \n}", "function getPlacesAndDetail(baseLoc) {\n var locs;\n //check if locations are available in the localStorage\n //if available in LocalStorage, call 'generateLocations' to load data as an array of Objects\n //if not available in LocalStorage, call 'getLocations' to fetch from data provider\n (locs = JSON.parse(localStorage.getItem(baseLoc))) ? generateLocations(locs) : getLocations(baseLoc, processInfo);\n\n //loads the location info to mapViewModel.locations\n function generateLocations(locs) {\n var noOfLocs = locs.length;\n for (i = 0; i < noOfLocs; i++) {\n var loc = new Location(locs[i]);\n mapViewModel.locations.push(loc);\n }\n }\n\n //this is the callback for getLocations\n function processInfo(error, result) {\n //if getLocations returns error, try to display the map alone centered at baseLoc\n if (error) {\n getGeocode(baseLoc, centerMap);\n return;\n }\n\n //no error from getLocations. Process data\n var resultLength = result.response.groups[0].items.length;\n for (var i = 0; i < resultLength; i++) {\n var item = result.response.groups[0].items[i];\n var loc = new Location();\n loc.name = item.venue.name;\n loc.address = item.venue.location.address ? item.venue.location.address : 'Address not available';\n loc.lat = item.venue.location.lat;\n loc.lon = item.venue.location.lng;\n loc.phone = item.venue.contact.formattedPhone ? item.venue.contact.formattedPhone : 'Not Available';\n loc.category = item.venue.categories[0].name ? item.venue.categories[0].name : 'Category not available';\n loc.marker = makeMapMarker(loc);\n mapViewModel.locations.push(loc);\n }\n\n //store the locations in localStorage\n localStorage.setItem(baseLoc, JSON.stringify(mapViewModel.locations(), replacer));\n \n //this is for JSON.stringify.\n //to ensure location.marker to have null value.\n //otherwise stringify will throw error.\n function replacer(i, obj) {\n if (i == 'marker') {\n return null;\n }\n return obj;\n }\n\n //callback for getGeocode\n //centers the map using the data returned from getGeocode\n function centerMap(error, data) {\n var centre = {lat: -34.397, lng: 150.644}; //default map center\n \n //if getGeocode returns a valid location, center the map using that location\n if (!error && data.status === 'OK' ) { \n centre = data.results[0].geometry.location;\n }\n map.setCenter(centre);\n }\n }\n}", "function renderLocationsPage(app, $container, router, auth, opt, query) {\n if (opt == null) {\n const query = query__objectToString({ resetState: 'yes' });\n router.navigate(`locations/all?${query}`, { trigger: true, replace: true });\n return;\n }\n\n return auth__checkLogin(auth).then((isLoggedIn) => {\n if (!isLoggedIn) {\n const query = query__objectToString({ redirect: Backbone.history.getFragment() });\n router.navigate(`login?${query}`, { trigger: true });\n return;\n }\n\n const {\n redirectTo = 'Home',\n redirectToFragment = 'home',\n resetState\n } = query__stringToObject(query);\n $container.html(`<p><a href=\"#${redirectToFragment}\">Back to ${redirectTo}</a></p>`);\n\n const breadcrumbs = [{ name: app.name, link: '#home' }, { name: 'Locations', link: '#locations' }];\n\n const views = [\n {\n title: 'All Locations',\n fragment: `locations/all?${query__objectToString({ resetState: 'yes' })}`\n }\n ];\n\n const definition = {\n columns: [],\n order: [],\n searchCols: []\n };\n\n let stateSaveWebStorageKey;\n\n const datatable_columns = locations_datatable_columns(auth);\n\n switch (opt) {\n default:\n breadcrumbs.push({ name: 'All' });\n $container.append('<h2>All Locations</h2>');\n views[0].isCurrent = true;\n stateSaveWebStorageKey = `locations__${opt}`;\n\n definition.columns.push(\n Object.assign({}, datatable_columns.action, {\n render(data) {\n const href = `#locations/${opt}/${data}?${query__objectToString({ resetState: 'yes' })}`;\n return `<a href=\"${href}\" class=\"btn btn-default dblclick-target\">Open</a>`;\n }\n }),\n\n datatable_columns.site_name,\n datatable_columns.address,\n\n datatable_columns.latest_note__date,\n datatable_columns.latest_note__note,\n\n datatable_columns.__CreatedOn,\n datatable_columns.__ModifiedOn,\n datatable_columns.__Owner,\n datatable_columns.__Status\n );\n\n definition.order.push([1, 'asc']);\n\n definition.searchCols[definition.columns.length - 1] = { search: 'Active' };\n }\n\n if (resetState === 'yes') {\n sessionStorage.removeItem(stateSaveWebStorageKey);\n }\n\n return Promise.resolve().then(() => {\n return renderDatatable($container, definition, {\n auth,\n url: '/* @echo C3DATA_LOCATIONS_URL */',\n\n newButtonLabel: 'New Location',\n newButtonFragment: `locations/${opt}/new`,\n\n stateSaveWebStorageKey,\n\n views\n });\n }).then(() => {\n app.setBreadcrumb(breadcrumbs, true);\n app.setTitle('Locations');\n }, (error) => {\n console.error(error); // eslint-disable-line no-console\n });\n }, (error) => {\n console.error(error); // eslint-disable-line no-console\n });\n}", "function fetchGeoData(){\n $.ajax({\n dataType: \"json\",\n url: \"data/map.geojson\",\n success: function(data) {\n $(data.features).each(function(key, data) {\n geoDataLocations.push(data);\n });\n startMap();\n },\n error: function(error){\n console.log(error);\n return error;\n }\n });\n }", "static list() {\n return api_base_1.default.request('locations/').then((locations) => {\n return locations.data.map(each => new Location_1.default(each));\n });\n }", "function getLocations(bounds) {\n\n const url = \"/api/v1/stores?lat1=\" + bounds.getNorthEast().lat() + \"&lat2=\"\n + bounds.getSouthWest().lat() + \"&lng1=\" + bounds.getNorthEast().lng()\n + \"&lng2=\" + bounds.getSouthWest().lng();\n\n // Query the backend to refresh results.\n $.getJSON(url, updateView);\n}", "loadLocationData() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/location/\", {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(obj => this.processLocationData(obj));\n }", "function renderLocationScreen(data){\r\n\r\n // loop through data for markers\r\n for(var i=0; i<data.objects.length; i++){\r\n\r\n // create object\r\n var myLoopObject = {\r\n garageName: data.objects[i].name,\r\n garageLat: data.objects[i].latitude,\r\n garageLong: data.objects[i].longitude,\r\n garageDistance: -1,\r\n garageUpdated: takeTime(data.objects[i].time),\r\n garageAddress: data.objects[i].address,\r\n garageSpots: data.objects[i].spots\r\n //garageID: data.objects[i].ID\r\n };\r\n garages.push(myLoopObject);\r\n }\r\n\r\n getTemplateAjax('./templates/location.handlebars', function(template) {\r\n handlebarsFormatDateForDisplay();\r\n jqueryNoConflict('#rampContent').html(template(data));\r\n });\r\n return garages;\r\n }", "function getLocations() {\n return $http.get('location.json')\n .then(successFn, errorFn);\n }", "function getLocation() {\n $.ajax({\n url: base_url + \"users/location\",\n method: \"GET\",\n headers: {\n token: localStorage.getItem(\"access_token\")\n }\n })\n .done(response => {\n console.log(response)\n $(\"#location\").empty()\n $(\"#location\").append(`\n <div class=\"card border-info mb-3\" style=\"max-width: 18rem;\">\n <div class=\"card-header\">Location</div>\n <div class=\"card-body text-info\">\n <h5 class=\"card-title\">Region: Indonesia</h5>\n <p class=\"card-text\">City: ${response.wheater.city_name}</p>\n <p class=\"card-text\">Latitude: ${response.wheater.lat}</p>\n <p class=\"card-text\">Longitude: ${response.wheater.lon}</p>\n </div>\n `)\n })\n .fail(err => {\n console.log(err)\n })\n }", "function loadSampleLocations() {\n $.ajax({\n url: \"/api/sample-locations\",\n data: {},\n success: function(data, status) {\n if (status === \"success\") {\n var sampleLocations = data.sampleLocations;\n\n createMarkersForMultiplePlaces(sampleLocations);\n }\n },\n error: function(error, status) {\n if (status === \"error\") {\n displayErrorMessage(\n \"Error: There was an error in retrieving sample locations!\"\n );\n }\n }\n });\n}", "function addGeoJSON() {\r\n $.ajax({\r\n url: \"https://potdrive.herokuapp.com/api/map_mobile_data\",\r\n type: \"GET\",\r\n success: function(data) {\r\n window.locations_data = data\r\n console.log(data)\r\n //create markers from data\r\n addMarkers();\r\n //redraw markers whenever map moves\r\n map.on(plugin.google.maps.event.MAP_DRAG_END, addMarkers);\r\n setTimeout(function(){\r\n map.setAllGesturesEnabled(true);\r\n $.mobile.loading('hide');\r\n }, 300);\r\n },\r\n error: function(e) {\r\n console.log(e)\r\n alert('Request for locations failed.')\r\n }\r\n }) \r\n }", "function getAllLocations(){\n\t$.ajax({\n\t\turl: \"http://pokeapi.co/api/v2/location?limit=10\",\n\t\tsuccess: getAllLocationsCallback\n\t})\n}", "function fetchMarkers() {\n fetch('/markers').then(response => response.json()).then((markers) => {\n markers.forEach(\n (marker) => { \n createMarkerForDisplay(marker.lat, marker.lng, marker.content, marker.address);\n createListForDisplay(marker.content,marker.address)});\n});\n}", "function loadLocations(){\n var result = LocationsService.get({param:AuthService.getId()}, function() {\n $scope.locations = result.directions;\n }, function(){\n Loading.showText('No se pudo cargar los taxistas.');\n Loading.hideTimeout();\n });\n }", "function loadLocations(){\n var result = LocationsService.get({param:AuthService.getId()}, function() {\n $scope.locations = result.directions;\n }, function(){\n Loading.showText('No se pudo cargar los taxistas.');\n Loading.hideTimeout();\n });\n }", "fetchLocations() {\n let url = \"https://5f4529863fb92f0016754661.mockapi.io/locations\"\n fetch(url)\n .then(response => response.json())\n .then(data => {\n this.setState({ locations: data })\n })\n }", "function update()\n{\n var xhr,\n url;\n \n // clear any existing markers\n map.clearOverlays();\n\n // get map's bounds\n var bounds = map.getBounds();\n \n // query for the five cities in the view\n // instantiate XMLHttpRequest object\n try {\n xhr = new XMLHttpRequest();\n } catch (e) {\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n // handle old browsers\n if (xhr === null) {\n alert(\"Ajax not supported by your browser!\");\n return;\n }\n \n url = \"proxy.php?sw=\" +\n bounds.getSouthWest().lat() + \",\" + bounds.getSouthWest().lng() +\n \"&ne=\" +\n bounds.getNorthEast().lat() + \",\" + bounds.getNorthEast().lng();\n\n xhr.onreadystatechange = function() {\n var infos,\n xhtml,\n i,\n articles,\n j;\n \n if (xhr.readyState === 4) {\n document.getElementById(\"progress\").style.display = \"none\";\n if (xhr.status === 200) {\n infos = eval(\"(\" + xhr.responseText + \")\");\n for (i = 0; i < infos.length; i++) {\n articles = \"\";\n for (j = 0; j < infos[i].articles.length; j++) {\n articles += (\"<li>\" + \n \"<a href='\" + infos[i].articles[j].link + \"'>\" +\n infos[i].articles[j].title +\n \"</a>\" +\n \"</li>\");\n }\n addMarker(\n new GLatLng(infos[i].Latitude, infos[i].Longitude),\n \"<b>\" + infos[i].City + \", \" + infos[i].State + \"</b>\" +\n \"<br />\" +\n \"<ul>\" +\n articles +\n \"</ul>\"\n );\n }\n } else {\n alert(\"Error with Ajax call!\");\n }\n }\n };\n xhr.open(\"GET\", url, true);\n xhr.send(null);\n document.getElementById(\"progress\").style.display = \"block\";\n\n // mark home if within bounds\n if (bounds.containsLatLng(home))\n {\n // prepare XHTML\n var xhtml = \"<b>Home Sweet Home</b>\";\n\n // add marker to map\n addMarker(home, xhtml);\n }\n\n // TODO: contact proxy, add markers\n}", "function loadLocations() {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', '/departments/get-departments/', true);\n xhr.send();\n xhr.onreadystatechange = function() {\n console.log( 'appa')\n if (this.readyState != 4) return;\n if (this.status != 200) {\n console.log( 'ошибка: ' + (this.status ? this.statusText : 'запрос не удался') );\n return;\n } else {\n console.log( xhr.responseText ); // responseText -- текст ответа.\n \n try {\n var locations = JSON.parse(xhr.responseText);\n console.log(locations);\n } catch (e) {\n console.log( \"Некорректный ответ \" + e.message );\n }\n \n initMap(locations);\n }\n }\n }", "function fromLocationDisplay() {\n const results = JSON.parse($(\"#data_res\").text());\n const long = $(\"#long\").text();\n const lat = $(\"#lat\").text();\n const eu_aqi = JSON.parse($(\"#eu_aqi\").text());\n map.setCenter(JSON.parse(\"[\" + long + \",\" + lat + \"]\"));\n map2.setCenter(JSON.parse(\"[\" + long + \",\" + lat + \"]\"));\n buildDataTable(results.data, results.fields, eu_aqi, results.devices);\n var sendToAllProcess = {};\n for (var property in results.devices) {\n if (results.devices.hasOwnProperty(property)) {\n sendToAllProcess[property] = {\n fields: results.fields,\n records: results.devices[property]\n };\n }\n }\n processAllResult(sendToAllProcess);\n addMarkerUser(parseFloat(long), parseFloat(lat), map);\n map.setZoom(11);\n map2.setZoom(13);\n prepPolygons(results.zones, results.fields);\n addMarkerUser(parseFloat(long), parseFloat(lat), map2);\n}", "function getRestrooms(lat,lng){\n\tvar url = \"http://fortytonone.herokuapp.com/search_bathrooms.json?\";\n\turl += \"lat=\"+lat+\"&\";\n\turl += \"long=\"+lng;\n\t$.get(url, function (response) {\n\t\t// hide the loading icon\n\t\t$('#loading').hide();\n\t\t// Make the initial map\n \t\tmakeMap(lat,lng); \t\t\n\n \t\t// Send each address to be geocoded. \n for (var i in response.bathrooms){\n \tconsole.log(response.bathrooms[i].name);\n \t/*\n \t sending the name to the geoCode func too, so that it's available in the callback \n \t \t-- there must be a more sensible way!\n \t*/\n \tgeoCodeAddress(response.bathrooms[i].location,response.bathrooms[i].name,function(posObj){ \n \t\t//console.log(posObj);\n \t\t// set up markers\n \t\tvar myLatlng = new google.maps.LatLng(posObj.la,posObj.lo);\n\t \tvar marker = new google.maps.Marker({\n\t\t\t\t\tmap: map,\n\t\t\t\t\tposition: myLatlng,\n\t\t\t\t\tinfowindow_content: posObj.location_name // custom property to set name of marker\n\t\t\t\t});\n\t\t\t\t// set up info windows\n\t\t\t\tgoogle.maps.event.addListener(marker, 'click', function(){\n\t\t \t\t\tinfowindow.setContent(this.infowindow_content);\n\t\t \t\t\tinfowindow.open(map, this);\n\t\t \t\t});\t\n\t });\t\n } \n\t});\t\n}", "function getLocations() {\n return $.ajax({\n type: \"get\",\n async: false,\n url: '/mapapi/getAllLocation'\n });\n}", "function showPosition(position) {\n\n // user's current latitude and longitude\n var lati = position.coords.latitude;\n var long = position.coords.longitude;\n\n // push user's position into global userlatlng array for reference outside initMap\n userlatlng.push(lati, long);\n // userLocation object for Maps renderer\n userLocation = { lat: lati, lng: long };\n\n // =================== YELP ================= //\n\n // Client side POST request to stored back end API built for App\n $.post(\"/api/yelp\", { latitude: lati, longitude: long }, function(data) {\n //Push a random retaurant into the restaurant array\n // Data returns an array of 10 restaurant objects\n // create a yelpSearch variable that grabs a random restaurant from data array\n var yelpSearch = data[Math.floor(Math.random() * data.length)];\n console.log(yelpSearch);\n restaurant.push(yelpSearch);\n //Push the restaurant coordintes into the restlatlng array\n restlatlng.push(\n yelpSearch.coordinates.latitude,\n yelpSearch.coordinates.longitude\n );\n //Define the restaurant location as an object with the coordinates\n var restLocation = {\n lat: yelpSearch.coordinates.latitude,\n lng: yelpSearch.coordinates.longitude\n };\n\n // DISPLAY RESTAURANT DATA ON PAGE\n $(\"#rest-name\").html(yelpSearch.name);\n $(\"#rest-city\").html(yelpSearch.location.city);\n //Breakup the titles and stats to style them\n //Rating\n var yelpRating = $(\"<p>\").attr(\"class\", \"ratingStat\").text(yelpSearch.rating);\n // var ratingTitle = $(\"<p>\").attr(\"class\", \"rating-title\");\n $(\"#rest-rating\").html(yelpRating);\n //Price\n var yelpPrice = $(\"<p>\").attr(\"class\", \"ratingStat\").text(yelpSearch.price);\n $(\"#rest-price\").html(yelpPrice);\n //ReviewCount\n var yelpReview = $(\"<p>\").attr(\"class\", \"ratingStat\").text(yelpSearch.review_count);\n $(\"#rest-review\").html(yelpReview);\n //Load yelp image\n $(\"#rest-image\").attr(\"src\", yelpSearch.image_url);\n //Restaurant OPEN or CLOSED\n\n if (yelpSearch.is_closed === false) {\n var closed = $(\"<p>\").attr(\"class\", \"statusClosed\").text(\"closed\");\n var open = $(\"<p>\").attr(\"class\", \"statusOpen\").text(\"open\");\n var currently = $(\"<p>\").attr(\"class\", \"status-title\").text(\"currently\");\n $(\"#rest-open\").html(currently);\n $(\"#rest-open\").html(open);\n } else {\n $(\"#rest-open\").html(currently);\n $(\"#rest-open\").html(open);\n }\n //Phone # Styling\n var phone = $(\"<p>\").attr(\"class\", \"status-title\").text(\"phone\");\n var yelpPhone = $(\"<p>\").attr(\"class\", \"yelpPhone\").text(yelpSearch.display_phone);\n $(\"#rest-phone\").html(phone);\n $(\"#rest-phone\").html(yelpPhone);\n\n //Populates the restaurant category type regardless of how many there are\n console.log(yelpSearch.categories);\n for (var i = 0; i < yelpSearch.categories.length; i++) {\n var badgeSpan = $(\"<div>\").attr(\"class\", \"new badge\");\n var badgeText = $(\"<p>\").attr(\"class\", \"p-small\");\n var badgeType = yelpSearch.categories[i].alias;\n badgeText.html(badgeType);\n badgeSpan.html(badgeText);\n\n //Targets the holder div where the badges go\n $(\"#rest-type\").html(badgeSpan);\n console.log(badgeSpan);\n console.log(badgeText);\n console.log(badgeType);\n }\n //Address breakdown\n var addressTitle = $(\"<p>\").attr(\"class\", \"status-title\").text(\"Address\");\n var address1 = $(\"<h5>\").text(yelpSearch.location.display_address[0]);\n var address2 = $(\"<h5>\").text(yelpSearch.location.display_address[1]);\n $(\"#rest-address\").html(addressTitle);\n $(\"#rest-address\").append(address1);\n $(\"#rest-address\").append(address2);\n \n //Button event handler\n $(\"#tryLater\").on(\"click\", function(event) {\n event.preventDefault();\n var toastHTML = \"<h6 id='toast' class='teal z-depth-5 center-align' style='border-radius: 3px; padding:25px'>Restaurant added to User Profile.</h6>\"\n M.toast({html: toastHTML}, {displayLength: 4000})\n $.post(\"/api/restaurants\", yelpSearch, function () {\n console.log(\"Restaurant added to database.\");\n });\n });\n\n //Initialize google map\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: restLocation,\n disableDefaultUI: true,\n styles: snazzy,\n zoom: 10\n // gestureHandling: \"none\"\n });\n\n //Enable css styling for the google markers\n var myoverlay = new google.maps.OverlayView();\n myoverlay.draw = function() {\n //this assigns an id to the markerlayer Pane, so it can be referenced by CSS\n this.getPanes().markerLayer.id = \"markerLayer\";\n };\n myoverlay.setMap(map);\n\n // Google directions api\n var directionsService = new google.maps.DirectionsService();\n var directionsDisplay = new google.maps.DirectionsRenderer();\n\n function calculateAndDisplayRoute(directionsService, directionsDisplay) {\n directionsService.route(\n {\n origin: userlatlng.toString(),\n destination: restlatlng.toString(),\n travelMode: \"DRIVING\"\n },\n function(response, status) {\n if (status === \"OK\") {\n new google.maps.DirectionsRenderer({\n map: map,\n directions: response,\n suppressMarkers: true\n });\n var leg = response.routes[0].legs[0];\n makeMarker(leg.start_location, icons.start, \"title\", map);\n makeMarker(leg.end_location, icons.end, \"title\", map);\n } else {\n window.alert(\"Directions request failed due to \" + status);\n }\n }\n );\n }\n\n // Set the marker locations\n var makeMarker = function(position, icon, title, map) {\n new google.maps.Marker({\n position: position,\n map: map,\n icon: icon,\n title: title\n });\n }\n\n //Stylize the icons\n var icons = {\n start: new google.maps.MarkerImage(\n // URL\n \"../images/Logo-Export/FF-User-Icon.png\",\n // (width,height)\n new google.maps.Size(62, 61),\n // The origin point (x,y)\n new google.maps.Point(0, 0),\n // The anchor point (x,y)\n new google.maps.Point(22, 32)\n ),\n end: new google.maps.MarkerImage(\n // URL\n \"../images/Logo-Export/Food-Finder-Map-Marker.png\",\n // (width,height)\n new google.maps.Size(51, 69),\n // The origin point (x,y)\n new google.maps.Point(0, 0),\n // The anchor point (x,y)\n new google.maps.Point(22, 32)\n )\n };\n\n calculateAndDisplayRoute(directionsService, directionsDisplay);\n directionsDisplay.setMap(map);\n });\n }", "componentDidMount() {\n this.state.alllocations.map(location => {\n return fetchJsonp(\n `https://en.wikipedia.org/w/api.php?action=opensearch&search=${\n location.title\n }&format=json&callback=wikiCallback`\n )\n .then(response => response.json())\n .then(responseData => {\n let fetchedInfo = [\n ...this.state.locationsInfo,\n [responseData, responseData[2][0], responseData[3][0]]\n ];\n this.updateData(fetchedInfo);\n })\n .catch(function() {\n alert('Failed to fetch information');\n });\n });\n }", "function DisplayGEOJsonLayers(){\n map.addLayer({ \n //photos layer\n \"id\": \"photos\",\n \"type\": \"symbol\",\n \"source\": \"Scotland-Foto\",\n \"layout\": {\n \"icon-image\": \"CustomPhoto\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg'); // Place polygon under this labels.\n\n map.addLayer({ \n //selected rout section layer\n \"id\": \"routes-today\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'housenum-label'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"routes\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(120, 180, 244, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"routes-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'routes'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"walked\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(80, 200, 50, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"walked-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'walked'); // Place polygon under this labels.\n\n map.addLayer({\n \"id\": \"SelectedMapLocationLayer\",\n \"type\": \"symbol\",\n \"source\": \"SelectedMapLocationSource\",\n \"layout\": {\n \"icon-image\": \"CustomPhotoSelected\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg');\n //ClickbleMapItemCursor(); //Now that the layers a loaded, have the mouse cursor change when hovering some of the layers\n NewSelectedMapLocation();\n\n}", "function renderMarkers() {\n allListings.forEach(function(listing) {\n var formattedAddress = listing.street + ' ' + listing.city + ',' +\n listing.state + ' ' + listing.zip;\n var id = listing._id;\n geocodeAddress(formattedAddress, id);\n });\n setAllMap();\n}", "function getGeoWeather() {\n \tweather.getGeoWeather()\n\t\t.then((results) => {\n\t\t\tui.display(results);\n\t\t})\n\t\t.catch((err) => err);\n}", "function renderStops() {\n // If a marker has not already been placed by clicking, get the lat lng values from the input\n if (markers[0] == null) {\n var lat = athens.lat;\n var lng = athens.lng;\n let location = new google.maps.LatLng(lat, lng)\n placeMarker(location);\n // location_marker = markers[0]\n } else {\n var lat = markers[0].getPosition().lat();\n var lng = markers[0].getPosition().lng();\n }\n location_marker = markers[0]\n\n // console.log('lat ' + lat + ' lng ' + lng)\n\n // Get the rest of what we need and render the stops\n const distance = slider.value;\n const route_onestop_id = selector.value;\n\n const url = 'http://localhost:3000/api/stops/stops-within/' + distance +\n '/center/' + lat + ',' + lng + '/route/' + route_onestop_id;\n\n // remove any stops that might be currently displayed\n map.data.forEach(function(feature) {\n map.data.remove(feature);\n })\n\n // NOTE: This uses cross-domain XHR, and may not work on older browsers.\n map.setCenter(location_marker.getPosition());\n map.setZoom(14);\n\n $.getJSON(url, function(data) {\n var feature = map.data.addGeoJson(data);\n });\n\n map.data.addListener('click', function(event) {\n var feat = event.feature;\n var html = \"<b>\" + feat.getProperty('name') + \"</b><br>\" + feat.getProperty('tags')['stop_desc'];\n\n // Maybe I can query Mongo here based on onestop-id and get routes info through that\n // add info of routes\n html += \"<br><b>Δρομολόγια (short name):</b>\"\n const routes_info = feat.getProperty('routes_serving_stop');\n for (i = 0; i < routes_info.length; i++) {\n html += \"<br>\" + routes_info[i]['route_name'];\n }\n infowindow.setContent(html);\n infowindow.setPosition(event.latLng);\n infowindow.setOptions({ pixelOffset: new google.maps.Size(0, -34) });\n infowindow.open(map);\n });\n }", "function initializeMap() {\n geocoder = new google.maps.Geocoder();\n\n const urlParams = new URLSearchParams(window.location.search);\n let servletUrl = \"/polling-stations?electionId=\" + urlParams.get(\"electionId\") + \"&address=\" + urlParams.get(\"address\");\n\n document.getElementById('polling-stations-map').style.height = '600px';\n\n fetch(servletUrl)\n .then(response => response.json())\n .then((pollingStationList) => {\n if (pollingStationList === undefined || pollingStationList.length == 0) {\n document.getElementById(\"polling-stations-map\").style.display = \"none\";\n document.getElementById(\"polling-station-status\").innerText = \n \"Sorry, we can't find any polling stations for this election near your address.\";\n console.log(\"displayed polling station message\");\n return;\n }\n\n document.getElementById(\"polling-station-status\").innerText = \"Polling stations near you for this election:\";\n document.getElementById(\"polling-stations-map\").style.display = \"block\";\n \n const address = urlParams.get('address');\n \n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == 'OK') {\n map = new google.maps.Map(document.getElementById(\"polling-stations-map\"), {\n center: results[0].geometry.location,\n zoom: 13\n });\n console.log(\"Created map\");\n \n const homeMarker = new google.maps.Marker({\n position:results[0].geometry.location, \n map:map,\n icon: \"https://img.icons8.com/ios-filled/50/000000/home.png\",\n draggable: false\n });\n console.log(\"Created user address marker\");\n \n pollingStationList.forEach((pollingStation) => {\n\n let descriptionTemplate = \n `<div id=\"content\">\n <div id=\"siteNotice\"></div> \n <h3 id=\"firstHeading\" class=\"firstHeading\"> {{pollingStation.name}} </h3> \n <div id=\"bodyContent\">\n <p> {{pollingStation.address}} </p>\n <p>Open {{pollingStation.pollingHours}} beginning {{pollingStation.startDate}}\n and until {{pollingStation.endDate}}.</p>\n <p> {{findType pollingStation.locationType}} </p>\n {{#if pollingStation.sources}}\n <p><i> Sources: {{withCommas pollingStation.sources}}</i></p>\n {{/if}}\n </div>\n </div>`;\n\n let template = Handlebars.compile(descriptionTemplate);\n let context = {pollingStation: pollingStation};\n let description = template(context);\n \n addPollingStation(pollingStation.address, map, pollingStation.name, description);\n console.log(\"Added polling station marker\");\n });\n } else {\n alert('Geocode was not successful for the following reason: ' + status);\n }\n });\n });\n}", "function getGeoLocation() {\n showPage('results');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(returnedPosition) {\n let position = {};\n position.longitude = returnedPosition.coords.longitude;\n position.latitude = returnedPosition.coords.latitude;\n getCityByLocation(position);\n });\n }\n}", "function populateMap(location){\n //get all items from geojson and set them as \"marker\"\n geoDataLocations.forEach(function(marker){\n var userDistance;\n //calculate user distance\n if(location){\n userDistance = getDistance(userCoords, L.polygon(marker.geometry.coordinates).getBounds().getCenter());\n }else{\n userDistance = \"Not available\"\n }\n //take each marker coordinates and add them to map\n L.polygon(marker.geometry.coordinates).addTo(mymap)\n //chain bindpopup to add properties\n .bindPopup(\"<h3>\"+marker.properties.name+\"</h3><p style='margin:10px 0'>\"+marker.properties.slogan+\"</p><img src='../logotypes/\"+marker.properties.logo+\"' alt='bears'><p class='user-distance'>Distance: \"+userDistance+\"</p>\"); \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}", "getRestaurantsFromAPI(lat, lng) {\n const url =\n \"https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\" +\n lat +\n \",\" +\n lng +\n \"&radius=2000&type=restaurant&key=AIzaSyDpZpcBF6Q7iisYJXN4_hbI2DUZbmrmauk\";\n\n this.resetMarkersAndRestaurant();\n fetch(url)\n .then(data => data.json())\n .then(resp => {\n let newMarkers = [];\n let newRestaurants = [];\n resp.results.forEach(r => {\n const imgUrl =\n \"https://maps.googleapis.com/maps/api/streetview?size=600x300&location=\" +\n r.geometry.location.lat +\n \",\" +\n r.geometry.location.lng +\n \"&pitch=10&fov=90&heading=235&key=key\";\n newMarkers = newMarkers.concat([\n {\n lat: r.geometry.location.lat,\n lng: r.geometry.location.lng,\n restaurantName: r.name\n }\n ]);\n newRestaurants.push(\n this.setRestaurant(\n r.name,\n r.vicinity,\n [],\n r.rating,\n r.place_id,\n imgUrl\n )\n );\n });\n this.addMarkers(newMarkers);\n this.addRestaurants(newRestaurants);\n });\n }", "function queryLocations() {\t\t \n\tvar selection = document.getElementById('querySelector');\n\tvar msg = selection.options[selection.selectedIndex].value;\n\t\n $.ajax({\n url: \"query\",\n type: 'POST',\n dataType: 'json',\n data: msg \n }).done(function(resp){\n \tvar cityCircle;\n \tvar circleColor;\n \tvar dataLimit = 8;\n \tqueryResults = resp;\n \t\n \t$(\"#infoScreen\").html(\"\");\n \tfor(var i=0; i<queryResults.length; i++){ \n \t\t// Displays sample of data received in text format\n \t\tif(i<dataLimit){\n\t \t$(\"#infoScreen\").append(i+1 + \". Long: \" + queryResults[i].longitude +\n\t \t\t\t\", Lat: \" + queryResults[i].latitude + \n\t \t\t\t\", State: \" + queryResults[i].state + \"<br>\");\t\n\t \tif(i == (dataLimit-1))\n\t \t\t$(\"#infoScreen\").append(\"...\");\n \t\t}\n \t\n \tif(queryResults[i].state === \"Online\")\n \t\tcircleColor = 'green';\n \telse\n \t\tcircleColor = 'red';\n \t\t\n \t// Draws the location spots on google map\n \tvar populationOptions = {\n \t\t strokeColor: circleColor,\n \t\t strokeOpacity: 0.8,\n \t\t strokeWeight: 2,\n \t\t fillColor: circleColor,\n \t\t fillOpacity: 0.35,\n \t\t map: map,\n \t\t center: new google.maps.LatLng(queryResults[i].latitude, \n \t\t \t\t queryResults[i].longitude),\n \t\t radius: 3\n \t\t };\n \t\t // Add the circle for this city to the map.\n \t\t cityCircle = new google.maps.Circle(populationOptions);\n \t} \t \t\t\n });\n}", "function showAllHotelMap(){\n\t\n\tvar array_hotels = [];\n\tvar array_links = {};\n\t$(\"a.map-link\").each(function(i,e){\n array_hotels.push($(e).attr(\"tab\"));\n\t});\n\t$(\"span.bold-blue-text a\").each(function(i,e){\n var href = $(e).attr(\"href\");\n var h_key = href.match(/\\d+\\?/)[0].match(/\\d+/)[0];\n array_links[h_key] = $(e).outer();\n\t});\n\t\n\t$(\"#map_canvas\").html(\"\");\n $(\"#map_canvas\").mask(\"Loading...\");\n\n\t//send request to get location of current hotel and other places around it\n\t$.ajax({\n\t\turl: allHotelServiceUrl,\n\t\tdata: {'hotelIds' : array_hotels},\n\t\ttype: 'GET',\n\t\tdataType: 'JSON',\n\t\tsuccess: function(response){\n\t\t\t//process data\n\t\t\tif(response.data != false){\n\t\t\t\tvar hotel = response.data.hotel;\n\t\t\t\t\n\t\t\t\tvar places = response.data.places;\n\n\n\t\t\t\t//display the map here\n\t\t\t\tvar center = new google.maps.LatLng(places[0][\"Latitude\"], places[0][\"Longitude\"]);\n\n\t\t\t\t//initialize map with provided center\n\t\t\t\tinitializeMap(center);\n\n\t\t\t\t//info\n\t\t\t\t var html = \"<div>\" + array_links[places[0][\"EANHotelID\"].toString()] + \"<br />\" + places[0][\"Address1\"] + \"</div>\";\n\t\t\t\t var infoWindow = new google.maps.InfoWindow({\n\t\t\t\t \tcontent: html\n\t\t\t\t })\n\n\t\t\t\t//display hotel at the center of the map\n\t\t\t\tmainMarker = new google.maps.Marker({\n\t\t\t\t \tposition: center,\n\t\t\t\t \t//title: places[0][\"Name\"] + \"\\n\" + places[0][\"Address1\"] ,\n\t\t\t\t \tmap: map,\n\t\t\t\t \ticon: '/assets/hotel.png'\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//infoWindow.open(map, mainMarker);\n\t\t\t\tgoogle.maps.event.addListener(mainMarker, 'mouseover', function(){\n\t\t\t\t\t\tinfoWindow.setContent(html);\n\t\t\t\t\t\tinfoWindow.open(map, mainMarker);\n\t\t\t\t\t})\n\t\t\t\t\n\t\t\t\t//places.splice(0, 1);\n\t\t\t\tvar subInfoWindow = new google.maps.InfoWindow();\n\t\t\t\t//display other places on the map\n\t\t\t\t$.each(places, function(index, place){\n\t\t\t\t\tvar desc = place[\"Name\"] + \"\\n\" + place[\"Address1\"];\n\t\t\t\t\tvar html = \"<div>\" + array_links[place[\"EANHotelID\"].toString()] + \"<br />\" + place[\"Address1\"] + \"</div>\";\n\t\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\t\tposition: new google.maps.LatLng(place[\"Latitude\"], place[\"Longitude\"]),\n\t\t\t\t\t\t//title: desc,\n\t\t\t\t\t\tmap: map,\n\t\t\t\t \t\ticon: '/assets/hotel.png'\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t\totherMarkers.push(map,marker);\n\t\t\t\t\t//subInfoWindow.open(map, marker);\n\t\t\t\t\tgoogle.maps.event.addListener(marker, 'mouseover', function(){\n\t\t\t\t\t\tsubInfoWindow.setContent(html);\n\t\t\t\t\t\tsubInfoWindow.open(map, marker);\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t $(\"#map_canvas\").unmask();\n\t }else{\n\t \t$(\"#map_canvas\").text(\"No maps found\")\n\t \t$(\"#map_canvas\").unmask();\n\t \t//alert(\"No maps found\");\n\t \t\n\t \t\n\t }\n\t\t}\n\t})\n}", "function initialize() {\r\n var mapOptions = {\r\n zoom: 12,\r\n center: kampala\r\n };\r\n\r\n map = new google.maps.Map(document.getElementById('map-canvas'),\r\n mapOptions);\r\n\r\n\t$.getJSON('/map-geojson/stations', function(data){\r\n\t\t// var latLng = new google.maps.LatLng(data)\r\n\t\t$.each(data, function(key, value){\r\n\t\t\tvar coord = value.geometry.coordinates;\r\n\t\t\tvar latLng = new google.maps.LatLng(parseFloat(coord[0]), parseFloat(coord[1]));\r\n\r\n\t\t\tvar content = '<div id=\"content\">'+\r\n\t\t\t\t'<h2>' + value.properties.title + '</h2>'+\r\n\t\t\t\t'<p>' + \"<a href='\"+value.properties.url +\"'>Readings</a>\" + '</p>'+\r\n\t\t\t\t'</div>'\r\n\t\t\t//create an informatin window\t\r\n\t\t\tvar infowindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: content\r\n\t\t\t})\r\n\t\t\t//create a marker\r\n\t\t\tvar marker = new google.maps.Marker({\r\n\t\t\t\tposition: latLng,\r\n\t\t\t\tmap: map,\r\n\t\t\t\ttitle: value.properties.title\r\n\t\t\t});\r\n\t\t\t//add click event listener\r\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function(){\r\n\t\t\t\tinfowindow.open(map, marker);\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n\r\n}", "function gethotels() {\n var data;\n\n $.ajax({\n url: 'https://api.foursquare.com/v2/venues/search',\n dataType: 'json',\n data: 'client_id=JDZ2RTQ3D1VSVUOY42A5ROL0IASDWQFIPYQUO315HFBY1HC4&client_secret=ILBIH43ZVUQN4A0R3KU5IBZEX1VHXAUTHPBS10KQVMKEOXDU&v=20161016%20&ll=29.9090984,73.8439466%20&query=hotel',\n async: true,\n }).done(function (response) {\n data = response.response.venues;\n data.forEach(function (hotel) {\n foursquare = new Foursquare(hotel, map);\n self.hotelList.push(foursquare);\n });\n self.hotelList().forEach(function (hotel) {\n if (hotel.map_location()) {\n google.maps.event.addListener(hotel.marker, 'click', function () {\n self.populateInfoWindow(hotel);\n });\n }\n });\n }).fail(function (response, status, error) {\n $('#query-summary').text('Hotels not loaded');\n });\n }", "function Locations(props) {\n const displayData = () => {\n let data = props.data;\n if(data.loading) {\n return (\n <div>\n Loading locations...\n </div>\n );\n } else {\n return data.locations.map(location => {\n return (\n <li key={ location.id }>\n <h1>{ location.name }</h1>\n <ul>\n {location.people.map(person => {\n return(\n <li>\n <p>{ person.name }</p>\n </li>\n );\n })}\n </ul>\n </li>\n );\n });\n }\n };\n return (\n <div>\n <ul>\n {displayData()}\n </ul>\n </div>\n );\n}", "function retriveData() {\r\n jqueryNoConflict.getJSON(dataSource, renderLocationScreen);\r\n }", "function getRestaurants(latlng) {\n\n currentLocation = latlng;\n createMarker();\n map.panTo(latlng);\n\n var url = \"/api/v1/search\";\n url += \"?lat=\" + latlng.lat;\n url += \"&lng=\" + latlng.lng;\n url += \"&offset=\" + offset * 3;\n //check to see if there are food categories\n if(currentPreferences && currentPreferences.length > 0) {\n url += \"&category_filter=\";\n for(var i = 0; i < currentPreferences.length - 1; i++) {\n url += currentPreferences[i] + \",\";\n }\n url += currentPreferences[i]; //last element without comma\n }\n offset++;\n console.log(url);\n console.log(\"fetching\", url);\n fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n console.log(\"data:\", data);\n allRestaurants = data;\n chooseRestaurant();\n })\n .catch(function(error) {\n console.error(error);\n });\n}", "updateLocation() {\n this.apiList.map.clearMarkers();\n $('.eventsContainer').empty();\n $('.businessContainer').empty();\n $('.weatherContainer').empty();\n $('.destinationsAdded').empty();\n $('.directionsPanel').empty();\n $('.calculateRoute').removeClass('hidden');\n var userMarker = new Marker(this.apiList.map.mapObj, { name: \"You\" }, undefined, this.apiList.map.updateLocation, this.apiList.map.closeWindows, this.apiList.map.expandClickHandler);\n userMarker.renderUser({\n lat: this.userPositionLat,\n lng: this.userPositionLong\n });\n this.apiList.map.markers.user = userMarker;\n this.initAJAX();\n }", "function getData() {\n $.get(\"/api/all/\", data => {\n if (data) {\n // Empty array to hold all of the city names\n const cities = [];\n for (let i = 0; i < data.length; i++) {\n // Push every city from every sighting into the array\n cities.push(data[i].city);\n }\n\n // Loop over all cities and get lat/lon\n for (i = 0; i < cities.length; i++) {\n // Use geocoder to get cities' lat/lon\n const geocoder = new google.maps.Geocoder();\n const address = cities[i];\n geocoder.geocode(\n {\n address: address\n },\n (results, status) => {\n if (status === google.maps.GeocoderStatus.OK) {\n // lat/lng variables to store the coordinates generated by Google Maps\n const lat = results[0].geometry.location.lat();\n const lng = results[0].geometry.location.lng();\n // Create a marker for each set of coordinates\n new google.maps.Marker({\n position: {\n lat: lat,\n lng: lng\n },\n map,\n // Custom flying saucer icon for the markers\n icon: \"images/alien-icon.png\",\n title: \"ALIENS!\"\n });\n }\n }\n );\n }\n }\n });\n}", "getAllLocations() {\n\n infoWindow = new window.google.maps.InfoWindow();\n if (navigator && navigator.geolocation) {\n\n navigator.geolocation.getCurrentPosition(function (position) {\n pos = [position.coords.latitude, position.coords.longitude]\n let centerpos = { \"lat\": position.coords.latitude, \"lng\": position.coords.longitude }\n map.setCenter(centerpos);\n\n }, function (error) {\n console.log(\"error\", error)\n this.handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n this.handleLocationError(false, infoWindow, map.getCenter());\n }\n }", "function renderMap(data) {\n // `data` is an array of objects\n // console.log(data);\n // Add each object to the map if `latitude` and `longitude` are available\n data.forEach(function(obj) {\n if (obj['latitude'] != undefined){\n if (obj['longitude'] != undefined){\n // Use `bindPopup()` to add `type`, `datetime`, and `address` properties\n L.marker([obj['latitude'], obj['longitude']]).addTo(seattleMap)\n .bindPopup('<strong>' + obj['name'] + '</strong>' \n + '<br>' + '<strong>' + 'Phone Number: '+ '</strong>' + obj['phone_number']\n + '<br>' + '<strong>' + 'Address: ' + '</strong>' + obj['address']\n + '<br>' + obj['city'] + ', ' + obj['state'])\n }\n }\n });\n}", "function renderEvents() {\n markers.clearLayers();\n var eventsGeoJsonAPI = '/api/geojson/events';\n updateMap(eventsGeoJsonAPI);\n removeSpinner();\n}", "function LocationList() {\n const [state, dispatch] = useStoreContext();\n\n//Will display locations based on what is currently in the search location state in the global state manager.\n const getLocations = () => {\n // dispatch({ type: LOADING });\n API.getLocationByState(state.searchLocation.region, state.searchLocation.city, state.searchLocation.difficulty)\n .then(results => {\n dispatch({\n type: GET_LOCATIONS,\n locations: results.data\n });\n })\n .catch(err => console.log(err));\n };\n //Will update the locations displayed when the search location is updated in the global state. Would also like to have this display the users current location on load in future development.\n useEffect(() => {\n getLocations();\n }, [state.searchLocation]);\n\n// Going to display locations if search locations currently exists. Lazy load was throwing up too many warnings as is, will use it in future development.\n return (\n <div>\n {state.locations.length ? (\n <div>\n <h4 className=\"mb-2 mt-0 text-center\">Explore New Trails in {state.searchLocation.city}</h4>\n <List>\n {state.locations.map(location => (\n // <LazyLoad offsetVertical={300}>\n <ListItem key={location._id}>\n <Link to={\"/locations/\" + location._id}>\n {location.area}: <strong>{location.name}</strong>\n </Link>\n </ListItem>\n // </LazyLoad>\n ))}\n </List>\n </div>\n ) : (\n <h3>There are no locations to display!</h3>\n )}\n </div>\n );\n}", "function initialize() {\n rendermap();\n retrieveMarkerLocations();\n}", "function storeMarkers() {\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n\n var JSONObject = JSON.parse(response);\n var stores = JSONObject.stores;\n\n for (var i = 0; i < stores.length; i++) {\n\n var storesLat = stores[i].lat;\n var storesLng = stores[i].lng;\n var storeCity = stores[i].city;\n var storeState = stores[i].state;\n var storeZip = stores[i].zip;\n var storeAddress = stores[i].address;\n var storeDistance = stores[i].distance;\n var storeRetailer = stores[i].retailer;\n //begin lodash\n var retailerName = _.find(JSONObject.retailers, { id: storeRetailer });\n var retailDisplay = retailerName.name;\n\n\n var storeProductIDs = JSON.parse(JSONObject.stores[i].products) || [];\n // || to ensure code doesn't break, set [];\n var storeRetailer = JSONObject.stores[i].retailer;\n // turn string array to JS array, get product details, then create HTML string for info window\n var productHTML = storeProductIDs\n .map(function (productId) {\n return JSONObject.products\n .find(function (product) {\n return productId === product.id\n });\n })\n .reduce(function (result, p) { return result + p.title + '<br>'; }, '');\n\n //add the store information into the HTML id JSON\n var names = $(\"<li>\").append(\n $('<p>').text(retailDisplay),\n $('<p>').text(storeAddress),\n $('<p>').text(storeCity + \", \" + storeState + \" \" + storeZip),\n $('<p>').html(\"Products: \" + productHTML),\n $('<p>').text(Math.floor(storeDistance) + \" Miles Away\")\n );\n $('#JSON').append(names);\n\n // content for infowindow\n var contentString = '<span>' + retailDisplay + '<br>' + storeAddress + '<br>' + storeCity + ', ' + storeState + ' ' + storeZip + '<br>' + \"Products: \" + productHTML + '</span>';\n\n var storeInfowindow = new google.maps.InfoWindow({\n content: contentString\n });\n\n // LORRIE: beginning of code to add number to marker\n var marker = new google.maps.Marker({ \n position: { lat: parseFloat(storesLat), lng: parseFloat(storesLng) }, \n map: map, \n info: contentString\n // label: label\n })\n \n // LORRIE: end of code to add number to marker num_events+ \n markers.push(marker);\n \n // click event listener for marker infowindow. \n marker.addListener('click', function () {\n storeInfowindow.setContent(this.info);\n storeInfowindow.open(map, this);\n });\n\n };\n // storeMarker function end\n\n });\n }", "function loadMyPlacesAll(event) {\n $.ajax({\n url: 'http://localhost:3000/myplacesall',\n type: 'GET',\n success: function (res) {\n for (var i in res) {\n //console.log(res[i].lon);\n addMyPlaceMarkerAll(res[i].lon, res[i].lat, res[i].place, res[i].descr);\n }\n }\n });\n}", "function createLocations(){\n\n\t//Uptown Areas\n\tlibrary = new Location('Library', 'This is the Library of ' + user.townName + '. It is filled with thousand of books, Magazines, and newspaper articles. Any information you are looking for you will find here. There is a librarian here all the time and you will usually find at least one student studying.', [ancientBook, hiddenTreasureMap, bookOnDecipheringCode, scienceBook, mathBook], [librarian, student], [], 'library');\n\n\thotel = new Location ('Hotel', 'The hotel of ' + user.townName + ' is a hundred year old building with 42 beautiful rooms for travelers, tourists, and businessmen to stay in. There is always front desk help for any needs you have and a bell boy to take care of your luggage.', [roomKeySet, luggage, luggageCart, pillow, elevatorKey], [bellboy, frontDeskHelp], [], 'hotel');\n\n\t//Shopping District Areas\n\tgroceryStore = new Location ('Grocery Store', 'You will find a lot of ' + user.townName + ' shoppers here on the weekend getting their groceries. Any clerk or cashier will be happy to help you get your freshest food and other essential groceries here all at once!', [shoppingBasket, boxOfCereal, rawSteak, priceGun, cashRegister], [cashier, clerk, shopper], [], 'grocery');\n\n\tcoffeeShop = new Location ('Coffee Shop', 'A nice little place to get any type of coffee you would like along with a little something to eat. There is only need for one employee but she is very good and will take care of you. Beware of the hipster that comes in everyday. Regardless anyday of the year is a good time to stop in!', [hotCoffee, icedCoffee, doughnut, muffin, thermos], [employee, hipster], [], 'coffee');\n\n\thardwareStore = new Location ('Hardware Store', 'With aisles and aisles of home and yard improvement items this is the perfect place to get the tool for the job. The owner is a great guy and will always help you plus you will find a contractor or two that will probably be able to help you as well.', [hammer, screwdriver, wrench, shovel, saw], [owner, contractor], [], 'hardware');\n\n\t//Downtown Areas\n\tpoliceStation = new Location ('Police Station', 'You do not want to end up here in the ' + user.townName + ' Police Station. The town is not highly crime plagued but this Station has eight holding cells and twelve officers prepared for anything. Do not be like the crook in here now because the officer will not take it easy on you.', [handcuffs, nightstick, handcuffKey, taser, policeReport], [officer, crook], [], 'police');\n\n\tautoShop = new Location ('Auto Shop', 'This Auto Shop features a six bay garage with four lifts. They have everything possible to fix any vehicle. Mike the mechanic is the best just ask any customer of his! Do not go anywhere else to get your car, truck, or any other motorized vehicle fixed!', [tire, engine, torqueWrench, carJack, alternator], [mechanic, customer], [], 'auto');\n\n\t//Districts\n\tdowntown = new Location ('Downtown', 'This is Downtown ' + user.townName + ' where you will find our lovely Police Station and Auto Shop. If you get into trouble with the law or car problems you will find yourself here. If you travel north from here, you will find yourself in the Shopping District.', [], [], [], 'downtown');\n\n\tshoppingDistrict = new Location ('Shopping District', 'You find yourself in the busy Shopping District of ' + user.townName +'. You see a large grocery store on your right. Across the street from the grocery store you see a road that leads west to Uptown. On one side of this road you see a small coffee shop. Across the street from the coffee shop you see a hardware store. If you take the main road south, you will arrive in Downtown.', [], [], [], 'shopping');\n\n\tuptown = new Location ('Uptown', 'While in Uptown ' + user.townName + ' you will experience a nice laid back area. This part of town includes a library, for the book connoisseurs, and a Hotel for individuals visiting on business or some tourists.If you travel South-East you will find the Shopping District and continue South to get to Downtown', [], [], [], 'uptown');\n}", "function loadServiceLocations() {\n var deferred = $q.defer();\n $http.get(api.LOCATION_SEVICE_API)\n .then(\n function (response) {\n console.log('Fetched successfully all locations');\n $localStorage.locs = response.data;\n deferred.resolve(response);\n },\n function (errResponse) {\n console.error('Error while loading locations');\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "async function fetchData() {\n const response = await fetch(\n \"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_hour.geojson\",\n {\n method: \"GET\",\n }\n );\n\n const jsonResponse = await response.json();\n\n if (jsonResponse && jsonResponse.metadata.count>0) {\n const { features, metadata, bbox } = jsonResponse;\n\n setFeaturesState(features);\n setMetaData(metadata);\n setBboxState(bbox);\n return jsonResponse;\n }\n }", "function getLocations() {\n console.log('client sent request to server for all locations');\n $http.get('/schedule/locations').then(function(response) {\n locations.array = response.data;\n console.log('locations: ', locations.array);\n });\n }", "function showHotels(region){\n\n\t\tif (markers) //clears hotel markers currently on display\n\t\t{\n\t\t\tmarkers.clearLayers();\t\n\t\t}\n\n\t\tdata = {'region': region};\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: \"/maps/hoteldata\",\n\t\t\tdata: data,\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(data) {\n\t\t\t\tfor (var i = data.length - 1; i >= 0; i--) {\n\t\t\t\t\tvar marker = L.marker([data[i].latitude, data[i].longitude],{icon: happy})\n\t\t\t\t\tmarker.bindPopup(data[i].id + '-' + data[i].name);\n\t\t\t\t\tmarkers.addLayer(marker);\n\t\t\t\t\thotelsDisplayed = region;\n\t\t\t\t};\n\t\t\t}\n\t\t}).done(function() {\n\t\t \tmap.addLayer(markers);\n\t\t});\n\n\t}", "function LoadGEOJsonSources() {\n map.addSource('Scotland-Foto', {\n \"type\": \"geojson\",\n \"data\": \"https://daanvr.github.io/Schotland/geojson/Scotrip-FotoDataFile-RichOnly-Live.geojson\"\n });\n map.addSource('Scotland-Routes', {\n \"type\": \"geojson\",\n \"data\": \"https://daanvr.github.io/Schotland/geojson/Routes.geojson\"\n });\n\n var data = JSON.parse('{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-5.096936,57.149319]},\"properties\":{\"FileName\":\"IMG_8571\",\"type\":\"Foto\",\"FileTypeExtension\":\"jpg\",\"SourceFile\":\"/Users/daan/Downloads/Schotlandexpiriment/IMG_8571.JPG\",\"CreateDate\":\"2018-04-13\",\"CreateTime\":\"15:15:34\",\"Make\":\"Apple\",\"Model\":\"iPhoneSE\",\"ImageSize\":\"16382x3914\",\"Duration\":\"\",\"Altitude\":\"276\",\"URL\":\"https://farm1.staticflickr.com/823/26804084787_f45be76bc3_o.jpg\",\"URLsmall\":\"https://farm1.staticflickr.com/823/26804084787_939dd60ebc.jpg\"}}]}');\n map.addSource('SelectedMapLocationSource', {\n type: \"geojson\",\n data: data,\n });\n\n AddMapIcon(); // add img to be used as icon for layer\n}", "function populateWareHouses() {\n\n // Empty content string\n var tableContent = '';\n\n map = new google.maps.Map(document.getElementById('mymap'), {\n center: myLatLng,\n zoom: 5\n });\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n map.setCenter(pos);\n }, function() {\n// handleLocationError(true, infoWindow, map.getCenter());\n });\n }\n google.maps.event.addListener(map, 'click', function(event) {\n for (i = 0; i < arrUserMarkers.length; i++)\n {\n arrUserMarkers[i].setMap(null);\n }\n arrUserMarkers = [];\n var latitude = event.latLng.lat();\n var longitude = event.latLng.lng();\n console.log( latitude + ', ' + longitude );\n var pinImage = new google.maps.MarkerImage(\"http://www.googlemapsmarkers.com/v1/009900/\");\n\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng( parseFloat(latitude), parseFloat(longitude)),\n icon: pinImage,\n map: map\n });\n arrUserMarkers.push(marker);\n objMarkersFilterQuery = {};\n placeNearestLocations(latitude,longitude);\n });\n\n // jQuery AJAX call for JSON\n// $.getJSON('/wareHouses/wareHouses', function( data ) {\n// wareHouses = data;\n// addInput();\n// // For each item in our JSON, add a table row and cells to the content string\n// placeMarkesrs(data);\n//\n// });\n\n\n}", "function loadMyPlaces(event) {\n $.ajax({\n url: 'http://localhost:3000/myplaces',\n type: 'GET',\n success: function (res) {\n for (var i in res) {\n //console.log(res[i].lon);\n addMyPlaceMarker(res[i].lon, res[i].lat, res[i].place, res[i].descr);\n }\n }\n });\n}", "function renderPointsOfInterest() {\n markers.clearLayers();\n var pointsGeoJsonAPI = '/api/geojson/points';\n updateMap(pointsGeoJsonAPI);\n removeSpinner();\n}", "function processInfo(error, result) {\n //if getLocations returns error, try to display the map alone centered at baseLoc\n if (error) {\n getGeocode(baseLoc, centerMap);\n return;\n }\n\n //no error from getLocations. Process data\n var resultLength = result.response.groups[0].items.length;\n for (var i = 0; i < resultLength; i++) {\n var item = result.response.groups[0].items[i];\n var loc = new Location();\n loc.name = item.venue.name;\n loc.address = item.venue.location.address ? item.venue.location.address : 'Address not available';\n loc.lat = item.venue.location.lat;\n loc.lon = item.venue.location.lng;\n loc.phone = item.venue.contact.formattedPhone ? item.venue.contact.formattedPhone : 'Not Available';\n loc.category = item.venue.categories[0].name ? item.venue.categories[0].name : 'Category not available';\n loc.marker = makeMapMarker(loc);\n mapViewModel.locations.push(loc);\n }\n\n //store the locations in localStorage\n localStorage.setItem(baseLoc, JSON.stringify(mapViewModel.locations(), replacer));\n \n //this is for JSON.stringify.\n //to ensure location.marker to have null value.\n //otherwise stringify will throw error.\n function replacer(i, obj) {\n if (i == 'marker') {\n return null;\n }\n return obj;\n }\n\n //callback for getGeocode\n //centers the map using the data returned from getGeocode\n function centerMap(error, data) {\n var centre = {lat: -34.397, lng: 150.644}; //default map center\n \n //if getGeocode returns a valid location, center the map using that location\n if (!error && data.status === 'OK' ) { \n centre = data.results[0].geometry.location;\n }\n map.setCenter(centre);\n }\n }", "fetchGeographicLocation() {\n\t\t//First check if the browser supports geo locations\n\t\tif (navigator.geolocation){\n\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\t/*anonymous method passed as the first argument used by the getCurrentPosition\n\t\t\t\t method when it was successful, else it calls the error function */\n\t\t\t\t(position) => {\n\t\t\t\t\t//creating a variable to store the coordinates\n\t\t\t\t\tlet crds = position.coords;\n\t\t\t\t\tthis.fetchWeatherData(crds.latitude, crds.longitude);\n\t\t\t\t},\n\t\t\t\t//the method that gets called when an error occurs\n\t\t\t\t() => {\n\t\t\t\t\twindow.alert(\"Error has occurred\");\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}", "function populate()\n{\n // mark houses\n for (var house in HOUSES)\n {\n // plant house on map\n new google.maps.Marker({\n icon: \"https://google-maps-icons.googlecode.com/files/home.png\",\n map: map,\n position: new google.maps.LatLng(HOUSES[house].lat, HOUSES[house].lng),\n title: house\n });\n }\n\n // get current URL, sans any filename\n var url = window.location.href.substring(0, (window.location.href.lastIndexOf(\"/\")) + 1);\n\n // scatter passengers\n for (var i = 0; i < PASSENGERS.length; i++)\n {\n // pick a random building\n var building = BUILDINGS[Math.floor(Math.random() * BUILDINGS.length)];\n\n // prepare placemark\n var placemark = earth.createPlacemark(\"\");\n placemark.setName(PASSENGERS[i].name + \" to \" + PASSENGERS[i].house);\n\n // prepare icon\n var icon = earth.createIcon(\"\");\n icon.setHref(url + \"/img/\" + PASSENGERS[i].username + \".jpg\");\n\n // prepare style\n var style = earth.createStyle(\"\");\n style.getIconStyle().setIcon(icon);\n style.getIconStyle().setScale(4.0);\n\n // prepare stylemap\n var styleMap = earth.createStyleMap(\"\");\n styleMap.setNormalStyle(style);\n styleMap.setHighlightStyle(style);\n\n // associate stylemap with placemark\n placemark.setStyleSelector(styleMap);\n\n // prepare point\n var point = earth.createPoint(\"\");\n point.setAltitudeMode(earth.ALTITUDE_RELATIVE_TO_GROUND);\n point.setLatitude(building.lat);\n point.setLongitude(building.lng);\n point.setAltitude(0.0);\n\n // associate placemark with point\n placemark.setGeometry(point);\n\n // add placemark to Earth\n earth.getFeatures().appendChild(placemark);\n\n // add marker to map\n var marker = new google.maps.Marker({\n icon: \"https://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/man.png\",\n map: map,\n position: new google.maps.LatLng(building.lat, building.lng),\n title: PASSENGERS[i].name + \" at \" + building.name\n });\n\n // remember passenger's placemark and marker for pick-up's sake\n NewPassengers[i] = PASSENGERS[i];\n NewPassengers[i].lat = building.lat;\n NewPassengers[i].lng = building.lng;\n NewPassengers[i].placemark = placemark;\n NewPassengers[i].marker = marker;\n\n }\n}", "function populate()\n{\n // mark houses\n for (var house in HOUSES)\n {\n // plant house on map\n new google.maps.Marker({\n icon: \"https://google-maps-icons.googlecode.com/files/home.png\",\n map: map,\n position: new google.maps.LatLng(HOUSES[house].lat, HOUSES[house].lng),\n title: house\n });\n }\n\n // get current URL, sans any filename\n var url = window.location.href.substring(0, (window.location.href.lastIndexOf(\"/\")) + 1);\n\n // scatter passengers\n for (var i = 0; i < PASSENGERS.length; i++)\n {\n // pick a random building\n var building = BUILDINGS[Math.floor(Math.random() * BUILDINGS.length)];\n\n // prepare placemark\n var placemark = earth.createPlacemark(\"\");\n placemark.setName(PASSENGERS[i].name + \" to \" + PASSENGERS[i].house);\n\n // prepare icon\n var icon = earth.createIcon(\"\");\n icon.setHref(url + \"/img/\" + PASSENGERS[i].username + \".jpg\");\n\n // prepare style\n var style = earth.createStyle(\"\");\n style.getIconStyle().setIcon(icon);\n style.getIconStyle().setScale(4.0);\n\n // prepare stylemap\n var styleMap = earth.createStyleMap(\"\");\n styleMap.setNormalStyle(style);\n styleMap.setHighlightStyle(style);\n\n // associate stylemap with placemark\n placemark.setStyleSelector(styleMap);\n\n // prepare point\n var point = earth.createPoint(\"\");\n point.setAltitudeMode(earth.ALTITUDE_RELATIVE_TO_GROUND);\n point.setLatitude(building.lat);\n point.setLongitude(building.lng);\n point.setAltitude(0.0);\n\n // associate placemark with point\n placemark.setGeometry(point);\n\n // add placemark to Earth\n earth.getFeatures().appendChild(placemark);\n\n // add marker to map\n var marker = new google.maps.Marker({\n icon: \"https://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/man.png\",\n map: map,\n position: new google.maps.LatLng(building.lat, building.lng),\n title: PASSENGERS[i].name + \" at \" + building.name\n });\n\t\t\n\t\t\n\t\t// TODO: remember passenger's placemark and marker for pick-up's sake\n\t\tPASSENGERS[i][\"marker\"] = marker;\n\t\tPASSENGERS[i][\"placemark\"] = placemark;\n\t\tPASSENGERS[i][\"passenger\"] = false;\n }\n}", "function locationView() {\r\n this.searchText = null;\r\n this.locationName = null;\r\n this.template = null;\r\n\r\n //this.load = function (albumId) { };\r\n }", "function getLocation(){\n var queryURL = \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\" + lat + \",\" + lon + \"&key=AIzaSyAXsZwTySX_Xsrq3PqkkSy8LiQ4iTnE5MA\";\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n city = response.results[0].address_components[3].long_name;\n console.log(city);\n state = response.results[0].address_components[5].long_name;\n console.log(state);\n zipcode = response.results[0].address_components[7].long_name;\n console.log(zipcode);\n\n // Now that all information is acquired, send it to be displayed on the front-end\n setLocation();\n });\n\n // Add location to front-end \n function setLocation(){\n $(\"#currentLocation\").text(city + \", \" + state + \" - \" + zipcode);\n }\n }", "GetDisplayLocationList() {\n // return [displayLocations] to Frontend\n }", "function showPosition() {\n fetch(\"https://ipwhois.app/json/?objects=city,latitude,longitude\")\n .then((response) => response.json())\n .then((data) => {\n let currentLat = parseFloat(data.latitude).toFixed(2);\n let currentLong = parseFloat(data.longitude).toFixed(2);\n let currentCity = data.city;\n // Adding position marker - the main map\n let markerHome = L.marker([currentLat, currentLong]).addTo(map);\n markerHome\n .bindPopup(`<em>You are here: </em><br><b>${currentLat}°, ${currentLong}°<br>in: <u>${currentCity}</u></b>`)\n .openPopup();\n // Adding position to the 3D Map\n showPosition3D(currentLat, currentLong, currentCity);\n // Showing Local Solar Time\n localSolarTime(currentLat, currentLong);\n })\n .catch(console.error);\n}", "function initialize() {\n\n // if a search term is present\n if(searchTerm) {\n // if user is searching by name\n if (searchType == 'Name') {\n $.get('/api/locations_api/search_name?search=' + searchTerm, function(data) {\n makeMap(data);\n });\n }\n // else the user is searching by location\n else {\n $.get('/api/locations_api/search_location?search=' + searchTerm, function(data) {\n makeMap(data);\n });\n }\n }\n // else no search term is present and all locations are rendered\n else {\n $.get('/api/locations_api', function(data) {\n makeMap(data);\n });\n }\n\n } // close initialize", "render({}, { location }) {\n\t\tif (!location) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this.props.map === \"map\") {\n\t\t\treturn (\n\t\t\t\t<div class={style.map}>\n\t\t\t\t\t<div id=\"map\"></div>\n\t\t\t\t\t<script async defer src=\"https://maps.googleapis.com/maps/api/js?key=AIzaSyAuzBX3VW1x1ThzSgvF33lYx0ISuP0pdY0&callback=initMap\"></script>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div class={style.location}>\n\t\t\t\t<div>\n\t\t\t\t\t<div>Lat: { location.lat }</div>\n\t\t\t\t\t<div>Lng: { location.lng }</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "function fetchAndPopulateAddress() {\n if (\n _currentLocation.hasOwnProperty('lt') == true &&\n _currentLocation.hasOwnProperty('lg') == true\n ) {\n var xhr = new XMLHttpRequest();\n var url =\n 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' +\n _currentLocation['lt'] +\n ',' +\n _currentLocation['lg'];\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.timeout = LOCATION_TIMEOUT;\n xhr.onload = function () {\n var status = this.status;\n var response;\n if (status == 200) {\n try {\n response = JSON.parse(this.response);\n } catch (e) {\n response = this.response;\n }\n populateAddress(response['results'][0]);\n }\n _isLocationRefreshing = false;\n inflateLocationView();\n };\n xhr.onerror = function () {\n _isLocationRefreshing = false;\n inflateLocationView();\n };\n xhr.send();\n } else {\n _isLocationRefreshing = false;\n inflateLocationView();\n }\n}", "async mapView() {\n if (this.state.location != \"null\") {\n const location = JSON.parse(this.state.location);\n await import(\"../universal/popup-map.js\")\n .then((res) => {\n this._qs(\n \".popup\"\n ).innerHTML = `<map-view location=\"${encodeURIComponent(\n JSON.stringify({ lat: location.ltd, lng: location.lng })\n )}\"></map-view>`;\n })\n .catch((err) => this.popup(err, \"error\"));\n } else this.popup(\"Location does not specified\", \"info\", 2);\n }", "function WeatherModule () {\n var parent = ExtendClass(this, new ViewBase(\"weather\")),\n m_$View = parent.GetView(),\n authKeys = {\n client_id : 'lg3zYjRbNthJBbvIv9t6O',\n client_secret : 'ReYt1UjjK9bppY14qlnuPiG9VrC07SqbR1vJWbfD'\n },\n\n getWeather = function (aCoords) {\n var $mapCanvas = $('<div id=\"map-canvas\" class=\"mapWrapper\"></div>'),\n $overlay = $('<div class=\"overlay\"></div>'),\n haveCoords = _.isObject(aCoords),\n payload = _.extend({}, authKeys, {\n p : haveCoords ? (aCoords.latitude + ',' + aCoords.longitude) : ':auto'\n });\n\n $.ajax({\n url : 'http://api.aerisapi.com/places',\n data : payload,\n dataType : 'jsonp'\n }).done(function (oPlaceData) {\n if (oPlaceData.success == true) {\n var place = oPlaceData.response.place,\n loc = oPlaceData.response.loc,\n ob, theDate, pointer, map;\n\n $.ajax({\n url : 'http://api.aerisapi.com/observations',\n data : payload,\n dataType : 'jsonp'\n }).done(function (aWeatherData) {\n if (aWeatherData.success == true) {\n ob = aWeatherData.response.ob;\n theDate = new Date(ob.timestamp*1000);\n // append the title based on location settings\n m_$View.html('<hr>');\n if (haveCoords) {\n m_$View.append('<h3>Your local weather summary</h3>');\n loc.lat = aCoords.latitude;\n loc.long = aCoords.longitude;\n }\n else {\n m_$View.append(\n '<h3>Your not so local weather summary</h3>', \n '<p>For a more accurate location, please allow location services...</p>'\n );\n }\n\n $mapCanvas.append($overlay).appendTo(m_$View);\n $overlay.html('<small>Report at ' + getDateHtml(theDate) + '</span>');\n\n if (haveCoords) {\n $overlay.append('<p>The current weather is <strong>' + ob.weather.toLowerCase() + '</strong> with a temperature of <strong>' + ob.tempC + '°</strong></p>');\n }\n else {\n $overlay.append('<p>The current weather in <strong>' + place.name +'</strong> is <strong>' + ob.weather.toLowerCase() + '</strong> with a temperature of <strong>' + ob.tempC + '°</strong></p>');\n }\n\n pointer = new google.maps.LatLng(loc.lat, loc.long);\n map = new google.maps.Map(document.getElementById(\"map-canvas\"), {\n center : pointer,\n zoom : 15,\n mapTypeId : google.maps.MapTypeId.ROADMAP, //google.maps.MapTypeId.SATELLITE,\n disableDefaultUI : true\n });\n\n // map.setTilt(45);\n\n $mapCanvas.append($overlay);\n\n $.ajax({\n url : 'http://api.aerisapi.com/forecasts',\n data : $.extend({}, authKeys, {\n p : ':auto'\n }),\n dataType : 'jsonp'\n }).done(function (aForecastData) {\n if (aForecastData.success == true) {\n var today = aForecastData.response[0].periods[0];\n $overlay.append('<p>Today\\'s forecast:</p>');\n $('<ul>').append(\n '<li>Temperature - Max <strong>' + today.maxTempC + '°</strong>, Min <strong>' + today.minTempC + '°</strong></li>',\n '<li>Wind <strong>' + today.windDir + ' at ' + today.windSpeedKPH + 'KPH</strong></li>'\n ).appendTo($overlay);\n }\n });\n }\n });\n }\n });\n\n };\n \n // Public Methods\n this.Show = function($Target) {\n m_$View.empty();\n parent.Show($Target);\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (oPos) {\n getWeather(oPos.coords);\n }, function (e) {\n getWeather();\n });\n } else {\n getWeather();\n }\n };\n \n this.Hide = function(){\n m_$View.empty();\n parent.Hide();\n };\n}", "function getLocations(callback) {\n return fetch('/locations', {\n accept: \"application/json\"\n }).then(checkStatus)\n .then(response => response.json())\n .then(convertToMapObject)\n .then(callback);\n}", "function displayRestaurants(req, response) {\n console.log(`LOCATION: LAT: ${req.body.lat} LON: ${req.body.lon}`);\n let options = {\n url: \"https://api.yelp.com/v3/businesses/search?term=food&latitude=\" + req.body.lat + \"&longitude=\" + req.body.lon + \"&open_now=true&sort_by=rating&radius=5000\",\n headers: { Authorization: \"Bearer \" + req.token }\n };\n request(options, function(err, res, body) {\n if (err) console.log(\"ERROR: \" + err);\n let bod = JSON.parse(body);\n let restaurants = bod.businesses;\n response.render('restaurants', { restaurants });\n });\n}", "function getUserLocation() {\n fetch(`https://ipapi.co/json`)\n .then(function(response) {\n return response.json();\n })\n .then(function(recievedData) {\n displayUserLocation(recievedData);\n });\n}", "function getForecast() {\n request('locations.json')\n .then(displayForecast)\n .catch(handleError)\n }", "function displayJSONwithMap() {\n\tbio.display();\n\twork.display();\n\tprojects.display();\n\teducation.display();\n\t\n\t// insert the Google may that was provided by Cameron and James.\n\t$(\"#mapDiv\").append(googleMap);\n\t\n\t// insert a class name so sections can be formatted \n\t$(\"#main\").children(\"div\").toggleClass(\"main-section\");\n\t// don't put the \"main-section\" class name on all divs!\n\t$(\"#header\").toggleClass(\"main-section\");\n\t// acutally I'm not using this div, so lose it.\n\t$(\"#header\").next(\"div\").remove();\n}", "function buildLocationList(data) {\n data.features.forEach(function(store, i){\n \n let prop = store.properties;\n // Add a new listing section to the sidebar.\n let listings = document.getElementById('listings');\n let listing = listings.appendChild(document.createElement('div'));\n listing.id = 'listing-' + prop.id;\n listing.className = 'item' + ' ' + prop.type;\n \n // Photo container\n let img = listing.appendChild(document.createElement('div'));\n img.id = 'photoContainer-'+ prop.id;\n img.className = 'photoContainer';\n\n // Information container\n let info = listing.appendChild(document.createElement('div'));\n info.className = 'infoContainer';\n\n //Add the link to the individual listing created above.\n let link = info.appendChild(document.createElement('a'));\n link.href = '#';\n link.className = 'title';\n link.id = \"link-\" + prop.id;\n link.innerHTML = prop.title;\n\n //Add details to the individual listing.\n let details = info.appendChild(document.createElement('div'));\n details.innerHTML = prop.description;\n details.innerHTML += ' · ' + prop.address;\n if (prop.phone) {\n details.innerHTML += ' · ' + prop.phoneFormatted;\n }\n\n // Add listener on link\n link.addEventListener('click', function(e){\n for (let i=0; i < data.features.length; i++) {\n if (this.id === \"link-\" + data.features[i].properties.id) {\n let clickedListing = data.features[i];\n flyToStore(clickedListing);\n createPopUp(clickedListing);\n }\n }\n let activeItem = document.getElementsByClassName('active');\n if (activeItem[0]) {\n activeItem[0].classList.remove('active');\n }\n this.parentNode.classList.add('active');\n });\n });\n }", "function dataPlaces(){\n $.ajax({\n url: \"https://data.cityofchicago.org/resource/uahe-iimk.json\",\n type: \"GET\",\n data: {\n \"$where\" : \"latitude != 0 AND longitude != 0\",\n \"$$app_token\" : \"ONMw6rs4vX99YkE7M5cOetVo9\"\n }\n }).done(function(data) {\n for (var i = data.length - 1; i >= 0; i--) {\n var location = new google.maps.LatLng(data[i].latitude, data[i].longitude);\n markers[i] = new google.maps.Marker({\n position: location,\n map: map,\n title: 'Affordable Place',\n icon: {url: 'http://www.vavos.nl/images/ico-in-rond-huis.png', scaledSize : new google.maps.Size(35, 35)},\n });\n markers[i].data = data[i];\n markers[i].distance = google.maps.geometry.spherical.computeDistanceBetween(location, Chicago) / 1000;\n markers[i].libraries = 0;\n markers[i].security = 50;\n markers[i].parks = 0;\n addMarker(markers[i]);\n }\n dataLibraries();\n });\n}", "render() {\n this.geoloc();\n return(\n <div className=\"search-index-div\">\n <div className=\"twelve columns text-center\">\n <ResultsPage results={this.state.results} result={this.state.result} newResult={this.newResult} clickYes={this.clickYes}/>\n <Yes result={this.state.result} yes={this.state.yes} lat={this.state.lat} lng={this.state.lng} />\n {this.foodButtons()}\n </div>\n </div>\n );\n }", "function displayParks(stateCode) {\n $('#table').empty();\n $('#map').empty();\n var queryURL = 'https://developer.nps.gov/api/v1/parks?stateCode=' + stateCode + '&api_key=' + apiKey;\n\n $.get({\n url: queryURL,\n }).then(function (response) {\n console.log(response);\n\n for (var i = 0; i < response.data.length; i++) {\n var tRow = $('<tr>');\n var parkName = $('<td>').text(response.data[i].fullName);\n var parkCity = $('<td>').text(response.data[i].addresses[0].city);\n var parkDescription = $('<td>').text(response.data[i].description);\n\n var mapBtn = $('<a>');\n mapBtn.addClass('waves-effect waves-light btn mapBtn')\n mapBtn.attr('data-index', i);\n mapBtn.text('MAP');\n mapBtn.on('click', function (event) {\n event.preventDefault();\n var index = $(this).attr('data-index');\n console.log(\"thisName: \" + response.data[index].name);\n getLatLong(index);\n });\n\n tRow.append(parkName, parkCity, parkDescription, mapBtn);\n $('#table').append(tRow);\n }\n\n function getLatLong(index) {\n var latitude = response.data[index].latitude;\n var longitude = response.data[index].longitude;\n var coordinates = new google.maps.LatLng(latitude, longitude);\n console.log(\"thisCoord: \" + coordinates);\n\n localStorage.setItem('lastCoord', JSON.stringify(coordinates));\n\n displayMap(coordinates);\n }\n\n // Initialize and add the map\n function displayMap(coordinates) {\n // The map, centered at park\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 6,\n center: coordinates,\n });\n // The marker, positioned at park\n const marker = new google.maps.Marker({\n position: coordinates,\n map: map,\n });\n }\n }).catch(function (error) {\n console.error(error);\n });\n }", "function retrieveMarkerLocations() {\n $(function() {\n $.get(\"/donation/geolocations\", function(data) {\n $.each(data, function(index, geoObj) {\n console.log(geoObj[0] + \" \" + geoObj[1] + \" \" + geoObj[2]);\n });\n callback(data);\n });\n });\n}", "function getNearbyLocations(latitude, longitude, resultsMap) {\n lastLatLonQueried = {'lastLat':latitude, 'lastLng':longitude}\n\n $.get(\"/get_locations/\" + latitude + \"/\" + longitude, function(result) {\n\n $('#location-table').html(\"\");\n clearMarkers();\n\n for (var i = 0; i < result['nearby_locations'].length; i++) {\n //Append to table for each location\n var html_location = \"<tr>\";\n html_location += \"<td>\" + result['nearby_locations'][i]['address'] + \"</td>\"\n html_location += \"<td>\" + result['nearby_locations'][i]['comment'] + \"</td>\"\n html_location += \"<td>\" + result['nearby_locations'][i]['distance'].toFixed(2) + \"</td>\"\n html_location += \"</tr>\";\n\n $('#location-table').append(html_location);\n\n //Pin a marker for each location\n var currentLatLng = {\n lat: result['nearby_locations'][i]['lat'],\n lng: result['nearby_locations'][i]['lng']\n };\n var marker = new google.maps.Marker({\n position: currentLatLng,\n map: resultsMap,\n title: result['nearby_locations'][i]['address']\n });\n markersArray.push(marker);\n } //end of for\n\n }, \"json\");\n}", "function onWeatherAppLoad() {\n var myWeather = new Weather();\n // First, get latitude and longitude\n myWeather.fetchLongLat().then(function(parsedObject) {\n // Now, we have latitude and longitude, get the weather information\n myWeather.fetchWeather(parsedObject.location).then(function(weatherData){\n // weather data arrived, update the UI components\n myWeather.updateUI(weatherData);\n });\n });\n}", "function getjson() {\n\n // clearLayers before adding to prevent duplicates\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n\n // Clears the control Layers\n if (group) {\n group.forEach(function (entry) {\n controlLayers.removeLayer(entry);\n })\n };\n\n // Get all GeoJSON from our DB using our GET\n $.ajax({\n type: \"GET\",\n url: \"http://localhost:3000/getjson\",\n success: function (response) {\n // JSNLog\n logger.info('Get successful!', response);\n\n if (response.length == 0) {\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n\n } else {\n\n map.addLayer(jsonLayers);\n\n // Using a forEach method iterating over the array of nested objects\n response.forEach(function (entry) {\n\n var id = entry._id;\n var name = entry.geojson.name;\n var geojsonLayer = L.geoJSON(entry.geojson);\n var bild = entry.geojson.properties.picture;\n var text = entry.geojson.properties.text;\n var link = entry.geojson.properties.link;\n var linkname = entry.geojson.properties.linkname;\n var type = entry.geojson.properties.type;\n var capacity = entry.geojson.properties.capacity;\n var price = entry.geojson.properties.price;\n var typeinfo = \"\";\n\n // Different popups depending on type\n if (type == \"default\") {\n\n typeinfo = \"\";\n\n } else {\n\n if (type == \"parkingplace\") {\n\n typeinfo = \"<b>Capacity: \" + capacity + \" spots</b><br><b>Price: \" + price + \" €</b>\";\n\n } else {\n\n if (type == \"hotel\") {\n\n typeinfo = \"<b>Capacity: \" + capacity + \" room</b><br><b>Price: \" + price + \" €</b>\";\n\n } else {\n\n typeinfo = \"\";\n\n }\n\n }\n\n }\n\n // JSNLog\n logger.info(\"link\");\n logger.info(link);\n\n var ishttp = link.indexOf(\"https://\" || \"http://\" || \"HTTPS://\" || \"HTTP://\");\n\n // JSNLog\n logger.info(\"ishttp\");\n logger.info(ishttp);\n\n // URL check for HTTP:\n if (ishttp == 0) {\n\n link = link;\n // JSNLog\n logger.info(\"link mit\");\n logger.info(link);\n\n } else {\n\n link = \"http://\" + link;\n // JSNLog\n logger.info(\"link ohne\");\n logger.info(link);\n\n }\n\n // JSNLog\n logger.info(\"typeinfo\");\n logger.info(typeinfo);\n\n var popup = \"<h2>\" + name + \"</h2><hr><img style='max-width:200px;max-height:100%;' src='\" + bild + \"'><p style='font-size: 14px;'>\" + text + \"<br><br><a target='_blank' href='\" + link + \"'>\" + linkname + \"</a><br><br>\" + typeinfo + \"</p>\";\n\n controlLayers.removeLayer(geojsonLayer);\n\n // Adding each geojson feature to the jsonLayers and controlLayers\n geojsonLayer.addTo(jsonLayers);\n\n // Adds a reference to the geojson into an array used by the control Layer clearer\n group.push(geojsonLayer);\n\n // Add controlLayer\n controlLayers.addOverlay(geojsonLayer, name);\n\n // Add popup\n geojsonLayer.bindPopup(popup, {\n maxWidth: \"auto\"\n });\n\n\n\n // Adding the layernames to the legendlist\n $('#jsonlegendelem').append(\"<li style='height: 30px;width: 100%;'><div class='title'><p style='font-size: 14px;display: inline;'>\" + name + \"</p></div><div class='content'><a target='_blank' href='http://localhost:3000/json/\" + id + \"' class='linkjson'><p class='linkjsonper'>&nbsp;<i class='fa fa-link' aria-hidden='true'></i>&nbsp;</p></a><button class='delbutton' type='button' id='\" + id + \"' onclick='editfeature(this.id)'><i class='fa fa-pencil' aria-hidden='true'></i></button><button class='delbutton' type='button' id='\" + id + \"' onclick='deletefeature(this.id)'><i class='fa fa-trash' aria-hidden='true'></i></button></div></li>\");\n });\n\n // Adding a legend + removebutton\n $(\"#jsonlegenddiv\").show();\n $(\"#jsonlegendbtndiv\").show();\n $('#jsonlegend').replaceWith(\"<h3>Features:</h3>\");\n $('#jsonlegendbtn').replaceWith(\"<table class='cleantable' style='width: 100%; padding: 0px;'><tr><td style='width: 50%;padding: 0px;'><button style='width: 100%;' type='button' class='button jsonupbtn' value='' onclick='removelayer()'>&#x21bb; Remove all features</button></td><td style='width: 50%;padding: 0px;'><button style='margin-left: 1px;width: 100%;' type='button' class='buttondel jsonupbtn' value='' id='deletefeaturedb' style='width: 100%;'onclick='deleteallfeature()'><i class='fa fa-trash' aria-hidden='true'></i> Delete all features</button></td></tr></table>\");\n }\n },\n error: function (responsedata) {\n\n // If something fails, cleaning the legend and jsonlayers\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Failed in!', response);\n },\n timeout: 3000\n }).error(function (responsedata) {\n\n // If something fails, cleaning the legend and jsonlayers\n jsonLayers.clearLayers();\n $(\"#jsonlegendelem\").empty();\n $(\"#jsonlegenddiv\").hide();\n $(\"#jsonlegendbtndiv\").hide();\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Failed out!', response);\n });\n\n // JSNLog\n logger.info(jsonLayers);\n}", "function getGeolocation() {\n // console.log(this.responseText);\n var data = JSON.parse(this.responseText);\n var results = data.results;\n results.forEach(function (element) {\n console.log(element.geometry.location);\n var ubication = {\n lat: element.geometry.location.lat,\n lng: element.geometry.location.lng\n };\n });\n }", "function search(locURL) {\n $.ajax({\n url: locURL,\n method: \"GET\",\n dataType: 'json',\n success : function (data) {\n var obj = data;\n var o = obj.results[0][\"geometry\"][\"location\"];\n makeURL(o.lat, o.lng);\n initialize(o.lat, o.lng);\n }\n })\n}", "function drawLocation(images) {\n\n /**\n * Setup the location element, and fade it in on page load.\n *\n * The location element contains all the main content on this page.\n */\n var $locationContainer = $('.location');\n $locationContainer.css('opacity', 0);\n $locationContainer.addClass('animated fadeIn');\n\n /**\n * Setup the timeline\n */\n var $timelineBackground = $('.timeline-background');\n Session.set('$timelineBackgroundWidth', $timelineBackground.width());\n Session.set('$timelineBackgroundHeight', $timelineBackground.height());\n var $timelineBackgroundSVG = d3.select('.timeline-background')\n .append('svg')\n .attr('class', 'timeline-background-svg')\n .attr('width', Session.get('$timelineBackgroundWidth'))\n .attr('height', Session.get('$timelineBackgroundHeight'));\n\n /**\n * Draw year markers at the start and end of the timeline\n */\n var firstYear = DateUtils.getNumericYear(_.first(images).isoDate);\n drawYearMarker($timelineBackgroundSVG, 0, 50, 50, 55, firstYear);\n var lastYear = DateUtils.getNumericYear(_.last(images).isoDate);\n drawYearMarker(\n $timelineBackgroundSVG,\n (Session.get('$timelineBackgroundWidth') - 100),\n 50,\n (Session.get('$timelineBackgroundWidth') - 55), 55, lastYear\n );\n\n // Draw selection handle\n drawTimelineHandle($timelineBackgroundSVG);\n\n // Draw timeline images\n drawTimelineImages(images);\n\n /**\n * Highlight the image from the previous locations page\n *\n * When you first come to this page from the locations overview, you've\n * clicked on a specific picture within this location. This picture\n * should be highlighted when you first come to the page.\n *\n * Get the clicked image details from the URL and look up its index\n * for highlighting\n */\n var clickedImage = Router.current().params.query.image;\n var groupObj = d3.selectAll('g[data-id=' + clickedImage + ']');\n var dIndex = groupObj.attr('data-index');\n highlightImageByIndex(dIndex);\n\n // Save timeline offset for future transformation operations\n var $timeline = $('.timeline-images-svg');\n var timelineOffset = $timeline.parent().offset();\n Session.set('timelineOffset', timelineOffset);\n\n // Draw prev/next buttons\n var $locationContainerHeight = $locationContainer.height();\n var locationSVG = d3.select('.location')\n .append('svg')\n .attr('class', 'prev-next-buttons')\n .attr('width', 1920)\n .attr('height', $locationContainerHeight);\n drawNavButton(locationSVG, 50, 400, 30, 'left');\n drawNavButton(locationSVG, 1860, 400, 30, 'right');\n\n // Dim button if on first or last image\n updatePrevNextButtons(dIndex);\n}", "function showLocationsState(data) {\n state = 2; // ambiguous\n locations = data.locations;\n\n app.hidePreloader();\n\n var html = locationsStateCompiled({locations: locations});\n $$('.state-place').html(html);\n }", "function getMarkers()\r\n {\r\n $.ajax({\r\n method: 'POST',\r\n // url: '/api/maps/profile/'+user,\r\n url: $('#api-box').attr('data-api-url'),\r\n data: {\r\n regions: $('.region-selected').val(),\r\n categories: categoryList,\r\n text: $('[name=\"search\"]').val(),\r\n cityMaker: cityMaker\r\n },\r\n success: function(results) {\r\n try {\r\n results = JSON.parse(results);\r\n } catch (e) {\r\n results = results;\r\n }\r\n createMarkers(results);\r\n }\r\n });\r\n }", "function render(data, callback) {\n var aggdata = aggregateByLocation(data);\n myApp.scale = d3.scale.linear().domain([aggdata.min, aggdata.max])\n .range([2, 50]);\n if (myApp.pointFeature === undefined) {\n myApp.pointFeature = myApp.map\n .createLayer('feature')\n .createFeature('point', {selectionAPI: true});\n }\n if (myApp.pointFeature) {\n myApp.pointFeature.geoOff(geo.event.feature.mouseclick);\n }\n\n myApp.pointFeature\n .data(aggdata.data)\n .position(function (d) { return { x:d.loc[0], y:d.loc[1] } })\n .style('radius', function (d) { return myApp.scale(d.binCount); })\n .style('stroke', false)\n .style('fillOpacity', 0.4)\n .style('fillColor', 'orange')\n .geoOn(geo.event.feature.mouseclick, function (evt) {\n var i = 0, anchor = null;\n\n var currLocation = $(\"#search\").val();\n var clickedLocation = evt.data[\"place\"];\n if (!currLocation || currLocation.length < 1 || currLocation !== myApp.location ||\n clickedLocation !== myApp.location) {\n $(\"#search\").val(evt.data[\"place\"])\n $(\"#search\").trigger(\"geocode\");\n myApp.location = evt.data[\"loc\"];\n myApp.setLocationTypeToLatLon();\n }\n for (i = 0; i < evt.data.urls.length; ++i) {\n // Scrap the URL\n scrapUrl(evt.data.urls[i], function(images) {\n myApp.displaySearchResults({\n \"data\": evt.data,\n \"images\": images});\n });\n }\n\n if (myApp.location !== null || myApp.location !== undefined ||\n myApp.location !== \"\") {\n myApp.queryData(myApp.timeRange, {\"value\":myApp.location, \"type\":myApp.locationType},\n function(data) {\n // Format the data\n var adsPerDay = {}, newData = [], i, time, month, inst, timeString, item;\n for (i = 0; i < data.length; ++i) {\n time = new Date(data[i][\"time\"]);\n month = (time.getMonth() + 1);\n if (month < 10) {\n month = (\"0\" + month);\n }\n timeString = time.getFullYear() + \"-\"\n + month + \"-\" +\n + time.getDate();\n if (timeString in adsPerDay) {\n adsPerDay[timeString] = adsPerDay[timeString] + 1;\n } else {\n adsPerDay[timeString] = 1;\n }\n }\n\n for (item in adsPerDay) {\n inst = {};\n inst[\"date\"] = item;\n inst[\"value\"] = adsPerDay[item];\n newData.push(inst);\n }\n\n if (newData.length > 1) {\n myApp.displayStatistics(newData, false);\n }\n });\n }\n });\n\n myApp.map.draw();\n\n if (callback) {\n callback();\n }\n }", "function initialize() {\n\n var mapOptions = {\n zoom: 13,\n center: new google.maps.LatLng(42.360082, -71.05888),\n mapTypeId: google.maps.MapTypeId.SATELLITE\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'),\n mapOptions);\n\n $.ajax({\n type:\"GET\",\n dataType: \"json\",\n cache: false,\n url: \"https://data.cityofboston.gov/resource/7cdf-6fgx.json?year=2014\",\n success: function(data){\n for(var i = 0; i < data.length; i++){\n locations.push(new google.maps.LatLng(data[i].location.latitude, data[i].location.longitude));\n }\n\n console.log(locations);\n\n pointArray = new google.maps.MVCArray(locations);\n\n heatmap = new google.maps.visualization.HeatmapLayer({\n data: pointArray,\n maxIntensity: 5\n });\n\n heatmap.setMap(map);\n }\n });\n\n setMarkers(map, placePoints);\n\n}//initialize end", "function retrieveGeocodeResults(data) {\n searchButton.style.display = 'inline';\n\n if (data.results && data.results.length > 0) {\n var location = data.results[0];\n var coords = location.geometry.location;\n getPlaces(coords.lat, coords.lng, '');\n getFoursquareEvents(coords.lat, coords.lng, '', location.formatted_address);\n getEventfulEvents(coords.lat, coords.lng, '', location.formatted_address);\n getUpcomingEvents(coords.lat, coords.lng, '', location.formatted_address);\n locationInput.value = location.formatted_address;\n LOCATION_KEY = location.formatted_address.split(',')[0];\n setTitlePage(LOCATION_KEY);\n } else {\n // TODO: error handling\n }\n}", "render (data) {\n this.root.innerHTML = storeTemplate(data);\n const mapId = this.root.querySelector('#map');\n const newMap = new MapAPI({\n div: mapId,\n zoom: 11\n });\n newMap.showStore(data.body);\n newMap.addMyPosition();\n this.addEventListeners();\n }", "function showRestaurants(data){\n console.log('you found restaurants! ', data);\n data.forEach(function(restaurant){\n var location = {\n lat: restaurant.coordinates.latitude,\n lng: restaurant.coordinates.longitude\n }\n // this is the content that goes on the card associated with each restaurant in the map\n var content = '<h6>' + restaurant.name + '</h6>' + '<p>' + restaurant.location.address1 + '</p>'\n addMarker(location, content)\n })\n }", "loadUsersLocations(req, res) {\n const userId = req.session.user.id;\n Location.findAll({\n where: { userId },\n })\n .then((locations) => {\n let locs = [];\n for (let i = 0; i < locations.length; i++) {\n let newLoc = {\n name: locations[i].dataValues.name,\n lat: locations[i].dataValues.lat,\n lon: locations[i].dataValues.lon,\n };\n locs.push(newLoc);\n }\n res.json({ locations: locs });\n })\n .catch((err) => console.log(`Error loading locations, ${err}`));\n }", "function retrieveMarkerLocations()\n {\n const latlng = [];\n $(function() {\n $.get(\"/tenants/vacantresidences\", function(data) {\n }).done(function(data) {\n $.each(data, function(index, geoObj)\n {\n console.log(geoObj[0] + \" \" + geoObj[1] + \" \" + geoObj[2] + \" \" + geoObj[3]);\n });\n positionMarkers(data);\n });\n });\n }", "function retrieveWeather(locations) {\n for (let loc of locations) {\n getTemp(currentURL, loc.id, appID, (temp) => {\n try {\n let obj = JSON.parse(temp);\n loc.weather = obj;\n updateMarker(loc.weather.main.temp, loc.weather.weather[0].main, loc.id);\n } catch(error) {\n console.log(error);\n }\n });\n }\n}", "function getData(map){\n\n //load the data\n $.ajax(\"data/hotspotInfo.geojson\", {\n dataType: \"json\",\n success: function(response){\n\n //create a leaflet GeoJSON layer and add it to the map\n geojson = L.geoJson(response, {\n style: function (feature){\n if(feature.properties.TYPE === 'hotspot_area'){\n return {color: '#3182bd',\n weight: 2,\n stroke:1};\n } else if(feature.properties.TYPE ==='outer_limit'){\n return {color: '#9ecae1',\n weight: 2,\n stroke: 0,\n fillOpacity: .5};\n }\n },\n\n\n onEachFeature: function (feature,layer) {\n var popupContent = \"\";\n if (feature.properties) {\n //loop to add feature property names and values to html string\n popupContent += \"<h5>\" + \"Region\" + \": \" + feature.properties.NAME + \"</h5>\";\n\n if (feature.properties.TYPE ===\"hotspot_area\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot\" + \"</h5>\";\n\n }\n\n\n if (feature.properties.TYPE ===\"outer_limit\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot Outer Limit\" + \"</h5>\";\n\n }\n\n\n layer.bindPopup(popupContent);\n\n };\n\n\n layer.on({\n mouseover: highlightFeature,\n mouseout: resetHighlight,\n click: zoomToFeature\n });\n layer.on({\n click: panelInfo,\n })\n }\n }).addTo(map);\n\n //load in all the biodiversity and threatened species image overlays\n var noneUrl = 'img/.png',\n noneBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var none = L.imageOverlay(noneUrl, noneBounds);\n\n \tvar amphibianUrl = 'img/amphibian_richness_10km_all.png',\n \tamphibianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var amphibians = L.imageOverlay(amphibianUrl, amphibianBounds);\n\n var caecilianUrl = 'img/caecilian_richness_10km.png',\n \tcaecilianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caecilians = L.imageOverlay(caecilianUrl, caecilianBounds);\n\n var anuraUrl = 'img/frog_richness_10km.png',\n \tanuraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var anura = L.imageOverlay(anuraUrl, anuraBounds);\n\n var caudataUrl = 'img/salamander_richness_10km.png',\n \tcaudataBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caudata = L.imageOverlay(caudataUrl, caudataBounds);\n\n var threatenedaUrl = 'img/threatened_amp.png',\n threatenedaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threateneda = L.imageOverlay(threatenedaUrl, threatenedaBounds);\n\n var birdsUrl ='img/birds.png',\n birdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var birds = L.imageOverlay(birdsUrl, birdsBounds);\n\n var psittaciformesUrl = 'img/psittaciformes_richness.png',\n psittaciformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var psittaciformes = L.imageOverlay(psittaciformesUrl, psittaciformesBounds);\n\n var passeriformesUrl = 'img/passeriformes_richness.png',\n \t passeriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var passeriformes = L.imageOverlay(passeriformesUrl, passeriformesBounds)\n\n var nonpasseriformesUrl = 'img/nonPasseriformes.png',\n nonpasseriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var nonpasseriformes = L.imageOverlay(nonpasseriformesUrl, nonpasseriformesBounds)\n\n var hummingbirdsUrl = 'img/hummingbirds.png',\n hummingbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var hummingbirds = L.imageOverlay(hummingbirdsUrl, hummingbirdsBounds)\n\n var songbirdsUrl = 'img/songbirds_richness.png',\n \tsongbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var songbirds = L.imageOverlay(songbirdsUrl, songbirdsBounds);\n\n var threatenedbUrl = 'img/threatened_birds.png',\n threatenedbBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedb = L.imageOverlay(threatenedbUrl, threatenedbBounds);\n\n var mammalsUrl = 'img/mammals.png',\n mammalsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var mammals = L.imageOverlay(mammalsUrl, mammalsBounds);\n\n var carnivoraUrl = 'img/carnivora.png',\n carnivoraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var carnivora = L.imageOverlay(carnivoraUrl, carnivoraBounds);\n\n var cetartiodactylaUrl = 'img/cetartiodactyla.png',\n cetartiodactylaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var cetartiodactyla = L.imageOverlay(cetartiodactylaUrl, cetartiodactylaBounds);\n\n var chiropteraUrl = 'img/chiroptera_bats.png',\n chiropteraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var chiroptera = L.imageOverlay(chiropteraUrl, chiropteraBounds);\n\n var eulipotyphlaUrl = 'img/eulipotyphla.png',\n eulipotyphlaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var eulipotyphla = L.imageOverlay(eulipotyphlaUrl, eulipotyphlaBounds);\n\n var marsupialsUrl = 'img/marsupials.png',\n marsupialsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var marsupials = L.imageOverlay(marsupialsUrl, marsupialsBounds);\n\n var primatesUrl = 'img/primates.png',\n primatesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var primates = L.imageOverlay(primatesUrl, primatesBounds);\n\n var rodentiaUrl = 'img/rodentia.png',\n rodentiaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var rodentia = L.imageOverlay(rodentiaUrl, rodentiaBounds);\n\n var threatenedmUrl = 'img/threatened_mammals.png',\n threatenedmBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedm = L.imageOverlay(threatenedmUrl, threatenedmBounds);\n\n //define structure of layers and overlays\n var animals = [\n {\n groupName: \"Overlays Off\",\n expanded: false,\n layers: {\n \"Overlays Off\": none\n }\n }, {\n groupName: \"Amphibians\",\n expanded: true,\n layers: {\n \"All Amphibians\": amphibians,\n \t\"Caecilian\": caecilians,\n \t\"Anura\": anura,\n \t\"Caudata\": caudata\n }\n }, {\n groupName: \"Birds\",\n expanded: true,\n layers: {\n \"Birds\": birds,\n \t\"Psittaciformes\": psittaciformes,\n \t\"Passeriformes\": passeriformes,\n \"NonPasseriformes\": nonpasseriformes,\n \"Trochilidae\": hummingbirds,\n \t\"Passeri\": songbirds\n }\n }, {\n groupName: \"Mammals\",\n expanded: true,\n layers: {\n \"All Mammals\": mammals,\n \"Carnivora\": carnivora,\n \"Cetartiodactyla\": cetartiodactyla,\n \"Chiroptera\": chiroptera,\n \"Eulipotyphla\": eulipotyphla,\n \"Marsupials\": marsupials,\n \"Primates\": primates,\n \"Rodentia\": rodentia\n }\n }, {\n groupName: \"Threatened Species\",\n expanded: true,\n layers: {\n \"Threatened Amphibians\": threateneda,\n \"Threatened Birds\": threatenedb,\n \"Threatened Mammals\": threatenedm\n }\n }\n ];\n\n var overlay = [\n {\n groupName: \"Hotspots\",\n expanded: true,\n layers: {\n \"Hotspots (Biodiversity Hotspots are regions containing high biodiversity but are also threatened with destruction. Most hotspots have experienced greated than 70% habitat loss.)\": geojson\n }\n }\n ];\n\n //style the controls\n var options = {\n group_maxHeight: \"200px\",\n exclusive: false,\n collapsed: false\n }\n\n //add heat maps and hotspot overlay to map\n var control = L.Control.styledLayerControl(animals, overlay, options);\n control._map = map;\n var controlDiv = control.onAdd(map);\n\n document.getElementById('controls').appendChild(controlDiv);\n\n $(\".leaflet-control-layers-selector\").on(\"change\", function(){\n $(\"#mapinfo\").empty();\n if ( map.hasLayer(amphibians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caecilians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(anura)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caudata)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(threateneda)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(birds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(psittaciformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(nonpasseriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(passeriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(hummingbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(songbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(threatenedb)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if(map.hasLayer(mammals)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(carnivora)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(cetartiodactyla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(chiroptera)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(eulipotyphla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(marsupials)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(primates)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(rodentia)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(threatenedm)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(geojson)){\n };\n });\n\n}\n});\n\n\n\n}", "function generateContent(){\n for(var i = 0; i<allLocations.length; i++){\n allLocations[i].calculateCustomersEachHour();\n allLocations[i].calculateCookiesSoldEachHour();\n allLocations[i].render();\n }\n}" ]
[ "0.69302857", "0.6445347", "0.6349254", "0.6315161", "0.63055634", "0.62847716", "0.62761736", "0.62350285", "0.6190274", "0.6158551", "0.61425865", "0.6139178", "0.61288035", "0.61107385", "0.6083875", "0.60771", "0.60771", "0.6041177", "0.60375226", "0.6008874", "0.59670305", "0.5959043", "0.5956645", "0.5955611", "0.59175515", "0.5902707", "0.58869696", "0.5874505", "0.584355", "0.5842432", "0.58336526", "0.58275443", "0.5821102", "0.5819175", "0.5819143", "0.5818285", "0.581421", "0.58047026", "0.5777589", "0.5768623", "0.57629323", "0.5750828", "0.57486814", "0.57396805", "0.5726799", "0.5719021", "0.5711292", "0.5706592", "0.5706064", "0.5705866", "0.5694579", "0.56917334", "0.5684277", "0.56745327", "0.56699634", "0.5661836", "0.56582475", "0.5651007", "0.56491935", "0.5648167", "0.56469464", "0.56404877", "0.56404877", "0.56365305", "0.56336", "0.56292987", "0.5627865", "0.5625455", "0.5624176", "0.5623692", "0.5617684", "0.56159717", "0.5615739", "0.56120884", "0.5609322", "0.5605671", "0.5604078", "0.55996746", "0.55962616", "0.55948716", "0.55872905", "0.5584021", "0.55803615", "0.5577231", "0.5574993", "0.55715007", "0.5571197", "0.5567852", "0.5567695", "0.5567641", "0.55649704", "0.55614823", "0.5556805", "0.5552179", "0.5551012", "0.55504227", "0.55499583", "0.55477905", "0.55388516", "0.5537407" ]
0.6357385
2
Get the info for a single point on the map by identifier
async function getInfo(req, res) { const locationID = req.params.locationID; // Fetch the full location data const locations = await database .select([ "name", "line1", "line2", "zip", "city", "state", "wheelchair_accessible", "latitude", "longitude" ]) .from("locations") .where({ id: locationID }); const location = locations[0]; // Get all the meetings that are held at this location const meetings = await database .select(["id", "title", "details"]) .from("meetings") .where({ location_id: locationID }); // For every one of these meetings, fetch the individual meetings const hours = await database .select([ "meeting_hours.day", "meeting_hours.start_time", "meeting_hours.end_time", "meeting_hours.special_interest", "meeting_hours.meeting_id", "meeting_types.name AS type" ]) .from("meeting_hours") .whereIn("meeting_id", meetings.map(h => h.id)) .leftJoin( "meeting_types", "meeting_hours.meeting_type_id", "meeting_types.id" ); // How to sort the days of the week const sorter = { Monday: 1, Tuesday: 2, Wednesday: 3, Thursday: 4, Friday: 5, Saturday: 6, Sunday: 7 }; // Combine hours and meetings into a single object const result = { location, meetings: meetings .map(({ id, title, details }) => { return { title, details, hours: hours // Only nest the hours of the meeting we're working on .filter(h => h.meeting_id === id) // Strip out the fields we don't need .map(({ day, start_time, end_time, special_interest, type }) => ({ day: getDayName(day), start_time: formatTime(start_time), end_time: formatTime(end_time), special_interest, type })) // Sort by day of the week .sort((a, b) => { return sorter[a.day] > sorter[b.day] ? 1 : -1; }) }; }) // Sort the top level meetings by title alphabetically .sort((a, b) => (a.title > b.title ? 1 : -1)) }; return res.json(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPt(id) {\n for (var i=0; i<points.length; i++) { \n if (points[i].id == id) { return points[i]; }\n }\n}", "function getInfo(point, callback) {\n var url = $.StringFormat('api/Map/GetRegionByPoint/{0}/{1}/{2}',\n 1, point[0], point[1]);\n url = getUrl(url);\n var url = getUrl(url);\n serviceInvoker.get(url, {}, {\n success: function (response) {\n callback(response)\n }\n }, null, true, true);\n }", "function getPoints(id) {\n\t\t\n\t\tmarkersSource = \"/markers.php\";\n\t\t\t\n\t\tif (id > 0) {\t\n\t\t\tmarkersSource = markersSource + \"?id=\" + id ;\n\t\t}\n\t\t\n\t\t$.ajax({\n\t\t\t\ttype: \"GET\",\n\t\t\t\turl: markersSource,\n\t\t\t\tdataType: \"xml\",\n\t\t\t\tsuccess: function(xml) {\n\t\t\t\t\t$(xml).find('marker').each(function(){\n\t\t\t\t\t\tlinktext = \"<a href='/name/\" + $(this).attr('sortname') + \"'>\";\n\t\t\t\t\t\tinfoHTML = \"<b>\" + $(this).attr('name') + \"</b><br>\" + $(this).attr('address') + \"<br>\" + linktext + \"View details and photos in inventory</a>\";\n\t\t\t\t\t\taddMarker($(this).attr('lat'), $(this).attr('lon'), infoHTML, id);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\n\n\t\t\n\t}", "function showMarkerSelected(id){\n\t// find the marker from google map objectlist\n\t// get the marker details\n\t// create infoWindow with de\n}", "function getMarkerById(id){\r\n\tvar mkr = null;\r\n\tmarkers_group.eachLayer(function (layer) {\r\n\t\tif (layer.myid == id){\r\n\t\t\tconsole.log(\"Marker Found: \"+id);\r\n\t\t\tmkr = layer;\r\n\t }\r\n\t});\r\n\tif (mkr == null){console.log(\"Marker Not Found\");}\r\n\treturn mkr;\r\n}", "function GetMarker(id){\n var len=markers.length;\n for (var i = 0; i < len; i++) {\n if(markers[i].mId==id){\n return markers[i];\n }\n }\n}", "function identify(event) {\r\n if (map.getZoom() >= 16) selectByCoordinate(event.latlng.lng, event.latlng.lat);\r\n}", "function getPropertyMapDetail(uuid) {\r\n return get('/property/mapdetail', { uuid: uuid }).then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "get point() {}", "function selectByCoordinate(lon, lat) {\r\n url = pointOverlay(lon, lat, 4326, 'tax_parcels', 'pid', \"\", 'json', '?');\r\n $.getJSON(url, function(data){\r\n if (data.total_rows > 0 ) {\r\n url = config.web_service_base + \"v1/ws_mat_pidgeocode.php?format=json&callback=?\";\r\n args = \"&pid=\" + urlencode(data.rows[0].row.pid);\r\n url = url + args;\r\n $.getJSON(url, function(data) {\r\n if (data.total_rows > 0 ) {\r\n message = \"<h5>Identfy</h5>\" + data.rows[0].row.address + \"<br />PID: \" + data.rows[0].row.parcel_id;\r\n message += \"<br /><br /><strong><a href='javascript:void(0)' class='identify_select' data-matid='\" + data.rows[0].row.objectid + \"' onclick='locationFinder(\\\"Address\\\", \\\"master_address_table\\\", \\\"objectid\\\", \" + data.rows[0].row.objectid + \");'>Select this Location</a></strong>\";\r\n $.publish(\"/layers/addmarker\", [ data.rows[0].row.longitude, data.rows[0].row.latitude, 1, message ]);\r\n }\r\n });\r\n }\r\n });\r\n}", "function ShowInfo(id){\n var desc=dataModel.locations[id].view.getDescription(id);\n // open new info window\n if(desc){\n // close infoo window if already open\n CloseInfo();\n infoWindow=new google.maps.InfoWindow({\n content: desc\n });\n infoWindow.open(mapElement, GetMarker(id));\n }\n}", "function GetXandYCoordinate(id){\n id = \"\"+id;\n return {y : id[0],x : id[1]};\n}", "function getInfo(id){\r\n\tif (id == \"default\" || id == null){\r\n\t\tid = \"hatsportletid\";\r\n\t}\r\n\tvar ret = new Info(null,false,null,id);\r\n\treturn (ret);\r\n}", "getMapPointData() {\n\t\treturn {\n\t\t\t'type': 'Feature',\n\t\t\t'features': [\n\t\t\t\t{\n\t\t\t\t\t'properties': {\n\t\t\t\t\t\t'id': 1,\n\t\t\t\t\t\t'label': 'House 1',\n\t\t\t\t\t},\n\t\t\t\t\t'geometry': {\n\t\t\t\t\t\t'type': 'Point',\n\t\t\t\t\t\t'coordinates': [-78.836754, 40.242299], // Note: long, lat\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t'properties': {\n\t\t\t\t\t\t'id': 2,\n\t\t\t\t\t\t'label': 'Building 2',\n\t\t\t\t\t},\n\t\t\t\t\t'geometry': {\n\t\t\t\t\t\t'type': 'Point',\n\t\t\t\t\t\t'coordinates': [-78.828488, 40.229427], // Note: long, lat\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t]\n\t\t};\n\t}", "function handlePointSelect(coordinate, layersSupportingGetFeatureInfo) {\n if (useInfoMarker === true) {\n _showInfoMarker(coordinate);\n }\n eventHandler.TriggerEvent(ISY.Events.EventTypes.MapClickCoordinate, coordinate);\n _trigStartGetInfoRequest(layersSupportingGetFeatureInfo);\n\n for (var i = 0; i < layersSupportingGetFeatureInfo.length; i++) {\n var subLayer = layersSupportingGetFeatureInfo[i];\n switch (subLayer.source) {\n case ISY.Domain.SubLayer.SOURCES.wmts:\n case ISY.Domain.SubLayer.SOURCES.wms:\n case ISY.Domain.SubLayer.SOURCES.proxyWms:\n case ISY.Domain.SubLayer.SOURCES.proxyWmts:\n _sendGetFeatureInfoRequest(subLayer, coordinate);\n break;\n case ISY.Domain.SubLayer.SOURCES.wfs:\n case ISY.Domain.SubLayer.SOURCES.vector:\n var features = mapImplementation.GetFeaturesInExtent(subLayer, mapImplementation.GetExtentForCoordinate(coordinate, pixelTolerance));\n _handleGetInfoResponse(subLayer, features);\n break;\n }\n }\n }", "function parseLocationNameDataOpenStreetMap(res, point, detail) {\n var locationName = detail ? res.address.city || res.address.state : res.address.state;\n return locationName ? (0, _extend3.default)({}, point, {\n locationName: locationName\n }) : point;\n}", "getMarker(x, y) {\n return this.level.getMarker(x, y);\n }", "function parseLocationNameDataOpenStreetMap(res, point, detail) {\n\t var locationName = detail ? res.address.city || res.address.state : res.address.state;\n\t return locationName ? (0, _extend3.default)({}, point, {\n\t locationName: locationName\n\t }) : point;\n\t}", "function getCoords( id, options ) {\n //let box = d3.select(`#${id}`).node().getBoundingClientRect();\n let x, y, latLng;\n if (options && options.anchor) {\n switch (options.anchor) {\n case 'center':\n x = (box.width / 2) + box.left;\n y = (box.height / 2) + box.top;\n latLng = map.layerPointToLatLng([x, y]);\n return [latLng.lat, latLng.lng];\n case 'center-left':\n x = box.left;\n y = (box.height / 2) + box.top;\n latLng = map.layerPointToLatLng([x, y]);\n return [latLng.lat, latLng.lng];\n case 'center-right':\n x = box.right;\n y = (box.height / 2) + box.top;\n latLng = map.layerPointToLatLng([x, y]);\n return [latLng.lat, latLng.lng];\n }\n } else {\n x = (box.width / 2) + box.left;\n y = (box.height / 2) + box.top;\n latLng = map.layerPointToLatLng([x, y]);\n }\n return [latLng.lat, latLng.lng];\n}", "function point(){\n console.log(position);\n console.log(\"lat:\"+ position.coordinate.lat + \"/lon:\" + position.coordinate.lon + \"/ip:\" + position.ip ) ;\n}", "function detectedPointToPhysical(id, xPixels, yPixels, zMm){\n\t\treturn kinectMappings[id](id, xPixels, yPixels, zMm);\n\t}", "function getGistIdCallback(response) {\n // Get data form response:\n var responseJsonText = response.documentElement.textContent;\n var responseJsonObject = JSON.parse(responseJsonText);\n console.log(responseJsonObject);\n // Callback to further process data:\n callback(responseJsonObject.PointByAreaLocationAndPointName);\n }", "getLocationInfo(){\n return this.map.getLocationInfo();\n }", "function shelterFind(id, number){\n var longitude = \"\";\n var latitude = \"\";\n var url = \"https://api.petfinder.com/shelter.get?format=json&key=0dbe85d873e32df55a5a7be564ae63a6&callback=?&id=\"+id;\n $.ajax({\n url: url,\n dataType: 'jsonp',\n method: 'shelter.get',\n }).done(function(result) {\n latitude = result.petfinder.shelter.latitude.$t;\n longitude = result.petfinder.shelter.longitude.$t;\n // Coordinates to center the map\n var myLatlng = new google.maps.LatLng(latitude,longitude);\n var myCenter = new google.maps.LatLng(parseFloat(latitude)+.9,longitude-.9);\n \n // Other options for the map, pretty much selfexplanatory\n var mapOptions = {\n zoom: 8,\n center: myCenter,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n var bounds = new google.maps.LatLngBounds();\n\n var marker = new google.maps.Marker({\n position: myLatlng,\n map: map,\n title: result.petfinder.shelter.name.$t\n });\n\n // Attach a map to the DOM Element, with the defined settings\n map = new google.maps.Map(document.getElementById(\"map\"+number), mapOptions);\n console.log(result.petfinder.shelter);\n });\n\n}", "function detailMunicipio(){\n munD = '';\n if (map.getZoom() >= 14){\n\t var latDet = roundNumber(targetCoordMun.lat(),7); while (latDet.length != 10){latDet = latDet + \"0\" + \"\";}\n\t\tvar lngDet = roundNumber(targetCoordMun.lng(),7); while (lngDet.length != 10){lngDet = lngDet + \"0\" + \"\";}\n\t\t\n\t\tvar plesso = coordPless['\"'+lngDet+','+latDet+'\"'][0];\n\t\t\n\t for (var x in plesso){\n\t\t\tmunD = plesso[x][\"M\"];\n\n\t\t}\n }\n\n}", "function getSpawnPoint(id){\r\n\tvar x;\r\n\tvar y;\r\n\tswitch(id){\r\n\t\tcase 0:\r\n\t\t\tx = 40;\r\n\t\t\ty = 40;\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\tx = 960;\r\n\t\t\ty = 560;\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tx = 40;\r\n\t\t\ty = 560;\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tx = 960;\r\n\t\t\ty = 40;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tx = 40;\r\n\t\t\ty = 40;\r\n\t\t\tbreak;\r\n\t}\r\n\tvar position = {\r\n\t\tx: x,\r\n\t\ty: y\r\n\t}\r\n\treturn position;\r\n}", "function getCoordinates(address) {\n var apiToken = \"pk.eyJ1IjoiY3B0c3Bvb2t5IiwiYSI6ImNrZDlpcDRheDA0b2IzM2pxZDZzNnI2Y2cifQ.0GQCDJlDIwPOy_9uR0Vgsw\";\n var mapboxURL = \"https://api.mapbox.com/geocoding/v5/mapbox.places/\" + address + \".json?access_token=\" + apiToken;\n\n $.ajax({\n url: mapboxURL,\n method: 'GET'\n }).then(function(response) {\n renderMarker(response.features[0].center);\n });\n }", "function getSensorMarkersByID(callback) {\n const sensorsurlwithid = sensorsurl + \"/\" + window.id;\n $.getJSON(sensorsurlwithid, function(data) {\n callback(data);\n });\n}", "function getSelectedPointInfo() {\n pointInfoRequest({\n requestingMethod: \"LearningCurve.getSelectedPointInfo\",\n datasetId: dataset,\n selected: true });\n}", "constructor(id = '4c893ec5105237044947c7f1') {\n this.id = id;\n this.coords = []; // for lat and lng in buildMap()\n this.tips = {};\n this.features = {};\n }", "function payerPoints(payer){\n console.log(pointMap.get(payer));\n return (\n <div>\n <h2>Points of Payer: {payer}</h2>\n </div>\n );\n \n}", "function showTreasureLocation(clickedId){\n if (clickedId == 'map-done'){\n $('#mini-map-input').hide();\n initMap();\n }\n else{\n $('#mini-map-input').show();\n }\n\n $.ajax({\n url: Url + '/treasures/' + clickedId,\n type: 'GET',\n success: function(response){\n returnedData = JSON.parse(response);\n var pos = JSON.parse(returnedData['gps coordinates'])\n var marker = new google.maps.Marker({\n position: pos\n });\n miniMap.setZoom(15);\n miniMap.setCenter(pos);\n marker.setMap(miniMap);\n }\n })\n}", "getObjectAtLoc(x, y) {\n let tile = this.getTile(x, y);\n if (tile.hasOwnProperty(\"object\")) //determine if an object lives here\n return tile.object;\n return \"None\";\n }", "selectMarkerById(id) {\n const marker = this.state.markers.filter(\n el => el.title === id,\n );\n console.log(marker[0]);\n const boxClass = 'infoBox';\n const myLatlng = new google.maps.LatLng(marker[0].position.lat,marker[0].position.lng);\n const markerPxPosition = fromLatLngToPixel(this._map, myLatlng);\n const infoBoxCorrectPxPosition = { x: markerPxPosition.x - 195, y: markerPxPosition.y - 385 };\n const coords = fromPixelToLatLng(this._map, { x: infoBoxCorrectPxPosition.x, y: infoBoxCorrectPxPosition.y });\n const markerPosition = new google.maps.LatLng({ lat: coords.lat(), lng: coords.lng() }); \n this.setState({ infoBoxData: { content: marker[0].infoContent, markerPosition, boxClass }, infoWindowData: null });\n //this.setState({ infoBoxData: { content: marker[0].infoContent, markerPosition, boxClass }, infoWindowData: null });\n /*\n _fromUser = false;\n\n const { list } = this.props;\n const itemIndex = findIndexByKeyValue(list, 'id', id);\n\n const { latitude, longitude } = list[itemIndex].address.location;\n\n // this.map.props.map.setZoom(21);\n // this.map.props.map.panTo(new google.maps.LatLng(latitude + 0.00011, longitude));\n\n const { markers } = this.state;\n const markerIndex = findIndexByKeyValue(markers, 'id', id);\n const marker = markers[markerIndex];\n\n this.setState({ infoShow: true, infoData: [marker], infoCenter: new google.maps.LatLng(marker.position.lat, marker.position.lng) });\n \n */\n }", "getDataInfo(dataId) {\n return this.texData.get(dataId);\n }", "function displayEventInfo(e) {\n if (e.targetType == \"map\") {\n var point = new Microsoft.Maps.Point(e.getX(), e.getY());\n var loc = e.target.tryPixelToLocation(point);\n document.getElementById(\"textBox\").value = loc.latitude + \", \" + loc.longitude;\n\n }\n }", "function displayMarkerInfo(e){\n GetSellerInformationFromIdPromise = GetSellerInformationFromId(e.target.options.sellerId);\n GetSellerInformationFromIdPromise.then((result) => {\n result =JSON.parse(result);\n if(result[\"SELL_ID\"] != 0){\n sellerId = result[\"SELL_ID\"];\n window.location.href = `/Seller/GetSellerById/${sellerId}`;\n }\n else{\n alert('Aucun résultat trouvé pour ce vendeur');\n }\n }).catch((error)=>{\n alert(`Erreur : ${error}`);\n })\n\n // Searching into DB seller info with this coords\n}", "function renderPoints(points_array){\n for(var i = 0; i < points_array.length; i++) {\n let pointObject = points_array[i]\n let latLng = {lat: Number(pointObject.lat), lng: Number(pointObject.long)};\n let marker = new google.maps.Marker({ //change this to ID later\n position: latLng,\n map: map,\n icon: image\n });\n markers.push(marker)\n newPointDescription(pointObject.title, pointObject.address, pointObject.description, pointObject.id, pointObject.img_url)\n }\n let map_id = $('#map').data('map_id')\n isUserOwnerOfMap(map_id)\n}", "function getCurrentMarker(locID){\n\tfor (var i=0, len = mapMarkers.length; i < len; i++){\n\t\tif (mapMarkers[i].id == locID){\n\t\t\treturn mapMarkers[i];\n\t\t}\n\t}\n}", "function showCoordinates(evt) {\n var mp = esri.geometry.webMercatorToGeographic(evt.mapPoint);\n\n //display mouse coordinates\n dojo.byId(self.settings.domID + \"-track-map-info\").innerHTML = EduVis.formats.lat(mp.y) + \", \" + EduVis.formats.lng(mp.x);\n\n }", "function getCoordinates(suggestion) {\n var plaats = suggestion.id;\n url = 'https://geodata.nationaalgeoregister.nl/locatieserver/lookup?fl=*&id=' + plaats;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var myArr = JSON.parse(this.responseText);\n getTarget(myArr);\n }\n };\n xmlhttp.open('GET', url, true);\n xmlhttp.send();\n}", "function showCoordinates(evt) {\n //the map is in web mercator but display coordinates in geographic (lat, long)\n var mp = webMercatorUtils.webMercatorToGeographic(evt.mapPoint);\n //display mouse coordinates\n dom.byId(\"info\").innerHTML = mp.x.toFixed(6) + \", \" + mp.y.toFixed(6);\n }", "function circleClickHandler() {\n var title = descriptionMap.get(this.id)[0]\n var info = descriptionMap.get(this.id)[1]\n alert(title + \"\\n\" + info)\n}", "async function getVertex(selectedPoint) {\n var url = `${geoserverUrl}/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=routing:nearest_vertex&outputformat=application/json&viewparams=x:${selectedPoint.lng};y:${selectedPoint.lat};`;\n const response = await fetch(url);\n var data = await response.json();\n var features = await data.features;\n return await features[0].properties.id;\n}", "function SerachByID(id) {\n for (let key of EmpMap_1.EmpMap.keys()) {\n if (key == id) {\n console.log(EmpMap_1.EmpMap.get(key));\n }\n }\n}", "function extractInfoPoints( data , mapConstants, imgConstants){\n\t//Map the data to only the important info\n\tretPoints=[];\n\tdata.forEach( function(d){\n\t\t//get the point and map it according to map constants\n\t\tactPoint = new Point( d.location_x, d.location_y, d.location_z );\n\t\tactPoint.x = ( ( actPoint.x - mapConstants[0]) / mapConstants[2] ) * imgConstants[0] + ( imgConstants[0] / 2 );\n\t\tactPoint.y = ( ( actPoint.y - mapConstants[1]) / mapConstants[3] ) * imgConstants[1] + ( imgConstants[1] / 2 );\n\t\tmapPoint = new Point(actPoint.x,actPoint.y,actPoint.z);\n\t\t\n\t\t//map to a infoPoint, extra based on the type of event\n\t\tswitch(d.event_type){\n\t\t\tcase 'player_heartbeat':\n\t\t\t\tretPoints.push(new infoPoint(mapPoint,d.round_seconds,d.is_sprinting));\n\t\t\tdefault:\n\t\t\t\tretPoints.push(new infoPoint(mapPoint,d.round_seconds,d.event_type));\n\t\t\t\tbreak;\n\t\t}\n\t});\n\t//make sure they are sorted\n\treturn retPoints.sort(function(a,b){return a.secs - b.secs});\n}", "get(id) {\n var key = this._idStringify(id);\n\n return this._map[key];\n }", "function getEventMarkersByID(callback) {\n const eventsurlwithid = eventsurl + \"/\" + window.id;\n $.getJSON(eventsurlwithid, function(data) {\n callback(data);\n });\n}", "_getMarker(markerId) {\n\t\tfor(let marker in this.markers) {\n\t\t\tif(this.markers[marker].id == markerId) {\n\t\t\t\treturn this.markers[marker];\n\t\t\t}\n\t\t}\n\t}", "function getMapData(data) {\n\n\tfor (var i = 0; i < data.length; i++) {\n loc[i] = data[i].loc;\n locX[i] = data[i].locx;\n locY[i] = data[i].locy;\n }\n\n//console.log(data[1]);\n}", "function showClueLocation(clickedId){\n if (clickedId == 'map-done'){\n $('#mini-map-input').hide();\n initMap();\n }\n else{\n $('#mini-map-input').show();\n }\n\n $.ajax({\n url: Url + '/clues/' + clickedId,\n type: 'GET',\n success: function(response){\n returnedData = JSON.parse(response);\n var pos = JSON.parse(returnedData['gps coordinates'])\n var marker = new google.maps.Marker({\n position: pos\n });\n miniMap.setZoom(15);\n miniMap.setCenter(pos);\n marker.setMap(miniMap);\n }\n })\n}", "function checkPointCoord(id) {\n\tvar points = [];\n\tsvg.selectAll(\".\" + id + \"-point\")\n .each(function(d) {\n \tvar point = [];\n\t\t\t \t$.grep(symptomInfoStack, function(stack, j) { \t\t\t\t\t\n\t\t\t\t\tif (stack.id != id && stack.id != 'default') {\n\t\t\t\t\t\t$.grep(stack.data, function(array, index) {\n\t\t\t\t\t\t\tif( xScale(new Date(array.date)) == xScale(new Date(d.date))\n\t\t\t\t\t\t\t\t&& yScale(array.value) == yScale(d.value))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log(\"> SAME COORD: \"+ stack.id+index.toString());\n\t\t\t\t\t\t\t\tpoint.push({id: stack.id+index.toString(), value: d.value});\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\tpoints.push(point);\n\t\t\t}\n\t\t);\n\treturn points;\n}", "function showCoordinates(evt) {\n //get mapPoint from event\n //The map is in web mercator - modify the map point to display the results in geographic\n var mp = esri.geometry.webMercatorToGeographic(evt.mapPoint);\n //display mouse coordinates\n dojo.byId(\"coords\").innerHTML = \"<b>Longitude: \" + mp.x.toFixed(2) + \"&nbsp;&nbsp;&nbsp;&nbsp;Latitude: \" + mp.y.toFixed(2) + \"</b>\";\n //dojo.byId(\"coords\").innerHTML = \"<b>X: \" + evt.mapPoint.x + \"&nbsp;&nbsp;&nbsp;Y: \" +evt.mapPoint.y + \"</b>\";\n }", "function getInfo(id) {\n // Read the JSON file to get data\n d3.json(\"static/data/samples.json\").then((samplesData) => {\n // Get the data info for the demographic \n var metadata = samplesData.metadata;\n console.log(metadata)\n // filter meta data info by id\n var result = metadata.filter(meta => meta.id.toString() === id)[0];\n console.log(result);\n // select demographic panel to insert data\n var demoInfo = d3.select(\"#sample-metadata\");\n \n // Clear out the demographic for every new id input \n demoInfo.html(\"\");\n \n // Grab the necessary demographic data for the id and append the info\n Object.entries(result).forEach((key) => { \n demoInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \n });\n });\n}", "function getSpotInfoFromReaderId(readerId) {\n return {spot_name:\"FB SCOPE Room\", spot_image:'http://sphotos-b.xx.fbcdn.net/hphotos-prn1/156221_109747199180823_827669867_n.jpg'};\n}", "displayInfo(id) {\r\n const endpoint = `https://pokeapi.co/api/v2/pokemon/${id}/`;\r\n\r\n const req = new Request(endpoint);\r\n\r\n fetch(req)\r\n .then(blob => blob.json())\r\n .then(data => console.log(data));\r\n }", "static getLocationById(woeid) {\n\t\tvar query =\n\t\t\t`select item, location \n\t\t\t\tfrom weather.forecast \n\t\t\t\twhere woeid = ${woeid} and u='c'`;\n\t\treturn axios.get(`${url}/?q=${query}&format=json`)\n\t\t\t.then(res => {\n\t\t\t\tvar item = res.data.query.results.channel.item;\n\t\t\t\tvar location = res.data.query.results.channel.location;\n\t\t\t\treturn {\n\t\t\t\t\twoeid: woeid,\n\t\t\t\t\ttitle: `${location.city}, ${location.region}, ${location.country}`,\n\t\t\t\t\tcondition: item.condition,\n\t\t\t\t\tforecast: item.forecast\n\t\t\t\t}\n\t\t\t});\n\t}", "function nearest_feature(pos) {\n return vertices_source.getClosestFeatureToCoordinate(pos.getGeometry().getFirstCoordinate()).get('id');\n }", "function findPointByCoordinates(x, y) {\n let point = null;\n pointsCollection.forEach(function (value) {\n if (value.getPosition().x === x && value.getPosition().y === y) {\n point = value;\n }\n });\n return point;\n}", "function getDetailMap () {\n return NgMap.getMap( { id : 'detail-map'} )\n }", "getFeature (layer, coordinates) {\n return this.getLayer(layer).getSource().getClosestFeatureToCoordinate(coordinates)\n }", "function getLeafletImageLocation() {\n return $(\"#\" + id).attr(\"data-leaflet-img\");\n }", "function search(panoId, param) {\n if (panoId in _pointClouds && getPointCloud(panoId)){\n var pc = getPointCloud(panoId);\n\n // kd-tree. It's slooooooow. I'll try Three.js later.\n // https://github.com/ubilabs/kd-tree-javascript\n //var point = pc.tree.nearest({x: param.x, y: param.y, z: param.z}, 1, 100);\n var point = pc.tree.nearest({x: param.x, y: param.y, z: param.z}, 1, 40);\n if (point && point[0]) {\n var idx = point[0][0].id;\n return idx;\n //var ix = idx / 3 % w;\n //var iy = (idx / 3 - ix) / w;\n //return {ix: ix, iy: iy};\n }\n }\n return null;\n }", "function getPoint(instr) {\n var latitude;\n var longitude;\n var pointname = \"Not named\";\n var matchref;\n var statusmessage = \"Fail\";\n var count;\n var coords = {};\n var pointregex = [\n /^([A-Za-z]{2}[A-Za-z0-9]{1})$/,\n /^([A-Za-z0-9]{6})$/,\n /^([\\d]{2})([\\d]{2})([\\d]{3})([NnSs])([\\d]{3})([\\d]{2})([\\d]{3})([EeWw])(.*)$/,\n /^([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})[\\s]*([NnSs])[\\W]*([0-9]{1,3}):([0-9]{1,2}):([0-9]{1,2})[\\s]*([EeWw])$/,\n /^(\\d{1,2})[\\s:](\\d{1,2})\\.(\\d{1,3})\\s*([NnSs])\\s*(\\d{1,3})[\\s:](\\d{1,2})\\.(\\d{1,3})\\s*([EeWw])$/\n ];\n for(count = 0; count < pointregex.length; count++) {\n matchref = instr.match(pointregex[count]);\n if(matchref) {\n switch(count) {\n case 0:\n case 1:\n //BGA or Welt2000 point\n $.ajax({\n url: \"findtp.php\",\n data: {\n postdata: matchref[0]\n },\n timeout: 3000,\n method: \"POST\",\n dataType: \"json\",\n async: false, //must be synchronous as order in which points are returned is important\n success: function (data) {\n pointname = data.tpname;\n if(pointname !== \"Not found\") {\n latitude = data.latitude;\n longitude = data.longitude;\n statusmessage = \"OK\";\n }\n }\n });\n break;\n case 2:\n //format in IGC file\n latitude = parseFloat(matchref[1]) + parseFloat(matchref[2]) / 60 + parseFloat(matchref[3]) / 60000;\n if(matchref[4].toUpperCase() === \"S\") {\n latitude = -latitude;\n }\n longitude = parseFloat(matchref[5]) + parseFloat(matchref[6]) / 60 + parseFloat(matchref[7]) / 60000;\n if(matchref[8].toUpperCase() === \"W\") {\n longitude = -longitude;\n }\n if(matchref[9].length > 0) {\n pointname = matchref[9];\n }\n if((latitude !== 0) && (longitude !== 0)) {\n statusmessage = \"OK\";\n }\n break;\n case 3:\n //hh:mm:ss\n latitude = parseFloat(matchref[1]) + parseFloat(matchref[2]) / 60 + parseFloat(matchref[3]) / 3600;\n if(matchref[4].toUpperCase() === \"S\") {\n latitude = -latitude;\n }\n longitude = parseFloat(matchref[5]) + parseFloat(matchref[6]) / 60 + parseFloat(matchref[7]) / 3600;\n if(matchref[8].toUpperCase() === \"W\") {\n longitude = -longitude;\n }\n break;\n case 4:\n latitude = parseFloat(matchref[1]) + parseFloat(matchref[2]) / 60 + parseFloat(matchref[3]) / (60 * (Math.pow(10, matchref[3].length)));\n if(matchref[4].toUpperCase() === \"S\") {\n latitude = -latitude;\n }\n longitude = parseFloat(matchref[5]) + parseFloat(matchref[6]) / 60 + parseFloat(matchref[7]) / (60 * (Math.pow(10, matchref[7].length)));\n if(matchref[8].toUpperCase() === \"W\") {\n longitude = -longitude;\n }\n statusmessage = \"OK\";\n break;\n }\n }\n }\n coords.lat = latitude;\n coords.lng = longitude;\n return {\n message: statusmessage,\n coords: coords,\n name: pointname\n };\n}", "function buildPointInfoString(point) {\n var commonKeys = ['name', 'id', 'category', 'x', 'value', 'y'],\n specialKeys = ['z', 'open', 'high', 'q3', 'median', 'q1', 'low', 'close'],\n infoString,\n hasSpecialKey = false;\n\n for (var i = 0; i < specialKeys.length; ++i) {\n if (point[specialKeys[i]] !== undefined) {\n hasSpecialKey = true;\n break;\n }\n }\n\n // If the point has one of the less common properties defined, display all that are defined\n if (hasSpecialKey) {\n H.each(commonKeys.concat(specialKeys), function (key) {\n var value = point[key];\n if (value !== undefined) {\n infoString += '. ' + key + ', ' + value;\n }\n });\n } else {\n // Pick and choose properties for a succint label\n infoString = (point.name || point.category || point.id || 'x, ' + point.x) + ', ' +\n (point.value !== undefined ? point.value : point.y);\n }\n\n return (point.index + 1) + '. ' + infoString + (point.description ? '. ' + point.description : '');\n }", "function showIdMarker(marker, locations) { \t\n\t\tvar latlgn = new google.maps.LatLng(locations[1], locations[2]);\n\t\tvar ifw = new google.maps.InfoWindow();\n\t\tifw = new google.maps.InfoWindow({\n\t\t\t content: (locations[4]).toString(),\n\t\t\t closeBoxURL: \"\",\n\t\t\t maxWidth: 160\n\t\t });\n\t\tifw.open(map, marker);\n }", "function executeIdentifyTask (event) {\n var g = event.mapPoint;\n g.setSpatialReference(new SpatialReference(102100));\n \n var params = new BufferParameters();\n params.distances = [ 500 ];\n params.bufferSpatialReference = new esri.SpatialReference({wkid: 102100});\n params.outSpatialReference = map.spatialReference;\n params.unit = GeometryService['Feet'];\n params.geometries = [g];\n gsvc.buffer(params, showBuffer);\n}", "function getgeoinfoFoss (event){\n\t\t //console.log(\"getgeoinfoUSGS\");\n\t\t// console.log(event.graphic.attributes);\n\t\t var attr = event.graphic.attributes;\n\t\t var lon=event.mapPoint.x;\n\t\t var lat=event.mapPoint.y;\t\t\n\t\t map.infoWindow.setTitle(\"Fossil Information \");\n\t\t map.infoWindow.setContent( \"<b>Formation:</b>\"+attr.Formation+\"<br/><b>Collection Name:</b>\"+attr.nam+\"<br/><b>Early interval:</b>\"+attr.oei);\n\n\t\t map.infoWindow.show(event.mapPoint, map.getInfoWindowAnchor(event.screenPoint));\n }", "function getLocation(object) {\n return fetch(`https://api.flickr.com/services/rest/?method=flickr.photos.geo.getLocation&api_key=${flickKey}&photo_id=${object.id}&format=json&nojsoncallback=1`)\n .then(r => r.json())\n .then(k => k.photo.location);\n}", "function showPosition() {\n fetch(\"https://ipwhois.app/json/?objects=city,latitude,longitude\")\n .then((response) => response.json())\n .then((data) => {\n let currentLat = parseFloat(data.latitude).toFixed(2);\n let currentLong = parseFloat(data.longitude).toFixed(2);\n let currentCity = data.city;\n // Adding position marker - the main map\n let markerHome = L.marker([currentLat, currentLong]).addTo(map);\n markerHome\n .bindPopup(`<em>You are here: </em><br><b>${currentLat}°, ${currentLong}°<br>in: <u>${currentCity}</u></b>`)\n .openPopup();\n // Adding position to the 3D Map\n showPosition3D(currentLat, currentLong, currentCity);\n // Showing Local Solar Time\n localSolarTime(currentLat, currentLong);\n })\n .catch(console.error);\n}", "function showInfoWindow(event) {\n\tvar $elementFired = $( event.data.elementPlotter );\n\t\n\tif (exists($elementFired)) {\n\t\tvar id = $elementFired.attr('item-id');\n\t\t\n\t\tif (id) {\n\t\t\tfor (var indexInfoMarks = 0; indexInfoMarks < markers.length; indexInfoMarks++) {\n\t\t\t\tvar infoMark = markers[indexInfoMarks];\n\t\t\t\t\n\t\t\t\tif (infoMark.id == id) {\n\t\t\t\t\tnew google.maps.event.trigger( infoMark.googleOBJ , 'click' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function map_pointer_switch(id){\n \t if (point_location==0){\n\t\tpoint_location=1;\n\t\tpoint_location_result_id=id;\n\t } else {\n\t\tpoint_location=0;\n\t\tpoint_location_result_id=\"\";\n\t }\n\t}", "function getCoordinate(event){\n\tmapCollector.coordinates = {\n\t\tlat: event.latLng.lat(),\n\t\tlng: event.latLng.lng()\n\t }\t\n\t return mapCollector.coordinates;\n}", "function getMapCountry(point){\n\tvar feature = thisMap.queryRenderedFeatures(point, {\n\t\tlayers:[\"countryMask\"],\n\t});\n\t//as long as we have something in the feature query \n\tif (typeof feature[0] !== 'undefined'){\n\t\treturn feature[0];\n\t}\n}", "function showMarkerInfo(placeID) {\n if (viewModel.currentPlace == null) {\n if (markersDictionary[placeID]) {\n markersDictionary[placeID].setIcon(highlightedIcon);\n populateInfoWindow(markersDictionary[placeID], largeInfowindow)\n } else {\n console.log('Please waite for Markers to be loaded.');\n viewModel.message('Please waite for Markers to be loaded.');\n }\n }\n}", "getMarker(x, y) {\n if (typeof this.maze[x + (y * this.tilesWide)] === 'object') {\n return this.maze[x + (y * this.tilesWide)];\n }\n else {\n return false;\n }\n }", "function getMap(mapId) {\nreturn dojo.filter(_maps, function (map) {\n return (map.id === mapId);\n})[0];\n}", "function GetShippingLocationByID(id) {\n try {\n debugger;\n var data = { \"ID\": id };\n var ds = {};\n ds = GetDataFromServer(\"ShippingLocation/GetShippingLocation/\", data);\n if (ds != '') {\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n notyAlert('error', ds.Message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "function showMarkerDetail(asset){\n\tvar markerTitle = asset.name + \" : \" + asset.type;\n\t\tmarkerTitle += \"\\n\" + \"latitude: \"+ asset.coordLat \n\t\tmarkerTitle += \"\\n\" + \"longitude: \"+ asset.coordLng \n\treturn markerTitle;\n}", "function markerSelected(markerId) {\n marker = namespace.markers[markerId];\n createPopRadius(marker);\n createInfoWindow(marker);\n findNearbyPOIs(marker);\n\n}", "async function getLatLng(data) {\n try {\n const response = await axios\n .get(\n `https://api.openweathermap.org/data/2.5/weather?q=${data}&appid=9d7a9a132d47022faca7ad4802838e35`\n )\n .then((res) => {\n lon = res.data.coord.lon;\n lat = res.data.coord.lat;\n });\n } catch (error) {\n console.log(error);\n }\n}", "function getInfo() { return document.getElementById('info') }", "function getMapRegion(point){\n\tvar feature = thisMap.queryRenderedFeatures(point, {\n\t\tlayers:[\"regionsMask\"],\n\t});\n\t//as long as we have something in the feature query \n\tif (typeof feature[0] !== 'undefined'){\n\t\treturn feature[0];\n\t} \n}", "function mapDetailsFunction(mapID, visibility) {\n mapDetails = {\n id: mapID,\n type: \"circle\",\n source: {\n type: \"geojson\",\n data: \"fires2021MissionExtinguish.geojson\",\n },\n layout: {\n 'visibility': visibility\n },\n paint: {\n \"circle-color\": fillColor,\n \"circle-opacity\": 1,\n 'circle-radius': {\n 'base': 2,\n 'stops': [\n [16, 5],\n [22, 180]\n ]\n },\n },\n }\n return mapDetails;\n}", "function addGeoJsonPoint(geojson, name, id, overlayId, modifiers, zoom) {\n var coordinates,\n iconUrl,\n xOffset,\n yOffset,\n xUnits,\n yUnits,\n fillColor,\n kml,\n obj,\n result,\n description,\n style,\n iconObj;\n\n // set defaults in case there aren't any parameters \n modifiers = modifiers || {};\n\n // retrieve the style elements from the geojson if availble.\n style = emp.geojsonParser.getStyle(geojson);\n\n if (modifiers.iconUrl) {\n modifiers.iconUrl = modifiers.iconUrl.replace('&', '&amp;');\n }\n\n iconUrl = modifiers.iconUrl || style.iconUrl;\n\n // If no icon has been specified try to pull the default icon\n // from the map environment.\n if (!iconUrl) {\n\n iconObj = emp.utilities.getDefaultIcon();\n\n iconUrl = iconObj.iconUrl;\n xOffset = iconObj.offset.x;\n yOffset = 1 - iconObj.offset.y;\n xUnits = iconObj.offset.xUnits;\n yUnits = iconObj.offset.yUnits;\n } else {\n xOffset = modifiers.iconXOffset || 0;\n yOffset = modifiers.iconYOffset || 0;\n xUnits = modifiers.xUnits || \"pixels\";\n yUnits = modifiers.yUnits || \"pixels\";\n }\n\n fillColor = modifiers.fillColor || style.fillColor || \"FF000000\";\n name = style.name || name || \"\";\n\n if (style.description) {\n description = style.description;\n } else if (modifiers.description) {\n description = modifiers.description;\n }\n\n fillColor = adjustColor(fillColor);\n\n if (geojson.coordinates !== undefined || geojson.coordinates !== null) {\n coordinates = geojson.coordinates;\n\n kml = '<Placemark>' +\n '<name><![CDATA[' + name + ']]></name>';\n\n if (description) {\n kml += '<description><![CDATA[' + description + ']]></description>';\n }\n\n kml += '<Style id=\"user-icon\">' +\n '<IconStyle>' +\n '<scale>1.0</scale>' +\n '<Icon>' +\n '<href>' + iconUrl + '</href>' +\n '</Icon>' +\n '<hotSpot x=\"' + xOffset + '\" y=\"' + yOffset + '\" xunits=\"' + xUnits + '\" yunits=\"' + yUnits + '\"/>' +\n '</IconStyle>' +\n '</Style>';\n\n result = getPointKml(coordinates);\n if (result.success) {\n kml += result.data;\n kml += '</Placemark>';\n\n obj = {\n kml: kml,\n name: name,\n id: id,\n overlayId: overlayId,\n data: geojson,\n format: 'geojson',\n properties: modifiers,\n zoom: zoom\n };\n\n return {\n success: true,\n message: \"\",\n data: obj\n };\n }\n\n } else {\n result = {\n success: false,\n message: \"geojson does not have a valid coordinate.\"\n };\n }\n\n return result;\n }", "function getInfo(element) {\n setupDefaultInfo(\n element,\n 'name',\n 'name_en',\n 'category',\n 'phone',\n 'rating',\n 'location',\n 'google_map',\n 'image',\n 'description'\n )\n getIdAndSetupRoute(element)\n}", "function displayTooltip (evt) {\n let feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) {\n return feature\n })\n tooltip.style.display = feature ? '' : 'none'\n if (feature) {\n let info = feature.N.geo.city + ', ' + feature.N.geo.country_name\n overlay.setPosition(evt.coordinate)\n $(tooltip).text(info)\n jTarget.css(\"cursor\", 'pointer')\n } else {\n jTarget.css(\"cursor\", '')\n }\n }", "function getFirstPointIdOfLine(featureId, layer) {\n\t\t\tvar mapLayer = this.theMap.getLayersByName(layer);\n\t\t\tif (mapLayer && mapLayer.length > 0) {\n\t\t\t\tmapLayer = mapLayer[0];\n\t\t\t}\n\t\t\tvar ft = mapLayer.getFeatureById(featureId);\n\t\t\tif (ft && ft.geometry && ft.geometry.components && ft.geometry.components.length > 0) {\n\t\t\t\treturn ft.geometry.components[0].id;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "function getDemoInfo(id) {\n // read the json file to get data\n d3.json(\"names.json\").then((data)=> {\n // get the metadata info for the demographic panel\n const metadata = data.metadata;\n \n console.log(metadata)\n \n // filter metadata info by id\n const result = metadata.filter(meta => meta.id.toString() === id)[0];\n // select demographic panel to put data\n const demographicInfo = d3.select(\"#name-metadata\");\n \n // empty the demographic info panel each time before getting new id info\n demographicInfo.html(\"\");\n \n // grab the necessary demographic data data for the id and append the info to the panel\n Object.entries(result).forEach((key) => { \n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \n });\n });\n }", "function getPoint(args) {\n console.log(\"called getPoint RPC with: \", args[0]);\n var loc_data = torque2wamp.getPoint(args[0]);\n var retval = {};\n for(var itmp in loc_data.names) {\n retval[loc_data.names[itmp]] = loc_data.values[itmp];\n }\n retval['coordinates'] = loc_data.coordinates;\n var retval_json = JSON.stringify(retval)\n return retval;\n }", "function MouseOverItem(idPoint, e) {\n idItemOver = idPoint.replace(\"item\", \"\");\n if (InfoEdiMode == \"Info\") {\n ShowInfoFromPoint(idItemOver, e);\n }\n}", "function getInfo(id) {\n // read the json file\n d3.json(\"samples.json\").then((data)=> {\n \n // get info for panel\n var metadata = data.metadata;\n\n console.log(metadata)\n\n // filter data\n var result = metadata.filter(meta => meta.id.toString() === id)[0];;\n\n // select demographic \n var demographicInfo = d3.select(\"#sample-metadata\");\n \n demographicInfo.html(\"\");\n\n // append the info to the panel\n Object.entries(result).forEach((key) => { \n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \n });\n });\n}", "function getInfoMN(PrecinctID) {\n var myData = precinctData[PrecinctID];\n var toReturn = '';\n var statNames = Object.keys(stateSyntax);\n // console.log(statNames);\n // console.log(myData);\n for (var i = 0; i < statNames.length; i++) {\n var statName = statNames[i];\n toReturn += \"<br>\";\n toReturn += \"<b>\" + statName + \"</b>: \";\n toReturn += myData[stateSyntax[statName]];\n }\n toReturn += \"<br><b>District</b>: \" + precinctDistricts[myData[stateSyntax[precinctID_NAME]]];\n return toReturn;\n}", "function showCurrentLocation(request, featureId, layername, point) {\n\t\t\t//IE doesn't know responseXML, it can only provide text that has to be parsed to XML...\n\t\t\tvar results = request.responseXML ? request.responseXML : util.parseStringToDOM(request.responseText);\n\n\t\t\tvar resultContainer = $('#geolocationResult');\n\t\t\tresultContainer.empty();\n\n\t\t\tvar addressResult = util.getElementsByTagNameNS(results, namespaces.xls, 'Address');\n\t\t\taddressResult = addressResult ? addressResult[0] : null;\n\t\t\tvar address = util.parseAddress(addressResult);\n\n\t\t\t//use as waypoint button\n\t\t\tvar useAsWaypointButton = new Element('span', {\n\t\t\t\t'class' : 'clickable useAsWaypoint',\n\t\t\t\t'title' : 'use as waypoint',\n\t\t\t\t'id' : featureId,\n\t\t\t\t'data-position' : point.x + ' ' + point.y,\n\t\t\t\t'data-layer' : layername\n\t\t\t});\n\t\t\taddress.insert(useAsWaypointButton);\n\n\t\t\t//set data-attributes\n\t\t\taddress.setAttribute('data-layer', layername);\n\t\t\taddress.setAttribute('id', featureId);\n\t\t\taddress.setAttribute('data-position', point.x + ' ' + point.y);\n\n\t\t\tresultContainer.append(address);\n\n\t\t\t//event handling\n\t\t\t$('.address').mouseover(handleMouseOverElement);\n\t\t\t$('.address').mouseout(handleMouseOutElement);\n\t\t\t$('.address').click(handleSearchResultClick);\n\t\t\t$('.useAsWaypoint').click(handleUseAsWaypoint);\n\t\t}", "function onePoint() {\n var branch_id = $('#branch_id').val();\n var postData = 'branch=' + branch_id + '&_csrf=' + $('.toPost').val();\n $.post('/companies/getonepoint', postData, function(data) {\n var answer = jQuery.parseJSON(data);\n\n onePoint = prepareOnePlacemark(answer);\n myMap.geoObjects.add(onePoint);\n myMap.setCenter([answer.ay, answer.ax], 16);\n\n });\n }", "locate(id) {\n return this.show(id);\n }", "function showLastKnownLocationOfProfessorOnMap(){\n sendData = {'findName': $('#findName').val()};\n \n $.get('../find',\n sendData,\n function(data){\n var jData = jQuery.parseJSON(data);\n var color = randomColor();\n \n jData['rows'].forEach(function(dPoint){\n var posX = dPoint['value']['posX'];\n var posY = dPoint['value']['posY'];\n var time = dPoint['value']['time'];\n var currentTime = (new Date().getTime())/1000;\n var timeDifference = currentTime - parseInt(time);\n var radius;\n \n if ((timeDifference > 30000) || (timeDifference < 0)){\n // Don't do anything! \n } else {\n radius = 40 * Math.pow((30000 - timeDifference),6) / Math.pow(30000,6);\n radius = (radius < 15 ? 10 : radius);\n drawCircleOnMap(posX, posY, dPoint['key'][0], radius, color, 60000);\n }\n });\n });\n }", "function getId(index){\n\treturn cachedPinInfo[index].id;\n}", "function showEntity(data, guid) {\n var center = null;\n if (data['result'] == null) {\n\t// Removes invalid entities from the list of recently created entities.\n\tvar i = 0;\n\twhile (i < recent_entities.length) {\n\t if (recent_entities[i][0] == guid) {\n\t\trecent_entities.splice(i, 1);\n\t } else {\n\t\t++i;\n\t }\n\t}\n\tinitRecentEntities();\n\treturn;\n }\n if (!guid) {\n\tguid = data['query']['params']['guid'];\n }\n var name = data['result']['name'];\n var geom = data['result']['geom'];\n if (geom['type'] == 'Point') {\n\tvar lon = geom['coordinates'][0];\n\tvar lat = geom['coordinates'][1];\n\taddMapPoint(linkURL(guid, name), lat, lon);\n\t_entity_centers[guid] = new GLatLng(lat, lon);\n } else if (geom['type'] == 'Polygon') {\n\tvar points = geom['coordinates'][0];\n\tvar polypoints = [];\n\tfor (var i = 0; i < points.length; ++i) {\n\t polypoints.push(new GLatLng(points[i][1], points[i][0]));\n\t}\n\tvar polygon =\n\t new GPolygon(polypoints, \"#f33f00\", 3, 1, \"#ff0000\", 0.15);\n\t_map.addOverlay(polygon);\n\t_map.addOverlay(\n\t createMarker(polygon.getBounds().getCenter(), linkURL(guid, name)));\n\t_entity_centers[guid] = polygon.getBounds().getCenter();\n }\n var numResults = data['result'].length;\n}", "function getFeatureInfo(mapReq, callback){\n\tvar getFeatureInfoError = validateMapQuery(mapReq);\n\tif(!getFeatureInfoError){\n\t\tcreateMap(mapReq, function(createMapError, map){\n\t\t\tif(createMapError){\n\t\t\t\tcallback(createMapError);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmap.queryMapPoint(mapReq.i, mapReq.j, {}, function(err, results) {\n\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\tconsole.log(results)\n\t\t\t\t\tvar attributes = [];\n\t\t\t\t\tfor(var resultsIndex = 0; resultsIndex < results.length; ++resultsIndex){\n\t\t\t\t\t\tif(mapReq.query_layers.indexOf(results[resultsIndex].layer) != -1){\n\t\t\t\t\t\t\tvar features = results[resultsIndex].featureset; // assuming you're just grabbing the first object in the array\n\t\t\t\t\t\t\tvar feature;\n\t\t\t\t\t\t\twhile ((feature = features.next())) {// grab all of the attributes and push to a temporary array\n\t\t\t\t\t\t\t\tattributes.push(feature.attributes());\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\tcallback(null, attributes);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t} else{\n\t\tcallback(getFeatureInfoError)\n\t}\n}", "function loadInfoForLatLon(lat_lon) {\n var url;\n if (lat_lon == 'pop') {\n url = SITE + '/popular.json';\n } else {\n url = JSON_BASE + '/' + lat_lon.replace(',', '') + '.json';\n }\n\n return $.getJSON(url).then(function(response_data, status, xhr) {\n // Add these values to the cache.\n $.extend(photo_id_to_info, response_data);\n var photo_ids = [];\n for (var k in response_data) {\n photo_ids.push(k);\n }\n if (lat_lon != 'pop') {\n lat_lon_to_name[lat_lon] = extractName(response_data);\n }\n return photo_ids;\n });\n}" ]
[ "0.6529646", "0.62422067", "0.6213143", "0.61647475", "0.6152371", "0.612864", "0.60602134", "0.60185033", "0.5978962", "0.5912388", "0.5903155", "0.58792114", "0.57814556", "0.5766544", "0.56738406", "0.5672328", "0.56620836", "0.566206", "0.56618106", "0.5645751", "0.56390494", "0.5620059", "0.5615023", "0.5608956", "0.5605133", "0.56035423", "0.5592489", "0.55727005", "0.555576", "0.5535444", "0.5534388", "0.5532104", "0.5511672", "0.5506842", "0.5506674", "0.5502069", "0.549916", "0.5497008", "0.549488", "0.5468353", "0.5462533", "0.5459741", "0.54324496", "0.5417366", "0.54103875", "0.54103273", "0.5405656", "0.5404343", "0.5397449", "0.5393924", "0.538199", "0.5381544", "0.5379072", "0.5374168", "0.53593856", "0.5358154", "0.53417945", "0.5340401", "0.5334614", "0.53212905", "0.53209335", "0.5309008", "0.53005105", "0.5287688", "0.5279304", "0.5277088", "0.52769125", "0.52603626", "0.5257046", "0.52566904", "0.52516353", "0.5250108", "0.5249869", "0.5248666", "0.52453816", "0.5245265", "0.52428895", "0.5239166", "0.52358407", "0.52271205", "0.5226824", "0.5225783", "0.52253306", "0.52231497", "0.5221231", "0.52211684", "0.5219346", "0.5217307", "0.5211242", "0.52030796", "0.52029467", "0.5199776", "0.5198809", "0.5196671", "0.51939785", "0.5193641", "0.5191117", "0.519055", "0.5189657", "0.5186449", "0.51850265" ]
0.0
-1
Send the search query to NLP, use result to search for IDs of locations so the application can show just those locations
async function search(req, res) { const q = req.body.q; const { data } = await axios.get("https://api.wit.ai/message", { params: { q, v: 20181205 }, headers: { Authorization: `Bearer ${process.env.WIT_KEY}` } }); const info = {}; let rows = await database .select("id") .from("locations") .map(row => row.id); if (data.entities) { await Promise.all( Object.keys(data.entities).map(async entityName => { const entity = data.entities[entityName][0]; console.log(entity); if (entity.confidence < 0.9) return; if (entityName === "neighborhood") { const center = { lat: +entity.metadata.split(",")[0], lon: +entity.metadata.split(",")[1] }; info.center = center; const locationIDs = await database .select("id") .from("locations") .whereRaw( ` ( 3959 * acos( cos(radians(${center.lat})) * cos(radians(latitude)) * cos( radians(longitude) - radians(${center.lon}) ) + sin(radians(${center.lat})) * sin(radians(latitude)) ) ) < 0.75 ` ) .map(row => row.id); rows = rows.filter(id => locationIDs.includes(id)); } // Specific time or day "tomorrow", "in 2 days", "now", "tomorrow at 3" if (entityName === "datetime" && entity.value) { const days = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]; const date = new Date(entity.value); const day = days[date.getDay()]; const query = database .select("locations.id") .from("meeting_hours") .leftJoin("meetings", "meeting_hours.meeting_id", "meetings.id") .leftJoin("locations", "meetings.location_id", "locations.id") .where({ day }); if (entity.grain === "hour" || entity.grain === "minute" || entity.grain === "second") { query.where({ start_time: date.toLocaleTimeString("en-GB") }); } query.groupBy("locations.id"); const dayIDs = await query.map(row => row.id); rows = rows.filter(id => dayIDs.includes(id)); info.day = day; } // Time range "before 3pm", "after 10a", "between 12 and 4" // Because the meetings are a recurring event, it doesn't necessarily make // sense to have "After monday", as it will wrap around indefinitely if (entityName === "datetime" && (entity.to || entity.from)) { const query = database .select("locations.id") .from("meeting_hours") .leftJoin("meetings", "meeting_hours.meeting_id", "meetings.id") .leftJoin("locations", "meetings.location_id", "locations.id"); if (entity.from) { const date = new Date(entity.from.value); query.where("start_time", ">", date.toLocaleTimeString("en-GB")); info.from = date; } if (entity.to) { const date = new Date(entity.to.value); query.where("start_time", "<", date.toLocaleTimeString("en-GB")); info.to = date; } query.groupBy("locations.id"); const dayIDs = await query.map(row => row.id); rows = rows.filter(id => dayIDs.includes(id)); } }) ); } return res.json({ ids: rows, info }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doSearchWith(location) {\n state = 1;\n locations = [];\n errorMessage = '';\n searchTerm = location;\n\n $$('#search-text').val(searchTerm);\n\n doSearchByTerm();\n }", "searchGoogle(searchStr, location2) {\n console.log(\"I'm in search Google on the front-end\");\n console.log(searchStr);\n console.log(location2);\n API.searchGoogle({\n search: searchStr,\n location: location2\n })\n .then(res => {\n console.log(\"I've completed searchYelp and i'm on the client. Here is res\");\n console.log(res);\n })\n .catch(err => console.log(err));\n }", "async function mapsearch (mapTerm) {\n try {\n const url = 'http://www.mapquestapi.com/geocoding/v1/address'\n const apiKey = 'am1BU3QUNaeuhkwz9knde0YtIjINA42j'\n\n\n const mapresponse = await axios.get(url, {\n params: {\n location: mapTerm,\n key: apiKey,\n }\n\n })\n\n //console.log (\"MAP\")\n //console.log (mapresponse)\n //console.log (Number(mapresponse.data.results[0].locations[0].latLng.lat))\n //console.log (Number(mapresponse.data.results[0].locations[0].latLng.lng))\n\n let lattitude = (Number(mapresponse.data.results[0].locations[0].latLng.lat))\n let longitude = (Number(mapresponse.data.results[0].locations[0].latLng.lng))\n\n //send positions back for search\n search(\"\",lattitude,longitude)\n\n\n\n } catch (error) {\n\n console.log(error)\n\n }\n }", "function doSearchByTerm(location) {\n app.showPreloader();\n\n ps.searchByTerm(searchTerm, searchByTermSuccess, searchByTermError);\n\n function searchByTermSuccess(data) {\n processResponse(data);\n }\n\n function searchByTermError(data) {\n showErrorState({message: 'Other error'});\n }\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}", "function search(){\n let query;\n if(searchLocation===\"location\"){\n searchLocation(\"\")\n }\n query=`https://ontrack-team3.herokuapp.com/students/search?location=${searchLocation}&className=${searchClass}&term=${searchName}` \n prop.urlFunc(query);\n }", "search (query) {\n\t\t// Store lat/lng of locality to use in this url (focus.point.lat, focus.point.lon)\n \t\t//const endpoint = `https://search.mapzen.com/v1/autocomplete?text=${query}&api_key=${this.props.config.mapzen.apiKey}&focus.point.lat=${this.props.coordinates[0]}&focus.point.lon=${this.props.coordinates[1]}&layers=venue`\n \t\tconst placetype = this.state.placetype\n \t\tconst endpoint = `https://whosonfirst-api.mapzen.com/?method=whosonfirst.places.search&api_key=${this.props.config.mapzen.apiKey}&q=${query}&${placetype}=${this.props.source.id}&placetype=venue&per_page=100&extras=geom:latitude,geom:longitude,sg:,addr:full,wof:tags`\n \t\tthis.throttleMakeRequest(endpoint)\n\t}", "function searchToLatLong(request, response){\r\n let query = request.query.data;\r\n\r\n // define the search\r\n\r\n let sql = `SELECT * FROM locations WHERE search_query=$1;`;\r\n let values = [query]; //always array\r\n console.log('line 67', sql, values);\r\n\r\n //make the query fo the database\r\n client.query(sql, values)\r\n .then (result => {\r\n // did the db return any info?\r\n console.log('result from Database', result.rowCount);\r\n if (result.rowCount > 0) {\r\n response.send(result.rows[0]);\r\n }else {\r\n console.log('results', result.rows);\r\n //otherwise go get the data from the api\r\n const url = `https://maps.googleapis.com/maps/api/geocode/json?address=${request.query.data}&key=${process.env.GEOCODE_API_KEY}`;\r\n console.log(url);\r\n superagent.get(url)\r\n\r\n\r\n .then(result => {\r\n if (!result.body.results.length) {throw 'NO DATA';}\r\n else {\r\n let location = new Location(query, result.body.results[0]);\r\n let newSQL = `INSERT INTO locations (search_query, formatted_address, latitude, longitude) VALUES ($1, $2, $3, $4) RETURNING ID;`;\r\n let newValues = Object.values(location);\r\n\r\n client.query(newSQL, newValues)\r\n .then( data => {\r\n //attach returnilng id to the location object\r\n location.id = data.rows[0].id;\r\n response.send(location);\r\n });\r\n }\r\n })\r\n .catch(err => handleError(err, response));\r\n }\r\n })\r\n}", "search(response) {\n return new Promise((resolve, reject) => {\n if ('search_query' in response.entities) {\n response.context.items = response.entities.search_query[0].value;\n delete response.context.missing_keywords;\n } else {\n response.context.missing_keywords = true;\n delete response.context.items;\n }\n return resolve(response.context);\n });\n }", "function textSearch(input){\n var query = {\n key:key.placekey,\n query:input+\" in Hong Kong\",\n // region:\"hk\",\n }\n var options = {\n host: 'maps.googleapis.com',\n path:'/maps/api/place/textsearch/json?'+qs.stringify(query),\n method: 'GET'\n }\n var body = null;\n https.get(options, function(res) {\n // console.log('STATUS: ' + res.statusCode);\n // console.log('HEADERS: ' + JSON.stringify(res.headers));\n // Buffer the body entirely for processing as a whole.\n var bodyChunks = [];\n res.on('data', function(chunk) {\n // You can process streamed parts here...\n bodyChunks.push(chunk);\n }).on('end', function() {\n body = Buffer.concat(bodyChunks);\n var tmp = body.toString('utf8');\n tmp = JSON.parse(tmp);\n for (var item in tmp[\"results\"]){\n // console.log(tmp[\"results\"][item]);\n var json = {};\n json[\"mapID\"] = tmp[\"results\"][item][\"place_id\"];\n json[\"mapName\"] = tmp[\"results\"][item][\"name\"];\n json[\"status\"] = tmp[\"status\"];\n json[\"geometry\"] = tmp[\"results\"][item][\"geometry\"][\"location\"];\n json[\"types\"] = tmp[\"results\"][item][\"types\"];\n savePlace(json);\n }\n });\n });\n}", "function searchRestaurants(){\n sendID();\n let search = {term: keywords.value, location: locations.value};\n let xhr = new XMLHttpRequest;\n xhr.open(\"POST\",\"/search\", true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.onloadend = function(e) {\n if (xhr.readyState === 4 && xhr.status === 200) { \n console.log(`Search found ${JSON.parse(xhr.response).businesses.length} restaurants`);\n if (document.getElementById(\"search_results\").hasChildNodes()) {\n while (document.getElementById(\"search_results\").firstChild) {\n document.getElementById(\"search_results\").removeChild(document.getElementById(\"search_results\").firstChild);\n }\n }\n\n for(i = 0; i < JSON.parse(xhr.response).businesses.length; i++){\n displaySearchResults(JSON.parse(xhr.response).businesses[i], 0);\n }\n console.log(\"after displayresults\")\n }\n };\n xhr.send(JSON.stringify(search));\n}", "function processQuery(query) {\n var service = Map.service($scope.map);\n service.textSearch({\n query: query\n }, displayResult);\n }", "localSearch(queryId, searchInput, maxResults) {\n // This results dictionary will have domain object ID keys which\n // point to the value the domain object's score.\n let results;\n const input = searchInput.trim().toLowerCase();\n const message = {\n request: 'search',\n results: {},\n total: 0,\n queryId\n };\n\n results = Object.values(this.localIndexedItems).filter((indexedItem) => {\n return indexedItem.name.toLowerCase().includes(input);\n });\n\n message.total = results.length;\n message.results = results\n .slice(0, maxResults);\n const eventToReturn = {\n data: message\n };\n this.onWorkerMessage(eventToReturn);\n }", "executeSearch(term) {\n var results;\n try {\n results = this.search.fuse.search(term); // the actual query being run using fuse.js\n } catch (err) {\n if (err instanceof TypeError) {\n console.log(\"hugo-fuse-search: search failed because Fuse.js was not instantiated properly.\")\n } else {\n console.log(\"hugo-fuse-search: search failed: \" + err)\n }\n return;\n }\n let searchitems = '';\n\n if (results.length === 0) { // no results based on what was typed into the input box\n this.resultsAvailable = false;\n searchitems = '';\n } else { // we got results, show 5\n for (let item in results.slice(0,5)) {\n let result = results[item];\n if ('item' in result) {\n let item = result.item;\n searchitems += this.itemHtml(item);\n }\n }\n this.resultsAvailable = true;\n }\n\n this.element_results.innerHTML = searchitems;\n if (results.length > 0) {\n this.top_result = this.element_results.firstChild;\n this.bottom_result = this.element_results.lastChild;\n }\n }", "function mapSearch()\n {\n // reset the markers\n clearPlaces();\n\n // Create the PlaceService and send the request.\n // Handle the callback with an anonymous function.\n service = new google.maps.places.PlacesService(map);\n service.nearbySearch(request, function(results, status) {\n $('.wbf-search-form .btn .fa').addClass('hidden'); // hide loading icon\n\n // no results\n if (status == google.maps.places.PlacesServiceStatus.ZERO_RESULTS) {\n swal({title: translations.swal.no_results, text: translations.swal.no_results_msg, type: \"warning\"});\n }\n // yup there's results\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n\n for (var i = 0; i < results.length; i++) {\n var place = results[i];\n addPlaceMarker(place);\n }\n addSearchMarker(request.location);\n showRadius(request.location, request.radius);\n }\n });\n }", "function search() {\n console.log(\"search \", search);\n const ingredientsList = ingredients.join(\",\");\n const url = `http://localhost:8888/api?i=${ingredientsList}&q=${inputValue}&p=1`;\n axios\n .get(url)\n .then((res) => {\n console.log(\"res \", res);\n setResults(res.data.results);\n })\n .catch((err) => {\n console.log(\"err \", err);\n });\n }", "function Search() {\n if ($('#doc-count').html() != \"\") {\n $('#loading-indicator').show();\n }\n else $('#progress-indicator').show();\n\n q = $(\"#q\").val();\n\n // Get center of map to use to score the search results\n $.get('/api/GetDocuments',\n {\n q: q != undefined ? q : \"*\",\n searchFacets: selectedFacets,\n currentPage: currentPage\n },\n function (data) {\n $('#loading-indicator').css(\"display\", \"none\");\n $('#progress-indicator').css(\"display\", \"none\");\n UpdateResults(data);\n });\n}", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "function printLocations(){\n var service = new google.maps.places.PlacesService(map);\n service.textSearch(textRequest, callbackTen); \n}", "static query( lat, lng, radius ) {\n\t\treturn new Promise( (resolve, reject) => {\n\t\t\t\n\t\t\t// Prepare query\n\t\t\tlet query = {\n\t\t\t\t'action': 'locations_search',\n\t\t\t\tlat,\n\t\t\t\tlng,\n\t\t\t\tsearch_radius: radius,\n\t\t\t};\n\t\t\t\n\t\t\tif( typeof fetch == 'function' ) {\n\t\t\t\t// If fetch is available, use it\n\t\t\t\tlet headers = new Headers({ 'Accept': 'application/json' });\n\t\t\t\tlet formData = new FormData();\n\t\t\t\tfor( let key in query ) {\n\t\t\t\t\tif( query.hasOwnProperty( key ) ) {\n\t\t\t\t\t\tformData.append( key, query[key] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfetch( locsearch.ajax_url, {method: 'POST', headers, body: formData} )\n\t\t\t\t\t.then( result => {\n\t\t\t\t\t\tif( !result.ok ) reject( Error( result.statusText ) );\n\t\t\t\t\t\treturn result.json();\n\t\t\t\t\t})\n\t\t\t\t\t.then( resolve ).catch( reject );\n\t\t\t} else {\n\t\t\t\t// Otherwise fallback to jQuery\n\t\t\t\tjQuery.post({\n\t\t\t\t\turl: locsearch.ajax_url,\n\t\t\t\t\tdata: query,\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\terror: function( jqXHR, status, error ) {\n\t\t\t\t\t\treject( Error( `Error: ${error}` ) );\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function( locations, status, jqXHR ) {\n\t\t\t\t\t\tresolve( locations );\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t});\n\t}", "function search(req, res, next) {\n // values from form post method\n let userQuery;\n if (req.body.speech) {\n userQuery = {\n term : req.body.speech,\n // location : req.body.location,\n // cll : latlng,\n // cll : req.body.cll,\n };\n }\n // console.log('userQuery *** ', userQuery);\n\n const reqParams = {\n location : 'New+York',\n limit : 3, // returns only 3 results\n sorting : 1, // sorts by distance\n cll : '40.7398476,-73.99020680000001', // General Assembly\n radius_filter : 8000, // approx 5 miles\n // cll : latlng,\n\n oauth_consumer_key : process.env.CONSUMER_KEY,\n oauth_token : process.env.TOKEN,\n oauth_nonce : n(),\n oauth_timestamp : n().toString().substr(0, 10),\n oauth_signature_method : 'HMAC-SHA1',\n oauth_version : '1.0',\n };\n\n /* the order of parameters matter as the next param will overwrite if the key already exists */\n // const params = Object.assign(userQuery, reqParams);\n const params = _.assign(reqParams, userQuery);\n\n const CONSUMER_SECRET_KEY = process.env.CONSUMER_SECRET_KEY;\n const TOKEN_SECRET = process.env.TOKEN_SECRET;\n\n // create signature with oauth generate function\n const signature = oauthSignature.generate(\n 'GET', // HTTP method\n URL,\n params,\n CONSUMER_SECRET_KEY,\n TOKEN_SECRET,\n { encodeSignature: false }\n );\n\n // add to params for api call\n params.oauth_signature = signature;\n\n // stringify an object into a query string, sorting the keys\n // i.e., turn objects into strings to be used as query strings\n const paramsURL = qs.stringify(params);\n\n // new url for yelp api call\n const API_URL = `${URL}?${paramsURL}`;\n // console.log('API_URL ***', API_URL);\n\n fetch(API_URL)\n .then(urlResult => urlResult.json())\n .then(jsonResult => {\n res.yelpResults = jsonResult;\n next();\n })\n .catch(err => {\n res.err = err;\n next(err);\n });\n}", "function SearchUserObject() {\n concatResult();\n window.searchQuery = searchInput.value;\n CreateURI(centerLat, centerLng);\n}", "handleSearch(queryString) {\n const helper = algoliasearchHelper(client, indexName);\n\n helper.on(\"result\", content => {\n this.setState({\n query: queryString,\n searchResults: content.hits,\n currentResults: content.hits.slice(0, 5),\n count: content.nbHits,\n searchTime: content.processingTimeMS,\n currentCategory: null,\n currentPayment: null\n });\n });\n\n if (!this.state.geoLocation) {\n helper\n .setQueryParameter(`aroundLatLngViaIP`, true)\n .setQuery(queryString)\n .search();\n } else {\n const { lat, lng } = this.state.geoLocation;\n helper\n .setQueryParameter(`aroundLatLng`, `${lat}, ${lng}`)\n .setQuery(queryString)\n .search();\n }\n }", "search() {\n let location = ReactDOM.findDOMNode(this.refs.Search).value;\n if (location !== '') {\n let path = `/search?location=${location}`;\n makeHTTPRequest(this.props.updateSearchResults, path);\n }\n }", "function searchPlaces(query)\n{\n\n service = new google.maps.places.PlacesService(map);\n service.textSearch(query, processPlaces);\n \n}", "function search(keyword, start_date, start_time, end_date, end_time, category, location){\n\n let searchRequest = {\"lost_or_found\": 0, // 0 == found\n \"keyword\": keyword,\n \"start_date\": start_date,\n \"start_time\": start_time,\n \"end_date\": end_date,\n \"end_time\": end_time,\n \"category\": category,\n \"location\":location}\n \n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\",\"/search\");\n xhr.setRequestHeader('Content-Type', 'application/json')\n \n xhr.addEventListener(\"load\", function() {\n if (xhr.status == 200) {\n // Do something here with the results...\n console.log(xhr.responseText)\n \n var entries = JSON.parse(xhr.responseText)\n \n for(var i = 0; i < entries.length; i++){\n addNewResult(entries[i].title, \n entries[i].photo_url,\n entries[i].category,\n entries[i].location,\n entries[i].date,\n entries[i].description);\n }\n \n } else {\n console.log(\"ERROR IN search: \", xhr.responseText);\n }\n });\n xhr.send(JSON.stringify(searchRequest));\n}", "function GeoLocQuery(){}", "function wildlifeCentres() {\n\n //check whether the value field is not empty\n // if it is not, proceed with the search\n if(document.getElementById(\"userQuery\").value != \"\") {\n\n // delete any existing markers\n deleteMarkers();\n query = 'Wildlife centres';\n userQuery = document.getElementById(\"userQuery\").value;\n\n //depending on what the user has typed, the title on the page will be changed\n document.querySelector(\".new-heading\").textContent = userQuery;\n\n // create a request object\n let request = {\n placeId: place.place_id,\n // location: globalPos,\n // radius: '100000',\n //again, it doesn't matter where you are, just search for the wildlife centres(query)\n // in the region user has chosen (userQuery)\n query: [ query + ' ' + userQuery ]\n };\n\n // create the service object\n const service = new google.maps.places.PlacesService(map);\n\n // perform a search based on the request object and callback\n service.textSearch(request, callback);\n\n // this is an inner callback function as referenced immediately above\n function callback(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n for (let i = 0; i < results.length; i++){\n addMarker(results[i]);\n }\n }\n }\n\n // display all the pins on the map\n displayAllMarkers(map);\n\n //if the user puts an empty value\n } else {alert (\"Search field is empty! Put some value there.\")}\n }", "function search() {\n var search = {\n bounds: map.getBounds(),\n types: [\"restaurant\"]\n }\n\n places.nearbySearch(search, function(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n clearResults()\n clearMarkers()\n // Create a marker for each hotel found, and\n // assign a letter of the alphabetic to each marker icon.\n for (var i = 0; i < results.length; i++) {\n var markerLetter = String.fromCharCode(\"A\".charCodeAt(0) + i % 26)\n var markerIcon = MARKER_PATH + markerLetter + \".png\"\n\n // Use marker animation to drop the icons incrementally on the map.\n markers[i] = new google.maps.Marker({\n position: results[i].geometry.location,\n icon: markerIcon,\n zIndex: -1\n })\n\n // If the user clicks a restaurant marker, show the details of that restaurant\n // in an info window.\n markers[i].placeResult = results[i]\n google.maps.event.addListener(markers[i], \"click\", showInfoWindow)\n setTimeout(dropMarker(i), i * 100)\n addResult(results[i], i)\n }\n }\n })\n}", "function displaySearchResults(results) {\n var addressClickHandler = function() {\n var location = $(this).data('location');\n $('#directions').empty();\n findPollingLocationFor(location);\n };\n if (results.length === 1) {\n findPollingLocationFor(results[0].geometry.location);\n } else {\n var $ul = $('<ul>').addClass('location-choices').appendTo('#directions');\n for (var i = 0; i < results.length; i++) {\n var result = results[i];\n var link = $('<a>').text(result.formatted_address).data('location', result.geometry.location).on('click', addressClickHandler);\n $('<li>').append(link).appendTo($ul);\n }\n $('.modal').modal('hide');\n }\n }", "_getQueryGeocode(data, params) {\n return {\n text: data,\n outFields: params.outFields || '*',\n maxLocations: params.maxLocations || 10,\n };\n }", "function search(){\n\n\n // remove all markers from the map. Useful when a new search is made \n\n for(i=0;i<all_markers.length;i++){\n\n all_markers[i].marker_obj.setMap(null);\n\n }\n\n // hide the placeholder text and remove previous results from the list\n var placetext = document.getElementById(\"placeholder-text\");\n if(placetext) placetext.innerHTML = \"\";\n \n placesList = document.getElementById('places');\n placesList.innerHTML = \"\";\n\n // prepare request object for place api search\n\n var request = {\n location: pyrmont,\n radius: 5000,\n types: [\"restaurant\"]\n };\n\n var keyword = document.getElementById(\"keyword\").value;\n var minprice = document.getElementById(\"minprice\").value;\n var maxprice = document.getElementById(\"maxprice\").value;\n var opennow = document.getElementById(\"opennow\").checked;\n\n if(keyword != \"\") \n request.name = keyword;\n \n request.minprice = minprice;\n request.maxprice = maxprice;\n\n if(opennow) request.opennow = true;\n\n console.log(request);\n\n \n // initialize the service \n var service = new google.maps.places.PlacesService(map);\n service.nearbySearch(request, callback);\n}", "function search() {\n var search = {\n bounds: map.getBounds(),\n types: ['lodging']\n };\n\n places.nearbySearch(search, function(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n clearMarkers();\n // Create a marker for each hotel found, and\n // assign a letter of the alphabetic to each marker icon.\n for (var i = 0; i < results.length; i++) {\n var markerLetter = String.fromCharCode('A'.charCodeAt(0) + i);\n var markerIcon = MARKER_PATH + markerLetter + '.png';\n // Use marker animation to drop the icons incrementally on the map.\n markers[i] = new google.maps.Marker({\n position: results[i].geometry.location,\n animation: google.maps.Animation.DROP,\n icon: markerIcon\n });\n // If the user clicks a hotel marker, show the details of that hotel\n // in an info window.\n markers[i].placeResult = results[i];\n google.maps.event.addListener(markers[i], 'click', showInfoWindow);\n setTimeout(dropMarker(i), i * 100);\n //addResult(results[i], i);\n }\n }\n });\n}", "function requestSearchResults(query) {\n return {\n type: CONSTANTS.REQUEST_SEARCH_RESULTS,\n query: query\n }\n}", "function searchHandler(results, status) {\n\n const MAX_ITEMS = 10;\n var numberOfItems;\n\n if (results.length > MAX_ITEMS) {\n numberOfItems = MAX_ITEMS;\n } else {\n numberOfItems = results.length;\n }\n\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n for (var i = 0; i < numberOfItems; i++) {\n var resultItem = results[i];\n // save search result in the model\n var place = {\n \"googlePlaceId\": resultItem.place_id,\n \"yelpId\": '',\n \"isFavourite\": false,\n \"title\": resultItem.name,\n \"position\": resultItem.geometry.location,\n \"wikiSearchTerm\": 'Erlangen',\n \"categoryIcon\": resultItem.icon,\n }\n\n if (objectExistsInArray(vm.placeList(), place) == false) {\n vm.placeList.push( new Place(place) );\n }\n }\n\n // TODO:Make sure the selected item persists after reload\n\n vm.generateAllMarkers();\n\n vm.applyFilter();\n\n saveData();\n }\n}", "function doSearch() {\n twitter.getSearch({\n q: SEARCH_WORDS.join(\" \"),\n lang: \"en\",\n count: 15\n }, (err, response, body) => {\n console.error(\"SEARCH ERROR:\", err);\n }, (data) => {\n var response = JSON.parse(data);\n processTweets(response.statuses);\n });\n}", "function retrieveGeocodeResults(data) {\n searchButton.style.display = 'inline';\n\n if (data.results && data.results.length > 0) {\n var location = data.results[0];\n var coords = location.geometry.location;\n getPlaces(coords.lat, coords.lng, '');\n getFoursquareEvents(coords.lat, coords.lng, '', location.formatted_address);\n getEventfulEvents(coords.lat, coords.lng, '', location.formatted_address);\n getUpcomingEvents(coords.lat, coords.lng, '', location.formatted_address);\n locationInput.value = location.formatted_address;\n LOCATION_KEY = location.formatted_address.split(',')[0];\n setTitlePage(LOCATION_KEY);\n } else {\n // TODO: error handling\n }\n}", "render() {\n\n\t\tconst {locations, query} = this.props;\n\t\tconst locationList = locations.filter(\n\t\t\titem => item.title.toLowerCase().indexOf(query.toLowerCase()) !== -1);\n\t\t\n return (<div className=\"options-box\">\n <header><h1>Find Your Neighborhood Places</h1></header> \t\n \n <input type=\"text\" className=\"search-location\" tabIndex=\"0\" role=\"search\" placeholder=\"Search Places\" value={query}\n onChange={event => this.props.searchByQuery(event)}/>\n <div>\n \t<ul className=\"location-item-list\">\n \t{locationList.map((item, index) => (\n\t\t\t\t\t\t\t<LocationListItem key={index} location={item} markerClick={item => {\n\t\t\t\t\t\t\t\tthis.props.markerClick(item);\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\n \t</ul> \n </div>\n </div>); \n\t}", "static async search(query) {\n const res = await this.request(`search`, { query });\n return res;\n }", "async function getRestaurants(lat,lng, r, response) {\n var result = await geoSearch(lat,lng, r);\n console.log(result);\n response.send(JSON.stringify(result));\n}", "search(){\n let query_description = this.query_description\n //let query_location = this.query_location\n client.fetch('https://jobs.github.com/positions.json?search='+query_description)\n .then(response => response.json())\n .then(data => {\n this.jobs = data;\n });\n }", "function callSearchLocation(){\n\tif(\"undefined\" != address && null != address && 0 < address.length && currentlyEmittedAddressIndex < address.length-1){\n\t\taddressString = address.slice(currentlyEmittedAddressIndex + 1,address.length).join(\" \");\n\t\tcurrentlyEmittedAddressIndex ++;\n\t\tsearchLocationOnMapAddressArray(addressString);\n\t}\n}", "async function searchAccuWeatherLocations(req, res, next) {\n\t// Use request to call the AccuWeather text search API\n\tlet getResponse = await requestLib.get({\n\t\t\"headers\": {\n\t\t\t\"content-type\": \"application/json\",\n\t\t\t\"Authorization\": req.access_token\n\t\t},\n\t\t\"url\": \"https://dataservice.accuweather.com/locations/v1/search\",\n\t\t\"body\": JSON.stringify({\n\t\t\t\"apikey\": req.body.accuWeatherApiKey, // AccuWeather API Key\n\t\t\t\"q\": req.body.q // The text query to search\n\t\t\t\"language\": req.body.language,\n\t\t\t\"details\": req.body.details,\n\t\t\t\"offset\": req.body.offset,\n\t\t\t\"alias\": req.body.alias\n\t\t})\n\t}, (error, responseBody) => {\n\t\tif(error) {\n\t\t\tconsole.log(`Error searching location information. Status: ${error.status}. Message: ${error.message}`);\n\t\t\treturn next(error);\n\t\t}\n\n\t\tlet response = JSON.parse(responseBody.body);\n\t\tconsole.log(`Location information found for ${q}.`);\n\t\treturn res.status(200).json({ \"locationKey\": response.Key });\n\t});\n}", "function runSearch(query) {\n\n return new Promise(function(resolve,reject){\n\n fetch(placeRequest + query + '&key=' + placeKey).then(function(response){\n return response.json();\n }).then(function(json) {\n results = json.results;\n console.log(results);\n\n //Format response with necessary data\n var resultItems = results.map(function(obj){\n var place = {\n location: {}\n };\n\n place.id = obj.id\n place.name = obj.name\n place.address = obj.formatted_address\n place.location.lng = obj.geometry.location.lng\n place.location.lat = obj.geometry.location.lat\n\n if (obj.website !== undefined) {\n place.website = obj.website\n }\n\n if (obj.photos !== undefined) {\n place.photo = `https://maps.googleapis.com/maps/api/place/photo?maxwidth=1200&photoreference=${obj.photos[0].photo_reference}&key=${placeKey}`\n } else{\n place.photo = '/placeholder.jpg'\n }\n\n return place;\n\n });\n\n state.search.items = resultItems\n resolve();\n\n }).catch(function(err){\n console.log(err);\n throw err;\n reject();\n });\n\n });\n }", "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "function search_twitter_eind(keyword_value) {\n\n\n var twitter_search_params = {q: keyword_value, count: 300};\n\n\n client.get('search/tweets', twitter_search_params, function(error, tweets, response) {\n\n\n\n var results = [];\n\n if(!error) {\n\n\n for(tweet of tweets.statuses) {\n\n\n if(tweet.user.location != null && tweet.user.location.trim().length > 0 && tweet.lang == 'nl') {\n\n console.log('>Tweet: ' + '\\n' + tweet.text + '\\n\\n' + '>Locatie: ' + '\\n' + tweet.user.location + '\\n')\n\n var result2 = {tweet: tweet.text, location: tweet.user.location};\n\n results.push(result2);\n\n }\n\n } \n\n } else {\n\n console.log('No tweets:' + error );\n }\n\n\n //console.log(tweets);\n\n\n if (results.length === 0) {\n io.emit('errormessageeind', \"Sorry, your end search doesn't match any located tweets.\")\n \n } else {\n \n\n io.emit('search_twitter_results_eind', choice(results)); \n\n }\n\n });\n\n}", "function placeSearch(latitude, longitude, radius) {\n //Uncomment if using Google API\n // let link = '/maps/api/place/nearbysearch/json?location=' + latitude + ',' + longitude + '&radius=' + radius + '&type=' + searchTag +'&key=' + gapikey;\n // https.request({\n // host: 'maps.googleapis.com',\n // path: link,\n // method: 'GET'},\n // PlaceResponse).end();\n\n // Mapquest API\n let path_name = '/search/v2/radius?key=' + qapikey +'&maxMatches=4&origin=' + latitude + ',' + longitude + '&hostedData=mqap.ntpois|name LIKE ?|%'+ searchTag + '%';\n https.request({\n host: 'www.mapquestapi.com',\n path: encodeURI(path_name),\n method: 'GET'},\n PlaceResponse).end();\n }", "function sendSearchResult(search) {\n selectAndExecute(\"sr/\" + forHash(search), function() {\n var response = {type: \"searchresult\", link: \"search\", search: search, lists: [], controlLink: location.hash};\n response.header = $.trim($(\"#breadcrumbs\").find(\".tab-text\").text());\n var searchView = $(\"#main .search-view\");\n response.moreText = $.trim(searchView.find(\"div .header .more:visible\").first().text());\n response.lists.push(parseSublist(searchView, \"srar\", 6));\n response.lists.push(parseSublist(searchView, \"sral\", 5));\n response.lists.push(parseSublist(searchView, \"srs\", 10));\n response.empty = response.lists[0] === null && response.lists[1] === null && response.lists[2] === null;\n post(\"player-navigationList\", response);\n });\n }", "function searchToLatLng(request, response) {\n const locationName = request.query.data;\n const geocodeURL = `https://maps.googleapis.com/maps/api/geocode/json?address=${locationName}&key=${GEOCODE_API_KEY}`;\n client\n .query(\n `SELECT * FROM locations\n WHERE search_query =$1`,\n [locationName]\n )\n .then(sqlRes => {\n if (sqlRes.rowCount === 0) {\n console.log('from web');\n superagent\n .get(geocodeURL)\n .then(result => {\n let location = new LocationConstructor(result.body);\n location.search_query = locationName;\n client.query(\n `INSERT INTO locations(search_query,formatted_query, latitude, longitude)\n VALUES($1,$2,$3,$4)`,\n [\n location.search_query,\n location.formatted_query,\n location.latitude,\n location.longitude\n ]\n );\n response.send(location);\n })\n .catch(error => {\n console.error(error);\n response.status(500).send('Status 500: Life is hard mang.');\n });\n } else {\n response.send(sqlRes.rows[0]);\n }\n });\n}", "function searchVenue(){\n\t\t$(\"#query\").click(function(){\n\t\t\t$(this).val(\"\");\n\t\t});\n\n\t\t$(\"#query\").blur(function(){\n\t\t\tif ($(this).val() == \"\") {\n\t\t\t\t$(this).val(\"Example: Ninja Japanese Restaurant\");\n\t\t\t}\n\t\t\n\t\t\tif ($(this).val() != \"Example: Ninja Japanese Restaurant\") {\n\t\t\t\t$(this).addClass(\"focus\");\n\t\t\t} else {\n\t\t\t\t$(this).removeClass(\"focus\");\n\t\t\t}\n\t\t});\n\n\t\t//Submit search query and call to getVenues\n\t\t$(\"#searchform\").submit(function(event){\n\t\t\tevent.preventDefault();\n\t\t\tif (!lat) {\n\t\t\t\tnavigator.geolocation.getCurrentPosition(getLocation);\n\t\t\t} else {\n\t\t\t\tgetVenues();\n\t\t\t}\t\t\n\t\t});\n\n\t}", "function findLocation(query, callback) {\n $.ajax('http://nominatim.openstreetmap.org/search', {\n data: { format: 'json', q: query }, \n dataType: 'json'\n }).success(function(data) {\n callback(data.map(function(item) { \n return { \n latlng: [item.lat, item.lon], \n name: item.display_name \n }; \n }));\n });\n }", "function buildResults(searchKeyword,searchLocation,limit,resultsnum,pageNumber,first,home) {\n\n\tvar searchKey =searchKeyword;\n\tvar searchLoc = searchLocation;\n\tvar lim = limit;\n\tvar resultsNumber = resultsnum;\n\tvar pagenum = pageNumber;\n\tvar initialSearch = first;\n\tvar center = home;\n\n\tgetCenter(center);\n\n\tvar queryURL = \"http://api.indeed.com/ads/apisearch?publisher=8023780673544955&format=json\"+searchKey+searchLoc+lim+resultsNumber+\"&v=2\";\n\t//console.log('queryURL: '+queryURL);\n\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET',\n\t crossDomain: true,\n\t dataType: 'jsonp'\n\t})\n\t.done(function(response) {\n\t\t\n\t\t//console.log(response);\n\n\t\tvar results = response.results\n\t\tvar numResults = response.totalResults;\n\t\tvar query = response.query;\n\t\tvar responseLocation = response.location;\n\n\t\t$(\"#resultsListHeader\").html(\"<div class=\\\"searchHeader\\\"><span class='badge'>\"+numResults+\"</span> Results for: <span class='badge'>\"+query+\"</span> - <span class='badge'>\"+responseLocation+\"</span></div>\");\n\t\t$('#resultsList').html('');\n\n\t\tfor (var i = 0; i < results.length; i++) {\n\n\t\t\tvar jobTitle = results[i].jobtitle;\n\t\t\tvar company = results[i].company;\n\t\t\tvar location = results[i].formattedLocationFull;\n\t\t\tvar snippet = results[i].snippet;\n\t\t\tvar link = results[i].url;\n\t\t\tvar jobKey = results[i].jobkey;\n\n\t\t\t$(\"#resultsList\").append(\"<a href=\"+link+\" target=\\\"_blank\\\" ><div class=\\\"searchResult\\\" id=\"+jobKey+\"><h2>\" + jobTitle + \"</h2><p>\" + company + \" - \" + location + \"</p><p>\" + snippet + \"</p></div></a>\");\n\t\t\t//$(\"#resultsList\").append(\"<div class=\\\"searchResult\\\" id=\"+jobKey+\"><a href=\"+link+\" target=\\\"_blank\\\" ><h2>\" + jobTitle + \"</h2><p>\" + company + \" - \" + location + \"</p><p>\" + snippet + \"</p></a></div>\");\n\n\t\t\tvar secondURL = 'http://api.indeed.com/ads/apigetjobs?publisher=8023780673544955&jobkeys='+jobKey+'&format=json&v=2';\n\n\t\t\t$.ajax({\n\t\t\t\turl: secondURL,\n\t\t\t\tmethod: 'GET',\n\t\t\t crossDomain: true,\n\t\t\t dataType: 'jsonp'\n\t\t\t})\n\t\t\t.done(function(response) {\n\t\t\t\t//console.log('inner respsonse:');\n\t\t\t\t//console.log(response);\n\t\t\t\tvar long = response.results[0].longitude;\n\t\t\t\tvar lat = response.results[0].latitude;\n\t\t\t\tvar jobKey = response.results[0].jobkey;\n\t\t\t\tvar jobTitle = response.results[0].jobtitle;\n\t\t\t\tvar link = response.results[0].url;\n\t\t\t\tvar cCompany = response.results[0].company;\n\t\t\t\tvar snippet = response.results[0].snippet;\n\t\t\t\n\t\t\t\tvar myLatlng = new google.maps.LatLng(lat,long);\n\t\t\t\t\t\t\t \n\t\t\t\tvar allMarkers = new google.maps.Marker({\n\t\t\t\t\tposition: myLatlng,\n\t\t\t\t\tmap: map,\n\t\t\t\t\ticon: 'assets/images/markerIcon.png',\n\t\t\t\t\tanimation: google.maps.Animation.DROP,\n\t\t\t\t\ttitle: jobTitle\n\t\t\t\t});\n\t\t\t \t\n\t\t\t\tvar contentString = '<div id=\"content\">'+\n\t\t\t\t\t\t\t\t\t\t'<div id=\"siteNotice\">'+\n\t\t\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t\t\t'<h3 id=\"firstHeading\" class=\"firstHeading\">'+jobTitle+'</h3>'+\n\t\t\t\t\t\t\t\t\t\t'<div id=\"bodyContent\">'+\n\t\t\t\t\t\t\t\t\t\t\t'<p><b>'+cCompany+'</b></p>'+\n\t\t\t\t\t\t\t\t\t\t\t'<p>'+snippet+'</p> '+\n\t\t\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t\t'</div>';\n\n\t\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\t\tcontent: contentString,\n\t\t\t\t\tmaxWidth: 300, \n\t\t\t\t\tbuttons: { close: { visible: false } }\n\t\t\t\t});\n\n\t\t\t\tgoogle.maps.event.addListener(allMarkers, 'click', function() {\n\t\t\t\t\tinfowindow.open(map,this);\n\t\t\t\t\t\t$('#' + jobKey).addClass('clicked').parent().siblings().children().removeClass('clicked');\n\t\t\t\t\t\t$('.resultsarea').scrollTop(0);\n\t\t\t\t\t\t$('.resultsarea').animate({\n\t\t\t\t\t\t\tscrollTop: $('#' + jobKey).position().top - 25 }, 500);\n\t\t\t\t});\n\n\t\t\t\tgoogle.maps.event.addListener(allMarkers, 'mouseover', function() {\n\t\t\t\t\tinfowindow.open(map,this);\n\t\t\t\t});\n\t\t\t\tgoogle.maps.event.addListener(allMarkers, 'mouseout', function() {\n\t\t\t\t\tinfowindow.close(map,this);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tconsole.log ('allmarkers:');\n\t\t\t\tconsole.log (allMarkers);\n\n\t\t\t});\t\t\t\n\t\t}\n\t\t\n\n\t\tif ( Math.ceil(numResults / 10) > pagenum ){\n\t\t\t$(\"#resultsList\").append(\"<button type=\\\"button\\\" class=\\\"btn btn-default center-block\\\" id=\\\"nextPage\\\">Next 10 <span class=\\\"glyphicon glyphicon-chevron-right\\\" aria-hidden=\\\"true\\\"></span></button>\");\n\t\t\t$('#nextPage').click(function(){\n\t\t\t\t//initMap();\n\t\t\t\t\n\t\t\t\tif (initialSearch) {\n\t\t\t\t\tvar start = '&start=';\n\t\t\t\t\tinitialSearch = false;\n\t\t\t\t\tpagenum++;\n\t\t\t\t\tbuildResults(searchKey,searchLoc,start,resultsNumber,pagenum,initialSearch,center);\n\t\t\t\t} else {\n\t\t\t\t\tvar start = '&start=';\n\t\t\t\t\tpagenum++;\n\t\t\t\t\tresultsNumber = resultsNumber + 10;\n\t\t\t\t\tbuildResults(searchKey,searchLoc,start,resultsNumber,pagenum,initialSearch,center);\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif ( pagenum > 1 ){\n\t\t\t$(\"#resultsList\").append(\"<button type=\\\"button\\\" class=\\\"btn btn-default center-block\\\" id=\\\"previousPage\\\"><span class=\\\"glyphicon glyphicon-chevron-left\\\" aria-hidden=\\\"true\\\"></span> Previous 10</button>\");\n\t\t\t$('#previousPage').click(function(){\n\t\t\t\t//initMap();\n\t\t\t\tgetCenter(center);\n\t\t\t\tif (pagenum == 2) {\n\t\t\t\t\tvar limit = \"&limit=\";\n\t\t\t\t\tfirst = true;\n\t\t\t\t\tresultsNumber = 10;\n\t\t\t\t\tpagenum--;\n\t\t\t\t\tbuildResults(searchKey,searchLoc,limit,resultsNumber,pagenum,first,center);\n\t\t\t\t} else {\n\t\t\t\t\tvar start = '&start=';\n\t\t\t\t\tpagenum--;\n\t\t\t\t\tresultsNumber = resultsNumber - 10;\n\t\t\t\t\tbuildResults(searchKey,searchLoc,start,resultsNumber,pagenum,first,center);\t\t\t\t\n\t\t\t\t}\n\t\t\t});\t\n\t\t}\n\n\t});\n}", "function performSearch(){\n\n\t//The request for the Search\n\tvar request = {\n\t\tbounds: map.getBounds(),\n\t\ttypes: [\"gas_station\"],\n\t\tkeyword: 'Gas Station'\n\t};\n\n\t//Searching in the Map\n\tservice.radarSearch(request, callback);\n}", "function searchLocations() {\n\n var address = document.getElementById(\"addressInput\").value;\n\n var geocoder = new google.maps.Geocoder();\n\n geocoder.geocode({ address: address }, function( results, status ) {\n\n if (status == google.maps.GeocoderStatus.OK) {\n searchLocationsNear(results[0].geometry.location);\n } else {\n alert(address + ' not found');\n }\n \n });\n\n }", "function performSearch() {\n // reset the scroll in case they scrolled down to read prior results\n window.scrollTo(0, 0)\n\n fetchSearch(\n // Ensures event properties include \"type\": \"gene\" in search logging.\n 'gene', {\n page: searchParams.page,\n genes: searchParams.genes,\n preset: searchParams.preset\n }).then(results => {\n setSearchState({\n params: searchParams,\n isError: false,\n isLoading: false,\n isLoaded: true,\n results,\n updateSearch\n })\n }).catch(error => {\n setSearchState({\n params: searchParams,\n isError: true,\n isLoading: false,\n isLoaded: true,\n results: error,\n updateSearch\n })\n })\n }", "function getLocationData(searchQuery, res) {\n checkExist(searchQuery, res);\n\n // const query = {\n // key: process.env.GEOCODE_API_KEY,\n // q: searchQuery,\n // limit: 1,\n // format: 'json'\n // };\n // let url = 'https://us1.locationiq.com/v1/search.php';\n // superagent.get(url).query(query).then(data => {\n // try {\n // let longitude = data.body[0].lon;\n // let latitude = data.body[0].lat;\n // let displayName = data.body[0].display_name;\n\n // let sqlQuery = `insert into citylocation(cname,lat,long) values ($1,$2,$3)returning*`;\n // let value = [displayName, latitude, longitude];\n // client.query(sqlQuery, value).then(data => {\n // console.log(\"data inserted\" + data);\n // // res.status(200).send(\"data inserted\",data.text[0].lat);\n // }).catch(error => {\n // // console.log(\"data not inserted\"+error);\n // res.status(500).send(\"data not inserted\", error);\n // });\n\n\n // let responseObject = new CityLocation(searchQuery, displayName, latitude, longitude);\n // res.status(200).send(responseObject);\n // } catch (error) {\n // res.status(500).send('Sorry, something went wron' + error);\n // }\n\n // }).catch(error => {\n // res.status(500).send('Sorry, something went wron' + error);\n // });\n\n}", "function makeSearch() {\n var query = $('#search-line').val();\n if (query.length < 2) {\n return null;\n }\n\n // cleanup & make AJAX query with building response\n $('#ajax-result-items').empty();\n $.getJSON(script_url+'/api/search/index?query='+query+'&lang='+script_lang, function (resp) {\n if (resp.status !== 1 || resp.count < 1)\n return;\n var searchHtml = $('#ajax-carcase-item').clone().removeClass('hidden');\n $.each(resp.data, function(relevance, item) {\n var searchItem = searchHtml.clone();\n searchItem.find('#ajax-search-link').attr('href', site_url + item.uri);\n searchItem.find('#ajax-search-title').text(item.title);\n searchItem.find('#ajax-search-snippet').text(item.snippet);\n $('#ajax-result-items').append(searchItem.html());\n searchItem = null;\n });\n $('#ajax-result-container').removeClass('hidden');\n });\n }", "function search(params, returnResult = false) {\n\n if(!params) {\n params = {\n terms: document.getElementById('terms').value,\n limitByNum: document.getElementById('limitByNum').checked,\n num: document.getElementById('num').value,\n starred: document.getElementById('starred').checked,\n tags: document.getElementById('tags').value.split(' ').map(tag => { if(tag!='') { return '@'+tag } else { return '' } }).join(' '),\n useAnd: document.getElementById('useAnd').checked,\n filterEarlier: document.getElementById('filterEarlier').value,\n filterLater: document.getElementById('filterLater').value\n }\n }\n\n return new Promise((resolve, reject)=>{\n postFromButton('searchButton', 'Searching...', '/jrnlAPI/search',\n params,\n (data)=>{\n if(!data.success && data.stderr) {\n showModal('Error', data.stderr)\n reject()\n return\n }\n\n if(returnResult) {\n resolve(data)\n return\n }\n\n let tags = Object.keys(data.tags)\n let entries = data.entries\n if (entries) {\n document.getElementById('searchResults').innerHTML = printEntries(entries, tags)\n \n removeMarkers()\n let markers = entries.map(entry => { return createMarker(entry, tags) })\n markers = markers.filter(marker => marker != null)\n markers.forEach(marker => { addMarker(marker) })\n centerMap(markers)\n\n resolve(data)\n return\n }\n })\n })\n}", "function search(query) {\n var aMatches = aLastResults =_search(query)\n .filter(function(o) {\n return o.sIdMatch !== null || o.sNameMatch !== null;\n });\n console.log(aLastResults.length + ' search results');\n _populateSearchTargetVariables(ui$, aMatches);\n return _toControl(aMatches);\n }", "searchList () {\n this.showAlert(undefined, false); //hide alert box if shown\n this.clickClearRoute();\n if (this.searchString().indexOf('\\\\') >= 0) { //symbol \\ cannot be used in regexp\n this.showAlert(SEARCH_ERROR_TEXT + '\\\\');\n } else {\n const regex = new RegExp(this.searchString(), 'i'); //use regexp to ignore register in a search string\n const locations = this.locations();\n for (let i = 0; i < locations.length; i++) {\n let nameMatch = regex.test(locations[i].name);\n locations[i].visible(nameMatch);\n locations[i].marker.setVisible(nameMatch);\n }\n }\n }", "function backendSearch(params) {\n\n $.post('/' + engine + '/points/get', params)\n .done(function (data) {\n\n logger.addItem('Engine: ' + engine);\n logger.addItem('Items found: ' + data.stats.found);\n logger.addItem('Query time (ms): ' + data.stats.time);\n clearOverlays();\n\n data.items.forEach(function (item) {\n addMarker(item.location.coordinates[1], item.location.coordinates[0], $map.data('gmap').map);\n });\n\n logger.render();\n });\n }", "function userSearch(){\n var newInput = input.val();\n geocode(newInput, MAPBOX_TOKEN).then(function (result){\n lng = result[0];\n lat = result[1];\n marker.setLngLat([lng, lat]);\n map.flyTo({\n center: [lng, lat],\n essential: true,\n zoom: 9\n })\n weatherMap();\n })\n }", "function searchForText() {\n // get the keywords to search\n var query = $('form#search input#mapsearch').val();\n\n // extract the fields to search, from the selected 'search category' options\n let category = $('select#search-category').val();\n\n // filter the object for the term in the included fields\n DATA.filtered = searchObject(DATA.tracker_data, query, CONFIG.search_categories[category]);\n\n // suggestions: if the search category is \"company\", include a list of suggestions below \n var suggestions = $('div#suggestions').empty();\n if (category == 'parent') {\n suggestions.show();\n var companies = searchArray(DATA.companies, query).sort();\n companies.forEach(function(company) {\n var entry = $('<div>', {'class': 'suggestion', text: company}).appendTo(suggestions);\n entry.mark(query);\n });\n }\n\n // add the results to map, table, legend\n drawMap(DATA.filtered); // update the map (and legend)\n updateResultsPanel(DATA.filtered, query) // update the results-panel\n drawTable(DATA.filtered, query); // populate the table\n $('form#nav-table-search input').val(query); // sync the table search input with the query\n CONFIG.selected_country.layer.clearLayers(); // clear any selected country\n CONFIG.selected_country.name = ''; // ... and reset the name\n $('div#country-results').show(); // show the results panel, in case hidden\n $('a.clear-search').show(); // show the clear search links\n\n return false;\n}", "onSearchLocation(query) {\n var self = this;\n this.setState({\n locations: this.locations.filter(location => {\n if (location.marker) {\n if (location.name.toLowerCase().indexOf(query.toLowerCase().trim()) >= 0) {\n location.marker.setMap(self.map);\n } else {\n location.marker.setMap(null);\n }\n }\n return location.name.toLowerCase().indexOf(query.toLowerCase().trim()) >= 0;\n })\n })\n }", "function textSearchPlaces() {\n var bounds = map.getBounds();\n hideMarkers(placeMarkers);\n var placesService = new google.maps.places.PlacesService(map);\n placesService.nearbySearch({\n location: map.center,\n radius: 30000,\n type: [\"museum\"]\n }, function(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n createMarkersForPlaces(results);\n locations = results;\n ko.applyBindings(new ViewModel());\n }\n });\n}", "function searchEndPoint(userQuery) {\n\n\tlet found = [];\n\n\t$.ajax({\n\n\t\turl: \"/products\",\n\t\tmethod: \"GET\",\n\t\tformat: \"json\",\n\n\t\tsuccess: function(responseJSON) {\n\n\t\t\tvar name, description, brand, model, condition, category;\n\t\t\tvar namePos, descriptionPos, brandPos, modelPos, conditionPos, categoryPos;\n\n\t\t\t$(\".search\").empty();\n\t\t\t$(\".search\").append(`<h2 class=\"searchTitle\">🔎 Resultados de ${$(\"#ex1\").val()}...</h2>`);\n\t\t\t$(\".search\").append(`<a href=\"./advancedSearch.html\"><button type=\"button\" class=\"btn btn-info advanced-search\">Busqueda Avanzada</button></a>`);\n\t\t\t$(\".search\").append(`<content class=\"searches-content\">`);\n\t\t\t$(\".searches-content\").empty();\n\n\t\t\tfor (let i=0; i<responseJSON.length; i++)\n\t\t\t\tif (!responseJSON[i].bought)\n\t\t\t\t\tfound.push(responseJSON[i]);\n\n\t\t\tfor (let i=0; i<found.length; i++) {\n\n\t\t\t\tname = found[i].name.toLowerCase();\n\t\t\t\tdescription = found[i].description.toLowerCase();\n\t\t\t\tbrand = found[i].brand.toLowerCase();\n\t\t\t\tmodel = found[i].model.toLowerCase();\n\t\t\t\tcondition = found[i].condition.toLowerCase();\n\t\t\t\tcategory = found[i].category.toLowerCase();\n\n\t\t\t\tnamePos = name.search(userQuery);\n\t\t\t\tdescriptionPos = description.search(userQuery);\n\t\t\t\tbrandPos = brand.search(userQuery);\n\t\t\t\tmodelPos = model.search(userQuery);\n\t\t\t\tconditionPos = condition.search(userQuery);\n\t\t\t\tcategoryPos = category.search(userQuery);\n\n\t\t\t\tif (namePos != -1 || descriptionPos != -1 || brandPos != -1 || modelPos != -1 || conditionPos != -1 || categoryPos != -1) {\n\n\t\t\t\t\t$(\".search\").append(`\n\t\t\t\t\t\t<div class=\"searches-container\" id=\"${found[i].id}\">\n\t\t\t\t\t\t\t<div class=\"searches-image\" >\n\t\t\t\t\t\t\t\t<img class=\"searches-image-size\" id=\"${found[i].id}\" src=\"./img/${found[i].image}\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"searches-info\" id=\"${found[i].id}\">\n\t\t\t\t\t\t\t\t<h5 class=\"search-info-title\" id=\"${found[i].id}\">${found[i].name}</h5>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-description search-info-sub\" id=\"${found[i].id}\">${found[i].description}</li>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-condition search-info-sub\" id=\"${found[i].id}\">${found[i].condition}</li>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-location search-info-sub\" id=\"${found[i].id}\">${found[i].location}</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$(\".search\").append(\n\t\t\t\t`\n\t\t\t\t\t</content>\n\t\t\t\t\t<div class=\"space\"></div>\n\t\t\t\t`\n\t\t\t);\n\n\t\t\tmain();\n\t\t},\n\n\t\terror: function(err) {\n\t\t\tconsole.log(\"Juguito de Chale\", errors)\n\t\t}\n\t});\n}", "function search(query, cb) {\n\n return fetch(`https://trackapi.nutritionix.com/v2/natural/nutrients`, {\n method: \"post\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'x-app-id': '6f812326',\n 'x-app-key': '5e4d76d60110068b62760cfba5754e99',\n 'x-remote-user-id': '1'\n },\n body: JSON.stringify({\n 'query': `${query}`,\n 'num_servings': 1,\n 'use_raw_foods': true, \n })\n })\n .then(checkStatus)\n .then(parseJSON)\n .then(checkSearch)\n .then(cb);\n}", "function showSearchResults() {\n\n var markers = [];\n // Listen for the event fired when the user selects a prediction and retrieve\n // more details for that place.\n searchBox.addListener('places_changed', function () {\n var places = searchBox.getPlaces();\n\n if (places.length == 0) {\n return;\n }\n\n // Clear out the old markers.\n markers.forEach(function (marker) {\n marker.setMap(null);\n });\n markers = [];\n\n // For each place, get the icon, name and location.\n var bounds = new google.maps.LatLngBounds();\n places.forEach(function (place) {\n if (!place.geometry) {\n console.log(\"Returned place contains no geometry\");\n return;\n }\n var icon = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n\n // Create a marker for each place.\n markers.push(new google.maps.Marker({\n map: map,\n icon: icon,\n title: place.name,\n position: place.geometry.location\n }));\n\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n });\n map.fitBounds(bounds);\n });\n}", "function getSuggestedLocations(response){\n var suggestions ='';\n if(!(response.results === undefined || response.results === null) ) {\n for(i=0;i<response.results.length;i++){\n suggestions += '\\n' + response.results[i].city +',' + response.results[i].state ;\n }\n }\n return suggestions;\n}", "function searchIncidents() {\n const id = document.getElementById('search').value;\n const data = {\n incidentId: id\n };\n $.ajax({\n url: \"/database/search\",\n type: \"POST\",\n data: data,\n success: function (result) {\n clearIncidents();\n addIncidentMarkers(result);\n populateIncidents(result);\n }\n });\n}", "function search() {\t\t\t\t\n\t\t\tconsole.log(vm.apiDomain);\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n\t\t\tAlleleFearSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.selectedIndex = 0;\n\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tclear();\n\t\t\t\t pageScope.loadingEnd();\n\t\t\t\t}\n\t\t\t\tsetFocus();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: AlleleFearSearchAPI.search\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "submitSearch(){\n //Term that we will use for query\n const searchTerm = this.state.searchTerm;\n\n //Require that name not be an empty string\n if(searchTerm.length === 0)\n {\n //Reset state\n this.setState({\n loading: false,\n lastSearchTerm: '',\n results: []\n });\n }\n //Avoid unneeded duplicate requests by checking if search term has changed at all from the term whose results are currently being displayed\n else if(searchTerm !== this.state.lastSearchTerm){\n this.setState({\n lastSearchTerm: searchTerm,//Store this search term as what was previously searched to avoid unneeded duplicate requests\n loading: true//Begin showing loading spinner until results are received\n });\n\n //Send test search with query in format \"[search term] in [location]\"\n PlacesService.textSearch({\n //Searching by zip sucks - like Schenectady, NY's zip code is 12345 and google doesn't know what to do with that\n //Instead, using the formatted name of the location gets way cleaner results!\n query: `${searchTerm} in ${this.props.locationName}`\n }, this.handleSearchResults);\n }\n }", "search() {\n console.log(\"Search text: \" + this.searchText);\n var localSearchResultsGenes = [];\n var nonGenes = [];\n\n this.checkGenes(localSearchResultsGenes, nonGenes);\n var nonGeneStr = nonGenes.join(\" \");\n console.log(\"Checking non genes: \" + nonGeneStr);\n \n var searchResults = this.searchStudyIndex(nonGenes);\n var studiesIntersected = this.intersection(searchResults);\n var localSearchResultsStudies = this.extractStudyDetails(studiesIntersected);\n this.searchResultsGenes = localSearchResultsGenes;\n this.searchResultsStudies = localSearchResultsStudies;\n\n this.setSearchResultsSummaryMsg();\n this.currentStudySelected = null;\n this.studyGroupSelected = 0;\n }", "async function getSearchData() {\n //First check if the keyword is valid\n var keyword = GET.keyword;\n //Abort if keyword is undefined or not of a proper length\n if (!keyword || keyword.length < 1) return;\n //Now set up the request method\n let response = await fetch('https://manc.hu/api/lexicon/search', {\n method: 'post',\n mode: \"cors\",\n cache: \"no-cache\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n },\n headers: {\n \"Authorization\": \"Bearer \" + (await getAccessToken()),\n \"Content-Type\": \"application/json\",\n },\n body: '{\"query\": \"' + keyword + '\",\"definition\": true,\"from\": 0,\"size\": 100}'\n });\n //Now wait for the response\n let result = await response.json();\n return result;\n}", "function processSearchResponse() {\n\tif (requestXml.readyState == 4) {\n\t\tvar resultXml = requestXml.responseXML;\n\t\t\n\t\tk = 0;\n\t\tnames = [];\n\t\ttrackers = [];\n\t\thashes = [];\n\t\t$('RESULT', resultXml).each(function(i) {\n\t\t\tnames[k] = $(this).find(\"NAME\").text();\n\t\t\ttrackers[k] = $(this).find(\"TRACKER\").text();\n\t\t\thashes[k] = $(this).find(\"HASH\").text();\n\t\t\tk++;\n\t\t});\n\t\t\n\t\tsearch_results = [];\n\t\tfor (var j = 0; j < names.length; j++)\n\t\t\tsearch_results.push(names[j]);\n\t\t\n\t\t$('#results_list').sfList('clear');\n\t\t$('#results_list').sfList('option', 'data', search_results);\n\t\t\n\t\tis_list_shown = true;\n\t}\n}", "search(search, maxNbr) {\n return this.httpGet(\"/room/search/\" + search + this.getQueryMax(maxNbr));\n }", "function search(_event) {\r\n let inputName = document.getElementById(\"searchname\");\r\n let inputMatrikel = document.getElementById(\"searchmatrikel\");\r\n let query = \"command=search\";\r\n query += \"&nameSearch=\" + inputName.value;\r\n query += \"&matrikelSearch=\" + inputMatrikel.value;\r\n console.log(query);\r\n sendRequest(query, handleSearchResponse);\r\n }", "function search (keyword, type, limit, offset) {\n //type = type || settings.searchClass.uri.value;\n limit = limit || settings.resultLimit;\n q = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\n' +\n 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\\n';\n if (settings.endpoint.type == 'fuseki')\n q += 'PREFIX text: <http://jena.apache.org/text#>\\n';\n q +='prefix dcterms: <http://purl.org/dc/terms/>\\n'; \n q +='prefix envri: <http://envri.eu/ns/>\\n';\n q +='prefix foaf: <http://xmlns.com/foaf/0.1/>\\n'; \n q +='prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\n'; \n q +='prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>\\n'; \n q +='prefix skos: <http://www.w3.org/2004/02/skos/core#>\\n'; \n q +='prefix xml: <http://www.w3.org/XML/1998/namespace>\\n';\n q +='prefix xsd: <http://www.w3.org/2001/XMLSchema#>\\n';\n q +='PREFIX rm: <http://www.oil-e.net/ontology/envri-rm.owl#>\\n';\n q +='PREFIX dc: <http://purl.org/dc/elements/1.1/>\\n';\n q +='prefix context: <http://147.213.76.116:8080/marmotta/context/>\\n';\n q +='prefix eosc: <http://eosc.eu/>\\n';\n q +='prefix prov: <http://www.w3.org/ns/prov#>\\n';\n q +='prefix orcid: <https://orcid.org/>\\n';\n q +='prefix np: <http://www.nanopub.org/nschema#>\\n';\n q +='prefix fair: <https://w3id.org/fair/principles/terms/>\\n';\n q +='prefix icc: <https://w3id.org/fair/icc/terms/>\\n';\n q +='prefix pav: <http://purl.org/pav/>\\n';\n q +='prefix dct: <http://purl.org/dc/terms/>\\n';\n q +='prefix sio: <http://semanticscience.org/resource/>\\n';\n q +='prefix npx: <http://purl.org/nanopub/x/>\\n';\n q +='prefix owl: <http://www.w3.org/2002/07/owl#>\\n';\n q +='prefix schema: <http://schema.org/>\\n';\n q +='prefix envriri: <http://envri.eu/RI/>\\n';\n q +='PREFIX dc: <http://purl.org/dc/elements/1.1/>\\n';\n q +='PREFIX owl: <http://www.w3.org/2002/07/owl#>\\n';\n q +='PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\n';\n q +='PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\\n';\n q +='PREFIX foaf: <http://xmlns.com/foaf/0.1/>\\n';\n q +='PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\\n';\n q +='PREFIX base: <http://www.oil-e.net/ontology/oil-base.owl#>\\n';\n q +='PREFIX rm: <http://www.oil-e.net/ontology/envri-rm.owl#>\\n';\n q +='PREFIX envri: <http://www.envri.eu/community#>\\n';\n q +='PREFIX actris: <http://www.envri.eu/community/actris#>\\n';\n q +='PREFIX anaee: <http://www.envri.eu/community/anaee#>\\n';\n q +='PREFIX argo: <http://www.envri.eu/community/euro-argo#>\\n';\n q +='PREFIX eiscat: <http://www.envri.eu/community/eiscat#>\\n';\n q +='PREFIX epos: <http://www.envri.eu/community/epos#>\\n';\n q +='PREFIX eudat: <http://www.envri.eu/community/eudat#>\\n';\n q +='PREFIX icos: <http://www.envri.eu/community/icos#>\\n';\n q +='PREFIX lter: <http://www.envri.eu/community/lter-europe#>\\n';\n q +='PREFIX sdn: <http://www.envri.eu/community/seadatanet#>\\n';\n\n q += 'SELECT DISTINCT ?uri ?label ?type ?tlabel WHERE {\\n';\n q += ' { SELECT ?uri ?label WHERE {\\n';\n q += ' ?uri <' + settings.labelUri + '> ?label . \\n';\n //q += ' FILTER (lang(?label) = \"'+ settings.lang + '\")\\n';\n if (keyword) {\n switch (settings.endpoint.type) {\n case 'virtuoso':\n q += ' ?label bif:contains \"\\'' + keyword + '\\'\" .\\n';\n break;\n case 'fuseki':\n\tq += 'FILTER(regex(?label, \"' + keyword +'\", \"i\")) .\\n';\n q += ' ?uri text:query (<' + settings.labelUri + '> \"' + keyword + '\" '+ limit +') .\\n';\n break;\n default:\n q += ' FILTER regex(?label, \"' + keyword + '\", \"i\")\\n'\n }\n }\n q += ' } LIMIT ' + limit;\n if (offset) q += ' OFFSET ' + offset;\n q += '\\n }\\n OPTIONAL {\\n';\n q += ' ?uri rdf:type ?type .\\n';\n q += ' ?type <' + settings.labelUri + '> ?tlabel .\\n';\n q += ' FILTER (lang(?tlabel) = \"'+ settings.lang + '\")\\n}}';\nconsole.log(q);\n\n//alert('q:' + q);\n\n return q;\n }", "function searchToLatLng(req, res) {\r\n //GEOCODE_API_KEY\r\n let locationName = req.query.data;\r\n const url = `https://maps.googleapis.com/maps/api/geocode/json?address=${locationName}&key=${GEOCODE_API_KEY}`;\r\n\r\n superagent\r\n .get(url)\r\n .then(result => {\r\n let location = {\r\n search_query: locationName,\r\n formatted_query: result.body.results[0].formatted_address,\r\n latitude: result.body.results[0].geometry.location.lat,\r\n longitude: result.body.results[0].geometry.location.lng\r\n };\r\n res.send(location);\r\n })\r\n .catch(e => {\r\n console.error(e);\r\n res.status(500).send('oops');\r\n });\r\n}", "function searchLoc(){\n selectedPlace = document.getElementById('place');\n deleteAllMarkers();\n searchNearLocs(map, curPos);\n }", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "static buildGetPlacesQuery(lat, lng) {\n return \"https://maps.googleapis.com/maps/api/place/textsearch/json\"\n + \"?query=\" + relevantPlaceTypes\n + \"&language=en\"\n + \"&fields=formatted_address,geometry,icon,id,name,permanently_closed,photos,place_id,plus_code,types,user_ratings_total,price_level,rating,opening_hours\"\n + \"&location=\" + lat.toString() + \",\" + lng.toString()\n + \"&key=\" + MapsApiKey.MAPS_API_KEY\n + \"&radius=12000\";\n }", "function japanSearch(req, res) {\n let url = `https://api.spoonacular.com/recipes/complexSearch?number=12&cuisine=Japanese&apiKey=${apiKey}`;\n\n superagent.get(url)\n .then(searchResults => searchResults.body.results.map(result => new Result(result)))\n .then(results => {\n let cookie = req.cookies.userID ? req.cookies.userID : '';\n res.render('searchPages/japan_food', {searchResults: results, 'cookie': cookie});\n })\n .catch(error => handleError(error, res));\n}", "function autocomplete(query) {\n const restrictions = query.country_code ? `&countrycodes=${query.country_code}` : '';\n\n const templateStr = `https://nominatim.openstreetmap.org/search?q=${query.location}${restrictions}&format=json&addressdetails=1`;\n\n //console.log('autocompleteStr --> ', templateStr);\n\n return axios.get(templateStr)\n .then(res => res.data)\n .catch(err => { throw err; })\n}", "function callback() {\n let latLong = self.state.latLong;\n let search = `${latLong['lat']},${latLong['lng']},${self.state.searchRadius}`\n self.setState({searchParams: search});\n self.props.search(self.state.searchParams, self.state.latLong);\n }", "function search_results(data, context){\n var obj = JSON.parse(data);\n // cache the jQuery object\n var $search_results = $('#search_results');\n // empty the element\n $search_results.empty();\n // add the results\n $search_results.append('<h2>Results</h2><p>Objects with the following ids match your query:</p><ul>');\n if (obj.ids.length>0) {\n $.each(obj.ids, function(o, object_id) {\n context.partial('templates/result.template', { obj: object_id}, function(rendered) { $search_results.append(rendered)});\n });\n } else {\n $search_results.append('<li>None found. Please try again...</li>');\n }\n $search_results.append('</ul>');\n }", "function turnQueryToLatLng() {\n \n var queryURL1 = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + city + \"+\" + state +\"&key=AIzaSyDVWyEiCdvzn-H3nOsn9NuJ7LfEa-zLCw8\";\n\n $.ajax({\n url: queryURL1,\n method: \"GET\"\n }).done(function(response1) {\n //create variables for latitude & longitude\n var brewSearchLat = String(response1.results[0].geometry.location.lat);\n var brewSearchLng = String(response1.results[0].geometry.location.lng);\n //set the global search variables for lat/lng\n globalLatSearch = response1.results[0].geometry.location.lat;\n globalLngSearch = response1.results[0].geometry.location.lng;\n //call the search for breweries function\n searchForBreweries(brewSearchLat, brewSearchLng);\n\n });\n }", "geocode(query) {\n return new Promise((resolve, reject) => {\n this.geocoder.geocode({ searchText: query }, result => {\n if(result.Response.View.length > 0) {\n if(result.Response.View[0].Result.length > 0) {\n resolve(result.Response.View[0].Result[0].Location.DisplayPosition);\n } else {\n reject({ message: \"no results found\" });\n }\n } else {\n reject({ message: \"no results found\" });\n }\n }, error => {\n reject(error);\n });\n });\n }", "function requestSearch(searchTerm, coordinates) {\n $('#search-results').empty();\n $(\"#error-message\").empty(); \n var requestSettings ={\n success: searchSuccess,\n error:searchError,\n data: {\n term:searchTerm,\n latitude:coordinates.latitude,\n longitude: coordinates.longitude\n },\n headers:{\n Authorization: \"Bearer \" + ACCESS_TOKEN\n },\n }\n $.ajax (SEARCH_ENDPOINT,requestSettings); \n}", "searchSuggest(query) {\r\n let finalQuery;\r\n if (typeof query === \"string\") {\r\n finalQuery = { querytext: query };\r\n }\r\n else {\r\n finalQuery = query;\r\n }\r\n return this.create(SearchSuggest).execute(finalQuery);\r\n }", "function sendSearchQuery(){\n lastAction = \"search\";\n if(!stopped){\n data = {};\n data['instance'] = collection;\n data['string_query'] = 'true';\n data['vector_query'] = 'false';\n query = $(\"div.task\"+currentTask).find('input[name=\"query\"]').val();\n data['query'] = query;\n data['vector_query'] = JSON.stringify(getCurrentVectorQuery());\n $(\".relevance-feedback-search-results\").show();\n $(\".relevance-feedback-search-results\").html(\"Loading...\");\n $.post(\"src/php/similarsentences/similarsentences.php\",\n data,\n handleResults);\n } else {\n startTimedTask(currentTask);\n sendSearchQuery();\n }\n logActivity({\n instance:collection,\n participant: getParticipant(),\n task_number: currentTask,\n activity: \"search\",\n search_query: query,\n num_relevant : -1,\n num_irrelevant: -1,\n })\n}", "search(event){\n this.placeService.textSearch({\n query: `${event.target.value}`,\n type: 'airport'\n }, this.handleSuggestions);\n }", "function getSearchResults(request) {\n return \"Search Results.\";\n}", "function textSearchPlaces() {\n let bounds = map.getBounds();\n hideMarkers(markersArray);\n let placesService = new google.maps.places.PlacesService(map);\n placesService.textSearch({\n query: document.getElementById('places-search').value,\n bounds: bounds\n }, function(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n createMarkersForPlaces(results);\n }\n });\n}", "function nearbySearch(text, callback) {\n service.nearbySearch({location: room_26_100, radius: 1000, keyword: text},\n function(results, status) {\n if (status != \"OK\" && status != \"ZERO_RESULTS\") {\n var msg = \"Request to Google Places service (nearbySearch) failed (status: \" + status + \")\";\n alert(msg);\n throw {name: \"places\", message: msg};\n }\n\n callback(results);\n });\n}", "function postSearchResults(request, response) {\n // get api url\n let url = 'https://www.googleapis.com/books/v1/volumes?q='\n\n\n let query = request.body.search[0];\n let titleOrAuthor = request.body.search[1];\n\n if (titleOrAuthor === 'title') {\n url += `+intitle:${query}`;\n } else if (titleOrAuthor === 'author') {\n url += `+inauthor:${query}`;\n }\n\n // grab data from api\n superagent.get(url)\n .then(results => {\n // loop through results and construct new book object each iteration\n let books = results.body.items.map(val => {\n return new Book(val);\n });\n // console.log(results.body.items[0]);\n response.render('pages/searches/show.ejs', {\n searchResults: books\n });\n }).catch(err => error(err, response));\n}", "function searchGus(location) {\r\n hideListings();\r\n var service = new google.maps.places.PlacesService(map);\r\n service.nearbySearch({\r\n location: location,\r\n radius: radius,\r\n type: ['gas_station']\r\n }, callback);\r\n}", "function searchLocationServerSide(locationString) {\n var ajaxRequest = $.ajax({\n url: '/location',\n type: 'GET',\n data: {location: locationString}\n })\n\n ajaxRequest.done(locationData)\n}", "function showResults () {\n const value = this.value\n const results = index.search(value, 8)\n // console.log('results: \\n')\n // console.log(results)\n let suggestion\n let childs = suggestions.childNodes\n let i = 0\n const len = results.length\n\n for (; i < len; i++) {\n suggestion = childs[i]\n\n if (!suggestion) {\n suggestion = document.createElement('div')\n suggestions.appendChild(suggestion)\n }\n suggestion.innerHTML = `<b>${results[i].tablecode}</>: ${results[i].label}`\n // `<a href = '${results[i].tablecode}'> ${results[i]['section-name']} ${results[i].title}</a>`\n\n // console.log(results[i])\n }\n\n while (childs.length > len) {\n suggestions.removeChild(childs[i])\n }\n //\n // // const firstResult = results[0].content\n // // const match = firstResult && firstResult.toLowerCase().indexOf(value.toLowerCase())\n // //\n // // if (firstResult && (match !== -1)) {\n // // autocomplete.value = value + firstResult.substring(match + value.length)\n // // autocomplete.current = firstResult\n // // } else {\n // // autocomplete.value = autocomplete.current = value\n // // }\n }", "function querySearch(query) {\n var results = query ? $scope.regions.filter(function (item) {\n var smallDesc = angular.lowercase(item.Description);\n return (smallDesc.indexOf(angular.lowercase(query)) !== -1);\n }) : $scope.regions,\n deferred;\n if ($scope.simulateQuery) {\n deferred = $q.defer();\n $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);\n return deferred.promise;\n } else {\n return results;\n }\n }" ]
[ "0.6563675", "0.6422522", "0.6415669", "0.63826334", "0.63748336", "0.63509065", "0.6348148", "0.62460667", "0.6243116", "0.61705744", "0.6132467", "0.612258", "0.6115154", "0.6114472", "0.6082796", "0.6062363", "0.6054352", "0.60445225", "0.60358274", "0.60297674", "0.6019465", "0.59940827", "0.59885067", "0.5978981", "0.5959379", "0.5957992", "0.59565187", "0.59514534", "0.5949915", "0.5944434", "0.59394246", "0.59313786", "0.59260976", "0.59241277", "0.5922605", "0.5913783", "0.59121364", "0.59086514", "0.5900871", "0.58971995", "0.58841187", "0.58771056", "0.58679265", "0.5867355", "0.58639026", "0.58631647", "0.5861114", "0.58550537", "0.5854013", "0.58474153", "0.5839543", "0.58387965", "0.58381575", "0.58375967", "0.5834092", "0.58310926", "0.5830629", "0.58284557", "0.5827422", "0.58232015", "0.58225214", "0.58154577", "0.5813104", "0.5810521", "0.58076966", "0.58031785", "0.57995737", "0.5788791", "0.5785849", "0.576672", "0.57630247", "0.5762546", "0.5762402", "0.5752953", "0.57517767", "0.57492524", "0.5738711", "0.57251966", "0.57209766", "0.5713905", "0.5707665", "0.5707005", "0.57069784", "0.5706321", "0.57041526", "0.5703854", "0.57027334", "0.5700781", "0.56977373", "0.5696209", "0.568994", "0.56897885", "0.56855285", "0.56819314", "0.5679899", "0.5675398", "0.56733376", "0.56690496", "0.5668823", "0.5667494" ]
0.6334055
7
Console log any uncaught errors and return a 500 error
function errorHandler(error, req, res, next) { console.log("\n" + JSON.stringify(error, null, 2) + "\n"); res.status(500).end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "exceptionHandler() {\n this.server.use(async (err, req, res, _next) => {\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n const errors = await new Youch(err, req).toJSON();\n return res.status(500).json(errors);\n }\n\n return res.status(500).json({ error: 'Internal server error' });\n });\n }", "function errorHandler(error, request, response) {\n response.status(500).send(error);\n}", "function errorHandler(error, request, response) {\n response.status(500).send(error);\n}", "function erroHandler(err, request, response, next) {\n response.status(500).send(\"Server Error! Please Try again later!!\");\n}", "function handleError(err){\n\tconsole.log(`Request failed: ${err}`);\n}", "handleAppErrors() {\r\n this.app.on('error', (err, ctx) => {\r\n logger.error(`Application Error: ${ err.name } @ ${ ctx.method }:${ ctx.url }`);\r\n logger.error(err.stack);\r\n });\r\n }", "function handleError(err, res) {\r\n console.error(err);\r\n if (res) res.status(500).send('sorry, something broke');\r\n}", "function ErrorHandler() {}", "function handleError(err){\n console.log(`Request failed: ${err}`)\n}", "function errorHandler (error) {\n console.error(error)\n throw new Error('Failed at server side')\n}", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "catchExceptions(){\n process.on('uncaughtException', function (err) {\n Logger.fatal(err);\n //var stack = new Error().stack;\n //Logger.exception(stack);\n });\n }", "function handleError(err, req, res, next) {\n console.error(err.stack)\n res.status(500).json({err: err.message})\n }", "function errHandler(err) {\n console.error('There was an error performing the operation');\n console.log(err);\n console.log(err.code);\n console.error(err.message);\n}", "function handleError(err, res) {\r\n console.error(err);\r\n if (res) res.status(500).send('Sorry, something went wrong');\r\n}", "function errHandler(err) {\n console.error('There was an error performing the operation');\n console.log(err);\n console.log(err.code);\n console.error(err.message);\n}", "function errorHandler(error, request, response, next) {\n console.error(error.message);\n console.error(error.stack);\n response.status(500).render('error_template', { error: error });\n}", "function onUncaughtException(err) {\n console.log('Uncaught exception:', err);\n }", "function genericError(){\n output('Fatal error. Open the browser\\'s developer console for more details.');\n}", "function handleError(err, res) {\r\n console.error(err);\r\n if (res) res.status(500).send('⚠︎ So terriably sorry, something has gone very wrong and you should turn back. Now. ⚠');\r\n}", "handle (error, { response }) {\n return response.status(500).json({\n status : 'InternalServerError',\n data: null,\n error: 'Internal Server Error'\n })\n }", "function handleError(res, err) {\n console.error(err);\n return res.status(500).send(\"server error\");\n}", "function handleError(res, err) {\n console.error(err);\n return res.status(500).send(\"server error\");\n}", "function errorHandler(err, req, res, next) {\n res.status(500).send('Error!\\n\\n' + err.stack)\n}", "function errorHandler(error) { console.log('Error: ' + error.message); }", "function onUncaughtException(err) {\n var err = \"uncaught exception: \" + err;\n console.log(err);\n}", "function handle_error(error) {\n console.log(\"Error from server\", error);\n}", "function errorHandler(err, req, res) {\n res.status(err.status || 500).send(`\n <h1>${ err.message }</h1>\n <h2>${ err.status }</h2>\n <pre>${ err.stack }</pre>\n `);\n}", "errorHandler(error) {\n console.log(error);\n }", "function errorHandler(err, req, res, next) {\n console.error(`Error: ${err.stack}`);\n res.status(err.response ? err.response.status : 500);\n res.json({ error: err.message });\n}", "function logErrors (err, req, res, next) {\n //console.error(err.stack)\n console.log(\"caught an erroor\");\n console.log(err.stack)\n next(err)\n}", "function handleUncaughtException() {\n process.on('uncaughtException', (error) => {\n debug('Uncaught exception');\n console.error('\\n\\n=== uncaught exception ================='); // eslint-disable-line no-console\n console.error(error.message); // eslint-disable-line no-console\n console.error(error.stack); // eslint-disable-line no-console\n console.error('========================================\\n\\n');\n\n const message = error.message || '';\n const stack = (error.stack || '').split('\\n');\n logger.error('Uncaught exception. Exiting.', { error: { message, stack }, tags: 'exit' });\n\n exitProcess(100);\n });\n}", "function productionErrorHandler(err, req, res, next) {\n res.status(err.status || 500);\n res.json({\n message: err.message,\n error: {}\n });\n}", "function errorHandler(err, req, res) {\n res.status(500).send(err);\n }", "function handleError(err) {\n console.log('>>> ERROR:: something went wrong ... ', err);\n}", "function errorHandler(err, req, res, next) {\n const statusCode = res.statusCode !== 200 ? res.statusCode : 500;\n console.log('You have reached the error handler', err.message);\n res.status(statusCode);\n res.json({\n message: err.message,\n stack: process.env.NODE_ENV === 'production' ? 'stack' : err.stack\n });\n}", "function errorHandler(data) {\n console.log(\"error: \" + JSON.stringify(data));\n }", "function errorHandler(err, req, res, next) {\r\n console.error(err.message)\r\n console.error(err.stack)\r\n res.status(500).render('error_template', { error: err })\r\n}", "function handleError(err) {\n console.log(err);\n}", "function Error(error, response) {\n console.error(error);\n return response.status(500).send('Oops! Something went wrong! Please try again in 401');\n}", "function errorHandler(err, req, res, next) {\n console.error(err.message);\n console.error(err.stack);\n res.status(500).render('error_template', { error: err });\n}", "static serverError(message, res) {\n res.writeHead(500, {'Content-Type': 'text/html'});\n res.write(message);\n res.end();\n }", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "function onError(e) { console.log(e); }", "function errorHandler(err, req, res, next) {\n console.error(err.message);\n console.error(err.stack);\n res.status(500).render('error_template', { error: err });\n }", "function handleError(error){\n\t\tconsole.error(\"[ERROR] \", error);\n\t}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason)\n res.status(code || 500).json({\"error\": message})\n }", "function logErrors(error, req, res, next) {\n var status = error.statusCode || 500;\n console.error(status + ' ' + (error.message ? error.message : error));\n if (error.stack) {\n console.error(error.stack);\n }\n next(error);\n }", "errorPageHandler(err, req, res, next) {\n res.status(500);\n res.render('error', {error: err.stack});\n }", "logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n }", "function logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n}", "function handleError(error) {\n console.log(error);\n}", "function UncaughtExceptionHandler(err){\n console.log(\"Uncaught Exception Encountered!!\");\n console.log(\"err: \", err);\n console.log(\"Stack trace: \", err.stack);\n setInterval(function(){}, 1000);\n}", "function logRequestError(err) {\n\n\tvar {response} = err;\n\tif (!response) {\n\t\tlogger.warning(`TritonAgent raised exception for URL ${this._urlPath}`, err);\n\t} else if (response.notFound) {\n\t\t// 404? don't care about response\n\t\tlogger.warning(`Resource not found on server: ${this._urlPath}`);\n\t} else if (response.serverError) {\n\t\tlogger.warning(`Received server error for URL ${this._urlPath}`, err);\n\t} else {\n\t\tlogger.warning(`Unexpected status code returned for URL ${this._urlPath}`, err);\n\t}\n}", "function logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n}", "function logErrors(err, req, res, next) {\n\tconsole.error(err.stack);\n\tnext(err);\n}", "function developmentErrorHandler(err, req, res, next) {\n res.status(err.status || 500);\n res.json({\n message: err.message,\n error: err\n });\n}", "function errorHandler(error) {\n console.log(error);\n}", "function errorHandler(error) {\n console.log(error);\n}", "configureErrorBoundary(err, _, res, next) {\n const statusCode = err.statusCode || 500;\n const message = err.message || \"Internal Server Error\";\n\n res.status(statusCode).json({ message, statusCode });\n console.log(err.stack);\n next();\n }", "function on_error(e) {\n\tconsole.error(e, e.stack); // eslint-disable-line no-console\n\tvar div = document.createElement('div');\n\tdiv.appendChild(document.createTextNode(e.message));\n\tdocument.querySelector('.error').appendChild(div);\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n }", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n }", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n }", "function errorHandler(err, req, res, next) {\n if (res.headersSent) {\n return next(err);\n }\n console.error(\"errorHandler\", err);\n res.status(500).send({ errors: `Error running your code. ${err}` });\n}", "function errorHandler (err, req, res, next) {\n\tif(req.ws){\n\t\tconsole.error(\"ERROR from WS route - \", err);\n\t} else {\n\t\tconsole.error(err);\n\t\tres.setHeader('Content-Type', 'text/plain');\n\t\tres.status(500).send(err.stack);\n\t}\n}", "function on_error(e) {\n\tconsole.error(e, e.stack); // eslint-disable-line no-console\n\tvar div = document.createElement('div');\n\tdiv.appendChild(document.createTextNode(e.message));\n\tdocument.querySelector('.error').appendChild(div);\n}", "function error(err) {\n console.error(err.stack)\n}", "function handleException(request, message, error) {\n var msg = \"\";\n msg += \"Code: \" + request.status + \"\\n\";\n msg += \"Text: \" + request.statusText + \"\\n\";\n if (request.responseJSON && request.responseJSON.error) {\n msg += \"Message: \" + request.responseJSON.error.message + \"\\n\";\n }\n alert(msg);\n}", "function errorHandler(err, req,res, next)\r\n{\r\nconsole.error(err.message);\r\nconsole.error(err.stack);\r\nres.status(500);\r\nres.render('error',{message:err});\r\n}", "onerror() {}", "onerror() {}", "function unknownError(err, next) {\n console.error(err);\n return next({status: 500});\n}", "function stdErrorHandler(request, context, exception, clearRequestQueue = false) {\n //newer browsers do not allow to hold additional values on native objects like exceptions\n //we hence capsule it into the request, which is gced automatically\n //on ie as well, since the stdErrorHandler usually is called between requests\n //this is a valid approach\n try {\n if (threshold == \"ERROR\") {\n let errorData = ErrorData_1.ErrorData.fromClient(exception);\n sendError(errorData);\n }\n }\n finally {\n if (clearRequestQueue) {\n Implementation.requestQueue.clear();\n }\n }\n }", "onError(e) {\n console.log('error =>', e.message);\n }", "function onError(e) {\n console.error(e);\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function errorHandler(err, req, res, next) {\n console.log(err.message);\n console.log(err.stack);\n res.status(500).render('error_template', { error: err });\n}", "function error(err) {\n res.statusCode = err.status || 500;\n res.end(err.message);\n }", "function myError(response) {\n\t\tconsole.log(\"Error: \" + response);\n\t}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}" ]
[ "0.66826737", "0.6674529", "0.6674529", "0.66566586", "0.66491514", "0.6634539", "0.6609027", "0.66086215", "0.6593812", "0.65918833", "0.65782785", "0.6575421", "0.65572834", "0.6555865", "0.6552396", "0.65217906", "0.64840674", "0.6483882", "0.6478902", "0.6451221", "0.6450542", "0.6441098", "0.6441098", "0.6436406", "0.64284176", "0.6398154", "0.6382111", "0.6372163", "0.63721246", "0.63689595", "0.6353629", "0.6348536", "0.6318788", "0.62905043", "0.62866414", "0.627665", "0.62732136", "0.6248598", "0.62361485", "0.6233433", "0.6232726", "0.62253034", "0.6225162", "0.6211828", "0.62085783", "0.6192452", "0.6183228", "0.61809266", "0.6179491", "0.61771107", "0.61757505", "0.61753964", "0.6156517", "0.6152618", "0.6145386", "0.61419606", "0.6139724", "0.61346173", "0.61346173", "0.6113964", "0.6111111", "0.61075985", "0.61075985", "0.61075985", "0.61040735", "0.6102996", "0.61018866", "0.6101021", "0.61002886", "0.60880893", "0.60813904", "0.60813904", "0.60765266", "0.60758626", "0.6065343", "0.60612565", "0.6060229", "0.6060229", "0.6060229", "0.6060229", "0.6058324", "0.6057368", "0.60563487", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459", "0.6038459" ]
0.66880614
0
Convert a day shorthand to the full name
function getDayName(day) { switch (day) { case "mon": return "Monday"; case "tue": return "Tuesday"; case "wed": return "Wednesday"; case "thu": return "Thursday"; case "fri": return "Friday"; case "sat": return "Saturday"; case "sun": return "Sunday"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_day_name(day) {\n switch (day) {\n case 0:\n return \"ѕн\";\n case 1:\n return \"¬т\";\n case 2:\n return \"—р\";\n case 3:\n return \"„т\";\n case 4:\n return \"ѕт\";\n case 5:\n return \"—б\";\n case 6:\n return \"¬с\";\n\n default:\n abort(\"Incorrect day of the week!\");\n return \"???\";\n }\n}", "function spellDay(day) {\n switch (day) {\n case \"-\":\n day = \"-\";\n break;\n case \"M\":\n day = \"Monday\";\n break;\n case \"T\":\n day = \"Tuesday\";\n break;\n case \"W\":\n day = \"Wednesday\";\n break;\n case \"R\":\n day = \"Thursday\";\n break;\n case \"MW\":\n day = \"Monday and Wednesday\";\n break;\n case \"TR\":\n day = \"Tuesday and Thursday\";\n break;\n\n }\n \n return day;\n}", "function dayFormat(day) {\n switch (day) {\n case 1:\n case 21:\n return day + 'st';\n case 2:\n case 22:\n return day + 'nd';\n case 3:\n case 23:\n return day + 'rd';\n default:\n return day + 'th';\n }\n }", "function weekdayName(p_Date, p_abbreviate){\nif(!isDate(p_Date)){return \"invalid date: '\" + p_Date + \"'\";}\nvar dt = new Date(p_Date);\nvar retVal = dt.toString().split(' ')[0];\nvar retVal = Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')[dt.getDay()];\nif(p_abbreviate==true){retVal = retVal.substring(0, 3)}// abbr to 1st 3 chars\nreturn retVal;\n}", "function getDayName(day,type) {\n var ldays = [_(\"Sunday\"),_(\"Monday\"),_(\"Tuesday\"),_(\"Wednesday\"),_(\"Thursday\"),_(\"Friday\"),_(\"Saturday\")],\n sdays = [_(\"Sun\"),_(\"Mon\"),_(\"Tue\"),_(\"Wed\"),_(\"Thu\"),_(\"Fri\"),_(\"Sat\")];\n\n if (type === \"short\") {\n return sdays[day.getDay()];\n } else {\n return ldays[day.getDay()];\n }\n}", "function day2str(day) {\n switch (day) {\n case 0: day = \"Sunday\"; break;\n case 1: day = \"Monday\"; break;\n case 2: day = \"Tuesday\"; break;\n case 3: day = \"Wednesday\"; break;\n case 4: day = \"Thursday\"; break;\n case 5: day = \"Friday\"; break;\n case 6: day = \"Saturday\"; break;\n }\n return day;\n}", "function getDaySuffix(day) {\n var _num = day.toString().split(\"\").pop();\n var _suffix = \"th\";\n\n if (_num === \"1\")\n _suffix = \"st\";\n else if (_num === \"2\")\n _suffix = \"nd\";\n else if (_num === \"3\")\n _suffix = \"rd\";\n \n return _suffix;\n}", "function dayToString(day) {\n\t\tvar days = [\"Sun.\", \"Mon.\", \"Tue.\", \"Wed.\", \"Thu.\", \"Fri.\", \"Sat.\"];\n\t\treturn days[day];\n\t}", "static weekName (day) {\n let names = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];\n return names[day];\n }", "function dayToString(day){\n switch(day){\n case 1:\n case 21:\n case 31:\n return day+\"st\";\n case 2:\n case 22:\n return day+\"nd\";\n case 3:\n case 23:\n return day+\"rd\";\n default:\n return day+\"th\";\n }\n}", "function dayToString(day){\n switch(day){\n case 1:\n case 21:\n case 31:\n return day+\"st\";\n break;\n case 2:\n return day+\"nd\";\n break;\n case 3:\n return day+\"rd\";\n break;\n default:\n return day+\"th\";\n }\n}", "function getDayName(dayOfWeek) {\n const days = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];\n return days[dayOfWeek];\n}", "function whatDay(day) {\n var result = \"\";\n day = day.toLowerCase()\n if (day === 'sunday' || day === 'monday') {\n result = 'Have a good week';\n } else if (day === 'tuesday' || day === 'wednesday') {\n result = 'Ohhh ... ';\n } else if (day === 'thursday') {\n result = 'Yalla habaita';\n } else if (day === 'friday' || day === 'saturday') {\n result = 'Yammi Jachnun'\n } else {\n result = 'not a day';\n }\n return result;\n}", "function date2str(day) {\n var date;\n switch (day) {\n case 1: date = '1st'; break;\n case 2: date = '2nd'; break;\n case 3: date = '3rd'; break;\n case 21: date = '21st'; break;\n case 22: date = '22nd'; break;\n case 23: date = '23rd'; break;\n case 31: date = '31st'; break;\n default: date = String(day) + 'th'; break;\n }\n return date;\n}", "static getWeekdayShort(date) {\n const weekdayName = date.toLocaleString(this.locales, { weekday: 'short' });\n return this.firstUpperCase(weekdayName);\n }", "function getDayOfWeek(day) {\n switch(day) {\n case 0: return 'Sun';\n case 1: return 'Mon';\n case 2: return 'Tue';\n case 3: return 'Wed';\n case 4: return 'Thu';\n case 5: return 'Fri';\n case 6: return 'Sat';\n default: return;\n }\n}", "function dayString(num){\r\n if (num == \"1\") { return \"Montag\" }\r\n else if (num == \"2\") { return \"Dienstag\" }\r\n else if (num == \"3\") { return \"Mittwoch\" }\r\n else if (num == \"4\") { return \"Donnerstag\" }\r\n else if (num == \"5\") { return \"Freitag\" }\r\n else if (num == \"6\") { return \"Samstag\" }\r\n else if (num == \"0\") { return \"Sonntag\" }\r\n}", "function dayConvert(day) {\n\t\tday = parseInt(day);\n\t\t\n\t\t// just handle the cases for numbers 1-31\n\t\tif (day===1 || day===21 || day===31) {\n\t\t\treturn day + 'st';\n\t\t}\n\t\telse if (day===2 || day===22) {\n\t\t\treturn day + 'nd';\n\t\t}\n\t\telse if (day===3 || day===23) {\n\t\t\treturn day + 'rd';\n\t\t}\n\t\telse {\n\t\t\treturn day + 'th';\n\t\t}\n\t}", "function getDayName(dateStr, locale) {\n var date = new Date(dateStr);\n return date.toLocaleDateString(locale, { weekday: 'long' });\n}", "function dayConvert(day) {\n //creating the switch statement because it is the easiest way I know of\n //to handle this many cases easily.\n switch (day) {\n case 1:\n return \"Monday\";\n break;\n case 2:\n return \"Tuesday\";\n break;\n case 3:\n return \"Wednesday\";\n break;\n case 4:\n return \"Thursday\";\n break;\n case 5:\n return \"Friday\";\n break;\n case 6:\n return \"Saturday\";\n break;\n case 7:\n return \"Sunday\";\n break;\n case \"Monday\":\n return 1;\n break;\n case \"Tuesday\":\n return 2;\n break;\n case \"Wednesday\":\n return 3;\n break;\n case \"Thursday\":\n return 4;\n break;\n case \"Friday\":\n return 5;\n break;\n case \"Saturday\":\n return 6;\n break;\n case \"Sunday\":\n return 7;\n break;\n default:\n print(\"This is the base case.\");\n }\n}", "findDayOfWeek(day) {\n switch (new Date(day.dt_txt).getDay()) {\n case 0:\n return \"Sunday\"\n case 1:\n return \"Monday\"\n case 2:\n return \"Tuesday\"\n case 3:\n return \"Wednesday\"\n case 4:\n return \"Thursday\"\n case 5:\n return \"Friday\"\n default:\n return \"Saturday\"\n }\n }", "function getDay() {\n return ''+ this._day.getDay();\n }", "function formatWeekdayName(weekday, options) {\n return date_fns_1.format(weekday, 'cccccc', options);\n}", "function determineDay(day) {\n switch (day) {\n case \"Mon\":\n return \"2015-08-24 \";\n case \"Tue\":\n return \"2015-08-25 \";\n case \"Wed\":\n return \"2015-08-26 \";\n case \"Thu\":\n return \"2015-08-27 \";\n case \"Fri\":\n return \"2015-08-28 \";\n }\n }", "function _dayKey (day) {\n return moment(day).format(_dateFmt);\n }", "function formatDay(rawDay) {\n var formattedDay;\n if (rawDay.charAt(0) == \"0\") {\n var formattedDay = rawDay.substring(1);\n console.log(\"formattedDay: \" + formattedDay);\n return formattedDay;\n } else {\n return rawDay;\n }\n}", "function reformatDayString(day){\n day = day.toDateString();\n let month = day.slice(4,7);\n let date = day.slice(8,10);\n let year = day.slice(11);\n //****HOMEWORK*****/// - complete this function\n let reformatDay = year+convertMonth(month)+date;\n return reformatDay;\n }", "function formatDate(day) {\n\treturn `${day.getFullYear()}-${day.getMonth()+1}-${day.getDate()}`\n}", "function renderDayNames() {\n var names = this.options.moment.weekdaysMin()\n // Moment gives Sunday as the first item, but uses Monday as the first day of the week.\n // This is due to getMonthDetails returning the value of ISO weekday, which has Monday\n // as index 1 and Sunday at index 7. For this reason, Sunday is shifted from the from\n // of the array and pushed to the back.\n names.push(names.shift())\n names.forEach(function (d) {\n var dayName = document.createElement('span')\n dayName.textContent = d\n dayName.classList.add('anytime-picker__day-name')\n daysEl.appendChild(dayName)\n })\n }", "function dateConverter(day)\n{\n\tvar date = new Date(user.currentTime.year, user.currentTime.month, day);\n\n\tswitch(date.getDay())\n\t{\n\t\tcase 0:\n\t\t\treturn \"Sunday\";\n\t\tcase 1:\n\t\t\treturn \"Monday\";\n\t\tcase 2:\n\t\t\treturn \"Tuesday\";\n\t\tcase 3:\n\t\t\treturn \"Wednesday\";\n\t\tcase 4:\n\t\t\treturn \"Thursday\";\n\t\tcase 5:\n\t\t\treturn \"Friday\";\n\t\tcase 6:\n\t\t\treturn \"Saturday\";\n\t}\n}", "function getFullDateInVietnamese(){\r\n\tvar now = new Date();\r\n\tvar month = \"\";\r\n\tvar day = \"\";\r\n\tvar first_date_num=\"\";\r\n\r\n if (now.getDate() < 10)\r\n \tfirst_date_num=\"0\";\r\n\telse\r\n\t\tfirst_date_num=\"\";\r\n\t\t\t\r\n\tswitch (now.getDay()){\r\n\t\tcase 0: day=\"Ch&#7911; nh&#7853;t\";break;\r\n\t\tcase 1: day=\"Th&#7913; hai\";break;\r\n\t\tcase 2: day=\"Th&#7913; ba\";break;\r\n\t\tcase 3: day=\"Th&#7913; t&#432;\";break;\r\n\t\tcase 4: day=\"Th&#7913; n&#259;m\";break;\r\n\t\tcase 5: day=\"Th&#7913; s&#225;u\";break;\r\n\t\tcase 6: day=\"Th&#7913; b&#7843;y\";break;\r\n\t}\r\n\t\r\n\treturn day + \" ng&#224;y \" + first_date_num + now.getDate() + \" th&#225;ng \" + (now.getMonth()+1) + \" n&#259;m \" + now.getFullYear();\r\n}", "function getDayOfWeek() {\n var string = this._day.getDayOfWeek();\n switch(this._day.getDayOfWeek()) {\n case 1:\n string = 'Lundi';\n break;\n case 2:\n string = 'Mardi';\n break;\n case 3:\n string = 'Mercredi';\n break;\n case 4:\n string = 'Jeudi';\n break;\n case 5:\n string = 'Vendredi';\n break;\n case 6:\n string = 'Samedi';\n break;\n case 7:\n string = 'Dimanche';\n break;\n }\n\n return string;\n }", "function formatDayString(marker) {\n return marker.toISOString().replace(/T.*$/, '');\n }", "function day() {\n return \"friday\";\n}", "function _getDayString(id){\n var day;\n switch(id) {\n case 1:\n day = \"Monday\";\n break;\n case 2:\n day = \"Tuesday\";\n break;\n case 3:\n day = \"Wednesday\";\n break;\n case 4:\n day = \"Thursday\";\n break;\n case 5:\n day = \"Friday\";\n break;\n case 6:\n day = \"Saturday\";\n break;\n case 7:\n day = \"Sunday\";\n break;\n default:\n day = \"unknown day\";\n }\n return day;\n }", "function dateSuffix(day) {\n //set suffix according to date of the month\n if (day % 10 == 1 && day != 11) return 'st';\n else if (day % 10 == 2 && day != 12) return 'nd';\n else if (day % 10 == 3 && day != 13) return 'rd';\n else return 'th';\n}", "function getDayName(number) {\n var weekday = new Array(7);\n weekday[0] = \"Sunday\";\n weekday[1] = \"Monday\";\n weekday[2] = \"Tuesday\";\n weekday[3] = \"Wednesday\";\n weekday[4] = \"Thursday\";\n weekday[5] = \"Friday\";\n weekday[6] = \"Saturday\";\n return weekday[number];\n}", "function fromDayName(fn) {\n return function(match) {\n var dayname = fn(match),\n wday = $send(Opal.const_get_relative($nesting, 'DAYNAMES'), 'map', [], \"downcase\".$to_proc()).indexOf((dayname).$downcase());\n\n return current_day - current_wday + wday;\n }\n }", "function formatDaySimple(d, numberDay) {\r\n var day = new Date(d).getDay(),\r\n diff = new Date(d).getDate() - day + (day == 0 ? -7 + numberDay : numberDay); // adjust when day is sunday\r\n return formatValue(new Date(new Date(d).setDate(diff)).getDate()) + '_' + formatValue(new Date(new Date(d).setDate(diff)).getMonth() + 1) + '_' + new Date(new Date(d).setDate(diff)).getFullYear();\r\n}", "function getDay(day) {\n const today = new Date().getDay();\n var week = [\n { name: 'ned', day: 0 },\n { name: 'pon', day: 1 },\n { name: 'uto', day: 2 },\n { name: 'sre', day: 3 },\n { name: 'čet', day: 4 },\n { name: 'pet', day: 5 },\n { name: 'sub', day: 6 },\n { name: 'ned', day: 7 },\n { name: 'pon', day: 8 },\n { name: 'uto', day: 9 },\n { name: 'sre', day: 10 },\n { name: 'čet', day: 11 },\n { name: 'pet', day: 12 },\n { name: 'sub', day: 13 }\n ];\n return week[today + day].name\n}", "function EWSRP_DayInstanceDayName()\n{\n return EWSRP_dayNameList[this.DayOfWeek];\n}", "getDayNumerals(date) { return `${date.day}`; }", "function happyMonday(name){\n return `Happy Monday, ${name}!`\n}", "dddd (date, dateLocale) {\n return dateLocale.days[ date.getDay() ]\n }", "function whatDayToday(day) {\n var result;\n day = day.toLowerCase();\n switch (day) {\n case \"sunday\":\n case \"monday\":\n result = \"Have a good week\"\n break\n case \"tuesday\":\n case \"wednesday\":\n result = \"Ohhh....\"\n break\n case \"thrusday\":\n result = \"Yalla habayta\"\n break\n case \"friday\":\n case \"saturday\":\n result = \"Yammi jachnun\"\n break\n default:\n result = \"Not a valid day\"\n break\n }\n return result\n }", "function prettyDay(dd) {\n return prettyDate(dd, \" \", true);\n }", "function getDayName(dayNum){ //add parameter of function inside the parenthesis\r\n\tvar day; //write variable to print in and print out first. Just mention the variable type and the variable name\r\n\tswitch(dayNum){ //use switch function inside another function that can return variable or return just inside the switch function\r\n\t\tcase 1:\r\n\t\tday = \"Monday\";\r\n\t\tbreak; //break everytime \r\n\t\tcase 2:\r\n\t\tday =\"Tuesday\";\r\n\t\tbreak;\r\n\t\tcase 3:\r\n\t\tday =\"Wednesday\";\r\n\t\tbreak;\r\n\t\tcase 4:\r\n\t\tday = \"Thursday\"; //more convenient than if function when there is the same parameter and different values\r\n\t\tbreak;\r\n\t\tcase 5:\r\n\t\tday = \"Friday\";\r\n\t\tbreak;\r\n\t\tcase 6:\r\n\t\tday = \"Saturday\";\r\n\t\tbreak;\r\n\t\tcase 7:\r\n\t\tday = \"Sunday\";\r\n\t\tbreak;\r\n\t\tdefault: //add default setting in case the parameter is not valid\r\n\t\tday = \"Day doesn't exist. Your \"+ dayNum + \"is not a valid day.\"\r\n\t\tbreak;\r\n\t}\r\n\treturn day;\r\n}", "function whatWeekDayNameIsIt(number) {\n var day;\n switch (number) {\n case 1:\n day = \"Monday\";\n break;\n case 2:\n day = \"Tuesday\";\n break;\n case 3:\n day = \"Wednesday\";\n break;\n case 4:\n day = \"Thursday\";\n break;\n case 5:\n day = \"Friday\";\n break;\n case 6:\n day = \"Saturday\";\n break;\n case 7:\n day = \"Sunday\";\n break;\n default:\n day = \"Please enter valid weekday number\";\n }\n return day;\n}", "function getDay(num) {\n\tlet day = \"\";\n\tif(num == 1 || num == 8) {\n\t\tday = \"MON\";\n\t} else if(num == 2 || num == 9) {\n\t\tday=\"TUE\";\n\t} else if(num == 3 || num == 10) {\n\t\tday=\"WED\";\n\t} else if(num == 4 || num == 11) {\n\t\tday=\"THUR\";\n\t} else if(num == 5 || num == 12) {\n\t\tday=\"FRI\";\n\t} else if(num == 6) {\n\t\tday=\"SAT\";\n\t} else if(num == 7) {\n\t\tday=\"SUN\";\n\t } \n\treturn day;\n}", "static formatDay(date, shortDays = false) {\n const currentDay = date.getUTCDay();\n\n if (shortDays)\n return SHORT_DAYS[currentDay];\n else\n return LONG_DAYS[currentDay];\n }", "function getDayOfWeek(theDay)\n{\t\n\tswitch (theDay)\n\t{\n\t\tcase 0:\n\t\t\treturn \"Sunday\";\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\treturn \"Monday\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\treturn \"Tuesday\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\treturn \"Wednesday\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\treturn \"Thursday\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\treturn \"Friday\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\treturn \"Saturday\";\n\t\t\tbreak;\t\t\t\n\t}\n}", "function morning(name){\r\n\t\r\n\treturn `good morning ${name}`;\r\n}", "function fromDayName(fn) {\n return function(match) {\n var dayname = fn(match),\n wday = ($a = ($b = $scope.get('DAYNAMES')).$map, $a.$$p = \"downcase\".$to_proc(), $a).call($b).indexOf((dayname).$downcase());\n\n return current_day - current_wday + wday;\n }\n }", "function formatDay(date) {\n\treturn moment(date).format(\"ddd MMMM Do\");\n}", "function getDateString(d){\n\t\tvar days = ['SUN','MON','TUES','WED','THURS','FRI','SAT'];\n\t\tvar spaces = [' ',' '];\n\t\tvar t = days[d.getDay()] + spaces.join('') + d.getDate();\n\t\treturn t\n\t}", "prettyBirthday() {//Can be put in method\n return dayjs(this.person.dob.date)\n .format('DD MMMM YYYY')//change in assignment to different format not default\n }", "fullDateString(date) {\n return {\n day: this.getDayName(date.getDay()),\n month: this.getMonthName(date.getMonth()),\n year: date.getFullYear(),\n d: date.getDate()\n };\n }", "function getDay(day) {\n switch (day) {\n case \"Monday\": return 1;\n\n case \"Tuesday\": return 2;\n case \"Wednesday\": return 3;\n case \"Thursday\": return 4;\n case \"Friday\": return 5;\n case \"Saturday\": return 6;\n case \"Sunday\": return 7;\n default: return \"error\"; break;\n\n }\n}", "function day(date) { return `${date.getDate()}`.padStart(2, '0') }", "function getMonthName(day) {\n let month;\n // Switch Statement for months\n switch (day) {\n case 0: \n month = 'Jan';\n break;\n case 1: \n month = 'Feb';\n break;\n case 2: \n month = 'Mar';\n break;\n case 3: \n month = 'Apr';\n break;\n case 4: \n month = 'May'; \n break;\n case 5: \n month = 'Jun';\n break;\n case 6: \n month = 'Jul';\n break;\n case 7: \n month = 'Aug'; \n break;\n case 8: \n month = 'Sep'; \n break;\n case 9: \n month = 'Oct'; \n break;\n case 10: \n month = 'Nov';\n break;\n case 11: \n month = 'Dec';\n break;\n }\n return month;\n}", "function dayOfWeek(day) {\n /**\n Return the string \"Monday\" if the argument passed to parameter day is 1.\n Return \"Tuesday\" if the argument is 2. Or return the string \"\"Wednesday\", \"Thursday\",\n \"Friday\", \"Saturday\", or Sunday if day is 3, 4, 5, 6, or 7 respectively.\n */\n if (day === 1) {\n return \"Monday\";\n }\n else if (day === 2) {\n return \"Tuesday\";\n }\n else if (day ===3) {\n return \"Wednesday\";\n }\n else if (day === 4) {\n return \"Thursday\";\n }\n else if (day === 5) {\n return \"Friday\";\n }\n else if (day === 6) {\n return \"Saturday\";\n }\n else if (day === 7) {\n return \"Sunday\";\n }\n else {\n return \"Not a valid day of the week\";\n }\n\n}", "function getLocaleDayNames(locale,formStyle,width){var data=findLocaleData(locale);var daysData=[data[3/* DaysFormat */],data[4/* DaysStandalone */]];var days=getLastDefinedValue(daysData,formStyle);return getLastDefinedValue(days,width);}", "d (date) {\n return date.getDay()\n }", "dd (date, dateLocale) {\n return this.dddd(date, dateLocale).slice(0, 2)\n }", "function weekdayName(weekdayNum){\n // getting day of the week based on numbers 1 to 6; number 1 starting with \"Sunday\" and number 6 ending with \"Saturday\"\n switch (weekdayNum){\n case 1:\n console.log(\"Sunday\");\n break;\n case 2:\n console.log(\"Monday\")\n break;\n case 3:\n console.log(\"Tuesday\")\n break;\n case 4:\n console.log(\"Wednesday\")\n break;\n case 5:\n console.log(\"Thursday\")\n break;\n case 6:\n console.log(\"Friday\")\n break;\n case 7:\n console.log(\"Saturday\");\n break;\n }\n}", "getDayName(index) {\n return this.settings.days[index];\n }", "ddd (date, dateLocale) {\n return dateLocale.daysShort[ date.getDay() ]\n }", "function getDay(date) {\n var day = date.substring(6, 8);\n day = parseInt(day);\n var j = day % 10,\n k = day % 100;\n if (j == 1 && k != 11) {\n return day + \"st\";\n }\n if (j == 2 && k != 12) {\n return day + \"nd\";\n }\n if (j == 3 && k != 13) {\n return day + \"rd\";\n }\n return day + \"th\";\n}", "function happyHolidaysTo(name) {\n return `Happy holidays, ${name}!`;\n}", "function getDayName(dateString) {\n let dayName;\n let dn = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]\n let d = new Date(dateString);\n dayName = dn[d.getDay()];\n return dayName;\n}", "function dayPart(oDate)\n{\n var theHour = oDate.getHours();\n if (theHour < 6)\n return \"wee hours\";\n if (theHour < 12)\n return \"morning\";\n if (theHour < 18)\n return \"afternoon\";\n return \"evening\";\n}", "function getSpecial(){\n var today = new Date();\n var day = today.getDay();\n var specialmeallist = ['Pizza', 'Wings', 'Tacos', 'Margaritas', 'Reuben', 'Pancakes', 'Ice Cream Sunday'];\n var specialmeal = specialmeallist[day];\n \n switch (day){\n case 0:\n day = 'Sunday';\n break;\n case 1:\n day = 'Monday';\n break;\n case 2:\n day = 'Tuesday';\n break;\n case 3:\n day = 'Wednesday';\n break;\n case 4:\n day = 'Thursday';\n break;\n case 5:\n day = 'Friday';\n break;\n case 6:\n day = 'Saturday';\n break;\n }\n return '<h3 id=\\'special\\'>'+day+'s Special is: '+specialmeal+'</h3>';\n}", "function weekDayToString(weekDay){\n switch(weekDay){\n case 1:\n return \"Monday\";\n break;\n case 2:\n return \"Tuesday\";\n break;\n case 3:\n return \"Wednesday\";\n break;\n case 4:\n return \"Thursday\";\n break;\n case 5:\n return \"Friday\";\n break;\n case 6:\n return \"Saturday\";\n break;\n case 0:\n return \"Sunday\";\n break;\n default:\n return \"Error: weekDay number \"+today.getDay();\n }\n}", "function weekOrWeekend(day){\n \n switch(day){\n case \"Monday\":return \"week\";\n break;\n case \"Tuesday\":return \"week\";\n break;\n case \"Wednesday\":return \"week\";\n break;\n case \"Thursday\":return \"week\";\n break;\n case \"Friday\":return \"week\";\n break;\n case \"Saturday\":return \"weekend\";\n break;\n case \"Sunday\":return \"weekend\";\n break;\n default:return \"Invalid day\";\n }\n}", "function happyHolidaysTo(name) {\n return `Happy holidays, ${name}!`\n}", "function happyHolidaysTo(name) {\n return `Happy holidays, ${name}!`\n}", "function happyHolidayTo(holiday, name) {\n return `Happy ${holiday}, ${name}!`;\n}", "function getDayType(day)\r\n{\r\n\tswitch(day)\r\n\t{\r\n\t\t//Weekdays\r\n\t\tcase 1: //Monday\r\n\t\tcase 2: //Tuesday\r\n\t\tcase 3: //Wednesday\r\n\t\tcase 4: //Thursday\r\n\t\tcase 5: return \"Weekday\"; break; //Friday\r\n\r\n\t\t//Weekends\r\n\t\tcase 6: //Saturday\r\n\t\tcase 0: return \"Weekend\"; break; //Sunday\r\n\r\n\t\t//Otherwise\r\n\t\tdefault: return null; break; //Invalid date\r\n\t}\r\n}", "function happyHolidayTo(holiday, name)\n{\n return `Happy ${holiday}, ${name}!`\n}", "function formatDay(day, options) {\n return date_fns_1.format(day, 'd', options);\n}", "getTitle() {\n return IsMorning(this.date) ? \"Sunrise - \" + this.date.toLocaleString() : \"Sunset - \" + this.date.toLocaleString();\n }", "function happyHolidaysTo(name)\n{\n return `Happy holidays, ${name}!`\n}", "function day() {\r\n var d = new Date();\r\n var weekday = new Array(7);\r\n weekday[0]= \"Sunday\";\r\n weekday[1] = \"Monday\";\r\n weekday[2] = \"Tuesday\";\r\n weekday[3] = \"Wednesday\";\r\n weekday[4] = \"Thursday\";\r\n weekday[5] = \"Friday\";\r\n weekday[6] = \"Saturday\";\r\n\r\n return weekday[d.getDay()];\r\n}", "function happyHolidayTo(holiday, name) {\n return `Happy ${holiday}, ${name}!`\n}", "function happyHolidayTo(holiday, name) {\n return `Happy ${holiday}, ${name}!`\n}", "function happyHolidaysTo (name) {\n return \"Happy holidays, \" + name + \"!\"\n}", "processDate ( ) {\n let days = [ 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday', 'Sunday' ];\n let date = new Date ( this.data.release_date ).toDateString ( );\n let split = date.split ( ' ' );\n let fullday = days.filter ( x => x.indexOf ( split [ 0 ] ) !== -1 );\n return `${fullday}, ${split [ 1 ]} ${ split [ 2 ]} ${split [ 3 ]}`;\n }", "function shortDate(date){\n var d = new Date(date);\n var dayArray = ['Sun', 'Mon','Tue','Wed','Thu','Fri','Sat'];\n var curr_day = d.getDay();\n var curr_date = d.getDate();\n if(curr_date < 10){curr_date = \"0\" + curr_date;}\n var curr_month = d.getMonth() + 1;\n if(curr_month < 10){curr_month = \"0\" + curr_month;}\n var curr_year = d.getFullYear(); \n var shortDate = curr_date + \"-\" + curr_month + \"-\" + curr_year;\n //dayArray[curr_day] + \" \" + \n return (shortDate);\n}", "function r(t){return t.toLowerCase().split(\"-\").map(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}).join(\"-\")}", "function dayFinder(date) {\n var newDate = new Date(date);\n switch(newDate.getDay()) {\n case 0:\n return \"Sunday\";\n case 1:\n return \"Monday\";\n case 2:\n return \"Tuesday\";\n case 3:\n return \"Wednesday\";\n case 4:\n return \"Thursday\";\n case 5:\n return \"Friday\";\n case 6:\n return \"Saturday\";\n break;\n }\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 short() {\n return date.toLocaleDateString(locale);\n }", "function shortForm(){\n return Date.parse((new Date()).getFullYear() + \" \" + date.replace(\",\",\"\").match(/[a-zA-Z0-9 \\:]+/)[0].trim());\n }", "function dayOfWeekAsString(dayIndex) {\n return [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"][dayIndex];\n }", "function getDayOfWeek(dayNumber)\r\n{\r\n\tswitch(dayNumber)\r\n\t{\r\n\t\tcase 0: return \"Sunday\"; break;\r\n\t\tcase 1: return \"Monday\"; break;\r\n\t\tcase 2: return \"Tuesday\"; break;\r\n\t\tcase 3: return \"Wednesday\"; break;\r\n\t\tcase 4: return \"Thursday\"; break;\r\n\t\tcase 5: return \"Friday\"; break;\r\n\t\tcase 6: return \"Saturday\"; break;\r\n\t\tdefault: return null; break;\r\n\t}\r\n}", "function happyHolidayTo(holiday, name) {\n return (`Happy ${holiday}, ${name}!`);\n}", "function displayDay() {\n var day;\n \n switch (new Date().getDay()) {\n case 0: \n day = \"Sunday\";\n break;\n case 1: \n day = \"Monday\";\n break;\n case 2:\n day = \"Tuesday\";\n break;\n case 3:\n day = \"Wednesday\";\n break;\n case 4:\n day = \"Thursday\";\n break;\n case 5:\n day = \"Friday\";\n break;\n case 6:\n day = \"Saturday\";\n break;\n }\n \n var dayDiv = document.getElementById('day');\n dayDiv.innerText = day;\n }", "function getDay(date) {\n return getDateTime(date).substring(0, 10);\n}", "function e(t,e,n){return t+\" \"+i({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],t)}", "function changeFormate(x) {\n var year = x.substring(0, 4);\n var month = x.substring(5, 7);\n var day = x.substring(8, 10);\n var nd = year + \"/\" + month + \"/\" + day;\n return nd\n}" ]
[ "0.73955697", "0.7046606", "0.702821", "0.6944925", "0.6942296", "0.6846222", "0.67730534", "0.6684676", "0.66161096", "0.6579167", "0.6551712", "0.6547645", "0.64998364", "0.64977765", "0.6379533", "0.63597834", "0.6348753", "0.63403744", "0.631655", "0.62867796", "0.6242216", "0.62392306", "0.6239109", "0.6223646", "0.62154806", "0.6196435", "0.6178806", "0.6170307", "0.615097", "0.6150422", "0.6139187", "0.6135331", "0.60796356", "0.60749453", "0.6045935", "0.6045424", "0.60386205", "0.60259664", "0.5999068", "0.59963757", "0.5992923", "0.5990259", "0.59664184", "0.5956993", "0.59485626", "0.5945181", "0.59266067", "0.5889654", "0.58895904", "0.58793795", "0.58625823", "0.5855783", "0.58298576", "0.58214843", "0.5793466", "0.5769093", "0.57617795", "0.5755545", "0.57392883", "0.5735893", "0.5727685", "0.57177466", "0.5699845", "0.5696839", "0.5687172", "0.5684127", "0.5679684", "0.567133", "0.5670942", "0.56650156", "0.56449604", "0.5642835", "0.5639873", "0.5637465", "0.56221086", "0.56221086", "0.5622019", "0.56152046", "0.5597532", "0.55965644", "0.55941117", "0.5579099", "0.55686975", "0.5567293", "0.5567293", "0.55538845", "0.5547781", "0.5537441", "0.5530285", "0.5528377", "0.5525136", "0.5523124", "0.5522717", "0.5515813", "0.54919726", "0.54907465", "0.54890794", "0.54795235", "0.5476578", "0.54764" ]
0.738814
1
Convert a timestring YYYYMMDDTHH:MM:SS to 12h format 20181210T15:36:00 => 3:36PM
function formatTime(timeString) { const H = +timeString.substr(0, 2); const h = H % 12 || 12; const ampm = H < 12 ? "AM" : "PM"; return h + timeString.substr(2, 3) + ampm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeTo12HrFormat(time_to_convert)\n{ // Take a time in 24 hour format and format it in 12 hour format\n let time_part_array = time_to_convert.split(\":\");\n let ampm = 'AM';\n\n if (time_part_array[0] >= 12) {\n ampm = 'PM';\n }\n\n if (time_part_array[0] > 12) {\n time_part_array[0] = time_part_array[0] - 12;\n }\n return time_part_array[0] + ':' + time_part_array[1] + ':' + time_part_array[2] + ' ' + ampm;\n}", "tConvert(time, format) {\n if (format == 12) {\n let timeArr = time.split(\":\");\n let hours = timeArr[0];\n let _ext = \"AM\";\n if (hours >= 12) {\n hours = timeArr[0] % 12;\n _ext = \"PM\";\n }\n return hours + \":\" + timeArr[1] + \":\" + timeArr[2] + \" \" + _ext;\n } else {\n }\n }", "function timeConversion(s) {\n let hour = parseInt(s.slice(0, 2));\n let clock = s.slice(8, 10);\n if (clock === 'PM') {\n hour = (hour == 12) ? hour = 12 : hour += 12;\n //better way is\n // hour = (hour % 12) + 12;\n } else {\n hour = (hour == 12) ? hour = 0 : hour;\n }\n return hour.toString().padStart(2, 0) + s.slice(2,8)\n}", "function timeConversion(s) {\r\n let r = '';\r\n let rn = 0;\r\n // Apague o AM das horas entre 1:00AM e 11:59AM\r\n let hn = parseInt(s.slice(0, 2)); // hora no formato numerico\r\n let t = s.slice(8); // turno: AM ou PM\r\n if (hn >= 1 && hn <= 11 && t == 'AM') {\r\n r = s.slice(0, 8);\r\n }\r\n // Deixe o horario do meio-dia igual e simplesmente remova o PM\r\n if (hn == 12) {\r\n r = s.slice(0, 8);\r\n }\r\n // Some 12 horas ao periodo entre 1:00 PM e 11:59 PM e apague o PM\r\n if (hn >= 1 && hn <= 11 && t == 'PM') {\r\n rn = hn + 12;\r\n r = rn + s.slice(2, 8);\r\n }\r\n // Substitua o '12' por '00' ao periodo entre \"12:00 AM\" e \"12:59 AM\" e apague o AM\r\n if (hn == 12 && t == 'AM') {\r\n r = '00' + s.slice(2, 8);\r\n } \r\n return r;\r\n}", "function convert24to12hr(time){\n var hrs = parseInt(time.split(':')[0]);\n var suffix = (hrs >= 12) ? \" PM\" : \" AM\";\n hrs = (hrs >= 13) ? hrs-12: hrs;\n return '' + hrs + ':' + time.split(':')[1] + suffix;\n}", "function timeConversion(s) {\n var arr=s.split(\":\");\n let hr=arr[0];\n if(arr[2].charAt(2) == 'P'){\n arr[2]=arr[2].replace(\"PM\",\"\");\n hr=parseInt(hr)+12;\n if(hr==24 && arr[1]==\"00\" && arr[2]==\"00\")\n hr=\"00\";\n if(hr==24)\n hr=12;\n }else{\n if(hr==12)\n hr=\"00\";\n arr[2]=arr[2].replace(\"AM\",\"\");\n \n }\n var str=hr+\":\"+arr[1]+\":\"+arr[2];\n return str;\n \n\n}", "function timeConversion(s) {\n\tlet hh = s.slice(0, 2)\n\tlet mm = s.slice(3, 5)\n\tlet ss = s.slice(6, 8)\n\n\tif (s.slice(8, 10) === 'PM') {\n\t\tif (hh === '12') return `${hh}:${mm}:${ss}`\n\t\treturn `${+hh + 12}:${mm}:${ss}`\n\t}\n\tif (s.slice(8, 10) === 'AM') {\n\t\tif (hh === '12') return `00:${mm}:${ss}`\n\t\treturn `${hh}:${mm}:${ss}`\n\t}\n}", "function timeConversion(s) {\n let amPm = s[8];\n let convert = 0;\n let holder = s.split(':');\n\n if (((amPm === 'P') && (parseInt(holder[0]) === 12))) {\n return `${holder[0]}:${holder[1]}:${holder[2].slice(0, 2)}`;\n }\n else if ((amPm === 'A') && (parseInt(holder[0]) === 12)) {\n return `00:${holder[1]}:${holder[2].slice(0, 2)}`;\n }\n else if (amPm === 'P') {\n convert = (parseInt(holder[0]) + 12);\n return `${convert}:${holder[1]}:${holder[2].slice(0, 2)}`;\n }\n else {\n return `${holder[0]}:${holder[1]}:${holder[2].slice(0, 2)}`;\n }\n\n}", "function timeConversion(s) {\n let amOrpm = s.substring(s.length-2,s.length);\n console.log(amOrpm);\n let arr = s.split(':');\n if(amOrpm == 'PM'){\n if(arr[0] == '12'){\n arr[0] = '12';\n }\n else{\n arr[0] = parseInt(arr[0]) + 12;\n }\n arr[arr.length-1] = arr[arr.length-1].substring(0,2);\n }else if(amOrpm == 'AM'){\n arr[arr.length-1] = arr[arr.length-1].substring(0,2);\n if(arr[0] == '12'){\n arr[0] = '00';\n }\n }\n return arr.join(':')\n \n\n}", "function timeConversion(s) {\n var ampm = s.substring(8,10);\n //console.log(ampm);\n var hour = s.substring(0,2);\n //console.log(hour);\n if(ampm == \"PM\") {\n let h = parseInt(hour);\n if(h!=12)\n h = h+12;\n if(h==24)\n return \"00\" + s.substring(2,8);\n else\n return h + s.substring(2,8);\n }\n else {\n let h = parseInt(hour);\n if(h==12)\n return \"00\" + s.substring(2,8);\n else\n return hour + s.substring(2,8);\n }\n}", "function timeConversion(s) {\n let time = s.toLowerCase().split(':');\n let hours = parseInt(time[0]);\n let ampm = time[2];\n if (ampm.indexOf('am') != -1 && hours == 12) {\n time[0] = '00';\n }\n if (ampm.indexOf('pm') != -1 && hours < 12) {\n time[0] = hours + 12;\n }\n\n return time.join(':').replace(/(am|pm)/, '');\n\n}", "function timeConversion(s) {\n //first make into array so we can manipulate it\n //check if am or pm to start conditioning logic\n //if its am, only need to make 12 00, change nothing else\n //if PM need to add 12 to all exept 12(stays the same)\n //then we need to get rid of the am/pm\n\n let arr = s.slice(0, 8).split(':');\n\n // if (s[8] === 'P') {\n // if (arr[0] !== '12') {\n // arr[0] = Number(arr[0]) + 12;\n // } else {\n // arr[0] = '12';\n // }\n // }\n // if (s[8] === 'A') {\n // if (arr[0] !== '12') {\n // arr[0] = arr[0];\n // } else {\n // arr[0] = '00';\n // }\n // }\n // return arr.join(':');\n // }\n\n // ||\n\n s[8] === 'P' && arr[0] !== '12'\n ? (arr[0] = Number(arr[0]) + 12)\n : (arr[0] = '12');\n s[8] === 'A' && arr[0] !== '12' ? arr[0] : (arr[0] = '00');\n\n return arr.join(':');\n}", "function to12(time24) {\n\n\tvar timearr = time24.split(\":\",2);\n\tvar hr = parseInt(timearr[0]);\n\tvar min = timearr[1];\n\tvar suffix = (hr >= 12) ? \" PM\":\" AM\";\n\thr = (hr > 12) ? hr - 12: hr;\n\thr = (hr == 0) ? 12: hr;\n\n\treturn hr + \":\" + min + suffix;\n}", "function tConvert (time) {\n // Check correct time format and split into components\n time = time.toString ().match (/^([01]\\d|2[0-3])(:)([0-5]\\d)(:[0-5]\\d)?$/) || [time];\n console.log(\"TIME: \" + time);\n\n if (time.length > 1) { // If time format correct\n time = time.slice (1); // Remove full string match value\n time[5] =+ time[0] < 12 ? ' AM' : ' PM'; // Set AM/PM\n time[0] =+ time[0] % 12 || 12; // Adjust hours\n }\n return time.join(''); // return adjusted time or original string\n}", "function timeConversion(s) {\n var timeDigits = s.slice(0, 8);\n var timeParts = s.slice(8);\n var timeArray = timeDigits.split(\":\");\n if (timeParts === \"PM\" && timeArray[0] !== \"12\") {\n timeArray[0] = Number(timeArray[0]) + 12;\n }\n if (timeParts === \"AM\" && timeArray[0] === \"12\") {\n timeArray[0] = String((Number(timeArray[0]) - 12)).padEnd(2, 0);\n }\n timeDigits = timeArray.join(\":\");\n return timeDigits;\n}", "function tConvert(time) {\n // Check correct time format and split into components\n time = time.toString().match(/^([01]\\d|2[0-3])(:)([0-5]\\d)(:[0-5]\\d)?$/) || [time];\n\n if (time.length > 1) { // If time format correct\n time = time.slice(1); // Remove full string match value\n time[5] = +time[0] < 12 ? 'am' : 'pm'; // Set AM/PM\n time[0] = +time[0] % 12 || 12; // Adjust hours\n }\n return time.join(''); // return adjusted time or original string\n}", "function timeConversion(s) {\n /*\n * Write your code here.\n */\n let l = s.length\n let t = s.substring(l - 2)\n let hour;\n let a;\n let f;\n if (t == \"PM\") {\n\n\n hour = +s.substring(0, 2)\n if (hour == 12) {\n return s.replace(\"PM\", \"\")\n }\n let rest = s.substring(2)\n a = 12 + hour\n f = +a + rest.replace(\"PM\", \"\")\n }\n if (t == \"AM\") {\n hour = +s.substring(0, 2)\n if (hour == 12) {\n a = \"00\" + s.substring(2)\n return f = a.replace(\"AM\", \"\")\n }\n f = s.replace(\"AM\", \"\")\n }\n return f\n\n }", "function timeConversion(s) {\n\t/*\n\t * Write your code here.\n\t */\n\ts = s.split(\":\");\n\tfor (var i = 0; i < s.length; i++) {\n\t\tvar hour = parseInt(s[0]);\n\t\tif (s[2].includes('AM') && hour === 12) {\n\t\t\treturn \"00\" + \":\" + s[1] + \":\" + s[2].replace(/AM/g, '');\n\t\t} else if (s[2].includes('AM') && hour < 12) {\n\t\t\treturn \"0\" + hour + \":\" + s[1] + \":\" + s[2].replace(/AM/g, '');\n\t\t} else if (s[2].includes('AM') && hour !== 12) {\n\t\t\treturn hour + \":\" + s[1] + \":\" + s[2].replace(/AM/g, '');\n\t\t} else if (s[2].includes('PM') && hour === 12) {\n\t\t\treturn hour + \":\" + s[1] + \":\" + s[2].replace(/PM/g, '');\n\t\t} else {\n\t\t\treturn (hour + 12) + \":\" + s[1] + \":\" + s[2].replace(/PM/g, '');\n\t\t}\n\t}\n}", "function converTime(t){\n t = Number(t); //cast to number\n if (t > 0 && t < 12){\n return t + ':00 am'\n } else if(t === 0) {\n return \"12:00 am\"\n } else if(t === 12) {\n return '12:00 pm'\n } else if(t > 12){\n return (t-12) + ':00 pm'\n }\n }", "function timeConversion(s) {\n //00:05:45PM\n //19:05:45\n const pm = s.slice(8,10) === 'PM';\n const hours = s.slice(0,2);\n let adjustedHours = hours;\n if(pm && parseInt(hours) < 12) adjustedHours = parseInt(hours) + 12;\n if(pm && parseInt(hours) === 12) adjustedHours = 12;\n if(!pm && parseInt(hours) === 12) adjustedHours = '00';\n \n console.log(`${adjustedHours}:${s.slice(3,5)}:${s.slice(6,8)}`);\n}", "function timeConversion(time24) {\n const meridiem = time24.substring(time24.length - 2);\n const numericTime = time24.substring(0, time24.length - 2);\n const timeArray = numericTime.split(\":\");\n const hour12 = Number(timeArray[0]);\n\n const hour24 = convertHour(hour12, meridiem)\n\n // add leading zero if needed\n if (hour24 < 10) {\n timeArray[0] = '0' + hour24;\n } else {\n timeArray[0] = hour24;\n }\n\n const time12 = timeArray.join(':');\n\n console.log(time12);\n}", "function convertTo24HRFormat(time12HR) {\n let time24HR;\n\n time12HR = time12HR.split(\":\");\n // time12HR == [\"10a\"] or [\"10\", \"30a\"]\n\n let isAM = time12HR[time12HR.length - 1].includes(\"a\");\n // isAM == true\n\n // remove \"a\" or \"p\" in hours\n let hours = isAM ? removeChar(time12HR[0], \"a\") : removeChar(time12HR[0], \"p\");\n // hours == \"10\"\n\n let minutes = time12HR[1] ? time12HR[1].slice(0, time12HR[1].length - 1) : \"00\";\n // minutes == \"30\" or \"00\"\n\n // IF 12AM\n if (isAM && hours === \"12\") {\n hours = 24;\n\n // IF PM AND NOT 12\n } else if (!isAM && hours !== \"12\") {\n hours = 12 + Number(hours);\n }\n\n time24HR = `${hours}:${minutes}:00`;\n\n return time24HR;\n }", "convertMilitaryTimeToAMPM(datetime) {\n let _hrs = datetime.substring(11, 13); // ex: 18, 10\n let _mins = datetime.substring(14, 16); // ex: 00, 30\n if(parseInt(_hrs) >= 12) {\n _hrs = _hrs - 12;\n }\n _hrs = ('0' + _hrs).slice(-2);\n return _hrs + ':' + _mins;\n }", "function tConvert (time) {\n // Check correct time format and split into components\n time = time.toString ().match (/^([01]\\d|2[0-3])(:)([0-5]\\d)(:[0-5]\\d)?$/) || [time];\n if (time.length > 1) { // If time format correct\n time = time.slice (1); // Remove full string match value\n time[5] = +time[0] < 12 ? 'AM' : 'PM'; // Set AM/PM\n time[0] = +time[0] % 12 || 12; // Adjust hours\n }\n return time.join (''); // return adjusted time or original string\n}", "function convertTo24Hour(time) {\n var hours = parseInt(time.substr(0, 2));\n if (time.indexOf('AM') != -1 && hours == 12) {\n time = time.replace('12', '0');\n }\n if (time.indexOf('PM') != -1 && hours < 12) {\n time = time.replace(hours, (hours + 12));\n }\n return time.replace(/AM|PM/, '').replace(\":\", \"\").replace(\" \", \"\");\n}", "function timeConversion(s) {\n\t/*\n\t * Write your code here.\n\t */\n\tlet trimmedStr = s.slice(0, -2);\n\tconst elements = trimmedStr.split(\":\");\n\n\tif (s.endsWith(\"PM\")) {\n\t\tif (elements[0] !== \"12\") {\n\t\t\tconst hours = Number(elements[0]);\n\t\t\telements[0] = (hours + 12).toString();\n\t\t}\n\t} else if (elements[0] === \"12\") {\n\t\telements[0] = \"00\";\n\t}\n\n\treturn elements.join(\":\");\n}", "function formatTime3(string) {\n let newStr = \"\";\n\n let strArr = string.split(\" \");\n // strArr = [\"1:00\", \"AM\"]\n\n newStr += strArr[0];\n\n let isAM = strArr[1][0] === \"A\";\n\n if (isAM) {\n newStr += \"a\";\n\n } else {\n newStr += \"p\";\n }\n\n return newStr;\n }", "function convTime(time) {\n // var for am/pm\n var amPm;\n // split hours and mins\n var timesplit = time.split(\":\");\n\n // if hours > 12 then do conversion\n if (timesplit[0] > 12) {\n timesplit[0] = timesplit[0]-12;\n amPm=\"pm\";\n }\n else {\n if (timesplit[0] === \"12\") {\n amPm=\"pm\";\n }\n else {\n amPm=\"am\";\n }\n }\n\n // if minutes > 10 then insert a 0\n if (timesplit[1] < 10) {\n timesplit[1] = \"0\"+timesplit[1];\n }\n\n // return the string with am/pm added\n return (timesplit[0]+ \":\" + timesplit[1] + \" \" + amPm);\n\n}", "function as12HourTime(number) {\n\t\tif (number == 0 || number == 24) {\n\t\t\treturn \"midnight\";\n\t\t}\n\t\tif (number < 12) {\n\t\t\treturn number + \"am\";\n\t\t}\n\t\tif (number == 12) {\n\t\t\treturn \"noon\";\n\t\t} else {\n\t\t\treturn (number - 12) + \"pm\";\n\t\t}\n\t}", "function time24(convert_hr_str){\n //parse the end of the string to get either am or pm\n var hr12_check = convert_hr_str.substring(convert_hr_str.length - 2);\n //coerce the time string into a number\n var hrNum = parseInt(convert_hr_str);\n //if the time string is a number, convert the time to 24 clock\n // 1pm = 13\n if (hr12_check.toLowerCase() === 'pm'){\n hrNum = hrNum + 12;\n }\n return hrNum;\n}", "function convertTime12to24(time, ampm) {\n // eslint-disable-next-line prefer-const\n var _time$split = time.split(regexSplitTime),\n _time$split2 = _slicedToArray(_time$split, 3),\n hours = _time$split2[0],\n minutes = _time$split2[1],\n seconds = _time$split2[2];\n\n if (hours === '12') {\n hours = '00';\n }\n\n if (ampm === 'PM') {\n hours = parseInt(hours, 10) + 12;\n }\n\n return \"\".concat(hours, \":\").concat(minutes).concat(seconds ? \":\".concat(seconds) : '');\n }", "function formatTime_12_24(convertFormat, strTime) {\n var time = false;\n var regex = null;\n \n if(convertFormat == \"12\") {\n regex = /^([0-1]?\\d|2[0-3]):([0-5]\\d):([0-5]\\d)$/i;\n } else {\n if(convertFormat == \"24\") {\n regex = /^([0]\\d|[1][0-2]):([0-5]\\d):([0-5]\\d)\\s?(?:AM|PM)$/i;\n }\n }\n\n if (regex != null && regex.test(strTime)) {\n if(convertFormat == \"24\") {\n var arrayTime = strTime.split(\":\");\n var restTime = arrayTime[2].split(\" \");\n var hours = Number(arrayTime[0]);\n var minutes = Number(arrayTime[1]);\n var seconds = Number(restTime[0]);\n var meridian = restTime[1];\n\n if (meridian == \"PM\" && hours < 12)\n hours = hours + 12;\n \n if(meridian == \"AM\" && hours == 12)\n hours = hours - 12;\n\n if (hours < 10)\n hours = \"0\" + hours.toString();\n\n if (minutes < 10)\n minutes = \"0\" + minutes.toString();\n\n if (seconds < 10)\n seconds = \"0\" + seconds.toString();\n\n time = hours + \":\" + minutes + \":\" + seconds;\n } else {\n var arrayTime = strTime.split(\":\");\n var hours = Number(arrayTime[0]);\n var minutes = Number(arrayTime[1]);\n var seconds = Number(arrayTime[2]);\n var meridian = \"AM\";\n\n if (hours >= 12) {\n hours = hours - 12;\n meridian = \"PM\";\n }\n \n if (hours == 0) {\n hours = 12;\n }\n\n if (hours < 10)\n hours = \"0\" + hours.toString();\n\n if (minutes < 10)\n minutes = \"0\" + minutes.toString();\n\n if (seconds < 10)\n seconds = \"0\" + seconds.toString();\n\n time = hours + \":\" + minutes + \":\" + seconds + \" \" + meridian;\n }\n }\n\n return time;\n}", "function tConvert(time) {\n // Check correct time format and split into components\n time = time.toString().match(/^([01]\\d|2[0-3])(:)([0-5]\\d)(:[0-5]\\d)?$/) || [\n time,\n ];\n\n if (time.length > 1) {\n // If time format correct\n time = time.slice(1); // Remove full string match value\n time[5] = +time[0] < 12 ? \"AM\" : \"PM\"; // Set AM/PM\n time[0] = +time[0] % 12 || 12; // Adjust hours\n }\n //my added part to get rid of last two 00's (Ethan W)\n time.splice(1, 3);\n time.splice(2, 0, \" \");\n // return adjusted time or original string\n return time.join(\"\");\n}", "function convertTime12to24(time12h) {\n const [time, modifier] = time12h.split(' ');\n let [hours, minutes] = time.split(':');\n if (hours === '12') {\n hours = '00';\n }\n if (modifier === 'PM' || modifier === 'pm') {\n hours = parseInt(hours, 10) + 12;\n }\n return hours + ':' + minutes;\n}", "function timeConversion(s) {\n var splited = s.split(\":\");\n var hour = splited[0];\n var minute = splited[1];\n var seconds = splited[splited.length - 1].slice(0, 2);\n var amPm = splited[splited.length - 1].slice(-2);\n var defaultTime = hour + \":\" + minute + \":\" + seconds;\n return hour === \"12\" && amPm.toUpperCase() === \"PM\"\n ? defaultTime\n : hour === \"12\" && amPm.toUpperCase() === \"AM\"\n ? \"00:\" + minute + \":\" + seconds\n : amPm.toUpperCase() === \"PM\"\n ? parseInt(hour) + 12 + \":\" + minute + \":\" + seconds\n : defaultTime;\n}", "function convertTime(time) {\n var ampm = 'am'\n var hrs = parseInt(Number(time/4));\n \tvar min = Math.round((Number(time/4)-hrs) * 60);\n if (hrs > 12) {\n ampm = 'pm';\n hrs = hrs - 12;\n }\n if (min == 0) {\n min = '00';\n }\n \n return hrs + ':' + min + ampm;\n }", "function convertTimeStringformat(format, str) {\n var time = $(\"#clock\").val();\n var hours = Number(time.match(/^(\\d+)/)[1]);\n var minutes = Number(time.match(/:(\\d+)/)[1]);\n var AMPM = time.match(/\\s(.*)$/)[1];\n if (AMPM == \"PM\" && hours < 12) hours = hours + 12;\n if (AMPM == \"AM\" && hours == 12) hours = hours - 12;\n var sHours = hours.toString();\n var sMinutes = minutes.toString();\n if (hours < 10) sHours = \"0\" + sHours;\n if (minutes < 10) sMinutes = \"0\" + sMinutes;\n return (sHours + \":\" + sMinutes);\n}", "function get24HrFormat(str) {\n let _t = str.split(/[^0-9]/g);\n _t[0] =+_t[0] + (str.indexOf(\"pm\")>-1 && +_t[0]!==12 ? 12: 0);\n return _t.join(\"\");\n }", "function GetTwelveHourTimeString(TimeString)\n{\n var returnTimeString = TimeString;\n returnTimeString = returnTimeString.replace(/^\\s*/, \"\").replace(/\\s*$/, \"\")\n\n var ampm = 'AM';\n var firstColonPos = returnTimeString.indexOf(':');\n var hour = parseInt(returnTimeString.substring(0, firstColonPos).replace(/^[0]+/g, \"\"));\n\n if (!isNaN(hour))\n {\n if (hour > 12)\n {\n hour = hour - 12;\n ampm = 'PM';\n }\n\n if (hour.toString().length == 1)\n hour = '0' + hour;\n \n returnTimeString = hour + returnTimeString.substring(firstColonPos);\n\n var amPmIndex = returnTimeString.toUpperCase().indexOf('PM');\n if (amPmIndex == -1)\n amPmIndex = returnTimeString.toUpperCase().indexOf('AM');\n else\n ampm = 'PM';\n\n if (amPmIndex > -1)\n returnTimeString = returnTimeString.substring(0, amPmIndex) + ampm;\n else\n returnTimeString = returnTimeString + ' ' + ampm;\n }\n\n return returnTimeString;\n}", "function convertTime(h) {\n if (h == 0) return (\"12 am\");\n if (h == 12) return (\"12 pm\");\n return (h < 12) ? h + \" am\" : (h - 12) + \" pm\";\n}", "function convert(input) {\n return moment(input, 'HH:mm:ss').format('h:mm:ss A');\n }", "function twentyFourHourToTwelveHour(time) {\n\tvar h = eval(time.substring(0, 2));\n\tvar m = eval(time.substring(3, 5));\n\tvar merediem = 'AM';\n\tif (h == 0) {\n\t\th = 12;\n\t} else if (h == 12) {\n\t\tmerediem = 'PM';\n\t} else if (h > 12) {\n\t\th -= 12;\n\t\tmerediem = 'PM';\n\t}\n\treturn h + ':' + padWithZero(m) + ' ' + merediem;\n}", "function convertTime(time) {\n if (time === null) {\n return 'N/A'\n } else {\n let amPm;\n let militaryHrMn = time.substring(0, time.length - 3);\n let minutes = militaryHrMn.substring(3);\n let hour = time.substring(0, time.length - 6);\n \n if (hour > 12) {\n hour = hour - 12;\n amPm = \"pm\";\n } else {\n amPm = \"am\";\n }\n return `${hour}:${minutes}${amPm}`;\n }\n}", "function convertTimeString(time) {\n var hours = Number(time.match(/^(\\d+)/)[1]);\n var minutes = Number(time.match(/:(\\d+)/)[1]);\n var AMPM = time.match(/\\s(.*)$/)[1];\n if (AMPM == \"PM\" && hours < 12)\n hours = hours + 12;\n if (AMPM == \"AM\" && hours == 12)\n hours = hours - 12;\n var sHours = hours.toString();\n var sMinutes = minutes.toString();\n if (hours < 10)\n sHours = \"0\" + sHours;\n if (minutes < 10)\n sMinutes = \"0\" + sMinutes;\n return (sHours + ':' + sMinutes + ':00');\n}", "function ConvertTimeformat(format) {\n\tvar time = format;\n\tvar hours = Number(time.match(/^(\\d+)/)[1]);\n\tvar minutes = Number(time.match(/:(\\d+)/)[1]);\n\tvar AMPM = time.match(/\\s(.*)$/)[1];\n\tif (AMPM == \"PM\" && hours < 12) hours = hours + 12;\n\tif (AMPM == \"AM\" && hours == 12) hours = hours - 12;\n\tvar sHours = hours.toString();\n\tvar sMinutes = minutes.toString();\n\tif (hours < 10) sHours = \"0\" + sHours;\n\tif (minutes < 10) sMinutes = \"0\" + sMinutes;\n\treturn (sHours + \":\" + sMinutes + \":00\");\n}", "function reFormatTime(time) {\n const ampm = time.substr(-2, 2);\n let formattedTime;\n let formattedHour;\n const colon = time.indexOf(':');\n\n if (ampm === 'PM') {\n formattedHour = time.substr(0, 2);\n\n if (formattedHour == '12') { formattedHour = 12; } else { formattedHour = 12 + parseInt(time.substr(0, 2)); }\n\n formattedTime = `${formattedHour + time.substr(colon, 3)}:00`;\n } else {\n formattedHour = parseInt(time.substr(0, 2));\n if (formattedHour < 10) {\n formattedHour = `0${formattedHour}`;\n }\n if (formattedHour == 12) {\n formattedHour = '00';\n }\n formattedTime = `${formattedHour + time.substr(colon, 3)}:00`;\n }\n return formattedTime;\n }", "function convertTime(datetime) {\n \n // Convert to 12-hour clock\n var hours = datetime.getHours();\n var ampm = hours >= 12 ? \"PM\" : \"AM\";\n hours = hours % 12;\n hours = hours ? hours : 12;\n \n // Append a 0 to minutes less than 10\n var minutes = datetime.getMinutes();\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n \n // Construct string\n var timeStr = hours + \":\" + minutes + \" \" + ampm;\n return timeStr;\n}", "function formatTime(time) {\n // TODO This will fail for times that have hour value of 0 - 9\n let hour = Number.parseInt(time.substring(0, 2));\n if (hour < 12) {\n if (hour == 0) {\n return \"12\" + time.substring(2) + \" AM\";\n }\n else {\n return hour + time.substring(2) + \" AM\";\n }\n }\n else {\n if (hour == 12) {\n return \"12\" + time.substring(2) + \" PM\";\n }\n else {\n return (hour % 12) + time.substring(2) + \" PM\";\n }\n }\n}", "function format24HourTimeFrom12HourPieces(hours12,minutes,ampm){\n var hours24;\n var numHours12 = Number(hours12);\n var parsedTime;\n\tvar numericMinutes = Number(minutes);\n\n if(ampm == \"pm\" && numHours12 < 12){ \n hours24 = (numHours12 + 12) \n } else if(ampm == \"am\" && numHours12 == 12){\n hours24 = \"00\"\n } else {\n hours24 = hours12\n } \n \n parsedTime = (hours24 + \":\" + (isNaN(numericMinutes) ? \"00\" : numericMinutes)) \n return parsedTime;\n}", "function asl_timeConvert(_str) {\n\n if (!_str) return 0;\n\n var time = $.trim(_str).toUpperCase();\n\n //when 24 hours\n if (asl_configs && asl_configs.time_format == '1') {\n\n var regex = /(1[012]|[0-9]):[0-5][0-9]/;\n\n if (!regex.test(time))\n return 0;\n\n var hours = Number(time.match(/^(\\d+)/)[1]);\n var minutes = Number(time.match(/:(\\d+)/)[1]);\n\n return hours + (minutes / 100);\n } else {\n\n var regex = /(1[012]|[1-9]):[0-5][0-9][ ]?(AM|PM)/;\n\n if (!regex.test(time))\n return 0;\n\n var hours = Number(time.match(/^(\\d+)/)[1]);\n var minutes = Number(time.match(/:(\\d+)/)[1]);\n var AMPM = (time.indexOf('PM') != -1) ? 'PM' : 'AM';\n\n if (AMPM == \"PM\" && hours < 12) hours = hours + 12;\n if (AMPM == \"AM\" && hours == 12) hours = hours - 12;\n\n return hours + (minutes / 100);\n }\n }", "function militaryTime(timeStr) {\n\n let hour = timeStr.substring(0, 2) * 1;\n let timeFormat = timeStr.substring();\n\n// if midnight\n if (hour === 12 && s.indexOf(\"AM\") !== -1) {\n return (\"00\" + timeFormat);\n}\n// if afternoon\nif (hour === 12 && s.indexOf(\"PM\") !== -1) {\n return (time + timeFormat);\n}\n //write code here\n}", "function timeConversion(s) {\n //variable that holds the hours\n let hours = s[0] + s[1]\n //variable that holds minutes && seconds.\n let minutesAndSeconds = s[2]+s[3]+s[4]+s[5]+s[6]+s[7]\n //variable that holds wether is before or after noon.\n let time = s[8]+s[9]\n //checks if it's am or pm\n if(time === 'AM'){\n if(hours == 12){\n return '00' + minutesAndSeconds\n } else {\n return hours + minutesAndSeconds\n }\n } else {\n if(hours == 12){\n return hours + minutesAndSeconds\n }\n //re-sets hours to be equal to hours + 12, we convert it from string, to number, to string.\n hours = [parseFloat(hours) + 12].toString(hours)\n if(hours == 24){\n return '00' + minutesAndSeconds\n } else {\n return hours + minutesAndSeconds\n }\n }\n }", "function translateMilitary(timeStr){\n \n if(timeStr.charAt(8) == \"A\"){\n if(timeStr.substring(0,2)==\"12\"){\n return \"00\"+timeStr.substring(2,8);\n }\n else{\n return timeStr.substring(0,8);\n }\n \n }\n else{\n if (timeStr.substring(0,2)==\"12\"){\n return timeStr.substring(0,8);\n \n }\n else{\n return (parseInt(timeStr.substring(0,2)) + 12) + timeStr.substring(2,8);\n }\n \n }\n}", "function convertTime(string) {\n // split all event times on the ':' and then grab the first half\n let stringTime = string.split(':')[0];\n let stringTimeMinutes = string.split(\":\")[1]\n let totalTime;\n\n // Convert string to number\n parsedTime = parseInt(stringTime)\n\n // If the number is greater than 12 we add PM and convert out of military time\n if (parsedTime > 12) {\n parsedTime = parsedTime - 12\n totalTime = parsedTime + \":\" + stringTimeMinutes +\n \"PM\"\n }\n // If the number is less than 12 we add AM\n else if (parsedTime < 12) {\n totalTime = parsedTime + \":\" + stringTimeMinutes +\n \"AM\"\n }\n // Return the new formated times to be displayed in the Events section\n return totalTime\n\n}", "function normalizeTimeString(input) {\n\tinput = input.trim();\n\n\tconst match12 = input.match(/(\\d?\\d):(\\d?\\d)(?::\\d?\\d)? (AM|PM)/i);\n\n\tif (match12) {\n\t\tconst hours = parseInt(match12[1]);\n\t\tconst minutes = parseInt(match12[2]);\n\t\tconst ampm = match12[3];\n\n\t\tfunction pad(n) {\n\t\t\treturn n < 10 ? `0${n}` : `${n}`\n\t\t}\n\n\t\tif (ampm.toLowerCase() === \"pm\" && hours !== 12) {\n\t\t\treturn `${pad(hours + 12)}:${pad(minutes)}`;\n\t\t} else {\n\t\t\treturn `${pad(hours)}:${pad(minutes)}`;\n\t\t}\n\t} else if (input.match(/(\\d?\\d):(\\d?\\d)(?::\\d?\\d)?/)) {\n\t\treturn input;\n\t} else {\n\t\treturn null;\n\t}\n}", "function format_time(hour){\n if(hour > 23){ \n hour -= 24; \n } \n let amPM = (hour > 11) ? \"pm\" : \"am\"; \n if(hour > 12) { \n hour -= 12; \n } \n if(hour == 0) { \n hour = \"12\"; \n } \n return hour + amPM;\n}", "function ConvertAMPMStringTo24HourTime(ampmTime)\n{\t\n\tvar arrTimeAndAMPM = ampmTime.split(' ');\n\t\t\n\tif(arrTimeAndAMPM.length > 0)\n\t{\n\t\tvar arrHoursAndMinutes = arrTimeAndAMPM[0].split(':');\n\t\t\n\t\tif(arrHoursAndMinutes.length > 0)\n\t\t\treturn ConvertAMPMTimeTo24Hour(arrHoursAndMinutes[0], arrHoursAndMinutes[1], arrTimeAndAMPM[1]);\t\t\n\t\telse\n\t\t\treturn null;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "function convertTimeIntoAmPm(time){\n var timeString = time;\n var hourEnd = timeString.indexOf(\":\");\n var H = +timeString.substr(0, hourEnd);\n var h = H % 12 || 12;\n var ampm = H < 12 ? \"AM\" : \"PM\";\n timeString = h + timeString.substr(hourEnd, 3) + ampm;\n return timeString\n\n}", "function format_time(hour) {\n if(hour > 23){ \n hour -= 24; \n } \n let amPM = (hour > 11) ? \"pm\" : \"am\"; \n if(hour > 12) { \n hour -= 12; \n } \n if(hour == 0) { \n hour = \"12\"; \n } \n return hour + amPM;\n }", "function convertTime (time) {\n\n // \"9 AM\" --> [\"9\", \"AM\"], parse the integer 9 to make sure it is not a string\n var newTime = parseInt(time.split(\" \")[0]) // [0] refers to H of \"H A\"\n // sets newtime at 12 PM\n if (time === \"12 PM\") {\n newTime = 12\n }\n\n // sets newTime for after 12 PM\n else if (time.split(\" \")[1]===\"PM\"){ // [1] refers to A of \"H A\"\n newTime = newTime +12 \n }\n // sets newTime for before 12 PM\n return newTime\n}", "function convertFormat(time) {\n let format = 'AM';\n if (time >= 12) {\n format = 'PM';\n }\n return format;\n}", "function intTime_to_timeTime(time_str) {\n let step_one = time_str / 60;\n let time_min = Math.floor(step_one);\n\n let step_two = (step_one - time_min) * 60;\n let time_sec = Math.floor(step_two);\n\n let step_three = (step_two - time_sec) * 60;\n let time_mil = Math.floor(step_three);\n\n\n\n if (time_min < 10) {\n time_min = \"0\" + time_min.toString();\n } else {\n time_min = time_min.toString();\n }\n\n if (time_sec < 10) {\n time_sec = \"0\" + time_sec.toString();\n } else {\n time_sec = time_sec.toString();\n }\n\n if (time_mil < 10) {\n time_mil = \"0\" + time_mil.toString();\n } else {\n time_mil = time_mil.toString();\n }\n\n return time_min + \":\" + time_sec + \":\" + time_mil\n}", "function timeConversion(s) {\n let obtainAmOrPm = s.slice(8);\n let obtainHours = s.slice(0,2);\n let obtainTime = s.slice(2,8);\n\n if(obtainAmOrPm === \"PM\"){\n if(parseInt(obtainHours) !== 12) {\n obtainHours = parseInt(obtainHours) + 12\n }\n }else{\n if(obtainHours === \"12\"){\n obtainHours = \"00\"\n }\n }\n let results = obtainHours + obtainTime;\n\n console.log(results);\n\n return results;\n}", "function toMilitaryTime(time) {\n var timeParse = time.split(\" \");\n var half = timeParse[1]\n var timeParse2 = timeParse[0].split(\":\");\n var milTime = \"{0}:{1}\";\n var hour = parseInt(timeParse2[0]);\n if (hour >= 24)\n hour = 0 \n if (half == 'PM') {\n if (hour != 12)\n hour += 12 \n }\n else {\n if (hour == 12)\n hour = 0 \n }\n return milTime.format(hour, timeParse2[1])\n}", "function convertTimeTo24HourSystem(h){\n\t\t\t\tif(h.indexOf('12') !=-1 && h.indexOf('A') !=-1){\n\t\t\t\t\t\n\t\t\t\t\th=h.replace('12','00');\n\t\t\t\t\th=h.substr(0,h.indexOf(\"A\")-1);\n\t\t\t\t\t//alert(\"24H Clock: \"+h);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(h.indexOf('12')==-1 && h.indexOf('P') !=-1){\n\t\t\t\t\tt=h.substr(0,h.indexOf(\"P\"));\n\t\t\t\t\t\n\t\t\t\t\tt1=t.split(':');\n\t\t\t\t\thh=parseInt(t1[0])+(12);\n\t\t\t\t\th=h.replace(t,hh+\":\"+t1[1]);\n\t\t\t\t\th=h.substr(0,h.indexOf(\"P\")-1);\n\t\t\t\t\t//alert(\"Time (24H) is: \"+h);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(h.substr(0,1)==\"0\" && h.substr(1,1)!=\"0\" ){//eliminate the leading zero\n\t\t\t\t\t\tt=h.split(\":\");\n\t\t\t\t\t\tt1=t[0];\n\t\t\t\t\t\tt1=t1.replace(\"0\",\"\");\n\t\t\t\t\t\th=t1+\":\"+t[1];\n\t\t\t\t\t\t//alert(\"New time \"+h);\n\t\t\t\t\t}\n\t\t\t\treturn h;\n\t\t\t\t}", "function convertTo24Hour(time) {\n var hours = time.split(':')[0];\n var minutes = time.split(':')[1].split(' ')[0];\n var period = time.split(' ')[1];\n if (period === 'PM' && hours <= 11) {\n hours = String(Number(hours) + 12);\n }\n return Number(hours + minutes);\n}", "function formatTime(time){\r\n //Incoming Time format hh:mm:ss\r\n splitTime = time.split(\":\");\r\n hour = splitTime[0];\r\n minute = splitTime[1];\r\n\r\n //Determine if the hour is AM or PM\r\n if (hour > 12){\r\n amPM = \"PM\";\r\n hour = hour - 12;\r\n }else{\r\n amPM = \"AM\";\r\n }\r\n\r\n //return time in hh:mm AM/PM\r\n return hour +\":\" + minute + \" \" + amPM;\r\n}", "function stringToTime(string) {\n \n var amPmFactor = 0; // An offset (either 0 or 12) to account for AM or PM in string\n \n // Implement the AM/PM Factor\n if (string.substring(string.indexOf('M') - 1, string.indexOf('M')) == 'P') {\n if (string.substring(0, 2) !== '12') {\n amPmFactor = 12;\n }\n } else {\n if (string.substring(0, 2) == '12') {\n amPmFactor = -12;\n }\n }\n \n var hours;\n var minutes;\n \n // Set the hours and minutes of the date\n if (string.substring(2, 3) !== ':') {\n hours = parseInt(string.substring(0, 1)) + amPmFactor;\n minutes = string.substring(2, 4);\n }\n else {\n hours = parseInt(string.substring(0, 2)) + amPmFactor;\n minutes = string.substring(3, 5);\n }\n \n return [hours, minutes];\n \n}", "function parse24hrDateString(time) {\n var int_time = parseInt(time);\n var hr = parseHour(int_time/100);\n return \" \" + hr + \":\" + (\"0\" + (int_time%100)).slice(-2) + ((int_time >= 1200) ? \" PM\" : \" AM\");\n}", "function tsToHHMM(timestamp) {\n const date = new Date(timestamp);\n return `${('0' + date.getHours()).slice(-2)}:${('0' + date.getMinutes()).slice(-2)}`;\n}", "function format_time(hour) {\n if (hour > 23) {\n hour -= 24;\n }\n let amPM = (hour > 11) ? \"pm\" : \"am\";\n if (hour > 12) {\n hour -= 12;\n }\n if (hour == 0) {\n hour = \"12\";\n }\n return hour + amPM;\n}", "function format_time(hour) {\n if (hour > 23) {\n hour -= 24;\n }\n let amPM = (hour > 11) ? \"pm\" : \"am\";\n if (hour > 12) {\n hour -= 12;\n }\n if (hour == 0) {\n hour = \"12\";\n }\n return hour + amPM;\n}", "function reformatTime(isoTime) {\n\t\tvar hours = parseInt(isoTime.substring(0, 2), 10),\n\t\t\tminutes = parseInt(isoTime.substring(3, 5), 10),\n\t\t\tampm = 'am';\n\n\t\tif (hours >= 12) {\n\t\t\tampm = 'pm';\n\t\t}\n\n\t\tif (hours > 12) {\n\t\t\thours -= 12;\n\t\t}\n\n\t\tif (minutes == 0)\n\t\t\tminutes = \"00\";\n\t\treturn hours + ':' + minutes + ' ' + ampm;\n\t}", "function formatTime(val) {\n var a = new Number(val.substring(0,val.indexOf(\":\")));\n if (a > 12) {\n a -= 12;\n }\n var b = val.substring(val.indexOf(\":\"),val.length);\n return a + b;\n}", "function to12Hrs(hour){\r\n\t\tif(hour === 0) return [12, \"am\"];\r\n\t\telse if(hour == 12) return [12, \"pm\"];\r\n\t\telse if(hour >= 1 && hour < 12) return [hour, \"am\"];\r\n\t\telse return [hour - 12, \"pm\"];\r\n\t}", "function convertTimeFormat(hours, minutes) {\n var AmOrPm = hours >= 12 ? 'pm' : 'am';\n hours = (hours % 12) || 12;\n return hours + ':' + minutes + ' ' + AmOrPm;\n}", "function getFormattedTime(fourDigitTime) {\n var hours24 = parseInt(fourDigitTime.substring(0, 2),10);\n var hours = ((hours24 + 11) % 12) + 1;\n var amPm = hours24 > 11 ? 'pm' : 'am';\n var minutes = fourDigitTime.substring(2);\n\n return hours + ':' + minutes + amPm;\n}", "function formatDateTime(inputStr) {\n var dateandTime = inputStr.split('T');\n var date = dateandTime[0].split('-');\n var time = dateandTime[1].split(':');\n return date[1] + \"/\" + date[2] + \"/\" + date[0] + \" \" + time[0] + \":\" + time[1];\n}", "function timestamp_24h_to_12h_abbr(timestamp)\n{\n\tvar time = get_time_from_timestamp(timestamp);\n\tvar hour = parseInt(time.substring(0, 2));\n\tvar meridian = (hour < 12) ? \"AM\" : \"PM\";\n\n\tif (hour == 0)\n\t{\n\t\thour = 12;\n\t}\n\tif (hour == 18)\n\t{\n\t\thour = 6;\n\t}\n\n\treturn hour.toString() + \" \" + meridian;\n}", "function formatTimeStamp() {\n var sendTime = Date().slice(16,21)\n var sendHour = sendTime.slice(0, 2)\n var pm = sendHour > 11 && sendHour < 24 ? true : false\n\n if (sendHour > 12) {\n sendHour = sendHour % 12\n }\n return sendHour + sendTime.slice(2) + (pm ? \" PM\" : \" AM\");\n}", "function Convert24HourTimeToAMPM(time)\n{\n\tvar ampmTime;\n\tvar Hours = time.getHours();\n\tvar minutes = time.getMinutes();\n\tvar ampm = \"AM\";\t\t\n\t\t\n\tif (Hours == 0) \n\t\tHours = 12;\n\telse\n\t{\t\t\t\t\t\n\t\tif (Hours > 11)\n\t\t\tampm = \"PM\";\n\t\t\n\t\tif (Hours > 12)\n\t\t\tHours -= 12;\n\t}\n\t\t\n\tHours = leadingZero(Hours);\n\tminutes = leadingZero(minutes);\n\t\t\n\tampmTime = Hours + \":\" + minutes + \" \" + ampm;\n\t\t\n\treturn ampmTime;\n}", "function parseTimeString(str){\n var colonDelim = str.search(':');\n var spaceDelim = str.search (' ');\n var hours = str.substring(0, colonDelim);\n var minutes = str.substring(colonDelim + 1, spaceDelim);\n var AmPm = str.substring(spaceDelim + 1);\n if(AmPm == 'PM') hours = parseInt(hours) + 12;\n if(minutes.charAt(0) == '0') minutes = minutes.substring(1);\n return parseInt(minutes*60) + parseInt(hours*3600);\n}", "function applyTimeFormat(time, timeFormatFlag) {\n if (time == \"\") return \"\";\n if (time.match(/^[Nn][+-]{0,1}\\d{0,}$/i) != null) return convertTime(time, \"h:m\");\n var h; var m;\n var tempTime = time.toLowerCase();\n switch (timeFormatFlag) {\n case \"12\":\n time = time.replace(/\\s/g, \"\");\n time = time.toLowerCase();\n var p = time.match(/[a]|[am]|[p]|[pm]/i);\n time = time.replace(/\\D/g, \"\");\n if (time.length == 3) {\n if (time.charCodeAt(0) == 48)\n time = \"0\" + time;\n }\n if (time.length < 3) {\n time = time + \"00\";\n }\n //========================================\n // do validate midnight\n //========================================\n var isMidnight = validateIsMidnight(time); \n if (!isMidnight) {\n var amValue = tempTime.match(/[a]|[am]/i);\n if (amValue != null)\n isMidnight = true;\n }\n if (isMidnight) {\n p = \"a\";\n }\n else {\n if (time.charCodeAt(0) == 49 && time.charCodeAt(1) == 50) {\n p = \"p\";\n }\n else {\n p = (p == null ? \"a\" : p);\n }\n }\n //========================================\n \n if (time.match(/^(\\d{1,2})(\\d{2})$/) && (RegExp.$1 < 13) && (RegExp.$2 < 60)) {\n var l = time.length;\n h = time.substr(0, l - 2) - 0; m = time.substr(l - 2, 2) - 0;\n return convertTime((h < 10 ? \"0\" + h : h) + \":\" + (m < 10 ? \"0\" + m : m) + p, \"h:m\");\n }\n if (time.match(/^(\\d{1,2})(\\d{2})$/) && (RegExp.$1 < 24) && (RegExp.$2 < 60)) {\n var l = time.length;\n h = time.substr(0, l - 2) - 0; m = time.substr(l - 2, 2) - 0;\n return convertTime((h < 10 ? \"0\" + h : h) + \":\" + (m < 10 ? \"0\" + m : m), \"h:m\");\n }\n return -1;\n break;\n case \"24\": \n var p = tempTime.match(/[a]|[am]|[p]|[pm]/i);\n //if user input is in am /pm format we go ahead and format it as 24 hours. \n if (p != null) {\n //we first validate the time as AM and PM\n var validTime = applyTimeFormat(tempTime, \"12\");\n //if time is valid in AM/PM we go ahead and convert it to 24 hours\n if (validTime != -1) {\n var tempDateTime = new Date(\"01/01/2008 \" + validTime);\n var hours = tempDateTime.getHours();\n var minutes = tempDateTime.getMinutes();\n //\n if (hours < 10)\n hours = \"0\" + hours;\n if (minutes < 10)\n minutes = \"0\" + minutes;\n //check for 12:00 AM\n var isAM = tempTime.substr(p.index, 1)\n if ((isAM == \"a\") && (hours == 12)) {\n hours = \"00\";\n }\n validTime = convertTime(hours + \":\" + minutes, \"h:m\");\n return validTime;\n }\n return validTime;\n }\n else {\n return validateAndFormat24HoursTimeInput(time);\n }\n break;\n default: return -1;\n }\n}", "function formatTime(time) {\n var hour = time.substr(0, 2);\n var minute = time.substr(3, 2);\n var ret;\n\n if (hour == 0) {\n ret = \"12:\" + minute + \"am\";\n }\n else if (hour == 12) {\n ret = hour + \":\" + minute + \"pm\";\n }\n else if (hour > 12) {\n hour -= 12;\n ret = hour + \":\" + minute + \"pm\";\n } else {\n ret = hour * 1 + \":\" + minute + \"am\";\n }\n if (hour < 10) {\n ret = \"&nbsp;\" + ret;\n }\n return ret;\n }", "function convert_timeto24Hour(TimeFormat){\n\tvar hrs = Number(TimeFormat.match(/^(\\d+)/)[1]);\n\tvar mnts = Number(TimeFormat.match(/:(\\d+)/)[1]);\n\tvar format = TimeFormat.match(/\\s(.*)$/)[1];\n\tif (format == \"PM\" && hrs < 12) hrs = hrs + 12;\n\tif (format == \"AM\" && hrs == 12) hrs = hrs - 12;\n\tvar hours = hrs.toString();\n\tvar minutes = mnts.toString();\n\tif (hrs < 10) hours = \"0\" + hours;\n\tif (mnts < 10) minutes = \"0\" + minutes;\n\tvar time_format = hours + \":\" + minutes;\n\treturn time_format;\n}", "function stringToTime(s) {\n var s1 = s.split(\":\");\n var s2 = s1[1].split(\" \");\n var t = {\n hours: s1[0],\n mins: s2[0],\n isAM: s2[1].toUpperCase() == \"AM\"\n };\n return t;\n }", "function convertHourToMilitaryTime(timePeriod, hour) {\n if (timePeriod == \"am\") {\n if (hour == \"12\") {\n return \"0\";\n }\n return hour;\n } else { // timePeriod == \"pm\"\n var intHour = parseInt(hour) + 12;\n return intHour.toString();\n }\n}", "function convertToTime(num) {\n\tvar hours = Math.floor(num);\n\tvar minutes = String(extractMinutes(num));\n\tif (minutes.length == 1) minutes = \"0\" + minutes;\n\nvar label = (hours >= 12) ? \"pm\" : \"am\";\n\tif (hours == 24) {\n\t\thours = 12; \n\t\tlabel=\"am\";\n\t}\n\telse if (hours == 0)\n\t\thours = 12;\n\telse if (hours > 12)\n\t\thours -= 12;\n\n\treturn hours + \":\" + minutes + label;\n}", "function toMilitaryTime(standardTime) {\n standardTime = standardTime.split(\" \");\n let timeOfDay = standardTime[1];\n let time = standardTime[0].split(\":\");\n // when it's 12:00:00 a.m. timer officially shows 24:00:00, otherwise it shows 00:00:01\n // when it's 12:00:00 p.m. -> we want to to keep it to show 12:00:00\n // normally it's gonna be 1:00:00 p.m. => 1+12 => 13:00:00\n // 11:30:00 p.m. => 23:30:00\n // 7:00:00 a.m. => 7:00:00\n\n if (timeOfDay === \"A.M.\" && time[0] === \"12\" && time[2][1] > \"0\") {\n\n return \"00\" + \":\" + time[1] + \":\" + time[2]\n\n } else if (timeOfDay === \"P.M.\" && time[0] !== \"12\") {\n\n return (parseInt(time[0]) + 12) + \":\" + time[1] + \":\" + time[2]\n\n } else if (timeOfDay === \"A.M.\" && time[0] === \"12\") {\n\n return (parseInt(time[0]) + 12) + \":\" + time[1] + \":\" + time[2]\n\n } else {\n\n return time.join(\":\")\n\n }\n}", "function formatTime(time) {\n let hour, apm\n if (time.hour < 12) {\n hour = \"\" + time.hour\n apm = \"am\"\n } else if (time.hour < 24) {\n if (time.hour == 12) hour = \"\" + time.hour\n else hour = \"\" + (time.hour - 12)\n apm = \"pm\"\n } else {\n // if hour >= 24, display it as on the next day\n hour = \"\" + (time.hour - 24)\n apm = \"am\"\n time.day = (time.day + 1) % 7\n }\n\n let minute = \"\" + time.minute\n if (time.minute < 10) minute = \"0\" + minute\n\n // let day\n // if (time.day == 0) day = \"Sun\"\n // else if (time.day == 1) day = \"Mon\"\n // else if (time.day == 2) day = \"Tue\"\n // else if (time.day == 3) day = \"Wed\"\n // else if (time.day == 4) day = \"Thu\"\n // else if (time.day == 5) day = \"Fri\"\n // else if (time.day == 6) day = \"Sat\"\n\n return hour + \":\" + minute + \" \" + apm\n}", "function timeConversion(s) {\n /*\n * Write your code here.\n */\n let newS =''\n let newTime = 12\n var newnewnewTime;\n let firstTwo= s.charAt(0);\n if (s.charAt(8) === 'P') {\n if (s.charAt(0) === '0') {\n newTime += parseInt(s.charAt(1))\n var newnewTime= newTime.toString();\n newS = s.slice(2, 8)\n newnewnewTime = newnewTime.concat('', newS)\n console.log(newnewnewTime)\n // s.replace(newTime.toString(), s.substring(0,2))\n } else if (s.charAt(0) === '1' && s.charAt(1) !=='2') {\n firstTwo.concat('', s.charAt(1))\n var newnewTime = firstTwo.concat('', s.charAt(1));\n newTime += parseInt(newnewTime);\n console.log(newTime);\n var newnewTime = newTime.toString();\n newS = s.slice(2, 8)\n newnewnewTime = newnewTime.concat('', newS)\n } else if (s.charAt(1) === '2') {\n newnewnewTime = s.slice(0,8)\n } \n }\n if (s.charAt(8) === 'A') {\n if (s.charAt(1) !== '2') {\n newnewnewTime = s.slice(0, 8)\n } else if (s.charAt(1) === '2') {\n newS = s.slice(2,8)\n newnewnewTime = '00'.concat('',newS)\n }\n }\n return newnewnewTime\n}", "function timeConverter(time)\n{\n\tif(time == 0 || time == 24)\n\t\treturn \"12:00a.m.\"\n\tif(time < 12)\t\n\t\treturn time + \":00a.m.\";\t\n\telse if(time == 12)\n\t\treturn time + \":00p.m.\";\n\telse if(time > 12 && time < 24)\n\t\treturn (time - 12) + \":00p.m.\";\n}", "timeFormatter (time) {\n var timeArr = time.split('T');\n var finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n return finalTime;\n }", "function timeTo12 (twentyfourTime){\n let twelveTime;\n if (twentyfourTime < 13) {\n twelveTime = twentyfourTime + \" AM\"\n }\n else {\n twelveTime = (twentyfourTime - 12) + \" PM\"\n }\n return twelveTime;\n}", "function twelve_hour_time(h){\n\n if(h > 12){\n h = h - 12;\n AM_or_PM = \" PM\";\n }\n return h;\n\n }", "function convertDate(time) {\n let date = new Date(time);\n let hours = date.getHours();\n let ampm;\n if (hours > 12) {\n if (hours === 12) ampm = \"pm\";\n else {\n ampm = \"pm\";\n hours -= 12;\n }\n } else ampm = \"am\";\n let minutes = \"0\" + date.getMinutes();\n return hours + \":\" + minutes.substr(-2) + ampm;\n}", "function formatTime(string) {\n return string.slice(0, 5);\n }", "formatTime(date) {\n let hours = date.getHours();\n let ampm = hours >= 12 ? 'PM' : 'AM';\n hours %= 12;\n hours = hours ? hours : 12; // the hour 0 should be 12\n\n return hours + ampm;\n }", "function formatAMPM(hours, minutes) {\n \n var ampm = hours >= 12 ? 'pm' : 'am';\n hours = hours % 12;\n hours = hours ? hours : 12; // the hour '0' should be '12'\n minutes = minutes < 10 ? '0'+minutes : minutes;\n var strTime = hours + ':' + minutes + ' ' + ampm;\n return strTime;\n}", "formatTime(d){\n let time = new Date(d.replace('Z', ''));\n let date = new Date(time);\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let ampm = hours >= 12 ? 'PM' : 'AM';\n hours = hours % 12;\n hours = hours ? hours: 12;\n minutes = minutes < 10 ? '0'+minutes : minutes;\n let formatedTime = `${hours}:${minutes} ${ampm}`\n\n return formatedTime;\n }" ]
[ "0.7604746", "0.7502571", "0.7458783", "0.74494475", "0.74114186", "0.7336281", "0.7317826", "0.73045397", "0.7218895", "0.71925", "0.7158564", "0.7154339", "0.7120323", "0.71182984", "0.7089649", "0.70373565", "0.7031415", "0.7009963", "0.70091", "0.7007204", "0.7006592", "0.69882154", "0.6974383", "0.69680214", "0.6960377", "0.6938513", "0.693582", "0.6931605", "0.69257545", "0.69239444", "0.6903308", "0.6883158", "0.68595713", "0.68506896", "0.68330324", "0.6786375", "0.6771917", "0.6747253", "0.67448163", "0.6731868", "0.67317706", "0.67272234", "0.6709805", "0.67093956", "0.6706523", "0.66889215", "0.6687808", "0.6663613", "0.6657304", "0.6656232", "0.659686", "0.6594804", "0.65766567", "0.6554958", "0.6553345", "0.6526123", "0.6516495", "0.65149003", "0.6511952", "0.6510422", "0.64975286", "0.6484312", "0.6478731", "0.64774555", "0.64736384", "0.64683145", "0.6468001", "0.643889", "0.6405667", "0.6401908", "0.6401389", "0.6401389", "0.64011145", "0.639875", "0.638941", "0.6387631", "0.6339253", "0.6338353", "0.63328606", "0.6330661", "0.63238055", "0.6323076", "0.62939024", "0.6281462", "0.62714183", "0.62661815", "0.6251388", "0.6249505", "0.6248074", "0.6240015", "0.62371767", "0.6237151", "0.62284", "0.62262845", "0.62126815", "0.621219", "0.62045836", "0.6203573", "0.61931556", "0.61902416" ]
0.7315751
7
varianta care NU merge ramane Aprins
function switch_() { var bulb = document.getElementById('bulb2'); if(bulb.src == "http://127.0.0.1:5500/Teme/Vlad/L13/Images/bulbon.png") { /* '.src' arenevoie de toata calea" */ bulb.src = "Images/bulboff.png"; } else { bulb.src = "Images/bulbon.png"; } console.log(bulb.src) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rimuovi(){\n\n\tvar j = 0;\n\n\t// Per ogni elemento controllo la condizione\n\t// Se è idoneo, copio elemento in J\n\n\tfor(var i = 0; i<persone.length; i++){\n\t\tif(persone[i].altezza > 1.5) {\n\t\t\tpersone[j++] = persone[i];\n\t\t}\n\t}\n\t// Aggiorno array con valori nuovi messi in J\n\tpersone.length = j;\n\n\t// Visualizzo\n\tvisualizzaPersone();\n}", "function sukeistiMasyvo2elementus(nr1, nr2) {\n var x = prekybosCentrai[nr1];\n prekybosCentrai[nr1] = prekybosCentrai[nr2];\n prekybosCentrai[nr2] = x;\n }", "function optimal_compos_golden(adr)//mam sklad 7, szukam czy ktos na lawce sie nadaje//szukanie lepszego perfo-nie roz problem\n{\n if(adr==1)\n {\n \ttea = team1;//z tempo odczyt, a do tempz zapisuje;\n }\n else \n {\n \ttea = team2;//z tempo odczyt, a do tempz zapisuje;\n }\n//console.log(changes);\n var all_lawka = [];\n var item1 = [];\n var item2 = [];\n var item3 = [];\n var item4 = [];\n for(var i=1;i<=6;i++)//mam gwaracje, że przejdzie przez każdego R na ławce, ale dalej zawsze wybierze najlepszego\n {\t\n tea[0]=Array(0,0,0,0,0,0,0,0,0,0,0,0);\n item1 = [];item2 = [];item3 = [];item4 = [];\n\t\t\tfor(var j=8;j<=12;j++)\n\t\t\t{\n\t\t\t //item = [];\n if(tea[j][4]==\"R\" && i == 1)// i = 1 - sprawdzam każdego z ławki konkretnie za R\n\t\t\t {\n\t\t\t \tif(tea[j][11] > (tea[i][11]+1))\n {\n nadwyzka = tea[j][11] - tea[i][11];nadwyzka = zaokr(nadwyzka); \n item1 = [j, i, nadwyzka];\n all_lawka.unshift(item1);// \n }\n\t\t\t }\n if(tea[j][4]==\"A\" && i == 4)// i = 4\t\n\t\t\t {\n\t\t\t \tif(tea[j][6] > (tea[i][6]+1))\n {\n nadwyzka = tea[j][6] - tea[i][6];nadwyzka = zaokr(nadwyzka);\n item2 = [j, i, nadwyzka];\n all_lawka.unshift(item2);// \n }\n\t\t\t }\n item3 =[];\n if(tea[j][4]==\"P\" && (i == 2 || i == 5))// i = 2; i =5;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][7])/2 > ((tea[i][6]+tea[i][7])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][7])/2 - ((tea[i][6]+tea[i][7])/2);nadwyzka = zaokr(nadwyzka);\n item3=[];\n item3 = [j, i, nadwyzka];\n test = all_lawka.unshift(item3);//\n //alert(\"test-length: \"+test+\" item: \"+item3);\n }\n\t\t\t }\n if(tea[j][4]==\"S\" && (i == 3 || i == 6))// i = 3; i =6;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][9])/2 > ((tea[i][6]+tea[i][9])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][9])/2 - ((tea[i][6]+tea[i][9])/2);nadwyzka = zaokr(nadwyzka);\n item4 = [j, i, nadwyzka];\n all_lawka.unshift(item4);// \n }\n\t\t\t }\n } //end of for j=8..12\n //console.log(all_lawka);\n }//end of for i=1..6\n //sortowanie\n for(u=0; u<all_lawka.length; u++)\n {\n for(w=1; w<all_lawka.length; w++)\n {\n if(all_lawka[w][2] > all_lawka[w-1][2])\n {\n temp = all_lawka[w-1];\n all_lawka[w-1] = all_lawka[w];\n all_lawka[w] = temp;\n }\n }\n }\n //próba wykoanania zmiany\n for(u=0; u<all_lawka.length; u++)\n {\n out_id = all_lawka[u][1];\n in_id = all_lawka[u][0];\n out_nr = tea[out_id][3]; //na indeksie 1 mam wyznaczonego do zejścia - nr dla funkcji possible_change\n in_nr = tea[in_id][3]; //\n if(adr == 1)\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen3\").innerHTML;\ndocument.getElementById(\"screen3\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info1\").innerHTML;\ndocument.getElementById(\"change_info1\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change1(out_id,in_id); flag_golden1 = 1; return 0;\n }\n }\n else\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen6\").innerHTML;\ndocument.getElementById(\"screen6\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info2\").innerHTML;\ndocument.getElementById(\"change_info2\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change2(out_id,in_id); flag_golden2 = 1; return 0;\n }\n }\n }\n\n\n if(adr==1)\n {\n team1 = tea;\n }\n else \n {\n team2 = tea;\n }\n\n banch_ins();\n return 1;\n}", "function main(entradas) {\n const linhas = entradas.trim().split(\"\\n\"); //separa as entradas por linha e converte em um ARRAY de STRINGS.\n let Vsize = 0, V = [], Csize = 0, C = [];\n let rproc = [];\n for (let i = 0; i < linhas.length; i++) {\n let linha_entrada;\n try {\n linha_entrada = eval(linhas[i]); //tenta converter a string pra inteiro ou array se falhar, cai no catch.\n } catch {\n linha_entrada = linhas[i]; //mantem como string porque o eval falhou em converter pra inteiro ou array.\n }\n if (!linha_entrada || linha_entrada !== \"\") {\n const resultado_processado = processarLinha(linha_entrada);\n if (resultado_processado) {\n rproc.push(resultado_processado);\n }\n }\n }\n\n \n Vsize = (rproc[0]);\n V = rproc[1].split(\" \");\n Csize = (rproc[2]);\n C = rproc[3].split(\" \");\n let Vi = [], Ci = [];\n for (let i = 0; i < V.length; i++) /// c 3\n {\n Vi.push((V[i]));\n }\n for (let i = 0; i < C.length; i++) /// c 3\n {\n Ci.push((C[i]));\n }\n //console.log(Vsize + \" \" + V + Csize+ C);\n\n //console.log(Ci);\n let nvS = Vi.sort(function (a, b) { return b - a });\n //console.log(\"nv=\" +nvS);\n let nV = [...new Set(nvS)];\n //console.log(\"nv=\" +V);\n let contador = 0, valorC = 0, valorV = 0;\n\n for (let i = 0; i < Ci.length; i++) /// c 3\n {\n contador = 1;\n valorC = Ci[i];\n //console.log(\"C \" +valorC);\n for (let j = 0; j < nV.length; j++) { /// nV 3 \n valorV = nV[j];\n if (valorV > valorC) {\n contador++;\n }\n }\n console.log(contador);\n }\n}", "function sukeistiMasayvoElementus(nr1, nr2) {\nlet y = prekiautojai[nr1];\nprekiautojai[nr1] = prekiautojai[nr2];\nprekiautojai[nr2] = y;\n\n}", "function pos_pianeticr(njd,np){\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) settembre 2010\n // termini di correzione per i pianeti Giove e Saturno.\n // np=numero identificativo del pianeta.\n\n var T=(njd-2415020.0)/36525;\n\n M=358.47583+35999.049750*T-0.000150*T*T-0.0000033*T*T*T; // Sole.\n\n M1=102.27938+149472.51529*T+0.000007*T*T; // Mercurio.\n M2=212.60322+ 58517.80387*T+0.001286*T*T; // Venere.\n M4=319.51913+ 19139.85475*T+0.000181*T*T; // Marte.\n M5=225.32833+ 3034.69202*T-0.000722*T*T; // Giove.\n M6=175.46622+ 1221.55147*T-0.000502*T*T; // Saturno.\n \n \n \n var Delta_LP=0; // termini correzione di lungo periodo.\n //var Delta_L=0; // correzione per la longitudine.\n var Delta_R=0; // correzione per il raggio vettore.\n\n var Delta_LL=0; // correzione per la longitudine.\n var Delta_P=0; // correzione per il perielio.\n var Delta_AS=0; // correzione semiasse maggiore.\n var Delta_EC=0; // correzione eccentricità.\n var Delta_MM=0; // correzione anomalia media.\n var Delta_LAT_ELIO=0; // correzione latitudine eliocentrica.\n \n\n// Correzioni per Mercurio - Perturbazioni in longitudine.\n// Da aggiungere dopo aver risolto l'E.Keplero\n\n if (np==0) {\n\n // longitudine\n\n Delta_LL=0.00204*Math.cos(Rad(5*M2-2*M1+12.220))\n +0.00103*Math.cos(Rad(2*M2-M1-160.6920))\n +0.00091*Math.cos(Rad(2*M5-M1-37.00300))\n +0.00078*Math.cos(Rad(5*M2-3*M1+10.137));\n\n // perturbazioni in raggio vettore\n\n Delta_R=0.000007525*Math.cos(Rad(2*M5-M1+53.013))\n +0.000006802*Math.cos(Rad(5*M2-3*M1-259.918))\n +0.000005457*Math.cos(Rad(2*M2-2*M1-71.188))\n +0.000003569*Math.cos(Rad(5*M2-M1-77.75));\n \n }\n\n// Correzioni per Venere -Perturbazioni in longitudine. \n// Delta_LP da aggiungere alla longitudine e anomalia media prima di aver risolto l'E.Keplero.\n// gli altri 2 termini dopo aver risolto l'E.Keplero.\n\nelse if(np==1) {\n\n // longitudine e anomalia media\n\n Delta_LP=0.00077*Math.sin(Rad(237.24+150.27*T));\n Delta_MM=Delta_LP;\n\n // longitudine\n\n Delta_LL=0.00313*Math.cos(Rad(2*M-2*M2-148.225))\n +0.00198*Math.cos(Rad(3*M-3*M2+2.565))\n +0.00136*Math.cos(Rad(M-M2-119.107))\n +0.00096*Math.cos(Rad(3*M-2*M2-135.912))\n +0.00082*Math.cos(Rad(M5-M2-208.087));\n\n // perturbazioni in raggio vettore\n\n Delta_R=0.000022501*Math.cos(Rad(2*M-2*M2-58.208))\n +0.000019045*Math.cos(Rad(3*M-3*M2+92.577))\n +0.000006887*Math.cos(Rad(M5-M2-118.090))\n +0.000005172*Math.cos(Rad(M-M2-29.110))\n +0.000003620*Math.cos(Rad(5*M-4*M2-104.208))\n +0.000003283*Math.cos(Rad(4*M-4*M2+63.513))\n +0.000003074*Math.cos(Rad(2*M5-2*M2-55.167));\n\n}\n\n// Correzioni per la Terra\n\nelse if (np==2) {\n\n Delta_LP=0;\n\n // correzioni ***************\n\n var A=153.23+22518.7541*T;\n var B=216.57+45037.5082*T;\n var C=312.69+32964.3577*T;\n var D=350.74+445267.1142*T-0.00144*T*T;\n var E=231.19+20.20*T;\n var H=353.40+65928.7155*T;\n\n // angoli in radianti.\n\n A=Rad(A); \n B=Rad(B); \n C=Rad(C); \n D=Rad(D); \n E=Rad(E); \n H=Rad(H); \n\n // correzione per la longitudine.\n\n var Delta_LL=0.00134*Math.cos(A)\n +0.00154*Math.cos(B)\n +0.00200*Math.cos(C)\n +0.00179*Math.sin(D)\n +0.00178*Math.sin(E);\n\n // correzioni per il raggio vettore.\n\n var Delta_R=0.00000543*Math.sin(A)\n +0.00001575*Math.sin(B)\n +0.00001627*Math.sin(C)\n +0.00003076*Math.cos(D) \n +0.00000927*Math.sin(H);\n \n}\n\n// correzioni per il pianeta Marte ******************************** INIZIO .\n// Delta_LP da aggiungere alla longitudine e anomalia media prima di aver risolto l'E.Keplero.\n// gli altri 2 termini dopo aver risolto l'E.Keplero.\n\n\nif (np==3) {\n\n // longitudine e anomalia media\n\nDelta_LP=-0.01133*Math.sin(Rad(3*M5-8*M4+4*M))\n -0.00933*Math.cos(Rad(3*M5-8*M4+4*M)); // termine lungo periodo.\nDelta_MM=Delta_LP;\n\n // longitudine\n\nDelta_LL=0.00705*Math.cos(Rad(M5-M4-48.958))\n +0.00607*Math.cos(Rad(2*M5-M4-118.350))\n +0.00445*Math.cos(Rad(2*M5-2*M4-191.897))\n +0.00388*Math.cos(Rad(M-2*M4+20.495))\n +0.00238*Math.cos(Rad(M-M4+35.097))\n +0.00204*Math.cos(Rad(2*M-3*M4+158.638))\n +0.00177*Math.cos(Rad(3*M4-M2-57.602))\n +0.00136*Math.cos(Rad(2*M-4*M4+154.093))\n +0.00104*Math.cos(Rad(M5+17.618));\n\n // raggio vettore\n\nDelta_R=0.000053227*Math.cos(Rad(M5-M4+41.1306))\n +0.000050989*Math.cos(Rad(2*M5-2*M4-101.9847))\n +0.000038278*Math.cos(Rad(2*M5-M4-98.3292))\n +0.000015996*Math.cos(Rad(M-M4-55.555))\n +0.000014764*Math.cos(Rad(2*M-3*M4+68.622))\n +0.000008966*Math.cos(Rad(M5-2*M4+43.615))\n +0.000007914*Math.cos(Rad(3*M5-2*M4-139.737))\n +0.000007004*Math.cos(Rad(2*M5-3*M4-102.888))\n +0.000006620*Math.cos(Rad(M-2*M4+113.202)) \n +0.000004930*Math.cos(Rad(3*M5-3*M4-76.243))\n +0.000004693*Math.cos(Rad(3*M-5*M4+190.603))\n +0.000004571*Math.cos(Rad(2*M-4*M4+244.702))\n +0.000004409*Math.cos(Rad(3*M5-M4-115.828));\n}\n\n// correzioni per il pianeta Marte ******************************** FINE.\n\n// correzioni per il pianeta Giove ******************************* INIZIO.\n// tutti i termini di Giove sono da aggiungere prima dell'equazione di Keplero\n\n\nif (np==4) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var V=5*Q-2*P;\n var W=2*P-6*Q+3*S;\n var Z=Q-P;\n\n // ************************* A\n // correzione per la longitudine media da aggiungere prima dell'equazione di Keplero\n // solo per la longitudine media.\n\n Delta_LL=(0.331364-0.010281*X-0.004692*X*X)*Math.sin(Rad(V)) \n +(0.003228-0.064436*X+0.002075*X*X)*Math.cos(Rad(V)) \n -(0.003083+0.000275*X-0.000489*X*X)*Math.sin(Rad(2*V))\n +0.002472*Math.sin(Rad(W))\n +0.013619*Math.sin(Rad(Z))\n +0.018472*Math.sin(Rad(2*Z))\n +0.006717*Math.sin(Rad(3*Z))\n +0.002775*Math.sin(Rad(4*Z))\n +(0.007275-0.001253*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +0.006417*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n +0.002439*Math.sin(Rad(3*Z))*Math.sin(Rad(Q)) \n -(0.033839+0.001125*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -0.003767*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -(0.035681+0.001208*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -0.004261*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n +0.002178*Math.cos(Rad(Q))\n +(-0.006333+0.001161*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -0.006675*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n -0.002664*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -0.002572*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n -0.003567*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.002094*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n +0.003342*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n // correzione per l'anomalia media -- più in fondo nel listato.\n\n // perturbazioni perielio da utilizzare per calcolare M. (vedi in fondo nel listato)\n\n Delta_P=(0.007192-0.003147*X)*Math.sin(Rad(V))\n +(-0.020428-0.000675*X+0.000197*X*X)*Math.cos(Rad(V))\n +(0.007269+0.000672*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.004344*Math.sin(Rad(Q))\n +0.034036*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.005614*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +0.002964*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n +0.037761*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +0.006158*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -0.006603*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -0.005356*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +0.002722*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.004483*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n -0.002642*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.004403*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n -0.002536*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +0.005547*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -0.002689*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n // correzione per l'anomalia media da aggiungere prima dell'equazione di Keplero\n\n var el_orb=orb_plan(njd,4); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità non corretta.\n\n Delta_MM=Delta_LL-(Delta_P/eccent);\n\n\n // semiasse maggiore da aggiungere prima dell'equazione di Keplero.\n\n Delta_AS=-263*Math.cos(Rad(V))\n +205*Math.cos(Rad(Z))\n +693*Math.cos(Rad(2*Z))\n +312*Math.cos(Rad(3*Z))\n +147*Math.cos(Rad(4*Z))\n +299*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +181*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +204*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n +111*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -337*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -111*Math.cos(Rad(2*Z))*Math.cos(Rad(Q));\n \n Delta_AS=Delta_AS/1000000;\n \n // eccentricità da aggiungere prima dell'equazione di Keplero\n\n Delta_EC=(3606+130*X-43*X*X)*Math.sin(Rad(V))\n +(1289-580*X)*Math.cos(Rad(V))\n -6764*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -1110*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -224*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -204*Math.sin(Rad(Q))\n +(1284+116*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +188*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +(1460+130*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +224*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -817*Math.cos(Rad(Q))\n +6074*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +992*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +508*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n +230*Math.cos(Rad(4*Z))*Math.cos(Rad(Q))\n +108*Math.cos(Rad(5*Z))*Math.cos(Rad(Q))\n -(956+73*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +448*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +137*Math.sin(Rad(3*Z))*Math.sin(Rad(2*Q))\n +(-997+108*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +480*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +148*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n +(-956+99*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +490*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +158*Math.sin(Rad(3*Z))*Math.cos(Rad(2*Q))\n +179*Math.cos(Rad(2*Q))\n +(1024+75*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -437*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n -132*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q));\n\n Delta_EC=Delta_EC/10000000;\n}\n\n// correzioni per il pianeta Giove ********************************* FINE.\n\n// correzioni per il pianeta Saturno ****************************** INIZIO.\n// tutti i termini di Saturno sono da aggiungere prima dell'equazione di Keplero\n// tranne il termine della latitudine eliocentrica\n\n\nif (np==5) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var V=5*Q-2*P;\n var W=2*P-6*Q+3*S;\n var Z=Q-P;\n var PS=S-Q;\n\n // perturbazioni in longitudine media\n\n Delta_LL=+(-0.814181+0.018150*X+0.016714*X*X)*Math.sin(Rad(V))\n +(-0.010497+0.160906*X-0.004100*X*X)*Math.cos(Rad(V))\n +0.007581*Math.sin(Rad(2*V))\n -0.007986*Math.sin(Rad(W))\n -0.148811*Math.sin(Rad(Z))\n -0.040786*Math.sin(Rad(2*Z))\n -0.015208*Math.sin(Rad(3*Z))\n -0.006339*Math.sin(Rad(4*Z))\n -0.006244*Math.sin(Rad(Q))\n +(0.008931+0.002728*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.016500*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -0.005775*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n +(0.081344+0.003206*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.015019*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +(0.085581+0.002494*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +(0.025328-0.003117*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.014394*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +0.006319*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n +0.006369*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +0.009156*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.007525*Math.sin(Rad(3*PS))*Math.sin(Rad(2*Q))\n -0.005236*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -0.007736*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n -0.007528*Math.cos(Rad(3*PS))*Math.cos(Rad(2*Q));\n\n // eccentricità\n\n Delta_EC=+(-7927+2548*X+91*X*X)*Math.sin(Rad(V))\n +(13381+1226*X-253*X*X)*Math.cos(Rad(V))\n +(248-121*X)*Math.sin(Rad(2*V))\n -(305+91*X)*Math.cos(Rad(2*V))\n +412*Math.sin(Rad(Z))\n +12415*Math.sin(Rad(Q))\n +(390-617*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +(165-204*X)*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n +26599*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -4687*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -1870*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n -821*Math.cos(Rad(4*Z))*Math.sin(Rad(Q))\n -377*Math.cos(Rad(5*Z))*Math.sin(Rad(Q))\n +497*Math.cos(Rad(2*PS))*Math.sin(Rad(Q))\n +(163-611*X)*Math.cos(Rad(Q))\n -12696*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -4200*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -1503*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -619*Math.sin(Rad(4*Z))*Math.cos(Rad(Q))\n -268*Math.sin(Rad(5*Z))*Math.cos(Rad(Q))\n -(282+1306*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +(-86+230*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +461*Math.sin(Rad(2*PS))*Math.cos(Rad(Q))\n -350*Math.sin(Rad(2*Q))\n +(2211-286*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q)) \n -2208*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n -568*Math.sin(Rad(3*Z))*Math.sin(Rad(2*Q))\n -346*Math.sin(Rad(4*Z))*Math.sin(Rad(2*Q))\n -(2780+222*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +(2022+263*X)*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +248*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n +242*Math.sin(Rad(3*PS))*Math.sin(Rad(2*Q))\n +467*Math.cos(Rad(3*PS))*Math.sin(Rad(2*Q))\n -490*Math.cos(Rad(2*Q))\n -(2842+279*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +(128+226*X)*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +224*Math.sin(Rad(3*Z))*Math.cos(Rad(2*Q))\n +(-1594+282*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n +(2162-207*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n +561*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q))\n +343*Math.cos(Rad(4*Z))*Math.cos(Rad(2*Q))\n +469*Math.sin(Rad(3*PS))*Math.cos(Rad(2*Q))\n -242*Math.cos(Rad(3*PS))*Math.cos(Rad(2*Q))\n -205*Math.sin(Rad(Z))*Math.sin(Rad(3*Q))\n +262*Math.sin(Rad(3*Z))*Math.sin(Rad(3*Q))\n +208*Math.cos(Rad(Z))*Math.cos(Rad(3*Q))\n -271*Math.cos(Rad(3*Z))*Math.cos(Rad(3*Q))\n -382*Math.cos(Rad(3*Z))*Math.sin(Rad(4*Q))\n -376*Math.sin(Rad(3*Z))*Math.cos(Rad(4*Q));\n\n Delta_EC=Delta_EC/10000000; \n\n // correzione del perielio\n\n Delta_P=+(0.077108+0.007186*X-0.001533*X*X)*Math.sin(Rad(V))\n +(0.045803-0.014766*X-0.000536*X*X)*Math.cos(Rad(V))\n -0.007075*Math.sin(Rad(Z))\n -0.075825*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.024839*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -0.008631*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -0.072586*Math.cos(Rad(Q))\n -0.150383*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.026897*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +0.010053*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -(0.013597+0.001719*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +(-0.007742+0.001517*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +(0.013586-0.001375*X)*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +(-0.013667+0.001239*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +0.011981*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +(0.014861+0.001136*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -(0.013064+0.001628*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n\n // correzione per l'anomalia media da aggiungere prima dell'equazione di Keplero\n\n var el_orb=orb_plan(njd,5); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LL-(Delta_P/eccent);\n\n\n// semiasse maggiore.\n\n Delta_AS=572*X*Math.sin(Rad(V))\n +2933*Math.cos(Rad(V))\n +33629*Math.cos(Rad(Z))\n -3081*Math.cos(Rad(2*Z))\n -1423*Math.cos(Rad(3*Z))\n -671*Math.cos(Rad(4*Z))\n -320*Math.cos(Rad(5*Z))\n +1098*Math.sin(Rad(Q))\n -2812*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +688*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -393*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -228*Math.sin(Rad(4*Z))*Math.sin(Rad(Q))\n +2138*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -999*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -642*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n -325*Math.cos(Rad(4*Z))*Math.sin(Rad(Q))\n -890*Math.cos(Rad(Q))\n +2206*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -1590*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -647*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -344*Math.sin(Rad(4*Z))*Math.cos(Rad(Q))\n +2885*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +(2172+102*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +296*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -267*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n -778*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +495*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +250*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n -856*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +441*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +296*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n +211*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q))\n -427*Math.sin(Rad(Z))*Math.sin(Rad(3*Q))\n +398*Math.sin(Rad(3*Z))*Math.sin(Rad(3*Q))\n +344*Math.cos(Rad(Z))*Math.cos(Rad(3*Q))\n -427*Math.cos(Rad(3*Z))*Math.cos(Rad(3*Q));\n \nDelta_AS=Delta_AS/1000000;\n\n\n\n// aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO= +0.000747*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.001069*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.002108*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.001261*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.001236*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n -0.002075*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q)); \n\n}\n\n// correzioni per il pianeta Saturno******************************** FINE.\n\n// correzioni per il pianeta Urano******************************** INIZIO.\n\nif (np==6) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var W=2*P-6*Q+3*S;\n var G=83.76922+218.4901*T;\n var H=2*G-S;\n var Z=S-P;\n var N=S-Q;\n var OM=G-S;\n \n // perturbazioni in longitudine media A\n\n Delta_LP=+(0.864319-0.001583*X)*Math.sin(Rad(H))\n +(0.082222-0.006833*X)*Math.cos(Rad(H))\n +0.036017*Math.sin(Rad(2*H))\n -0.003019*Math.cos(Rad(2*H))\n +0.008122*Math.sin(Rad(W));\n\n var B=0.120303*Math.sin(Rad(H))\n +(0.019472-0.000947*X)*Math.cos(Rad(H))\n +0.006197*Math.sin(Rad(2*H));\n\n // correzione per l'anomalia media di Urano\n\n var el_orb=orb_plan(njd,6); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LP-(B/eccent);\n\n // eccentricità\n\nDelta_EC=+(-3349+163*X)*Math.sin(Rad(H)) \n +20981*Math.cos(Rad(H))\n +1311*Math.cos(Rad(2*H));\n\nDelta_EC=Delta_EC/10000000;\n\n // correzione semiasse maggiore.\n\nDelta_AS=-0.003825*Math.cos(Rad(H));\n\n // correzione per la longitudine vera.\n\n Delta_LL=+(0.010122-0.000988*X)*Math.sin(Rad(S+N))\n +(-0.038581+0.002031*X-0.001910*X*X)*Math.cos(Rad(S+N))\n +(0.034964-0.001038*X+0.000868*X*X)*Math.cos(Rad(2*S+N))\n +0.005594*Math.sin(Rad(S+3*OM))\n -0.014808*Math.sin(Rad(Z))\n -0.005794*Math.sin(Rad(N))\n +0.002347*Math.cos(Rad(N))\n +0.009872*Math.sin(Rad(OM))\n +0.008803*Math.sin(Rad(2*OM))\n -0.004308*Math.sin(Rad(3*OM));\n\n// aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO=+(0.000458*Math.sin(Rad(N))-0.000642*Math.cos(Rad(N))-0.000517*Math.cos(Rad(4*OM)))*Math.sin(Rad(S))\n -(0.000347*Math.sin(Rad(N))+0.000853*Math.cos(Rad(N))+0.000517*Math.sin(Rad(4*N)))*Math.cos(Rad(S))\n +0.000403*(Math.cos(Rad(2*OM))*Math.sin(Rad(2*S))+Math.sin(Rad(2*OM))*Math.cos(Rad(2*S))); \n\n// correzione al raggio vettore.\n\nDelta_R=-25948+ (5795*Math.cos(Rad(S))-1165*Math.sin(Rad(S))+1388*Math.cos(Rad(2*S)))*Math.sin(Rad(N))\n +4985*Math.cos(Rad(Z))+(1351*Math.cos(Rad(S))+5702*Math.sin(Rad(S))+1388*Math.sin(Rad(2*S)))*Math.cos(Rad(N))\n -1230*Math.cos(Rad(S))+904*Math.cos(Rad(2*OM))\n +3354*Math.cos(Rad(N))+894*(Math.cos(Rad(OM))-Math.cos(Rad(3*OM)));\n\nDelta_R=Delta_R/1000000;\n \n \n\n}\n// correzioni per il pianeta Urano ************************************ FINE.\n\n// correzioni per il pianeta Nettuno ******************************** INIZIO.\n\nif (np==7) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var W=2*P-6*Q+3*S;\n var G=83.76922+218.4901*T;\n var H=2*G-S;\n var Z=G-P;\n var N=G-Q;\n var OM=G-S;\n \n // perturbazioni in longitudine media A\n\n Delta_LP=+(-0.589833+0.001089*X)*Math.sin(Rad(H))\n +(-0.056094+0.004658*X)*Math.cos(Rad(H)) \n -0.024286*Math.sin(Rad(2*H));\n\n var B=0.024039*Math.sin(Rad(H))\n -0.025303*Math.cos(Rad(H))\n +0.006206*Math.sin(Rad(2*H))\n -0.005992*Math.cos(Rad(2*H));\n\n// correzione per l'anomalia media di Urano\n\n var el_orb=orb_plan(njd,7); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LP-(B/eccent);\n\n // eccentricità\n\n Delta_EC=+4389*Math.sin(Rad(H))\n +4262*Math.cos(Rad(H))\n +1129*Math.sin(Rad(2*H))\n +1089*Math.cos(Rad(2*H));\n\n Delta_EC=Delta_EC/10000000;\n\n// correzione semiasse maggiore.\n\n Delta_AS=-817*Math.sin(Rad(H))+8189*Math.cos(Rad(H))+781*Math.cos(Rad(2*H));\n\n Delta_AS=Delta_AS/1000000;\n\n // correzione per la longitudine vera.\n\n Delta_LL=-0.009556*Math.sin(Rad(Z))\n -0.005178*Math.sin(Rad(N))\n +0.002572*Math.sin(Rad(2*OM))\n -0.002972*Math.cos(Rad(2*OM))*Math.sin(Rad(G))\n -0.002833*Math.sin(Rad(2*OM))*Math.cos(Rad(G));\n \n // aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO=+0.000336*Math.cos(Rad(2*OM))*Math.sin(Rad(G))\n +0.000364*Math.sin(Rad(2*OM))*Math.cos(Rad(G));\n\n // correzione al raggio vettore.\n\n Delta_R=-40596\n +4992*Math.cos(Rad(Z))\n +2744*Math.cos(Rad(N))\n +2044*Math.cos(Rad(OM))\n +1051*Math.cos(Rad(2*OM));\n\nDelta_R=Delta_R/1000000;\n \n\n}\n// correzioni per il pianeta Nettuno ******************************** FINE\n\n\n// variabili correzioni\n// lperiodo, rvett long. assemagg ecc M lat\n var correzioni=new Array(Delta_LP,Delta_R,Delta_LL,Delta_AS,Delta_EC,Delta_MM,Delta_LAT_ELIO);\n\n return correzioni;\n\n}", "_convert(equipo, asistencia){\n let equipoResult = []\n let persona = {} //molde\n let asistenciaConvert= this._asistenciaConvert(asistencia); \n let equipoConvert = this._equipoConvert(equipo);\n let dias = ['lunes', 'martes', 'miercoles', 'jueves', 'viernes', 'sabado', 'domingo']\n \n if(equipoConvert==null || equipoConvert.length==0){ //viene vacio\n if(asistenciaConvert==null || asistenciaConvert.length==0){ // viene vacia\n equipoResult = equipoResult; //ambos vienen vacios\n }else{\n equipoResult = asistenciaConvert; // pasamos las asistencias pero sin nombres \n }\n }else if(asistenciaConvert==null || asistenciaConvert.length==0){ // equipo no viene vacio pero si asistencias\n equipoResult = equipoConvert; // asignamos todos los colaboradores con 0 asistencias\n }else{\n let len_ec = equipoConvert.length;\n let len_ac = asistenciaConvert.length;\n\n if(len_ec >= len_ac){\n //juntar ambos comparando codigos\n for(var i =0; i<len_ec; i++){\n let codigoeq = equipoConvert[i].num;\n let encontrado ='no'\n for(var k =0; k<len_ac; k++){\n let codigoac = asistenciaConvert[k].num;\n if(codigoeq==codigoac){\n encontrado=k\n }\n }\n\n if(encontrado!='no'){ //encontro la asistencia del colaborador \n equipoConvert[i].asistencia = asistenciaConvert[encontrado].asistencia //asigno las asistencias \n equipoConvert[i].retardos = asistenciaConvert[encontrado].retardos\n equipoResult.push(equipoConvert[i]);\n }else{\n equipoResult.push(equipoConvert[i]);\n }\n\n }\n }else{\n //juntar ambos comparando codigos\n for(var i =0; i<len_ac; i++){\n let codigoac = asistenciaConvert[i].num;\n let encontrado ='no'\n for(var k =0; k<len_ec; k++){\n let codigoec = equipoConvert[k].num;\n if(codigoac==codigoec){\n encontrado=k\n }\n }\n\n if(encontrado!='no'){ //encontro la asistencia del colaborador \n equipoConvert[encontrado].asistencia = asistenciaConvert[i].asistencia //asigno las asistencias \n equipoConvert[encontrado].retardos = asistenciaConvert[i].retardos\n equipoResult.push(equipoConvert[encontrado]);\n }else{\n equipoResult.push(asistenciaConvert[i]);\n }\n\n }\n }\n\n }\n\n return equipoResult\n }", "function orb_plan(njd,np){\n\n // elementi orbitali dei pianeti per l'equinozio della data.\n\n\n var T=(njd-2415020.0)/36525;\n \n var L=new Array (); // Longitudine media dei pianeti.\n\n L[0]=178.179078+149474.07078*T+0.0003011*T*T; // Mercurio.\n L[1]=342.767053+58519.211910*T+0.0003097*T*T; // Venere.\n L[2]= 99.696680+36000.768920*T+0.0003025*T*T; // Terra.\n L[3]=293.737334+19141.695510*T+0.0003107*T*T; // Marte.\n L[4]=238.049257+3036.3019860*T+0.0003347*T*T-0.00000165*T*T*T; // Giove.\n L[5]=266.564377+1223.5098840*T+0.0003245*T*T-0.00000580*T*T*T; // Saturno.\n L[6]=244.197470+429.86354600*T+0.0003160*T*T-0.00000060*T*T*T; // Urano.\n L[7]= 84.457994+219.88591400*T+0.0003205*T*T-0.00000060*T*T*T; // Nettuno.\n L[8]= 93.48+144.96*T; // Plutone.\n\n\n\n var M=new Array (); // Anomalia media dei pianeti.\n\n M[0]=102.27938+149472.51529*T+0.000007*T*T; // Mercurio.\n M[1]=212.60322+ 58517.80387*T+0.001286*T*T; // Venere.\n M[2]=178.47583+35999.049750*T-0.000150*T*T-0.0000033*T*T*T; // Terra.\n M[3]=319.51913+ 19139.85475*T+0.000181*T*T; // Marte.\n M[4]=225.32829+ 3034.69202*T-0.000722*T*T; // Giove.\n M[5]=175.46616+ 1221.55147*T-0.000502*T*T; // Saturno.\n M[6]= 72.64878+ 428.37911*T+0.000079*T*T; // Urano.\n M[7]= 37.73063+ 218.46134*T-0.000070*T*T; // Nettuno.\n M[8]=0; // Plutone.\n\n\n var a= new Array( 0.3870986, 0.7233316, 0.999996, 1.523688300, 5.20256100, 9.5547470, 19.2181400, 30.1095700, 39.48168677); // \n var p= new Array(0.24085000, 0.6152100, 1.000040, 1.8808900, 11.8622400, 29.457710, 84.0124700, 164.7955800, 248.09);\n var m= new Array(0.000001918, 0.00001721, 0.0000000, 0.000004539, 0.000199400, 0.000174000, 0.00007768, 0.000075970, 0.000004073);\n var d= new Array( 6.74, 16.92, 0, 9.36, 196.74, 165.60, 65.80, 62.20, 3.20); \n \n var e= new Array(); // Eccentricità delle orbite planetarie.\n\n e[0]=0.20561421+0.00002046*T-0.000000030*T*T; // Mercurio. \n e[1]=0.00682069-0.00004774*T+0.000000091*T*T; // Venere.\n e[2]=0.01675104-0.00004180*T-0.000000126*T*T; // Terra. \n e[3]=0.09331290+0.000092064*T-0.000000077*T*T; // Marte. \n e[4]=0.04833475+0.000164180*T-0.0000004676*T*T-0.00000000170*T*T*T; // Giove.\n e[5]=0.05589232-0.000345500*T-0.0000007280*T*T+0.00000000074*T*T*T; // Saturno.\n e[6]=0.04634440-0.000026580*T+0.0000000770*T*T; // Urano.\n e[7]=0.00899704+0.000006330*T-0.0000000020*T*T; // Nettuno. \n e[8]=0.24880766; // Plutone. \n\n var i= new Array(); // Inclinazione dell'orbita\n\n i[0]=7.002881+0.0018608*T-0.0000183*T*T;\n i[1]=3.393631+0.0010058*T-0.0000010*T*T;\n i[2]=0;\n i[3]=1.850333-0.0006750*T+0.0000126*T*T;\n i[4]=1.308736-0.0056961*T+0.0000039*T*T;\n i[5]=2.492519-0.0039189*T-0.00001549*T*T+0.00000004*T*T*T;\n i[6]=0.772464+0.0006253*T+0.0000395*T*T;\n i[7]=1.779242-0.0095436*T-0.0000091*T*T;\n i[8]=17.14175;\n\n var ap= new Array(); // Argomento del perielio.\n\n ap[0]=28.753753+0.3702806*T+0.0001208*T*T; // Mercurio\n ap[1]=54.384186+0.5081861*T-0.0013864*T*T;\n ap[2]=gradi_360(L[2]-M[2]+180); // Terra\n ap[3]=285.431761+1.0697667*T+0.0001313*T*T+0.00000414*T*T*T;\n ap[4]=273.277558+0.5994317*T+0.00070405*T*T+0.00000508*T*T*T;\n ap[5]=338.307800+1.0852207*T+0.00097854*T*T+0.00000992*T*T*T;\n ap[6]=98.071581+0.9857650*T-0.0010745*T*T-0.00000061*T*T*T;\n ap[7]=276.045975+0.3256394*T+0.00014095*T*T+0.000004113*T*T*T;\n ap[8]=113.76329; // Plutone\n\n \n var nd= new Array(); // Longitudine del nodo.\n\n nd[0]=47.145944+1.1852083*T+0.0001739*T*T; // Mercurio. \n nd[1]=75.779647+0.8998500*T+0.0004100*T*T; // Venere.\n nd[2]=0; // Terra\n nd[3]=48.786442+0.7709917*T-0.0000014*T*T-0.00000533*T*T*T; // Marte.\n nd[4]=99.443414+1.0105300*T+0.00035222*T*T-0.00000851*T*T*T; // Giove.\n nd[5]=112.790414+0.8731951*T-0.00015218*T*T-0.00000531*T*T*T; // Saturno.\n nd[6]=73.477111+0.4986678*T+0.0013117*T*T; // Urano.\n nd[7]=130.681389+1.0989350*T+0.00024987*T*T-0.000004718*T*T*T; // Nettuno.\n nd[8]=110.30347; // Plutone.\n\n\n\n var Long_media=gradi_360(L[np]);\n var Anomalia_media=gradi_360(M[np]);\n var Semiasse=a[np];\n var Periodo=p[np];\n var Inclinazione=i[np];\n var Long_perielio=gradi_360(ap[np]+nd[np]);\n var Long_nodo=nd[np];\n var eccentr=e[np];\n var dim_ang=d[np];\n var magnitudine=m[np];\n\n if(np==8) {Anomalia_media=gradi_360(Long_media-ap[8]-nd[8]); }\n\n\n var elem_orb=new Array(Periodo , Long_media , Anomalia_media , Long_perielio , eccentr , Semiasse , Inclinazione , Long_nodo , dim_ang , magnitudine);\n\nreturn elem_orb;\n\n}", "function afase_luna(njd){\n\n // calcola l'angolo di fase della luna per la data (njd)\n // gennaio 2012\n\n var dati_luna=pos_luna(njd); // recupero fase/elongazione (1)\n var dati_sole=pos_sole(njd);\n\n var elongazione1=dati_luna[4]; // elongazione in gradi sessadecimali.\n var dist_luna=dati_luna[7]/149597870; \n var dist_sole=dati_sole[4]; // distanza del sole in UA.\n\n elongazione=Math.abs(elongazione1)*1;\n\n var dist_sl=dist_luna*dist_luna+dist_sole*dist_sole-2*dist_luna*dist_sole*Math.cos(Rad(elongazione)); // distanza sole-luna\n dist_sl=Math.sqrt(dist_sl);\n\n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_luna; // distanza pianeta-terra.\n var Dts= dist_sole; // distanza terra-sole.\n var Dps= dist_sl; // distanza pianeta-sole.\n\n // teorema del coseno\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-elongazione-delta_fase; // angolo di fase in gradi.\n\n if(elongazione1<0) {angolo_fase=-angolo_fase; }\n\n return angolo_fase;\n\n}", "getHRT4code (code) {\n const { phenomenonMapping } = this.props;\n const UNKNOWN = 'Unknown';\n if (!phenomenonMapping) {\n return UNKNOWN;\n }\n if (typeof code === 'undefined') {\n return UNKNOWN;\n }\n const codeFragments = code.split(SEPARATOR);\n if (codeFragments.length < 2) {\n return UNKNOWN;\n }\n let result = '';\n let variantIndex;\n let additionIndex;\n let effectiveMapping = cloneDeep(phenomenonMapping).filter((item) => code.startsWith(item.phenomenon.code));\n if (effectiveMapping.length === 1) {\n if (effectiveMapping[0].phenomenon.code === code) {\n effectiveMapping[0].variants = [];\n effectiveMapping[0].additions = [];\n }\n } else {\n effectiveMapping = cloneDeep(phenomenonMapping).map((item) => {\n if (item.variants.length > 0) {\n variantIndex = item.variants.findIndex((variant) => codeFragments[0].startsWith(variant.code));\n if (variantIndex > -1) {\n item.variants = [item.variants[variantIndex]];\n return item;\n }\n } else if (item.phenomenon.code.startsWith(codeFragments[0])) {\n return item;\n }\n }).filter((item) => typeof item !== 'undefined').filter((item) => {\n if (item.variants.length > 0) {\n return codeFragments[1].startsWith(item.phenomenon.code);\n } else {\n return true;\n }\n }).map((item) => {\n if (item.additions.length > 0) {\n additionIndex = item.additions.findIndex((addition) => codeFragments[1].endsWith(addition.code));\n if (additionIndex > -1) {\n item.additions = [item.additions[additionIndex]];\n return item;\n } else if (codeFragments.length > 2) {\n additionIndex = item.additions.findIndex((addition) => codeFragments[2].endsWith(addition.code));\n if (additionIndex > -1) {\n item.additions = [item.additions[additionIndex]];\n return item;\n }\n }\n }\n item.additions = [];\n return item;\n });\n }\n if (effectiveMapping.length === 1) {\n if (effectiveMapping[0].variants.length === 1) {\n result = effectiveMapping[0].variants[0].name + ' ' + effectiveMapping[0].phenomenon.name.toLowerCase();\n } else if (effectiveMapping[0].variants.length === 0) {\n result = effectiveMapping[0].phenomenon.name;\n } else {\n result = UNKNOWN;\n }\n if (effectiveMapping[0].additions.length === 1) {\n result += ' ' + effectiveMapping[0].additions[0].name;\n }\n return result;\n }\n return UNKNOWN;\n }", "function vU(a,b){this.Re=[];this.Uoa=a;this.Hna=b||null;this.jL=this.XD=!1;this.qs=void 0;this.z7=this.NPa=this.V6=!1;this.jV=0;this.Ld=null;this.a7=0}", "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "imprimirMayorAMenor() {\n\t\tthis.vehiculos.sort((v1, v2) => {\n\t\t\treturn v2.precio - v1.precio\n\t\t})\n\n\t\tconsole.log('Vehiculos ordenados de mayor a menor:')\n\n\t\tthis.vehiculos.forEach(vehiculo => {\n\t\t\tconsole.log(`${vehiculo.marca} ${vehiculo.modelo}`)\n\t\t});\n\t}", "function naikAngkot(arrPenumpang) {\n var rute = ['A', 'B', 'C', 'D', 'E', 'F'];\n var a = 0;\n var b = 0;\n var final = [];\n\n for (i = 0; i < arrPenumpang.length; i++) {\n for (k = 0; k < rute.length; k++) {\n if (rute[k] === arrPenumpang[i][1]) {\n a = k;\n // console.log(a);\n } else if (rute[k] === arrPenumpang[i][2]) {\n b = k;\n // console.log(b);\n }\n }\n final.push({\n penumpang: arrPenumpang[i][0],\n naikDari: arrPenumpang[i][1],\n tujuan: arrPenumpang[i][2],\n bayar: (b - a) * 2000\n });\n }\n return final;\n}", "modifVar(type, nb) {\n if (type === 'humeur') {\n if (this.humeur + (nb / this.difficulte) <= 100) this.humeur += nb / this.difficulte;\n else this.humeur = 100;\n }\n if (type === 'argent') this.argent += nb;\n if (type === 'environnement') {\n if (this.environnement + nb <= 100) this.environnement += nb;\n else this.environnement = 100;\n }\n if (type === 'debit' && this.debit + nb >= 0) {\n if (this.debit + (nb / this.difficulte) <= 100) this.debit += nb / this.difficulte;\n else this.debit = 100;\n }\n\n if (this.environnement <= 0) this.environnement = 0;\n if (this.humeur <= 0) this.humeur = 0;\n\n this.modifBarre();\n }", "function pos_luna(njd){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2010.\n // funzione per il calcolo della posizione della Luna.\n // njd= numero dei giorni giuliani per il T.U. di Greenwich.\n // coordinate equatoriali geocentriche per l'equinozio della data.\n\nvar T=(njd-2415020.0)/36525;\n\nvar L1=270.434164+481267.8831*T-0.001133*T*T+0.0000019*T*T*T; // longitudine media.\n\nvar M=358.475833+35999.04975*T-0.000150*T*T-0.0000033*T+T*T; // anomalia media del Sole\n\nvar M1=296.104608+477198.8491*T+0.009192*T*T+0.0000144*T*T*T; // anomalia media della Luna\n\nvar D=350.737486+445267.1142*T-0.001436*T*T+0.0000019*T*T*T; // elongazione media della Luna\n\nvar F=11.250889+483202.0251*T-0.003211*T*T-0.0000003*T*T*T; // distanza media della Luna dal suo nodo ascendente.\n\nvar N=259.183275-1934.1420*T+0.002078*T*T+0.0000022*T*T*T; // longitudine media del nodo ascendente della Luna.\n\n// termini additivi di correzione.\n\nvar Delta=0.003964*Math.sin(Rad(346.560+132.870*T-0.0091731*T*T));\n\nL1=L1+0.000233*Math.sin(Rad(51.2+20.2*T))+Delta;\n M= M-0.001778*Math.sin(Rad(51.2+20.2*T));\nM1=M1+0.000817*Math.sin(Rad(51.2+20.2*T))+Delta;\n D= D+0.002011*Math.sin(Rad(51.2+20.2*T))+Delta;\n\nL1=L1+0.001964*Math.sin(Rad(N));\nM1=M1+0.002541*Math.sin(Rad(N));\n D= D+0.001964*Math.sin(Rad(N));\n F= F-0.024691*Math.sin(Rad(N));\n F= F-0.004328*Math.sin(Rad(N+275.05-2.30*T));\n F= F+Delta;\n\nvar e=1-0.002495*T-0.00000752*T*T;\n\n// Calcola la Longitudine ecclittica.\n\nvar Long=L1+6.288750*Math.sin(Rad(M1))\n +1.274018*Math.sin(Rad(2*D-M1))\n +0.658309*Math.sin(Rad(2*D))\n +0.213616*Math.sin(Rad(2*M1))\n -0.185596*Math.sin(Rad(M))*e\n -0.114336*Math.sin(Rad(2*F))\n +0.058793*Math.sin(Rad(2*D-2*M1))\n +0.057212*Math.sin(Rad(2*D-M-M1))*e\n +0.053320*Math.sin(Rad(2*D+M1))\n +0.045874*Math.sin(Rad(2*D-M))*e\n +0.041024*Math.sin(Rad(M1-M))*e\n -0.034718*Math.sin(Rad(D))\n -0.030465*Math.sin(Rad(M+M1))*e\n +0.015326*Math.sin(Rad(2*D-2*F))\n -0.012528*Math.sin(Rad(2*F+M1))\n -0.010980*Math.sin(Rad(2*F-M1))\n +0.010674*Math.sin(Rad(4*D-M1))\n +0.010034*Math.sin(Rad(3*M1))\n +0.008548*Math.sin(Rad(4*D-2*M1))\n -0.007910*Math.sin(Rad(M-M1+2*D))*e\n -0.006783*Math.sin(Rad(2*D+M))*e\n +0.005162*Math.sin(Rad(M1-D))\n -0.005000*Math.sin(Rad(M+D))*e\n +0.004049*Math.sin(Rad(M1-M+2*D))*e\n +0.003996*Math.sin(Rad(2*M1+2*D))\n +0.003862*Math.sin(Rad(4*D))\n +0.003665*Math.sin(Rad(2*D-3*M1))\n +0.002695*Math.sin(Rad(2*M1-M))*e\n +0.002602*Math.sin(Rad(M1-2*F-2*D))\n +0.002396*Math.sin(Rad(2*D-M-2*M1))*e\n -0.002349*Math.sin(Rad(M1+D))\n +0.002249*Math.sin(Rad(2*D-2*M))*e*e\n -0.002125*Math.sin(Rad(2*M1+M))*e \n -0.002079*Math.sin(Rad(2*M))*e*e \n +0.002059*Math.sin(Rad(2*D-M1-2*M))*e*e\n -0.001773*Math.sin(Rad(M1+2*D-2*F))\n -0.001595*Math.sin(Rad(2*F+2*D))\n +0.001220*Math.sin(Rad(4*D-M-M1))*e\n -0.001110*Math.sin(Rad(2*M1+2*F))\n +0.000892*Math.sin(Rad(M1-3*D))\n -0.000811*Math.sin(Rad(M+M1+2*D))*e\n +0.000761*Math.sin(Rad(4*D-M-2*M1))*e\n +0.000717*Math.sin(Rad(M1-2*M))*e*e\n +0.000704*Math.sin(Rad(M1-2*M-2*D))*e*e\n +0.000693*Math.sin(Rad(M-2*M1+2*D))*e\n +0.000598*Math.sin(Rad(2*D-M-2*F))*e\n +0.000550*Math.sin(Rad(M1+4*D))\n +0.000538*Math.sin(Rad(4*M1))\n +0.000521*Math.sin(Rad(4*D-M))*e\n +0.000486*Math.sin(Rad(2*M1-D));\n \n// Calcolo della Latitudine ecclittica.\n\nvar Beta= 5.128189*Math.sin(Rad(F))\n +0.280606*Math.sin(Rad(M1+F))\n +0.277693*Math.sin(Rad(M1-F))\n +0.173238*Math.sin(Rad(2*D-F))\n +0.055413*Math.sin(Rad(2*D+F-M1))\n +0.046272*Math.sin(Rad(2*D-F-M1))\n +0.032573*Math.sin(Rad(2*D+F))\n +0.017198*Math.sin(Rad(2*M1+F))\n +0.009267*Math.sin(Rad(2*D+M1-F))\n +0.008823*Math.sin(Rad(2*M1-F))\n +0.008247*Math.sin(Rad(2*D-M-F))*e\n +0.004323*Math.sin(Rad(2*D-F-2*M1))\n +0.004200*Math.sin(Rad(2*D+F+M1))\n +0.003372*Math.sin(Rad(F-M-2*D))*e\n +0.002472*Math.sin(Rad(2*D+F-M-M1))*e\n +0.002222*Math.sin(Rad(2*D+F-M))*e\n +0.002072*Math.sin(Rad(2*D-F-M-M1))*e\n +0.001877*Math.sin(Rad(F-M+M1))*e\n +0.001828*Math.sin(Rad(4*D-F-M1))\n -0.001803*Math.sin(Rad(F+M))*e\n -0.001750*Math.sin(Rad(3*F))\n +0.001570*Math.sin(Rad(M1-M-F))*e\n -0.001487*Math.sin(Rad(F+D))\n -0.001481*Math.sin(Rad(F+M+M1))*e\n +0.001417*Math.sin(Rad(F-M-M1))*e\n +0.001350*Math.sin(Rad(F-M))*e\n +0.001330*Math.sin(Rad(F-D))\n +0.001106*Math.sin(Rad(F+3*M1))\n +0.001020*Math.sin(Rad(4*D-F))\n +0.000833*Math.sin(Rad(F+4*D-M1))\n +0.000781*Math.sin(Rad(M1-3*F))\n +0.000670*Math.sin(Rad(F+4*D-2*M1))\n +0.000606*Math.sin(Rad(2*D-3*F))\n +0.000597*Math.sin(Rad(2*D+2*M1-F))\n +0.000492*Math.sin(Rad(2*D+M1-M-F))*e\n +0.000450*Math.sin(Rad(2*M1-F-2*D))\n +0.000439*Math.sin(Rad(3*M1-F))\n +0.000423*Math.sin(Rad(F+2*D+2*M1))\n +0.000422*Math.sin(Rad(2*D-F-3*M1))\n -0.000367*Math.sin(Rad(M+F+2*D-M1))*e\n -0.000353*Math.sin(Rad(M+F+2*D))*e\n +0.000331*Math.sin(Rad(F+4*D))\n +0.000317*Math.sin(Rad(2*D+F-M+M1))*e\n +0.000306*Math.sin(Rad(2*D-2*M-F))*e*e\n -0.000283*Math.sin(Rad(M1+3*F));\n\n var omega1=0.0004664*Math.cos(Rad(N));\n var omega2=0.0000754*Math.cos(Rad(N+275.05-2.30));\n\n var Lat=Beta*(1-omega1-omega2); // latitudine ecclittica.\n\n // Calcolo della parallasse.\n\n var parallasse=0.950724\n +0.051818*Math.cos(Rad(M1))\n +0.009531*Math.cos(Rad(2*D-M1))\n +0.007843*Math.cos(Rad(2*D))\n +0.002824*Math.cos(Rad(2*M1))\n +0.000857*Math.cos(Rad(2*D+M1))\n +0.000533*Math.cos(Rad(2*D-M))*e\n +0.000401*Math.cos(Rad(2*D-M-M1))*e\n +0.000320*Math.cos(Rad(M1-M))*e\n -0.000271*Math.cos(Rad(D))\n -0.000264*Math.cos(Rad(M1+M))*e\n -0.000198*Math.cos(Rad(2*F-M1))\n +0.000173*Math.cos(Rad(3*M1))\n +0.000167*Math.cos(Rad(4*D-M1))\n -0.000111*Math.cos(Rad(M))*e\n +0.000103*Math.cos(Rad(4*D-2*M1))\n -0.000084*Math.cos(Rad(2*M1-2*D))\n -0.000083*Math.cos(Rad(2*D+M))*e\n +0.000079*Math.cos(Rad(2*D+2*M1))\n +0.000072*Math.cos(Rad(4*D))\n +0.000064*Math.cos(Rad(2*D-M+M1))*e\n -0.000063*Math.cos(Rad(2*D+M-M1))*e\n +0.000041*Math.cos(Rad(M+D))*e\n +0.000035*Math.cos(Rad(2*M1-M))*e\n -0.000033*Math.cos(Rad(3*M1-2*D))\n -0.000030*Math.cos(Rad(M1+D))\n -0.000029*Math.cos(Rad(2*F-2*D))\n -0.000029*Math.cos(Rad(2*M1+M))*e\n +0.000026*Math.cos(Rad(2*D-2*M))*e*e\n -0.000023*Math.cos(Rad(2*F-2*D+M1))\n +0.000019*Math.cos(Rad(4*D-M-M1))*e;\n\n Long=gradi_360(Long); // La longitudine all'interno dell'intervallo 0-360.\n\n var dati_luna=trasf_ecli_equa(njd,Long,Lat); // calcola le coordinate equatoriali geocentriche.\n\n // dati del Sole.\n\n var dat_sole=pos_sole(njd); // calcola la longitudine del sole\n var Long_sole=dat_sole[2]; // longitudine vera del sole.\n \n // CALCOLO DELLA FASE E DELL'ELONGAZIONE\n\n var Elongazione=elong(dati_luna[0],dati_luna[1],dat_sole[0],dat_sole[1]); // elongazione in gradi dal Sole.\n\n var Fase_luna=0.5*(1-Math.cos(Rad(Elongazione))); // FASE\n \n var dist_luna=6378.14/Math.sin(Rad(parallasse));\n dist_luna=dist_luna.toFixed(0); // Distanza in Km.\n\n var dim_app=Math.atan(3476.2/dist_luna); \n dim_app=Rda(dim_app)*3600;\n dim_app=dim_app.toFixed(2); // Diametro apparente in secondi d'arco.\n\n // elenco delle variabili restituite dalla funzione [pos_luna].\n\n // dati_luna[0]= ascensione retta già in ore decimali (diviso per 15).\n // dati_luna[1]= declinazione in gradi sessadecimali.\n dati_luna[2]= Long; // in gradi sessadecimali.\n dati_luna[3]= Fase_luna; // fase lunare.\n dati_luna[4]= Elongazione; // elongazione in gradi sessadecimali.\n dati_luna[5]= parallasse; // parallasse della Luna in gradi. \n dati_luna[6]= dim_app; // diametro apparente in secondi d'arco.\n dati_luna[7]= dist_luna; // distanza della Luna in Km. \n\n return dati_luna;\n\n}", "function comprimentoMedioPalavras(palavra1, palavra2){\n let comprimento1 = palavra1.length;\n let comprimento2 = palavra2.length;\n return (comprimento1 +comprimento2)/2\n\n}", "function intercambiar() {\n const aux = vaso1;\n vaso1 = vaso2;\n vaso2 = aux;\n}", "function minglemerge(Av,Ax,s,e,b){\n \n if(e-s>mergcach.length) mergcach=new Array(ntain((e-s)*3,0,Av.length))\n for(var h=0,j=s,ee=e-s;h<ee; ) mergcach[h++]=Ax[j++] \n \n var wrpos=e-1, clonx=e-s-1, hipt=s-1, bhipt=hipt, lep=1 \n\n ///skip to first insert \n while( (clonx>=0) && !compar( Av[Ax[hipt]],Av[mergcach[clonx]] ) ) // is not jdest\n { clonx--,wrpos-- } \n \n while(clonx>=0)// ix of copyel to place\n {\n bhipt=hipt\n \n while( (hipt>=b) && compar( Av[Ax[hipt]],Av[mergcach[clonx]] ) ) // is not jdest\n { hipt-- } \n \n for(var c=bhipt,d=c+wrpos-bhipt; c>hipt; ){\n Ax[d--]=Ax[c--] \n }\n \n wrpos-=(bhipt-hipt)\n Ax[wrpos]=mergcach[clonx]\n wrpos--,clonx--\n \n }//while\n\n return wrpos<b? s-wrpos+1 : s-wrpos //merge underflowed\n //returns ... dunnonow...\n }", "function toNeumeFromNeumeVariations(){\n pushedNeumeVariations = false;\n neumeVariations = new Array();\n \n isNeumeVariant = false;\n \n document.getElementById(\"input\").innerHTML = neumeForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n}", "nuevoCiclo() {\n let suma = 0;\n for (let i = 0; i < this.vecinos.length; i++) {\n if (this.vecinos[i].estado === 1) {\n suma++;\n }\n }\n\n // Aplicamos las normas\n this.estadoProx = this.estado; // Por defecto queda igual\n\n // Vida: tiene 3 vecinos\n if (this.estado === 0 && suma === 3) {\n this.estadoProx = 1;\n }\n\n // Muerte: menos de 2(soledad) o mas de 3 (inanicion)\n if (this.estado == 1 && (suma < 2 || suma > 3)) {\n this.estadoProx = 0;\n }\n }", "function entregaVariacion( _dom1, _va1, _va2, _va3, _va4 ){\n\t//valores para comparar\n\tvar moneda_valorActual \t= [_va1, _va2, _va3, _va4];//array valores anteriores\n\tvar moneda_valorDominante \t= _dom1;//array valores actuales\n\t//para output\n\tvar salida= \"\";//para el output de prueba, test\n\tvar devuelve;//almacena valor a devolver para ser usado\n\n\n\t// obtiene variacion (valor absoluto) entre monedas y la dominante \n\tfor(i=0; i<moneda_valorActual.length; i++){\n\t\t//moneda_variacionValor[i] = \tMath.abs(moneda_valorActual[i] - moneda_valorDominante[0]) ;\n\t\t//porcentaje. VP=[(a-b).100]/a \n//\t\tmoneda_variacionValor[i] = \tMath.abs(\t[ (moneda_valorDominante - moneda_valorActual[i]) *100 ] / moneda_valorDominante\t );\n\t\tmoneda_variacionValor[i] = \tMath.abs(\t[ (moneda_valorDominante - moneda_valorActual[i]) ] / moneda_valorDominante\t );\n\t\tporcentaje[i] = moneda_variacionValor[i] ;\n\n }//cierre for\n \n\n\t// compara monedas y entrega valor mas alto\n\tvar counter = 1;//parte en 1 pues debe comtarar1 con el anterior q es 0\n\tvar indexDelMasAlto\t= 0;//valor inicial del index \t\n\t//selecciona valor mas alto \n\tfor(counter; counter<moneda_variacionValor.length; counter++){\n\t\tif(moneda_variacionValor[indexDelMasAlto] < moneda_variacionValor[counter]) {\n\t\t\tindexDelMasAlto = counter;\n\t\t} \n\t\tdevuelve = indexDelMasAlto;\n\t}// cierre for\n\treturn devuelve;// devuelve valor mas alto\n}", "function ST_LUNA(njd,LON,LAT,ALT){\n\n // metodo iterativo per calcolare il sorgere e il tramontare della Luna\n // compresi gli azimut del sorgere e del tramontare.\n // nel calcolo si tiene conto della rifrazione, altitudine dell'osservatore e della parallasse lunare.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy). 10 Dicembre 2011.\n\n var p_astro=0; // posizione della Luna. \n var tempo_sorgere=0; // tempo del sorgere.\n var tempo_tramonto=0; // tempo del tramonto.\n var tempo_transito=0; // tempo transito.\n var azimut_sorgere=0; // azimut sorgere.\n var azimut_tramonto=0; // azimut tramonto.\n var st_astri_sl=0; //\n\n njd=jdHO(njd); // riporta il g.g. della data all'ora H0(zero) del giorno. \n\n var njd1=njd; // giorno giuliano corretto per il sorgere o per il tramonto.\n var raggio=0.25; // raggio apparente della Luna.\n\n // **** inizio delle 10 iterazioni previste per il calcolo del Sorgere della Luna.\n\n for (a=0; a<10; a++) {\n\n p_astro=pos_luna(njd1); // recupera l'AR la DE e il raggio apparente del Sole.\n raggio=p_astro[6]/3600/2; // raggio della Luna in gradi.\n p_app=pos_app_pa(njd1,p_astro[0],p_astro[1],p_astro[5],LAT,LON,ALT); \n\n st_astri_sl=ST_ASTRO_DATA(njd1,p_app[0],p_app[1],LON,LAT,ALT,raggio);\n\n tempo_sorgere=st_astri_sl[2]; // istante del sorgere.\n njd1=njd+tempo_sorgere/24;\n }\n\n azimut_sorgere=st_astri_sl[0]; // azimut del sorgere.\n \n \n // **** inizio delle 10 iterazioni previste per il calcolo del transito della Luna.\n\n for (a=0; a<10; a++) {\n\n p_astro=pos_luna(njd1);\n raggio=p_astro[6]/3600/2; // astro di riferimento: sole.\n p_app=pos_app_pa(njd1,p_astro[0],p_astro[1],p_astro[5],LAT,LON,ALT);\n \n st_astri_sl=ST_ASTRO_DATA(njd1,p_app[0],p_app[1],LON,LAT,ALT,raggio);\n\n tempo_transito=st_astri_sl[3]; // istante del transito.\n njd1=njd+tempo_transito/24;\n }\n \n // **** inizio delle 10 iterazioni previste per il calcolo del tramontare della Luna.\n\n for (a=0; a<10; a++) {\n\n p_astro=pos_luna(njd1);\n raggio=p_astro[6]/3600/2;\n p_app=pos_app_pa(njd1,p_astro[0],p_astro[1],p_astro[5],LAT,LON,ALT);\n \n st_astri_sl=ST_ASTRO_DATA(njd1,p_app[0],p_app[1],LON,LAT,ALT,raggio);\n\n tempo_tramonto=st_astri_sl[4]; // istante del tramonto.\n njd1=njd+tempo_tramonto/24;\n }\n \n azimut_tramonto=st_astri_sl[1]; // azimut del tramontare.\n\n//alert(st_astri_sl[5]);\n\nvar tempi_st= new Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto) ; \n// VARIABILI RESTITUITE 0 1 2 3 4\n\nreturn tempi_st;\n\n}", "compareDNA(pAequor) {\r\n let commonElement = 0;\r\n let commonBase = [];\r\n for(let i = 0; i < dna.length; i++) {\r\n if(this.dna[i] === pAequor.dna[i]){\r\n commonElement += 1;\r\n commonBase.push(this.dna[i]);\r\n }\r\n } \r\n // test:\r\n /* Print the specimen #1 dna and specimen #2 dna + all common base in an array. \r\n console.log(this.dna);\r\n console.log(pAequor.dna);\r\n console.log(commonBase)\r\n */\r\n console.log(`Specimen ${this.specimenNum} and specimen ${pAequor.specimenNum} have ${commonElement/15*100}% DNA in common.`)\r\n }", "function ordenarProductosPrecio(productos, orden){\n\n //creo una variable donde se van a cagar los productos por orden de precio\n\n //variable de menor a mayor\n let productosOrdenPrecioAsc = [];\n //variable de mayor a menor\n let productosOrdenPrecioDesc = [];\n\n //guardamos una copia del array de productos traidos del json\n\n let productosCopia = productos.slice();\n\n // creo una variable que va a ser un array con solo los precios de cada producto, la cargamos mediante un map\n \n let arrayProductosOrdenPrecio = productosCopia.map((producto) => {return producto.precio} );\n\n //ordeno el array con los precios\n \n let comparar = (a,b) => {return a - b};\n \n arrayProductosOrdenPrecio.sort(comparar);\n\n // recorro el array con los precios de los productos en orden\n\n for(precio of arrayProductosOrdenPrecio){\n \n //guardo el indice donde se encuentra el producto que coincide con el precio del array con precios ordenados\n\n let indice = productosCopia.findIndex( (productoCopia) => { if(productoCopia.precio==precio){ \n\n return productoCopia \n\n } } );\n\n //guardo en el array de productos por orden de precio que cree al principio de la funcion, el producto del array que coincida con el indice\n\n //mayor a menor\n productosOrdenPrecioDesc.unshift(productosCopia[indice]);\n //menor a mayor\n productosOrdenPrecioAsc.push(productosCopia[indice]);\n\n /*Luego de guardarlo, elimino ese producto del array copia ya que \n el metodo findIndex devuelve el indice del primer elemto que coincida y si hay productos con la misma fecha\n se va a guardar siempre el primero que encuentre (resumen: lo elimino para que no se guarden elementos repetidos)*/\n\n productosCopia.splice(indice,1);\n \n }\n\n //retornamos el nuevo array de productos ordenados por precio \n\n if(orden == \"asc\"){\n\n return productosOrdenPrecioAsc;\n\n }\n\n if(orden == \"des\"){\n\n return productosOrdenPrecioDesc;\n\n }\n\n if(orden != \"asc\" && orden != \"des\"){\n\n console.log(\"ingrese correctamente el parametro indicador del ordenamiento por precio\");\n\n }\n \n\n}", "function comprarColete(i){\n if(mochilaColete.length == 0){\n if(jogador1.grana < mercadoColetes[i].preco){\n console.log('Falta din!!!')\n }else{\n mochilaColete.push(mercadoColetes[i])\n \n jogador1.grana -= mercadoColetes[i].preco \n }\n }else{\n for(let j in mochilaColete){\n if(i == mochilaColete[j].id){\n console.log('Já tem este colete!')\n return\n }\n }\n if(jogador1.grana < mercadoColetes[i].preco){\n console.log('Falta din!!!')\n }else{\n mochilaColete.push(mercadoColetes[i])\n \n jogador1.grana -= mercadoColetes[i].preco \n }\n }\n console.log(mochilaColete)\n gravarLS('grana', jogador1.grana); \n mostraInfoJogador()\n}", "function cfasi_lunari(mese,anno,fase){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) Luglio 2010\n // funzione per il calcolo delle fasi lunari.\n // mese= numero del mese da 1 a 12.\n // anno=anno di riferimento.\n // k=0.00 per la luna nuova\n // k=0.25 per il primo quarto.\n // k=0.50 per la luna piena\n // k=0.75 per l'ultimo quarto.\n // fase= valore numerico per la fase 0 - 0.25 - 0.50 - 0.75 sono ammessi solo questi valori.\n \nvar anno_dec=anno+(mese/12);\nvar k=(anno_dec-1900)*12.3685; // calcolo della costante k. (parseInt) tronca la parte decimale\n k=parseInt(k)*1+fase*1;\n \nvar T=k/1236.85;\n\nvar fseno=166.56+132.87*T-0.009173*T*T;\n fseno=fseno/180*Math.PI;\n\nvar njd_fase =2415020.75933+29.53058868*k+0.0001178*T*T-0.000000155*T*T*T+0.00033*Math.sin(fseno);\n\n // calcolo anomalia media del sole.\n\nvar M=359.2242+29.10535608*k-0.0000333*T*T-0.00000347*T*T*T;\n M=gradi_360(M);\n M=M/180*Math.PI;\n\n // calcolo anomalia media della luna.\n\nvar M1=306.0253+385.81691806*k+0.0107306*T*T+0.00001236*T*T*T;\n M1=gradi_360(M1);\n M1=M1/180*Math.PI;\n\n // calcolo dell'argomento della latitudine della luna.\n\nvar F=21.2964+390.67050646*k-0.0016528*T*T-0.00000239*T*T*T;\n F=gradi_360(F);\n F=F/180*Math.PI;\n\n // calcolo correzioni per la luna nuova e piena.\n\nvar correzione1=0;\n\nif (fase==0 || fase==0.50) {\n \n correzione1= (0.1734-0.000393*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.4068*Math.sin(M1)\n +0.0161*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0104*Math.sin(2*F)\n -0.0051*Math.sin(M+M1)\n -0.0074*Math.sin(M-M1)\n +0.0004*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0010*Math.sin(2*F-M1)\n +0.0005*Math.sin(M+2*M1); \n}\n\nelse if (fase==0.25 || fase==0.75) {\n \n correzione1= (0.1721-0.0004*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.6280*Math.sin(M1)\n +0.0089*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0079*Math.sin(2*F)\n -0.0119*Math.sin(M+M1)\n -0.0047*Math.sin(M-M1)\n +0.0003*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0021*Math.sin(2*F-M1)\n +0.0003*Math.sin(M+2*M1)\n +0.0004*Math.sin(M-2*M1)\n -0.0003*Math.sin(2*M+M1); \n}\n\nelse {alert(\"Valore fase \"+fase+\" non valido!\");}\n\nvar njd_fase=njd_fase+correzione1; // per la luna nuova.\n\n // njd_fase= numero dei giorni giuliani.\nreturn njd_fase;\n\n}", "function vietuSukeitimas (i, j) {\n if (i >= 0 && j >= 0 && i !== j){\n var x = prekiautojai[i];\n prekiautojai[i] = prekiautojai[j];\n prekiautojai[j] = x;\n console.log(prekiautojai);\n } else {\n return \"Iveskite 0, teigiama reiksme ir skirtingas reiksmes\"\n }\n}", "function ordina(){\n\n\tfor (var i = 0; i<persone.length; i++){\n\t\tvar minimoFinOra = i; \n\n\t\tfor(var j=i+1; j<persone.length; j++){\n\n\t\t\tif(persone[j].altezza<persone[minimoFinOra].altezza){\n\n\t\t\t\tminimoFinOra = j;\n\t\t\t}\n\t\t}\n\t\t// Salvo il valore minimo\n\t\tvar tmp = persone[i];\n\t\tpersone[i] = persone[minimoFinOra];\n\t\tpersone[minimoFinOra] = tmp;\n\t}\n\t//Visualizzo\n\tvisualizzaPersone();\n}", "imprimirVehiculos() {\n\t\tthis.vehiculos.forEach(vehiculo => {\n\t\t\tif (vehiculo.puertas) {\n\t\t\t\tconsole.log(`Marca: ${vehiculo.marca} // Modelo: ${vehiculo.modelo} // Puertas: ${vehiculo.puertas} // Precio: $${this.formatearPrecio(vehiculo.precio)}`)\n\t\t\t}\n\t\t\tif (vehiculo.cilindrada) {\n\t\t\t\tconsole.log(`Marca: ${vehiculo.marca} // Modelo: ${vehiculo.modelo} // Cilindrada: ${vehiculo.cilindrada}cc // Precio: $${this.formatearPrecio(vehiculo.precio)}`)\n\t\t\t}\n\t\t});\n\t}", "function comportement (){\n\t }", "function naikAngkot(arrPenumpang) {\n rute = ['A', 'B', 'C', 'D', 'E', 'F'];\n //your code here\n if (arrPenumpang.length === 0) {\n \treturn '[]';\n }\n var daftarPenumpang = [];\n for (var i = 0; i < arrPenumpang.length; i++) {\n \tvar dataPenumpang = {};\n \tdataPenumpang.penumpang = arrPenumpang[i][0];\n \tdataPenumpang.naikDari = arrPenumpang[i][1];\n \tdataPenumpang.tujuan = arrPenumpang[i][2];\n \tdataPenumpang.bayar = (rute.indexOf(arrPenumpang[i][2])-rute.indexOf(arrPenumpang[i][1]))*2000;\n \tdaftarPenumpang.push(dataPenumpang);\n }\n return daftarPenumpang;\n}", "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma += \"Plasma \"+i.toString()+\": \";\n let total = this._injectores[i].get_plasma+this._injectores[i].get_extra_plasma;\n estado_plasma += total+\"mg/s \";\n }\n console.log(estado_plasma);\n\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i].get_danio_por<100){\n if (this._injectores[i].get_extra_plasma>0){\n console.log(\"Tiempo de vida: \"+this._injectores[i].tiempo_vuelo().toString()+\" minutos.\");\n } else {\n console.log(\"Tiempo de vida infinito!\");\n break;\n }\n }\n }\n } else {\n console.log(\"Unable to comply.\")\n console.log(\"Tiempo de vida 0 minutos.\")\n }\n } else {\n throw \"_potencia_disponible: NO DEFINIDA\";\n }\n }", "function union(nfa1, nfa2){\n var unionNFA=[];\n// console.log(\"nfa1: \");\n // console.log(nfa2);\n for(var i=0; i<nfa1.length; i++)\n {unionNFA.push(nfa1[i]);\n \n }\n for(var j=0; j<nfa2.length; j++)\n {unionNFA.push(nfa2[j]);\n } \n \n return unionNFA;\n \n}", "function getTotalMercs() {\r\n return Number(rmCommas(obj('trainedSaMercs').innerHTML))+Number(rmCommas(obj('trainedDaMercs').innerHTML))+Number(rmCommas(obj('trainedUntMercs').innerHTML));\r\n }", "function mostraMercadoArmas(){\n let j = 0\n //let btn = criaElementos('button', 'Comprar',$tabelaMercado)\n $tabelaMercado.innerHTML = '';\n mercadoArmas.forEach((ma)=>{\n let b = ma.bonusArma//ma.forca + (jogador1.powerRS * (ma.pBonus));\n b = b.toFixed(0);\n\n criaTabela($tabelaMercado, ma.nome,\n `${ma.forca}+${jogador1.powerRS}*${ma.pBonus*100}% = ${b} Bônus`,\n ma.precoTxt,\n `<button onclick=\"compraArma(${j})\">Compar</button>`);\n j++;\n })\n}", "getResultatCodificat(){ // SI EL MÈTODE NO PASSA ALGUN VALOR, SE LI POSSA this. MÉS EL ATRIBUT CORRESPONENT.\n this.eliminarEspaisBlanc();\n this.senseAccent();\n for (var i = 0; i < this._entrada.length; i++){\n\n // IGUALEM LA LLARGADA DE LA CLAU A LA DE L'ENTRADA\n var y = 0;\n var max_lenght = this._entrada.length;\n while (this._entrada.length != this._clau.length){\n\n this._clau = this._clau + this._clau[y];\n\n if(y >= max_lenght){\n\n y = 0;\n }\n else{\n\n y++;\n }\n }\n\n // BUSQUEM ON ESTAN SITUATS TANT LA LLETRA DE L'ENTRADA COM DE LA CLAU\n var posicio_lletra_entrada = this._alfabet.indexOf(this._entrada[i]);\n var posicio_lletra_clau = this._alfabet.indexOf(this._clau[i]);\n\n // SUMEM LES DUES POSICIONS\n var suma_posicions = posicio_lletra_entrada + posicio_lletra_clau;\n\n // ANEM RESTANT MENTRE QUE EL MOD SIGUI MÉS GRAN QUE EL LENGTH DEL ABECEDARI\n while (suma_posicions >= this._alfabet.length){\n\n suma_posicions = suma_posicions - this._alfabet.length;\n }\n \n // ARA BUSQUEM LA LLETRA AMB LA QUAL SUBSTITUIREM L'ENTRADA\n this._resultat = this._resultat + this._alfabet[suma_posicions];\n }\n\n // RETORNEM EL RESULTAT\n return (document.form.sortida.value = this._resultat);\n }", "function pos_app(njd,AR,DE){\n\n // calcola la posizione apparente di un astro -nutazione e aberrazione della luce\n \n var T=(njd-2415020.0)/36525;\n\n var obli_eclittica=23.452294-0.0130125*T-0.00000164*T*T+0.000000503*T*T*T;\n obli_eclittica=Rad(obli_eclittica); \n\n var nutaz=nutazione(njd);\n\n // effetto dovuto alla nutazione.\n\n var Delta_ar=(Math.cos(obli_eclittica)+Math.sin(obli_eclittica)*Math.sin(Rad(AR*15))*Math.tan(Rad(DE)))*nutaz[0]-(Math.cos(Rad(AR*15))*Math.tan(Rad(DE)))*nutaz[1];\n var Delta_de=(Math.sin(obli_eclittica)*Math.cos(Rad(AR*15)))*nutaz[0]+Math.sin(Rad(AR*15))*nutaz[1];\n\n // effetto dovuto all'aberrazione annua.\n\n var PSOLE=pos_sole(njd); // calcola la longitudine del Sole.\n var LSOLE=PSOLE[2]; // longitudine del Sole.\n\n var Delta_ar1=-20.49*(Math.cos(Rad(AR*15))*Math.cos(Rad(LSOLE))*Math.cos(obli_eclittica)+Math.sin(Rad(AR*15))*Math.sin(Rad(LSOLE)))/Math.cos(Rad(DE));\n var Delta_de1=-20.49*(Math.cos(Rad(LSOLE))*Math.cos(obli_eclittica)*(Math.tan(obli_eclittica)*Math.cos(Rad(DE))-Math.sin(Rad(AR*15))*Math.sin(Rad(DE)))+Math.cos(Rad(AR*15))*Math.sin(Rad(LSOLE))*Math.sin(Rad(DE)));\n\n // correzione coordinate equatoriali.\n\n var AR_C=AR+((Delta_ar+Delta_ar1)/15)/3600;\n var DE_C=DE+(Delta_de+Delta_de1)/3600;\n\n var RID_COORD=new Array(AR_C,DE_C); //coordinate equatoriali ridotte. \n\nreturn RID_COORD;\n\n}", "function cruzamiento(poblacion,seleccion,ciudades,elite)\n\t\t\t{\n\t\t\t\tvar numPobla = poblacion.length;\n\t\t\t\tvar indice1,indice2;\n\t\t\t\tvar k = 0;\n\t\t\t\tvar new_poblation = new Array();\n\t\t\t\t/*Genero nueva poblacion*/\n\t\t\t\twhile(k < parseInt(numPobla / 2))\n\t\t\t\t{\n\t\t\t\t\t//Escogo el metodo de seleccion para tener dos PADRES\n\t\t\t\t\tswitch(seleccion)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Torneo\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t\tindice2 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Ranking\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Aleatorio\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t\tindice2 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//console.log(indice1);\n\t\t\t\t\t//console.log(indice2);\n\t\t\t\t\t/*Padres*/\n\t\t\t\t\tvar dad = poblacion[indice1].recorrido; \n\t\t\t\t\tvar mom = poblacion[indice2].recorrido;\n\t\t\t\t\t/*Camino para Hijos*/\n\t\t\t\t\tvar camino1 = new Array();\n\t\t\t\t\tvar camino2 = new Array();\n\t\t\t\t\t/*Numero entre 0 y numero de ciudades menos 1*/\n\t\t\t\t\tbp = parseInt( Math.random() * ciudades ); /*Punto de roptura*/\n\n\t\t\t\t/*-----------Genero 2 nuevos caminos-----------*/\n\t\t\t\t\t//Respaldo caminos de papa y mama hasta bp\n\t\t\t\t\tfor(var i = 0; i < bp; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcamino1.push(dad[i]);\n\t\t\t\t\t\tcamino2.push(mom[i]);\n\t\t\t\t\t}\n\t\t\t\t\tfor(var i = 0; i < ciudades; i++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//Tomo el elemento a buscar en el segundo vector\n\t\t\t\t\t\tvar busca1 = mom[i];\n\t\t\t\t\t\tvar busca2 = dad[i];\n\t\t\t\t\t\tfor(var j = bp; j < ciudades; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(busca1 == dad[j])\n\t\t\t\t\t\t\t\tcamino1.push(busca1);\n\t\t\t\t\t\t\tif(busca2 == mom[j])\n\t\t\t\t\t\t\t\tcamino2.push(busca2); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*Hijos generados*/\n\t\t\t\t\tvar hijo1 = {recorrido: camino1, distancia: aptitud(camino1,region)}\n\t\t\t\t\tvar hijo2 = {recorrido: camino2,distancia : aptitud(camino2,region)}\n\n\t\t\t\t\tnew_poblation.push(hijo1);\n\t\t\t\t\tnew_poblation.push(hijo2);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\treturn new_poblation;\n\t\t\t}", "static isMergeNeeded(searchBPList,assMoreList){\n\n let searchBPNumberList = [];\n let matchedBPList = [];\n try{\n searchBPList.forEach(mng => {\n if(mng.bpNumber != \"NO_MGMT\")searchBPNumberList.push(mng.bpNumber)\n mng.regionList.forEach(rgn => {\n if(rgn.bpNumber != \"NO_REGN\")searchBPNumberList.push(rgn.bpNumber)\n rgn.propertyList.forEach(prop => {\n if(rgn.bpNumber != \"NO_PROP\")searchBPNumberList.push(prop.bpNumber)\n })\n })\n })\n assMoreList.forEach(mng => {if(CommonUtil.isArrayContains(searchBPNumberList,mng.bpNumber)) matchedBPList.push(mng.bpNumber)\n mng.regionList.forEach(rgn => {if(CommonUtil.isArrayContains(searchBPNumberList,rgn.bpNumber)) matchedBPList.push(rgn.bpNumber)\n rgn.propertyList.forEach(prop => {if(CommonUtil.isArrayContains(searchBPNumberList,prop.bpNumber)) matchedBPList.push(prop.bpNumber)\n })\n })\n })\n }catch(err){\n //console.log('ERROR=====isMergeNeeded===>'+err.message)\n }\n return matchedBPList.length > 0\n }", "function mediavotesparty(republicans, democrats,independents){\n \n \n for (i = 0; i < republicans.length; i++){\n app.pctRepublicans =+ app.pctRepublicans + republicans[i].votes_with_party_pct;\n }\n app.pctRepublicans = (app.pctRepublicans/republicans.length).toFixed(2);\n \n for (i = 0; i < democrats.length; i++){\n app.pctDemocrats =+ app.pctDemocrats + democrats[i].votes_with_party_pct;\n } \n app.pctDemocrats = (app.pctDemocrats/democrats.length).toFixed(2);\n \n for (i = 0; i < independents.length; i++){\n app.pctIndependent=+ app.pctIndependent + independents[i].votes_with_party_pct;\n } \n app.pctIndependent = (app.pctIndependent/independents.length).toFixed(2); \n if(independents == 0){\n app.totalparty = 2;\n app.pctIndependent =0;\n \n }else{\n app.totalparty=3;\n \n }\n\n app.pctTotal = (parseFloat(app.pctRepublicans)+parseFloat(app.pctDemocrats)+parseFloat(app.pctIndependent))/parseFloat(app.totalparty);\n \n // rows_at_sen_glance(republicans,democrats,independents,pctRepublicans,pctDemocrats,pctIndependent,pctTotal); \n \n }", "merge() {\r\n }", "function municoesAndam(){\n\tif(jogoEmAndamento==true){\n\t\tmunicoes.forEach(andarMunicao);\n\t}\n}", "function desarrolloMercado(desMercado,costoDesProd) {//se van sumando los desarrolloMercado de cada producto, e.i, su precio de desarrollo\n var nvoDesMercado = desMercado + costoDesProd;\n return nvoDesMercado\n}", "function ST_SOLE_LUNA(njd,tempo_rif,astro,longitudine,latitudine,altitudine,raggio){\n // metodo iterativo per calcolare il sorgere e il tramontare del sole e della luna.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy). Giugno 2010.\n // il parametro astro assume i valori \"L\" e \"S\", rispettivamente luna e sole.\n // tempo_rif = \"TL\" tempo medio locale \"TU\" tempo universale.\n\n var tempo_rifst=0; // tempo di riferimento per il sorgere e il tramonto.\n // \nif (tempo_rif==\"TL\") { tempo_rifst=-fuso_loc(); } // riferimento al tempo locale.\nelse if (tempo_rif==\"TU\") { tempo_rifst=0 ;} // il riferimento rimane il TU\n \n\n // var njd=calcola_jdUT0(); // il numero del giorno giuliano di oggi alle ore 0(zero) del T.U.\n\n var p_astro=0; // posizione del sole o della luna.\n var tempo_sorgere=0; // tempo del sorgere.\n var tempo_tramonto=0; // tempo del tramonto.\n var tempo_transito=0; // tempo transito.\n var azimut_sorgere=0; // azimut sorgere.\n var azimut_tramonto=0; // azimut tramonto. \n var st_astri_sl=0; //\n var njd1=njd*1; // giorno giuliano corretto per il sorgere o per il tramonto.\n var ce_par=0; // coordinate correte per la parallasse\n\n var verifica1=0;\n var verifica2=0;\n\n // inizio delle 4 iterazioni previste per il calcolo del sorgere di un astro.\n\n // ST_ASTRO_DATA Array(AZSC,AZTC,TMGS,TMGTR,TMGT) \n // 0 1 2 3 4 \n \n\n for (a=0; a<8; a++) {\n\nif (astro==\"L\") { p_astro=pos_luna(njd1); ce_par=cor_parall(njd1,p_astro[0],p_astro[1],1.019,latitudine,longitudine,altitudine); p_astro[0]=ce_par[0]; p_astro[1]=ce_par[1]; } // astro di riferimento: luna.\nelse if (astro==\"S\") { p_astro=pos_sole(njd1); } // astro di riferimento: sole. \n \n st_astri_sl=ST_ASTRO_DATA(njd1,p_astro[0],p_astro[1],longitudine,latitudine,altitudine,raggio);\n tempo_sorgere=st_astri_sl[2]+tempo_rifst; // tempo del sorgere.\n tempo_sorgere=ore_24(tempo_sorgere);\n\n if (tempo_sorgere>22){verifica1=22;}\n if (verifica1==22 && tempo_sorgere<22){verifica2=22;}\n if (verifica1==22 && verifica2==22 ){njd1=njd; tempo_sorgere=0;}\n else {njd1=njd*1+tempo_sorgere/24; }\n \n }\n\n azimut_sorgere=st_astri_sl[0].toFixed(1); // azimut del sorgere di un astro.\n njd1=njd; verifica1=0; verifica2=0;\n\n // inizio delle 4 iterazioni previste per il calcolo del transito di un astro.\n\n for (a=0; a<8; a++) {\n\nif (astro==\"L\") { p_astro=pos_luna(njd1); ce_par=cor_parall(njd1,p_astro[0],p_astro[1],1.019,latitudine,longitudine,altitudine); p_astro[0]=ce_par[0]; p_astro[1]=ce_par[1]; } // astro di riferimento: luna.\nelse if (astro==\"S\") { p_astro=pos_sole(njd1); } // astro di riferimento: sole. \n\n st_astri_sl=ST_ASTRO_DATA(njd1,p_astro[0],p_astro[1],longitudine,latitudine,altitudine,raggio);\n tempo_transito=st_astri_sl[3]+tempo_rifst;\n tempo_transito=ore_24(tempo_transito);\n // tempo del transito.\n if (tempo_transito>22){verifica1=22;}\n if (verifica1==22 && tempo_transito<22){verifica2=22;}\n if (verifica1==22 && verifica2==22 ){njd1=njd; tempo_transito=0;}\n else {njd1=njd*1+tempo_transito/24; }\n \n }\n \n njd1=njd; verifica1=0; verifica2=0;\n\n // inizio delle 4 iterazioni previste per il calcolo del tramontare di un astro.\n\n for (a=0; a<8; a++) {\n\nif (astro==\"L\") { p_astro=pos_luna(njd1); ce_par=cor_parall(njd1,p_astro[0],p_astro[1],1.019,latitudine,longitudine,altitudine); p_astro[0]=ce_par[0]; p_astro[1]=ce_par[1]; } // astro di riferimento: luna.\nelse if (astro==\"S\") { p_astro=pos_sole(njd1); } // astro di riferimento: sole. \n\n st_astri_sl=ST_ASTRO_DATA(njd1,p_astro[0],p_astro[1],longitudine,latitudine,altitudine,raggio);\n tempo_tramonto=st_astri_sl[4]+tempo_rifst; // tempo del tramonto\n tempo_tramonto=ore_24(tempo_tramonto);\n \n if (tempo_tramonto>22){verifica1=22;}\n if (verifica1==22 && tempo_tramonto<22){verifica2=22;}\n if (verifica1==22 && verifica2==22 ){njd1=njd; tempo_tramonto=0;}\n else {njd1=njd*1+tempo_tramonto/24; }\n \n }\n \n azimut_tramonto=st_astri_sl[1].toFixed(1); // azimut del tramontare di un astro.\n njd1=njd; verifica1=0; verifica2=0;\n \n if (tempo_sorgere>0) {tempo_sorgere= sc_ore_hm(tempo_sorgere);}\nelse if (tempo_sorgere==0){tempo_sorgere=\"\"; }\n\n if (tempo_transito>0){tempo_transito= sc_ore_hm(tempo_transito);}\nelse if (tempo_transito==0){tempo_transito=\"\"; }\n\n if (tempo_tramonto>0) {tempo_tramonto= sc_ore_hm(tempo_tramonto);}\nelse if (tempo_tramonto==0){tempo_tramonto=\"\"; }\n\n \nvar tempi_st= new Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto) ; // restituisce le variabili.\n// 0 1 2 3 4 \n\nreturn tempi_st;\n\n}", "function insert_in_basePv_consta_rubrique_phase_bat_mpe(pv_consta_rubrique_phase_bat_mpe,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemPv_consta_rubrique_phase_bat_mpe==false)\n {\n getId = vm.selectedItemPv_consta_rubrique_phase_bat_mpe.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n periode: pv_consta_rubrique_phase_bat_mpe.periode,\n observation: pv_consta_rubrique_phase_bat_mpe.observation,\n id_pv_consta_entete_travaux: vm.selectedItemPv_consta_entete_travaux.id,\n id_rubrique_phase:pv_consta_rubrique_phase_bat_mpe.id_phase \n });\n console.log(datas);\n //factory\n apiFactory.add(\"pv_consta_detail_bat_travaux/index\",datas, config).success(function (data)\n { \n\n if (NouvelItemPv_consta_rubrique_phase_bat_mpe == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n { \n //vm.selectedItemPv_consta_rubrique_phase_bat_mpe.convention = conve[0];\n \n vm.selectedItemPv_consta_rubrique_phase_bat_mpe.$selected = false;\n vm.selectedItemPv_consta_rubrique_phase_bat_mpe.$edit = false;\n vm.selectedItemPv_consta_rubrique_phase_bat_mpe ={};\n }\n else \n { \n vm.selectedItemPv_consta_rubrique_phase_bat_mpe.observation='';\n \n }\n }\n else\n {\n //avenant_convention.convention = conve[0];\n pv_consta_rubrique_phase_bat_mpe.id = String(data.response); \n NouvelItemPv_consta_rubrique_phase_bat_mpe=false;\n }\n pv_consta_rubrique_phase_bat_mpe.$selected = false;\n pv_consta_rubrique_phase_bat_mpe.$edit = false;\n vm.selectedItemPv_consta_rubrique_phase_bat_mpe = {};\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function montaValorMes () {\r\n\t\t\t// laco de despesas\r\n\t\t\tfor (var x in $scope.despesas) {\r\n\t\t\t\t// separo a despesa\r\n\t\t\t\tvar despesa = $scope.despesas[x];\r\n\t\t\t\t// crio um atributo pres(array) na despesa\r\n\t\t\t\tdespesa.pres = [];\r\n\r\n\t\t\t\t// laco de meses até 8\r\n\t\t\t\t// for (var m=0; m<8; m++) {\r\n\t\t\t\tfor (var m=0; m<$scope.tlmeses; m++) {\r\n\t\t\t\t\tvar day = moment().add(m, \"M\").date(); // dia atual + 1\r\n\t\t\t\t\tvar month = moment().add(m, \"M\").month(); // mes atual + 1\r\n\t\t\t\t\tvar year = moment().add(m, \"M\").year(); // ano atual + 1\r\n\t\t\t\t\tvar data = ''; // variavel data\r\n\r\n\t\t\t\t\t// laco de prestacoes da despesa\r\n\t\t\t\t\tfor (var p=0; p<despesa.prestacoes; p++) {\r\n\t\t\t\t\t\tvar dia = moment(despesa.datavencimento).add(p, \"M\").date(); // dia da data despesa + index\r\n\t\t\t\t\t\tvar mes = moment(despesa.datavencimento).add(p, \"M\").month(); // mes data despesa + index\r\n\t\t\t\t\t\tvar ano = moment(despesa.datavencimento).add(p, \"M\").year(); // ano data despesa + index\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// caso o mes e ano da despesa seja = ao mes e ano atual \r\n\t\t\t\t\t\tif (mes === month && ano === year) {\r\n\t\t\t\t\t\t\tdata = {\"data\": mes+\"/\"+ano, \"valor\":despesa.valor};\r\n\t\t\t\t\t\t\t// pegando a prestação atual\r\n\t\t\t\t\t\t\tif (m === 0) { // m = o ( mes atual )\r\n\t\t\t\t\t\t\t\tdespesa.prestacao = (p+1)+\"/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!despesa.prestacao) {\r\n\t\t\t\t\t\t// se ano = atual mas mes menor ou ano menor\r\n\t\t\t\t\t\tif ( (ano === year && mes < month) || (ano < year) ) {\r\n\t\t\t\t\t\t\tdespesa.prestacao = despesa.prestacoes+\"/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tdespesa.prestacao = \"0/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( data === '' ) {\r\n\t\t\t\t\t\tdespesa.pres.push({\"data\": \"00/0000\", \"valor\":\"xxxx\", \"color\":\"background:#f0f5f5; color:#ccc;\", \"icon\":\"fa-trophyx\"});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tdespesa.pres.push(data);\r\n\t\t\t\t\t\t$scope.totais[m].valor = $scope.totais[m].valor + parseInt(despesa.valor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($scope.totais[m-1] != undefined && $scope.totais[m].valor < $scope.totais[m-1].valor) {\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-down\";\r\n\t\t\t\t\t\t}else if($scope.totais[m-1] != undefined && $scope.totais[m].valor > $scope.totais[m-1].valor) {\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-up\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-right\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$scope.totalgeral = $scope.totalgeral + parseFloat(despesa.valor);\r\n\t\t\t}\r\n\t\t}", "function computeIllumination( mvMatrix, model ) {\n\t\n\t// return;// Comentar mais tarde\n\t// Phong Illumination Model\n\n // SMOOTH-SHADING \n\n // Compute the illumination for every vertex\n\n // Iterate through the vertices\n\t\n for( var vertIndex = 0; vertIndex < model.vertices.length; vertIndex += 3 )\n {\t\n\t\t// For every vertex\n\t\t\n\t\t// GET COORDINATES AND NORMAL VECTOR\n\t\t\n\t\tvar auxP = model.vertices.slice( vertIndex, vertIndex + 3 );\n\t\t\n\t\tvar auxN = model.normals.slice( vertIndex, vertIndex + 3 );\n\n // CONVERT TO HOMOGENEOUS COORDINATES\n\n\t\tauxP.push( 1.0 );\n\t\t\n\t\tauxN.push( 0.0 );\n\t\t\n // APPLY CURRENT TRANSFORMATION\n\n var pointP = multiplyPointByMatrix( mvMatrix, auxP );\n\n var vectorN = multiplyVectorByMatrix( mvMatrix, auxN );\n \n normalize( vectorN );\n\n\t\t// VIEWER POSITION\n\t\t\n\t\tvar vectorV = vec3();\n\t\t\n\t\tif( projectionType == 0 ) {\n\t\t\n\t\t\t// Orthogonal \n\t\t\t\n\t\t\tvectorV[2] = 1.0;\n\t\t}\t\n\t\telse {\n\t\t // Perspective\n\t\t \n\t\t // Viewer at ( 0, 0 , 0 )\n\t\t\n\t\t\tvectorV = symmetric( pointP );\n\t\t}\n\t\t\n normalize( vectorV );\n\n\t // Compute the 3 components: AMBIENT, DIFFUSE and SPECULAR\n\t \n\t // FOR EACH LIGHT SOURCE\n\t for(var l = 0; l < lightSources.length; l++ )\n\t {\n\t\t\tif( lightSources[l].isOff() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t // INITIALIZE EACH COMPONENT, with the constant terms\n\t\n\t\t var ambientTerm = vec3();\n\t\t\n\t\t var diffuseTerm = vec3();\n\t\t\n\t\t var specularTerm = vec3();\n\t\t\n\t\t // For the current light source\n\t\t\n\t\t ambient_Illumination = lightSources[l].getAmbIntensity();\n\t\t\n\t\t int_Light_Source = lightSources[l].getIntensity();\n\t\t\n\t\t pos_Light_Source = lightSources[l].getPosition();\n\t\t \n\t\t // Animating the light source, if defined\n\t\t \n\t\t var lightSourceMatrix = mat4();\n\t\t \n\t\t // COMPLETE THE CODE FOR THE OTHER ROTATION AXES\n\t\t \n\t\t if( lightSources[l].isRotYYOn() ) \n\t\t {\n\t\t\t\tlightSourceMatrix = mult( \n\t\t\t\t\t\tlightSourceMatrix, \n\t\t\t\t\t\trotationYYMatrix( lightSources[l].getRotAngleYY() ) );\n\t\t\t}\n\n\t\t\tif( lightSources[l].isRotXXOn() ) \n\t\t {\n\t\t\t\tlightSourceMatrix = mult( \n\t\t\t\t\t\tlightSourceMatrix, \n\t\t\t\t\t\trotationXXMatrix( lightSources[l].getRotAngleXX() ) );\n\t\t\t}\n\n\t\t\tif( lightSources[l].isRotZZOn() ) \n\t\t {\n\t\t\t\tlightSourceMatrix = mult( \n\t\t\t\t\t\tlightSourceMatrix, \n\t\t\t\t\t\trotationZZMatrix( lightSources[l].getRotAngleZZ() ) );\n\t\t\t}\n\t\t\t\n\t for( var i = 0; i < 3; i++ )\n\t {\n\t\t\t // AMBIENT ILLUMINATION --- Constant for every vertex\n\t \n\t\t\t ambientTerm[i] = ambient_Illumination[i] * model.kAmbi[i];\n\t\n\t diffuseTerm[i] = int_Light_Source[i] * model.kDiff[i];\n\t\n\t specularTerm[i] = int_Light_Source[i] * model.kSpec[i];\n\t }\n\t \n\t // DIFFUSE ILLUMINATION\n\t \n\t var vectorL = vec4();\n\t\n\t if( pos_Light_Source[3] == 0.0 )\n\t {\n\t // DIRECTIONAL Light Source\n\t \n\t vectorL = multiplyVectorByMatrix( \n\t\t\t\t\t\t\tlightSourceMatrix,\n\t\t\t\t\t\t\tpos_Light_Source );\n\t }\n\t else\n\t {\n\t // POINT Light Source\n\t\n\t // TO DO : apply the global transformation to the light source?\n\t\n\t vectorL = multiplyPointByMatrix( \n\t\t\t\t\t\t\tlightSourceMatrix,\n\t\t\t\t\t\t\tpos_Light_Source );\n\t\t\t\t\n\t\t\t\tfor( var i = 0; i < 3; i++ )\n\t {\n\t vectorL[ i ] -= pointP[ i ];\n\t }\n\t }\n\t\n\t\t\t// Back to Euclidean coordinates\n\t\t\t\n\t\t\tvectorL = vectorL.slice(0,3);\n\t\t\t\n\t normalize( vectorL );\n\t\n\t var cosNL = dotProduct( vectorN, vectorL );\n\t\n\t if( cosNL < 0.0 )\n\t {\n\t\t\t\t// No direct illumination !!\n\t\t\t\t\n\t\t\t\tcosNL = 0.0;\n\t }\n\t\n\t // SEPCULAR ILLUMINATION \n\t\n\t var vectorH = add( vectorL, vectorV );\n\t\n\t normalize( vectorH );\n\t\n\t var cosNH = dotProduct( vectorN, vectorH );\n\t\n\t\t\t// No direct illumination or viewer not in the right direction\n\t\t\t\n\t if( (cosNH < 0.0) || (cosNL <= 0.0) )\n\t {\n\t cosNH = 0.0;\n\t }\n\t\n\t // Compute the color values and store in the colors array\n\t \n\t var tempR = ambientTerm[0] + diffuseTerm[0] * cosNL + specularTerm[0] * Math.pow(cosNH, model.nPhong);\n\t \n\t var tempG = ambientTerm[1] + diffuseTerm[1] * cosNL + specularTerm[1] * Math.pow(cosNH, model.nPhong);\n\t \n\t\t\tvar tempB = ambientTerm[2] + diffuseTerm[2] * cosNL + specularTerm[2] * Math.pow(cosNH, model.nPhong);\n\t\n\t\t\t\n\t\t\tlight += 1;\n\t\t\t\n\t\t\tif(light >= 50000)\n\t\t\t{\n\t\t\t\tlight = 50000\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmodel.colors[vertIndex] += tempR;\n\t \n\t // Avoid exceeding 1.0\n\t \n\t\t\tif( model.colors[vertIndex] > 1.0 ) {\n\t\t\t\tmodel.colors[vertIndex] = 1.0;\n\t\t\t}\n\t \n\t // Avoid exceeding 1.0\n\t \n\t\t\tmodel.colors[vertIndex + 1] += tempG;\n\t\t\t\n\t\t\tif( model.colors[vertIndex + 1] > 1.0 ) {\n\t\t\t\t\n\t\t\t\tmodel.colors[vertIndex + 1] = 1.0;\n\t\t\t}\n\t\t\t\n\t\t\tmodel.colors[vertIndex + 2] += tempB;\n\t \n\t // Avoid exceeding 1.0\n\t \n\t\t\tif( model.colors[vertIndex + 2] > 1.0 ) {\n\t\t\t\tmodel.colors[vertIndex + 2] = 1.0;\n\t\t\t}\n\t\t\t// lightSources[l].switchOff();\n\t\t}\n\t\t\t\n\t}\n}", "union(n, m) {\n nId = this.id[n];\n mId = this.id[m];\n for(var i = 0; i < id.length; i++) {\n if(n[i] === nId) n[i] = mId;\n }\n }", "function copiafyv(principal, copia) {\n try {\n /*Analizo primero el root principal */\n principal.lista_Nodo.forEach(function (element) {\n if (element.tipo == \"Clase\") {\n MYFPrincipal = [];\n MYFfCopia = [];\n /*por cada calse encontrada, la busco en el otro arbol*/\n copia.lista_Nodo.forEach(function (element2) {\n if (element2.tipo == \"Clase\") {\n /*Por cada clase que encuentro en el otro root compruebo si son los mismos*/\n if (element.descripcion == element2.descripcion) {\n /*recorro para encontrar los metodos y funciones de la clase principal*/\n element.lista_Nodo.forEach(function (element3) {\n if (element3.tipo == \"Funcion\") {\n MYFPrincipal.push(element3.descripcion);\n /*encontramos si tiene parametros la funcion*/\n element3.lista_Nodo.forEach(function (parametrosMF) {\n if (parametrosMF.tipo == \"Parametros\") {\n var parametroslst = returnLst(parametrosMF.lista_Nodo);\n element2.lista_Nodo.forEach(function (fmCopia) {\n if (fmCopia.tipo == \"Funcion\" && element3.tipodato == fmCopia.tipodato) {\n fmCopia.lista_Nodo.forEach(function (paramCopia) {\n if (paramCopia.tipo == \"Parametros\") {\n var parametroslstCopia = returnLst(paramCopia.lista_Nodo);\n if (parametroslst.toString() == parametroslstCopia.toString()) {\n console.log(\"las funciones \" + element3.descripcion + \" Son iguales en ambos archivos,por tener los mismos tipos de parametros en el mismo orden\" + \" de la calse \" + element.descripcion);\n MYFfCopia_Clase.push(element.descripcion);\n MYFfCopia.push(element3.descripcion);\n }\n }\n });\n }\n });\n }\n });\n }\n else if (element3.tipo == \"Metodo\") {\n MYFPrincipal.push(element3.descripcion);\n /*encontramos si tiene parametros la funcion*/\n element3.lista_Nodo.forEach(function (parametrosF) {\n if (parametrosF.tipo == \"Parametros\") {\n var parametroslstM = returnLst(parametrosF.lista_Nodo);\n element2.lista_Nodo.forEach(function (mCopia) {\n if (mCopia.tipo == \"Metodo\" && element3.descripcion == mCopia.descripcion) {\n mCopia.lista_Nodo.forEach(function (paramCopiaM) {\n if (paramCopiaM.tipo == \"Parametros\") {\n var parametroslstCopiaM = returnLst(paramCopiaM.lista_Nodo);\n if (parametroslstM.toString() == parametroslstCopiaM.toString()) {\n console.log(\"los metodos \" + element3.descripcion + \" Son iguales en ambos archivos,por tener los mismos tipos de parametros en el mismo orden\" + \" de la calse \" + element.descripcion);\n MYFfCopia.push(element3.descripcion);\n MYFfCopia.push(element3.descripcion);\n }\n }\n });\n }\n });\n }\n });\n }\n });\n if (MYFPrincipal.toString() == MYFfCopia.toString()) {\n console.log(\"las clases \" + element.descripcion + \" Son iguales en ambos archivos\");\n }\n }\n }\n });\n }\n });\n }\n catch (error) {\n }\n}", "function genera_parametros(){\r\n\tx_0=103;\r\n\tm=1001;\r\n\tprimos.forEach(a=>{\r\n\t\tprimos.forEach(c=>{\r\n\t\t\tnum_ale = generador_mixto(a,c,x_0,m)\r\n\t\t\tif(num_ale.length == m){ //tambien deberia revisar si hay numeros repetidos\r\n\t\t\t\timprimir_configuracion_parametros_a_pantalla\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function compraArma(i){\n\n if(mochilaArmas.length == 0){\n if(jogador1.grana < mercadoArmas[i].preco){\n console.log('Falta din!!!')\n }else{\n mochilaArmas.push(mercadoArmas[i])\n \n jogador1.grana -= mercadoArmas[i].preco \n }\n }else{\n for(let j in mochilaArmas){\n if(i == mochilaArmas[j].id){\n console.log('Já tem esta arma!')\n return\n }\n }\n if(jogador1.grana < mercadoArmas[i].preco){\n console.log('Falta din!!!')\n }else{\n jogador1.nArmas++;\n mochilaArmas.push(mercadoArmas[i])\n //localStorage.setItem(`arma${i}`, JSON.stringify(mercadoArmas[i]))\n jogador1.grana -= mercadoArmas[i].preco \n }\n }\n gravarLS('grana', jogador1.grana); \n mostraInfoJogador()\n}", "merge(v) {\n\t\t\n\t\tif( v.lvl >= this.max_lvl ) return\n\t\t\n\t\tvar same = (v.childs[0] != null || v.type != 0) && v != this.root && v.childs[0] != 0\n\t\t\n\t\tfor( var i = 1; i < 8; i++ ) {\n\t\t\tif ( !same || v.childs[i] == null || v.childs[i].type != v.childs[0].type ) {\n\t\t\t\tsame = false\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (same) {\n\t\t\t\n\t\t\tvar type = v.childs[0].type\n\t\t\tfor( var i = 0; i < 8; i++ ) {\n\t\t\t\tthis.del( v.childs[i] )\n\t\t\t}\n\t\t\tthis.retype(v, type)\n\t\t\t\n\t\t\tthis.merge(v.par)\n\t\t}\n\t}", "function skaiciuotiVidurki(mas) {\n var suma = 0;\n for (var i = 0; i < mas.length; i++) {\n suma += mas[i];\n }\n // return Math.round(suma / mas.length);\n var ats = suma / mas.length;\n ats = Math.round(ats);\n return ats;\n}", "function calcNeto( ) {\r\n\t\t\treturn $scope.pes_br-$scope.pes_ta;\r\n//\t\t\treturn toString(accounting.unformat($scope.pes_br)-accounting.unformat($scope.pes_ta)); /*\r\n\t\t}", "function impostaTotaliInDataTable(totaleStanziamentiEntrata, totaleStanziamentiCassaEntrata, totaleStanziamentiResiduiEntrata, totaleStanziamentiEntrata1, totaleStanziamentiEntrata2,\n \t\ttotaleStanziamentiSpesa, totaleStanziamentiCassaSpesa, totaleStanziamentiResiduiSpesa, totaleStanziamentiSpesa1, totaleStanziamentiSpesa2){\n\n \tvar totaleStanziamentiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata);\n var totaleStanziamentiCassaEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaEntrata);\n var totaleStanziamentiResiduiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiEntrata);\n //anno = anno bilancio +1\n var totaleStanziamentiEntrata1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata1);\n //anno = anno bilancio +2\n var totaleStanziamentiEntrata2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata2);\n \n \n var totaleStanziamentiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa);\n var totaleStanziamentiCassaSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaSpesa);\n var totaleStanziamentiResiduiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiSpesa);\n //anno = anno bilancio +1\n var totaleStanziamentiSpesa1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa1);\n //anno = anno bilancio +2\n var totaleStanziamentiSpesa2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa2);\n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazione\", totaleStanziamentiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateResiduoVariazione\", totaleStanziamentiResiduiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCassaVariazione\", totaleStanziamentiCassaEntrataNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiEntrata1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiEntrata2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazione\", totaleStanziamentiSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCassaVariazione\", totaleStanziamentiCassaSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseResiduoVariazione\", totaleStanziamentiResiduiSpesaNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiSpesa1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiSpesa2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazione\", (totaleStanziamentiEntrataNotUndefined - totaleStanziamentiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaResiduoVariazione\", (totaleStanziamentiResiduiEntrataNotUndefined - totaleStanziamentiResiduiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCassaVariazione\", (totaleStanziamentiCassaEntrataNotUndefined - totaleStanziamentiCassaSpesaNotUndefined));\n \n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuUno\", (totaleStanziamentiEntrata1NotUndefined - totaleStanziamentiSpesa1NotUndefined));\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuDue\", (totaleStanziamentiEntrata2NotUndefined - totaleStanziamentiSpesa2NotUndefined));\n }", "async function parse_parse() {\n try {\n let regiones_y_comunas = await parse_regiones_y_comunas();\n for (let i = 0; i < regiones_y_comunas.length; i++) {\n\n // Damn \"O'Higins\" comuna in the region of Aisén, that makes an additional replace\n regiones_y_comunas[i] = JSON.parse(regiones_y_comunas[i].replace(/O'/g, \"O\\\\'\").replace(/'/g, '\"'))\n }\n return regiones_y_comunas;\n } catch (error) {\n console.log(\"Error\");\n console.log(error);\n }\n }", "function brutus(pair,levslist) {\r\n\r\n var purp = [];\r\n for (var x = 0; x < pair.length; ++x){\r\n var currency = pair.substring(3,pair.length);\r\n var Fx1 = [];\r\n var g = 0;\r\n for (var f = 0; f < 200; ++f) {\r\n Fx1.push(g);\r\n g += 1;\r\n }\r\n var yclose = []; // META PORT\r\n var g = 0;\r\n for (var f = 0; f < Fx1.length; ++f) {\r\n yclose.push(Math.floor(Math.random() * 6) + 1);\r\n g += 1;\r\n }\r\n var Fy1 = []\r\n if (currency == 'JPY') {\r\n for (var f = 0; f < yclose.length; ++f) {\r\n Fy1.push(yclose[f]*100);\r\n }\r\n } else {\r\n for (var f = 0; f < yclose.length; ++f) {\r\n Fy1.push(yclose[f]*10000);\r\n }\r\n }\r\n var wholeslope = 0\r\n for (var f = 1; f < Fy1.length; ++f) {\r\n wholeslope += (Fy1[f]-Fy1[f-1])/(Fx1[f]-Fx1[f-1]);\r\n }\r\n var wholeslope = wholeslope/Fy1.length;\r\n var scopetheta = Math.abs((Math.atanh(wholeslope)* 180 / Math.PI));\r\n\r\n if (scopetheta > 5) {\r\n \r\n }\r\n \r\n\r\n\r\n return [wholeslope,scopetheta];\r\n }\r\n}", "function realizarInversion() {\n \n rangos = rango.getRango()\n // Ya estamos haciendo una/s inversion/es\n if (realizandoInversion == true){}\n \n // Podemos realizar inversiones\n else {\n \n realizandoInversion = true\n\n // Hacemos algunas comprobaciones\n // TODO Añadir que solo cojas aquellos que tengan keys\n comprobarPreInversion(function(superanComprobaciones){\n \n console.log('Superan las comprobaciones: ', superanComprobaciones)\n \n // Obtenemos los mejores valores para invertir de cada usuario\n obtenerValoresOptimosXUsuario(superanComprobaciones,function(monedasXUsuario,mejoresValores){\n \n // Obtenemos las monedas no penalizadas de cada usuario\n obtenerNoPenalizadasXUsuario(monedasXUsuario,superanComprobaciones,function(noPenalizadasXUsuario){\n \n // Solo compraremos aquellas monedas que no tengamos\n seleccionMonedasNuevas(noPenalizadasXUsuario,superanComprobaciones,function(noCompradasXUsuario){\n \n // Filtramos por el crecimiento de la moneda en las ultimas 3horas\n filtrarCrecimienPositivo(noCompradasXUsuario,{minutos:[180],intervalos:[5]},function(primerCrecPositivo){\n \n console.log('Primer crecPositivo ' , primerCrecPositivo)\n \n // Filtramos de nuevo por el crecimiento de la moneda en los ultimos 30min\n filtrarCrecimienPositivo(primerCrecPositivo,{minutos:[30],intervalos:[5]},function(segundoCrecPositivo){\n \n console.log('Segundo crec positivo ', segundoCrecPositivo)\n\n // Calculamos la cantidad de operaciones que podemos hacer\n calcularNumeroOperaciones(segundoCrecPositivo,function(opsXUsuario,parametros){\n \n // Elegimos las monedas que vamos a comprar\n // de manera aleatoria\n elegirMonedas(segundoCrecPositivo,opsXUsuario,function(monedasElegidasXUsuario){\n \n console.log(' ')\n console.log('Preparamos compras ',monedasElegidasXUsuario)\n console.log(' ')\n \n // Preparamos las compras (precios,cantidades,moneda..etc)\n prepararCompra(monedasElegidasXUsuario,parametros,function(comprasXUsuario){\n \n // Compramos las monedas elegidas\n comprarMonedas(comprasXUsuario,function(compradas,usuariosConCompras){\n\n // Calculamos la cantidad gastada por cada usuario\n prepararActualizacionSaldo(compradas,function(gastadoXUsuario){\n\n // Actualizamos el saldo de cada usuario\n actualizarSaldo(gastadoXUsuario,function(errores,params){\n\n if (errores){console.log('Ha habido problemas a la hora de actualizar el saldo')}\n \n // Añadimos las monedas al seguimiento de compras\n crearSeguimientoCompras(compradas,params)\n\n })\n }) \n })\n })\n }) \n })\n })\n })\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n })\n })\n })\n })\n }\n}", "function combine(upto, durence) {\r\n let text = Sub.text;\r\n let time = Sub.timeline;\r\n let result_text = [];\r\n let result_time = [];\r\n let result_names = [];\r\n\r\n // lasto4ka eba\r\n // check if we combaine last value with smth\r\n // or we need to push it\r\n // all because of the cycle borders (text.length-1)\r\n let last_check = false;\r\n\r\n for (let i = 0; i < text.length - 1; i++) {\r\n let temp_inc = i;\r\n // sLog((time[i+1] - time[i])<= durence*1000);\r\n if (text[i].length <= upto && time[i + 1] - time[i] <= durence * 1000) {\r\n if (\r\n text[i + 1].length <= upto &&\r\n time[i + 2] - time[i + 1] <= durence * 1000\r\n ) {\r\n text[i] = \"- \" + text[i] + \"\\n- \" + text[i + 1];\r\n temp_inc++;\r\n if (i == text.length - 2) {\r\n last_check = true;\r\n }\r\n }\r\n }\r\n result_text.push(text[i]);\r\n result_time.push(time[i]);\r\n result_names.push(Sub.names[i]);\r\n i = temp_inc;\r\n }\r\n // need those to push last values that\r\n if (!last_check) {\r\n result_text.push(text[text.length - 1]);\r\n result_names.push(Sub.names[text.length - 1]);\r\n result_time.push(time[text.length - 1]);\r\n last_check = false;\r\n }\r\n\r\n Sub.text = result_text;\r\n Sub.timeline = result_time;\r\n Sub.names = result_names;\r\n}", "function afase_pianeta(njd,AR,DE,dist_ps,dist_pt){\n\n // funzione per il calcolo dell'angolo di fase per un pianeta.\n // AR,DE sono le coordinate equatoriali decimali, del pianeta.\n // njd= numero del giorno giuliano.\n // dist_ps=distanza pianeta-sole in UA.\n // dist_pt=distanza pianeta-Terra in UA.\n // by Salvatore Ruiu - gennaio 2013.\n\n var coo_sole=pos_sole(njd); // coordinate equatoriali decimali del Sole.\n var Rs=coo_sole[4]; // distanza Terra-Sole. \n var elongaz=elong(AR,DE,coo_sole[0],coo_sole[1]); // elongazione in gradi dal Sole.\n\n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_pt; // distanza pianeta-terra.\n var Dts= Rs; // distanza terra-sole.\n var Dps= dist_ps; // distanza pianeta-sole.\n\n // risolve il teorema del coseno (noti i 3 lati del triangolo).\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-Math.abs(elongaz)-delta_fase; // risultato: angolo di fase in gradi.\n\nreturn angolo_fase;\n\n}", "compareDnaV2 (pAequor) {\n const result = this.dna.reduce((acc, curr, idx, arr) => {\n if (arr[idx] === pAequor.dna[idx]) {\n return acc + 1;\n }\n else {\n return acc;\n }\n }, 0)\n const percentage2 = result / this.dna.length * 100;\n return `Specimen ${this.specimenNum} and specimen ${pAequor.specimenNum} have ${percentage2.toFixed \n (2)}% in common.`\n }", "function setCO2volumeOld(volume) {\n // Set person to 1x1\n \n // Check type of visual\n let f_volumeRatio = volume / FRIG_V; \n let t_volumeRatio = volume / TRUCK_V;\n let h_volumeRatio = volume / HOUSE_V;\n let p_volumeRatio = volume / PLANE_V;\n let pc_volumeRatio = volume / PLANE_C_V;\n \n let type = \"fridge\";\n let typeAmount = (f_volumeRatio);\n \n if (pc_volumeRatio > 1) {\n type = \"plane-carrier\";\n typeAmount = (pc_volumeRatio);\n } else if (p_volumeRatio > 1) {\n type = \"plane\";\n typeAmount = (p_volumeRatio);\n } else if (h_volumeRatio > 1) {\n type = \"house\";\n typeAmount = (h_volumeRatio);\n } else if (t_volumeRatio > 1) {\n type = \"truck\";\n typeAmount = (t_volumeRatio);\n }\n \n // Set amount\n let $amountContainerDay = $(\"#amountDay #containerDay\");\n $(\"#totalAmountDay\").text(`Total of: ${typeAmount.toFixed(2)} ${type}s per day`);\n $amountContainerDay.empty();\n for (let i = 0; i < Math.round(typeAmount); i++) {\n $amountContainerDay.append(`<div class=\"${type}\"></div>`)\n }\n\n typeAmount = typeAmount*30;\n let $amountContainerMonth = $(\"#amountMonth #containerMonth\");\n $(\"#totalAmountMonth\").text(`Total of: ${typeAmount.toFixed(2)} ${type}s per month`);\n $amountContainerMonth.empty();\n for (let i = 0; i < Math.round(typeAmount); i++) {\n $amountContainerMonth.append(`<div class=\"${type}\"></div>`)\n }\n\n typeAmount = typeAmount*12;\n let $amountContainerYear = $(\"#amountYear #containerYear\");\n $(\"#totalAmountYear\").text(`Total of: ${typeAmount.toFixed(2)} ${type}s per year`);\n $amountContainerYear.empty();\n for (let i = 0; i < Math.round(typeAmount); i++) {\n $amountContainerYear.append(`<div class=\"${type}\"></div>`)\n }\n\n}", "function desviacionEstandarMuestra(array) {\n\t\t\tlet desviacionEstandar = varianzaMuestra(array) ** (1/2);\n\t\t\treturn desviacionEstandar;\n\t\t}", "function _GeraPontosDeVida(modo, submodo) {\n if (modo != 'personagem' && modo != 'elite' && modo != 'comum') {\n Mensagem(Traduz('Modo') + ' ' + modo + ' ' + Traduz('invalido') + '. ' + Traduz('Deve ser elite, comum ou personagem.'));\n return;\n }\n // Para cada classe, rolar o dado.\n var total_pontos_vida = 0;\n // Primeiro eh diferente na elite e personagem.\n var primeiro = (modo == 'comum') ? false : true;\n for (var i = 0; i < gPersonagem.classes.length; ++i) {\n var info_classe = gPersonagem.classes[i];\n for (var j = 0; j < info_classe.nivel; ++j) {\n var pontos_vida_nivel = 0;\n var template_personagem = PersonagemTemplate();\n var dados_vida = template_personagem != null && 'dados_vida' in template_personagem ?\n template_personagem.dados_vida :\n tabelas_classes[info_classe.classe].dados_vida;\n if (primeiro) {\n if (modo == 'elite') {\n pontos_vida_nivel = dados_vida;\n } else if (modo == 'personagem') {\n // O modificador de constituicao eh subtraido aqui pq sera adicionado\n // no calculo de pontos de vida, nos bonus.\n pontos_vida_nivel = dados_vida +\n gPersonagem.atributos['constituicao'].valor -\n gPersonagem.atributos['constituicao'].modificador;\n } else {\n pontos_vida_nivel = submodo == 'tabelado' ? dados_vida / 2 : Rola(1, dados_vida);\n }\n primeiro = false;\n } else {\n pontos_vida_nivel = submodo == 'tabelado' ? dados_vida / 2 : Rola(1, dados_vida);\n\n }\n // Nunca pode ganhar menos de 1 ponto por nivel.\n if (pontos_vida_nivel < 1) {\n pontos_vida_nivel = 1;\n }\n total_pontos_vida += pontos_vida_nivel;\n }\n }\n gPersonagem.pontos_vida.total_dados = Math.floor(total_pontos_vida);\n}", "function hitungVolumedanLuasPermukaanBalok(panjang, lebar, tinggi) {\n luasPermukaanBalok = 2 * ( (panjang * lebar) + (panjang * tinggi) + (lebar * tinggi) );\n volumeBalok = panjang * lebar * tinggi;\n document.write(\"Panjang : \" + panjang + \"<br/>\");\n document.write(\"Lebar : \" + lebar + \"<br/>\");\n document.write(\"Tinggi : \" + tinggi + \"<br/>\" + \"<br/>\");\n document.write(\"Volume Balok : \" + volumeBalok + \"<br/>\");\n document.write(\"Luas Permukaan Balok : \" + luasPermukaanBalok + \"<br/>\");\n}", "function varianzaMuestra(array) {\n\t\t\tlet suma = 0;\n\t\t\t// Hallamos la suma de cuadrados\n\t\t\tfor(i=0; i<array.length; i++) {\n\t\t\t\tsuma = suma + (array[i] ** 2);\n\t\t\t}\n\t\t\t// Terminamos el procedimiento\n\t\t\tlet varianza = (suma/(array.length-1)) - (promedio(array) ** 2);\n\t\t\treturn varianza;\n\t\t}", "genereazaVariabilaLognormala() {\n\t\t\t// Calculam media miu si dispersia sigma\n\t\t\tlet mu = this.calculeazaMediaMiu(this.getM, this.getS);\n\t\t\tlet sigma = this.calculeazaDispersiaSigmaPatrat(this.getM, this.getS);\n\t\t\t// Generam Z cu distributia normala N(0,1)\n\t\t\tlet Z = Normal.genereazaVariabilaNormala01();\n\t\t\t// Calculam X (sigma = sqrt(sigma patrat))\n\t\t\tlet X = mu + (Z * Math.sqrt(sigma));\n\t\t\t// Calculam si intoarcem pe Y cu distributia lognormala (miu, sigma)\n\t\t\treturn ( Math.pow(Math.E, X) );\n\t\t}", "function cariModus(arr) {\n var indexTampung =0;\n var simpanIndex, tampung=[];\n\n //Memfilter sekaligus menghitung jumlah angka yang sama yang akan di simpan pada array\"tampung\"\n for(var i=0; i<arr.length; i++) {\n var counter = 1;\n for(var j=i+1; j<arr.length; j++) {\n if(arr[i] === arr[j] && arr[i] !== '') {\n counter++;\n arr[j] = ''; //jika ada nilai yang sama maka arr[j] di hilangkan agar tidak ada duplikasi lagi\n }\n }\n if(arr[i] !== '') {\n tampung.push([arr[i], counter]) // array \"tampung\" menyimpan nilai dan jumah duplikatnya\n }\n }\n\n //mencari Modus\n var indexMax = 0;\n var MAX = tampung[indexMax][0];\n for(var i=0; i<tampung.length; i++) {\n if(tampung[i][1] > tampung[indexMax][1]) {\n indexMax = i;\n MAX = tampung[indexMax][0];\n }\n }\n\n // console.log(tampung)\n if(tampung.length === 1 || tampung[indexMax][1] === 1){ //untuk jika modus hanya ada 1 nilai atau tidak ada modus\n return -1 ; \n }else{\n return MAX;\n }\n}", "function merge(arena, piece){\r\n piece.matrix.forEach((row, y) =>{\r\n row.forEach((value, x) => {\r\n if(value !== 0){\r\n arena[y + piece.pos.y][x+ piece.pos.x] = value;\r\n }\r\n });\r\n });\r\n }", "function AtrazoBoco (mês, valorAnuidade) {\n switch(mês) {\n case 1:\n return `Valor da Anuidade: ${valorAnuidade}`\n break\n\n case 2:\n const juroscomposto1 = valorAnuidade * ((1 + 0.05)**1)\n return `Valor da Anuidade com Juros: ${juroscomposto1.toFixed(2)}`\n break\n\n case 3:\n const juroscomposto2 = valorAnuidade * ((1 + 0.05)**2)\n return `Valor da Anuidade com Juros: ${juroscomposto2.toFixed(2)}`\n break\n\n case 4:\n const juroscomposto3 = valorAnuidade * ((1 + 0.05)**3)\n return `Valor da Anuidade com Juros: ${juroscomposto3.toFixed(2)}`\n break\n\n case 5:\n const juroscomposto4 = valorAnuidade * ((1 + 0.05)**4)\n return `Valor da Anuidade com Juros: ${juroscomposto4.toFixed(2)}`\n break\n\n case 6:\n const juroscomposto5 = valorAnuidade * ((1 + 0.05)**5)\n return `Valor da Anuidade com Juros: ${juroscomposto5.toFixed(2)}`\n break\n\n case 7:\n const juroscomposto6 = valorAnuidade * ((1 + 0.05)**6)\n return `Valor da Anuidade com Juros: ${juroscomposto6.toFixed(2)}`\n break\n\n case 8:\n const juroscomposto7 = valorAnuidade * ((1 + 0.05)**7)\n return `Valor da Anuidade com Juros: ${juroscomposto7.toFixed(2)}`\n break\n\n case 9:\n const juroscomposto8 = valorAnuidade * ((1 + 0.05)**8)\n return `Valor da Anuidade com Juros: ${juroscomposto8.toFixed(2)}`\n break\n\n case 10:\n const juroscomposto9 = valorAnuidade * ((1 + 0.05)**9)\n return `Valor da Anuidade com Juros: ${juroscomposto9.toFixed(2)}` \n break\n\n case 11:\n const juroscomposto10 = valorAnuidade * ((1 + 0.05)**10)\n return `Valor da Anuidade com Juros: ${juroscomposto10.toFixed(2)}`\n break\n\n case 12:\n const juroscomposto11 = valorAnuidade * ((1 + 0.05)**11)\n return `Valor da Anuidade com Juros: ${juroscomposto11.toFixed(2)}`\n break\n }\n }", "function emulate0(query,levion){\n//console.log(\"tttttttttttttttttttttttttttttttttttttttttttttttt\"+query)\ntry{levenshtein=require(path.resolve('%CD%', './plugins/modules/levenshtein').replace('\\\\%CD%', ''))\n}catch(err){console.log(\"errrrrrreur\"+err)}\n //lis le nom des plugins\n f1 = path.resolve('%CD%', './plugins/demarrage/item/plugins.json').replace('\\\\%CD%', '');//console.log(f1)\n data5=fs.readFileSync(f1,'utf8').toString();\n objet5 = JSON.parse(data5); longueur5 = objet5.nompluguine.length \n\n //nom plugin 1 par 1\n for (i=0;i<longueur5;i++){//console.log(objet5.nompluguine[i])\n//on test si query fait pati des xml EX : query XML query\n \n \n f2 = path.resolve('%CD%', './plugins/demarrage/item/'+objet5.nompluguine[i] +'item.json').replace('\\\\%CD%', '');\n data6=fs.readFileSync(f2,'utf8').toString(); garbage1=0\n \n if ( (objet5.nompluguine[i].search(\"garbage\",\"gi\")>-1) ){ garbage1=1 }\n \n data6=fs.readFileSync(f2,'utf8').toString(); \n \n try{ objet6 = JSON.parse(data6);jsonStr6 = JSON.stringify(objet6); longueur6 = objet6.nompluguine.length }\n catch(err){console.log(err)}\n\n for(y=0;y<longueur6;y++){// si match== emulate +nom appel..\n \n //////////////////////\n levi=levenshtein(objet6.nompluguine[y],query)\n querylengthlevi=query.length\n objet6lengthlevi=objet6.nompluguine[y].length\n concordancelevi=(levi*100)/objet6lengthlevi\n //console.log(\"consordanceeeeeeeeeeeeee \" +concordancelevi)\n\n if( (concordancelevi<25) && (levion==1) ){\n console.log(\"concordance levi : \" +levi+\" \"+concordancelevi+\" \"+ objet6.nompluguine[y])\n query=objet6.nompluguine[y]\n }//fin concorancelevi\n \n /////////////////////\n\n\n\n if (query.search(new RegExp(objet6.nompluguine[y],\"gi\")) >-1){\n \n console.log('concordance dans les xml de : '+query+\" dans : \"+objet6.nompluguine[y]+ \" du plugin : \"+objet5.nompluguine[i]) \n \n if(garbage1==1){ \n console.log(\"!!!!!garbage!!!!\"+garbage1+objet5.nompluguine[i])\n objet5.nompluguine[i]=objet5.nompluguine[i].replace(new RegExp(\"garbage\",\"gi\"),\"\");\n console.log(objet5.nompluguine[i])\n garbage1=0; SARAH.run(objet5.nompluguine[i], { 'dictation' : query});\n callback({'tts' : \"\"}); return false\n }//fin if garbage1\n \n //le nom de sarah en v3 ou v4\n try{\n filePathcontent1 = path.resolve('%CD%', './custom.ini').replace('\\\\%CD%', '');\n content = fs.readFileSync(filePathcontent1,'utf8');ini = require('./ini/ini');fs = require('fs')\n nomappel = ini.parse(fs.readFileSync(filePathcontent1, 'utf-8')).common.name;//console.log('le nom : '+nomappel)\n }//fin try\n catch (Exception) {\n filePathcontent1 = path.resolve('%CD%', './client/custom.ini').replace('\\\\%CD%', '');\n content = fs.readFileSync(filePathcontent1,'utf8');ini = require('./ini/ini');fs = require('fs')\n nomappel = ini.parse(fs.readFileSync(filePathcontent1, 'utf-8')).bot.name;//console.log('le nom : '+nomappel)\n }//fin catch\n //concordance donc on émul\n url1 = 'http://127.0.0.1:8888/?emulate='+nomappel+' '+objet6.nompluguine[y];console.log('on connais donc ont appel depuis cortana : '+url1)\n request = require('request');\n request({ url : url1 })\n\n////on verifie si on ajoute aux phrases clés\n filePathrea = path.resolve('%CD%', './plugins/mémoiredemathilde/phrasescles/phrasescles.json').replace('\\\\%CD%', '');\n \n fs.readFile(filePathrea, function(err,data){\n \n objet = JSON.parse(data);jsonStr = JSON.stringify(objet);//console.log(objet.phrasescles)\n \n queryrecherchefin=query.search(new RegExp(\"\\\\b\" + objet6.nompluguine[y] + \"\\\\b\",\"gi\"))\n queryrecherche=\"\"\n\n for(iii=0;iii<queryrecherchefin;iii++){queryrecherche=queryrecherche+query[iii]};//console.log('*'+queryrecherche+'-')\n \n for(ii=0;ii<objet.phrasescles.length;ii++){queryrecherche=queryrecherche.trim()\n debut=objet.phrasescles[ii].search(new RegExp(queryrecherche,\"gi\"))\n // console.log(debut+objet.phrasescles[ii]+queryrecherche)\n if (debut>-1){//console.log('pas de push pour : '+objet.phrasescles[i]+queryrecherche)\n console.log('fini pour cortana le pluguin est actif et phrasescles connus')\n callback({'tts' : \"\"});\n return false\n }//fin if debut\n\n }//fin for ii\n\n //on ajoute aux phrases cles\n // if(queryrecherche.length>4){\n if(queryrecherche.length>4){\n queryrecherche=queryrecherche.trim()\n objet.phrasescles.push(queryrecherche); new_jsonStr = JSON.stringify(objet);\n console.log(\"valeur rajoutée au json phrasescles & fini pour cortana le pluguin est actif \"+queryrecherche)\n filePathphrasescles1 = path.resolve('%CD%', './plugins/mémoiredemathilde/phrasescles/phrasescles.json').replace('\\\\%CD%', '')\n fs.writeFile(filePathphrasescles1,new_jsonStr)\n }//fin if querysearch\n\n })//fs.read\n\n callback({'tts' : \"\"});\n return false///////////fin car on connais\n\n }//fin if query search nom plugin\n }//fin for Y\n}//fin for i\n\nif (levion==0){console.log(\"2 eme passage avec levi\"); levion=1 ; emulate0(query,levion)}\nelse{emulate(query)}\n//on re test avec levi\n\n//rien donc on émul pour voir\n\n}// fin fnct emulate0", "function Rndm(daftarPemain) {\n this.daftarPemain = daftarPemain;\n\n this.inpPemain = (namaPemain) => {\n if (this.daftarPemain.length === 0 || this.daftarPemain[0] === undefined) {\n this.daftarPemain.push(namaPemain);\n }\n else {\n for (var i = 0; i < this.daftarPemain.length; i++) {\n if (this.daftarPemain[i] === namaPemain) {\n alert(`user ${namaPemain}, sudah ada dalam permainan.`)\n return i--;\n }\n }\n this.daftarPemain.push(namaPemain);\n }\n return this.daftarPemain;\n }\n\n this.acakPemain = () => {\n var output = [];\n var arr = this.daftarPemain;\n var newArrr = arr.map(e => e);\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < newArrr.length; j++) {\n for (var k = 0; k < arr.length; k++) {\n for (var l = 0; l < arr.length; l++) {\n for (var m = 0; m < arr.length; m++) {\n var acak = newArrr[Math.floor(Math.random() * newArrr.length)];\n }\n }\n }\n }\n var find = newArrr.indexOf(acak);\n newArrr.splice(find, 1);\n output.push(acak);\n }\n \n return output;\n }\n\n this.outputHasil = () => {\n var out = '';\n var newOutput = this.acakPemain().map(e => e);\n newOutput.forEach((e,i) => out += `Pemain ke - ${i+1} adalah ${e}.\\n`);\n return out;\n }\n\n this.resetPermainan = () => {\n for (var i = 0; i < this.daftarPemain.length; i++) {\n this.daftarPemain.pop();\n }\n this.daftarPemain.pop();\n\n return this.daftarPemain;\n }\n}", "function trataColisoes()\n{\n //lateral esquerda - 1\n if(esfera.posicao[0] - esfera.raio < parametrosMesa.xMin)\n {\n if(ultimaColisao != 1)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 1;\n } \n }\n\n //lateral direita - 2\n if(esfera.posicao[0] + esfera.raio > parametrosMesa.xMax)\n {\n if(ultimaColisao != 2)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 2;\n } \n }\n\n //cima - 3\n if(esfera.posicao[1] - esfera.raio < parametrosMesa.zMax)\n {\n if(ultimaColisao != 3)\n {\n veloc[2] = -parametrosMesa.coeficienteRestituicao * veloc[2];\n ultimaColisao = 3; \n }\n \n }\n\n //corredor direito - 4\n if(esfera.posicao[1] - esfera.raio > -30)\n { \n if( ( (esfera.posicao[0] - esfera.raio < -19.75) && (esfera.posicao[0] + esfera.raio > -17.75) ) || \n ( (esfera.posicao[0] + esfera.raio > -18.75) && (esfera.posicao[0] - esfera.raio < -20.75) ) )\n {\n if(ultimaColisao != 4)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 4;\n } \n }\n \n\n //corredor esquerdo - 5\n if( (esfera.posicao[0] + esfera.raio > 19.04) && (esfera.posicao[0] - esfera.raio < 21.04) || \n (esfera.posicao[0] - esfera.raio < 20.04) && (esfera.posicao[0] + esfera.raio > 18.04) )\n {\n if(ultimaColisao != 5)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 5;\n } \n }\n }\n\n /*//corner direito - 6\n if(esfera.posicao[0] - esfera.posicao[1] >= 50)\n {\n if(ultimaColisao != 6)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 6;\n }\n }\n\n //corner esquerdo - 7\n if(-esfera.posicao[0] + esfera.posicao[1] >= 50){\n if(ultimaColisao != 7)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 7;\n }\n }*/\n}", "function ret_mix_range_oc(idx , tmp_mix_arr){\n\n var ppo2_bottom = document.getElementById(\"opt_ppo2_bottom\");\n var ppo2_min = document.getElementById(\"opt_ppo2_min\");\n var ppn2_max = document.getElementById(\"opt_ppn2_max\");\n\n var ppo2_bottom_idx = ppo2_bottom.options[ppo2_bottom.selectedIndex].value;\n var ppo2_min_idx = ppo2_min.options[ppo2_min.selectedIndex].value;\n var ppn2_max_idx = ppn2_max.options[ppn2_max.selectedIndex].value;\n var tmp_arr = [];\n var a = 0;\n for(c = 0 ; c < tmp_mix_arr.length ; c++){\n\n\n\n if(c + 1 == idx){\n //get current mod for selected mix\n var depth_cur_mod = travel_mix_depth_arr[ret_mix_mod_idx(tmp_mix_arr[a] , tmp_mix_arr[a+1])] * 1.0;\n\n //check current Mix MOD status\n if(depth_cur_mod == 0){\n //Auto\n //calculation of correction with altitude above sea level\n //console.log(1 / ((water_density_temperature_correction() * water_density() * 0.001 * (1)) - ((1 - height_to_bar()))));\n //calculation of correction without altitude above sea level\n var WaterDensTempCompensation = (1 / ((water_density_temperature_correction() * water_density() * 0.001 * (1))));\n\n dp_o2_max = (WaterDensTempCompensation * (ppo2_bottom_idx/(tmp_mix_arr[a]*0.01)*10)) - (10 * height_to_bar()) + 1;//+1m fixing rounding to standard\n dp_o2_min = (WaterDensTempCompensation * (ppo2_min_idx/(tmp_mix_arr[a]*0.01)*10)) - (10*height_to_bar());\n if(dp_o2_min < 1){dp_o2_min = 1;}\n if(dp_o2_min == Infinity){dp_o2_min = 1;}\n dp_ppn2_max = (WaterDensTempCompensation * (ppn2_max_idx/((100-tmp_mix_arr[a]-tmp_mix_arr[a+1])*0.01)*10)) - (10*height_to_bar()) + 1;//+1m fixing rounding to standard\n }\n else{\n //Manual\n dp_o2_max = depth_cur_mod + 1;\n dp_o2_min = 1.0;//Always from one meter depth\n dp_ppn2_max = depth_cur_mod + 1;\n\n }\n\n tmp_arr.push(dp_o2_min);\n if (dp_ppn2_max >= dp_o2_max){\n tmp_arr.push(dp_o2_max);\n }\n else\n {\n tmp_arr.push(dp_ppn2_max);\n }\n break;\n }\n a = a + 2;\n }\n\n return tmp_arr;\n}", "function seperateMaterials(invoice)\n{\n // invoicearr => invoiceno => materials : []\n // count no of materials in each invoice\n var c = 0;\n\n // find gst cess and have count\n\n console.log(\"In voice Number: \"+invoice);\n let arr = invoicearr[invoice];\n // console.log(arr);\n var materialArr = [];\n let mindex = {};\n arr.forEach((elem,i) => { \n // find gst cess\n // incr counter\n \n if (i == 0)\n {\n console.log(\"New Invoice data---\");\n // console.log(elem);\n }\n if (elem.match(/Slno(\\s)+(RITC)(\\s+)/))\n {\n // console.log(elem);\n }\n if (elem.match(/GST Cess(\\s+)(\\d+)(\\/)(\\d+)/))\n {\n c++;\n mindex[c] = i;\n }\n let s = findsurCharge(elem);\n if (s)\n {\n // console.log(\"S: \" + s)\n }\n });\n // console.log(\"Materials for invoice: \" + invoice + \" is \" + c);\n // console.log(mindex);\n for (let j in mindex)\n {\n // console.log(mindex[j]);\n // get the index of start of material and print start of material\n // console.log(arr[mindex[j] - 10]);\n let materialObj = {};\n let str = \"\";\n str += arr[mindex[j] - 11].trim() + \"### \";\n str += arr[mindex[j] - 10].trim();\n str += arr[mindex[j] - 9].trim();\n // str += arr[mindex[j] - 8].trim();\n // str += arr[mindex[j] - 7].trim() + \" ###\";\n // matearr.push(str);\n\n // index of material\n materialObj.materialNo = findMaterialIndex(str);\n // HSN code\n materialObj.HSNCode = findMaterialRITC(str);\n //BCD Amt(RS)\n materialObj.BCD = findBCD(arr[mindex[j] - 8].trim());\n //Ass value\n materialObj.AssVal = findAssVal(arr[mindex[j] - 7].trim());\n //Social Welfare Surcharge\n materialObj.surCharge = findsurCharge(arr[mindex[j] - 2].trim());\n //IGST\n materialObj.IGST = findIGST(arr[mindex[j] - 1].trim());\n //des\n let desObj = findDes(str);\n // console.log(desObj);\n materialObj.desOfGoods = desObj.desOfGoods;\n materialObj.partCode = desObj.partCode;\n materialObj.quantity = desObj.quantity;\n\n materialObj.invoice = invoice;\n let invobj = invoiceDetails.find(xx => xx.invoice === invoice);\n materialObj.invoiceDate = invobj.vendorDate;\n materialObj.vendorName = invobj.vendorName;\n materialObj.boeNo = boeNo;\n materialObj.boeDate = boeDate;\n materialObj.inVoiValue = invobj.inVoiValue;\n materialObj.exchangeRate = invobj.exchangeRate;\n materialObj.CHA = invobj.CHA;\n materialObj.amtInINR = findAmtINR(materialObj.exchangeRate, materialObj.inVoiValue);\n materialObj.cntryOrg = cntryOrg;\n materialObj.airBillNo = airBillNo;\n materialObj.airBillDt = airBillDt;\n materialArr.push(materialObj);\n }\n console.log(materialArr);\n}", "function goukei_4_10() {\n var total_c1 = 0;\n var total_c2 = 0;\n var total_c3 = 0;\n var total_c4 = 0;\n if (vm.property.men4_10_5 && vm.property.men4_10_5.length > 0) {\n vm.property.men4_10_5.forEach(function (item) {\n total_c1 += item.c1;\n total_c2 += item.c2;\n total_c3 += item.c3;\n var c4 = item.c2 + item.c3;\n item.c4 = c4;\n total_c4 += c4;\n });\n }\n\n vm.property.men4_10_1 = total_c1;\n vm.property.men4_10_2 = total_c2;\n vm.property.men4_10_3 = total_c3;\n vm.property.men4_10_4 = total_c4;\n }", "function paz(){\n\tDepartamento = new Array('<p>La Paz</p>');\n\tHistoria = new Array('<p class=\"text-justify\">La Paz es un departamento de El Salvador ubicado en la zona oriental del país. Limita al Norte con la república de Honduras; al Sur y al Oeste con el departamento de San Miguel, y al Sur y al Este con el departamento de La Unión. Su cabecera departamental es San Francisco. Morazán comprende un territorio de 1 447 km² y cuenta con una población de 181 285 habitantes.</p>');\n\t/*Declaracion de Variable Interna para recorrer el arreglo de Municipios,\n\tde la Misma manera para recorrer los elementos de otros arreglos*/\n\tvar Municipioss, Municipioss2, rios, lagos, volcanes, centertour, personaje;\n\tMunicipioss = \"\";\n\tMunicipios = new Array('<ol><span class=\"glyphicon glyphicon-home\"></span> La Union</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Yucuaiquin</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Intipuca</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> El Carmen</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Bolivar</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Santa Rosa de Lima</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Anamoros</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Concepcion de Oriente</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Lislique </ol>');\n\tfor(i = 0; i < Municipios.length; i++){\n\t\tMunicipioss += Municipios[i];\n\t}\n\tMuniciipios2 = new Array('<ol><span class=\"glyphicon glyphicon-home\"></span> San Alejo</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Conchagua</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> San Jose</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Yayantique</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Meanguera del Golfo</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Pasaquina</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Nueva Esparta</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Poloros</ol>');\n\tfor(m = 0; m< Municiipios2.length; m++){\n\t\tMunicipioss2 += Municiipios2[m];\n\t}\n\tRios = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> PLaya El Jaguey</ol>', '<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Playa Blanca</ol>');\n\trios = \"\";\n\tfor(j = 0; j < Rios.length; j++){\n\t\trios += Rios[j];\n\t}\n\tVolcanes = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Volcan Conchagua</ol>');\n\tPersonajes = new Array('<ol><span class=\"glyphicon glyphicon-ok\"></span> Antonio Grau Mora</ol>', '<ol><span class=\"glyphicon glyphicon-ok\"></span> Maria Cegarra Salcedo</ol>', '<ol><span class=\"glyphicon glyphicon-ok\"></span> Asensio Saez</ol>');\n\tpersonaje = \"\";\n\tfor(k = 0; k < Personajes.length; k++){\n\t\tpersonaje += Personajes[k];\n\t}\n\tCentroTour = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Parque de la Familia</ol>', '<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Bosque Conchagua</ol>');\n\tcentertour = \"\";\n\tfor(c = 0; c < CentroTour.length; c++){\n\t\tcentertour += CentroTour[c];\n\t}\n\n\tdocument.getElementById(\"Departament\").innerHTML = Departamento[0];\n\tdocument.getElementById(\"History\").innerHTML = Historia[0];\n\tdocument.getElementById(\"Municipio\").innerHTML = Municipioss;\n\tdocument.getElementById(\"Municipio2\").innerHTML = Municipioss2;\n\tdocument.getElementById(\"centro\").innerHTML = centertour;\n\tdocument.getElementById(\"Persons\").innerHTML = personaje;\n\tdocument.getElementById(\"river\").innerHTML = rios;\n\tdocument.getElementById(\"volca\").innerHTML = Volcanes[0];\n}", "function pos_app_pa(njd,AR,DE,P,LAT,LON,ALT){\n\n // calcola la posizione apparente di un astro - nutazione - aberrazione della luce e parallasse geocentrica.\n // nutazione e aberrazione.\n\nvar cnutab=pos_app(njd,AR,DE); // applica la correzione per la nutazione e l'aberrazione.\n\nvar ARna=cnutab[0]; // ascensione retta.\nvar DEna=cnutab[1]; // declinazione.\n\n // parallasse.\n\nvar cpar= cor_parall(njd,ARna,DEna,P,LAT,LON,ALT); // applica la correzione per la parallasse geocentrica.\n\nvar ARp=cpar[0]; // ascensione retta.\nvar DEp=cpar[1]; // declinazione.\n\nvar RID_COORD=new Array(ARp,DEp); //coordinate equatoriali ridotte. \n\nreturn RID_COORD;\n\n}", "getCaminosArbol(t) {\n if(this.t > t) return [];\n let retorno = this.caminosHijos;\n\n this.hijos.forEach(function (e) {\n retorno = retorno.concat(e.getCaminosArbol(t));\n }, this);\n\n return retorno;\n }", "function pos_pianeti(njd,np){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) novembre 2010\n // calcola la posizione dei pianeti \n // njd= numero del giorno giuliano della data in T.U.\n // np= numero identificativo del pianeta 0,1,2,3,4,5,6,7,8 mercurio,venere... 2 per la Terra\n // coordinate geocentriche del pianeta riferite all'equinozio della data (njd).\n // calcola le principali perturbazioni planetarie.\n\n // new Array(Periodo , Long_media , Anomalia_media , Long_perielio , eccentr , Semiasse , Inclinazione , Long_nodo , dim_ang , magnitudine);\n // 0 1 2 3 4 5 6 7 8 9\n\n var tempo_luce=t_luce(njd,np);\n \n njd=njd-tempo_luce; // correzione per il tempo luce.\n\n var el_orb=orb_plan(njd,np); // recupera gli elementi orbitali del pianeta.\n\n var periodo= el_orb[0]; // periodo.\n var L= el_orb[1]; // longitudine media all'epoca.\n var AM_media= el_orb[2]; // anomalia media. \n var long_peri= el_orb[3]; // longitudine del perielio.\n var eccent= el_orb[4]; // eccentricità dell'orbita.\n var semiasse= el_orb[5]; // semiasse maggiore.\n var inclinaz= el_orb[6]; // inclinazione.\n var long_nodo= el_orb[7]; // longitudine del nodo.\n var dimens= el_orb[8]; // dimensioni apparenti.\n var magn= el_orb[9]; // magnitudine.\n\n \n var correzioni_orb=pos_pianeticr(njd,np); // calcolo delle correzioni per il pianeta (np).\n \n// Array(Delta_LP , Delta_R , Delta_LL , Delta_AS , Delta_EC , Delta_MM , Delta_LAT_ELIO);\n// 0 1 2 3 4 5 6 \n// lperiodo, rvett long. assemagg ecc M lat\n\n// CORREZIONI \n\n L=L+correzioni_orb[0]; // longitudine media.\n AM_media= AM_media+correzioni_orb[5]; // anomalia media + correzioni..\n semiasse= semiasse+correzioni_orb[3]; // semiasse maggiore.\n eccent= eccent+correzioni_orb[4]; // eccentricità.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ***************************************************** inizio:\n\n var M=AM_media; // anomalia media \n \n M=gradi_360(M); // intervallo 0-360;\n\n var E=eq_keplero(M,eccent); // equazione di Keplero.E[0]=Anomalia eccentrica E[1]=Anomalia vera in radianti.\n \n var rv=semiasse*(1-eccent*Math.cos(E[0])); // calcolo del raggio vettore (distanza dal Sole).\n rv=rv+correzioni_orb[1]; // raggio vettore più correzione.\n\n\n var U=gradi_360(L+Rda(E[1])-M-long_nodo); // argomento della latitudine.\n\n var long_eccliticay=Math.cos(Rad(inclinaz))*Math.sin(Rad(U));\n var long_eccliticax=Math.cos(Rad(U));\n\n var long_ecclitica=quadrante(long_eccliticay,long_eccliticax)+long_nodo;\n var l=gradi_360(long_ecclitica);\n l=l+correzioni_orb[2]; // longitudine del pianeta + correzione.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ********************************************************* fine: \n\n var b=Rda(Math.asin(Math.sin(Rad(U))*Math.sin(Rad(inclinaz)))); // latitudine ecclittica in gradi (b)\n\n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** inizio:\n\n njd=njd+tempo_luce; \n\n var eff_sole=pos_sole(njd);\n var LS=eff_sole[2]; // longitudine geocentrica del Sole.\n var RS=eff_sole[4]; // raggio vettore.\n \n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** fine: \n\n // longitudine geocentrica.\n\n var Y=rv*Math.cos(Rad(b))*Math.sin(Rad(l-LS));\n var X=rv*Math.cos(Rad(b))*Math.cos(Rad(l-LS))+RS;\n\n var long_geo=gradi_360(quadrante(Y,X)+LS); // longitudine geocentrica.\n\n var dist_p=Y*Y+X*X+(rv*Math.sin(Rad(b)))*(rv*Math.sin(Rad(b))); \n dist_p=Math.sqrt(dist_p); // distanza del pianeta dalla Terra.\n\n var beta=(rv/dist_p)*Math.sin(Rad(b));\n var lat_geo=Rda(Math.asin(beta));\n lat_geo=lat_geo+correzioni_orb[6]; // latitudine + correzione.\n\n \n// fase del pianeta.\n\nvar fase=0.5*(1+Math.cos(Rad(long_geo-long_ecclitica)));\n fase=fase.toFixed(2);\n\n// parallasse del pianeta in gradi.\n\nvar pa=(8.794/dist_p)/3600;\n\nvar coo_pl=trasf_ecli_equa(njd,long_geo,lat_geo); // coordinate equatoriali. \n\n // diametro apparente in secondi d'arco.\n\nvar diam_app=dimens/dist_p; \n\n// magnitudine del pianeta.\n\nvar magnitudine=(5*(Math.log(rv*dist_p/(magn*Math.sqrt(fase))))/2.302580)-27.7;\n magnitudine=magnitudine.toFixed(1);\n\nif (magnitudine==Infinity) {magnitudine=\"nd\"; }\n\nvar elongaz=elong(coo_pl[0],coo_pl[1],eff_sole[0],eff_sole[1]); // elongazione in gradi dal Sole.\n \n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_p; // distanza pianeta-terra.\n var Dts= RS; // distanza terra-sole.\n var Dps= rv; // distanza pianeta-sole.\n\n // teorema del coseno\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-Math.abs(elongaz)-delta_fase; // angolo di fase in gradi.\n \nvar dati_pp= new Array(coo_pl[0],coo_pl[1],fase,magnitudine,dist_p,diam_app,elongaz,LS,RS,long_ecclitica,pa,rv,angolo_fase);\n// 0 1 2 3 4 5 6 7 8 9 10 11 12 \n\n\n\n// risultati: ARetta,Declinazione,fase,magnitudine,distanza pianeta,diametro apparente, elongazione, long. sole,raggio vettore Terra, longituddine elio. pianeta, parallase,dist sole-pianeta. \n\nreturn dati_pp;\n}", "function calculaMEdiana(lista){\n\n\nconst ordenarlist= ordenarListaMe1(lista);\nconst mitadLista1 = parseInt(ordenarlist.length/2);\n\n\nfunction esPar(numerito){\n if (numerito%2 === 0){\n return true;\n }else{\n return false;\n }\n}\n\nlet mediana;\n\n\nif (esPar(ordenarlist.length)){\n const elemento1 =lista1[mitadLista1-1] ;\n const elemento2 = lista1[mitadLista1];\n const promedio1y2 = calcularMediaAritmetica([elemento1,elemento2]);\n mediana = promedio1y2\n}else{\n mediana = lista1[mitadLista1];\n}\n\nreturn mediana;\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}", "LanzarBomba(num){\n return this.bomba[num];\n\n }", "function Puissance4(lig,col,l,c){\r\n //commencement de l'analyse\r\n console.log(\"Valeurs: \"+lig+\" \"+col+\" / Incrément \"+i+ \" \"+c);\r\n if(c == 0 && l == 0){\r\n //pour moi c'est inversé a verticale, b horizontal, c diag gauche et d diag droit\r\n // horizontalité\r\n var va = 1 +Puissance4(lig +1,col,1,0) + Puissance4(lig-1,col,-1,0);\r\n // verticalité\r\n var vb = 1 +Puissance4(lig,col+1,0,1) + Puissance4(lig,col-1,0,-1);\r\n // diagonale de droite\r\n var vc = 1 +Puissance4(lig+1,col+1,1,1) + Puissance4(lig-1,col-1,-1,-1); \r\n // diagonale de gauche\r\n var vd = 1 +Puissance4(lig-1,col+1,-1,1) + Puissance4(lig+1,col-1,1,-1);\r\n console.log(va,vb,vc,vd);\r\n if(va == 4 || vb == 4 || vc == 4 || vd == 4)return true;\r\n else return false; \r\n }\r\n //On vérifie que \"lig\" et \"col\" ne sortent pas du tableau \r\n if (lig<this.ligne && lig>=0 && col<this.colonne && col>=0){\r\n if(this.plateau[lig][col]==joueur){\r\n return 1+ Puissance4(lig + l, col + c, l, c);}\r\n else {return 0;}\r\n }\r\n else return 0;\r\n }", "compareDna (pAequor) {\n let identicalResults = 0;\n for (let i = 0; i < 15; i++) {\n if (this.dna[i] === pAequor.dna[i]) {\n identicalResults += 1;\n } \n }\n const percentage = identicalResults / this.dna.length * 100;\n console.log(`Specimen ${this.specimenNum} and specimen ${pAequor.specimenNum} have ${percentage.toFixed \n (2)}% in common.`);\n }", "function verifMangerPomme() {\n if (xPomme == xSerp && yPomme == ySerp) {\n initPositionPomme();\n tempsPomme = 0;\n score += 10 + 3*bodySerp.length;\n niveau += Math.trunc(score/300);\n tailleBody +=5;\n afficheScore();\n }else if (tempsPomme++ > tempsMaxPomme) {\n initPositionPomme();\n tempsPomme = 0;\n }\n }", "isInsiemeTotalmenteOrdinato(a, b) {\n var a1 = [], b1 = [];\n let index = 0;\n for (let i = 0; i < a.length; i++) {\n if (!a1.includes(a[i])) {\n a1[index] = a[i];\n b1[index] = b[i];\n index++;\n }\n }\n for (let i = 0; i < a1.length; i++) {\n for (let j = 0; j < b1.length; j++) {\n let sx = a1[i];\n let dx = b1[j];\n let match = false;\n if (sx !== dx) {\n for (let k = 0; k < a.length; k++) {\n if ((a[k] === sx && b[k] === dx) || (a[k] === dx && b[k] === sx)) {\n match = true;\n break;\n }\n }\n if (!match)\n return false;\n }\n }\n }\n return true;\n }", "piquesAleatoire() {\n\t\t// position y aleatoire pour 4 piques\n\t\tlet tirage = [];\n\t\twhile (tirage.length < 4) {\n\t\t\tlet nombreAleatoire = Math.round(Utl.aleatoire(4, 12));\n\t\t\tif (tirage.indexOf(nombreAleatoire) === -1) {\n\t\t\t\ttirage.push(nombreAleatoire);\n\t\t\t}\n\t\t}\n\t\treturn tirage;\n\t}", "function tukarBesarKecil(kalimat) {\n // INISIALISASI VARIABEL LIBRARY ABJAD DAN INDEKS ABJAD\n var lowAbjad = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];\n\n var upAbjad = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];\n\n var indexAbjad = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26];\n\n var i = 0;\n\n var resultOfTransform = [];\n\n // FUNCTION MENGECEK HURUF LOWERCASE\n function isItLowercase(huruf) {\n for (let i=0; i<lowAbjad.length; i++) {\n if (huruf === lowAbjad[i]) {\n return true;\n }\n }\n }\n\n // FUNCTION MENGECEK HURUF UPPERCASE\n function isItUppercase(huruf) {\n for (let i=0; i<upAbjad.length; i++) {\n if (huruf === upAbjad[i]) {\n return true;\n }\n }\n }\n\n // MENGAMBIL HURUF DARI ARRAY KALIMAT DAN MELAKUKAN PENGECEKAN UP/LOW CASE\n for (i; i<kalimat.length; i++) {\n // find indexAbjad of kalimat[i]\n var character = kalimat[i];\n //console.log(character);\n if (isItUppercase(character) === true) {\n // check indeks abjad\n for (var j=0; j<upAbjad.length; j++) {\n if (character === upAbjad[j]) {\n // transform to lowercase\n resultOfTransform.push(lowAbjad[j]);\n }\n }\n } else if (isItLowercase(character) === true) {\n for (var k=0; k<lowAbjad.length; k++) {\n if (character === lowAbjad[k]) {\n // transform to uppercase\n resultOfTransform.push(upAbjad[k]);\n }\n }\n } else { // mengembalikan nilai kalimat[i] sesuai nilai asal\n resultOfTransform.push(kalimat[i]);\n }\n }\n\n // merubah array resToString ke dalam bentuk STRING\n var resToString = resultOfTransform.toString();\n var finalResult = '';\n\n // membuang setiap tanda koma hasil dari transform array ke string\n for (var m=0; m<resToString.length; m++) {\n if (resToString[m] !== ',') {\n finalResult += resToString[m];\n }\n }\n\n // mengembalikan hasil\n return finalResult;\n}", "getNodosArbol(t) {\n // debugger;\n if(this.t > t) return [];\n let retorno = [this];\n this.hijos.forEach(function (e) {\n retorno = retorno.concat(e.getNodosArbol(t));\n }, this);\n\n return retorno;\n }", "function ordenarListaMe2(listao){\n\n let aux=[];\n let tam=listao.length;\n \n for(let j=0;j<tam; j++ ){\n console.log(tam);\n console.log(\"Estamos en la vueltaPrimerfase #\"+j);\n for(let i=0;i<=tam-1; i++){\n console.log(\"Estamos en la vuelta2dafase #\"+i);\n if(listao[i]>listao[i+1]){\n aux=listao[i];\n listao[i]=listao[i+1];\n listao[i+1]=aux;\n \n }\n } \n \n }\n return console.log(listao); \n }", "function cumpleanos(persona){\n return{\n ...persona,\n edad: persona.edad + 1\n }\n}", "ajuste_potencia(){\n if (this.energia_disponible()){\n let danio_total = this.calcular_danio_total();\n let inyect_total = this.inyectores_disponibles();\n let plasma_inyector = (danio_total+this._plasma_requerido - inyect_total * limit_plasma)/this.inyectores_disponibles();\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i]._danio_por!==100){\n if (plasma_inyector<0){\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder()+plasma_inyector;\n } else {\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder();\n this._injectores[i].set_extra_plasma = plasma_inyector;\n\n }\n }\n }\n this._potencia_disponible = true;\n } else {\n this._potencia_disponible = false;\n\n }\n }", "function pokreniKviz(){\r\n // niz koji popunjavamo tekstom pitanja i ponudjenim odgovorima\r\n // niz ce sadrzati HTML elemente\r\n const output = [];\r\n // prolazimo petljom kroz sve elemente niza pitanja\r\n // uzimamo pitanje koje je aktuelno u trenutnoj iteraciji i njegov indeks\r\n pitanja.forEach(function(trenutnoPitanje, pitanjeInd){\r\n // niz koji cemo popuniti odgovorima na trenutno pitanje\r\n const odgovori = []; \r\n // petlja koja prolazi svim odgovorima trenutnog pitanja\r\n for(slovo in trenutnoPitanje.odgovori){\r\n // u niz odgovora dodajemo HTML kod za prikaz ponudjenog odgovora\r\n // inputi za odgovor na isto pitanje moraju imati isti name atribut\r\n // odradjujemo da svaki od njih ima name=\"odogovor\"+indeks_trenutnog_pitanja\r\n // na taj nacin ce svi ponudjeni odgovori na pitanje sa indeksom 1 imati name=\"odgovor1\"\r\n // vrijednost odgovora je upravo ono slovo pod kojim je on i ponudjen\r\n // tekst je oblika: \" a : tekst_odgovora \"\r\n odgovori.push(\r\n `<label>\r\n <input type=\"radio\" name=\"odgovor${pitanjeInd}\" value=\"${slovo}\" >\r\n ${slovo} : ${trenutnoPitanje.odgovori[slovo]}\r\n </label>`\r\n );\r\n }\r\n // na kraju u output niz koji sadrzi sva pitanja i ponudjene odgovore dodajemo trenutno\r\n // trenutnoPitanje.pitanje je tekst pitanja\r\n // funkcija join od niza pravi string\r\n output.push(\r\n `\r\n <div class=\"pitanje\">${trenutnoPitanje.pitanje}</div>\r\n <div class=\"odgovori\"> ${odgovori.join('')} </div>\r\n `\r\n );\r\n });\r\n // na kraju popunjavamo div za prikaz pitanja i odgovora\r\n kvizDiv.innerHTML = output.join('');\r\n}", "function mengelompokkanAngka(arr) {\n // you can only write your code here!\n // let genap = []\n let newArr = [[],[],[]]\n // let ganjil = []\n // let kelipatan3 =[]\n for(i=0; i<arr.length; i++) {\n if(arr[i] % 2 == 0 && arr[i] % 3 !== 0) {\n newArr[0].push(arr[i])\n // newArr.push(genap);\n // console.log(genap)\n }\n else if(arr[i] % 2 !== 0 && arr[i] % 3 !== 0) {\n newArr[1].push(arr[i])\n // newArr.push(ganjil)\n // console.log(ganjil)\n }\n else if(arr[i] % 3 == 0) {\n newArr[2].push(arr[i])\n // newArr.push(kelipatan3)\n // console.log(newArr)\n }\n }\n return newArr\n}", "function englobarymostrardivoep(habp,habr,habmv,habant,pplan,preal,pmv,pant,v3){\n\n\n \t//////////////////////////////////PLAN HABILITADORAS ////////////////////////////////////////////////\t\t\t\n\t\t\t\t\t\t// ESFUERZO PROPIO PLAN EN BOLIVARES \t\t\t\t\t\n\t\t\t\t\t\tvar laborepbsf = filtrarcostohab(habp,filtrolabor,5,'_p',1);\n\t\t\t\t\t\tvar bbepbsf = filtrarcostohab(habp,filtrobb,5,'_p',1);\n\t\t\t\t\t\tvar mepbsf = filtrarcostohab(habp,filtrom,5,'_p',1);\n\t\t\t\t\t\tvar scepbsf = filtrarcostohab(habp,filtrosc,5,'_p',1);\n\t\t\t\t\t\tvar oepbsf = filtrarcostohab(habp,filtroo,5,'_p',1);\n\t\t\t\t\t\tvar totalepbsf = filtrartotal(laborepbsf,bbepbsf,mepbsf,scepbsf,oepbsf);\n \n \t\t\t\t\t\t \t\t // ESFUERZOS PROPIOS PLAN EN DOLARES\n \t\t\t\t\t\t var laborepdol = filtrarcostohab(habp,filtrolabor,5,'_p',2);\n \t\t\t\t\t\t var bbepdol = filtrarcostohab(habp,filtrobb,5,'_p',2);\n \t\t\t\t\t\t var mepdol = filtrarcostohab(habp,filtrom,5,'_p',2);\n \t\t\t\t\t\t var scepdol = filtrarcostohab(habp,filtrosc,5,'_p',2);\n \t\t\t\t\t\t var oepdol = filtrarcostohab(habp,filtroo,5,'_p',2);\n \t\t\t\t\t\t var totalepdol = filtrartotal(laborepdol,bbepdol,mepdol,scepdol,oepdol);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN BOLIVARES\n\t\t\t\t\t \t var labordttobsf = filtrarcostohab(habp,filtrolabor,4,'_p',1);\n \t\t\t\t\t\t var bbdttobsf = filtrarcostohab(habp,filtrobb,4,'_p',1);\n \t\t\t\t\t\t var mdttobsf = filtrarcostohab(habp,filtrom,4,'_p',1);\n \t\t\t\t\t\t var scdttobsf = filtrarcostohab(habp,filtrosc,4,'_p',1);\n \t\t\t\t\t\t var odttobsf = filtrarcostohab(habp,filtroo,4,'_p',1);\n \t\t\t\t\t\t var totaldttobsf = filtrartotal(labordttobsf,bbdttobsf,mdttobsf,scdttobsf,odttobsf);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordttodol = filtrarcostohab(habp,filtrolabor,4,'_p',2);\n \t\t\t\t\t\t var bbdttodol = filtrarcostohab(habp,filtrobb,4,'_p',2);\n \t\t\t\t\t\t var mdttodol = filtrarcostohab(habp,filtrom,4,'_p',2);\n \t\t\t\t\t\t var scdttodol = filtrarcostohab(habp,filtrosc,4,'_p',2);\n \t\t\t\t\t\t var odttodol = filtrarcostohab(habp,filtroo,4,'_p',2);\n \t\t\t\t\t\t var totaldttodol = filtrartotal(labordttodol,bbdttodol,mdttodol,scdttodol,odttodol);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN BOLIVARES\n \t\t\t\t\t\t var labordivobsf = filtrardivo(labordttobsf,laborepbsf);\n \t\t\t\t\t\t var bbdivobsf = filtrardivo(bbdttobsf,bbepbsf);\n \t\t\t\t\t\t var mdivobsf = filtrardivo(mdttobsf,mepbsf);\n \t\t\t\t\t\t var scdivobsf = filtrardivo(scdttobsf,scepbsf);\n \t\t\t\t\t\t var odivobsf = filtrardivo(odttobsf,oepbsf);\n \t\t\t\t\t\t var totaldivobsf = filtrartotal(labordivobsf,bbdivobsf,mdivobsf,scdivobsf,odivobsf);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordivodol = filtrardivo(labordttodol,laborepdol);\n \t\t\t\t\t\t var bbdivodol = filtrardivo(bbdttodol,bbepdol);\n \t\t\t\t\t\t var mdivodol = filtrardivo(mdttodol,mepdol);\n \t\t\t\t\t\t var scdivodol = filtrardivo(scdttodol,scepdol);\n \t\t\t\t\t\t var odivodol = filtrardivo(odttodol,oepdol);\n \t\t\t\t\t\t var totaldivodol = filtrartotal(labordivodol,bbdivodol,mdivodol,scdivodol,odivodol);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqv = filtroequivalente(labordivobsf,labordivodol);\n \t\t\t\t\t\t var bbdivoDeqv = filtroequivalente(bbdivobsf,bbdivodol);\n \t\t\t\t\t\t var mdivoDeqv = filtroequivalente(mdivobsf,mdivodol);\n \t\t\t\t\t\t var scdivoDeqv = filtroequivalente(scdivobsf,scdivodol);\n \t\t\t\t\t\t var odivoDeqv = filtroequivalente(odivobsf,odivodol);\n \t\t\t\t\t\t var totaldivoDeqv = filtrartotal(labordivoDeqv,bbdivoDeqv,mdivoDeqv,scdivoDeqv,odivoDeqv);\n\n \t\t\t\t\t\t ////////////////////// FIN PLAN ////////////////////////////////////////////////\n\n\n\n \t\t\t\t\t\t ////////////////REAL HABILITADORAS /////////////////////////\n\t\t\t\t\t\t\t\t// ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfr = filtrarcostohab(habr,filtrolabor,5,'_r',1);\n \t\t\t\t\t\t var bbepbsfr = filtrarcostohab(habr,filtrobb,5,'_r',1);\n \t\t\t\t\t\t var mepbsfr = filtrarcostohab(habr,filtrom,5,'_r',1);\n \t\t\t\t\t\t var scepbsfr = filtrarcostohab(habr,filtrosc,5,'_r',1);\n \t\t\t\t\t\t var oepbsfr = filtrarcostohab(habr,filtroo,5,'_r',1);\n \t\t\t\t\t\t var totalepbsfr = filtrartotal(laborepbsfr,bbepbsfr,mepbsfr,scepbsfr,oepbsfr);\n\n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolr = filtrarcostohab(habr,filtrolabor,5,'_r',2);\n \t\t\t\t\t\t var bbepdolr = filtrarcostohab(habr,filtrobb,5,'_r',2);\n \t\t\t\t\t\t var mepdolr = filtrarcostohab(habr,filtrom,5,'_r',2);\n \t\t\t\t\t\t var scepdolr = filtrarcostohab(habr,filtrosc,5,'_r',2);\n \t\t\t\t\t\t var oepdolr = filtrarcostohab(habr,filtroo,5,'_r',2);\n \t\t\t\t\t\t var totalepdolr = filtrartotal(laborepdolr,bbepdolr,mepdolr,scepdolr,oepdolr);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfr = filtrarcostohab(habr,filtrolabor,4,'_r',1);\n \t\t\t\t\t\t var bbdttobsfr = filtrarcostohab(habr,filtrobb,4,'_r',1);\n \t\t\t\t\t\t var mdttobsfr = filtrarcostohab(habr,filtrom,4,'_r',1);\n \t\t\t\t\t\t var scdttobsfr = filtrarcostohab(habr,filtrosc,4,'_r',1);\n \t\t\t\t\t\t var odttobsfr = filtrarcostohab(habr,filtroo,4,'_r',1);\n \t\t\t\t\t\t var totaldttobsfr = filtrartotal(labordttobsfr,bbdttobsfr,mdttobsfr,scdttobsfr,odttobsfr);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolr = filtrarcostohab(habr,filtrolabor,4,'_r',2);\n \t\t\t\t\t\t var bbdttodolr = filtrarcostohab(habr,filtrobb,4,'_r',2);\n \t\t\t\t\t\t var mdttodolr = filtrarcostohab(habr,filtrom,4,'_r',2);\n \t\t\t\t\t\t var scdttodolr = filtrarcostohab(habr,filtrosc,4,'_r',2);\n \t\t\t\t\t\t var odttodolr = filtrarcostohab(habr,filtroo,4,'_r',2);\n \t\t\t\t\t\t var totaldttodolr = filtrartotal(labordttodolr,bbdttodolr,mdttodolr,scdttodolr,odttodolr);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfr = filtrardivo(labordttobsfr,laborepbsfr);\n \t\t\t\t\t\t var bbdivobsfr = filtrardivo(bbdttobsfr,bbepbsfr);\n \t\t\t\t\t\t var mdivobsfr = filtrardivo(mdttobsfr,mepbsfr);\n \t\t\t\t\t\t var scdivobsfr = filtrardivo(scdttobsfr,scepbsfr);\n \t\t\t\t\t\t var odivobsfr = filtrardivo(odttobsfr,oepbsfr);\n \t\t\t\t\t\t var totaldivobsfr = filtrartotal(labordivobsfr,bbdivobsfr,mdivobsfr,scdivobsfr,odivobsfr);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolr = filtrardivo(labordttodolr,laborepdolr);\n \t\t\t\t\t\t var bbdivodolr = filtrardivo(bbdttodolr,bbepdolr);\n \t\t\t\t\t\t var mdivodolr = filtrardivo(mdttodolr,mepdolr);\n \t\t\t\t\t\t var scdivodolr = filtrardivo(scdttodolr,scepdolr);\n \t\t\t\t\t\t var odivodolr = filtrardivo(odttodolr,oepdolr);\n \t\t\t\t\t\t var totaldivodolr = filtrartotal(labordivodolr,bbdivodolr,mdivodolr,scdivodolr,odivodolr);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvr = filtroequivalente(labordivobsfr,labordivodolr);\n \t\t\t\t\t\t var bbdivoDeqvr = filtroequivalente(bbdivobsfr,bbdivodolr);\n \t\t\t\t\t\t var mdivoDeqvr = filtroequivalente(mdivobsfr,mdivodolr);\n \t\t\t\t\t\t var scdivoDeqvr = filtroequivalente(scdivobsfr,scdivodolr);\n \t\t\t\t\t\t var odivoDeqvr = filtroequivalente(odivobsfr,odivodolr);\n \t\t\t\t\t\t var totaldivoDeqvr = filtrartotal(labordivoDeqvr,bbdivoDeqvr,mdivoDeqvr,scdivoDeqvr,odivoDeqvr);\n\n \t\t\t\t\t\t /////////////FIN REAL ////////////////////////////////////////////////\n\n \t\t\t\t\t\t //////////////// MEJOR VISION ///////////////////////////////////////////////\n \t\t\t\t\t\t // ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfmv = filtrarcostohab(habmv,filtrolabor,5,'_mv',1);\n \t\t\t\t\t\t var bbepbsfmv = filtrarcostohab(habmv,filtrobb,5,'_mv',1);\n \t\t\t\t\t\t var mepbsfmv = filtrarcostohab(habmv,filtrom,5,'_mv',1);\n \t\t\t\t\t\t var scepbsfmv = filtrarcostohab(habmv,filtrosc,5,'_mv',1);\n \t\t\t\t\t\t var oepbsfmv = filtrarcostohab(habmv,filtroo,5,'_mv',1);\n \t\t\t\t\t\t var totalepbsfmv = filtrartotal(laborepbsfmv,bbepbsfmv,mepbsfmv,scepbsfmv,oepbsfmv);\n \t\t\t\t\t\t \n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolmv = filtrarcostohab(habmv,filtrolabor,5,'_mv',2);\n \t\t\t\t\t\t var bbepdolmv = filtrarcostohab(habmv,filtrobb,5,'_mv',2);\n \t\t\t\t\t\t var mepdolmv = filtrarcostohab(habmv,filtrom,5,'_mv',2);\n \t\t\t\t\t\t var scepdolmv = filtrarcostohab(habmv,filtrosc,5,'_mv',2);\n \t\t\t\t\t\t var oepdolmv = filtrarcostohab(habmv,filtroo,5,'_mv',2);\n \t\t\t\t\t\t var totalepdolmv = filtrartotal(laborepdolmv,bbepdolmv,mepdolmv,scepdolmv,oepdolmv);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfmv = filtrarcostohab(habmv,filtrolabor,4,'_mv',1);\n \t\t\t\t\t\t var bbdttobsfmv = filtrarcostohab(habmv,filtrobb,4,'_mv',1);\n \t\t\t\t\t\t var mdttobsfmv = filtrarcostohab(habmv,filtrom,4,'_mv',1);\n \t\t\t\t\t\t var scdttobsfmv = filtrarcostohab(habmv,filtrosc,4,'_mv',1);\n \t\t\t\t\t\t var odttobsfmv = filtrarcostohab(habmv,filtroo,4,'_mv',1);\n \t\t\t\t\t\t var totaldttobsfmv = filtrartotal(labordttobsfmv,bbdttobsfmv,mdttobsfmv,scdttobsfmv,odttobsfmv);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolmv = filtrarcostohab(habmv,filtrolabor,4,'_mv',2);\n \t\t\t\t\t\t var bbdttodolmv = filtrarcostohab(habmv,filtrobb,4,'_mv',2);\n \t\t\t\t\t\t var mdttodolmv = filtrarcostohab(habmv,filtrom,4,'_mv',2);\n \t\t\t\t\t\t var scdttodolmv = filtrarcostohab(habmv,filtrosc,4,'_mv',2);\n \t\t\t\t\t\t var odttodolmv = filtrarcostohab(habmv,filtroo,4,'_mv',2);\n \t\t\t\t\t\t var totaldttodolmv = filtrartotal(labordttodolmv,bbdttodolmv,mdttodolmv,scdttodolmv,odttodolmv);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfmv = filtrardivo(labordttobsfmv,laborepbsfmv);\n \t\t\t\t\t\t var bbdivobsfmv = filtrardivo(bbdttobsfmv,bbepbsfmv);\n \t\t\t\t\t\t var mdivobsfmv = filtrardivo(mdttobsfmv,mepbsfmv);\n \t\t\t\t\t\t var scdivobsfmv = filtrardivo(scdttobsfmv,scepbsfmv);\n \t\t\t\t\t\t var odivobsfmv = filtrardivo(odttobsfmv,oepbsfmv);\n \t\t\t\t\t\t var totaldivobsfmv = filtrartotal(labordivobsfmv,bbdivobsfmv,mdivobsfmv,scdivobsfmv,odivobsfmv);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolmv = filtrardivo(labordttodolmv,laborepdolmv);\n \t\t\t\t\t\t var bbdivodolmv = filtrardivo(bbdttodolmv,bbepdolmv);\n \t\t\t\t\t\t var mdivodolmv = filtrardivo(mdttodolmv,mepdolmv);\n \t\t\t\t\t\t var scdivodolmv = filtrardivo(scdttodolmv,scepdolmv);\n \t\t\t\t\t\t var odivodolmv = filtrardivo(odttodolmv,oepdolmv);\n \t\t\t\t\t\t var totaldivodolmv = filtrartotal(labordivodolmv,bbdivodolmv,mdivodolmv,scdivodolmv,odivodolmv);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvmv = filtroequivalente(labordivobsfmv,labordivodolmv);\n \t\t\t\t\t\t var bbdivoDeqvmv = filtroequivalente(bbdivobsfmv,bbdivodolmv);\n \t\t\t\t\t\t var mdivoDeqvmv = filtroequivalente(mdivobsfmv,mdivodolmv);\n \t\t\t\t\t\t var scdivoDeqvmv = filtroequivalente(scdivobsfmv,scdivodolmv);\n \t\t\t\t\t\t var odivoDeqvmv = filtroequivalente(odivobsfmv,odivodolmv);\n \t\t\t\t\t\t var totaldivoDeqvmv = filtrartotal(labordivoDeqvmv,bbdivoDeqvmv,mdivoDeqvmv,scdivoDeqvmv,odivoDeqvmv);\n\n \t\t\t\t\t\tvar aux=0;\n \t\t\t\t\t\t// labor y beneficio de real, MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfr = filtrardivo(labordivobsfr,bbdivobsfr); \n \t\t\t\t\t\tvar laborybbdivodolr = filtrardivo(labordivodolr,bbdivodolr); \n \t\t\t\t\t\tvar laborybbdivoDeqvr= filtrardivo(labordivoDeqvr,bbdivoDeqvr);\n \t\t\t\t\t\t// labor y beneficio de plan MMBSF,MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsf = filtrardivo(labordivobsf,bbdivobsf); \n \t\t\t\t\t\tvar laborybbdivodol = filtrardivo(labordivodol,bbdivodol); \n \t\t\t\t\t\tvar laborybbdivoDeqv = filtrardivo(labordivoDeqv,bbdivoDeqv);\n \t\t\t\t\t\t// Labor y beneficio de mejor vision MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfmv = filtrardivo(labordivobsfmv,bbdivobsfmv); \n \t\t\t\t\t\tvar laborybbdivodolmv = filtrardivo(labordivodolmv,bbdivodolmv); \n \t\t\t\t\t\tvar laborybbdivoDeqvmv = filtrardivo(labordivoDeqvmv,bbdivoDeqvmv);\n\n\n\n \t\t\t\t\t\t////////////// HABILITADORAS ANTEPROYECTOS //////////////////////////////\n \t\t\t\t\t\t// ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfant = filtrarcostohab(habant,filtrolabor,5,'_ant',1);\n \t\t\t\t\t\t var bbepbsfant = filtrarcostohab(habant,filtrobb,5,'_ant',1);\n \t\t\t\t\t\t var mepbsfant = filtrarcostohab(habant,filtrom,5,'_ant',1);\n \t\t\t\t\t\t var scepbsfant = filtrarcostohab(habant,filtrosc,5,'_ant',1);\n \t\t\t\t\t\t var oepbsfant = filtrarcostohab(habant,filtroo,5,'_ant',1);\n \t\t\t\t\t\t var totalepbsfant = filtrartotal(laborepbsfant,bbepbsfant,mepbsfant,scepbsfant,oepbsfant);\n \t\t\t\t\t\t \n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolant = filtrarcostohab(habant,filtrolabor,5,'_ant',2);\n \t\t\t\t\t\t var bbepdolant = filtrarcostohab(habant,filtrobb,5,'_ant',2);\n \t\t\t\t\t\t var mepdolant = filtrarcostohab(habant,filtrom,5,'_ant',2);\n \t\t\t\t\t\t var scepdolant = filtrarcostohab(habant,filtrosc,5,'_ant',2);\n \t\t\t\t\t\t var oepdolant = filtrarcostohab(habant,filtroo,5,'_ant',2);\n \t\t\t\t\t\t var totalepdolant = filtrartotal(laborepdolant,bbepdolant,mepdolant,scepdolant,oepdolant);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfant = filtrarcostohab(habant,filtrolabor,4,'_ant',1);\n \t\t\t\t\t\t var bbdttobsfant = filtrarcostohab(habant,filtrobb,4,'_ant',1);\n \t\t\t\t\t\t var mdttobsfant = filtrarcostohab(habant,filtrom,4,'_ant',1);\n \t\t\t\t\t\t var scdttobsfant = filtrarcostohab(habant,filtrosc,4,'_ant',1);\n \t\t\t\t\t\t var odttobsfant = filtrarcostohab(habant,filtroo,4,'_ant',1);\n \t\t\t\t\t\t var totaldttobsfant = filtrartotal(labordttobsfant,bbdttobsfant,mdttobsfant,scdttobsfant,odttobsfant);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolant = filtrarcostohab(habant,filtrolabor,4,'_ant',2);\n \t\t\t\t\t\t var bbdttodolant = filtrarcostohab(habant,filtrobb,4,'_ant',2);\n \t\t\t\t\t\t var mdttodolant = filtrarcostohab(habant,filtrom,4,'_ant',2);\n \t\t\t\t\t\t var scdttodolant = filtrarcostohab(habant,filtrosc,4,'_ant',2);\n \t\t\t\t\t\t var odttodolant = filtrarcostohab(habant,filtroo,4,'_ant',2);\n \t\t\t\t\t\t var totaldttodolant = filtrartotal(labordttodolant,bbdttodolant,mdttodolant,scdttodolant,odttodolant);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfant = filtrardivo(labordttobsfant,laborepbsfant);\n \t\t\t\t\t\t var bbdivobsfant = filtrardivo(bbdttobsfant,bbepbsfant);\n \t\t\t\t\t\t var mdivobsfant = filtrardivo(mdttobsfant,mepbsfant);\n \t\t\t\t\t\t var scdivobsfant = filtrardivo(scdttobsfant,scepbsfant);\n \t\t\t\t\t\t var odivobsfant = filtrardivo(odttobsfant,oepbsfant);\n \t\t\t\t\t\t var totaldivobsfant = filtrartotal(labordivobsfant,bbdivobsfant,mdivobsfant,scdivobsfant,odivobsfant);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolant = filtrardivo(labordttodolant,laborepdolant);\n \t\t\t\t\t\t var bbdivodolant = filtrardivo(bbdttodolant,bbepdolant);\n \t\t\t\t\t\t var mdivodolant = filtrardivo(mdttodolant,mepdolant);\n \t\t\t\t\t\t var scdivodolant = filtrardivo(scdttodolant,scepdolant);\n \t\t\t\t\t\t var odivodolant = filtrardivo(odttodolant,oepdolant);\n \t\t\t\t\t\t var totaldivodolant = filtrartotal(labordivodolant,bbdivodolant,mdivodolant,scdivodolant,odivodolant);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvant = filtroequivalente(labordivobsfant,labordivodolant);\n \t\t\t\t\t\t var bbdivoDeqvant = filtroequivalente(bbdivobsfant,bbdivodolant);\n \t\t\t\t\t\t var mdivoDeqvant = filtroequivalente(mdivobsfant,mdivodolant);\n \t\t\t\t\t\t var scdivoDeqvant = filtroequivalente(scdivobsfant,scdivodolant);\n \t\t\t\t\t\t var odivoDeqvant = filtroequivalente(odivobsfant,odivodolant);\n \t\t\t\t\t\t var totaldivoDeqvant = filtrartotal(labordivoDeqvant,bbdivoDeqvant,mdivoDeqvant,scdivoDeqvant,odivoDeqvant);\n\n \t\t\t\t\t\t \n \t\t\t\t\t\t// Labor y beneficio de mejor vision MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfant = filtrardivo(labordivobsfant,bbdivobsfant); \n \t\t\t\t\t\tvar laborybbdivodolant = filtrardivo(labordivodolant,bbdivodolant); \n \t\t\t\t\t\tvar laborybbdivoDeqvant = filtrardivo(labordivoDeqvant,bbdivoDeqvant);\n\n\n \t\t\t\t\t\t///////PLAN PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar pgeobsf = categoriaproyectos(pplan,geofisica,'_p',1);\n \t\t\t\t\t\tvar pgeodol = categoriaproyectos(pplan,geofisica,'_p',2);\n \t\t\t\t\t\tvar pgeoDeqv = filtroequivalente(pgeobsf,pgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar pperfavanzbsf = categoriaproyectos(pplan,perfavanz,'_p',1);\n \t\t\t\t\t\tvar pperfavanzdol = categoriaproyectos(pplan,perfavanz,'_p',2);\n \t\t\t\t\t\tvar pperfavanzDeqv = filtroequivalente(pperfavanzbsf,pperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar pperfdesarrobsf = categoriaproyectos(pplan,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar pperfdesarrodol = categoriaproyectos(pplan,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar pperfdesarroDeqv = filtroequivalente(pperfdesarrobsf,pperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar pperfexplorabsf = categoriaproyectos(pplan,perfexplora,'_p',1);\n \t\t\t\t\t\tvar pperfexploradol = categoriaproyectos(pplan,perfexplora,'_p',2);\n \t\t\t\t\t\tvar pperfexploraDeqv = filtroequivalente(pperfexplorabsf,pperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar precupadicbsf = categoriaproyectos(pplan,recupadic,'_p',1);\n \t\t\t\t\t\tvar precupadicdol = categoriaproyectos(pplan,recupadic,'_p',2);\n \t\t\t\t\t\tvar precupadicDeqv = filtroequivalente(precupadicbsf,precupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar precompozosbsf = categoriaproyectos(pplan,recompozos,'_p',1);\n \t\t\t\t\t\tvar precompozosdol = categoriaproyectos(pplan,recompozos,'_p',2);\n \t\t\t\t\t\tvar precompozosDeqv = filtroequivalente(precompozosbsf,precompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar precupesuplebsf = categoriaproyectos(pplan,recupesuple,'_p',1);\n \t\t\t\t\t\tvar precupesupledol = categoriaproyectos(pplan,recupesuple,'_p',2);\n \t\t\t\t\t\tvar precupesupleDeqv = filtroequivalente(precupesuplebsf,precupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar pinyectalternavaporbsf = categoriaproyectos(pplan,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar pinyectalternavapordol = categoriaproyectos(pplan,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar pinyectalternavaporDeqv = filtroequivalente(pinyectalternavaporbsf,pinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar plevantamientoartifbsf = categoriaproyectos(pplan,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar plevantamientoartifdol = categoriaproyectos(pplan,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar plevantamientoartifDeqv = filtroequivalente(plevantamientoartifbsf,plevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar pconutigasbsf = categoriaproyectos(pplan,conutigas,'_p',1);\n \t\t\t\t\t\tvar pconutigasdol = categoriaproyectos(pplan,conutigas,'_p',2);\n \t\t\t\t\t\tvar pconutigasDeqv = filtroequivalente(pconutigasbsf,pconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar pplantliqgasbsf = categoriaproyectos(pplan,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar pplantliqgasdol = categoriaproyectos(pplan,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar pplantliqgasDeqv = filtroequivalente(pplantliqgasbsf,pplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar pinstproducbsf = categoriaproyectos(pplan,instproduc,'_p',1);\n \t\t\t\t\t\tvar pinstproducdol = categoriaproyectos(pplan,instproduc,'_p',2);\n \t\t\t\t\t\tvar pinstproducDeqv = filtroequivalente(pinstproducbsf,pinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar poleoterminaembbsf = categoriaproyectos(pplan,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar poleoterminaembdol = categoriaproyectos(pplan,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar poleoterminaembDeqv = filtroequivalente(poleoterminaembbsf,poleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar palmacenamientobsf = categoriaproyectos(pplan,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar palmacenamientodol = categoriaproyectos(pplan,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar palmacenamientoDeqv = filtroequivalente(palmacenamientobsf,palmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar pdesarrollourbabsf = categoriaproyectos(pplan,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar pdesarrollourbadol = categoriaproyectos(pplan,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar pdesarrollourbaDeqv = filtroequivalente(pdesarrollourbabsf,pdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar pproteccionintegbsf = categoriaproyectos(pplan,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar pproteccionintegdol = categoriaproyectos(pplan,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar pproteccionintegDeqv = filtroequivalente(pproteccionintegbsf,pproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar ppcpbsf = categoriaproyectos(pplan,pcp,'_p',1);\n \t\t\t\t\t\tvar ppcpdol = categoriaproyectos(pplan,pcp,'_p',2);\n \t\t\t\t\t\tvar ppcpDeqv = filtroequivalente(ppcpbsf,ppcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar ptelecomunicacionesbsf = categoriaproyectos(pplan,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar ptelecomunicacionesdol = categoriaproyectos(pplan,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar ptelecomunicacionesDeqv = filtroequivalente(ptelecomunicacionesbsf,ptelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar pautomatizacionindbsf = categoriaproyectos(pplan,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar pautomatizacioninddol = categoriaproyectos(pplan,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar pautomatizacionindDeqv = filtroequivalente(pautomatizacionindbsf,pautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar pcomputaysistebsf = categoriaproyectos(pplan,computaysiste,'_p',1);\n \t\t\t\t\t\tvar pcomputaysistedol = categoriaproyectos(pplan,computaysiste,'_p',2);\n \t\t\t\t\t\tvar pcomputaysisteDeqv = filtroequivalente(pcomputaysistebsf,pcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar pedifinstindustbsf = categoriaproyectos(pplan,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar pedifinstindustdol = categoriaproyectos(pplan,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar pedifinstindustDeqv = filtroequivalente(pedifinstindustbsf,pedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar pequiposbsf = categoriaproyectos(pplan,equipos,'_p',1);\n \t\t\t\t\t\tvar pequiposdol = categoriaproyectos(pplan,equipos,'_p',2);\n \t\t\t\t\t\tvar pequiposDeqv = filtroequivalente(pequiposbsf,pequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar potrasinvbsf = categoriaproyectos(pplan,otrasinv,'_p',1);\n \t\t\t\t\t\tvar potrasinvdol = categoriaproyectos(pplan,otrasinv,'_p',2);\n \t\t\t\t\t\tvar potrasinvDeqv = filtroequivalente(potrasinvbsf,potrasinvdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t \n \t\t\t\t\t\t\n \t\t\t\t\t\t///////REAL PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar rgeobsf = categoriaproyectos(preal,geofisica,'_p',1);\n \t\t\t\t\t\tvar rgeodol = categoriaproyectos(preal,geofisica,'_p',2);\n \t\t\t\t\t\tvar rgeoDeqv = filtroequivalente(rgeobsf,rgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar rperfavanzbsf = categoriaproyectos(preal,perfavanz,'_p',1);\n \t\t\t\t\t\tvar rperfavanzdol = categoriaproyectos(preal,perfavanz,'_p',2);\n \t\t\t\t\t\tvar rperfavanzDeqv = filtroequivalente(rperfavanzbsf,rperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar rperfdesarrobsf = categoriaproyectos(preal,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar rperfdesarrodol = categoriaproyectos(preal,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar rperfdesarroDeqv = filtroequivalente(rperfdesarrobsf,rperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar rperfexplorabsf = categoriaproyectos(preal,perfexplora,'_p',1);\n \t\t\t\t\t\tvar rperfexploradol = categoriaproyectos(preal,perfexplora,'_p',2);\n \t\t\t\t\t\tvar rperfexploraDeqv = filtroequivalente(rperfexplorabsf,rperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar rrecupadicbsf = categoriaproyectos(preal,recupadic,'_p',1);\n \t\t\t\t\t\tvar rrecupadicdol = categoriaproyectos(preal,recupadic,'_p',2);\n \t\t\t\t\t\tvar rrecupadicDeqv = filtroequivalente(rrecupadicbsf,rrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar rrecompozosbsf = categoriaproyectos(preal,recompozos,'_p',1);\n \t\t\t\t\t\tvar rrecompozosdol = categoriaproyectos(preal,recompozos,'_p',2);\n \t\t\t\t\t\tvar rrecompozosDeqv = filtroequivalente(rrecompozosbsf,rrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar rrecupesuplebsf = categoriaproyectos(preal,recupesuple,'_p',1);\n \t\t\t\t\t\tvar rrecupesupledol = categoriaproyectos(preal,recupesuple,'_p',2);\n \t\t\t\t\t\tvar rrecupesupleDeqv = filtroequivalente(rrecupesuplebsf,rrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar rinyectalternavaporbsf = categoriaproyectos(preal,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar rinyectalternavapordol = categoriaproyectos(preal,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar rinyectalternavaporDeqv = filtroequivalente(rinyectalternavaporbsf,rinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar rlevantamientoartifbsf = categoriaproyectos(preal,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar rlevantamientoartifdol = categoriaproyectos(preal,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar rlevantamientoartifDeqv = filtroequivalente(rlevantamientoartifbsf,rlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar rconutigasbsf = categoriaproyectos(preal,conutigas,'_p',1);\n \t\t\t\t\t\tvar rconutigasdol = categoriaproyectos(preal,conutigas,'_p',2);\n \t\t\t\t\t\tvar rconutigasDeqv = filtroequivalente(rconutigasbsf,rconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar rplantliqgasbsf = categoriaproyectos(preal,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar rplantliqgasdol = categoriaproyectos(preal,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar rplantliqgasDeqv = filtroequivalente(rplantliqgasbsf,rplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar rinstproducbsf = categoriaproyectos(preal,instproduc,'_p',1);\n \t\t\t\t\t\tvar rinstproducdol = categoriaproyectos(preal,instproduc,'_p',2);\n \t\t\t\t\t\tvar rinstproducDeqv = filtroequivalente(rinstproducbsf,rinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar roleoterminaembbsf = categoriaproyectos(preal,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar roleoterminaembdol = categoriaproyectos(preal,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar roleoterminaembDeqv = filtroequivalente(roleoterminaembbsf,roleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar ralmacenamientobsf = categoriaproyectos(preal,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar ralmacenamientodol = categoriaproyectos(preal,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar ralmacenamientoDeqv = filtroequivalente(ralmacenamientobsf,ralmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar rdesarrollourbabsf = categoriaproyectos(preal,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar rdesarrollourbadol = categoriaproyectos(preal,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar rdesarrollourbaDeqv = filtroequivalente(rdesarrollourbabsf,rdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar rproteccionintegbsf = categoriaproyectos(preal,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar rproteccionintegdol = categoriaproyectos(preal,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar rproteccionintegDeqv = filtroequivalente(rproteccionintegbsf,rproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar rpcpbsf = categoriaproyectos(preal,pcp,'_p',1);\n \t\t\t\t\t\tvar rpcpdol = categoriaproyectos(preal,pcp,'_p',2);\n \t\t\t\t\t\tvar rpcpDeqv = filtroequivalente(rpcpbsf,rpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar rtelecomunicacionesbsf = categoriaproyectos(preal,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar rtelecomunicacionesdol = categoriaproyectos(preal,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar rtelecomunicacionesDeqv = filtroequivalente(rtelecomunicacionesbsf,rtelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar rautomatizacionindbsf = categoriaproyectos(preal,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar rautomatizacioninddol = categoriaproyectos(preal,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar rautomatizacionindDeqv = filtroequivalente(rautomatizacionindbsf,rautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar rcomputaysistebsf = categoriaproyectos(preal,computaysiste,'_p',1);\n \t\t\t\t\t\tvar rcomputaysistedol = categoriaproyectos(preal,computaysiste,'_p',2);\n \t\t\t\t\t\tvar rcomputaysisteDeqv = filtroequivalente(rcomputaysistebsf,rcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar redifinstindustbsf = categoriaproyectos(preal,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar redifinstindustdol = categoriaproyectos(preal,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar redifinstindustDeqv = filtroequivalente(redifinstindustbsf,redifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar requiposbsf = categoriaproyectos(preal,equipos,'_p',1);\n \t\t\t\t\t\tvar requiposdol = categoriaproyectos(preal,equipos,'_p',2);\n \t\t\t\t\t\tvar requiposDeqv = filtroequivalente(requiposbsf,requiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar rotrasinvbsf = categoriaproyectos(preal,otrasinv,'_p',1);\n \t\t\t\t\t\tvar rotrasinvdol = categoriaproyectos(preal,otrasinv,'_p',2);\n \t\t\t\t\t\tvar rotrasinvDeqv = filtroequivalente(rotrasinvbsf,rotrasinvdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t \n \t\t\t\t\t\t///////MEJOR VISION PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar mvgeobsf = categoriaproyectos(pmv,geofisica,'_p',1);\n \t\t\t\t\t\tvar mvgeodol = categoriaproyectos(pmv,geofisica,'_p',2);\n \t\t\t\t\t\tvar mvgeoDeqv = filtroequivalente(mvgeobsf,mvgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar mvperfavanzbsf = categoriaproyectos(pmv,perfavanz,'_p',1);\n \t\t\t\t\t\tvar mvperfavanzdol = categoriaproyectos(pmv,perfavanz,'_p',2);\n \t\t\t\t\t\tvar mvperfavanzDeqv = filtroequivalente(mvperfavanzbsf,mvperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar mvperfdesarrobsf = categoriaproyectos(pmv,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar mvperfdesarrodol = categoriaproyectos(pmv,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar mvperfdesarroDeqv = filtroequivalente(mvperfdesarrobsf,mvperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar mvperfexplorabsf = categoriaproyectos(pmv,perfexplora,'_p',1);\n \t\t\t\t\t\tvar mvperfexploradol = categoriaproyectos(pmv,perfexplora,'_p',2);\n \t\t\t\t\t\tvar mvperfexploraDeqv = filtroequivalente(mvperfexplorabsf,mvperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar mvrecupadicbsf = categoriaproyectos(pmv,recupadic,'_p',1);\n \t\t\t\t\t\tvar mvrecupadicdol = categoriaproyectos(pmv,recupadic,'_p',2);\n \t\t\t\t\t\tvar mvrecupadicDeqv = filtroequivalente(mvrecupadicbsf,mvrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar mvrecompozosbsf = categoriaproyectos(pmv,recompozos,'_p',1);\n \t\t\t\t\t\tvar mvrecompozosdol = categoriaproyectos(pmv,recompozos,'_p',2);\n \t\t\t\t\t\tvar mvrecompozosDeqv = filtroequivalente(mvrecompozosbsf,mvrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar mvrecupesuplebsf = categoriaproyectos(pmv,recupesuple,'_p',1);\n \t\t\t\t\t\tvar mvrecupesupledol = categoriaproyectos(pmv,recupesuple,'_p',2);\n \t\t\t\t\t\tvar mvrecupesupleDeqv = filtroequivalente(mvrecupesuplebsf,mvrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar mvinyectalternavaporbsf = categoriaproyectos(pmv,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar mvinyectalternavapordol = categoriaproyectos(pmv,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar mvinyectalternavaporDeqv = filtroequivalente(mvinyectalternavaporbsf,mvinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar mvlevantamientoartifbsf = categoriaproyectos(pmv,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar mvlevantamientoartifdol = categoriaproyectos(pmv,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar mvlevantamientoartifDeqv = filtroequivalente(mvlevantamientoartifbsf,mvlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar mvconutigasbsf = categoriaproyectos(pmv,conutigas,'_p',1);\n \t\t\t\t\t\tvar mvconutigasdol = categoriaproyectos(pmv,conutigas,'_p',2);\n \t\t\t\t\t\tvar mvconutigasDeqv = filtroequivalente(mvconutigasbsf,mvconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar mvplantliqgasbsf = categoriaproyectos(pmv,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar mvplantliqgasdol = categoriaproyectos(pmv,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar mvplantliqgasDeqv = filtroequivalente(mvplantliqgasbsf,mvplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar mvinstproducbsf = categoriaproyectos(pmv,instproduc,'_p',1);\n \t\t\t\t\t\tvar mvinstproducdol = categoriaproyectos(pmv,instproduc,'_p',2);\n \t\t\t\t\t\tvar mvinstproducDeqv = filtroequivalente(mvinstproducbsf,mvinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar mvoleoterminaembbsf = categoriaproyectos(pmv,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar mvoleoterminaembdol = categoriaproyectos(pmv,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar mvoleoterminaembDeqv = filtroequivalente(mvoleoterminaembbsf,mvoleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar mvalmacenamientobsf = categoriaproyectos(pmv,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar mvalmacenamientodol = categoriaproyectos(pmv,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar mvalmacenamientoDeqv = filtroequivalente(mvalmacenamientobsf,mvalmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar mvdesarrollourbabsf = categoriaproyectos(pmv,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar mvdesarrollourbadol = categoriaproyectos(pmv,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar mvdesarrollourbaDeqv = filtroequivalente(mvdesarrollourbabsf,mvdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar mvproteccionintegbsf = categoriaproyectos(pmv,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar mvproteccionintegdol = categoriaproyectos(pmv,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar mvproteccionintegDeqv = filtroequivalente(mvproteccionintegbsf,mvproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar mvpcpbsf = categoriaproyectos(pmv,pcp,'_p',1);\n \t\t\t\t\t\tvar mvpcpdol = categoriaproyectos(pmv,pcp,'_p',2);\n \t\t\t\t\t\tvar mvpcpDeqv = filtroequivalente(mvpcpbsf,mvpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar mvtelecomunicacionesbsf = categoriaproyectos(pmv,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar mvtelecomunicacionesdol = categoriaproyectos(pmv,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar mvtelecomunicacionesDeqv = filtroequivalente(mvtelecomunicacionesbsf,mvtelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar mvautomatizacionindbsf = categoriaproyectos(pmv,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar mvautomatizacioninddol = categoriaproyectos(pmv,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar mvautomatizacionindDeqv = filtroequivalente(mvautomatizacionindbsf,mvautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar mvcomputaysistebsf = categoriaproyectos(pmv,computaysiste,'_p',1);\n \t\t\t\t\t\tvar mvcomputaysistedol = categoriaproyectos(pmv,computaysiste,'_p',2);\n \t\t\t\t\t\tvar mvcomputaysisteDeqv = filtroequivalente(mvcomputaysistebsf,mvcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar mvedifinstindustbsf = categoriaproyectos(pmv,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar mvedifinstindustdol = categoriaproyectos(pmv,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar mvedifinstindustDeqv = filtroequivalente(mvedifinstindustbsf,mvedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar mvequiposbsf = categoriaproyectos(pmv,equipos,'_p',1);\n \t\t\t\t\t\tvar mvequiposdol = categoriaproyectos(pmv,equipos,'_p',2);\n \t\t\t\t\t\tvar mvequiposDeqv = filtroequivalente(mvequiposbsf,mvequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar mvotrasinvbsf = categoriaproyectos(pmv,otrasinv,'_p',1);\n \t\t\t\t\t\tvar mvotrasinvdol = categoriaproyectos(pmv,otrasinv,'_p',2);\n \t\t\t\t\t\tvar mvotrasinvDeqv = filtroequivalente(mvotrasinvbsf,mvotrasinvdol);\n \t\t\t\t\t\t/////////////////////////// \t\n\n \t\t\t\t\t\t///////ANTEPROYECTO VISION PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar antgeobsf = categoriaproyectos(pant,geofisica,'_p',1);\n \t\t\t\t\t\tvar antgeodol = categoriaproyectos(pant,geofisica,'_p',2);\n \t\t\t\t\t\tvar antgeoDeqv = filtroequivalente(antgeobsf,antgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar antperfavanzbsf = categoriaproyectos(pant,perfavanz,'_p',1);\n \t\t\t\t\t\tvar antperfavanzdol = categoriaproyectos(pant,perfavanz,'_p',2);\n \t\t\t\t\t\tvar antperfavanzDeqv = filtroequivalente(antperfavanzbsf,antperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar antperfdesarrobsf = categoriaproyectos(pant,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar antperfdesarrodol = categoriaproyectos(pant,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar antperfdesarroDeqv = filtroequivalente(antperfdesarrobsf,antperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar antperfexplorabsf = categoriaproyectos(pant,perfexplora,'_p',1);\n \t\t\t\t\t\tvar antperfexploradol = categoriaproyectos(pant,perfexplora,'_p',2);\n \t\t\t\t\t\tvar antperfexploraDeqv = filtroequivalente(antperfexplorabsf,antperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar antrecupadicbsf = categoriaproyectos(pant,recupadic,'_p',1);\n \t\t\t\t\t\tvar antrecupadicdol = categoriaproyectos(pant,recupadic,'_p',2);\n \t\t\t\t\t\tvar antrecupadicDeqv = filtroequivalente(antrecupadicbsf,antrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar antrecompozosbsf = categoriaproyectos(pant,recompozos,'_p',1);\n \t\t\t\t\t\tvar antrecompozosdol = categoriaproyectos(pant,recompozos,'_p',2);\n \t\t\t\t\t\tvar antrecompozosDeqv = filtroequivalente(antrecompozosbsf,antrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar antrecupesuplebsf = categoriaproyectos(pant,recupesuple,'_p',1);\n \t\t\t\t\t\tvar antrecupesupledol = categoriaproyectos(pant,recupesuple,'_p',2);\n \t\t\t\t\t\tvar antrecupesupleDeqv = filtroequivalente(antrecupesuplebsf,antrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar antinyectalternavaporbsf = categoriaproyectos(pant,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar antinyectalternavapordol = categoriaproyectos(pant,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar antinyectalternavaporDeqv = filtroequivalente(antinyectalternavaporbsf,antinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar antlevantamientoartifbsf = categoriaproyectos(pant,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar antlevantamientoartifdol = categoriaproyectos(pant,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar antlevantamientoartifDeqv = filtroequivalente(antlevantamientoartifbsf,antlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar antconutigasbsf = categoriaproyectos(pant,conutigas,'_p',1);\n \t\t\t\t\t\tvar antconutigasdol = categoriaproyectos(pant,conutigas,'_p',2);\n \t\t\t\t\t\tvar antconutigasDeqv = filtroequivalente(antconutigasbsf,antconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar antplantliqgasbsf = categoriaproyectos(pant,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar antplantliqgasdol = categoriaproyectos(pant,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar antplantliqgasDeqv = filtroequivalente(antplantliqgasbsf,antplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar antinstproducbsf = categoriaproyectos(pant,instproduc,'_p',1);\n \t\t\t\t\t\tvar antinstproducdol = categoriaproyectos(pant,instproduc,'_p',2);\n \t\t\t\t\t\tvar antinstproducDeqv = filtroequivalente(antinstproducbsf,antinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar antoleoterminaembbsf = categoriaproyectos(pant,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar antoleoterminaembdol = categoriaproyectos(pant,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar antoleoterminaembDeqv = filtroequivalente(antoleoterminaembbsf,antoleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar antalmacenamientobsf = categoriaproyectos(pant,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar antalmacenamientodol = categoriaproyectos(pant,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar antalmacenamientoDeqv = filtroequivalente(antalmacenamientobsf,antalmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar antdesarrollourbabsf = categoriaproyectos(pant,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar antdesarrollourbadol = categoriaproyectos(pant,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar antdesarrollourbaDeqv = filtroequivalente(antdesarrollourbabsf,antdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar antproteccionintegbsf = categoriaproyectos(pant,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar antproteccionintegdol = categoriaproyectos(pant,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar antproteccionintegDeqv = filtroequivalente(antproteccionintegbsf,antproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar antpcpbsf = categoriaproyectos(pant,pcp,'_p',1);\n \t\t\t\t\t\tvar antpcpdol = categoriaproyectos(pant,pcp,'_p',2);\n \t\t\t\t\t\tvar antpcpDeqv = filtroequivalente(antpcpbsf,antpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar anttelecomunicacionesbsf = categoriaproyectos(pant,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar anttelecomunicacionesdol = categoriaproyectos(pant,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar anttelecomunicacionesDeqv = filtroequivalente(anttelecomunicacionesbsf,anttelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar antautomatizacionindbsf = categoriaproyectos(pant,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar antautomatizacioninddol = categoriaproyectos(pant,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar antautomatizacionindDeqv = filtroequivalente(antautomatizacionindbsf,antautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar antcomputaysistebsf = categoriaproyectos(pant,computaysiste,'_p',1);\n \t\t\t\t\t\tvar antcomputaysistedol = categoriaproyectos(pant,computaysiste,'_p',2);\n \t\t\t\t\t\tvar antcomputaysisteDeqv = filtroequivalente(antcomputaysistebsf,antcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar antedifinstindustbsf = categoriaproyectos(pant,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar antedifinstindustdol = categoriaproyectos(pant,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar antedifinstindustDeqv = filtroequivalente(antedifinstindustbsf,antedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar antequiposbsf = categoriaproyectos(pant,equipos,'_p',1);\n \t\t\t\t\t\tvar antequiposdol = categoriaproyectos(pant,equipos,'_p',2);\n \t\t\t\t\t\tvar antequiposDeqv = filtroequivalente(antequiposbsf,antequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar antotrasinvbsf = categoriaproyectos(pant,otrasinv,'_p',1);\n \t\t\t\t\t\tvar antotrasinvdol = categoriaproyectos(pant,otrasinv,'_p',2);\n \t\t\t\t\t\tvar antotrasinvDeqv = filtroequivalente(antotrasinvbsf,antotrasinvdol);\n \t\t\t\t\t\t/////////////////////////// \t\n\n \t\t\t\t\t\tvar ptotalcatebsf = sumarcateogoria(pgeobsf,pperfavanzbsf,pperfdesarrobsf,pperfexplorabsf,precupadicbsf,precompozosbsf,precupesuplebsf,pinyectalternavaporbsf,plevantamientoartifbsf,pconutigasbsf,pplantliqgasbsf,pinstproducbsf,poleoterminaembbsf,palmacenamientobsf,pdesarrollourbabsf,pproteccionintegbsf,ppcpbsf,ptelecomunicacionesbsf,pautomatizacionindbsf,pcomputaysistebsf,pedifinstindustbsf,pequiposbsf,potrasinvbsf);\n \t\t\t\t\t\tvar ptotalcatedol = sumarcateogoria(pgeodol,pperfavanzdol,pperfdesarrodol,pperfexploradol,precupadicdol,precompozosdol,precupesupledol,pinyectalternavapordol,plevantamientoartifdol,pconutigasdol,pplantliqgasdol,pinstproducdol,poleoterminaembdol,palmacenamientodol,pdesarrollourbadol,pproteccionintegdol,ppcpdol,ptelecomunicacionesdol,pautomatizacioninddol,pcomputaysistedol,pedifinstindustdol,pequiposdol,potrasinvdol);\n \t\t\t\t\t\tvar ptotalcateDeqv = sumarcateogoria(pgeoDeqv,pperfavanzDeqv,pperfdesarroDeqv,pperfexploraDeqv,precupadicDeqv,precompozosDeqv,precupesupleDeqv,pinyectalternavaporDeqv,plevantamientoartifDeqv,pconutigasDeqv,pplantliqgasDeqv,pinstproducDeqv,poleoterminaembDeqv,palmacenamientoDeqv,pdesarrollourbaDeqv,pproteccionintegDeqv,ppcpDeqv,ptelecomunicacionesDeqv,pautomatizacionindDeqv,pcomputaysisteDeqv,pedifinstindustDeqv,pequiposDeqv,potrasinvDeqv);\n \t\t\t\t\t\tvar rtotalcatebsf = sumarcateogoria(rgeobsf,rperfavanzbsf,rperfdesarrobsf,rperfexplorabsf,rrecupadicbsf,rrecompozosbsf,rrecupesuplebsf,rinyectalternavaporbsf,rlevantamientoartifbsf,rconutigasbsf,rplantliqgasbsf,rinstproducbsf,roleoterminaembbsf,ralmacenamientobsf,rdesarrollourbabsf,rproteccionintegbsf,rpcpbsf,rtelecomunicacionesbsf,rautomatizacionindbsf,rcomputaysistebsf,redifinstindustbsf,requiposbsf,rotrasinvbsf);\n \t\t\t\t\t\tvar rtotalcatedol = sumarcateogoria(rgeodol,rperfavanzdol,rperfdesarrodol,rperfexploradol,rrecupadicdol,rrecompozosdol,rrecupesupledol,rinyectalternavapordol,rlevantamientoartifdol,rconutigasdol,rplantliqgasdol,rinstproducdol,roleoterminaembdol,ralmacenamientodol,rdesarrollourbadol,rproteccionintegdol,rpcpdol,rtelecomunicacionesdol,rautomatizacioninddol,rcomputaysistedol,redifinstindustdol,requiposdol,rotrasinvdol);\n \t\t\t\t\t\tvar rtotalcateDeqv = sumarcateogoria(rgeoDeqv,rperfavanzDeqv,rperfdesarroDeqv,rperfexploraDeqv,rrecupadicDeqv,rrecompozosDeqv,rrecupesupleDeqv,rinyectalternavaporDeqv,rlevantamientoartifDeqv,rconutigasDeqv,rplantliqgasDeqv,rinstproducDeqv,roleoterminaembDeqv,ralmacenamientoDeqv,rdesarrollourbaDeqv,rproteccionintegDeqv,rpcpDeqv,rtelecomunicacionesDeqv,rautomatizacionindDeqv,rcomputaysisteDeqv,redifinstindustDeqv,requiposDeqv,rotrasinvDeqv);\n \t\t\t\t\t\tvar mvtotalcatebsf = sumarcateogoria(mvgeobsf,mvperfavanzbsf,mvperfdesarrobsf,mvperfexplorabsf,mvrecupadicbsf,mvrecompozosbsf,mvrecupesuplebsf,mvinyectalternavaporbsf,mvlevantamientoartifbsf,mvconutigasbsf,mvplantliqgasbsf,mvinstproducbsf,mvoleoterminaembbsf,mvalmacenamientobsf,mvdesarrollourbabsf,mvproteccionintegbsf,mvpcpbsf,mvtelecomunicacionesbsf,mvautomatizacionindbsf,mvcomputaysistebsf,mvedifinstindustbsf,mvequiposbsf,mvotrasinvbsf);\n \t\t\t\t\t\tvar mvtotalcatedol = sumarcateogoria(mvgeodol,mvperfavanzdol,mvperfdesarrodol,mvperfexploradol,mvrecupadicdol,mvrecompozosdol,mvrecupesupledol,mvinyectalternavapordol,mvlevantamientoartifdol,mvconutigasdol,mvplantliqgasdol,mvinstproducdol,mvoleoterminaembdol,mvalmacenamientodol,mvdesarrollourbadol,mvproteccionintegdol,mvpcpdol,mvtelecomunicacionesdol,mvautomatizacioninddol,mvcomputaysistedol,mvedifinstindustdol,mvequiposdol,mvotrasinvdol);\n \t\t\t\t\t\tvar mvtotalcateDeqv = sumarcateogoria(mvgeoDeqv,mvperfavanzDeqv,mvperfdesarroDeqv,mvperfexploraDeqv,mvrecupadicDeqv,mvrecompozosDeqv,mvrecupesupleDeqv,mvinyectalternavaporDeqv,mvlevantamientoartifDeqv,mvconutigasDeqv,mvplantliqgasDeqv,mvinstproducDeqv,mvoleoterminaembDeqv,mvalmacenamientoDeqv,mvdesarrollourbaDeqv,mvproteccionintegDeqv,mvpcpDeqv,mvtelecomunicacionesDeqv,mvautomatizacionindDeqv,mvcomputaysisteDeqv,mvedifinstindustDeqv,mvequiposDeqv,mvotrasinvDeqv);\n \t\t\t\t\t\tvar anttotalcatebsf = sumarcateogoria(antgeobsf,antperfavanzbsf,antperfdesarrobsf,antperfexplorabsf,antrecupadicbsf,antrecompozosbsf,antrecupesuplebsf,antinyectalternavaporbsf,antlevantamientoartifbsf,antconutigasbsf,antplantliqgasbsf,antinstproducbsf,antoleoterminaembbsf,antalmacenamientobsf,antdesarrollourbabsf,antproteccionintegbsf,antpcpbsf,anttelecomunicacionesbsf,antautomatizacionindbsf,antcomputaysistebsf,antedifinstindustbsf,antequiposbsf,antotrasinvbsf);\n \t\t\t\t\t\tvar anttotalcatedol = sumarcateogoria(antgeodol,antperfavanzdol,antperfdesarrodol,antperfexploradol,antrecupadicdol,antrecompozosdol,antrecupesupledol,antinyectalternavapordol,antlevantamientoartifdol,antconutigasdol,antplantliqgasdol,antinstproducdol,antoleoterminaembdol,antalmacenamientodol,antdesarrollourbadol,antproteccionintegdol,antpcpdol,anttelecomunicacionesdol,antautomatizacioninddol,antcomputaysistedol,antedifinstindustdol,antequiposdol,antotrasinvdol);\n \t\t\t\t\t\tvar anttotalcateDeqv = sumarcateogoria(antgeoDeqv,antperfavanzDeqv,antperfdesarroDeqv,antperfexploraDeqv,antrecupadicDeqv,antrecompozosDeqv,antrecupesupleDeqv,antinyectalternavaporDeqv,antlevantamientoartifDeqv,antconutigasDeqv,antplantliqgasDeqv,antinstproducDeqv,antoleoterminaembDeqv,antalmacenamientoDeqv,antdesarrollourbaDeqv,antproteccionintegDeqv,antpcpDeqv,anttelecomunicacionesDeqv,antautomatizacionindDeqv,antcomputaysisteDeqv,antedifinstindustDeqv,antequiposDeqv,antotrasinvDeqv);\n\n\n \t\t\t\t\t\t for (var i=0; i < 12; i++) {\n \t\t\t\t\t\t \t\t\n \t\t\t\t\t\t \tif( laborybbdivoDeqvr[i] != 0 || mdivoDeqvr[i] != 0 || scdivoDeqvr[i] != 0 || odivoDeqvr[i]!= 0 ){\n \t\t\t\t\t\t \t\t//alert(aux);\n \t\t\t\t\t\t \t\taux++;\t\n \t\t\t\t\t\t \t}\n\n \t\t\t\t\t\t }// fin del for comprobar cual es la ejecución del real de los meses\n\n\n \t\t\t\t\t\t /// BLOQUE VISUAL DE LA TABLA\n \t\t\t\t\t\t \tvar informacion = motrarcabecera('red-header','leter',v3,meses[aux],'Parámetros Operacionales y Financieros');\n \t\t\t\t\t\t \tinformacion += descripciones('','Presupuesto de Inversiones',aux,ptotalcateDeqv,ptotalcatebsf,ptotalcatedol,ptotalcateDeqv,rtotalcatebsf,rtotalcatedol,rtotalcateDeqv,mvtotalcatebsf,mvtotalcatedol,mvtotalcateDeqv,anttotalcatebsf,anttotalcatedol,anttotalcateDeqv );\n \t\t\t\t\t\t \tinformacion += descripciones('','Presupuesto de Operaciones',aux,totaldivoDeqv,totaldivobsf,totaldivodol,totaldivoDeqv,totaldivobsfr,totaldivodolr,totaldivoDeqvr,totaldivobsfmv,totaldivodolmv,totaldivoDeqvmv,totaldivobsfant,totaldivodolant,totaldivobsfant);\n\t \t\t\t\t\t\t\n \t\t\t\t\t\t \tinformacion += '<tr>';\n\t \t\t\t\t\t\tfor (var i=0; i < 18 ; i++){\n\t \t\t\t\t\t\tinformacion += '<td>\t</td>';\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\tinformacion += '</tr>';\n \t\t\t\t\t\t \tinformacion += motrarcabecera('red-header','leter',v3,meses[aux],'ELEMENTO DE COSTO');\n \t\t\t\t\t\t \tinformacion += descripciones('','Labor y Beneficios',aux,laborybbdivoDeqv,laborybbdivobsf,laborybbdivodol,laborybbdivoDeqv,laborybbdivobsfr,laborybbdivodolr,laborybbdivoDeqvr,laborybbdivobsfmv,laborybbdivodolmv,laborybbdivoDeqvmv,laborybbdivobsfant,laborybbdivodolant,laborybbdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Materiales',aux,mdivoDeqv,mdivobsf,mdivodol,mdivoDeqv,mdivobsfr,mdivodolr,mdivoDeqvr,mdivobsfmv,mdivodolmv,mdivoDeqvmv,mdivobsfant,mdivodolant,mdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Servicios y Contratos',aux,scdivoDeqv,scdivobsf,scdivodol,scdivoDeqv,scdivobsfr,scdivodolr,scdivoDeqvr,scdivobsfmv,scdivodolmv,scdivoDeqvmv,scdivobsfmv,scdivodolant,scdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Otros Costos y Gastos',aux,odivoDeqv,odivobsf,odivodol,odivoDeqv,odivobsfr,odivodolr,odivoDeqvr,odivobsfmv,odivodolmv,odivoDeqvmv,odivobsfant,odivodolant,odivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('red-header','Total',aux,totaldivoDeqv,totaldivobsf,totaldivodol,totaldivoDeqv,totaldivobsfr,totaldivodolr,totaldivoDeqvr,totaldivobsfmv,totaldivodolmv,totaldivoDeqvmv,totaldivobsfant,totaldivodolant,totaldivobsfant);\n\t \t\t\t\t\t\tinformacion += '<tr>';\n\t \t\t\t\t\t\tfor (var i=0; i < 18 ; i++){\n\t \t\t\t\t\t\tinformacion += '<td>\t</td>';\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\tinformacion += '</tr>';\n\t \t\t\t\t\t\tinformacion += motrarcabecera('red-header','leter',v3,meses[aux],'CATEGORIA ');\n\t \t\t\t\t\t\tinformacion += descripciones('','Geofisica',aux,pgeoDeqv,pgeobsf,pgeodol,pgeoDeqv,rgeobsf,rgeodol,rgeoDeqv,mvgeobsf,mvgeodol,mvgeoDeqv,antgeobsf,antgeodol,antgeoDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Perforación de Avanzada',aux,pperfavanzDeqv,pperfavanzbsf,pperfavanzdol,pperfavanzDeqv,rperfavanzbsf,rperfavanzdol,rperfavanzDeqv,mvperfavanzbsf,mvperfavanzdol,mvperfavanzDeqv,antperfavanzbsf,antperfavanzdol,antperfavanzDeqv );\n\t \t\t\t\t\t\tinformacion += descripciones('','Perforación de Desarrollo',aux,pperfdesarroDeqv,pperfdesarrobsf,pperfdesarrodol,pperfdesarroDeqv,rperfdesarrobsf,rperfdesarrodol,rperfdesarroDeqv,mvperfdesarrobsf,mvperfdesarrodol,mvperfdesarroDeqv,antperfdesarrobsf,antperfdesarrodol,antperfdesarroDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Perforación Exploratoria',aux,pperfexploraDeqv,pperfexplorabsf,pperfexploradol,pperfexploraDeqv,rperfexplorabsf,rperfexploradol,rperfexploraDeqv,mvperfexplorabsf,mvperfexploradol,mvperfexploraDeqv,antperfexplorabsf,antperfexploradol,antperfexploraDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Recuperación Adicional',aux,precupadicDeqv,precupadicbsf,precupadicdol,precupadicDeqv,rrecupadicbsf,rrecupadicdol,rrecupadicDeqv,mvrecupadicbsf,mvrecupadicdol,mvrecupadicDeqv,antrecupadicbsf,antrecupadicdol,antrecupadicDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Recompletación De Pozos',aux,precompozosDeqv,precompozosbsf,precompozosdol,precompozosDeqv,rrecompozosbsf,rrecompozosdol,rrecompozosDeqv,mvrecompozosbsf,mvrecompozosdol,mvrecompozosDeqv,antrecompozosbsf,antrecompozosdol,antrecompozosDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Recuperación Suplementaria',aux,precupesupleDeqv,precupesuplebsf,precupesupledol,precupesupleDeqv,rrecupesuplebsf,rrecupesupledol,rrecupesupleDeqv,mvrecupesuplebsf,mvrecupesupledol,mvrecupesupleDeqv,antrecupesuplebsf,antrecupesupledol,antrecupesupleDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Inyección Alterna De Vapor',aux,pinyectalternavaporDeqv,pinyectalternavaporbsf,pinyectalternavapordol,pinyectalternavaporDeqv,rinyectalternavaporbsf,rinyectalternavapordol,rinyectalternavaporDeqv,mvinyectalternavaporbsf,mvinyectalternavapordol,mvinyectalternavaporDeqv,antinyectalternavaporbsf,antinyectalternavapordol,antinyectalternavaporDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Levantamiento Artificial',aux,plevantamientoartifDeqv,plevantamientoartifbsf,plevantamientoartifdol,plevantamientoartifDeqv,rlevantamientoartifbsf,rlevantamientoartifdol,rlevantamientoartifDeqv,mvlevantamientoartifbsf,mvlevantamientoartifdol,mvlevantamientoartifDeqv,antlevantamientoartifbsf,antlevantamientoartifdol,antlevantamientoartifDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Conservación y Utilización del Gas',aux,pconutigasDeqv,pconutigasbsf,pconutigasdol,pconutigasDeqv,rconutigasbsf,rconutigasdol,rconutigasDeqv,mvconutigasbsf,mvconutigasdol,mvconutigasDeqv,antconutigasbsf,antconutigasdol,antconutigasDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Planta de Líquidos y Gas',aux,pplantliqgasDeqv,pplantliqgasbsf,pplantliqgasdol,pplantliqgasDeqv,rplantliqgasbsf,rplantliqgasdol,rplantliqgasDeqv,mvplantliqgasbsf,mvplantliqgasdol,mvplantliqgasDeqv,antplantliqgasbsf,antplantliqgasdol,antplantliqgasDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Instalaciones de Producción',aux,pinstproducDeqv,pinstproducbsf,pinstproducdol,pinstproducDeqv,rinstproducbsf,rinstproducdol,rinstproducDeqv,mvinstproducbsf,mvinstproducdol,mvinstproducDeqv,antinstproducbsf,antinstproducdol,antinstproducDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Oleoductos y Terminales de Embarque',aux,poleoterminaembDeqv,poleoterminaembbsf,poleoterminaembdol,poleoterminaembDeqv,roleoterminaembbsf,roleoterminaembdol,roleoterminaembDeqv,mvoleoterminaembbsf,mvoleoterminaembdol,mvoleoterminaembDeqv,antoleoterminaembbsf,antoleoterminaembdol,antoleoterminaembDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Almacenamiento',aux,palmacenamientoDeqv,palmacenamientobsf,palmacenamientodol,palmacenamientoDeqv,ralmacenamientobsf,ralmacenamientodol,ralmacenamientoDeqv,mvalmacenamientobsf,mvalmacenamientodol,mvalmacenamientoDeqv,antalmacenamientobsf,antalmacenamientodol,antalmacenamientoDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Desarrollo Urbano',aux,pdesarrollourbaDeqv,pdesarrollourbabsf,pdesarrollourbadol,pdesarrollourbaDeqv,rdesarrollourbabsf,rdesarrollourbadol,rdesarrollourbaDeqv,mvdesarrollourbabsf,mvdesarrollourbadol,mvdesarrollourbaDeqv,antdesarrollourbabsf,antdesarrollourbadol,antdesarrollourbaDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Protección Integral',aux,pproteccionintegDeqv,pproteccionintegbsf,pproteccionintegdol,pproteccionintegDeqv,rproteccionintegbsf,rproteccionintegdol,rproteccionintegDeqv,mvproteccionintegbsf,mvproteccionintegdol,mvproteccionintegDeqv,antproteccionintegbsf,antproteccionintegdol,antproteccionintegDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Prevención y Control de Pérdidas',aux,ppcpDeqv,ppcpbsf,ppcpdol,ppcpDeqv,rpcpbsf,rpcpdol,rpcpDeqv,mvpcpbsf,mvpcpdol,mvpcpDeqv,antpcpbsf,antpcpdol,antpcpDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Telecomunicaciones',aux,ptelecomunicacionesDeqv,ptelecomunicacionesbsf,ptelecomunicacionesdol,ptelecomunicacionesDeqv,rtelecomunicacionesbsf,rtelecomunicacionesdol,rtelecomunicacionesDeqv,mvtelecomunicacionesbsf,mvtelecomunicacionesdol,mvtelecomunicacionesDeqv,anttelecomunicacionesbsf,anttelecomunicacionesdol,anttelecomunicacionesDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Automatización Industrial',aux,pautomatizacionindDeqv,pautomatizacionindbsf,pautomatizacioninddol,pautomatizacionindDeqv,rautomatizacionindbsf,rautomatizacioninddol,rautomatizacionindDeqv,mvautomatizacionindbsf,mvautomatizacioninddol,mvautomatizacionindDeqv,antautomatizacionindbsf,antautomatizacioninddol,antautomatizacionindDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Computación y Sistemas',aux,pcomputaysisteDeqv,pcomputaysistebsf,pcomputaysistedol,pcomputaysisteDeqv,rcomputaysistebsf,rcomputaysistedol,rcomputaysisteDeqv,mvcomputaysistebsf,mvcomputaysistedol,mvcomputaysisteDeqv,antcomputaysistebsf,antcomputaysistedol,antcomputaysisteDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Edificaciones e Instalaciones Industriales',aux,pedifinstindustDeqv,pedifinstindustbsf,pedifinstindustdol,pedifinstindustDeqv,redifinstindustbsf,redifinstindustdol,redifinstindustDeqv,mvedifinstindustbsf,mvedifinstindustdol,mvedifinstindustDeqv,antedifinstindustbsf,antedifinstindustdol,antedifinstindustDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Equipos',aux,pequiposDeqv,pequiposbsf,pequiposdol,pequiposDeqv,requiposbsf,requiposdol,requiposDeqv,mvequiposbsf,mvequiposdol,mvequiposDeqv,antequiposbsf,antequiposdol,antequiposDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Otras Inversiones',aux,potrasinvDeqv,potrasinvbsf,potrasinvdol,potrasinvDeqv,rotrasinvbsf,rotrasinvdol,rotrasinvDeqv,mvotrasinvbsf,mvotrasinvdol,mvotrasinvDeqv,antotrasinvbsf,antotrasinvdol,antotrasinvDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('red-header','Total',aux,ptotalcateDeqv,ptotalcatebsf,ptotalcatedol,ptotalcateDeqv,rtotalcatebsf,rtotalcatedol,rtotalcateDeqv,mvtotalcatebsf,mvtotalcatedol,mvtotalcateDeqv,anttotalcatebsf,anttotalcatedol,anttotalcateDeqv );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\n\n\t \t\t\t\t\t\treturn informacion;\n\n }", "function genereTournoi(){\n\n selecteurMatch = -1;\n bd.tournoi.tours = [];\n joueurAttente = [];\n\n //init\n for (var i = 0; i < bd.joueurs.length; i++){\n bd.joueurs[i].adversaires = [];\n bd.joueurs[i].coequipiers = [];\n bd.joueurs[i].points = 0;\n }\n\n var nbMatch;\n for (var i = 0; i < bd.tournoi.nbTour; i++){\n mettreJoueursDansSac(); //on met tous les joueurs selectionné dans un sac et on mélange\n populateAllMatchs(); //on générre tous les matchs possibles à partir des joueurs dans sac\n\n //nombre de mathc par tour\n nbMatch = Math.min(\n Math.floor(sac.length / (typeTournoiListe.SIMPLE ? 2 : 4)), \n allMatchs.length,\n bd.tournoi.nbTerrain\n );\n\n //on teste tous les matchs en les priorisant\n for (var j = 0; j < allMatchs.length; j++){\n testContraintes(allMatchs[j]);\n }\n //on tri la liste\n allMatchs.sort((m1, m2) => m1.pointContrainte - m2.pointContrainte);\n var matchs = [];\n var currentMatch;\n for (var j = 0; j < nbMatch; j++){\n if (allMatchs.length == 0) break; //s'il n'y a plus de match dispo on sort\n currentMatch = allMatchs[0];\n matchs.push(currentMatch);\n //attribution adversaires\n for (var k = 0; k < currentMatch[\"equipeA\"].length; k++){\n j1 = currentMatch[\"equipeA\"][k];\n for (var m = 0; m < currentMatch[\"equipeB\"].length; m++){\n j2 = currentMatch[\"equipeB\"][m];\n if (!j1.adversaires.includes(j2)) j1.adversaires.push(j2); \n if (!j2.adversaires.includes(j1)) j2.adversaires.push(j1); \n }\n }\n //et coequipiers equipe A\n var j1, j2;\n for (var k = 0; k < currentMatch[\"equipeA\"].length; k++){\n j1 = currentMatch[\"equipeA\"][k];\n for (var m = 0; m < currentMatch[\"equipeA\"].length; m++){\n j2 = currentMatch[\"equipeA\"][m];\n if (j1 != j2){\n if (!j1.coequipiers.includes(j2)) j1.coequipiers.push(j2);\n if (!j2.coequipiers.includes(j1)) j2.coequipiers.push(j1);\n }\n }\n }\n //et coequipiers equipe B\n var j1, j2;\n for (var k = 0; k < currentMatch[\"equipeB\"].length; k++){\n j1 = currentMatch[\"equipeB\"][k];\n for (var m = 0; m < currentMatch[\"equipeB\"].length; m++){\n j2 = currentMatch[\"equipeB\"][m];\n if (j1 != j2){\n if (!j1.coequipiers.includes(j2)) j1.coequipiers.push(j2);\n if (!j2.coequipiers.includes(j1)) j2.coequipiers.push(j1);\n }\n }\n }\n //on supprime tous les match ayant des joueurs déjà affecté sur ce tour\n allMatchs = allMatchs.filter(match => \n match.equipeA.filter(joueur => currentMatch.equipeA.includes(joueur)).length == 0 && \n match.equipeB.filter(joueur => currentMatch.equipeB.includes(joueur)).length == 0 &&\n match.equipeA.filter(joueur => currentMatch.equipeB.includes(joueur)).length == 0 &&\n match.equipeB.filter(joueur => currentMatch.equipeA.includes(joueur)).length == 0\n );\n\n //on supprime du sac les joueurs affectés a currentMatch\n var currentIndexOf;\n for (var k = 0; k < currentMatch.equipeA.length; k++){\n currentIndexOf = sac.indexOf(currentMatch.equipeA[k]);\n if (currentIndexOf != -1) sac.splice(currentIndexOf, 1);\n }\n for (var k = 0; k < currentMatch.equipeB.length; k++){\n currentIndexOf = sac.indexOf(currentMatch.equipeB[k]);\n if (currentIndexOf != -1) sac.splice(currentIndexOf, 1);\n }\n\n }\n\n //on ajoute dans joueur attente les joueurs restant dans le sac\n var flag;\n for (var k = 0; k < sac.length; k++){\n flag = false;\n for (var m = 0; m < joueurAttente.length; m++) {\n if (joueurAttente[m].name == sac[k].name){\n joueurAttente[m][\"nb\"]++;\n flag = true;\n }\n }\n if (!flag) joueurAttente.push({\"name\": sac[k].name, \"nb\": 1});\n }\n\n bd.tournoi.tours.push({\"matchs\": matchs, \"joueurAttente\": sac});\n }\n\n}", "function QualidadeCheck(){\n\tconsole.log(\"Avaliando pessoas!\");\n\tvar palavra1,\n\t\tpalavra2,\n\t\tpalavrafinal,\n\t\tresultado,\n\t\tcaracter;\n\tfor(var cont=0; cont < Cidade.length; cont++){\n\t\tpalavra1=Sun1;\n\t\tpalavra2=Sun2;\n\t\tpalavrafinal = Result;\n\t\tif(Cidade[cont].soma == null){\n\t\t\tfor(var cont2=0; cont2<Sun1.length; cont2++){\n\t\t\t\tcaracter = Sun1[cont2];\n\t\t\t\tpalavra1 = palavra1.replace(Sun1[cont2], Cidade[cont][caracter]);\n\t\t\t}\n\t\t\tfor(var cont2=0; cont2<Sun2.length; cont2++){\n\t\t\t\tcaracter = Sun2[cont2];\n\t\t\t\tpalavra2 = palavra2.replace(Sun2[cont2], Cidade[cont][caracter]);\n\t\t\t}\n\t\t\t\n\t\t\t//Soma das palavras, e preciso converte para inteiro.\n\t\t\tpalavra1 = parseInt(palavra1, 10);\n\t\t\tpalavra2 = parseInt(palavra2, 10);\n\t\t\tresultado = palavra1+palavra2;\n\t\t\tCidade[cont].soma = resultado;\n\n\t\t\t//Para que o .length funcione e consiga navegar pelos caracteres da soma, e necessario converte para String.\n\t\t\tresultado = String(resultado);\n\n\t\t\t//Caminhar por todos caracteres da soma.\n\t\t\tfor(var cont2=0; cont2<resultado.length; cont2++){\n\t\t\t\t//Caminha por todos caracteres do texto (Ex: 15263 ira se torna 'dlsjqi')\n\t\t\t\tfor(var cont3=0;cont3<Texto.length;cont3++){\n\t\t\t\t\t// Pelo o caractere vejo qual numero o representa, caso o numero seja o mesmo que eu esteja procurando, troco o numero pelo caractere.\n\t\t\t\t\tif(Cidade[cont][Texto[cont3]]==resultado[cont2]){\n\t\t\t\t\t\tresultado = resultado.replace(resultado[cont2], Texto[cont3]);\n\t\t\t\t\t}\n\t\t\t\t}\n }\n \n Cidade[cont].stexto = resultado;\n \n\t\t\t//saber % de acerto de cada palavra\t+ Aptidão\n\t\t\tCidade[cont] = new Object(AvaliacaoMetodo(Cidade[cont]));\n\t\t\tif(Cidade[cont].aptidao==0){\n\t\t\t\tKillError(\"RESULTADO ENCONTRADO\");\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfunction AvaliacaoMetodo(obj){\n\t\tvar taxa_acerto=0,temp;\n\t\tswitch(MetodoAvalicao){\n\t\t\tcase 1:\n\t\t\t\t//(SEND+MORE)-MONEY\n\t\t\t\t//Pego a soma do alfabeto e subtraio menos a palavra MONEY gerada pelo alfabeto, verificar se ocorre a igualdade.\n\t\t\t\t//Caso taxa == 0, então encontramos o resultado!\n\t\t\t\tvar letra,\n\t\t\t\t\tfrase=Result;\n\t\t\t\t//Converte frase MONEY para 12546 usando o alfabeto da cidade.\n\t\t\t\tfor (var cont=0; cont < frase.length; cont++){\n\t\t\t\t\tletra = frase.substring(cont, cont+1);\n\t\t\t\t\tif(obj[letra] != null){\n\t\t\t\t\t\tfrase = frase.replace(letra,obj[letra]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfrase = parseInt(frase, 10);\n\t\t\t\tobj.aptidao = frase - obj.soma;\n\t\t\t\tif(obj.aptidao<0){\n\t\t\t\t\tobj.aptidao = obj.aptidao*-1;\n\t\t\t\t}\n\n\t\t\t\t//Vamos força a finalização do programa, pois encontramos o resultado.\n\t\t\t\tobj.qualidade = parseInt((1/obj.aptidao)*10000);\n\t\t\t\treturn obj;\n\t\t\t\tbreak;\n case 2:\n KillError(\" -a [1,2:Não corrigido,3,4]\");\n\t\t\t\t// SOMA DE BIT A BIT E SUBTRAÇÃO\n\t\t\t\t//Pego a soma do alfabeto e subtraio menos a palavra MONEY gerada pelo alfabeto, verificar se ocorre a igualdade.\n\t\t\t\t//Caso taxa == 0, então encontramos o resultado!\n\t\t\t\tvar letra, frase=Result;\n\t\t\t\t//Converte frase MONEY para EX: 17892 usando o alfabeto da cidade.\n\t\t\t\tfor (var cont=0; cont < frase.length; cont++){\n\t\t\t\t\tletra = frase.substring(cont, cont+1);\n\t\t\t\t\tfrase = frase.replace(letra,Cidade[letra]);\n\t\t\t\t}\n\t\t\t\t//Somar bit a bit resultado da palavra MONEY.\n\t\t\t\tfor (cont=0; cont < frase.length; cont++){\n\t\t\t\t\ttaxa_acerto += parseInt(frase.substring(cont, cont+1), 10);\n\t\t\t\t}\n\n\t\t\t\t//Soma Cidade.soma BIT a BIT\n\t\t\t\ttemp=0;\n\t\t\t\tvar cidade_soma = String(Cidade.soma);\n\t\t\t\tfor (cont=0; cont < cidade_soma.length; cont++){\n\t\t\t\t\ttemp += parseInt(cidade_soma.substring(cont, cont+1), 10);\n\t\t\t\t}\n\n\t\t\t\t//Obter diferença do desejado e do numero gerado.\n\t\t\t\ttaxa_acerto = taxa_acerto - temp;\n\t\t\t\tif(taxa_acerto<0){\n\t\t\t\t\ttaxa_acerto = taxa_acerto*-1;\n\t\t\t\t}\n\n\t\t\t\t//Verificar se este foi o melhor obtido!\n\t\t\t\tif(CidadeTOP.qualidade>taxa_acerto || CidadeTOP.qualidade==null){\n\t\t\t\t\tCidade.qualidade = taxa_acerto;\n\t\t\t\t\tCidadeTOP = Cidade;\n\t\t\t\t}\n\t\t\t\treturn Cidade;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t//METODO NÃO ENTENDIDO\n\t\t\t\tKillError(\" -a [1,2,3:Não definido,4]\");\n\t\t\t\tbreak;\n case 4:\n KillError(\" -a [1,2,3,4:Não corrigido]\");\n\t\t\t\t//METODO DE % DE IGUALDADE ENTRE O QUE ESPERAVA \n\t\t\t\t//Comparar caractere por caractere e vejo a % de igualdade.\n\t\t\t\t//Caso chege a 100, encontramos nosso resultado.\n\t\t\t\tvar resultado = Cidade.stexto;\n\t\t\t\tCidade.aptidao = 0;\n\t\t\t\tfor(var cont2=0; cont2<resultado.length; cont2++){\n\t\t\t\t\tif(resultado[cont2]==Result[cont2]){\n\t\t\t\t\t\tCidade.aptidao = Cidade.aptidao+(1/Result.length)*100;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Verificar se este foi o melhor obtido!\n\t\t\t\tif(CidadeTOP.aptidao<Cidade.aptidao || CidadeTOP.aptidao==null){\n\t\t\t\t\tCidadeTOP = Cidade;\n\t\t\t\t}\n\t\t\t\t//Vamos força a finalização do programa, pois encontramos o resultado.\n\t\t\t\tif(Cidade.aptidao==100){\n\t\t\t\t\tKillError(\"RESULTADO ENCONTRADO\");\n\t\t\t\t}else{\n\t\t\t\t\tCidade.qualidade = Cidade.aptidao;\n\t\t\t\t}\n\t\t\t\treturn Cidade;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tKillError(\" -a [1,2,3:Não definido,4]\");\n\t\t}\n\t}\n}", "arbol(){\n var arbol = new Array();\n var padres = this._buscarPadre(data.categories);\n var hijos = this._buscarHijos(data.categories,padres);\n\n }", "function merge(arena, player) {\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if(value !== 0) {\n arena[y+player.pos.y][x+player.pos.x] = value;\n }\n });\n });\n}" ]
[ "0.57224685", "0.56796664", "0.56416065", "0.5552063", "0.54637206", "0.53561866", "0.53365123", "0.5327602", "0.52938485", "0.5251051", "0.51810575", "0.5179268", "0.51686335", "0.5158905", "0.5146927", "0.5136259", "0.5124638", "0.5089595", "0.50867534", "0.50853854", "0.5068608", "0.50682944", "0.5039277", "0.50385916", "0.5030137", "0.5021454", "0.50203633", "0.5011179", "0.5000828", "0.49946287", "0.498948", "0.49891028", "0.4987874", "0.49865454", "0.4980764", "0.49803564", "0.49762517", "0.49712738", "0.49631983", "0.49565968", "0.49523884", "0.49407405", "0.49341992", "0.4916042", "0.49067497", "0.4905353", "0.48988757", "0.48976356", "0.48920664", "0.4883301", "0.48831066", "0.48825055", "0.48807713", "0.48807645", "0.48801094", "0.4873611", "0.4871781", "0.4867994", "0.48677614", "0.4867251", "0.4860825", "0.48599523", "0.48458254", "0.48418725", "0.4839981", "0.4834482", "0.48343474", "0.483284", "0.48319155", "0.48312983", "0.48291767", "0.4811307", "0.4806255", "0.48041758", "0.48026708", "0.48003113", "0.48001269", "0.47947606", "0.4790972", "0.47899103", "0.47890013", "0.4785015", "0.47848663", "0.47848266", "0.47813964", "0.47798097", "0.47797486", "0.47791454", "0.47745743", "0.47674513", "0.47673163", "0.47657", "0.4763944", "0.47616646", "0.47579756", "0.47551936", "0.47551885", "0.4752854", "0.47512856", "0.47490755", "0.47484833" ]
0.0
-1
Get the Expression Condition's HTML id. Generate a new one if no ID present.
getId() { return this.props.id || this.generatedId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNeededId(self){\n var manipulator = $(self);\n var neededId = manipulator.attr('id').split('_')[1];//getting unique general value of id\n return neededId;\n}", "htmlId(name, type = '', ext = '') {\n return Util.htmlId(name, type, ext);\n }", "function getElementId(context) {\n return `#${context.id}`;\n}", "getFormId(element) {\n return element.getAttribute(\"id\");\n }", "getFormId(element) {\n return element.getAttribute(\"id\");\n }", "get id() {\n return new ElementAttribute(this.get(0), \"id\");\n }", "get id() {\n return new ElementAttribute(this.get(0), \"id\");\n }", "getId() {\n return this._executeAfterInitialWait(() => this.currently.getAttribute('id'));\n }", "function getUrlId() {\n return getURLSearch().replace('id=', '');\n}", "getHtmlId() {\n return '_frm-' + this.getLongId();\n }", "function getId(el){\n var id = el.getAttribute('adf-id');\n return id ? id : '-1';\n }", "function ge(x) {\r var elementId = document.getElementById(x);\r return elementId;\r }", "function opSetId(id, xml) {\r\n return xml.replace(/\\$\\$ID\\$\\$/g, id);\r\n}", "function icm_id (src) {\r\n var a = $x(\"//input[@name='comment[reference_id]']\", src);\r\n if(a.length == 1)\r\n return a[0].value;\r\n}", "getId() {\n const parent = this.getParent();\n return parent ? `${parent.getId()}/${this.getInternalId()}` : this.getInternalId();\n }", "function _(e) {return document.getElementById(e)}", "function getModelId()\n{\n\t var id = null;\n var inp = document.getElementsByName('modelId');\n var rw = -1;\n var r = -1;\n var sign = 1;\n for (var i = 0; i < inp.length; i++) {\n \tr++;\n if (inp[i].type == \"radio\" && inp[i].checked) {\n \trw = r + 1;\n \tbreak;\n }\n }\n if (rw >= 0) {\n \tvar table = document.getElementById(\"models\");\n \tvar row = table.rows[rw];\n \tif (row.style.color === 'lightgray') {\n sign = - 1;\n\t\t}\n var cell = row.cells[1];\n id = cell.innerHTML * sign;\n }\n return id;\n}", "getElementId(){\n return `${this.constructor.elementIdPrefix}${this.identity}`;\n }", "function GetID(event) {\n let id;\n try {\n id = (window.opener)? window.opener.curID : curID;\n } catch (error) { id = null; }\n\n while (!id || id === \"\") {\n id = (IsOnTurk())? GetAssignmentId() : prompt('Please enter your mTurk ID:','');\n }\n return id;\n}", "function getAttribute2(srcElement){\n try{\n return \"\"+ srcElement.getAttribute(\"id\");\n }catch(e){\n return \"--\";\n }\n}", "get id() {\r\n return utils.hash(TX_CONST + JSON.stringify({\r\n proof: this.proof,\r\n cm: this.cm }));\r\n }", "function igtId() {\n id = $('#igt-instance').attr('igtid');\n return id;\n}", "function makeId() {\n idNumber = idNumber + 1;\n const newId = ($tw.browser?'b':'s') + idNumber;\n return newId;\n }", "toString() {\r\n return this.id ? `<@${this.id}>` : null;\r\n }", "function getId() {\n return sanitizeId(idGen.generateCombination(2, \"-\"));\n}", "function generateElifDirective(condition) {\n return `#elif defined ${condition}`;\n }", "function _id(val) {\n return document.getElementById(val);\n}", "generateRuleId(){\n\n\treturn (\"R-\"+this.props.advertiserId+\"-\"+this.props.addId+\"-\"+Date.now());\n\t}", "getId() {\n return this.getAttribute('id');\n }", "get id() {\n return this.#el?.id ?? this.#id;\n }", "function newId(_id)\n{\n if(_id == \"watchHeader\")\n {\n return \"tutHeader\";\n }\n else\n {\n return \"watchHeader\";\n }\n}", "get id() {\n console.log('in id getter');\n return this._id + 'TEMPORARY';\n }", "getId() {\n uniqueId++\n return uniqueId;\n }", "function getId(x) {\n\treturn document.getElementById(x);\n}", "function onlyId() {\n\t\tvar id = CONSTANTS.KIT_DOM_ID_PREFIX + only();\n\t\tvar count;\n\t\tif(arguments.length == 1) {\n\t\t\tcount = arguments[0];\n\t\t} else {\n\t\t\tcount = 0;\n\t\t}\n\t\tcount++;\n\t\t$kit.log(count);\n\t\tif(count > 100) {\n\t\t\tthrow \"error!\";\n\t\t}\n\t\tif(!isEmpty(el8id(id))) {\n\t\t\treturn onlyId(count);\n\t\t}\n\t\treturn id\n\t}", "function getId(ele){\t// store the id value\r\n id_value = ele.id; \r\n}", "function findSelectedAssessId() {\n\n if (selectedAssessment!=null){\n return $(selectedAssessment).attr(\"id\");\n }\n return null;\n}", "function creatPopId(){\n\t\t\tvar i = \"pop_\" + (new Date()).getTime()+parseInt(Math.random()*100000);//Popup Index\n\t\t\tif($(\"#\" + i).length > 0){\n\t\t\t\treturn creatPopId();\n\t\t\t}else{\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}", "function getIdMain()\n{\n _idMainChar = jisQuery( '.idHolder' ).first().html();\n _idStorage += _idMainChar;\n}", "function l(what) {return document.getElementById(what);}", "get id() {\n return this.getAttributeValue(\"id\");\n }", "createIdInOption(id) {\n var idInOption = `${id}#${this.idRegister}`;\n this.idRegister++;\n\n return idInOption;\n }", "getHTML(){const l=this.strings.length-1;let html=\"\",isCommentBinding=!1;for(let i=0;i<l;i++){const s=this.strings[i],commentOpen=s.lastIndexOf(\"<!--\");// For each binding we want to determine the kind of marker to insert\n// into the template source before it's parsed by the browser's HTML\n// parser. The marker type is based on whether the expression is in an\n// attribute, text, or comment poisition.\n// * For node-position bindings we insert a comment with the marker\n// sentinel as its text content, like <!--{{lit-guid}}-->.\n// * For attribute bindings we insert just the marker sentinel for the\n// first binding, so that we support unquoted attribute bindings.\n// Subsequent bindings can use a comment marker because multi-binding\n// attributes must be quoted.\n// * For comment bindings we insert just the marker sentinel so we don't\n// close the comment.\n//\n// The following code scans the template source, but is *not* an HTML\n// parser. We don't need to track the tree structure of the HTML, only\n// whether a binding is inside a comment, and if not, if it appears to be\n// the first binding in an attribute.\n// We're in comment position if we have a comment open with no following\n// comment close. Because <-- can appear in an attribute value there can\n// be false positives.\nisCommentBinding=(-1<commentOpen||isCommentBinding)&&-1===s.indexOf(\"-->\",commentOpen+1);// Check to see if we have an attribute-like sequence preceeding the\n// expression. This can match \"name=value\" like structures in text,\n// comments, and attribute values, so there can be false-positives.\nconst attributeMatch=lastAttributeNameRegex.exec(s);if(null===attributeMatch){// We're only in this branch if we don't have a attribute-like\n// preceeding sequence. For comments, this guards against unusual\n// attribute values like <div foo=\"<!--${'bar'}\">. Cases like\n// <!-- foo=${'bar'}--> are handled correctly in the attribute branch\n// below.\nhtml+=s+(isCommentBinding?marker:nodeMarker)}else{// For attributes we use just a marker sentinel, and also append a\n// $lit$ suffix to the name to opt-out of attribute-specific parsing\n// that IE and Edge do for style and certain SVG attributes.\nhtml+=s.substr(0,attributeMatch.index)+attributeMatch[1]+attributeMatch[2]+boundAttributeSuffix+attributeMatch[3]+marker}}html+=this.strings[l];return html}", "function make_selector_from_id(id) {\n return '[id=\"'+id + '\"]';\n}", "function make_selector_from_id(id) {\n return '[id=\"'+id + '\"]';\n}", "function id(m) {\n\t var meaning = lang_1.isPresent(m.meaning) ? m.meaning : '';\n\t var content = lang_1.isPresent(m.content) ? m.content : '';\n\t return lang_1.escape(\"$ng|\" + meaning + \"|\" + content);\n\t}", "function getItemId() {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function createIdEvaluator(nameLiteral) {\n var name = lits[nameLiteral];\n return idEvaluator;\n\n function idEvaluator(ctx, writer) {\n return ctx[name];\n }\n }", "getRecipeOfTheDayID() {\n let recipeID = this.articleSaveRecipeOfTheDay.getAttribute('data-id');\n //console.log(`Recipe of the Day ID - ${ recipeID}`);\n return recipeID;\n }", "getId() {\n return MxI.$Null;\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n if(element!=null)\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function generateID ( $ )\n{\n thisid = $.prop ( 'id' );\n if ( strlen ( thisid ) === 0 )\n {\n thisid = \"GenID_\" + str_pad ( generateID_counter + \"\" , 4 , \"0\" , STR_PAD_LEFT );\n generateID_counter++;\n $.prop ( 'id' , thisid );\n }\n return thisid;\n}", "function getAttributeId(elementId, elementType){\n\tvar id = elementId;\n\tif(elementType == \"radio\" || elementType == \"checkbox\" || elementType == \"select-one\" || elementType == \"select-multiple\"){\n\t\tid = elementId.replace(/_attribute\\S*/, \"\");\n\t}\n\treturn id;\n}", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getQuizTitleId() {\n // Declare elemId as '#quizTitle' by default\n let elemId = '#quizTitle';\n\n // If we are on a quiz search page, or viewing a quiz..\n if ($('.quiz-search').length || $('#viewQuiz').length) {\n // Set elemId to '#modalQuizTitle'\n elemId = '#modalQuizTitle';\n }\n\n return elemId; // return the elemId\n}", "function getEntityIDFromWhereFragment(wherePredicate) {\n if (!wherePredicate || wherePredicate.preds) return undefined;\n // validation occurs inside of the toODataFragment call here.\n if (wherePredicate.expr1Source.toUpperCase() === 'ID') {\n return wherePredicate.expr2Source\n } else {\n return undefined;\n }\n }", "function generateID() {\r\n var issueID = chance.guid();\r\n return issueID;\r\n}", "function id(el){\n return document.getElementById(el);\n}", "function getId(x)\n {\n return document.getElementById(x);\n }", "function getNewTextId(elem) {\n return elem.getAttribute(\"data-for\");\n }", "function getId() {\n\treturn '[' + pad(++testId, 3) + '] ';\n}", "function gId(s) {\n return document.getElementById(s);\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "function getMapId() {\n \n var mapIdInHtml = C_MAP_ID;\n\n return mapIdInHtml;\n\n}", "function setWebcrawlerID(){\n $jQ('*').each(function(i){\n tag=$jQ(this).prop(\"tagName\");\n if (tag!==\"BR\" && tag!==\"STYLE\")\n $jQ(this).attr(vars.id, i+1);\n });\n}", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }" ]
[ "0.5656492", "0.55521345", "0.5539869", "0.55060476", "0.55060476", "0.54695356", "0.54695356", "0.536411", "0.53513783", "0.53201914", "0.53169733", "0.5291072", "0.5237168", "0.51988393", "0.5193068", "0.51418287", "0.51248926", "0.5124469", "0.51183987", "0.51112384", "0.5090593", "0.503919", "0.50221694", "0.50063443", "0.50008166", "0.49756294", "0.49712062", "0.49557292", "0.49533033", "0.49470422", "0.4933136", "0.4928823", "0.49142632", "0.48753655", "0.48708832", "0.48706728", "0.48492667", "0.48455966", "0.48246464", "0.48164847", "0.48162398", "0.47976705", "0.47900638", "0.47870302", "0.47870302", "0.47845003", "0.4783649", "0.47827056", "0.47718036", "0.47612694", "0.47589156", "0.47531196", "0.4743182", "0.4740652", "0.4740652", "0.4740652", "0.4740652", "0.4740652", "0.47393262", "0.47301257", "0.4717347", "0.47152913", "0.47136572", "0.47130182", "0.47123027", "0.47106493", "0.47102386", "0.47102386", "0.47102386", "0.47102386", "0.47102386", "0.47102386", "0.47102386", "0.47099137", "0.47071207", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368", "0.47058368" ]
0.48050958
42
Updates data in the context when the state or props change
getChildContext() { return { // story is passed along context to handle entities rendering story: this.state.story, // dimensions are the dimensions of the wrapper dimensions: this.state.dimensions }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateContext(context) {\n this.context = context\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 }", "function updateContext () {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n const dataItemOrObservable = isFunc ? realDataItemOrAccessor() : realDataItemOrAccessor;\n let dataItem = unwrap(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext[contextSubscribeSymbol]) {\n parentContext[contextSubscribeSymbol]();\n }\n\n // Copy $root and any custom properties from the parent context\n extend(self, parentContext);\n\n // Copy Symbol properties\n if (contextAncestorBindingInfo in parentContext) {\n self[contextAncestorBindingInfo] = parentContext[contextAncestorBindingInfo];\n }\n } else {\n self.$parents = [];\n self.$root = dataItem;\n }\n\n self[contextSubscribeSymbol] = subscribable$$1;\n\n if (shouldInheritData) {\n dataItem = self.$data;\n } else {\n self.$rawData = dataItemOrObservable;\n self.$data = dataItem;\n }\n\n if (dataItemAlias) { self[dataItemAlias] = dataItem; }\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback) { extendCallback(self, parentContext, dataItem); }\n\n return self.$data\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(data = {}) {\n this.state = Object.assign(this.state, data);\n this.notify(this.state);\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 }", "onUpdate(data) {\n this.setState(data);\n }", "function updateContext(values) {\n setContext({\n ...context,\n ...values\n })\n }", "componentDidUpdate() { //triggered if data changed in the database\n this.setData()\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = unwrap(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n self._subscribable = subscribable;\n } else {\n self.$parents = [];\n self.$root = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self.ko = options.knockoutInstance;\n }\n self.$rawData = dataItemOrObservable;\n self.$data = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self.$data;\n }", "updateContext (state, { key, value }) {\n if (value) {\n Vue.set(state.context, key, {...state.context[key], ...value})\n } else {\n Vue.delete(state.context, key)\n }\n }", "updateData(config) {\r\n this.setState(config);\r\n }", "_mergeWithCurrentState(change) {\n return assign(this.props.data, change);\n }", "update(key, value) {\n let property = {};\n property[key] = value;\n // Change state\n this.setState(property, () => this.getData());\n }", "componentDidUpdate() {\n console.log('got context');\n if (typeof this.context.user !== 'undefined' && this.context.user !== null && !this.state.gotContext) {\n console.log('got context');\n this.setState({\n gotContext: true,\n userFullName: this.context.user.firstname + ' ' + this.context.user.lastname,\n });\n }\n }", "componentWillReceiveProps(nextProps){\n this.setState({\n data: nextProps.data\n });\n this.forceUpdate();\n }", "handleUpdate(data) {\n this.setState({ data });\n}", "mergeWithCurrentState(change) {\n return assign(this.props.data, change);\n }", "triggerContextUpdate() {\n if (typeof this.setState !== 'function') {\n throw new Error(\n '[ProviderStore.triggerContextUpdate()] setState() is not configured: Unable to trigger a context update'\n );\n }\n\n this.setState(this.clone());\n }", "componentDidUpdate(prevProps,prevState){\n console.log(\"prevProps\",prevProps);\n console.log(\"prevState\",prevState);\n // We can do something like this in General.\n\n if(prevProps.counter.value!==this.props.counter){\n // AJAX Call and get new Data from the Source\n }\n }", "storeUpdated(store, prop) {\n if (prop !== \"selectedContextData\") return\n this.isDataVizEmpty() ? this.lineChart().createDataVis() : this.lineChart().updateDataVis()\n }", "contextDidChange() {\n this.currentModel = this.context;\n }", "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any obsevables (or is\n // itself an observable), the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItem = isFunc ? dataItemOrAccessor() : dataItemOrAccessor;\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrAccessor;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n\t // Most of the time, the context will directly get a view model object, but if a function is given,\n\t // we call the function to retrieve the view model. If the function accesses any observables or returns\n\t // an observable, the dependency is tracked, and those observables can later cause the binding\n\t // context to be updated.\n\t var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n\t dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n\t if (parentContext) {\n\t // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n\t // parent context is updated, this context will also be updated.\n\t if (parentContext._subscribable)\n\t parentContext._subscribable();\n\n\t // Copy $root and any custom properties from the parent context\n\t ko.utils.extend(self, parentContext);\n\n\t // Because the above copy overwrites our own properties, we need to reset them.\n\t self._subscribable = subscribable;\n\t } else {\n\t self['$parents'] = [];\n\t self['$root'] = dataItem;\n\n\t // Export 'ko' in the binding context so it will be available in bindings and templates\n\t // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n\t // See https://github.com/SteveSanderson/knockout/issues/490\n\t self['ko'] = ko;\n\t }\n\t self['$rawData'] = dataItemOrObservable;\n\t self['$data'] = dataItem;\n\t if (dataItemAlias)\n\t self[dataItemAlias] = dataItem;\n\n\t // The extendCallback function is provided when creating a child context or extending a context.\n\t // It handles the specific actions needed to finish setting up the binding context. Actions in this\n\t // function could also add dependencies to this binding context.\n\t if (extendCallback)\n\t extendCallback(self, parentContext, dataItem);\n\n\t return self['$data'];\n\t }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n self._subscribable = subscribable;\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n self._subscribable = subscribable;\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any obsevables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any obsevables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\n }", "function updateContext() {\n // Most of the time, the context will directly get a view model object, but if a function is given,\n // we call the function to retrieve the view model. If the function accesses any observables or returns\n // an observable, the dependency is tracked, and those observables can later cause the binding\n // context to be updated.\n var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n if (parentContext) {\n // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n // parent context is updated, this context will also be updated.\n if (parentContext._subscribable)\n parentContext._subscribable();\n\n // Copy $root and any custom properties from the parent context\n ko.utils.extend(self, parentContext);\n\n // Because the above copy overwrites our own properties, we need to reset them.\n // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n if (subscribable) {\n self._subscribable = subscribable;\n }\n } else {\n self['$parents'] = [];\n self['$root'] = dataItem;\n\n // Export 'ko' in the binding context so it will be available in bindings and templates\n // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n // See https://github.com/SteveSanderson/knockout/issues/490\n self['ko'] = ko;\n }\n self['$rawData'] = dataItemOrObservable;\n self['$data'] = dataItem;\n if (dataItemAlias)\n self[dataItemAlias] = dataItem;\n\n // The extendCallback function is provided when creating a child context or extending a context.\n // It handles the specific actions needed to finish setting up the binding context. Actions in this\n // function could also add dependencies to this binding context.\n if (extendCallback)\n extendCallback(self, parentContext, dataItem);\n\n return self['$data'];\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 }", "function updateContext() {\n\t // Most of the time, the context will directly get a view model object, but if a function is given,\n\t // we call the function to retrieve the view model. If the function accesses any obsevables or returns\n\t // an observable, the dependency is tracked, and those observables can later cause the binding\n\t // context to be updated.\n\t var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n\t dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n\t if (parentContext) {\n\t // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n\t // parent context is updated, this context will also be updated.\n\t if (parentContext._subscribable)\n\t parentContext._subscribable();\n\n\t // Copy $root and any custom properties from the parent context\n\t ko.utils.extend(self, parentContext);\n\n\t // Because the above copy overwrites our own properties, we need to reset them.\n\t // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n\t if (subscribable) {\n\t self._subscribable = subscribable;\n\t }\n\t } else {\n\t self['$parents'] = [];\n\t self['$root'] = dataItem;\n\n\t // Export 'ko' in the binding context so it will be available in bindings and templates\n\t // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n\t // See https://github.com/SteveSanderson/knockout/issues/490\n\t self['ko'] = ko;\n\t }\n\t self['$rawData'] = dataItemOrObservable;\n\t self['$data'] = dataItem;\n\t if (dataItemAlias)\n\t self[dataItemAlias] = dataItem;\n\n\t // The extendCallback function is provided when creating a child context or extending a context.\n\t // It handles the specific actions needed to finish setting up the binding context. Actions in this\n\t // function could also add dependencies to this binding context.\n\t if (extendCallback)\n\t extendCallback(self, parentContext, dataItem);\n\n\t return self['$data'];\n\t }", "function updateContext() {\n\t // Most of the time, the context will directly get a view model object, but if a function is given,\n\t // we call the function to retrieve the view model. If the function accesses any obsevables or returns\n\t // an observable, the dependency is tracked, and those observables can later cause the binding\n\t // context to be updated.\n\t var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,\n\t dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n\t if (parentContext) {\n\t // When a \"parent\" context is given, register a dependency on the parent context. Thus whenever the\n\t // parent context is updated, this context will also be updated.\n\t if (parentContext._subscribable)\n\t parentContext._subscribable();\n\n\t // Copy $root and any custom properties from the parent context\n\t ko.utils.extend(self, parentContext);\n\n\t // Because the above copy overwrites our own properties, we need to reset them.\n\t // During the first execution, \"subscribable\" isn't set, so don't bother doing the update then.\n\t if (subscribable) {\n\t self._subscribable = subscribable;\n\t }\n\t } else {\n\t self['$parents'] = [];\n\t self['$root'] = dataItem;\n\n\t // Export 'ko' in the binding context so it will be available in bindings and templates\n\t // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n\t // See https://github.com/SteveSanderson/knockout/issues/490\n\t self['ko'] = ko;\n\t }\n\t self['$rawData'] = dataItemOrObservable;\n\t self['$data'] = dataItem;\n\t if (dataItemAlias)\n\t self[dataItemAlias] = dataItem;\n\n\t // The extendCallback function is provided when creating a child context or extending a context.\n\t // It handles the specific actions needed to finish setting up the binding context. Actions in this\n\t // function could also add dependencies to this binding context.\n\t if (extendCallback)\n\t extendCallback(self, parentContext, dataItem);\n\n\t return self['$data'];\n\t }", "componentDidUpdate(prevProps) {\n if(prevProps.customer !== this.props.customer) {\n this.setInputValues();\n }\n }", "componentWillReceiveProps(nextProps) {\n\t\tvar settings_graph_data = this.state.settings_graph_data;\n\t\tvar settings_data = this.getSettingsData(nextProps.services, nextProps.categories);\n\t\tsettings_graph_data.datasets[0].data = settings_data;\n\t\tvar users_graph_data = this.state.users_graph_data;\n\t\tvar users_data = this.getUsersData(nextProps.providers, nextProps.agents, nextProps.consumers);\n\t\tusers_graph_data.datasets[0].data = users_data;\n\t\tvar tasks_graph_data = this.state.tasks_graph_data;\n\t\tvar tasks_data = this.getTasksData(nextProps.tasks);\n\t\ttasks_graph_data.datasets[0].data = tasks_data;\n\t\tthis.setState({ settings_graph_data: settings_graph_data, tasks_graph_data: tasks_graph_data, users_graph_data: users_graph_data });\n\t}", "componentWillReceiveProps(props){\n this.setData();\n }", "componentWillReceiveProps(nextProps) {\n if (nextProps.currentCategory !== this.props.currentCategory) {\n //console.log('nextProps', nextProps.currentCategory)\n\n let { title, description, imagePath } = nextProps.currentCategory\n\n this.setState({\n edit:true,\n checked:true,\n data:{\n ...this.state.data,\n title,\n description,\n imagePath\n }\n })\n }\n }", "update( data ) {\n this.state.cursor().update( cursor => {\n return cursor.merge( data )\n })\n }", "componentWillReceiveProps(nextProps) {\n this.setState({\n campaigns: this.modifyData(nextProps.campaigns)\n })\n }", "componentWillReceiveProps(nextProps) {\n this.setState({\n productDetails: nextProps.data\n });\n }", "componentDidMount(){\n this.UpdateData();\n }", "componentDidMount(){\n this.UpdateData();\n }", "update(data) {\n this.data = data || this.data;\n this._updateID++;\n }", "render() {\n return (\n <UIDataContext.Provider\n value={{\n ...this.state,\n getBusinessData: this.getBusinessData,\n getBusinessDataForId: this.getBusinessDataForId,\n getBusinessDataForType: this.getBusinessDataForType,\n updateBusiness: this.updateBusiness\n }}\n >\n {this.props.children}\n </UIDataContext.Provider>\n )\n }", "componentDidMount () {\n this.setState({ products: this.context.products })\n }", "componentDidUpdate() {\n this.componentData();\n }", "componentDidUpdate(prevProps){\n if (this.props.data !== prevProps.data) {\n\n\n //console.log(this.props.data);\n }\n\n\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 }", "updateWithoutSave(newValues) {\n // let newLanguageData = Object.assign({}, this.state.languageData, newValues)\n this.setState({\n // languageData: newLanguageData\n experiences: newValues\n })\n }", "updated(_changedProperties){}", "updated(_changedProperties){}", "update() {\n let scopes = this.stores.essentials.getAllScopes(),\n application = this.stores.kio.getApplication(this.props.applicationId);\n this.data = {\n application: application,\n applicationId: this.props.applicationId,\n isOwnApplication: this.stores.user\n .getUserTeams()\n .map(team => team.id)\n .some(id => id === application.team_id),\n ownerScopes: scopes.filter(s => s.is_resource_owner_scope),\n appScopes: scopes.filter(s => !s.is_resource_owner_scope),\n oauth: this.stores.mint.getOAuthConfig(this.props.applicationId)\n };\n }", "update (data) {\n for (let key in data) {\n if (this.hasOwnProperty(key)) { // Can only update already defined properties\n this[key] = data[key];\n }\n }\n }", "updateChanges(){\n let comp = new Competence();\n let competences = this.state.competences;\n let _this = this;\n let promises = [];\n let counter = 0;\n comp.mayApplyLocalChanges(competences, '{}.{}.name', '-', comp.toView.bind(comp)).then((comps) => {\n if(comps){\n this.loadData(false);\n } else return;\n _this.setState({competences:comps, dataSource: _this.getDatasource(comps)});\n });\n }", "componentDidUpdate(prevProps, prevState) {\n if (this.props.match.params.projectid !== prevProps.match.params.projectid) {\n this.getReactions();\n this.setData();\n this.setMembers();\n this.setUser();\n this.setMembership();\n this.getTags();\n this.getResources();\n this.getDocuments();\n this.getImages();\n this.setAuthor();\n this.setEditor();\n this.setLiker();\n }\n\n }", "_updateContext() {\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n view.detectChanges();\n }\n }", "componentWillReceiveProps(newProps) {\n console.log(newProps);\n this.setState({\n initialData: newProps.dataStore\n }, () => {\n this.handleChange();\n });\n }", "function updateData(data) {\n\t\t\t$scope.$parent.mainEntity.get().then(refreshMainEntity, processError);\n\t\t}", "componentDidUpdate(prevProps, prevState) {\n let currentParam = this.props.currentParam\n\n if (currentParam !== prevProps.currentParam) {\n this.setState({currentParam: currentParam})\n\n // Set localstorage whebn component update\n this.handleLocalStorage()\n }\n }", "updateClientState(uid, data) {\n this.pendingStates[uid] = data;\n }", "function updateContext() {\n\t// Switch the background image of the data – using an image to improve performance\n\tupdateContextBackgroundImage();\n\n\t// Mark each species in the context view, colored by threat level\n\t//contextCircles();\n\t//contextBars();\n\t\n\t// Draw rects for each family in context view, colored by threat level\n\t//contextFamilies();\n\t\n\t// Label each order with a line and its name\n\tcontextOrders();\n\t\n\t// Update context label\n\td3.select(\".contextlabel\").text(\"BROWSE ALL \"+getSingularFormClassname().toUpperCase()+\" SPECIES\")\t\n\t\t.attr(\"x\", function(d, i) {\n\t\t\tcontextlabelwidth = d3.select(this).node().getBBox().width\n\t\t\treturn x0;\n\t\t\t//return (divwidth/2)-(contextlabelwidth/2)\n\t\t\t})\n\t\td3.select(\".contextlabelhelperrect\").attr(\"x\", function () {\n\t\treturn x0-3;\n\t\t//return ((divwidth/2)-(contextlabelwidth/2))-contextlabelhelperrectspace;\n\t\t})\n\t\t.attr(\"width\", function() {return contextlabelwidth+(2*contextlabelhelperrectspace);}).attr(\"fill\", \"white\")\n\n\t\n\n}", "$_doPropsUpdate(props) {\n const previousProps = this.props\n const previousState = this.state\n const propsWithDefaults = this.$_addDefaultProps(props)\n this.$_doIncreaseTransactionLevel()\n if (!this.$runningPropsUpdate && this.controllerWillReceiveProps) {\n this.$runningPropsUpdate = true\n this.controllerWillReceiveProps(propsWithDefaults)\n this.$runningPropsUpdate = false\n }\n this.$props = propsWithDefaults\n this.$_doDecreaseTransactionLevel(previousProps, previousState)\n }", "unsafe_componentWillUpdate(nextProps, nextState) {\n\t\tthis.setData();\n\t}", "_mergeWithCurrentState(change) {\n const {updateProfileFormState} = this.props.data;\n return assign(updateProfileFormState, change);\n}", "updated(_changedProperties) { }", "_updateContext() {\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n let view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n view.detectChanges();\n }\n }", "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "componentWillReceiveProps(updatedProps) {\r\n console.log('New props received in EmployeeList');\r\n console.log(updatedProps);\r\n this.createDataSource(updatedProps);\r\n }", "_handleData() {\n // Pull out what we need from props\n const {\n _data,\n _dataOptions = {},\n } = this.props;\n\n // Pull out what we need from context\n const {\n settings = {},\n } = this.context;\n\n // Pull the 'getData' method that all modules which need data fetching\n // must implement\n const {\n getData = (() => Promise.resolve({ crap: 5 })),\n } = this.constructor;\n\n /**\n * Check if data was loaded server-side.\n * If not - we fetch the data client-side\n * and update the state\n *\n * We'll also add add the global settings to\n * the request implicitely\n */\n if (!_data) {\n getData(Object.assign({}, { __settings: settings }, _dataOptions))\n .then(_data => this.setState({ ['__data']: _data }))\n .catch(_data => this.setState({ ['__error']: _data }));\n }\n }", "handleStoreChanges() {\n // retrieve the \"global state\" that's in myStore by calling it's method 'returnAllData()', I made that method in todoStore.js, you can name it anything you want\n let updatedData = myStore.returnAllData();\n //using the updatedData variable I make sure to assign the incoming elements of the object to its corresponding keys here in Home's keys.\n this.setState({\n homeTasksArray: updatedData.tasks,\n totalCreated: updatedData.totalTasksCreated,\n totalRemoved: updatedData.totalTasksRemoved\n });\n }", "componentDidUpdate(oldProps) {\n if (\n this.props.selectedProductId !== oldProps.selectedProductId &&\n this.props.selectedProductId != null\n ) {\n const productToUpdate = this.props.inventory.find(\n (product) => product.id === this.props.selectedProductId\n );\n\n const { name, price, imgurl } = productToUpdate;\n\n this.setState({\n id: this.props.selectedProductId,\n name,\n price,\n imgurl,\n });\n }\n }", "componentDidUpdate(prevProps) {\n\t\tif (this.props.data !== prevProps.data) {\n\t\t\tthis.setState({\n\t\t\t\tdata: this.props.data,\n\t\t\t\tsensorCode: this.props.sensorCode,\n\t\t\t\tsensorName: this.props.sensorName,\n\t\t\t\tlocationCode: this.props.locationCode,\n\t\t\t\tunits: this.props.unitsOfMeasure\n\t\t\t});\n\t\t}\n\t}", "adminUpdate(){\n this.setState({\n users: adminStore.adminReturnUsers(),\n places: adminStore.adminReturnPlaces(),\n events: eventStore.getAllEvents()\n })\n }", "__doDataUpdate() {\n if (this.$isDestroyed) {\n return;\n }\n\n let queues = this.__setDataQueue;\n this.__setDataQueue = null;\n if (!queues || !queues.length) {\n return;\n }\n\n // call lifecycle beforeUpdate hook\n this.beforeUpdate && this.beforeUpdate();\n this.setData(getSetDataPaths(queues), this.__nextTickCallback);\n }", "updateRefresh(){\n\n\t\t//Run the provided order callback\n\t\tthis.props.orderCallback().then(res => {\n\n\t\t\t//Ensure react updates the DOM\n\t\t\tthis.forceUpdate();\n\n\t\t\t//Update the parent controller\n\t\t\tthis.props.parentUpdate();\n\n\t\t\t//Refresh details\n\t\t\taxios.post('/ingredient',{\n\t\t\t\tid: `${this.props.ingredientId}`\n\t\t\t}).then(res => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tdetails:res.data[0]\n\t\t\t\t})\n\t\t\t});\n\t\t}).catch(err=>{});\n\t}", "updateDecks() {\n this.setState(HearthstoneStore.getComposedState());\n }", "update(){\n\t\tthis.setState({\n\t\t\tusersCards:JSON.parse(JSON.stringify(modelInstance.getUsersCards())),\n\t\t\topponentsCards:JSON.parse(JSON.stringify(modelInstance.getOpponentsCards())),\n\t\t}, () => this.saveOriginalHealth());\n\t}", "componentDidMount() {\n this.update(this.props)\n }", "componentDidUpdate(prevProps, prevState) {\n if(this.props.product && prevProps.product !== this.props.product) {\n this.createDataset(this.props.product.history);\n }\n }", "componentDidUpdate(prevProps) {\n //Check to see if it was the technique id prop that was changed\n //This has the reason that otherwise the image data would not be fetched if the technique is set later\n if (this.props.id !== prevProps.id) {\n this.fetchData();\n }\n }", "componentDidUpdate(prevProps) {\n if (prevProps.current.id !== this.props.current.id) {\n this.setState({\n ...setStateData(this.props.current, this.props.viewer),\n loading: false,\n saving: \"IDLE\",\n editing: this.props.current.data.ownerId === this.props.viewer.id,\n });\n\n this._handleUpdateCarousel({\n objects: this.props.current.data.objects,\n editing: this.state.editing,\n });\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}", "notifyDataChanged() {\n this.hasDataChangesProperty = true;\n this.dataChanged.raiseEvent();\n }", "constructor(props){\n //console.log(props);\n super(props);\n console.log(props.data);\n this.onUpdate = this.onUpdate.bind(this);\n this.stateHandler = this.stateHandler.bind(this);\n const newData = {Writing:{},StateOptions:{}};\n this.state = {\n count:1,\n data: props.data || newData\n };\n }", "componentWillReceiveProps(new_props) {\n // get the new product_id from ProdcutsScreen\n // called from navigate('Order', {product_id: item_id}) in ProductsScreen\n const product_id = new_props.navigation.getParam(\"product_id\");\n if (product_id != undefined) {\n // update the product_id variable in state\n this.setState({product_id: product_id});\n // refresh product detail\n this.performRefresh(product_id);\n }\n }", "componentDidUpdate() {\n this.props.actions.updateQuestionSuccess({id: this.state.id, value: this.state.question});\n }", "componentWillReceiveProps(nextProps) {\n\t\tif (nextProps.data !== this.props.data) {\n\t\t\tthis.setState({\n\t\t\t\t...nextProps.data,\n\t\t\t});\n\t\t}\n\t}", "componentDidUpdate(oldProps) {\n const newProps = this.props;\n // TODO: support batch updates\n for (const prop in pick(newProps, attributesToStore)) {\n if (!isEqual(oldProps[prop], newProps[prop])) {\n if (prop in reduxActions) {\n let action;\n switch(reduxActions[prop]){\n case 'updateProps':\n action = actions[reduxActions[prop]]({\n key: prop,\n value: newProps[prop],\n });\n break;\n default:\n action = actions[reduxActions[prop]](newProps[prop]);\n }\n this.msaStore.dispatch(action);\n } else {\n console.error(prop, \" is unknown.\");\n }\n }\n }\n }", "componentDidMount()\n {\n this.updateData(this.props.list)\n }", "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "update() {\n this.setState({\n numberOfGuests: modelInstance.getNumberOfGuests(),\n menu: modelInstance.getMenu()\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 }", "update(...props) {\n if (this.onUpdate && this._) {\n return this.onUpdate(...props);\n }\n }", "componentDidUpdate(prevProps, prevState) {\n if (prevProps.list !== this.props.list) {\n this.updatePrices();\n }\n\n if (prevState.promoCode !== this.state.promoCode) {\n this.updatePrices();\n }\n }", "update(startingData) {}", "componentWillMount(){\n\t\tSTORE.on('dataUpdated', ()=> {\n\t\t\tthis.setState(STORE.data)\n\t\t})\n\t}" ]
[ "0.6943792", "0.6887212", "0.6870903", "0.6834622", "0.6834622", "0.6738094", "0.6657684", "0.649532", "0.647826", "0.6465182", "0.6451466", "0.64466405", "0.6435928", "0.6351043", "0.63240737", "0.6296172", "0.62808186", "0.62790316", "0.624504", "0.62392515", "0.6186127", "0.61782604", "0.6169754", "0.61421245", "0.6129314", "0.61242247", "0.61201745", "0.61201745", "0.6117197", "0.60938334", "0.60919315", "0.60919315", "0.60919315", "0.60919315", "0.60727626", "0.60502136", "0.60502136", "0.6030316", "0.59881073", "0.5981198", "0.5977662", "0.5972913", "0.5972259", "0.5950648", "0.59231097", "0.59231097", "0.5919069", "0.59139174", "0.59074134", "0.5895276", "0.58921343", "0.5887727", "0.58870876", "0.5882019", "0.5882019", "0.5881488", "0.5877573", "0.5867852", "0.5863227", "0.58559966", "0.5850367", "0.58479106", "0.58437884", "0.58404833", "0.58364516", "0.58214754", "0.5819996", "0.5808739", "0.5807055", "0.5803411", "0.5801139", "0.5795229", "0.57924306", "0.5782768", "0.57678485", "0.57662916", "0.5757914", "0.57472235", "0.5746666", "0.57396364", "0.57326514", "0.5731937", "0.57196814", "0.571618", "0.57118464", "0.57096976", "0.57096976", "0.5709517", "0.5709382", "0.5702622", "0.5699975", "0.5699364", "0.5696551", "0.5694136", "0.5685233", "0.56645906", "0.5659014", "0.56585056", "0.5658065", "0.5655322", "0.5655272" ]
0.0
-1
this method is called when your extension iopenTextDocuments activated your extension is activated the very first time the command is executed
function activate(context) { // assume only one preview supported. const contentProvider = new preview_content_provider_1.MarkdownPreviewEnhancedView(context); function openPreviewToTheSide(uri) { let resource = uri; if (!(resource instanceof vscode.Uri)) { if (vscode.window.activeTextEditor) { // we are relaxed and don't check for markdown files resource = vscode.window.activeTextEditor.document.uri; } } contentProvider.initPreview(resource, vscode.window.activeTextEditor, { viewColumn: vscode.ViewColumn.Two, preserveFocus: true, }); } function openPreview(uri) { let resource = uri; if (!(resource instanceof vscode.Uri)) { if (vscode.window.activeTextEditor) { // we are relaxed and don't check for markdown files resource = vscode.window.activeTextEditor.document.uri; } } contentProvider.initPreview(resource, vscode.window.activeTextEditor, { viewColumn: vscode.ViewColumn.One, preserveFocus: false, }); } function toggleScrollSync() { const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); const scrollSync = !config.get("scrollSync"); config.update("scrollSync", scrollSync, true).then(() => { contentProvider.updateConfiguration(); if (scrollSync) { vscode.window.showInformationMessage("Scroll Sync is enabled"); } else { vscode.window.showInformationMessage("Scroll Sync is disabled"); } }); } function toggleLiveUpdate() { const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); const liveUpdate = !config.get("liveUpdate"); config.update("liveUpdate", liveUpdate, true).then(() => { contentProvider.updateConfiguration(); if (liveUpdate) { vscode.window.showInformationMessage("Live Update is enabled"); } else { vscode.window.showInformationMessage("Live Update is disabled"); } }); } function toggleBreakOnSingleNewLine() { const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); const breakOnSingleNewLine = !config.get("breakOnSingleNewLine"); config .update("breakOnSingleNewLine", breakOnSingleNewLine, true) .then(() => { contentProvider.updateConfiguration(); if (breakOnSingleNewLine) { vscode.window.showInformationMessage("Break On Single New Line is enabled"); } else { vscode.window.showInformationMessage("Break On Single New Line is disabled"); } }); } function customizeCSS() { const globalStyleLessFile = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./style.less")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(globalStyleLessFile)); } function openMermaidConfig() { const mermaidConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./mermaid_config.js")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(mermaidConfigFilePath)); } function openMathJaxConfig() { const mathjaxConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./mathjax_config.js")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(mathjaxConfigFilePath)); } function openKaTeXConfig() { const katexConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./katex_config.js")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(katexConfigFilePath)); } function extendParser() { const parserConfigPath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./parser.js")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(parserConfigPath)); } function showUploadedImages() { const imageHistoryFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./image_history.md")); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(imageHistoryFilePath)); } function insertNewSlide() { const editor = vscode.window.activeTextEditor; if (editor && editor.document && editor.edit) { editor.edit((textEdit) => { textEdit.insert(editor.selection.active, "<!-- slide -->\n"); }); } } function insertPagebreak() { const editor = vscode.window.activeTextEditor; if (editor && editor.document && editor.edit) { editor.edit((textEdit) => { textEdit.insert(editor.selection.active, "<!-- pagebreak -->\n"); }); } } function createTOC() { const editor = vscode.window.activeTextEditor; if (editor && editor.document && editor.edit) { editor.edit((textEdit) => { textEdit.insert(editor.selection.active, '\n<!-- @import "[TOC]" {cmd="toc" depthFrom=1 depthTo=6 orderedList=false} -->\n'); }); } } function insertTable() { const editor = vscode.window.activeTextEditor; if (editor && editor.document && editor.edit) { editor.edit((textEdit) => { textEdit.insert(editor.selection.active, `| | | |---|---| | | | `); }); } } function openImageHelper() { contentProvider.openImageHelper(vscode.window.activeTextEditor.document.uri); } function webviewFinishLoading(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.updateMarkdown(sourceUri); } /** * Insert imageUrl to markdown file * @param uri: markdown source uri * @param imageUrl: url of image to be inserted */ function insertImageUrl(uri, imageUrl) { const sourceUri = vscode.Uri.parse(uri); vscode.window.visibleTextEditors .filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) && editor.document.uri.fsPath === sourceUri.fsPath) .forEach((editor) => { // const line = editor.selection.active.line editor.edit((textEditorEdit) => { textEditorEdit.insert(editor.selection.active, `![enter image description here](${imageUrl})`); }); }); } function refreshPreview(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.refreshPreview(sourceUri); } function openInBrowser(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.openInBrowser(sourceUri); } function htmlExport(uri, offline) { const sourceUri = vscode.Uri.parse(uri); contentProvider.htmlExport(sourceUri, offline); } function chromeExport(uri, type) { const sourceUri = vscode.Uri.parse(uri); contentProvider.chromeExport(sourceUri, type); } function princeExport(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.princeExport(sourceUri); } function eBookExport(uri, fileType) { const sourceUri = vscode.Uri.parse(uri); contentProvider.eBookExport(sourceUri, fileType); } function pandocExport(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.pandocExport(sourceUri); } function markdownExport(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.markdownExport(sourceUri); } /* function cacheSVG(uri, code, svg) { const sourceUri = vscode.Uri.parse(uri); contentProvider.cacheSVG(sourceUri, code, svg) } */ function cacheCodeChunkResult(uri, id, result) { const sourceUri = vscode.Uri.parse(uri); contentProvider.cacheCodeChunkResult(sourceUri, id, result); } function runCodeChunk(uri, codeChunkId) { const sourceUri = vscode.Uri.parse(uri); contentProvider.runCodeChunk(sourceUri, codeChunkId); } function runAllCodeChunks(uri) { const sourceUri = vscode.Uri.parse(uri); contentProvider.runAllCodeChunks(sourceUri); } function runAllCodeChunksCommand() { const textEditor = vscode.window.activeTextEditor; if (!textEditor.document) { return; } if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) { return; } const sourceUri = textEditor.document.uri; const previewUri = preview_content_provider_1.getPreviewUri(sourceUri); if (!previewUri) { return; } contentProvider.previewPostMessage(sourceUri, { command: "runAllCodeChunks", }); } function runCodeChunkCommand() { const textEditor = vscode.window.activeTextEditor; if (!textEditor.document) { return; } if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) { return; } const sourceUri = textEditor.document.uri; const previewUri = preview_content_provider_1.getPreviewUri(sourceUri); if (!previewUri) { return; } contentProvider.previewPostMessage(sourceUri, { command: "runCodeChunk", }); } function syncPreview() { const textEditor = vscode.window.activeTextEditor; if (!textEditor.document) { return; } if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) { return; } const sourceUri = textEditor.document.uri; contentProvider.previewPostMessage(sourceUri, { command: "changeTextEditorSelection", line: textEditor.selections[0].active.line, forced: true, }); } function clickTagA(uri, href) { href = decodeURIComponent(href); href = href .replace(/^vscode\-resource:\/\//, "") .replace(/^vscode\-webview\-resource:\/\/(.+?)\//, "") .replace(/^file\/\/\//, "file:///") .replace(/^https?:\/\/(.+?)\.vscode-webview-test.com\/vscode-resource\/file\/+/, "file:///") .replace(/^https?:\/\/file(.+?)\.vscode-webview\.net\/+/, "file:///"); if ([".pdf", ".xls", ".xlsx", ".doc", ".ppt", ".docx", ".pptx"].indexOf(path.extname(href)) >= 0) { mume_1.utility.openFile(href); } else if (href.match(/^file:\/\/\//)) { // openFilePath = href.slice(8) # remove protocol let openFilePath = mume_1.utility.addFileProtocol(href.replace(/(\s*)[\#\?](.+)$/, "")); // remove #anchor and ?params... openFilePath = decodeURI(openFilePath); vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(openFilePath), vscode.ViewColumn.One); } else { mume_1.utility.openFile(href); } } function clickTaskListCheckbox(uri, dataLine) { const sourceUri = vscode.Uri.parse(uri); const visibleTextEditors = vscode.window.visibleTextEditors; for (let i = 0; i < visibleTextEditors.length; i++) { const editor = visibleTextEditors[i]; if (editor.document.uri.fsPath === sourceUri.fsPath) { dataLine = parseInt(dataLine, 10); editor.edit((edit) => { let line = editor.document.lineAt(dataLine).text; if (line.match(/\[ \]/)) { line = line.replace("[ ]", "[x]"); } else { line = line.replace(/\[[xX]\]/, "[ ]"); } edit.replace(new vscode.Range(new vscode.Position(dataLine, 0), new vscode.Position(dataLine, line.length)), line); }); break; } } } function setPreviewTheme(uri, theme) { const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); config.update("previewTheme", theme, true); } context.subscriptions.push(vscode.workspace.onDidSaveTextDocument((document) => { if (preview_content_provider_1.isMarkdownFile(document)) { contentProvider.updateMarkdown(document.uri, true); } })); context.subscriptions.push(vscode.workspace.onDidChangeTextDocument((event) => { if (preview_content_provider_1.isMarkdownFile(event.document)) { contentProvider.update(event.document.uri); } })); context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => { contentProvider.updateConfiguration(); })); context.subscriptions.push(vscode.window.onDidChangeTextEditorSelection((event) => { if (preview_content_provider_1.isMarkdownFile(event.textEditor.document)) { const firstVisibleScreenRow = getTopVisibleLine(event.textEditor); const lastVisibleScreenRow = getBottomVisibleLine(event.textEditor); const topRatio = (event.selections[0].active.line - firstVisibleScreenRow) / (lastVisibleScreenRow - firstVisibleScreenRow); contentProvider.previewPostMessage(event.textEditor.document.uri, { command: "changeTextEditorSelection", line: event.selections[0].active.line, topRatio, }); } })); context.subscriptions.push(vscode.window.onDidChangeTextEditorVisibleRanges((event) => { const textEditor = event.textEditor; if (Date.now() < editorScrollDelay) { return; } if (preview_content_provider_1.isMarkdownFile(textEditor.document)) { const sourceUri = textEditor.document.uri; if (!event.textEditor.visibleRanges.length) { return undefined; } else { const topLine = getTopVisibleLine(textEditor); const bottomLine = getBottomVisibleLine(textEditor); let midLine; if (topLine === 0) { midLine = 0; } else if (Math.floor(bottomLine) === textEditor.document.lineCount - 1) { midLine = bottomLine; } else { midLine = Math.floor((topLine + bottomLine) / 2); } contentProvider.previewPostMessage(sourceUri, { command: "changeTextEditorSelection", line: midLine, }); } } })); /** * Open preview automatically if the `automaticallyShowPreviewOfMarkdownBeingEdited` is on. * @param textEditor */ context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor((textEditor) => { if (textEditor && textEditor.document && textEditor.document.uri) { if (preview_content_provider_1.isMarkdownFile(textEditor.document)) { const sourceUri = textEditor.document.uri; const config = vscode.workspace.getConfiguration("markdown-preview-enhanced"); const automaticallyShowPreviewOfMarkdownBeingEdited = config.get("automaticallyShowPreviewOfMarkdownBeingEdited"); const isUsingSinglePreview = config.get("singlePreview"); /** * Is using single preview and the preview is on. * When we switched text ed()tor, update preview to that text editor. */ if (contentProvider.isPreviewOn(sourceUri)) { if (isUsingSinglePreview && !contentProvider.previewHasTheSameSingleSourceUri(sourceUri)) { contentProvider.initPreview(sourceUri, textEditor, { viewColumn: contentProvider.getPreview(sourceUri).viewColumn, preserveFocus: true, }); } else if (!isUsingSinglePreview) { const previewPanel = contentProvider.getPreview(sourceUri); if (previewPanel) { previewPanel.reveal(vscode.ViewColumn.Two, true); } } } else if (automaticallyShowPreviewOfMarkdownBeingEdited) { openPreviewToTheSide(sourceUri); } } } })); /* context.subscriptions.push(vscode.workspace.onDidOpenTextDocument((textDocument)=> { // console.log('onDidOpenTextDocument', textDocument.uri) })) */ /* context.subscriptions.push(vscode.window.onDidChangeVisibleTextEditors(textEditors=> { // console.log('onDidChangeonDidChangeVisibleTextEditors ', textEditors) })) */ context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openPreviewToTheSide", openPreviewToTheSide)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openPreview", openPreview)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleScrollSync", toggleScrollSync)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleLiveUpdate", toggleLiveUpdate)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleBreakOnSingleNewLine", toggleBreakOnSingleNewLine)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openImageHelper", openImageHelper)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.runAllCodeChunks", runAllCodeChunksCommand)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.runCodeChunk", runCodeChunkCommand)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.syncPreview", syncPreview)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.customizeCss", customizeCSS)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openMermaidConfig", openMermaidConfig)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openMathJaxConfig", openMathJaxConfig)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openKaTeXConfig", openKaTeXConfig)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.extendParser", extendParser)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.showUploadedImages", showUploadedImages)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertNewSlide", insertNewSlide)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertTable", insertTable)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertPagebreak", insertPagebreak)); context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.createTOC", createTOC)); context.subscriptions.push(vscode.commands.registerCommand("_mume.revealLine", revealLine)); context.subscriptions.push(vscode.commands.registerCommand("_mume.insertImageUrl", insertImageUrl)); context.subscriptions.push(vscode.commands.registerCommand("_mume.pasteImageFile", image_helper_1.pasteImageFile)); context.subscriptions.push(vscode.commands.registerCommand("_mume.uploadImageFile", image_helper_1.uploadImageFile)); context.subscriptions.push(vscode.commands.registerCommand("_mume.refreshPreview", refreshPreview)); context.subscriptions.push(vscode.commands.registerCommand("_mume.openInBrowser", openInBrowser)); context.subscriptions.push(vscode.commands.registerCommand("_mume.htmlExport", htmlExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.chromeExport", chromeExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.princeExport", princeExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.eBookExport", eBookExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.pandocExport", pandocExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.markdownExport", markdownExport)); context.subscriptions.push(vscode.commands.registerCommand("_mume.webviewFinishLoading", webviewFinishLoading)); // context.subscriptions.push(vscode.commands.registerCommand('_mume.cacheSVG', cacheSVG)) context.subscriptions.push(vscode.commands.registerCommand("_mume.cacheCodeChunkResult", cacheCodeChunkResult)); context.subscriptions.push(vscode.commands.registerCommand("_mume.runCodeChunk", runCodeChunk)); context.subscriptions.push(vscode.commands.registerCommand("_mume.runAllCodeChunks", runAllCodeChunks)); context.subscriptions.push(vscode.commands.registerCommand("_mume.clickTagA", clickTagA)); context.subscriptions.push(vscode.commands.registerCommand("_mume.clickTaskListCheckbox", clickTaskListCheckbox)); context.subscriptions.push(vscode.commands.registerCommand("_mume.showUploadedImageHistory", showUploadedImages)); context.subscriptions.push(vscode.commands.registerCommand("_mume.setPreviewTheme", setPreviewTheme)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activate() {\n this._setDocumentTitle();\n }", "function activate() {\n scope.$on('wizard_changes-have-been-made', onChanges);\n scope.$on('text-edit_changes-have-been-made', onChanges);\n\n // array of the IDs of opened ndDialogs\n // will change if some ngDialog have been opened or closed\n scope.ngDialogs = ngDialog.getOpenDialogs();\n\n scope.$watchCollection('ngDialogs', function (newVal, oldVal) {\n if (lodash.isEmpty(oldVal) && newVal.length === 1) {\n $document.on('keyup', onKeyUp);\n } else if (lodash.isEmpty(newVal)) {\n $document.off('keyup', onKeyUp);\n\n isChangesHaveBeenMade = false;\n }\n });\n }", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"ckb-autocomplete\" is now active!');\n\n vscode.workspace.onDidChangeTextDocument(onDidChangeTextDocument);\n}", "function activateExtension() {\n Privly.options.setInjectionEnabled(true);\n updateActivateStatus(true);\n}", "function activate() {\n\t\t}", "function activate(){\n\n\t\t}", "function activate() {\n\n }", "onOpen() {\n\t\t}", "subscribeToFileOpen() {\n return atom.workspace.onDidOpen(event => {\n this.activeEditor = event.item;\n });\n }", "function activate() {\n\n\n }", "function activate(context) {\n store_1.store.extensionPath = context.extensionPath;\n store_1.store.booksPath = Path.join(context.extensionPath, 'book');\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"xv-book\" is now active!');\n treeViewProvider_1.treeViewProvider.initTreeView();\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n context.subscriptions.push(vscode.commands.registerCommand(config_1.Commands.setCookie, commands_1.setCookie), vscode.commands.registerCommand(config_1.Commands.searchOnline, commands_1.searchOnline), vscode.commands.registerCommand(config_1.Commands.openChapterWebView, (treeNode) => {\n if (!webView) {\n webView = ChapterView_1.createWebView(context, vscode.ViewColumn.Active, treeNode);\n context.subscriptions.push(webView.webviewPanel);\n }\n webView.updateChapter(treeNode);\n }));\n}", "function onOpen() {\n var menuItems = [\n {name: 'Add Password to All PDF Files Of Current Folder', functionName: 'addPasswordToCurrentFolderPDFs'} \n ];\n ss.addMenu('PDF.co', menuItems);\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"dsave\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.saveMe', function () {\n // The code you place here will be executed every time your command is executed\n //workbench.action.files.save\n\n // Display a message box to the user\n //vscode.window.showInformationMessage('Hello World!');\n });\n\n var watcher = vscode.workspace.createFileSystemWatcher(\"**/*-meta.json\"); //glob search string\n watcher.ignoreChangeEvents = false;\n watcher.ignoreCreateEvents = true;\n watcher.ignoreDeleteEvents = true;\n \n watcher.onDidChange(function(event) {\n console.log(\"here: \\n\" + event);\n converter.toXml(event.path);\n vscode.window.showInformationMessage(\"ddod\");\n });\n\n context.subscriptions.push(disposable);\n}", "function activate(context) {\n console.log('Congratulations, your extension \"funne\" is now active!');\n let disposable = vscode.commands.registerCommand('funne.init', () => {\n vscode.window.showInformationMessage('welcome to funne!');\n });\n context.subscriptions.push(disposable);\n}", "function qodeOnWindowLoad() {\n qodeInitElementorCustomFont();\n }", "function activate() {\n _registerLoadQuestionModuleHandler();\n _registerChooseAnswerHandler();\n _registerMakeDecisionHandler();\n }", "function activate() {\n _registerLoadQuestionModuleHandler();\n _registerChooseAnswerHandler();\n _registerMakeDecisionHandler();\n }", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"openapi-preview\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n context.subscriptions.push(vscode.commands.registerCommand('openapiPreview.open', function () {\n // The code you place here will be executed every time your command is executed\n // const config = vscode.workspace.getConfiguration('openApiPreview');\n const doc = vscode.window.activeTextEditor?.document;\n const panel = vscode.window.createWebviewPanel('openapiPreview', // Identifies the type of the webview. Used internally\n \"OpenAPI Preview\", // Title of the panel displayed to the user\n vscode.ViewColumn.Two, // Editor column to show the new webview panel in.\n getWebviewOptions(context.extensionUri));\n // And set its HTML content\n const elementsJsOnDiskPath = vscode.Uri.joinPath(context.extensionUri, 'node_modules', '@stoplight', 'elements', 'web-components.min.js');\n const elementsCssOnDiskPath = vscode.Uri.joinPath(context.extensionUri, 'node_modules', '@stoplight', 'elements', 'styles.min.css');\n const globalCssOnDiskPath = vscode.Uri.joinPath(context.extensionUri, 'css', 'global.css');\n const options = Object.assign({}, { elementsJsOnDiskPath, elementsCssOnDiskPath, globalCssOnDiskPath });\n panel.webview.html = getWebviewContent(panel.webview, options);\n panel.webview.onDidReceiveMessage(event => {\n if (event.type === 'ready') {\n updateSpec(panel, doc);\n }\n }, undefined, context.subscriptions);\n //change detection\n vscode.workspace.onDidSaveTextDocument(function (event) {\n if (doc?.fileName === event.fileName) {\n updateSpec(panel, doc);\n }\n });\n }));\n}", "initExtension() {\n\t\treturn;\n\t}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"raiman-tools\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n\n context.subscriptions.push(vscode.commands.registerCommand('raiman264.fileCheckout', fileCheckout));\n context.subscriptions.push(vscode.commands.registerTextEditorCommand('raiman264.prettyJSON', prettyJSON));\n context.subscriptions.push(vscode.commands.registerTextEditorCommand('raiman264.prettyCurl', prettyCurl));\n}", "activate() {\n super.activate();\n this.interactive = true;\n }", "function main(){\n app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;\n //app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;\n if(app.documents.length != 0){\n\t\tif (app.activeDocument.stories.length != 0){\n myFolder = (\"U:/\")\n expFormat = \".txt\"\n myExportPages(expFormat, myFolder)\n $.gc()\n }\n else alert(\"The document does not contain any text. Please open a document containing text and try again.\");\n }\n else alert(\"No documents are open. Please open a document and try again.\");\n}", "function activate(context) {\r\n\r\n var pdflatex = vscode.commands.registerCommand('extension.latexCompile', function() {\r\n\r\n try {\r\n vscode.workspace.saveAll();\r\n var pathFull = vscode.window.activeTextEditor.document.fileName;\r\n\r\n if (vscode.workspace.getConfiguration('latexCompile').mainFile) {\r\n if (vscode.workspace.rootPath) {\r\n pathFull = vscode.workspace.rootPath + \"/\" + vscode.workspace.getConfiguration('latexCompile').mainFile;\r\n } else {\r\n throw new Error('Use of mainFile requires a folder to be opened');\r\n }\r\n }\r\n\r\n if (getFileType(pathFull) != \"tex\") {\r\n throw new Error(\"Can't create PDF, open a .tex file.\");\r\n }\r\n\r\n //Child process that will invoke all shell commands\r\n var exec = require('child_process').exec;\r\n\r\n //Make log file to contain console\t\t\r\n var cdCmd = cdCommand(pathFull);\r\n exec(cdCmd + ' && type NUL > ' + quote(getFileName(pathFull)) + \".vscodeLog\");\r\n\r\n var compileSequence = [ cdCmd, texCommand(pathFull) ].join(' && ');\r\n console.log(compileSequence);\r\n setStatusBarText('Generating', \"PDF\");\r\n //Compile the LaTeX file; if citations are undefined, run\r\n //BibTeX and the compiler twice.\r\n exec(compileSequence, function (err, stdout, stderr) {\r\n errorCheck(pathFull, stdout, () => bibtexCheck(stdout, exec, pathFull));\r\n });\r\n } catch (error) {\r\n //Catch error and show the user the message in the error\r\n vscode.window.showErrorMessage(error.message);\r\n }\r\n });\r\n\r\n /**\r\n * Checks for undefined citations, then runs BibTeX, latexCompiler, latexCompiler\r\n * if there were undefined citations. Regardless, it opens the file.\r\n */\r\n function bibtexCheck(stdout, exec, pathFull) {\r\n // Check for undefined citations.\r\n let udCites = stdout.indexOf(\"There were undefined citations\") >= 0,\r\n udRefs = stdout.indexOf(\"There were undefined references\") >= 0;\r\n if (udCites || udRefs) {\r\n var texCompileCmd = texCommand(pathFull);\r\n if (udRefs && !udCites) {\r\n exec(texCommand, function (err, stdo, stderr) {\r\n errorCheck(pathFull, stdo, () => open(exec, getPDFName(pathFull)));\r\n });\r\n return;\r\n }\r\n // Command sequence to fix citations. Note the cd command is necessary.\r\n var bibSequence = [ \r\n cdCommand(pathFull),\r\n bibCommand(pathFull),\r\n texCompileCmd,\r\n texCompileCmd\r\n ].join(' && ');\r\n console.log(bibSequence);\r\n // Check compilation for errors, and open if none.\r\n exec(bibSequence, function (err, stdo, stderr) {\r\n errorCheck(pathFull, stdo, () => open(exec, getPDFName(pathFull))); \r\n });\r\n } else {\r\n // Open PDF file.\r\n open(exec, getPDFName(pathFull));\r\n }\r\n }\r\n\r\n /**\r\n * Opens pdfFileName.\r\n */\r\n function open(exec, pdfFileName) {\r\n if (vscode.workspace.getConfiguration('latexCompile').openAfterCompile) {\r\n setStatusBarText('Launching', \"PDF\");\r\n if (process.platform == 'darwin') {\r\n exec('open ' + quote(pdfFileName));\r\n } else if (process.platform == 'linux') {\r\n exec('xdg-open ' + quote(pdfFileName));\r\n } else {\r\n exec(quote(pdfFileName));\r\n }\r\n } else {\r\n vscode.window.showInformationMessage('PDF Compilled at ' + path);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the compilation process contains the phrase \"error.\"\r\n */\r\n function errorCheck(pathFull, stdout, callback) {\r\n //If error is found in output, display an error to user\r\n if (stdout.toLowerCase().indexOf(\"error\") > 0) {\r\n //Show error\r\n var fileName = getFileName(pathFull);\r\n var path = getFilePath(pathFull);\r\n vscode.window.setStatusBarMessage(\"Can't create PDF, see \" + fileName + \".vscodeLog\", 12000);\r\n\r\n if (vscode.workspace.getConfiguration('latexCompile').openLogAfterError) {\r\n var consoleLogFile = vscode.Uri.file(path + fileName + \".vscodeLog\");\r\n\r\n vscode.workspace.openTextDocument(consoleLogFile).then(function(d) {\r\n vscode.window.showTextDocument(d);\r\n // Open file, add console string, save file.\r\n var fd = fs.openSync(path + fileName + \".vscodeLog\", 'w+');\r\n var buffer = new Buffer(stdout);\r\n fs.writeSync(fd, buffer, 0, buffer.length);\r\n fs.close(fd);\r\n\r\n });\r\n\r\n }\r\n return;\r\n }\r\n // Call the callback if successful.\r\n callback();\r\n }\r\n\r\n // Returns the appropriate BibTeX command for the given file.\r\n function bibCommand(file) {\r\n var latexCompile = vscode.workspace.getConfiguration('latexCompile'),\r\n bibCommand = [ latexCompile.bibCompiler,\r\n quote(getFileName(file))\r\n ].join(' ');\r\n return bibCommand;\r\n }\r\n\r\n // Returns the appropriate latex compile command for the given file.\r\n function texCommand(file) {\r\n var latexCompile = vscode.workspace.getConfiguration('latexCompile'),\r\n texCompileCmd = [ latexCompile.compiler,\r\n quote(getFileNameAndType(file)),\r\n \"-interaction=nonstopmode\",\r\n \"-halt-on-error\"].join(' ');\r\n return texCompileCmd;\r\n }\r\n\r\n // Returns the appropriate change-directory command for the given file.\r\n function cdCommand(file) {\r\n var changeDirectory = \"cd \"\r\n if(process.platform == \"win322\")\r\n changeDirectory = \"cd /d \";\r\n return changeDirectory + quote(getFilePath(file));\r\n } \r\n\r\n //Function to put quotation marks around path\r\n function quote(path) {\r\n return '\"' + path + '\"';\r\n }\r\n \r\n //Function to get the name of the PDF\r\n function getPDFName(file) {\r\n return getFilePath(file) + getFileName(file) + \".pdf\";\r\n }\r\n //Function to get file name and type\r\n function getFileNameAndType(file) {\r\n var forwardSlash = file.lastIndexOf(\"/\");\r\n var backSlash = file.lastIndexOf(\"\\\\\");\r\n if (forwardSlash === -1 && backSlash === -1) {\r\n return file;\r\n }\r\n return file.substring((forwardSlash > backSlash) ? forwardSlash + 1 : backSlash + 1);\r\n }\r\n //Function to get only file type\r\n function getFileType(file) {\r\n var stringFile = getFileNameAndType(file);\r\n return stringFile.split(\".\")[1];\r\n }\r\n //Function to get only file name\r\n function getFileName(file) {\r\n var stringFile = getFileNameAndType(file);\r\n return stringFile.split(\".\")[0];\r\n }\r\n //Function to get only file path\r\n function getFilePath(file) {\r\n var path = file;\r\n path = path.match(/(.*)[\\/\\\\]/)[1] || ''; // extract the directory from the path\r\n path += '/';\r\n return path;\r\n }\r\n context.subscriptions.push(pdflatex);\r\n}", "function activate(context) {\r\n // Use the console to output diagnostic information (console.log) and errors (console.error)\r\n // This line of code will only be executed once when your extension is activated\r\n console.log('Congratulations, your extension \"ctags\" is now active!');\r\n var extension = new Extension(context);\r\n // The command has been defined in the package.json file\r\n // Now provide the implementation of the command with registerCommand\r\n // The commandId parameter must match the command field in package.json\r\n // Options to control the language client\r\n /*let clientOptions: LanguageClientOptions = {\r\n // Register the server for C source codes\r\n documentSelector: ['C'],\r\n } */\r\n}", "function first() {\n console.log(\"my fist extension was called!\");\n vscode.window.showInformationMessage(\"my stormalf-term extension was called!\");\n}", "function activate(context) {\n console.log('Extension \"Zenscript\" is now active!');\n}", "function activate(context) {\n console.log('The extension \"hl7tools\" is now active.');\n\n // get user preferences for the extension\n UpdateConfiguration();\n\n var activeEditor = window.activeTextEditor\n // only activate the field descriptions if it is identified as a HL7 file \n if (!IsHL7File(activeEditor)) {\n statusbarHL7Version.hide();\n return;\n }\n // exit if the editor is not active\n if (!activeEditor) {\n return;\n }\n else { \n // load the HL7 schema based on the version reported by the MSH segment\n LoadHL7Schema();\n // apply the hover descriptions for each field\n UpdateFieldDescriptions();\n }\n\n // the active document has changed. \n window.onDidChangeActiveTextEditor(function (editor) {\n if (editor) {\n // only activate the field descriptions if it is identified as a HL7 file \n if (IsHL7File(editor)) {\n // the new document may be a different version of HL7, so load the appropriate version of schema\n LoadHL7Schema();\n UpdateFieldDescriptions();\n HighlightFields.ShowHighlights(currentItemLocation, hl7Schema, highlightFieldBackgroundColor);\n }\n else {\n statusbarHL7Version.hide();\n }\n }\n }, null, context.subscriptions);\n\n // document text has changed\n workspace.onDidChangeTextDocument(function (event) {\n if (activeEditor && (event.document === activeEditor.document)) {\n // only activate the field descriptions if it is identified as a HL7 file \n if (IsHL7File(editor)) {\n UpdateFieldDescriptions();\n }\n else {\n statusbarHL7Version.hide();\n }\n }\n }, null, context.subscriptions);\n\n // user preferences have changed\n workspace.onDidChangeConfiguration(UpdateConfiguration);\n UpdateConfiguration();\n\n //-------------------------------------------------------------------------------------------\n // this function highlights HL7 items in the message based on item position identified by user.\n var highlightFieldCommand = vscode.commands.registerCommand('hl7tools.HighlightHL7Item', function () {\n console.log('In function Highlight Field');\n // prompt the user for the location of the HL7 field (e.g. PID-3). Validate the location via regex.\n var itemLocationPromise = vscode.window.showInputBox({ prompt: \"Enter HL7 item location (e.g. 'PID-3'), or the partial field name (e.g. 'name')\" });\n itemLocationPromise.then(function (itemLocation) {\n currentItemLocation = itemLocation;\n HighlightFields.ShowHighlights(itemLocation, hl7Schema, highlightFieldBackgroundColor);\n });\n\n });\n context.subscriptions.push(highlightFieldCommand);\n\n //-------------------------------------------------------------------------------------------\n // this function clears any highlighted HL7 items in the message\n var ClearHighlightedFieldsCommand = vscode.commands.registerCommand('hl7tools.ClearHighlightedFields', function () {\n console.log('In function ClearHighlightedFields');\n // set the highlighted location to null, then call ShowHighlights. This will clear highlights on a null location parameter.\n currentItemLocation = null;\n HighlightFields.ShowHighlights(currentItemLocation, hl7Schema, highlightFieldBackgroundColor);\n });\n context.subscriptions.push(ClearHighlightedFieldsCommand);\n\n //-------------------------------------------------------------------------------------------\n // This function masks out patient & next of kin identifiers\n var maskIdentifiersCommand = vscode.commands.registerCommand('hl7tools.MaskIdentifiers', function () {\n console.log('In function MaskIdentifiers');\n MaskIdentifiers.MaskAll();\n });\n context.subscriptions.push(maskIdentifiersCommand);\n\n //-------------------------------------------------------------------------------------------\n // Command to update the field descriptions (as a hover decoration over the field in the editor window)\n var identifyFieldsCommand = vscode.commands.registerCommand('hl7tools.IdentifyFields', function () {\n console.log('Running command hl7tools.IdentifyFields');\n UpdateFieldDescriptions();\n });\n context.subscriptions.push(identifyFieldsCommand);\n\n //-------------------------------------------------------------------------------------------\n // This function outputs the field tokens that make up the segment.\n // The function is based on TokenizeLine from https://github.com/pagebrooks/vscode-hl7 . Modified to \n // support repeating fields and make field indexes start at 1 (instead of 0) to match the HL7 field naming scheme. \n var displaySegmentCommand = vscode.commands.registerCommand('hl7tools.DisplaySegmentFields', function () {\n\n console.log('In function DisplaySegmentFields');\n\n // exit if the editor is not active\n var editor = vscode.window.activeTextEditor;\n if (!editor) {\n return;\n }\n\n var currentDoc = editor.document;\n var selection = editor.selection;\n var currentLineNum = selection.start.line;\n const fileName = path.basename(currentDoc.uri.fsPath);\n var currentSegment = currentDoc.lineAt(currentLineNum).text\n var segmentArray = currentSegment.split('|');\n var segmentName = segmentArray[0];\n var output = FieldTreeView.DisplaySegmentAsTree(currentSegment, hl7Schema, hl7Fields);\n\n // write the results to visual studio code's output window\n var channel = vscode.window.createOutputChannel('HL7 Fields - ' + segmentName + ' (' + fileName + ')');\n channel.clear();\n channel.appendLine(output);\n channel.show(vscode.ViewColumn.Two);\n\n });\n context.subscriptions.push(displaySegmentCommand);\n\n \n //-------------------------------------------------------------------------------------------\n // this function splits HL7 batch files into a separate file per message\n var splitBatchFileCommand = vscode.commands.registerCommand('hl7tools.SplitBatchFile', function () {\n var activeEditor = vscode.window.activeTextEditor;\n if (!activeEditor) {\n return;\n }\n // get the end of line char from the config file to append to each line.\n var config = vscode.workspace.getConfiguration();\n var endOfLineChar = config.files.eol;\n\n var newMessage = \"\";\n var batchHeaderRegEx = /(^FHS\\|)|(^BHS\\|)|(^BTS\\|)|(^FTS\\|)/i;\n var mshRegEx = /^MSH\\|/i;\n var currentDoc = activeEditor.document;\n var messageCount = 0;\n\n var allMessages = currentDoc.getText();\n\n var re = /^MSH\\|/gim;\n var split = allMessages.split(re);\n\n // If the user is splitting the file into more than 100 new files, warn and provide the opportunity to cancel.\n // Opening a large number of files could be a drain on system resources. \n if (split.length > 100) {\n var largeFileWarningPromise = vscode.window.showWarningMessage(\"This will open \" + split.length + \" new files. This could impact performance. Select 'Close' to cancel, or 'Continue' to proceed.\", \"Continue\");\n largeFileWarningPromise.then(function (response) {\n if (response == \"Continue\") {\n // loop through all matches, discarding anything before the first match (i.e batch header segments, or empty strings if MSH is the first segment) \n for (var i = 1; i < split.length; i++) {\n // TO DO: remove batch footers \n // open the message in a new document, user will be prompted to save on exit\n var newMessage = \"MSH|\" + split[i];\n vscode.workspace.openTextDocument({ content: newMessage, language: \"hl7\" }).then((newDocument) => {\n vscode.window.showTextDocument(newDocument, 1, false).then(e => {\n });\n }, (error) => {\n console.error(error);\n });\n }\n }\n });\n }\n // if the file is less than 100 messages, proceed with split.\n else {\n // loop through all matches, discarding anything before the first match (i.e batch header segments, or empty strings if MSH is the first segment) \n for (var i = 1; i < split.length; i++) {\n // TO DO: remove batch footers \n // open the message in a new document, user will be prompted to save on exit\n var newMessage = \"MSH|\" + split[i];\n vscode.workspace.openTextDocument({ content: newMessage, language: \"hl7\" }).then((newDocument) => {\n vscode.window.showTextDocument(newDocument, 1, false).then(e => {\n });\n }, (error) => {\n console.error(error);\n });\n }\n }\n });\n context.subscriptions.push(splitBatchFileCommand);\n\n //-------------------------------------------------------------------------------------------\n // This function sends the message in the active document to a remote host via TCP. The HL7 message is framed using MLLP.\n var SendMessageCommand = vscode.commands.registerCommand('hl7tools.SendMessage', function () {\n\n console.log(\"Sending HL7 message to remote host\");\n\n var activeEditor = vscode.window.activeTextEditor;\n if (!activeEditor) {\n return;\n }\n\n // get the HL7 message from the active document. Convert EOL to <CR> only.\n var currentDoc = activeEditor.document;\n var hl7Message = currentDoc.getText();\n var config = vscode.workspace.getConfiguration();\n const endOfLineChar = config.files.eol;\n hl7Message.replace(endOfLineChar, String.fromCharCode(0x0d));\n\n // get the user defaults for SendMessage\n var hl7toolsConfig = vscode.workspace.getConfiguration('hl7tools');\n const defaultEndPoint = hl7toolsConfig['DefaultRemoteHost'];\n const tcpConnectionTimeout = hl7toolsConfig['ConnectionTimeout'] * 1000;\n\n var remoteHostPromise = vscode.window.showInputBox({ prompt: \"Enter the remote host and port ('RemoteHost:Port')'\", value: defaultEndPoint });\n remoteHostPromise.then(function (remoteEndpoint) {\n // extract the hostname and port from the end point entered by the user\n remoteHost = remoteEndpoint.split(\":\")[0];\n remotePort = remoteEndpoint.split(\":\")[1];\n // send the current message to the remote end point.\n TcpMllpClient.SendMessage(remoteHost, remotePort, hl7Message, tcpConnectionTimeout);\n });\n\n });\n\n context.subscriptions.push(SendMessageCommand);\n\n //-------------------------------------------------------------------------------------------\n // This function receives messages from a remote host via TCP. Messages displayed in the editor as new documents.\n var StartListenerCommand = vscode.commands.registerCommand('hl7tools.StartListener', function () {\n\n var activeEditor = vscode.window.activeTextEditor;\n if (!activeEditor) {\n return;\n }\n\n // get the user defaults for port to listen on\n var hl7toolsConfig = vscode.workspace.getConfiguration('hl7tools');\n const defaultPort = hl7toolsConfig['DefaultListenerPort'];\n\n var listenerPromise = vscode.window.showInputBox({ prompt: \"Enter the TCP port to listen on for messages\", value: defaultPort });\n listenerPromise.then(function (listenerPort) {\n TcpMllpListener.StartListener(listenerPort);\n });\n });\n\n context.subscriptions.push(StartListenerCommand);\n\n //-------------------------------------------------------------------------------------------\n // This function stop listening for messages\n var StopListenerCommand = vscode.commands.registerCommand('hl7tools.StopListener', function () {\n\n TcpMllpListener.StopListener();\n });\n\n context.subscriptions.push(StopListenerCommand);\n\n\n //-------------------------------------------------------------------------------------------\n // apply descriptions to each field as a hover decoration (tooltip)\n function UpdateFieldDescriptions() {\n console.log(\"Updating field hover descriptions\");\n\n // exit if the editor is not active\n var activeEditor = vscode.window.activeTextEditor;\n if (!activeEditor) {\n return;\n }\n\n // don't apply descriptions if file is too large (i.e. large hl7 batch files). \n // Performance can be impacted on low specced systems \n var currentDoc = activeEditor.document;\n var hl7toolsConfig = vscode.workspace.getConfiguration('hl7tools');\n const maxLinesPreference = hl7toolsConfig['MaxLinesForFieldDescriptions'];\n var maxLines = Math.min(currentDoc.lineCount, maxLinesPreference);\n\n var regEx = /\\|/g;\n var validSegmentRegEx = /^[a-z][a-z]([a-z]|[0-9])\\|/i;\n var text = currentDoc.getText();\n // calculate the number of characters at the end of line (<CR>, or <CR><LF>)\n var config = vscode.workspace.getConfiguration();\n var endOfLineLength = config.files.eol.length;\n \n \n var hoverDecorationType = vscode.window.createTextEditorDecorationType({\n });\n\n // dispose of any prior decorations\n if (hoverDecorationList.length > 0) {\n currentHoverDecoration.dispose();\n hoverDecorationList = [];\n }\n // Search each line in the message to locate a matching segment.\n // For large documents end after a defined maximum number of lines (set via user preference) \n var positionOffset = 0;\n for (lineIndex = 0; lineIndex < maxLines; lineIndex++) {\n var startPos = null;\n var endPos = null;\n var currentLine = currentDoc.lineAt(lineIndex).text;\n var fields = currentLine.split('|');\n var segmentName = fields[0];\n var segmentDef = hl7Schema[segmentName];\n var fieldCount = -1;\n var previousEndPos = null;\n var fieldDescription = \"\";\n // ignore all lines that do not at least contain a segment name and field delimiter. This should be the absolute minimum for a segment\n if (!validSegmentRegEx.test(currentLine)) {\n positionOffset += currentLine.length + endOfLineLength;\n continue;\n }\n // the first delimiter is a field for MSH segments\n if (segmentName.toUpperCase() == \"MSH\") {\n fieldCount++;\n }\n // get the location of field delimiter characters\n while (match = regEx.exec(currentLine)) {\n endPos = activeEditor.document.positionAt(positionOffset + match.index);\n startPos = previousEndPos;\n previousEndPos = activeEditor.document.positionAt(positionOffset + match.index + 1);\n // when the next field is located, apply a hover tag decoration to the previous field\n if (startPos) {\n // try/catch needed for custom 'Z' segments not listed in the HL7 data dictionary.\n try {\n fieldDescription = segmentDef.fields[fieldCount].desc;\n }\n catch (err) {\n console.error(err);\n fieldDescription = \"\";\n }\n var decoration = { range: new vscode.Range(startPos, endPos), hoverMessage: fieldDescription + \" (\" + segmentName + \"-\" + (fieldCount + 1) + \")\" };\n hoverDecorationList.push(decoration);\n }\n fieldCount++;\n }\n // add a decoration for the last field in the segment (not bounded by a field delimiter) \n startPos = previousEndPos;\n endPos = activeEditor.document.positionAt(positionOffset + (currentLine.length + 1));\n try {\n fieldDescription = segmentDef.fields[fieldCount].desc;\n }\n catch (err) {\n console.error(err);\n fieldDescription = \"\";\n }\n var decoration = { range: new vscode.Range(startPos, endPos), hoverMessage: fieldDescription + \" (\" + segmentName + \"-\" + (fieldCount + 1) + \")\" };\n hoverDecorationList.push(decoration);\n\n // the field locations are relative to the current line, so calculate the offset of previous lines to identify the location within the file.\n positionOffset += currentLine.length + endOfLineLength;\n }\n\n // apply the hover decoration to the field \n activeEditor.setDecorations(hoverDecorationType, hoverDecorationList);\n currentHoverDecoration = hoverDecorationType;\n }\n}", "onOpen() { }", "function audioEditorDocumentReady() {\n audioEditorDocumentReadyPreview();\n audioEditorDocumentReadyCutters();\n audioEditorDocumentReadyGeneral();\n}", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"hwo\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.helloWorld', () => {\n // The code you place here will be executed every time your command is executed\n // Display a message box to the user\n vscode.window.showInformationMessage('Hello World!');\n });\n context.subscriptions.push(disposable);\n let asdasd = vscode.commands.registerCommand('extension.bla', () => {\n // The code you place here will be executed every time your command is executed\n var _a, _b;\n // Display a message box to the user\n vscode.window.showInformationMessage('bla!');\n let frontPosition = new vscode.Position(0, 0);\n let line_one_text = (_a = vscode.window.activeTextEditor) === null || _a === void 0 ? void 0 : _a.document.lineAt(0).text;\n // console.log(vscode.window.activeTextEditor?.document.save());\n // let length_of_first_line = vscode.window.activeTextEditor?.document.lineAt(0).text.length;\n // if (length_of_first_line !== undefined) {\n // \tlet backPosition = new vscode.Position(0, length_of_first_line);\n // \tconsole.log(vscode.window.activeTextEditor?.selection);\n // \tvscode.window.activeTextEditor?.edit(editBuilder => {\n // \t\teditBuilder.insert(backPosition, \").\");\n // \t});\n // }\n (_b = vscode.window.activeTextEditor) === null || _b === void 0 ? void 0 : _b.edit(editBuilder => {\n var _a;\n if (line_one_text !== undefined) {\n let backPosition = new vscode.Position(0, line_one_text.length);\n editBuilder.delete(new vscode.Range(frontPosition, backPosition));\n editBuilder.insert(frontPosition, \"-module(\" + line_one_text + \").\\n-compile(export_all).\");\n (_a = vscode.window.activeTextEditor) === null || _a === void 0 ? void 0 : _a.document.save();\n }\n // editBuilder.replace(frontPosition, \"-module(\" + line_one_text + \").\");\n });\n });\n context.subscriptions.push(asdasd);\n}", "activate() {\n this.active = true;\n }", "beginObservers () {\n\t\tthis.service.activate().then(() => {\n\t\t\tthis.disposables.add(this.service.onDidFinishIndexing(({path: paths}) => {\n\t\t\t\tif (!Array.isArray(paths)) {\n\t\t\t\t\tthis.createRangesForEditors(this.observing[paths])\n\t\t\t\t} else {\n\t\t\t\t\tfor (const path of paths) {\n\t\t\t\t\t\tthis.createRangesForEditors(this.observing[path])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}))\n\n\t\t\tthis.disposables.add(atom.workspace.observeTextEditors(this.observeTextEditor.bind(this)))\n\t\t})\n\t}", "function initOnLoadCompleted(e) {\n //add handler to event that receive message from popup page.\n browser.runtime.onMessage.addListener((message) => {\n switch (message.command) {\n case 'search'://'search' button clicked.\n Highlight(message.target);\n IsHighlight = true;\n break;\n case 'clear'://'clear' button clicked.\n Highlight(\"\");\n IsHighlight = false;\n break;\n case 'toggle'://'Ctrl+Alt+L'Shortcut\n if (IsHighlight) {\n Highlight(\"\");\n IsHighlight = false;\n }\n else {\n Highlight(message.target);\n IsHighlight = true;\n }\n break;\n }\n });\n}", "makeActive() {\n const { activeFile, editor, switchFile } = editorManager;\n if (activeFile?.id === this.id) return;\n\n activeFile?.removeActive();\n switchFile(this.id);\n\n if (this.focused) {\n editor.focus();\n } else {\n editor.blur();\n }\n\n this.#upadteSaveIcon();\n this.#tab.classList.add('active');\n this.#tab.scrollIntoView();\n if (!this.loaded && !this.loading) {\n this.#loadText();\n }\n\n editorManager.header.subText = this.#getTitle();\n\n this.#emit('focus', createFileEvent(this));\n }", "installed() {\n this._initializeEditor()\n }", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"apicontroller\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.apicontroller', () => {\n // The code you place here will be executed every time your command is executed\n vscode.window.showInputBox({ ignoreFocusOut: true, prompt: 'Digite o nome da classe de modelo', value: 'new' + +'.cs' })\n .then((newfilename) => {\n if (typeof newfilename === 'undefined') {\n return;\n }\n if (!newfilename.endsWith('.cs')) {\n newfilename += '.cs';\n }\n var newfilepath = './' + newfilename;\n openTemplateAndSaveNewFile(newfilename.replace('.cs', ''));\n });\n // Display a message box to the user\n });\n context.subscriptions.push(disposable);\n}", "function mkdfOnWindowLoad() {\n\n }", "function main(){\n //app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;\n app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;\n if(app.documents.length != 0){\n\t\tif (app.activeDocument.stories.length != 0){\n myFolder = (\"U:/\")\n expFormat = \".txt\"\n myExportPages(expFormat, myFolder)\n //myExportLinks(\n $.gc()\n }\n else alert(\"The document does not contain any text. Please open a document containing text and try again.\");\n }\n else alert(\"No documents are open. Please open a document and try again.\");\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"vscode-plugin-seek\" is now active!');\n\n const os = require('os');\n const createServer = require('./lib/service-bridge/server');\n const driver = require('./lib/driver');\n const spawnElectron = require('./lib/spawnElectron');\n const tmpdir = os.tmpdir();\n const sockPath = `unix://${tmpdir}/seek.sock`;\n\n const currDir = vscode.workspace.rootPath;\n\n createServer(driver, {\n path: sockPath\n });\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n\n const seekAdd = vscode.commands.registerCommand('extension.seekAdd', function () {\n const statusBar = vscode.window.setStatusBarMessage('$(watch)\\t 正在启动添加场景界面...');\n setTimeout(function () {\n statusBar.dispose();\n }, 3000);\n electronProcess = spawnElectron({\n appPath: path.join(__dirname, 'app'),\n sockPath,\n envParams: {\n ELECTRON_CURR_VIEW: 'add',\n ELECTRON_CURR_DIR: currDir\n }\n // others options in the future\n });\n })\n\n context.subscriptions.push(seekAdd);\n}", "function onInstall(e) {\n /**\n * The document is already open, so after installation is complete\n * the ˙onOpen()` trigger must be called manually in order for the\n * add-on to execute.\n */\n onOpen(e);\n}", "activate(state) {\n this.upgrade_settings();\n\n this.subscriptions = new CompositeDisposable();\n\n // register format command\n this.subscriptions.add(\n atom.commands.add(\"atom-workspace\", {\n \"atom-elixir-formatter:format\": () => formatter.formatActiveTextEditor()\n })\n );\n\n // register to receive text editor events\n this.subscriptions.add(\n atom.workspace.observeTextEditors(e => this.handleTextEvents(e))\n );\n }", "function onOpen() {\n var ui = DocumentApp.getUi();\n ui.createMenu('Script menu')\n .addItem('Setup', 'setup')\n .addItem('Create Events First Time', 'createDocForEvents')\n .addToUi();\n}", "function _beginLivePreview() {\n LiveDevelopment.open();\n }", "function mkdfOnDocumentReady() {\n mkdfCompareHolder();\n mkdfCompareHolderScroll();\n mkdfHandleAddToCompare();\n }", "OnActivated() {}", "function inputMethodFocus() {\n\t\t\tif (!editor.settings.content_editable) {\n\t\t\t\t// Case 1 IME doesn't initialize if you focus the document\n\t\t\t\t// Disabled since it was interferring with the cE=false logic\n\t\t\t\t// Also coultn't reproduce the issue on Safari 9\n\t\t\t\t/*dom.bind(editor.getDoc(), 'focusin', function() {\n\t\t\t\t\tselection.setRng(selection.getRng());\n\t\t\t\t});*/\n\n\t\t\t\t// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event\n\t\t\t\t// Needs to be both down/up due to weird rendering bug on Chrome Windows\n\t\t\t\tdom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {\n\t\t\t\t\tvar rng;\n\n\t\t\t\t\tif (e.target == editor.getDoc().documentElement) {\n\t\t\t\t\t\trng = selection.getRng();\n\t\t\t\t\t\teditor.getBody().focus();\n\n\t\t\t\t\t\tif (e.type == 'mousedown') {\n\t\t\t\t\t\t\tif (CaretContainer.isCaretContainer(rng.startContainer)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret\n\t\t\t\t\t\t\tselection.placeCaretAt(e.clientX, e.clientY);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function inputMethodFocus() {\n\t\t\tif (!editor.settings.content_editable) {\n\t\t\t\t// Case 1 IME doesn't initialize if you focus the document\n\t\t\t\t// Disabled since it was interferring with the cE=false logic\n\t\t\t\t// Also coultn't reproduce the issue on Safari 9\n\t\t\t\t/*dom.bind(editor.getDoc(), 'focusin', function() {\n\t\t\t\t\tselection.setRng(selection.getRng());\n\t\t\t\t});*/\n\n\t\t\t\t// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event\n\t\t\t\t// Needs to be both down/up due to weird rendering bug on Chrome Windows\n\t\t\t\tdom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {\n\t\t\t\t\tvar rng;\n\n\t\t\t\t\tif (e.target == editor.getDoc().documentElement) {\n\t\t\t\t\t\trng = selection.getRng();\n\t\t\t\t\t\teditor.getBody().focus();\n\n\t\t\t\t\t\tif (e.type == 'mousedown') {\n\t\t\t\t\t\t\tif (CaretContainer.isCaretContainer(rng.startContainer)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret\n\t\t\t\t\t\t\tselection.placeCaretAt(e.clientX, e.clientY);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function openDocument() {\n if (checkLocalStorage()) {\n if (myDiagram.isModified) {\n var save = confirm(\"Would you like to save changes to \" + getCurrentFileName() + \"?\");\n if (save) {\n saveDocument();\n }\n }\n openElement(\"openDocument\", \"mySavedFiles\");\n }\n}", "function qodeOnWindowLoad() {\r\n qodeInitelementorListingSimpleSearch();\r\n }", "function activate() {\n hideSidebar();\n setInitialDate();\n loadTransactionList();\n }", "async function cmdOpen(item, focusedWindow) {\n\n let targetWindow = focusedWindow;\n\n let path = await promptPDF();\n\n loadPDF(path, targetWindow);\n\n}", "function onOpen(e)\n{\n init();\n}", "onTabOpened(aTab, aFirstTab, aOldTab) {\n if (aTab.mode.name == \"folder\" || aTab.mode.name == \"glodaList\") {\n let modelTab = this.tabmail.getTabInfoForCurrentOrFirstModeInstance(\n aTab.mode\n );\n let oldFilterer =\n modelTab && \"quickFilter\" in modelTab._ext\n ? modelTab._ext.quickFilter\n : undefined;\n aTab._ext.quickFilter = new QuickFilterState(oldFilterer);\n this.updateSearch(aTab);\n this._updateToggle(aTab);\n }\n }", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"refactor-jsx\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand(\n 'extension.extractJsx',\n extractComponent\n );\n\n context.subscriptions.push(disposable);\n context.subscriptions.push(extractComponent);\n}", "function onInstall() {\n onOpen();\n}", "function onInstall() {\n onOpen();\n}", "function onInstall() {\n onOpen();\n}", "activate() {\n\n\t\tthis.arbitrate();\n\n\t}", "function first_load()\r\n{\r\n\ttext_input();\r\n\tupdate();\r\n\r\n\t// setup the message that pops up on exit\r\n\twindow.onbeforeunload = beforeunload;\r\n\r\n\t// setup shortcut keys\r\n\t// Vertical dash\r\n\tshortcut.add(\"Ctrl+Alt+D\",function() {\r\n\t\tinsertAtCursor(document.getElementById('editArea'),'|');\r\n\t});\r\n\t// Vertical square brackets\r\n\tshortcut.add(\"Ctrl+Alt+T\",function() {\r\n\t\tinsertAtCursor(document.getElementById('editArea'),'[]');\r\n\t});\r\n}", "onDocumentOpenOrContentChanged(document) {\n if (!this.startDataLoaded) {\n return;\n }\n // No need to handle file opening because we have preloaded all the files.\n // Open and changed event will be distinguished by document version later.\n if (this.shouldTrackFile(vscode_uri_1.URI.parse(document.uri).fsPath)) {\n this.trackOpenedDocument(document);\n }\n }", "activate() {\n\n }", "function qodeOnWindowLoad() {\n\t qodeInitNewsShortcodesPagination().init();\n }", "function activate() {\n\t\t\tconsole.log('Activated Chess View');\n\t\t\t\n\t\t}", "function enable()\n {\n browser.bookmarks.onRemoved.addListener(update_in_active_tabs);\n browser.tabs.onActivated.addListener(on_tab_activated);\n browser.tabs.onUpdated.addListener(on_tab_updated);\n browser.tabs.onRemoved.addListener(on_tab_removed);\n\n update_in_active_tabs();\n }", "function activate(context) {\r\n // Performs Initialization\r\n InitAdamsTool();\r\n // Add to a list of disposables which are disposed when this extension is deactivated.\r\n context.subscriptions.push(adamsTool);\r\n //context.subscriptions.push(disposable);\r\n}", "function activate() {\n console.debug(\"Activate pano viewer\");\n MasterService.activateLiveActivityGroupByName(ActivityGroups.PanoViewer);\n }", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error).\n // This line of code will only be executed once when your extension is activated.\n console.log('Congratulations, your extension \"WordCount\" is now active!');\n\n // create a new word counter\n let wordCounter = new WordCounter();\n\n let disposable = vscode.commands.registerCommand('extension.sayHello', () => {\n wordCounter.updateWordCount();\n });\n\n // Add to a list of disposables which are disposed when this extension is deactivated.\n context.subscriptions.push(wordCounter);\n context.subscriptions.push(disposable);\n}", "function EditorSharedStartup() {\n // Just for convenience\n gContentWindow = window.content;\n\n // Disable DNS Prefetching on the docshell - we don't need it for composer\n // type windows.\n GetCurrentEditorElement().docShell.allowDNSPrefetch = false;\n\n // Set up the mime type and register the commands.\n if (IsHTMLEditor()) {\n SetupHTMLEditorCommands();\n } else {\n SetupTextEditorCommands();\n }\n\n // add observer to be called when document is really done loading\n // and is modified\n // Note: We're really screwed if we fail to install this observer!\n try {\n var commandManager = GetCurrentCommandManager();\n commandManager.addCommandObserver(\n gEditorDocumentObserver,\n \"obs_documentCreated\"\n );\n commandManager.addCommandObserver(\n gEditorDocumentObserver,\n \"cmd_setDocumentModified\"\n );\n commandManager.addCommandObserver(\n gEditorDocumentObserver,\n \"obs_documentWillBeDestroyed\"\n );\n commandManager.addCommandObserver(\n gEditorDocumentObserver,\n \"obs_documentLocationChanged\"\n );\n\n // Until nsIControllerCommandGroup-based code is implemented,\n // we will observe just the bold command to trigger update of\n // all toolbar style items\n commandManager.addCommandObserver(gEditorDocumentObserver, \"cmd_bold\");\n } catch (e) {\n dump(e);\n }\n\n var isMac = AppConstants.platform == \"macosx\";\n\n // Set platform-specific hints for how to select cells\n // Mac uses \"Cmd\", all others use \"Ctrl\"\n var tableKey = GetString(isMac ? \"XulKeyMac\" : \"TableSelectKey\");\n var dragStr = tableKey + GetString(\"Drag\");\n var clickStr = tableKey + GetString(\"Click\");\n\n var delStr = GetString(isMac ? \"Clear\" : \"Del\");\n\n SafeSetAttribute(\"menu_SelectCell\", \"acceltext\", clickStr);\n SafeSetAttribute(\"menu_SelectRow\", \"acceltext\", dragStr);\n SafeSetAttribute(\"menu_SelectColumn\", \"acceltext\", dragStr);\n SafeSetAttribute(\"menu_SelectAllCells\", \"acceltext\", dragStr);\n // And add \"Del\" or \"Clear\"\n SafeSetAttribute(\"menu_DeleteCellContents\", \"acceltext\", delStr);\n\n // Set text for indent, outdent keybinding\n\n // hide UI that we don't have components for\n RemoveInapplicableUIElements();\n\n // Use browser colors as initial values for editor's default colors\n var BrowserColors = GetDefaultBrowserColors();\n if (BrowserColors) {\n gDefaultTextColor = BrowserColors.TextColor;\n gDefaultBackgroundColor = BrowserColors.BackgroundColor;\n }\n\n // For new window, no default last-picked colors\n gColorObj.LastTextColor = \"\";\n gColorObj.LastBackgroundColor = \"\";\n gColorObj.LastHighlightColor = \"\";\n}", "function onInstall() {\n onOpen();\n}", "function activate() {\n $log.debug('header activated');\n }", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"hello\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n var disposable = vscode.commands.registerCommand('hello.helloWorld', function () {\n // The code you place here will be executed every time your command is executed\n // Display a message box to the user\n vscode.window.showInformationMessage('Hello World from Hello!');\n });\n context.subscriptions.push(disposable);\n}", "function activate() {\n\t\t\twarnings.refreshData().then(function() {\n\t\t\t\tvm.warnings = warnings.getWarnings();\n\t\t\t});\n\t\t}", "__init15() {this._handleWindowFocus = () => {\n const breadcrumb = createBreadcrumb({\n category: 'ui.focus',\n });\n\n // Do not count focus as a user action -- instead wait until they focus and\n // interactive with page\n this._doChangeToForegroundTasks(breadcrumb);\n };}", "function inputMethodFocus() {\n\t\t\tif (!editor.settings.content_editable) {\n\t\t\t\t// Case 1 IME doesn't initialize if you focus the document\n\t\t\t\tdom.bind(editor.getDoc(), 'focusin', function() {\n\t\t\t\t\tselection.setRng(selection.getRng());\n\t\t\t\t});\n\n\t\t\t\t// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event\n\t\t\t\t// Needs to be both down/up due to weird rendering bug on Chrome Windows\n\t\t\t\tdom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {\n\t\t\t\t\tif (e.target == editor.getDoc().documentElement) {\n\t\t\t\t\t\teditor.getBody().focus();\n\n\t\t\t\t\t\tif (e.type == 'mousedown') {\n\t\t\t\t\t\t\t// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret\n\t\t\t\t\t\t\tselection.placeCaretAt(e.clientX, e.clientY);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselection.setRng(selection.getRng());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function InitOMButton(){\n objWindow.AddToolButton(\"document\", \"OMButton\", \"Org2Wiz\", \"\", \"OnOMButtonClicked\");\n\n var omAttachmentsOption = otw_getAttachOption();\n if((omAttachmentsOption === 'addtex') || (omAttachmentsOption === 'addpdf') || (omAttachmentsOption === 'addtexpdf')){\n objWindow.AddToolButton(\"document\", \"OMAttach\", \"AddAttach\", \"\", \"OnOMAttachClicked\");\n }\n}", "activate() {\n }", "function activate() {\n populationApp.toolbar.activate(Draw.FREEHAND_POLYGON);\n\n displayOutput(i18n.t(that.ns + \":na\"));\n }", "function activateAutoLinks() {\r\n\tlinkReaders.forEach( function(linkReader) {\r\n\t\tlinkReader.postMessage(extractorIsOn);\r\n\t});\r\n}", "init() {\n\t\tthis.#activateNew('Loading');\n\t}", "@MenuItem(\"GGJ/XModify\")\n\tstatic function Init() {\n\t\tvar window : XModify = EditorWindow.GetWindow(XModify);\n\t\twindow.Show();\n\t}", "activate() {\n this.paperTool.activate();\n }", "function activate(context) {\n\n context.subscriptions.push(vscode.commands.registerCommand('extension.switch', switchToOther));\n\n}", "static activate() {\n \n }", "function startExtension() {\n\t\tboolean receiverConfirmed = false;\n\n\t\tif (!receiverConfirmed) {\n\t\t\t//sends auto message to see if other person has extension.\n\t\t\tinsertToTextField(firstString);\n\n\t\t\t//sends Key\n\t\t\tinsertToTextField(publicKeyString);\n\n\n\n\t\t}\n\n\t\telse \n\t\t\tinsertToTextField(publicKeyString);\n\t}", "open() {\n\t\treturn true;\n\t}", "function activate(context) {\n //store the context\n extensionContext = context;\n\n //register storyteller commands for this plugin \n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.startStoryteller', startStoryteller));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.stopStoryteller', stopStoryteller));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.startPlaybackNoComment', startPlaybackNoComment));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.startPlaybackToMakeAComment', startPlaybackToMakeAComment));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.storytellerState', storytellerState));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.currentActiveDevelopers', currentActiveDevelopers));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.createNewDeveloper', createNewDeveloper));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.addDevelopersToActiveGroup', addDevelopersToActiveGroup));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.removeDevelopersFromActiveGroup', removeDevelopersFromActiveGroup));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.zipProject', zipProject));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.zipViewablePlayback', zipViewablePlayback));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.previewPerfectProgrammer', previewPerfectProgrammer));\n extensionContext.subscriptions.push(vscode.commands.registerCommand('storyteller.replaceWithPerfectProgrammer', replaceWithPerfectProgrammer));\n\n //if there is an open workspace then attempt to open storyteller without requiring user interaction\n if(vscode.workspace.workspaceFolders) {\n //path to the hidden .storyteller dir in every storyteller project \n const pathToHiddenStorytellerDir = path.join(vscode.workspace.workspaceFolders[0].uri.fsPath, '.storyteller');\n \n //if there is a .storyteller dir\n if(fs.existsSync(pathToHiddenStorytellerDir)) {\n //give a startup message in the status bar\n updateStorytellerStatusBar('Starting Storyteller $(sync~spin)', 'Starting Storyteller- please do not edit any files of dirs until this is complete', 'storyteller.storytellerState');\n \n //don't want to slow down the init of the system so we do the more expensive operations a little later\n setTimeout(function() {\n //init storyteller without a prompt\n startStoryteller();\n }, 1);\n } else { //there is an open directory but it does not have a .storyteller dir in it\n //don't start tracking unless the user chooses to use storyteller\n //add a button to the status bar so the user can start using storyteller\n updateStorytellerStatusBar('Start Storyteller', 'Start using Storyteller in this workspace', 'storyteller.startStoryteller');\n\n //show a message informing the user that they can use storyteller if they wish\n promptInformingAboutUsingStoryteller(false);\n }\n } else { //there is no open workspace\n //add a button to the status bar so the user can start using storyteller\n updateStorytellerStatusBar('Start Storyteller', 'Start using Storyteller in this workspace', 'storyteller.startStoryteller'); \n\n //show a message informing the user that they can use storyteller if they wish\n promptInformingAboutUsingStoryteller(true);\n }\n}", "function activate() {\n vm.controller.setObjectList();\n }", "onLoad() {\n this.openType = 'popup';\n this.opened = false;\n // this.open();\n }", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"logcat\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n\n var disposable = vscode.commands.registerCommand('logcat.startCapture', startCapture);\n context.subscriptions.push(disposable);\n\n var disposable1 = vscode.commands.registerCommand('logcat.endCapture', endCapture);\n context.subscriptions.push(disposable1);\n\n var disposable2 = vscode.commands.registerCommand('logcat.clear', clear);\n context.subscriptions.push(disposable2);\n\n}", "init(){\n\t\tthis._active = true\n\t}", "activate() {}", "function qodefOnDocumentReady() {\n\t\tqodefInitItemShowcase();\n\t}", "onFirstInstalled() {\n\n }", "function activate() {\n\t\t\tresolved = 0;\n\n\t\t\tqueryReadings();\n\t\t\tquerySensors();\n\n\t\t\t// set up chart listeners\n\t\t\t$scope.$on('mapMarkerSelected', function(event, buoyInstance) {\n\t\t\t\tif (vm.selectedBuoy && buoyInstance) {\n\t\t\t\t\tif (vm.selectedBuoy.id === buoyInstance.id) { return; }\n\t\t\t\t}\n\t\t\t\tchartObjects = [];\n\t\t\t\tvm.charts = dashboard.calculateChartData(buoyInstance);\n\t\t\t\t$scope.$apply(function() {\n\t\t\t\t\tvm.selectedBuoy = buoyInstance;\n\t\t\t\t});\n\t\t\t});\n\t\t\t$scope.$on('create', function(event, chart) {\n\t\t\t\tchartObjects.push(chart);\n\t\t\t});\n\t\t}", "function openDocument() {\r\n\t\tif (checkLocalStorage()) {\r\n\t\t if (myDiagram.isModified) {\r\n\t\t\tvar fileName = document.getElementById(\"currentFile\").textContent;\r\n\t\t\tvar save = confirm(\"Would you like to save changes to \" + fileName + \"?\");\r\n\t\t\tif (save) {\r\n\t\t\t if (fileName == UnsavedFileName) {\r\n\t\t\t\tsaveDocumentAs();\r\n\t\t\t } else {\r\n\t\t\t\tsaveDocument();\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t }\r\n\t\t var openDocument = document.getElementById(\"openDocument\");\r\n\t\t openDocument.style.visibility = \"visible\";\r\n\t\t}\r\n\t }", "function pageActivated() {\n\t suspendAudio = false;\n\n\t if (tag) {\n\t tagStateCheck(true); // tag first to ensure media channel start first\n\t }\n\n\t contextStateCheck(true);\n\t }", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"youdao-translator\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n var disposable = vscode.commands.registerCommand('extension.youdaoTranslate', function () {\n // The code you place here will be executed every time your command is executed\n var editor = vscode.window.activeTextEditor;\n\n if (!editor) {\n return console.log('no open text editor!');\n }\n\n var selection = editor.selection;\n var text = editor.document.getText(selection);\n\n if (!text) return;\n text = encodeText(text);\n var url = api + text;\n\n if (cache[text]) return result(cache[text], url);\n \n request.get(url, function (err, res, body) {\n if (err) return result('错误:' + err.message, url);\n try {\n // 单词\n // <h2 class=\"wordbook-js\">...<div class=\"trans-container\">...</div>\n var msg = body.replace(\n /^[\\s\\S]*<h2 class=\"wordbook-js\">([\\s\\S]*?)<div\\s+class=\"trans-container\">([\\s\\S]*?)<\\/div>[\\s\\S]*$/g,\n '$1###$2'\n );\n if (msg !== body) {\n msg = msg.replace(/<\\/?\\s?[^>]+>/g, '').replace(/\\s+/g, ' ').replace('###', \"\\n\").trim();\n cache[text] = msg;\n return result(msg, url, text);\n }\n // 句子\n // <div id=\"fanyiToggle\">...</div>\n msg = body.replace(\n /^[\\s\\S]*<div id=\"fanyiToggle\">([\\s\\S]*?)<\\/div>[\\s\\S]*$/g,\n '$1'\n );\n if (msg !== body) {\n msg = msg.replace(/<\\/p>/g, '###').replace(/<\\/?\\s?[^>]+>/g, '')\n .replace(/\\s+/g, ' ').replace(/###/g, \"\\n\")\n .replace(/以上为机器翻译结果,长、整句建议使用 人工翻译.*/g, '')\n .trim();\n cache[text] = msg;\n return result(msg, url);\n }\n return result('错误:匹配翻译内容失败', url);\n\n } catch (e) {\n return result('错误:' + e.message, url);\n }\n\n });\n\n });\n\n context.subscriptions.push(disposable);\n hover();\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Fingera UP');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n\n context.subscriptions.push(new FingeraStatusBarItem());\n\n}", "open() {\n this.opened = true;\n }", "function explorer_startup() {\n Explorer.startup();\n}", "checkForBeginning() {\n if (this.leftPage !== 1) {\n this.onFirstPage = false;\n } else {\n this.onFirstPage = true;\n }\n }" ]
[ "0.6455283", "0.6117023", "0.60365486", "0.6014545", "0.5901986", "0.57529926", "0.57506055", "0.5723525", "0.5675816", "0.56572926", "0.55934495", "0.55851805", "0.5583049", "0.55814564", "0.55658954", "0.5561733", "0.5561733", "0.5478126", "0.5466789", "0.5465945", "0.5447653", "0.54435325", "0.54388386", "0.54320437", "0.542482", "0.5423996", "0.53902256", "0.5390198", "0.5378613", "0.5370729", "0.5367615", "0.53524095", "0.53471535", "0.53385085", "0.5332314", "0.53320926", "0.5327623", "0.5319954", "0.5316587", "0.5316313", "0.530403", "0.5299983", "0.5287589", "0.5274685", "0.52583605", "0.52576137", "0.52576137", "0.52562535", "0.5240351", "0.52363706", "0.52321213", "0.5225603", "0.5218429", "0.52117276", "0.52109367", "0.52109367", "0.52109367", "0.51995486", "0.51932955", "0.51908493", "0.5189407", "0.5183737", "0.5182643", "0.51795477", "0.5179148", "0.51788276", "0.51764876", "0.51743746", "0.51654345", "0.51622355", "0.51586115", "0.51575255", "0.5147349", "0.5128469", "0.51266265", "0.5124734", "0.5121031", "0.5111159", "0.51099485", "0.51069945", "0.5103685", "0.510121", "0.5097892", "0.5096855", "0.50958204", "0.50945795", "0.5093891", "0.5091403", "0.50856906", "0.5081913", "0.50786287", "0.50664055", "0.5054647", "0.5053357", "0.50532174", "0.5046444", "0.5045039", "0.50415397", "0.5039599", "0.50374264", "0.5035523" ]
0.0
-1
Insert imageUrl to markdown file
function insertImageUrl(uri, imageUrl) { const sourceUri = vscode.Uri.parse(uri); vscode.window.visibleTextEditors .filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) && editor.document.uri.fsPath === sourceUri.fsPath) .forEach((editor) => { // const line = editor.selection.active.line editor.edit((textEditorEdit) => { textEditorEdit.insert(editor.selection.active, `![enter image description here](${imageUrl})`); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function markdownReplaceImageURL (md, prefix) {\n let mdMod = md.replace(/\\!\\[[a-zA-Z0-9 ]*\\]\\(\\s*(\\S*)\\s*\\)/gm, function(correspondance, p1){\n if (p1.startsWith('http')) {\n return correspondance\n } else {\n return correspondance.replace(p1, pathJoin([prefix, p1]))\n }\n });\n return mdMod\n}", "function imageURL() {\n var range = this.quill.getSelection();\n var value = prompt('What is the image URL');\n this.quill.insertEmbed(range.index, 'image', value, Quill.sources.USER);\n }", "static updateImageTags (markdown) {\n let updatedMarkdown = markdown\n let match\n let matches = []\n\n // Create an array of matches for all images we can find\n while ((match = MATCH_MARKDOWN_IMAGE.exec(markdown)) !== null) {\n matches.push({\n raw: match[0],\n alt: match[1],\n src: match[2]\n })\n }\n\n // If no matches are found, don't do anything\n if (!matches.length) {\n return markdown\n }\n\n // Loop through all image matches\n matches.forEach(({raw, alt, src}) => {\n // Create a new alt property without the `(inline)` string (if exists)\n const title = alt.replace(MATCH_INLINE_IMAGE, '')\n\n // Inline images are true if the image `alt` has `(inline)`\n const isInline = MATCH_INLINE_IMAGE.test(alt)\n\n // Full width properties (enabled by default)\n const fullWidthProperties = !isInline ? 'class=\"isFullWidth\"' : ''\n\n // All breakpoints we want to support\n const sources = [414, 734, 1024, 1200, 1440]\n\n // Image tag\n const image = `<img alt=\"${title}\" title=\"${title}\" src=\"${src}\" />`\n\n // Compose source tags for each break point, using Contentful's image API to serve optimized assets\n const source = sources.map(media => {\n // Image resize settings\n const settings = '&fit=fill&fm=jpg'\n\n return `<source media=\"(max-width: ${media}px)\" srcset=\"${src}?w=${media}${settings} 1x, ${src}?w=${media * 2}${settings} 2x\">` // eslint-disable-line\n }).join('')\n\n // Create picture tag\n const picture = `<picture ${fullWidthProperties}>${source}${image}</picture>`\n\n // Update markdown to use markup instead\n updatedMarkdown = updatedMarkdown.replace(raw, picture)\n })\n\n return updatedMarkdown\n }", "function add_img(url_end) {\r\n return \"http://i.imgur.com/\" + url_end;\r\n }", "function RichTextEmbeddedImage(props) {\n\tvar url = \"http:\" + props.sourceUrl;\n return <img src={url} alt=\"My image\"/>\n}", "function image(node) {\n var self = this;\n var content = uri(self.encode(node.url || '', node));\n var exit = self.enterLink();\n var alt = self.encode(self.escape(node.alt || '', node));\n\n exit();\n\n if (node.title) {\n content += ' ' + title(self.encode(node.title, node));\n }\n\n return '![' + alt + '](' + content + ')';\n}", "function drawImage(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n _replaceSelection(cm, stat.image, '![', '](http://)');\n}", "function drawImage() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.image, insertTexts.image, url);\n}", "async function replaceLocalImagesInMarkdown() {\n let markdownContent = fs.readFileSync(pathToMarkdownFile).toString()\n let imageUrls = extractImageUrls(markdownContent, '../')\n if (!imageUrls.length) {\n console.log('No local image need to be replaced!')\n return\n }\n\n const directoryPath = path.join(__dirname, imageDir);\n const localImages = fs.readdirSync(directoryPath)\n\n if (imageUrls.length !== localImages.length) {\n console.error('Markdown images count is not equal to local images count', imageUrls.length, localImages.length)\n process.exit(1)\n }\n for (let i = 0; i < localImages.length; i++) {\n const imageUrl = imageUrls[i]\n const imagePath = imageDir + '/' + localImages[i]\n\n let retry = true\n while (retry)\t{\n try {\n githubImageUrl = await uploadImage(imagePath, pathToMarkdownFile)\n retry = false\n } catch(e) {\n console.log(e, '\\nRetry uploading')\n }\n }\n\n githubImageUrl = githubImageUrl.replace('githubusercontent', 'gitmirror')\n markdownContent = markdownContent.replace(imageUrl, githubImageUrl)\n\n console.log('Rewriting md file...\\n')\n fs.writeFileSync(pathToMarkdownFile, markdownContent)\n }\n\n // TODO delete images\n console.log('Replacing local images is done!')\n}", "set src(src) {\n this\n .fetchMarkdown(src)\n .then(r => this.markdown = r);\n }", "function createLink(urlString, img, mail) {\n let projectLink = urlString !== '' ? `<a href=\"${urlString}\" target= \"_blank\"><img src=\"img/icon/${img}.png\"></a>` : '<!-- -->';\n return projectLink\n}", "function image(node) {\n var self = this\n var content = uri(self.encode(node.url || '', node))\n var exit = self.enterLink()\n var alt = self.encode(self.escape(node.alt || '', node))\n var txt = self.escape(node.title || node.alt || '')\n var image_prefix = self.options.image_prefix || '';\n\n exit()\n\n if (node.title) {\n content += space + title(self.encode(node.title, node))\n }\n\n if (node.url.endsWith('.svg')) {\n return `\\\\includesvg[width=0.7\\\\textwidth]{${path.join(image_prefix, node.url)}}`\n }\n\n return (\n `\\\\begin{figure}[htbp]\\n\\\\centering\\n` + \n `\\\\includegraphics[width=0.7\\\\textwidth]{` +\n path.join(image_prefix, node.url) + `} \\n` +\n (txt ? `\\\\caption{${txt}}` : '') + \n `\\n\\\\end{figure}`\n )\n}", "execute(url){\n let html = `<p><div class=\"avoid-break\"><img class=\"grapple-image align-left size-full\" src=\"${url}\" data-size=\"size-full\"/></div></p>`;\n let commandContext = this;\n\n let $image = $(html);\n\n this.editor.insert($image);\n\n $image.find('img').on('load', function(){\n commandContext.editor.updateHeight();\n });\n\n this.editor.checkChange();\n }", "function createImageLink$static(richtext/*:CoreMediaRichTextArea*/, content/*:Content*/)/*:void*/ {\n var contentUri/*:String*/ = content.getUriPath();\n var blobProperty/*:String*/ = com.coremedia.cms.editor.sdk.editorContext.getRichTextDragDropImageBlobProperty(content.getType().getName());\n if (blobProperty === null) {\n blobProperty = findMostSuitableBlobProperty$static(content);\n }\n\n var attributes/*:Object*/ = {\n 'alt': '',\n 'xlink:href': contentUri + \"#properties.\" + blobProperty,\n 'xlink:show': 'embed',\n 'xlink:actuate': 'onLoad',\n 'xlink:type': 'simple'\n };\n\n var ckEditor/*:**/ = richtext.getCKEditor();\n var imgElement/*:**/ = ckEditor.document.createElement('img', {attributes: attributes});\n insertElement$static(ckEditor, imgElement, true);\n\n richtext.convertImageElement(imgElement);\n }", "function drawImage(editor) {\n // TODO Rework the full logic of draw image\n var cm = editor.codemirror;\n var stat = getCMTextState(cm);\n //var options = editor.options;\n var url = \"http://\";\n _replaceSelection(cm, stat.image, insertTexts.image, url);\n}", "function insertImage() {\n telemetry_1.reporter.sendTelemetryEvent(\"command\", { command: telemetryCommandMedia + \".art\" });\n Insert(true);\n}", "function imgPrincipal(url) {\r\n let img_principal = `\r\n <img\r\n src=\"${url}\"\r\n style=\"width:300px;height:300px;\"\r\n />\r\n `;\r\n $(\"#img_principal\").html(img_principal);\r\n}", "function insertImageLinksToDocs() {\n let images = document.getElementsByClassName(GDOCS_IMG_OBJECT_CLASS);\n\n // Insert image anchor into each parent container\n for (let image of images) {\n // skip if the imageContainer already has the imageLink object added by this plugin\n const imageContainer = image.closest(`.${GDOCS_IMG_CONTAINER_CLASS}`);\n if (imageContainer.querySelector(\".imageLink\") != null) return;\n\n // insert imageLink object\n const imageURL = image.getElementsByTagName(\"image\")[0].getAttribute(\"xlink:href\");\n const imageHTML = `<a href=\"${imageURL}\" target=\"_blank\" class=\"imageLink\"></a>`;\n imageContainer.insertAdjacentHTML(\"afterbegin\", imageHTML);\n }\n}", "function drawImage(editor) {\n\t\t\tvar cm = editor.codemirror;\n\t\t\tvar stat = getState(cm);\n\t\t\tvar options = editor.options;\n\t\t\tvar url = \"http://\";\n\t\t\tif(options.promptURLs) {\n\t\t\t\turl = prompt(options.promptTexts.image);\n\t\t\t\tif(!url) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n\t\t}", "function drawImage(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n var options = editor.options;\n var url = 'https://';\n if (options.promptURLs) {\n url = prompt(options.promptTexts.image, 'https://');\n if (!url) {\n return false;\n }\n }\n _replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}", "function ScreenshotStatement(){\nimagename = \"OfficialStatement.png\"\n\n\twebshot(\"https://thegreatleadr.github.io/Github_Module/GitHub_FOLDER_STATEMENT/\", imagename, optionsStatement, (err) => {\n\tif(err){\n\t return console.log(err);\n\t}\n\t console.log(\"OfficialStatement succesfully created\");\n\t});\n}", "posterImg(poster) {\n return `https://image.tmdb.org/t/p/w342/${poster}`\n }", "renderNewImage() {\n\n document.getElementById('img').src = `${this.url}`\n document.getElementById('p1').innerText = `${this.caption}`\n\n }", "function renderImage(file){\n var reader = new FileReader();\n reader.onload = function(event){\n the_url = event.target.result\n //of course using a template library like handlebars.js is a better solution than just inserting a string\n preview = document.getElementById(\"blog_body_preview\")\n var oImg=document.createElement(\"img\");\n oImg.setAttribute('src', the_url);\n oImg.setAttribute('height', '300px');\n oImg.setAttribute('width', '450px');\n preview.appendChild(oImg);\n }\n \n //when the file is read it triggers the onload event above.\n reader.readAsDataURL(file);\n }", "function drawImage(editor) {\n\t\tvar cm = editor.codemirror;\n\t\tvar stat = getState(cm);\n\t\tvar options = editor.options;\n\t\tvar url = \"http://\";\n\t\tif(options.promptURLs) {\n\t\t\turl = prompt(options.promptTexts.image);\n\t\t\tif(!url) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n\t}", "function drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.image);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}", "function drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.image);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}", "function drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.image);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}", "static pasteImageURL(image_url) {\n let filename = image_url.split(\"/\").pop().split(\"?\")[0];\n let ext = path.extname(filename);\n let imagePath = this.genTargetImagePath(ext);\n if (!imagePath)\n return;\n let silence = this.getConfig().silence;\n if (silence) {\n Paster.downloadFile(image_url, imagePath);\n }\n else {\n let options = {\n prompt: \"You can change the filename. The existing file will be overwritten!\",\n value: imagePath,\n placeHolder: \"(e.g:../test/myimg.png?100,60)\",\n valueSelection: [\n imagePath.length - path.basename(imagePath).length,\n imagePath.length - ext.length,\n ],\n };\n vscode.window.showInputBox(options).then((inputVal) => {\n Paster.downloadFile(image_url, inputVal);\n });\n }\n }", "function ImageHead(url) {\n\twhiteboard.modalClose('.modal_image_upload_progress');\n\twhiteboard.modalClose('.modal_image_select');\n\twhiteboard.modalOpen('.modal_image');\n\twhiteboard.toolbarActivate('#toolbar_confirm', '#toolbar_cancel', '#toolbar_image');\n\tthis.url = url;\n\t$('#modal_image').attr('src', url);\n}", "function mmCreateUrlAttachment(attachment) {\n let type = $(attachment).data(\"type\");\n let id = $(attachment).data(\"id\");\n let $img = $(attachment).find(\".attachment-preview img\"),\n url = $img.data(\"src\"),\n urlmax = url.replace(/-150/g, \"\"),\n title = $img.attr(\"alt\"),\n max = $img.data(\"max\"),\n size = $img.data(\"size\"),\n sizes = $img.data(\"sizes\").toString(),\n align = $img.data(\"align\") || \"center\",\n textAlt = $img.attr(\"alt\") || \"\",\n proAlt = (textAlt!=null && textAlt.length>0)?`alt=\"${textAlt}\"`:\"\";\n textTitle = $img.data(\"title\") || \"\",\n proTitle = (textTitle!=null && textTitle.length>0)?`title=\"${textTitle}\"`:\"\";\n textCaption = $img.data(\"caption\") || \"\",\n tagCaption = (textCaption!=null && textCaption.length>0)?`<figcaption class=\"caption\">${textCaption}</figcaption>`:\"\";\n rs = '';\n switch (type) {\n case 'file':\n rs = `<a href=\"${url}\" title=\"${title}\">${url}</a>`;\n break;\n case 'image':\n let sizesArr = sizes.split(\",\"),\n srcset = [],\n srcsetSizes = [],\n cssAlign = \"\";\n cssAlign = (align == \"center\") ? `style=\"display: block; margin-left: auto; margin-right: auto; text-align:center;\"` : cssAlign;\n cssAlign = (align == \"right\") ? `style=\"float: right; text-align:right;\"` : cssAlign;\n sizesArr.forEach(s => {\n if (s <= size) {\n url = (s == max) ? urlmax : url.replace(/-150\\./g, `-${s}.`);\n srcset.push(`${url} ${s}w`);\n srcsetSizes.push(`${s}px`);\n }\n });\n urlmax = (size == max) ? urlmax : url.replace(/-150\\./g, `-${size}.`);\n rs = `<figure id=\"smsci-${id}\" class=\"sm-single-content-image\" ${cssAlign}>`;\n rs += `<img ${proAlt} ${proTitle} srcset=\"${srcset.join()}\" sizes=\"(max-width: ${size}px) ${srcsetSizes.join(\",\")}\" src=\"${urlmax}\" width=\"${size}\"/>`;\n rs += (tagCaption.length > 0) ? tagCaption : \"\";\n rs += \"</figure>\";\n break;\n default:\n console.log(\"wrong attachment type\");\n break;\n }\n return rs.trim();\n}", "function setSrc(data) {\n // data.contents contains \"See: [URL]\"\n const url = data.contents.match(\"See: (.*)\")[1];\n\n // this should be $img from context\n this.attr(\"src\", url)\n}", "function displayDURL(file) {\n var reader = new FileReader();\n\n reader.onload = function(e) {\n var img = new Image();\n img.src = e.target.result;\n img.onload = function() {\n var dataUrl = e.target.result;\n logo.src = dataUrl;\n imgUrl.value = logo.src;\n };\n };\n reader.readAsDataURL(file);\n }", "function addImage(src, type, doc, page, x, y, width, height, link, func) {\n let img = new Image();\n img.src = baseURL + src;\n img.addEventListener('load', function(event) {\n let url = getDataUrl(img, type);\n height = height? height: width * img.height / img.width;\n x = x < 0? -x - width: x;\n y = y < 0? -y - height: y;\n doc.setPage(page);\n doc.addImage(url, type, x, y, width, height);\n if (link)\n {\n let options = {url: link};\n doc.link(x, y, width, height, options);\n }\n });\n }", "function insertFile(file) {\n uploadFile(file, function (url) {\n var text = \"[img]\" + url + \"[/img]\";\n typeInTextarea(text);\n });\n }", "function MarkdownFileToBody(filename)\n{\n var callback = function (text) {\n //html = Showdown(text);\n fillDiv(text, gs_body_id);\n }\n getFile(filename, callback, true);\n}", "linkNewImage(img) {\n let imgObj = {\n title: img.title,\n url: img.url\n };\n this.props.addImage(imgObj);\n }", "function addPathToImage() {\n $(ctrl.imageTags).each(function (index) {\n if (ctrl.imageTags[index].hasAttribute('id')) {\n var imageSrc = ctrl.imageTags[index].getAttribute('id');\n $(ctrl.imageTags[index]).attr('src', oDataPath + \"/Asset('\" + imageSrc + \"')/$value\");\n }\n });\n }", "function imageReference(h, node) {\n var def = h.definition(node.identifier);\n var props = {src: normalize((def && def.url) || ''), alt: node.alt};\n\n if (def && def.title !== null && def.title !== undefined) {\n props.title = def.title;\n }\n\n return failsafe(h, node, def) || h(node, 'img', props);\n}", "function InsertPicture(_1){\r\nif(typeof _editor_picturePath!==\"string\"){\r\n_editor_picturePath=Xinha.getPluginDir(\"InsertPicture\")+\"/demo_pictures/\";\r\n}\r\nInsertPicture.Scripting=\"php\";\r\n_1.config.URIs.insert_image=\"../plugins/InsertPicture/InsertPicture.\"+InsertPicture.Scripting+\"?picturepath=\"+_editor_picturePath;\r\n}", "function drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.image, options.insertTexts.image);\n}", "static rule_replaceLocalImageWithLabel(p_info, p_doc) {\n let imgs = p_doc.getElementsByTagName('img');\n for (let i = 0; i < imgs.length; ++i) {\n let img = imgs[i];\n let httpRegExp = new RegExp('^http[s]://');\n if (httpRegExp.test(img.src)) {\n continue;\n }\n\n let dataRegExp = new RegExp('^data:image/');\n if (dataRegExp.test(img.src)) {\n continue;\n }\n\n let spanNode = p_doc.createElement('span');\n spanNode.style = 'font-weight: bold; color: white; background-color: red;'\n spanNode.textContent = 'INSERT_IMAGE_HERE';\n img.parentNode.replaceChild(spanNode, img);\n --i;\n }\n }", "function addImageToScreen(myURL) {\n\n}", "function enhance($, options, resolveFilePath, usePandocParser) {\n return __awaiter(this, void 0, void 0, function* () {\n // resolve image paths\n $(\"img, a\").each((i, imgElement) => {\n let srcTag = \"src\";\n if (imgElement.name === \"a\") {\n srcTag = \"href\";\n }\n const img = $(imgElement);\n const src = img.attr(srcTag);\n // insert anchor for scroll sync.\n if (options.isForPreview &&\n imgElement.name !== \"a\" &&\n img\n .parent()\n .prev()\n .hasClass(\"sync-line\")) {\n const lineNo = parseInt(img\n .parent()\n .prev()\n .attr(\"data-line\"), 10);\n if (lineNo) {\n img\n .parent()\n .after(`<p data-line=\"${lineNo +\n 1}\" class=\"sync-line\" style=\"margin:0;\"></p>`);\n }\n }\n img.attr(srcTag, resolveFilePath(src, options.useRelativeFilePath));\n });\n if (!usePandocParser) {\n // check .mume-header in order to add id and class to headers.\n $(\".mume-header\").each((i, e) => {\n const classes = e.attribs.class;\n const id = e.attribs.id;\n const $e = $(e);\n const $h = $e.prev();\n $h.addClass(classes);\n $h.attr(\"id\", encodeURIComponent(id)); // encodeURIComponent to fix utf-8 header.\n $e.remove();\n });\n }\n });\n}", "function insertImages(text, callback) {\n var matches = text.match(/\\<REPLACEWITHIMG\\>(.*?)::(.*?)\\<\\/REPLACEWITHIMG\\>/);\n\n if (matches) {\n var width = parseInt(matches[1], 10);\n var tube;\n var cmd;\n if (width !== NaN && width > 0) {\n cmd = 'node_modules/picture-tube/bin/tube.js --cols ' + width + ' \"' + matches[2] + '\"';\n } else {\n cmd = 'node_modules/picture-tube/bin/tube.js \"' + matches[2] + '\"';\n }\n exec(cmd, function(_, data) {\n var img = center(data);\n text = text.replace(matches[0], img);\n insertImages(text, callback);\n });\n } else {\n callback(null, text);\n }\n}", "function lineTemplate({\n config\n}) {\n let url = \"\";\n const {\n line\n } = config; // If the line should not be there we just return an empty string.\n\n if (line === exports.LineColor.NONE) {\n return ``;\n } // Construct the URL.\n\n\n if (isValidURL(line)) {\n url = line;\n } else {\n url = `https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/${line}.png`;\n }\n\n return `![-----------------------------------------------------](${url})`;\n}", "function toHtmlImg(image_url, title, keyword, horns) {\n let target = $('#imgTemp').html();\n let context = {\n 'imgKeyword': keyword,\n 'imgTitle': title,\n 'imgSrc': image_url,\n 'imgHorn': horns\n };\n let templateScript = Handlebars.compile(target);\n let html = templateScript(context);\n $('main').append(html);\n}", "function installImage(name, img) {\n RichTextView[name].iconUrl = '/images/' + img + '.svg';\n RichTextView[name].label = '';\n}", "function imagePlacer(url) {\n modalImageEl.src = `${url}`;\n}", "function addImage() {\n myPresentation.getCurrentSlide().addImage(inTxt.value);\n inTxt.value = \"\";\n}", "function markdownDescription(text) { }", "open(image) {\n super.open();\n this._image.src = image.src;\n this._description.textContent = image.alt;\n }", "async setImage() {\n try {\n if (this.hasProperty(this.parsedMessage, \"metadata\")) {\n const metadata = this.parsedMessage.metadata;\n const injectedObject = metadata[\"@injected\"];\n if (\n injectedObject &&\n this.hasProperty(injectedObject, \"extensions\")\n ) {\n const extensionsObject = injectedObject[\"extensions\"];\n if (\n extensionsObject &&\n this.hasProperty(extensionsObject, \"thumbnail-generation\")\n ) {\n const thumbnailGenerationObject =\n extensionsObject[\"thumbnail-generation\"];\n\n const imageToDownload = this.chooseImage(\n thumbnailGenerationObject\n );\n\n try {\n const response = await this.downloadImage(imageToDownload);\n const url = URL.createObjectURL(response);\n let img = new Image();\n img.src = url;\n img.onload = () => (this.imageUrl = img.src);\n } catch (error) {\n logger(\"error\", error);\n }\n }\n }\n } else {\n let img = new Image();\n img.src = this.parsedMessage.data.url;\n img.onload = () => (this.imageUrl = img.src);\n }\n } catch (error) {\n logger(\"error\", error);\n }\n }", "function image(relativePath) {\n return \"/static/editablegrid-2.0.1/images/\" + relativePath;\n}", "function newsTemplate({ urlToImage, title, url, description }) {\n return `\n <div class=\"col s12\">\n <div class=\"card\">\n <div class=\"card-image\">\n <img src=\"${urlToImage}\">\n <span class =\"card-title\">${title || ''}</span>\n </div>\n <div class=\"card-content\">\n <p>${description || ''}</p>\n </div>\n <div class=\"card-action\">\n <a href=\"${url}\">Read more</a>\n </div>\n </div>\n </div>\n `;\n}", "function showPic(whichpic) { //function named and argument given\n if (!document.getElementById(\"placeholder\")) return true; //if no placeholder then open image as link (onclick + onkeypress only)\n \n if (whichpic.getAttribute(\"title\")) { //get decription for new image\n var text = whichpic.getAttribute(\"title\");\n }\n else {\n var text = \"\"; //or no text if image doesn't have a description in it's title\n }\n \n var source = whichpic.getAttribute(\"href\"); //get the new source\n var placeholder = document.getElementById(\"placeholder\"); //find the placeholder\n if (placeholder.nodeName != \"IMG\") return true; //make sure placeholder is an image otherwise allow link to load image in new page\n placeholder.setAttribute(\"src\",source); //otherwise replace placeholder with new\n \n var description = document.getElementById(\"description\"); //find the description\n if (description.firstChild.nodeType == 3) {\n description.firstChild.nodeValue = text; //now replace it so long as nodetype is a text_node\n }\n \n return false; //stop new page from loading\n}", "setImage(path, row, col, style = {}) {\n let image = this.book.addImage({\n buffer: fs.readFileSync(path),\n extension: 'jpeg',\n });\n this.list.addImage(image, {\n tl: {\n row,\n col: col -1\n },\n br: {\n row: row + 1,\n col\n },\n editAs: 'oneCell'\n });\n }", "getInlineAttachment() {\n const imageData = fs.readFileSync(path.join(__dirname, '../resources/architecture-resize.png'));\n const base64Image = Buffer.from(imageData).toString('base64');\n\n return {\n name: 'architecture-resize.png',\n contentType: 'image/png',\n contentUrl: `data:image/png;base64,${ base64Image }`\n };\n }", "setAvatar(url) {\n const template = `<img src=\"${url}\" alt=\"\">`;\n this._userAvatar.insertAdjacentHTML(\"afterbegin\", template);\n }", "function viewImage(id,path_image) {\n var address='<img src={}>';\n document.getElementById(id).innerHTML=address.replace(\"{}\",path_image);\n}", "function PostToHTML(relpath, markdown_body) {\n var callback = function (text) {\n\n /* circumvent github's auto-meta parsing */\n text = text.replace(\"(((\",'---');\n text = text.replace(\")))\",'---');\n\n /* write some HTML to format the data */\n var body = document.getElementById(markdown_body);\n var post_head = document.createElement('div');\n var post_body = document.createElement('div');\n body.appendChild(post_head);\n body.appendChild(post_body);\n\n if ((isBlank(text)) || (text == null) || (text == 'null') || (typeof text === 'undefined')) {\n post_head.innerHTML = 'Unable to load text for: '+relpath;\n return;\n }\n\n /* parse YAML header */\n var obj = jsyaml.loadFront(text)\n\n /* check for post meta data */\n var date = typeof obj.Date !== 'undefined' ? obj.Date.toDateString() : '';\n var author = typeof obj.Author !== 'undefined' ? obj.Author : '';\n var summary = typeof obj.Summary !== 'undefined' ? obj.Summary : '';\n var title = typeof obj.Title !== 'undefined' ? obj.Title : '';\n\n /* write some HTML to format the data */\n post_head.innerHTML = '<b>'+title+'</b><br> &nbsp; &nbsp; '+author+\n ' | <small>'+date+'</small><br><br>';\n\n /* convert the unparsed content as markdown */\n post_body.innerHTML = Showdown(obj.__content);\n $('.linenums').removeClass('linenums');\n prettyPrint();\n };\n getFile(relpath, callback);\n}", "function addTextToImg(src,text){\n\t\tvar canvas = document.getElementById('matText');\n\t\tvar ctx = canvas.getContext('2d');\n\t\tvar imageObj = new Image();\n\t\timageObj.onload = function() {\n\t\t\tvar marginImg = (canvas.width- imageObj.width)/2\n\t\t\tctx.drawImage(imageObj, marginImg,0);\n\t\t\tctx.strokeStyle = 'rgb(188,188,188)';\n\t\t\tctx.rect(0, 0, canvas.width, canvas.height);\n\t\t\tctx.stroke();\t\t\n\t\t};\n\t\timageObj.src = src;\t \t\n\t\tctx.font = '12px \"PT Serif\"';\t\t\n\t\tvar marginText = (ctx.measureText(text).width<canvas.width)?(canvas.width-ctx.measureText(text).width)/2:0;\n\t\tctx.fillText(text,marginText, 100,canvas.width);\t\t\n\t\tvar url = ctx.canvas.toDataURL();\n\t\tctx.clearRect(0,0,canvas.width,canvas.height);\n\t\treturn url;\n\t}", "function urlFor(source) {\n return builder.image(source)\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 buildPost (filename) {\n let md = await this.fs.promises.readFile(`${this.config.settings.SRC}/${filename}`, \"utf8\")\n let { content, data } = matter(md)\n data.permalink = filename\n let html = marked(content, { baseUrl: \"../../\" }) \n //await this.processContent( { content, html, data, filename } )\n //await this.processImages({ content })\n await this.plugins(\"onsave\", { content, html, data, filename })\n return { html, data }\n }", "function renderImage(img){\n$image.setAttribute('src', img)\n}", "function getUrlPic(picture) { return \"url(\"+picture+\")\"; }", "function insertImage(editor, imageFile) {\n var reader = new FileReader();\n reader.onload = function (event) {\n if (!editor.isDisposed()) {\n editor.addUndoSnapshot(function () {\n var image = editor.getDocument().createElement('img');\n image.src = event.target.result;\n image.style.maxWidth = '100%';\n editor.insertNode(image);\n }, \"Format\" /* Format */);\n }\n };\n reader.readAsDataURL(imageFile);\n}", "static get pasteConfig() {\n return {\n tags: ['IMG'],\n patterns: {\n image: /https?:\\/\\/\\S+\\.(gif|jpe?g|tiff|png)$/i,\n },\n files: {\n mimeTypes: [ 'image/*' ],\n },\n }\n }", "insert(e) {\n e.preventDefault();\n\n // Insert the image.\n // @todo, support other media types.\n if (this.range != null && e.target.href) {\n let start = this.range.start;\n this.quill.insertEmbed(start, 'image', e.target.href);\n this.quill.setSelection(start + 1, start + 1);\n }\n else if (e.target.href) {\n this.quill.insertEmbed(0, 'image', e.target.href);\n }\n }", "async getRedditPic(url) {\n let downloadedImg = document.createElement('img')\n downloadedImg.src = url\n return console.log(downloadedImg)\n }", "function generateMarkdown(data) {\n var link = \"\";\n switch (data.license) {\n case \"MIT\":\n link =\n \"(https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n break;\n case \"Mozilla Public License 2.0\":\n link =\n \"(https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\";\n break;\n case \"Open Database License\":\n link =\n \"(https://img.shields.io/badge/License-ODbL-brightgreen.svg)](https://opendatacommons.org/licenses/odbl/)\";\n break;\n case \"ISC\":\n link =\n \"(https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)\";\n }\n\n return `\n [![License: ${data.license} ]${link}\n \n # Table of contents\n [description](#description)\n\n [installation](#installation)\n\n [questions](#questions)\n\n\n # Description\n\n ${data.description}\n\n # installation\n\n This program needs ${data.installation} to be installed before being run\n\n # Questions\n\n My github is ${data.github} if you would like to check out my other repos.\n If you have any questions, please feel free to email me @${data.email}\n\n\n\n\n\n `;\n\n /**\n * the table of contents would be first, with the link for each element within brackets\n * the content of each section would be rendered using the ${} notation and populated with the response object\n * I'm not too worried about the markdown syntax, as I am just happy that I got the function to call and write to a file successfully\n */\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 New_Image_Display(n) {\n image_index += n;\n if (image_index > image_files_in_dir.length) {\n image_index = 1\n }\n if (image_index < 1) {\n image_index = image_files_in_dir.length\n };\n \n val_obj = {descriptionInput:'', taglist:'', imgMain:image_files_in_dir[image_index - 1]}\n //view_annotate_module.Annotation_DOM_Alter(val_obj)\n\n //UNOCMMENT LATER!!!!\n tagging_view_annotate.Annotation_DOM_Alter(val_obj)\n\n //Load_State_Of_Image()\n\n //UNOCMMENT LATER!!!!\n Load_State_Of_Image_IDB() \n\n}", "function createImage(link) {\n var imageUrl = link.href; // Finds href key in image link\n var title = link.title; // Finds title key in image link\n var image = $('<img>'); // Creates an <img> tag\n image.attr({\n src: imageUrl, // Inserts href value into <img src=\" \">\n });\n\n image.hide(); // Hides image\n $imageviewer.html(image); // Displays image in the viewer container\n $caption.text(title); // Displays caption in the caption container\n image.fadeIn(300);\n}", "function buildImageOne(options) {\n html += `<img src=\"${options[0]}\" class=\"img-one\"\n `;\n}", "async function generateMarkdown(data) {\n\n //API call to get the GitHub user information for the photo and contact email.\n const gitAPI = await axios.get(`https://api.github.com/users/${data.username}`);\n\n //Function to determine if the user said 'yes' to adding a table of contents.\n if (data.tableOfContents === \"Yes\") {\n data.tableOfContents = \"## Table of Contents\\n\" +\n \"1. [Installation](#installation)\\n\" +\n \"2. [Usage](#usage)\\n\" +\n \"3. [License](#license)\\n\" +\n \"4. [Contributors](#contributors)\\n\" +\n \"5. [Tests](#tests)\\n\" +\n \"6. [Questions](#questions)\\n\\n\"\n ;\n } else {\n data.tableOfContents = \"\";\n }\n return (\n\n //Project title\n `# ${data.projectTitle}\\n\\n` +\n\n //Badge\n `[![Github license](https://img.shields.io/static/v1?label=License&message=${data.license}&color=blue)](#license)\\n\\n` +\n\n //Project Description\n `## Description\\n ${data.description}\\n\\n` +\n\n //Table of Contents (if desired)\n `${data.tableOfContents}` +\n\n //Installation\n `## Installation\\n` +\n `To install the depedencies necessary for this to function, run this command:\\n\\n` +\n \"```\" +\n `${data.install}` +\n \"```\" +\n `\\n\\n` +\n\n //Usage\n `## Usage\\n ${data.usage} \\n\\n` +\n\n //License\n `## License\\n` +\n `This project is licensed under the ${data.license} license.\\n\\n` +\n\n //Contributors\n `## Contributors\\n` +\n `The contributor(s) to this project is/are:\\n` +\n `${data.contributors}\\n\\n` +\n\n //Tests\n `## Tests\\n` +\n `To test this project, run this command:\\n\\n` +\n \"```\" +\n `${data.tests}` +\n \"```\" +\n `\\n\\n` +\n\n //Questions and Contact\n `## Questions\\n` +\n `<img src=\"${gitAPI.data.avatar_url}\">\\n\"` +\n `If you have questions about this project, feel free to contact email the contributor at [${gitAPI.data.email}](${gitAPI.data.email}) and visit their Github Account at https://github.com/${data.username} .\\n\\n`\n\n ); \n}", "function cardImageRelUrlToUrl(cardImageLink){\n\tconsole.log(`Changing Relative URL to URL for URL: \"${cardImageLink}\"`);\n\treturn `http://gatherer.wizards.com/${cardImageLink.split(\"/\").splice(2).join(\"/\")}`;\n}", "function bindMarkdownUpload(input) {\n var _pfile;\n input.inlineattachment({\n uploadUrl: '/attachments/cache',\n jsonFieldName: 'url',\n allowedTypes: [\n 'image/jpeg',\n 'image/png',\n 'image/jpg',\n 'image/gif',\n 'text/plain',\n 'text/comma-separated-values',\n 'text/csv',\n 'application/csv',\n 'application/excel',\n 'application/vnd.ms-excel',\n 'application/vnd.msexcel'\n ],\n urlText: function(filename, result) {\n var url = \"[\" + _pfile.name + \"](\" + filename + \")\";\n if (fileIsImage(_pfile)) {\n url = \"!\" + url;\n }\n return url;\n },\n onFileReceived: function(file) {\n _pfile = file;\n },\n beforeFileUpload: function(xhr) {\n xhr.file = _pfile;\n return true;\n },\n onFileUploadResponse: function(xhr) {\n var id = xhr.id || JSON.parse(xhr.responseText).id;\n var filefield = input.parent().find(\"input.is-hidden[type=file]\");\n var reference = filefield.data(\"reference\");\n var metadatafield = $(\"input[type=hidden][data-reference='\" + reference + \"']\");\n var data = JSON.parse(metadatafield.attr(\"value\"));\n data.push({ id: id, filename: xhr.file.name, content_type: xhr.file.type, size: xhr.file.size })\n metadatafield.attr(\"value\", JSON.stringify(data));\n filefield.removeAttr(\"name\");\n return true;\n },\n onFileUploaded: function() {\n input.trigger(\"keyup\");\n },\n remoteFilename: function(file) {\n return file.name;\n }\n });\n}", "function getUrlPic(picture) { return \"url(\"+host+picture+\")\"; }", "function getUrlPic(picture) { return \"url(\"+host+picture+\")\"; }", "function updateMetadata(index) {\n var filename = imgData[index].fileSrc.replace(/^.*\\//, '');\n var dimensions = imgData[index].origWidth + ' x ' + imgData[index].origHeight + ' px'; \n \n $('#md-filename').html(filename);\n $('#md-dimensions').html(dimensions);\n }", "constructor(\n\t\t\t\ttitle,\n\t\t\t\tlink,\n\t\t\t\tauthor,\n\t\t\t\timg,\n\t\t\t\tbody){\n\t\t\t\t\tthis.title = title;\n\t\t\t\t\tthis.link = link;\n\t\t\t\t\tthis.author = author;\n\t\t\t\t\tthis.img = img;\n\t\t\t\t\tthis.body = body;\n\t}", "function urlFor (source) {\n return builder.image(source)\n}", "function generateMarkdown(data) {\n return `# ${data.title}\n \n ## Description\n ${data.Description}\n \n ## License\n under${data.License}license\n ![github license](https://img.shields.io/badge/%3Clicense%3E-%3CMIT%3E-brightgreen%3E\t\n )\n \n \n ## Table of contents\n ${data.TableOfContents}\n \n ## Installation\n ${data.Installation}\n \n ## Usage\n ${data.Usage}\n \n ## Credits\n ${data.Credits}\n \n ## Test\n ${data.Test}\n \n ## Questions\n ${data.Questions}\n \n ## Username\n ${data.Username}\n \n ## Email\n ${data.Email}\n \n `;\n }", "function urlFor(source) {\n return builder.image(source);\n }", "static pasteImage() {\n let ext = \".png\";\n let imagePath = this.genTargetImagePath(ext);\n if (!imagePath)\n return;\n let silence = this.getConfig().silence;\n if (silence) {\n Paster.saveImage(imagePath);\n }\n else {\n let options = {\n prompt: \"You can change the filename. The existing file will be overwritten!.\",\n value: imagePath,\n placeHolder: \"(e.g:../test/myimage.png?100,60)\",\n valueSelection: [\n imagePath.length - path.basename(imagePath).length,\n imagePath.length - ext.length,\n ],\n };\n vscode.window.showInputBox(options).then((inputVal) => {\n Paster.saveImage(inputVal);\n });\n }\n }", "function getInstructionSlide() {\n var demo = 'https://gist.githubusercontent.com/alicehccn/ec09248285c24a49316a/raw';\n getMarkdown(demo, true);\n }", "static genTargetImagePath(extension = \".png\") {\n // get current edit file path\n let editor = vscode.window.activeTextEditor;\n if (!editor)\n return;\n let fileUri = editor.document.uri;\n if (!fileUri)\n return;\n if (fileUri.scheme === \"untitled\") {\n vscode.window.showInformationMessage(\"Before pasting an image, you need to save the current edited file first.\");\n return;\n }\n let filePath = fileUri.fsPath;\n // get selection as image file name, need check\n const selection = editor.selection;\n const selectText = editor.document.getText(selection);\n if (selectText && !/^[^\\\\/:\\*\\?\"\"<>|]{1,120}$/.test(selectText)) {\n vscode.window.showInformationMessage(\"Your selection is not a valid file name!\");\n return;\n }\n // get image destination path\n let folderPathFromConfig = this.getConfig().path;\n folderPathFromConfig = this.replacePredefinedVars(folderPathFromConfig);\n if (folderPathFromConfig &&\n folderPathFromConfig.length !== folderPathFromConfig.trim().length) {\n vscode.window.showErrorMessage('The specified path is invalid: \"' + folderPathFromConfig + '\"');\n return;\n }\n // image file name\n let imageFileName = \"\";\n if (!selectText) {\n imageFileName = moment().format(\"Y-MM-DD-HH-mm-ss\") + extension;\n }\n else {\n imageFileName = selectText + extension;\n }\n // image output path\n let folderPath = path.dirname(filePath);\n let imagePath = \"\";\n // generate image path\n if (path.isAbsolute(folderPathFromConfig)) {\n // important: replace must be done at the end, path.join() will build a path with backward slashes (\\)\n imagePath = path\n .join(folderPathFromConfig, imageFileName)\n .replace(/\\\\/g, \"/\");\n }\n else {\n // important: replace must be done at the end, path.join() will build a path with backward slashes (\\)\n imagePath = path\n .join(folderPath, folderPathFromConfig, imageFileName)\n .replace(/\\\\/g, \"/\");\n }\n return imagePath;\n }", "function addMarkdownToEditor(type){\n var fields = getFieldsForModalType(type);\n var res = \"\";\n if(type === \"link\"){\n res = \" [\" + fields[\"text\"] + \"](\" + fields[\"link\"] + \") \";\n }\n else if(type === \"heading\"){\n res = \"\\n#\" + fields[\"text\"] + \"\\n\";\n }\n else if(type === \"list\"){\n var items = fields[\"text\"].split(\"\\n\");\n res += \"\\n\";\n for(var i in items)\n res += \"* \" + items[i] + \"\\n\";\n }\n else if(type === \"media\"){\n var url = fields[\"url\"].trim();\n if(url !== \"\"){\n res = \"\\nm#\" + url + \"\\n\";\n }\n }\n else if(type === \"img\"){\n if($(\".img-viewer-thumb.active\").length >= 0){\n var src = $(\".img-viewer-thumb.active img\").attr(\"src\");\n var alt = $(\".img-viewer-thumb.active img\").attr(\"alt\");\n res += \"\\nm#\" + src + \"\\n\";\n }\n }\n else if(type === \"quote\"){\n res += \"\\n>\" + fields[\"text\"] + \"\\n\";\n }\n\n var curText = $(\"#post-editor\").val();\n var newText = curText.substr(0,cursorPosition) + res + curText.substr(cursorPosition);\n $(\"#post-editor\").val(newText);\n}", "buildImgURL(string){\n const value = string.toLowerCase().split(' ').join('-');\n return process.env.PUBLIC_URL+'/'+value;\n }", "function processImageTag(line) {\n var imageId = tools.getAttrValue(line, \"id\");\n if (imageId !== null && imageId.indexOf(\"image\") === 0) {\n var newImgLine = \"\";\n var x = tools.getAttrValue(line, \"x\");\n var y = tools.getAttrValue(line, \"y\");\n var w = tools.getAttrValue(line, \"width\");\n var h = tools.getAttrValue(line, \"height\");\n var viewBox = \"0 0 \" + w + \" \" + h;\n // handle clip-path for image\n var clipPath = tools.getAttrValue(line, \"clip-path\");\n // console.log(clipPath);\n if (clipPath !== null) {\n newImgLine += \"<g clip-path=\\\"\" + clipPath + \"\\\" id=\\\"cp-layer\\\">\"\n }\n // console.log(\"viewBox:\"+viewBox);\n newImgLine += \"<svg version=\\\"1.1\\\" viewBox=\\\"\" + viewBox\n + \"\\\" x=\\\"\" + x + \"\\\" y=\\\"\" + y + \"\\\" width=\\\"\" + w + \"\\\" height=\\\"\" + h + \"\\\" preserveAspectRatio=\\\"xMidYMid meet\\\">\";\n var imgLine = line;\n imgLine = tools.removeAttr(imgLine, \"x\");\n imgLine = tools.removeAttr(imgLine, \"y\");\n imgLine = tools.removeAttr(imgLine, \"preserveAspectRatio\");\n if (clipPath !== null) {\n imgLine = tools.removeAttr(imgLine, \"clip-path\");\n }\n newImgLine += imgLine;\n newImgLine += \"</svg>\";\n if (clipPath !== null) {\n newImgLine += \"</g>\"\n }\n // newImgLine = tools.replaceAttrValue(newImgLine,\"xlink:href\",\"/designs/templates/\"+getAttrValue(newImgLine,\"xlink:href\"));\n // newImgLine = tools.replaceAttrValue(newImgLine,\"xlink:href\",\"../../\"+getAttrValue(newImgLine,\"xlink:href\"));\n // console.log(\"img:\"+newImgLine);\n return newImgLine + \"\\n\";\n }\n return line + \"\\n\";\n}", "function generateMarkdown(data) {\n return `\n # Project Title\n <h1 align=\"center\">${data.title} 👋</h1>\n\n <p align=\"center\">\n <img src=\"https://img.shields.io/github/repo-size/MichaelPappas2662/ReadMeGenerator\" />\n <img src=\"https://img.shields.io/github/languages/top/MichaelPappas2662/ReadMeGenerator\" />\n <img src=\"https://img.shields.io/github/issues/MichaelPappas2662/ReadMeGenerator\" />\n <img src=\"https://img.shields.io/github/last-commit/MichaelPappas2662/ReadMeGenerator\" > \n</p>\n\n<p align=\"center\">\n <img src=\"https://img.shields.io/badge/Javascript-yellow\" />\n <img src=\"https://img.shields.io/badge/jQuery-blue\" />\n <img src=\"https://img.shields.io/badge/-node.js-green\" />\n <img src=\"https://img.shields.io/badge/-inquirer-red\" >\n <img src=\"https://img.shields.io/badge/-screencastify-lightgrey\" />\n <img src=\"https://img.shields.io/badge/-json-orange\" />\n</p>\n\n\n # Description\n ${renderLicenseBadge(data.license)}\n\n ${data.description}\n # Table of Contents \n * [Installation](#-Installation)\n * [Usage](#-Usage)\n * [License](#-Installation)\n * [Contributing](#-Contributing)\n * [Tests](#-Tests)\n * [Questions](#-Contact-Information)\n \n # Installation\n ${data.installation}\n # Usage\n ${data.usage}\n # License \n ${renderLicenseSection(data.license)}\n # Contributing \n ${data.contribute}\n # Tests\n ${data.tests}\n # Contact Information \n ![Developer Profile Picture](${data.avatar_url}) \n * GitHub Username: ${data.username}\n * Contact Email: ${data.userEmail}\n \n`;\n}", "function addImg(val) {\n fabric.Image.fromURL(val, function(img) {\n img.set({\n left: Math.random() * 500,\n top: Math.random() * 300,\n angle: 0,\n opacity: 1\n })\n c.add(img);\n });\n}", "function formatLink(text, link, rel, isImg) {\n if (typeof isImg === 'undefined') {\n isImg = false;\n }\n if (typeof rel === 'undefined') {\n rel = false;\n }\n var lnk = '';\n if (prg.markdown) {\n if (isImg) {\n lnk = \"!\";\n }\n lnk += \"[\" + text + \"](\" + link + \")\";\n } else if (prg.json) {\n lnk = {\"text\": text, \"link\": link, \"isImg\": isImg, \"rel\": rel};\n } else {\n lnk = text + \"\\t\" + link;\n }\n return lnk;\n}", "function displayImage() {\n const randomIndex = Math.floor(Math.random() * response.length);\n const imgSrc = response[randomIndex].links[0].href;\n const { title, description } = response[randomIndex].data[0];\n const imgHTML = `<img class=\"random-img\" src=\"${imgSrc}\" alt=\"${title}\">`;\n imageDescription.textContent = description;\n imageDescription.style.display = 'block';\n imageDiv.innerHTML = imgHTML;\n }", "function setDetails(imageUrl, titleText) {\n 'use strict';\n //Code go here\n var detailImage = document.querySelector(DETAIL_IMAGE_SELECTOR);\n //detailImage.setAttribute('src', 'img/otter3.jpg');\n detailImage.setAttribute('src',imageUrl);\n\n var detailTitle = document.querySelector(DETAIL_TITLE_SELECTOR);\n //detailTitle.textContent = 'You Should be Dancing';\n detailTitle.textContent = titleText;\n}", "placeholderArtwork(url) {\n if(!url) return \"http://placehold.it/100x100\";\n\n // const regx = /(-large)/;\n // const str = url.replace(regx, \"-crop\");\n\n return url;\n }", "function newImage(curId, afterID, title, src) {\n\t\t//Create image container\n\t\tvar div = document.createElement('div');\n\t\tdiv.id = \"image\" + curId;\n\t\tdiv.style.display = \"none\";\n\t\tdiv.classList.add(\"imageDiv\");\n\n\t\t// Insert template into container\n\t\tdiv.innerHTML = [{ id: curId }].map(ImageTemplate).join('');\n\n\t\t// Show image container\n\t\tdiv.style.display = \"block\";\n\n\t\t// Insert container with text after choosed id\n\t\tvar parent = document.getElementById('articleParent'); \n\t\t//parent.insertBefore(div, document.getElementById(afterID).nextSibling);\n\t\tparent.insertBefore(div, afterID);\n\n\t\t// Get img tag\n\t\tvar img = document.getElementById('img' + curId);\n\n\t\t// Load image into img tag\n\t\timg.src = src;\n\n\t\t// Set title\n\t\tdocument.getElementById('imgtitle' + curId).innerText = title;\n\t}" ]
[ "0.68855274", "0.63933325", "0.6258238", "0.6179141", "0.6099886", "0.6023173", "0.6010743", "0.5999033", "0.59867644", "0.596878", "0.5950638", "0.59488547", "0.5932189", "0.5922752", "0.59114945", "0.5863421", "0.57739586", "0.57591665", "0.57256883", "0.57233", "0.57179755", "0.5695557", "0.56715864", "0.5665231", "0.56614935", "0.5649232", "0.5649232", "0.5649232", "0.56450367", "0.5634366", "0.56044513", "0.559987", "0.5597667", "0.5588314", "0.5572298", "0.5571455", "0.5570711", "0.5567654", "0.5563877", "0.55595094", "0.5533663", "0.55281", "0.551125", "0.55054635", "0.5498629", "0.54903823", "0.54647845", "0.5462717", "0.5448629", "0.54441696", "0.5442466", "0.5440463", "0.54071075", "0.53892565", "0.5389185", "0.5357351", "0.53403586", "0.5340097", "0.533812", "0.5334091", "0.53219455", "0.5315887", "0.5307398", "0.5306453", "0.5306453", "0.5300395", "0.5296004", "0.52943975", "0.5289836", "0.5288021", "0.52866995", "0.52863723", "0.5265006", "0.52602816", "0.52597326", "0.52530473", "0.524932", "0.52327186", "0.52310455", "0.5225566", "0.5219968", "0.5219968", "0.52193695", "0.52116376", "0.520629", "0.52007556", "0.51910883", "0.5180078", "0.5174344", "0.5173206", "0.5171638", "0.5149214", "0.51421803", "0.5139826", "0.51344895", "0.5133963", "0.5132467", "0.5123419", "0.5122781", "0.51193297" ]
0.7792185
0
Get the topmost visible range of `editor`. Returns a fractional line number based the visible character within the line. Floor to get real line number
function getTopVisibleLine(editor) { if (!editor["visibleRanges"].length) { return undefined; } const firstVisiblePosition = editor["visibleRanges"][0].start; const lineNumber = firstVisiblePosition.line; const line = editor.document.lineAt(lineNumber); const progress = firstVisiblePosition.character / (line.text.length + 2); return lineNumber + progress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVisibleLine(editor) {\n if (!editor.visibleRanges.length) {\n return undefined;\n }\n const firstVisiblePosition = editor.visibleRanges[0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePosition.character / (line.text.length + 2);\n return lineNumber + progress;\n}", "function getBottomVisibleLine(editor) {\n if (!editor[\"visibleRanges\"].length) {\n return undefined;\n }\n const firstVisiblePosition = editor[\"visibleRanges\"][0].end;\n const lineNumber = firstVisiblePosition.line;\n let text = \"\";\n if (lineNumber < editor.document.lineCount) {\n text = editor.document.lineAt(lineNumber).text;\n }\n const progress = firstVisiblePosition.character / (text.length + 2);\n return lineNumber + progress;\n}", "getEog(editor) {\n const curPos = editor.getCursor();\n const lastLine = editor.getDoc().lastLine();\n\n if (this.lineEndPartOfGridRE.test(editor.getDoc().getLine(curPos.line))) {\n return { line: curPos.line, ch: editor.getDoc().getLine(curPos.line).length };\n }\n\n let line = curPos.line + 1;\n let isFound = false;\n for (; line <= lastLine; line++) {\n const strLine = editor.getDoc().getLine(line);\n if (this.lineEndPartOfGridRE.test(strLine)) {\n isFound = true;\n break;\n }\n\n if (this.lineBeginPartOfGridRE.test(strLine)) {\n isFound = false;\n break;\n }\n }\n\n if (!isFound) {\n return null;\n }\n\n const eodLine = Math.min(line, lastLine);\n const lineLength = editor.getDoc().getLine(eodLine).length;\n return { line: eodLine, ch: lineLength };\n }", "getLineAfterViewZone() {\n // TODO: abstract away the data, ids etc.\n const range = this.data.model.getDecorationRange(this.data.startEditDecId);\n // if the first decoration is missing, this implies the region reaches the\n // start of the editor.\n return range ? range.endLineNumber + 1 : 1;\n }", "getBog(editor) {\n const curPos = editor.getCursor();\n const firstLine = editor.getDoc().firstLine();\n\n if (this.lineBeginPartOfGridRE.test(editor.getDoc().getLine(curPos.line))) {\n return { line: curPos.line, ch: 0 };\n }\n\n let line = curPos.line - 1;\n let isFound = false;\n for (; line >= firstLine; line--) {\n const strLine = editor.getDoc().getLine(line);\n if (this.lineBeginPartOfGridRE.test(strLine)) {\n isFound = true;\n break;\n }\n\n if (this.lineEndPartOfGridRE.test(strLine)) {\n isFound = false;\n break;\n }\n }\n\n if (!isFound) {\n return null;\n }\n\n const bodLine = Math.max(firstLine, line);\n return { line: bodLine, ch: 0 };\n }", "getLineLimit(n_item) {\n const view = this.app.workspace.activeLeaf.view;\n let line_limit;\n if (view instanceof obsidian.MarkdownView) {\n const cm = view.sourceMode.cmEditor;\n if (n_item > 0) {\n line_limit = cm.lastLine();\n }\n else {\n line_limit = cm.firstLine();\n }\n }\n return line_limit;\n }", "function za(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=L(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var f=r.measure.appendChild(n(\"div\",[n(\"div\",a)],\"CodeMirror-linenumber CodeMirror-gutter-elt\")),o=f.firstChild.offsetWidth,i=f.offsetWidth-o;return r.lineGutter.style.width=\"\",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-i)+1,r.lineNumWidth=r.lineNumInnerWidth+i,r.lineNumChars=r.lineNumInnerWidth?a.length:-1,r.lineGutter.style.width=r.lineNumWidth+\"px\",In(e),!0}return!1}", "function lineTop (){\n var l = line(chars.top\n , chars['top-left'] || chars.top\n , chars['top-right'] || chars.top\n , chars['top-mid']);\n if (l)\n ret += l + \"\\n\";\n }", "function lineTop (){\n var l = line(chars.top\n , chars['top-left'] || chars.top\n , chars['top-right'] || chars.top\n , chars['top-mid']);\n if (l)\n ret += l + \"\\n\";\n }", "function getLastVerseNumberOrRange(editor, path) {\n var _a;\n const lastVerse = (_a = MyEditor.getLastVerse(editor, path)) === null || _a === void 0 ? void 0 : _a[0];\n return index_es/* Element.isElement */.W_.isElement(lastVerse)\n ? index_es/* Node.string */.NB.string(lastVerse.children[0])\n : undefined;\n}", "function annot_offset(range_end){\n var lines = editor.getSession().getDocument().getLines(0, range_end.row);\n var total_off = 0;\n var num_char;\n\n for(var i = 0; i < lines.length; i++){\n num_char = lines[i].length;\n total_off += parseInt((num_char - 1) / 80, 10);\n }\n\n return total_off;\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "function findStartLine(cm, n, precise) {\n\t\t var minindent, minline, doc = cm.doc;\n\t\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t\t for (var search = n; search > lim; --search) {\n\t\t if (search <= doc.first) { return doc.first }\n\t\t var line = getLine(doc, search - 1), after = line.stateAfter;\n\t\t if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n\t\t { return search }\n\t\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t\t if (minline == null || minindent > indented) {\n\t\t minline = search - 1;\n\t\t minindent = indented;\n\t\t }\n\t\t }\n\t\t return minline\n\t\t }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function fullDocumentRange(document) {\n const lastLineId = document.lineCount - 1;\n return new vscode.Range(\n 0,\n 0,\n lastLineId,\n document.lineAt(lastLineId).text.length\n );\n}", "function findStartLine(cm, n, precise) {\r\n var minindent, minline, doc = cm.doc;\r\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\r\n for (var search = n; search > lim; --search) {\r\n if (search <= doc.first) { return doc.first }\r\n var line = getLine(doc, search - 1), after = line.stateAfter;\r\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\r\n { return search }\r\n var indented = countColumn(line.text, null, cm.options.tabSize);\r\n if (minline == null || minindent > indented) {\r\n minline = search - 1;\r\n minindent = indented;\r\n }\r\n }\r\n return minline\r\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1)\n if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize)\n if (minline == null || minindent > indented) {\n minline = search - 1\n minindent = indented\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1)\n if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize)\n if (minline == null || minindent > indented) {\n minline = search - 1\n minindent = indented\n }\n }\n return minline\n}", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n\t\t var minindent, minline, doc = cm.doc;\n\t\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t\t for (var search = n; search > lim; --search) {\n\t\t if (search <= doc.first) return doc.first;\n\t\t var line = getLine(doc, search - 1);\n\t\t if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n\t\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t\t if (minline == null || minindent > indented) {\n\t\t minline = search - 1;\n\t\t minindent = indented;\n\t\t }\n\t\t }\n\t\t return minline;\n\t\t }", "function visibleLines(display, doc, viewPort) {\n var top = viewPort && viewPort.top != null ? Math.max(0, viewPort.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewPort && viewPort.ensure) {\n var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function findStartLine(cm, n, precise) {\n var minindent,\n minline,\n doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) {\n return doc.first;\n }\n\n var line = getLine(doc, search - 1),\n after = line.stateAfter;\n\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) {\n return search;\n }\n\n var indented = countColumn(line.text, null, cm.options.tabSize);\n\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\r\n var minindent, minline, doc = cm.doc;\r\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\r\n for (var search = n; search > lim; --search) {\r\n if (search <= doc.first) return doc.first;\r\n var line = getLine(doc, search - 1);\r\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\r\n var indented = countColumn(line.text, null, cm.options.tabSize);\r\n if (minline == null || minindent > indented) {\r\n minline = search - 1;\r\n minindent = indented;\r\n }\r\n }\r\n return minline;\r\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function getInputCursorLine(el) {\n var start = 0;\n\n if (typeof el.selectionStart == \"number\" && typeof el.selectionEnd == \"number\") {\n var normalizedValue = el.value.replace(/\\r\\n/g, \"\\n\");\n start = el.selectionStart;\n start = normalizedValue.slice(0, start);\n } else {\n el.focus(); \n\n var r = document.selection.createRange(); \n if (r == null) { \n return 0; \n } \n\n var re = el.createTextRange(), \n rc = re.duplicate(); \n re.moveToBookmark(r.getBookmark()); \n rc.setEndPoint('EndToStart', re); \n\n start = rc.text;\n }\n\n return(start.split(\"\\n\").length - 1);\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function findStartLine(cm, n, precise) {\n\t var minindent, minline, doc = cm.doc;\n\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t for (var search = n; search > lim; --search) {\n\t if (search <= doc.first) return doc.first;\n\t var line = getLine(doc, search - 1);\n\t if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t if (minline == null || minindent > indented) {\n\t minline = search - 1;\n\t minindent = indented;\n\t }\n\t }\n\t return minline;\n\t }", "function findStartLine(cm, n, precise) {\n\t var minindent, minline, doc = cm.doc;\n\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t for (var search = n; search > lim; --search) {\n\t if (search <= doc.first) return doc.first;\n\t var line = getLine(doc, search - 1);\n\t if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t if (minline == null || minindent > indented) {\n\t minline = search - 1;\n\t minindent = indented;\n\t }\n\t }\n\t return minline;\n\t }", "function findStartLine(cm, n, precise) {\n\t var minindent, minline, doc = cm.doc;\n\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t for (var search = n; search > lim; --search) {\n\t if (search <= doc.first) return doc.first;\n\t var line = getLine(doc, search - 1);\n\t if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t if (minline == null || minindent > indented) {\n\t minline = search - 1;\n\t minindent = indented;\n\t }\n\t }\n\t return minline;\n\t }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function getCurrentLine(el){\n var caret_pos = $(\"#work_markup\").getCursorPosition();\n return getLineNumber(caret_pos, el);\n}", "function visibleLines(display, doc, viewport) {\r\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\r\n top = Math.floor(top - paddingTop(display));\r\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\r\n\r\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\r\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\r\n // forces those lines into the viewport (if possible).\r\n if (viewport && viewport.ensure) {\r\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\r\n if (ensureFrom < from) {\r\n from = ensureFrom;\r\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\r\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\r\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\r\n to = ensureTo;\r\n }\r\n }\r\n return {from: from, to: Math.max(to, from + 1)}\r\n}" ]
[ "0.8047043", "0.7824864", "0.6870879", "0.6537144", "0.65344673", "0.63819563", "0.6225287", "0.6216907", "0.6168492", "0.61107486", "0.60311925", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58719045", "0.58659244", "0.58527595", "0.58527595", "0.58527595", "0.58527595", "0.58527595", "0.58527595", "0.58527595", "0.58527595", "0.58527595", "0.58527595", "0.58527595", "0.5848102", "0.58397996", "0.5822123", "0.5822123", "0.5815651", "0.5815651", "0.5815651", "0.58089936", "0.5800218", "0.5796989", "0.5794028", "0.5794028", "0.5794028", "0.5794028", "0.5794028", "0.5794028", "0.5794028", "0.5794028", "0.5794028", "0.5794028", "0.5794028", "0.5792696", "0.57697153", "0.57416296", "0.57416296", "0.57416296", "0.57413566", "0.57266134", "0.57266134", "0.57266134", "0.57266134", "0.57266134", "0.57266134", "0.57266134", "0.57266134", "0.57266134", "0.57266134", "0.57266134", "0.5720346", "0.5720346", "0.5720346", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.57125306", "0.5708421", "0.57001746" ]
0.8464181
0
Get the bottommost visible range of `editor`. Returns a fractional line number based the visible character within the line. Floor to get real line number
function getBottomVisibleLine(editor) { if (!editor["visibleRanges"].length) { return undefined; } const firstVisiblePosition = editor["visibleRanges"][0].end; const lineNumber = firstVisiblePosition.line; let text = ""; if (lineNumber < editor.document.lineCount) { text = editor.document.lineAt(lineNumber).text; } const progress = firstVisiblePosition.character / (text.length + 2); return lineNumber + progress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTopVisibleLine(editor) {\n if (!editor[\"visibleRanges\"].length) {\n return undefined;\n }\n const firstVisiblePosition = editor[\"visibleRanges\"][0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePosition.character / (line.text.length + 2);\n return lineNumber + progress;\n}", "function getVisibleLine(editor) {\n if (!editor.visibleRanges.length) {\n return undefined;\n }\n const firstVisiblePosition = editor.visibleRanges[0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePosition.character / (line.text.length + 2);\n return lineNumber + progress;\n}", "getLineAfterViewZone() {\n // TODO: abstract away the data, ids etc.\n const range = this.data.model.getDecorationRange(this.data.startEditDecId);\n // if the first decoration is missing, this implies the region reaches the\n // start of the editor.\n return range ? range.endLineNumber + 1 : 1;\n }", "getBog(editor) {\n const curPos = editor.getCursor();\n const firstLine = editor.getDoc().firstLine();\n\n if (this.lineBeginPartOfGridRE.test(editor.getDoc().getLine(curPos.line))) {\n return { line: curPos.line, ch: 0 };\n }\n\n let line = curPos.line - 1;\n let isFound = false;\n for (; line >= firstLine; line--) {\n const strLine = editor.getDoc().getLine(line);\n if (this.lineBeginPartOfGridRE.test(strLine)) {\n isFound = true;\n break;\n }\n\n if (this.lineEndPartOfGridRE.test(strLine)) {\n isFound = false;\n break;\n }\n }\n\n if (!isFound) {\n return null;\n }\n\n const bodLine = Math.max(firstLine, line);\n return { line: bodLine, ch: 0 };\n }", "getEog(editor) {\n const curPos = editor.getCursor();\n const lastLine = editor.getDoc().lastLine();\n\n if (this.lineEndPartOfGridRE.test(editor.getDoc().getLine(curPos.line))) {\n return { line: curPos.line, ch: editor.getDoc().getLine(curPos.line).length };\n }\n\n let line = curPos.line + 1;\n let isFound = false;\n for (; line <= lastLine; line++) {\n const strLine = editor.getDoc().getLine(line);\n if (this.lineEndPartOfGridRE.test(strLine)) {\n isFound = true;\n break;\n }\n\n if (this.lineBeginPartOfGridRE.test(strLine)) {\n isFound = false;\n break;\n }\n }\n\n if (!isFound) {\n return null;\n }\n\n const eodLine = Math.min(line, lastLine);\n const lineLength = editor.getDoc().getLine(eodLine).length;\n return { line: eodLine, ch: lineLength };\n }", "getLineLimit(n_item) {\n const view = this.app.workspace.activeLeaf.view;\n let line_limit;\n if (view instanceof obsidian.MarkdownView) {\n const cm = view.sourceMode.cmEditor;\n if (n_item > 0) {\n line_limit = cm.lastLine();\n }\n else {\n line_limit = cm.firstLine();\n }\n }\n return line_limit;\n }", "function getLastVerseNumberOrRange(editor, path) {\n var _a;\n const lastVerse = (_a = MyEditor.getLastVerse(editor, path)) === null || _a === void 0 ? void 0 : _a[0];\n return index_es/* Element.isElement */.W_.isElement(lastVerse)\n ? index_es/* Node.string */.NB.string(lastVerse.children[0])\n : undefined;\n}", "function annot_offset(range_end){\n var lines = editor.getSession().getDocument().getLines(0, range_end.row);\n var total_off = 0;\n var num_char;\n\n for(var i = 0; i < lines.length; i++){\n num_char = lines[i].length;\n total_off += parseInt((num_char - 1) / 80, 10);\n }\n\n return total_off;\n}", "function za(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=L(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var f=r.measure.appendChild(n(\"div\",[n(\"div\",a)],\"CodeMirror-linenumber CodeMirror-gutter-elt\")),o=f.firstChild.offsetWidth,i=f.offsetWidth-o;return r.lineGutter.style.width=\"\",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-i)+1,r.lineNumWidth=r.lineNumInnerWidth+i,r.lineNumChars=r.lineNumInnerWidth?a.length:-1,r.lineGutter.style.width=r.lineNumWidth+\"px\",In(e),!0}return!1}", "getEndPosition(widget) {\n let left = widget.x;\n let top = widget.y;\n let lineWidget = undefined;\n if (widget.childWidgets.length > 0) {\n lineWidget = widget.childWidgets[widget.childWidgets.length - 1];\n left += this.getWidth(lineWidget, false);\n }\n if (!isNullOrUndefined(lineWidget)) {\n top = this.getTop(lineWidget);\n }\n let topMargin = 0;\n let bottomMargin = 0;\n let size = this.getParagraphMarkSize(widget, topMargin, bottomMargin);\n return new Point(left, top + size.topMargin);\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc\n d.maxLine = getLine(doc, doc.first)\n d.maxLineLength = lineLength(d.maxLine)\n d.maxLineChanged = true\n doc.iter(function (line) {\n var len = lineLength(line)\n if (len > d.maxLineLength) {\n d.maxLineLength = len\n d.maxLine = line\n }\n })\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc\n d.maxLine = getLine(doc, doc.first)\n d.maxLineLength = lineLength(d.maxLine)\n d.maxLineChanged = true\n doc.iter(function (line) {\n var len = lineLength(line)\n if (len > d.maxLineLength) {\n d.maxLineLength = len\n d.maxLine = line\n }\n })\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function getEndOffSet() {\n var selObj = window.getSelection();\n var selRange = selObj.getRangeAt(0);\n return selRange['endOffset'];\n }", "function findMaxLine(cm) {\r\n var d = cm.display, doc = cm.doc;\r\n d.maxLine = getLine(doc, doc.first);\r\n d.maxLineLength = lineLength(d.maxLine);\r\n d.maxLineChanged = true;\r\n doc.iter(function(line) {\r\n var len = lineLength(line);\r\n if (len > d.maxLineLength) {\r\n d.maxLineLength = len;\r\n d.maxLine = line;\r\n }\r\n });\r\n }", "function visibleLines(display, doc, viewPort) {\n var top = viewPort && viewPort.top != null ? Math.max(0, viewPort.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewPort && viewPort.ensure) {\n var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function findMaxLine(cm) {\r\n var d = cm.display, doc = cm.doc;\r\n d.maxLine = getLine(doc, doc.first);\r\n d.maxLineLength = lineLength(d.maxLine);\r\n d.maxLineChanged = true;\r\n doc.iter(function (line) {\r\n var len = lineLength(line);\r\n if (len > d.maxLineLength) {\r\n d.maxLineLength = len;\r\n d.maxLine = line;\r\n }\r\n });\r\n}", "function estimateHeight(cm) {\r\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\r\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\r\n return function(line) {\r\n if (lineIsHidden(cm.doc, line)) return 0;\r\n\r\n var widgetsHeight = 0;\r\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\r\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\r\n }\r\n\r\n if (wrapping)\r\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\r\n else\r\n return widgetsHeight + th;\r\n };\r\n }", "function fullDocumentRange(document) {\n const lastLineId = document.lineCount - 1;\n return new vscode.Range(\n 0,\n 0,\n lastLineId,\n document.lineAt(lastLineId).text.length\n );\n}", "function visualLineEndNo(doc, lineN) {\n\t\t if (lineN > doc.lastLine()) return lineN;\n\t\t var line = getLine(doc, lineN), merged;\n\t\t if (!lineIsHidden(doc, line)) return lineN;\n\t\t while (merged = collapsedSpanAtEnd(line))\n\t\t line = merged.find(1, true).line;\n\t\t return lineNo(line) + 1;\n\t\t }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return lineNo(line) + 1\n}", "function estimateHeight(cm) {\n\t\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t\t return function (line) {\n\t\t if (lineIsHidden(cm.doc, line)) { return 0 }\n\n\t\t var widgetsHeight = 0;\n\t\t if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n\t\t if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n\t\t } }\n\n\t\t if (wrapping)\n\t\t { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n\t\t else\n\t\t { return widgetsHeight + th }\n\t\t }\n\t\t }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "function estimateHeight(cm) {\r\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\r\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\r\n return function (line) {\r\n if (lineIsHidden(cm.doc, line)) { return 0 }\r\n\r\n var widgetsHeight = 0;\r\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\r\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\r\n } }\r\n\r\n if (wrapping)\r\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\r\n else\r\n { return widgetsHeight + th }\r\n }\r\n}", "function visualLineEndNo(doc, lineN) {\n\t\t if (lineN > doc.lastLine()) { return lineN }\n\t\t var line = getLine(doc, lineN), merged;\n\t\t if (!lineIsHidden(doc, line)) { return lineN }\n\t\t while (merged = collapsedSpanAtEnd(line))\n\t\t { line = merged.find(1, true).line; }\n\t\t return lineNo(line) + 1\n\t\t }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }" ]
[ "0.77540386", "0.7541392", "0.6650702", "0.6616165", "0.65909344", "0.6335403", "0.6110543", "0.60798913", "0.592969", "0.5913406", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.5821295", "0.58194345", "0.58194345", "0.58194345", "0.58194345", "0.58194345", "0.58194345", "0.58194345", "0.58194345", "0.5809472", "0.5809472", "0.5796928", "0.5796928", "0.5796928", "0.5796928", "0.5796928", "0.5796928", "0.5796928", "0.5796928", "0.5796928", "0.5796928", "0.5796928", "0.5793907", "0.57897323", "0.5779548", "0.5767786", "0.57529896", "0.5749189", "0.5743357", "0.57391804", "0.57391804", "0.57391804", "0.57391804", "0.57391804", "0.57391804", "0.57391804", "0.5730349", "0.5730349", "0.5726335", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725937", "0.5725847", "0.5725847", "0.5725847", "0.5725705", "0.5723869", "0.5719903", "0.5719903", "0.5719903", "0.5719903", "0.5719903", "0.5719903", "0.5719903", "0.5719903", "0.5719903", "0.5719903", "0.5719903", "0.57171696", "0.57171696" ]
0.8385597
0
this method is called when your extension is deactivated
function deactivate() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deactivate() {\n\tconsole.log('关闭扩展')\n}", "function deactivate() {\n example.deactivate();\n console.log(`Extension(${example.name}) is deactivated.`);\n}", "function deactivateExtension() {\n Privly.options.setInjectionEnabled(false);\n updateActivateStatus(false);\n}", "function deactivate() {\n extension.nbLine = null;\n extension.editor = null;\n extension.deco.clear();\n extension.deco = null;\n cache_manager_1.default.clearCache();\n}", "function deactivate() {\n console.log(\"deactivating HL7Tools extension\");\n exports.deactivate = deactivate;\n}", "OnDeactivated() {}", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}" ]
[ "0.8011084", "0.7815618", "0.7768406", "0.76137966", "0.7570413", "0.75452274", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692" ]
0.0
-1
server.listen(pipe) creates a new pipe wrap, so server.close() doesn't actually unlink this existing pipe. It needs to be unlinked separately via handle.close()
function closePipeServer(handle) { return common.mustCall(function() { this.close(); handle.close(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeServer() {\n if (!!this.server) {\n this.server.close();\n }\n }", "function endConnection() {\n\t\tsocket.unpipe();\n\t\tserverSocket.unpipe();\n\t\tsocket.end();\n\t\tserverSocket.end();\n\t}", "_killServer(callback) {\n // Destroy all open sockets\n for (var socketId in this._sockets) {\n this._sockets[socketId].destroy();\n }\n // Close the server\n this._server.close(callback);\n }", "stop() {\n if (this.server === undefined) {\n return;\n }\n this.server.close();\n }", "async function destroyAttachServer() {\r\n const instance = await server;\r\n if (instance) {\r\n await new Promise(r => instance.close(r));\r\n }\r\n}", "function cleanupServer(serverName) {\n var server = servers[serverName]\n server && server.close()\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "cleanUp() {\n logger.info('server shutting down');\n this.server.close(() => process.exit(0));\n }", "function on_term() {\n // Close the server as a response to a terminate signal.\n if (server && server.close) {\n server.close(function() {\n // Exit with code 0 after close finishes.\n process.exit(0);\n });\n } else {\n // Exit right away if server doesn't exist or close is unavailable.\n process.exit(0);\n }\n}", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "stop() {\n if (this.server === undefined) {\n return;\n }\n\n this.server.close();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }" ]
[ "0.5974828", "0.5912525", "0.58015645", "0.5787746", "0.57842267", "0.57499593", "0.5748326", "0.5730429", "0.57298464", "0.5723317", "0.5723317", "0.5723317", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.5721548", "0.56937647", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898", "0.5692898" ]
0.71555525
0
Avoid conflict with listenpath
function randomPipePath() { return `${common.PIPE}-listen-handle-${counter++}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doListen(registry) {}", "static _onListenDone () {\n }", "listen() {\n }", "function defaultOnListen() {\n console.log(\"Socket is listening on port: \" + port);\n\n if (onListen)\n onListen();\n }", "function onListening() {\n // 忽略80端口\n const _port = (port != 80 ? ':' + port : '');\n const url = \"http://\" + hostname + _port + '/';\n debug(`${staticDir} server running at ${url}`);\n console.log(`${staticDir} server running at`,url);\n\n if(!argv.silent){\n openBrowserURL(url)\n }\n\n}", "function handleListen() {\n console.log(\"Listening\");\n }", "function handleListen() {\n console.log(\"Listening\");\n }", "onListening() {\n var addr = this.server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n _logs('访问地址: ' + _config2.default.secheme + '://ip:' + port + '/');\n _logs('APIDoc: ' + _config2.default.secheme + '://ip:' + apiPort + '/');\n}", "_expandListenConfig(listens) {\n return listens.map(item => {\n // Subdomain-marked records must have a subdomain (or multiple)\n if (item.charAt(0) == '.') {\n item = '*' + item;\n }\n\n // Add the protocols\n item = '*://' + item;\n\n // Add the ending slash, if none is present (required for listen directives)\n const indexProto = item.indexOf('//');\n const indexPathSlash = (indexProto >= 0) ? item.indexOf('/', indexProto + 2) : item.indexOf('/');\n if (indexPathSlash == -1) {\n item += '/';\n }\n\n // Add the ending wildcard\n item += '*';\n\n // Result\n return item;\n });\n }", "function handleListen() {\r\n console.log(\"Listening\"); //gibt Listening in der console aus \r\n }", "function start () {\n listen()\n}", "function onListening() {\n var addr = app.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n}", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = (typeof addr === 'string') ? 'pipe ' + addr : 'port ' + addr.port;\n}", "function createNotFoundDirectoryListener(){return function notFound(){this.error(404);};}", "function onListening() {\n \tvar addr = server.address();\n \tvar bind = typeof addr === 'string'\n \t? 'pipe ' + addr\n \t: 'port ' + addr.port;\n \tdebug('Listening on ' + bind);\n }", "function onListening() {\n\t\tvar addr = server.address();\n\t\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\t\tvar fqdn = scheme+\"://\"+host;\n\t\tcrawl.init(fqdn,host,scheme);\n\t}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n}", "function heyListen (instance, onListening) {\n // Unpack variables from instance\n var server = instance.server\n var config = instance.config\n\n function reportListening () {\n const title = config.productInformation.title\n global.listeningTime = (Date.now() - global.startTime) / 1000\n console.log(`[${title} Listening] on`, global.hostUrl, '-- Start up time:', global.listeningTime.toFixed(2), 'ms', NL)\n }\n\n instance.httpServer = server.listen(config.serverPort, config.ipAddress, function () {\n global.hostUrl = url.format({\n protocol: 'http',\n hostname: 'localhost',\n query: '',\n pathname: '',\n port: config.serverPort\n })\n\n if (onListening && typeof onListening === 'function') {\n onListening(null)\n }\n // Prod the navigation endpoint\n request(global.hostUrl + '/api/navigation', reportListening)\n })\n .on('error', function (e) {\n console.log('Could not start server: ')\n if (e.code === 'EADDRINUSE') {\n console.log(' Port address already in use.')\n }\n console.log(' ' + e)\n\n if (onListening && typeof onListening === 'function') {\n onListening(false)\n }\n })\n\n return instance.httpServer\n}", "function start() {\n listen();\n}", "_initFallbackListener() {\n\n this.server.get('*', (req, res) => {\n\n this._htpasswdMiddleware(req, res);\n\n // Serve the service-worker\n\n if (req.url === '/service-worker.js') {\n this.nextApp.serveStatic(req, res, paths.appStatic + req.url);\n\n // If no language has been defined in the request, we should try to find a route that matches the request.\n // If a route has been founded, we must trigger a redirection to add the language segment to the url.\n // For example, /products should probably be resolved to /en/products.\n\n } else {\n return this.nextApp.getRequestHandler()(req, res);\n }\n });\n }", "function handleListen() {\n //Die handleListen-Funktion vom Typ void benötigt keine Parameter und...\n console.log(\"Listening\");\n //gibt nur \"Listening\" in der Console aus\n }", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = `${serverConfig.host}:${serverConfig.defaultPort}`;\n\t// const bind = typeof(addr) === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n //debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = Dich_vu.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "_onListening() {\n /* Called after socket.bind */\n let address = this.socket.address()\n log.info(`server listening ${address.address}:${address.port}`)\n }", "componentDidMount() {\r\n this.listenerMutes = this.listenPaths.map(\r\n path => {\r\n let updateOn = ( val ) => {\r\n paths.putPath( path, this.state, val )\r\n this.setState( this.state )\r\n }\r\n updateOn.bind( this )\r\n\r\n let localProvided = false\r\n let mute = this.providers\r\n && this.providers\r\n .filter(\r\n provider => provider.canProvide( path )\r\n )\r\n .map(\r\n provider => {\r\n if( localProvided )\r\n throw 'Multiple local providers found for property ' + path + ' property is ambiguous'\r\n localProvided = true\r\n return provider.listen( path, updateOn )\r\n }\r\n )\r\n if( mute && mute[ 0 ] ) {\r\n return mute[ 0 ]\r\n } else {\r\n return null\r\n }\r\n }\r\n )\r\n .filter( mute => !!mute )\r\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n}", "function onListening() {\nvar addr = server.address();\nvar bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\ndebug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n\tdebug(\"Listening on \" + bind);\n}", "function onListening() {\n let addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n}", "function onListening()\n{\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n // debug('Listening on ' + bind);\n}", "function onListening()\n{\n\tvar addr\t= server.address();\n\tvar bind\t= ('string' === typeof addr) ? 'pipe ' + addr : 'port ' + addr.port;\n\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string' ?\n 'pipe' + addr :\n 'port' + addr.port;\n}", "function onListening() {\n var addr = wss.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Escuchando en ' + bind);\n}", "function listen_handler(){\n console.log(`Now Listening On Port ${port}`);\n}", "listen() {\n\n if (!this.validator) {\n console.info(\"[\" + this.apiName + \"] - Waiting for the configuration to load...\");\n setTimeout(() => { this.listen() }, 300);\n return;\n }\n\n this.app.listen(8080, () => {\n console.info('[' + this.apiName + '] - Microservice up and running');\n });\n\n }", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug( 'Listening on ' + bind );\n}", "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log('Listening on ' + bind);\n}", "constructor() {\n this.#listen();\n }", "constructor() {\n this.#listen();\n }", "onListening(server) {\n const { port } = server.listeningApp.address();\n console.log('Listening on port:', port);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n console.log(\"Listening on \" + bind);\n }", "function listening(){console.log(\"listening. . .\");}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n //debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function listenVolume() {\n watch(\"./data\", {recursive: true}, function (evt, name) {\n console.warn({evt, name}, \"watchFile\");\n if (evt == \"remove\") {\n queueListRemove(name);\n } else {\n queueListAdd(name);\n }\n })\n}", "function onListening() \n{\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('init - awesome server');\n // logger.info('init - awesome server');\n}", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = typeof addr === 'string' ? `pipe ${addr}` : `port ${addr.port}`;\n\tdebug(`Listening on ${bind}`);\n}", "function onListening() {\n Object.keys(httpServers).forEach(key => {\n var httpServer = httpServers[key];\n var addr = httpServer.address()||{};\n var bind = typeof addr === \"string\"\n ? \"pipe \" + addr\n : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n })\n}", "function registerPath(path) {\n socket.emit(\"registerPath\", path);\n} // Unregister the former path", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n console.log('Broadcast on local IP ' + ip);\n console.log('------------------------------');\n console.log('View site at http://localhost:' + port);\n}", "function onListening(){cov_12fvjqzcov().f[2]++;const addr=(cov_12fvjqzcov().s[26]++,server.address());const bind=(cov_12fvjqzcov().s[27]++,typeof addr==='string'?(cov_12fvjqzcov().b[6][0]++,'pipe '+addr):(cov_12fvjqzcov().b[6][1]++,'port '+addr.port));cov_12fvjqzcov().s[28]++;console.log('Listening on: ',bind);}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? `pipe ${addr}`\n : `pipe ${addr.port}`;\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function mylisten(server, PORT, host, log){\n\tlog(PORT, host);\n\tserver.listen(PORT, host);\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening () {\n const addr = server.address()\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n // when things are working well, writing to the log is fine\n logger.debug('Listening on %s', bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug( 'Listening on ' + bind );\n}", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = typeof addr === 'string'\n\t\t? 'pipe ' + addr\n\t\t: 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n\t\t\t'pipe ' + addr : 'port ' + addr.port;\n\t\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "_bindEventHandlers(){\n if ( this._server !== null ){\n // TODO\n }\n }", "function onListening () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('Listening on', bind)\n }", "function onListening() {\n var address = server.address();\n var bind = typeof address === 'string' ? 'pipe ' + address : 'port ' + address.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = (typeof addr === 'string') ? 'pipe ' + addr : 'port ' + addr.port;\n logger.info('>> LISTENING ON ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n // debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "listen(port = undefined) {\n if (port) {\n this.io.listen(port);\n }\n this.listenForPregameEvents();\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n console.log(\"Listening on \" + bind);\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function listening(){\n\tconsole.log('listening');\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address()\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port\n debug('Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function listener() {\r\n if (logged == 1) return;\r\n logged = 1;\r\n cfg.port = app.address().port;\r\n csl.log('Server running on port := ' + cfg.port);\r\n // Log the current configuration\r\n for (var key in cfg) {\r\n if (key != 'spdy' || key != 'https')\r\n csl.log(key + ' : ' + cfg[key]);\r\n }\r\n\r\n // If browser is true, launch it.\r\n if (cfg.browser) {\r\n var browser;\r\n switch (process.platform) {\r\n case \"win32\":\r\n browser = \"start\";\r\n break;\r\n case \"darwin\":\r\n browser = \"open\";\r\n break;\r\n default:\r\n browser = \"xdg-open\";\r\n break;\r\n }\r\n csl.warn('Opening a new browser window...');\r\n require('child_process').spawn(browser, ['http://localhost:' + app.address().port]);\r\n }\r\n }", "function onListening() {\n debug('Listening on port ' + port);\n}", "function onListening() {\n let addr = this.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address()\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n // debug('Listening on ' + bind) idk\n console.log('Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug_info('Listening on ' + bind);\n}" ]
[ "0.6034013", "0.6020821", "0.5982961", "0.59537745", "0.58785844", "0.5844389", "0.5844389", "0.5840405", "0.58013064", "0.57963765", "0.5788366", "0.57648695", "0.5738501", "0.57290965", "0.57160616", "0.5711018", "0.56939334", "0.5689265", "0.56786615", "0.56610465", "0.5639619", "0.5639498", "0.5629095", "0.56266665", "0.56213725", "0.56144255", "0.55946064", "0.5581487", "0.5579352", "0.5562157", "0.55551255", "0.55510545", "0.55502445", "0.55339926", "0.55238414", "0.5516433", "0.5513877", "0.5512559", "0.55108297", "0.5506792", "0.55037373", "0.550154", "0.54962456", "0.5474859", "0.5474859", "0.54710174", "0.5468322", "0.54672664", "0.54648906", "0.5463348", "0.54594976", "0.5453569", "0.5439092", "0.54387265", "0.5436986", "0.5431774", "0.5423383", "0.5418451", "0.5416447", "0.5415979", "0.5413768", "0.541036", "0.540665", "0.5399846", "0.5395502", "0.5394585", "0.5389503", "0.5386434", "0.53861064", "0.53857595", "0.53846294", "0.5380525", "0.5378053", "0.5377996", "0.53732985", "0.537225", "0.53702325", "0.53681195", "0.5363637", "0.5363637", "0.5363637", "0.5363637", "0.5363637", "0.53636354", "0.5359706", "0.5359218", "0.53495616", "0.53468144", "0.5343859", "0.5343859", "0.5343859", "0.5343859", "0.5343859", "0.5343859", "0.5343859", "0.5343859", "0.5343859", "0.5343859", "0.5343859", "0.5342071", "0.53420573" ]
0.0
-1
Gets a Location object from the window with information about the current location of the document.
getWindowLocation() { return window.location; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocation() {\n return location;\n }", "function GetLocation(){\n\tif(navigator.geolocation){\n\t\tnavigator.geolocation.getCurrentPosition(setLocation);\n\t}\n}", "function getWindowLocation() {\n\t\t\tif (!W.location.origin) {\n\t\t\t\tW.location.origin = W.location.protocol + \"//\" + W.location.hostname + (W.location.port ? ':' + W.location.port : '');\n\t\t\t}\n\t\t\treturn W.location.origin;\n\t\t}", "get location () {\n\t\treturn this._location;\n\t}", "get location() {\n\t\treturn this.__location;\n\t}", "get location() {\n\t\treturn this.__location;\n\t}", "get location() {\n\t\treturn this.__location;\n\t}", "function getBrowserGeoLoc(){\n getLocation();\n showPosition();\n }", "getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(objGeolocation.bundleObj, objGeolocation.handelError)\n } else {\n console.log('Geolocation is not supported by this browser');\n }\n }", "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(postLocation, showError);\n\t}\n}", "function _getLocation() { return \"\" + window.location; }", "function getLocation() {\n\tif (window.navigator.geolocation) {\n\t\twindow.navigator.geolocation.getCurrentPosition(showPosition);\n\t} else {\n\t\tshowPosition(DEFAULT_POSITION);\n\t}\n}", "getLocation() {\n return this._executeAfterInitialWait(() => this.currently.getLocation());\n }", "function getCurrentLocation() {\n\tif (!navigator.geolocation) {\n\t\talert(\"GeoLocation is not supported by browser.\");\n\t\treturn;\n\t}\n\treturn navigator.geolocation.getCurrentPosition(coordinates,\n\t\tdisplayErrorMessage);\n}", "getLocation() {\n return this._node.__execute(() => this.element.getLocation());\n }", "function getLocation() {\n var geolocation = navigator.geolocation;\n geolocation.getCurrentPosition(showLocation);\n }", "getLocation() {\n return this.origin;\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else { \n doc_location.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getPositionSuccess, getPositionError, getPositionOptions);\n }\n\telse {\n\t\talertify.error(\"Geolocation is not supported for this browser.\");\n\t}\n}", "function getLocation(entry) {\n return entry.getValue('location');\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n navigator.geolocation.getCurrentPosition(displayLocation, locationError);\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(createMap);\n } \n }", "function get_current_loc(){\n\tif(window.pageYOffset)\n\t\treturn window.pageYOffset;\n\tif(document.documentElement&& document.documentElement.scrollTop){\n\t\treturn (document.documentElement.scrollTop);\n\t}\n\tif(document.body){\n\t\treturn document.body.scrollTop;\n\t}\n}", "function getGeoLocation(){\n //Getting current position \n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n this.currentPosMark = new google.maps.Marker({\n position: pos,\n map: this.map,\n icon: this.iconTypes['beachFlag'],\n animation: google.maps.Animation.DROP,\n title: 'You are here!'\n });\n infoWindow.setPosition(pos);\n infoWindow.setContent('You are here');\n //infoWindow.open(map);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, this.map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, this.map.getCenter());\n }\n }", "function getLocation() {\n if (navigator.geolocation) {\n // Nest showPosition inside getLocation\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "function getLocation() {\n return findLocation(getStatus());\n}", "function locate () {\n morph(document.body, view(Object.assign({}, state, {isLoading: true})))\n navigator.geolocation.getCurrentPosition(\n (position) => morph(document.body, view(Object.assign({}, state, {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n error: null,\n positioned: true\n }))),\n err => morph(document.body, view(Object.assign({}, state, {\n error: err.message,\n positioned: false\n })))\n )\n }", "function getLocation(){\n\t\t\tif(navigator.geolocation){\n\t\t\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdisplayCoords.innerHTML=\"Geolocation API not supported by your browser\";\n\t\t\t}\n\t\t\t\n\t\t}", "function getLocation() {\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t\t} else {\n\t\t\tconsole.log('No location detected');\n\t\t}\n\t}", "function getLocation() {\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "function getBrowserLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Get Browser Location error\");\n };\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "function getLocation() {\n\t\tTitanium.Geolocation.getCurrentPosition( updatePosition );\n\t}", "function getLocation(){\r\n if (locationUser) {\r\n locationUser.getCurrentPosition(showPosition);\r\n } else {\r\n return 'Geolocation is not supported by this browser.';\r\n }\r\n}", "get location() {\n return new Point(this.x, this.y);\n }", "function Location(obj) { this.obj = obj; }", "function GetCurrentLocation() {\n // chek deafault user coordinates\n if (Modernizr.geolocation) {\n navigator.geolocation.getCurrentPosition(success, options);\n var options = {\n enableHighAccuracy: true,\n timeout: 5000,\n maximumAge: 0\n };\n function success(pos) {\n var crd = pos.coords;\n // transfer current user coordinates to default\n window.centerLat = crd.latitude;\n window.centerLng = crd.longitude;\n }\n } else {\n console.log('location error');\n }\n} // GetCurrentLocation", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n location.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getLoc() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success, getError);\n }\n\n else {\n console.log(\"Geolocation is not supported by this browser\");\n defaultLoc();\n }\n}", "function getLocation(id) {\r\n let location = document.getElementById(id);\r\n return location;\r\n}", "function get_office_location(){\n\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getLocation() {\n     if (navigator.geolocation) {\n // showPosition is a reference to a JS function below\n         navigator.geolocation.getCurrentPosition(showPosition);\n     }\n }", "function getLocation()\n {\n if(navigator.geolocation)\n {\n geoLoc = navigator.geolocation;\n watchID = geoLoc.watchPosition(showLocation, errorHandler);\n }\n else\n {\n console.log(\"sorry, browser does not support geolocation!\");\n }\n }", "function getUserLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showUserPosition);\n\t} \n}", "updateLocation(window, url) {\n const documentImpl = idlUtils.implForWrapper(window.document);\n if (window === this.current) this.current.url = url;\n documentImpl._URL = whatwgURL.parseURL(url || 'about:blank');\n documentImpl._location = new Location(this, url);\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 }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, error);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "getWindowPosition() {\n if (this.settingsEngine.has('mainWindow.position')) {\n const position = this.settingsEngine.get('mainWindow.position');\n\n return {\n 'xPos': position.x,\n 'yPos': position.y,\n }\n }\n\n return undefined;\n }", "function findLocation() {\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n infoWindow.setPosition(pos);\n infoWindow.setContent('You.');\n infoWindow.open(map);\n map.setCenter(pos);\n userLat = position.coords.latitude;\n userLng = position.coords.longitude;\n\n //Runs the Zomato ajax call\n getFoodSpots();\n\n }, function () {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n }", "function getLocation() {\n // Make sure browser supports this feature\n if (navigator.geolocation) {\n // Provide our showPosition() function to getCurrentPosition\n console.log(navigator.geolocation.getCurrentPosition(showPosition));\n }\n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "function getBrowserLocation() {\n let deferred = $q.defer()\n navigator.geolocation.getCurrentPosition(deferred.resolve)\n return deferred.promise\n}", "function getLocation() {\n return (0, _property.get)(\"guzzlrQuestLocation\");\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function getLocationHref() {\n try {\n return WINDOW.document.location.href;\n } catch (oO) {\n return '';\n }\n}", "function getLocation()\n {\n if (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(setPosition);\n }\n else{alert(\"Geolocation is not supported by this browser.\");}\n }", "function obtainLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(locationSuccess, locationError);\n\t} else {\n\t\talert(\"Geolocation is not supported by this browser.\");\n\t}\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else { \n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getLocation(){\n\tvar geolocation = navigator.geolocation;\n\t\tconsole.log(geolocation);\n\tgeolocation.getCurrentPosition(showLocation,errorHandler);\n\tconsole.log(geolocation);\n}", "location() {\n return __awaiter(this, void 0, void 0, function* () {\n const location = yield (yield this.element()).getLocation();\n const point = new point_1.Point(location.x, location.y);\n return point;\n });\n }", "constructor( /** EpaWindow */ loc )\n {\n this.loc = loc;\n }", "function getLocation(){\r\n\t\r\n\t if (navigator.geolocation){\r\n\t\t navigator.geolocation.getCurrentPosition(setPosition);\r\n\t }\r\n\t \r\n\t else{\r\n\t\talert(\"Geolocation is not supported by this browser.\");\r\n\t }\r\n\t}", "function getLocation() {\n navigator.geolocation.getCurrentPosition(function(position) {\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n console.log('lat =' + lat + ', lon =' + lon);\n });\n }", "function gnc_getLocation() {\n var fakeLocation = {};\n for (property in location) {\n switch (property) {\n case 'assign':\n fakeLocation[property] = function(uri) {\n if (!uri.length) {\n return;\n }\n\n var url = new URL(location);\n try {\n url = new URL(uri);\n } catch(e) {\n url = new URL(location);\n url.pathname =\n location.pathname.\n slice(0, location.pathname.lastIndexOf('/') + 1) + uri;\n url.search = '';\n }\n\n if (url.origin !== location.origin ||\n url.pathname !== location.pathname ||\n url.port !== location.port) {\n window.parent.postMessage({ type: 'host-navigate',\n url: decodeURIComponent(url.href) },\n '*');\n return;\n }\n\n location.assign(uri);\n };\n break;\n\n case 'href':\n Object.defineProperty(fakeLocation, property, {\n enumerable: true,\n get: function() { return location.href; },\n set: function(uri) { this.assign(uri); }\n });\n break;\n\n default:\n fakeLocation[property] = location[property];\n }\n }\n\n return fakeLocation;\n}", "function getLocation() {\n\tvar options = {\n\t\tenableHighAccuracy: true,\n\t\tmaximumAge: 30000,\n\t\ttimeout: 5000\n\t};\n\t\n\tif (window.navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(successCallback, errorCallback, options);\n\t} else {\n\t\talert('The browser does not natively support geolocation.');\n\t}\n}", "function getLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else {\n alert(\"Your browser doesn't support locations feature\");\n }\n}", "get _location() {return this._p.location;}", "get _location() {return this._p.location;}", "function getLocation() {\n if (navigator.geolocation) {\n console.log(\"Geo Location enabled\");\n navigator.geolocation.getCurrentPosition(success, error, options);\n } else {\n console.log(\"Geo Location not supported by browser\");\n }\n }", "function getAutoLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setCoords, showAutoLocError);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "function getCurrentPosition() {\n return $._getCurrentPosition();\n}", "function queryLocation() {\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(position => {\n location = position.coords;\n resolve(location);\n }, error => {\n AppError(error).displayError(); \n reject(error);\n });\n });\n }", "function getCurrentLocation() {\n // var location;\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(pos) {\n var location = {\n lat: pos.coords.latitude,\n lng: pos.coords.longitude\n };\n\n return location;\n }, handleError);\n } else {\n displayErrorMessage(\"Geolocation failed, using default coordinates.\");\n return defaultCoords;\n }\n\n function handleError(error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n displayErrorMessage(\"User denied the request for Geolocation.\");\n break;\n case error.POSITION_UNAVAILABLE:\n displayErrorMessage(\"Location information is unavailable.\");\n break;\n case error.TIMEOUT:\n displayErrorMessage(\"The request to get user location timed out.\");\n break;\n case error.UNKNOWN_ERROR:\n displayErrorMessage(\"An unknown error occurred.\");\n break;\n }\n }\n}", "function mapWindowLocation() {\n\n var path;\n var pathname = window.location.pathname;\n var index = pathname.indexOf(\"/hybrid/\");\n if (index >= 0 && pathname.length > index + 8) {\n path = pathname.substring(index + 7);\n index = path.indexOf(\"#\");\n if (index > 0) {\n path = path.substr(0, index);\n }\n } else {\n path = location.hash.substring(1);\n }\n\n return mapPath(path);\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n alert(\"GeoLocation is not supported on your Browser\");\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, showLocationError);\n \n } else { \n showMessage('Cannot acquire location','Geolocation is not supported by this browser.');\n ga('send', 'event', mode + '-getLocation', 'failure', 'failure');\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n let newLocation = navigator.geolocation.getCurrentPosition(function (\n position\n ) {\n lat = position.coords.latitude;\n long = position.coords.longitude;\n console.log(position);\n console.log(lat);\n console.log(long);\n });\n }\n}", "function getLocation() {\n\tif(navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(geoPosition, geoError, {enableHighAccuracy:true, timeout:30000, maximumAge:60000 }\n);\n\t} else {\n\t\tgeoError();\n\t}\n}", "function _getLocation() {\n if (navigator.geolocation) {\n App.Modules.GPS.state=STATES.ON;\n navigator.geolocation.getCurrentPosition(_getLocation_return);\n } else {\n App.Modules.GPS.state=STATES.NOT_SUPPORTED;\n _dispatchUpdateCallbacks( );\n }\n }", "get location() { return this.box.innerHTML }", "function getGeoLocation() {\n try {\n if (!!navigator.geolocation)\n return navigator.geolocation;\n else\n return undefined;\n }\n catch (e) {\n return undefined;\n }\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(storePosition);\n } else { \n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "function getcurentposition() {\n\tnavigator.geolocation.getCurrentPosition(GeoOnSuccess, GeoOnError, {enableHighAccuracy: true});\n}", "function obtainGeolocation(){\n window.navigator.geolocation.getCurrentPosition(localitation);\n }", "function getLocation() {\r\n\t if (navigator.geolocation) {\r\n\t navigator.geolocation.getCurrentPosition(setPosition);\r\n\t } else { \r\n\t alert(\"Geolocation is not supported by this browser.\");\r\n\t }\r\n\t}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getCoordinates);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(recordPosition);\n } else { \n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n var geoObject = navigator.geolocation.watchPosition(showPosition,\n handleError,options = {\n enableHighAccuracy: true\n }\n );\n }\n}", "function getLocation(location) {\n lat = location.coords.latitude;\n lng = location.coords.longitude;\n }", "get _location() {\n if (this._file)\n return this._file.path;\n\n if (this._uri)\n return this._uri.spec;\n\n return \"\";\n }", "function getUserLocation() {\n return new Promise(function(resolve, reject) {\n navigator.geolocation.getCurrentPosition(\n pos => {\n resolve(pos);\n },\n err => {\n reject(err);\n }, {\n timeout: 5000\n }\n );\n });\n}", "function markerLocation() {\n\t\t\t//Get location.\n\t\t\tvar currentLocation = marker.getPosition();\n\t\t\t//Add lat and lng values to a field that we can save.\n\t\t\tfrm.set_value(\"latitude\", currentLocation.lat()); //latitude\n\t\t\tfrm.set_value(\"longitude\", currentLocation.lng()); //longitude\n\t\t}", "function getGEOLocation(){\n if(Modernizr.geolocation)\n navigator.geolocation.getCurrentPosition(geoSuccess, geoError, {timeout:10000,enableHighAccuracy:true});\n else\n geoFallback();\n}", "function getLocationHref() {\n try {\n return WINDOW$6.document.location.href;\n } catch (oO) {\n return '';\n }\n }", "function getMapPosition()\n {\n return {\n center: ol.proj.toLonLat(map.getView().getCenter()),\n zoom: map.getView().getZoom()\n };\n }", "function getLocation() {\r\n\tif(navigator.geolocation) {\r\n\t\tnavigator.geolocation.getCurrentPosition(storePosition);\r\n\t} else {\r\n\t\t$('#location').html('Not supported.');\r\n\t}\t\t\r\n}" ]
[ "0.7135316", "0.648938", "0.6483093", "0.64668214", "0.645223", "0.645223", "0.645223", "0.6387621", "0.6378854", "0.6374205", "0.63673174", "0.6292917", "0.6246053", "0.61984664", "0.6196415", "0.619536", "0.6194755", "0.6188552", "0.61591405", "0.6143732", "0.6121506", "0.6121506", "0.6113446", "0.6096169", "0.6094852", "0.6094146", "0.60883594", "0.60873044", "0.6067043", "0.6056531", "0.6024361", "0.60175186", "0.60162914", "0.6010194", "0.6010194", "0.5977248", "0.59556305", "0.5952868", "0.59335", "0.5928668", "0.5918342", "0.5909925", "0.5901129", "0.5889574", "0.5844318", "0.5806927", "0.5792553", "0.57904345", "0.57648104", "0.57554054", "0.57490855", "0.5747898", "0.5735943", "0.5714512", "0.56918687", "0.56704295", "0.5662588", "0.566244", "0.5652777", "0.5652517", "0.5650111", "0.5646837", "0.56464833", "0.5645566", "0.56277907", "0.5597464", "0.5589518", "0.55880755", "0.55838543", "0.55788326", "0.5577919", "0.5577919", "0.55502504", "0.5548431", "0.55476654", "0.55476505", "0.5545563", "0.5544", "0.5539957", "0.55385476", "0.5529404", "0.55265784", "0.55199933", "0.5510413", "0.5503842", "0.5503634", "0.54973876", "0.5489473", "0.5488683", "0.54855144", "0.54761773", "0.5470571", "0.54622173", "0.5461558", "0.5453373", "0.5443545", "0.5440327", "0.5437622", "0.5433102", "0.5427291" ]
0.630214
11
Loads a HTML page Put the content of the body tag into the current page. Arguments: url of the other HTML page to load id of the tag that has to hold the content
function loadHTML(url, fun, storage, param) { var xhr = createXHR(); xhr.onreadystatechange = function () { if (xhr.readyState == 4) { //if(xhr.status == 200) { storage.innerHTML = getBody(xhr.responseText); fun(storage, param); } } }; xhr.open("GET", url, true); xhr.send(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LoadIntoId(url, id)\n{\n\t// Set default\n\tid = id || \"page_area\";\n\t\n\tvar page_area = document.getElementById(id);\n\t\n\tpage_area.innerHTML = read_contents(url);\n\t\n\t// Scroll to the top of the page\n\tdocument.body.scrollTop = document.documentElement.scrollTop = 0;\n}", "function LoadPage(url, id)\n{\n\tparent.location.hash = url;\n\tLoadIntoId(url, id);\n}", "function addHtml(url) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n finalHtml= xhttp.responseText;\n }\n };\n xhttp.open(\"GET\",url, false);\n xhttp.send();\n}", "function loadpage(page_request, containerid){\r\n\tif (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf(\"http\")==-1))\r\n\t\tdocument.getElementById(containerid).innerHTML=page_request.responseText;\r\n}", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "function loadUrl(newUrl) {\n fetch(newUrl)\n .then(response => {\n if(response.ok)\n return response.text();\n throw new Error('Network response was not ok.',response);\n })\n .then(text => new DOMParser().parseFromString(text, \"text/html\"))\n .then(doc => {\n if (doc === null) return;\n\n var newContent = doc.getElementById(\"mainContent\");\n var elemLanguage = doc.getElementById(\"mainmenu\");\n if (newContent === null || elemLanguage === null) {\n console.log(\"elements missing!\")\n return;\n }\n\n document.title = doc.title;\n document.getElementById(\"mainContent\").replaceWith(newContent);\n document.getElementById(\"mainmenu\").replaceWith(elemLanguage);\n\n document.dispatchEvent(new Event('MainContentChanged'));\n\n location.hash = newUrl.hash;\n\n var elem = (newUrl.hash) ? document.getElementById(newUrl.hash.replace(\"#\",\"\")) : null;\n if (elem)\n elem.scrollIntoView({ behavior: 'smooth' });\n else\n window.scroll({ top: 0, left: 0, behavior: 'smooth' });\n }).catch(function(error) {\n console.log('Fetch failed', error);\n window.location.href = \"/404.html\"\n });\n}", "function loadPage(href, history) {\n const pathName = getPathName(href);\n const { template, title, type } = routes[pathName];\n\n // already here, nothing to do\n if (!history && pathName === window.location.pathname) return;\n\n // render page content html\n renderContent(template, html => {\n\n // get full page title string\n const pageTitle = `Robert Dale Smith | ${title}`;\n\n // update history state only on loads not coming from browser back/forward\n if (!history) window.history.pushState({ pathName, pageTitle }, pageTitle, `${pathName}`);\n\n // update the page title\n document.title = pageTitle;\n\n // update content html\n document.querySelector('.content').innerHTML = html;\n\n // scroll to top of page/content\n if (!history) {\n if (pathName === '/') {\n // scrolls to top of home page\n document.scrollingElement.scrollTo(0, 0);\n } else {\n // scrolls to top of new page content and offset a bit\n const y = document.querySelector('.content').offsetTop;\n document.scrollingElement.scrollTo(0, y - 24);\n }\n }\n\n // set page type class\n document.querySelector('.page').className = `page ${type}`;\n\n // bind new viewer images\n viewer.bindImages('.thumbnail');\n\n // bind new page links\n bindLinks();\n\n // track page view\n ga.pageView(pathName);\n });\n}", "function mergeHtml(url) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n html= xhttp.responseText;\n }\n };\n xhttp.open(\"GET\",url, false);\n xhttp.send();\n}", "loadPage(){\n\t\tsuper.loadPage('https://www.google.com');\n\t}", "function setContent(contentUrl) {\n\n $(document).ready(function () {\n\n $('#Main2-container').load(contentUrl);\n\n });\n\n //window.scrollTo(0, 0); //move the view back to the top of the window\n}", "function pageLoader(page) {\n\t\t$.ajax({\n\t\t url: \"http://localhost/Personal/static-single-page-site/\" + page + \".html\",\n\t\t success: function(data){\n\t\t \t$(\"#page-data\").html();\n\t\t \t$(\"#page-data\").html(data);\n\t\t \twindow.history.replaceState({}, page, \"main.html?page=\"+ page )\n\t\t\t}\n\t\t});\n\t}", "function loadPage(path){\r\n return fetchPath(path).then(parseHtml)\r\n}", "function loadPage(id){\n\treturn new Promise(function(resolve, reject){\n\t\tvar url = 'https://land-book.com/websites/'+id;\n\t\trequest(url,function(err,resp,body){\n\t\t\t\tvar pageObject = parseBody(id,body);\n\t\t\t\tresolve(pageObject);\n\t\t});\n\n\t});\n}", "function loadContent() {\n $.ajax({\n url: 'ajax-get-page-content',\n type: 'GET',\n data: $data,\n beforeSend: function() {},\n success: function(response) {\n $('div#main-content').html(response);\n location.hash = $data.page || '';\n },\n complete: function(response) {\n loadModuleScript();\n }\n });\n }", "function loadHTML() {\n $('#ajax-example').load('content/content.html');\n }", "function insertHTML(sourceURL, destTag) {\n let target = document.querySelector(destTag);\n\n ///Getting data from the html files and injecting it to page.\n let XHR = new XMLHttpRequest();\n XHR.addEventListener(\"readystatechange\", function() {\n if (this.status === 200) {\n if (this.readyState === 4) {\n target.innerHTML = this.responseText;\n //setActiveNavLink();\n }\n }\n });\n XHR.open(\"GET\", sourceURL);\n XHR.send();\n }", "function loadHtml(url,target){\r\n var args = '';\r\n if(url.split(\"?\")[1]){\r\n args = '<div id=\\'args\\' style=\\'display: none;\\' data-args=\\''+url.split(\"?\")[1]+'\\'></div>';\r\n }\r\n $.ajax({\r\n type: \"get\",\r\n url: url,\r\n dataType: \"html\",\r\n async: false,\r\n success: function (data) {\r\n $(target).html(args+data);\r\n }\r\n });\r\n}", "function getPageHTML() {\n let language = getLanguage()\n // get all the server-rendered html in our desired language\n $.ajax({\n beforeSend: console.log('getting html for language...'),\n url: '/getHtml',\n type: 'POST',\n data: { language },\n success: (data) => {\n if (data.err) {\n console.error('Error getting html!')\n } else {\n $('#full-page').html(data)\n // now we load the rest of the site\n GetRestOfSiteData()\n }\n },\n complete: (xhr, status) => {\n if (status == 'error') {\n $('#full-page').html(xhr.responseText)\n }\n },\n })\n}", "function load_page(page,id){\n $('#'+id).load(page);\n}", "function changePage() {\n const url = window.location.href;\n const main = document.querySelector('main');\n loadPage(url).then((responseText) => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = responseText;\n const oldContent = document.querySelector('.mainWrapper');\n const newContent = wrapper.querySelector('.mainWrapper');\n main.appendChild(newContent);\n animate(oldContent, newContent);\n });\n }", "function load_products_page( url ) {\r\n\t\t\t// show loading\r\n\t\t\t$loading.css( 'display', 'block' );\r\n\r\n\t\t\t// get new page\r\n\t\t\t$.get( url, function( response, status, request ) {\r\n\t\t\t\t// hide loading\r\n\t\t\t\t$loading.css( 'display', 'none' );\r\n\r\n\t\t\t\t// check response status first\r\n\t\t\t\tif ( status == 'success' && request.status == 200 ) {\r\n\t\t\t\t\tvar $new_content = $( response ).find( '#wct-design-wizard .wct-products .products-wrapper' );\r\n\t\t\t\t\tif ( $new_content.length ) {\r\n\t\t\t\t\t\t// fill in new content\r\n\t\t\t\t\t\t$products_wrapper.html( $new_content.html() );\r\n\t\t\t\t\t\tlightbox_setup();\r\n\r\n\t\t\t\t\t\t// scroll\r\n\t\t\t\t\t\tanimate_scroll_to( $wizard, 20 );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} );\r\n\t\t}", "function LoadPage(page_name) {\n $('#content').load('./' + page_name + '.html');\n}", "function load(dom, url, source_dom=false)\n{\n let xml_http = new XMLHttpRequest(), content, content_process;\n xml_http.onreadystatechange = function()\n {\n if (xml_http.readyState === 4 && xml_http.status === 200)\n {\n content = xml_http.responseText;\n if(source_dom)\n {\n content_process = document.createElement(\"div\"),\n content_process.innerHTML = content,\n content_process.id = \"content_process\",\n content_process.style.display = \"none\",\n content = content_process.querySelector(source_dom).outerHTML\n }\n dom.innerHTML = content;\n }\n };\n xml_http.open(\"GET\", url, true);\n xml_http.send(null);\n}", "function loadContent(id){\n let locationData = \"pages/\" + id + \".html\"\n let getData = new XMLHttpRequest();\n getData.onreadystatechange = function(){\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"main-display\").innerHTML = this.responseText;\n updateData(id)\n tabTracker = id \n /* Close details tab if left opened */\n closeTask()\n }\n }\n getData.open(\"GET\", locationData, true);\n getData.send();\n}", "function loadHtml(document, iframe, htmlSpec, callback) {\n var targetWindow = iframe.contentWindow;\n document.addEventListener(\"DOMWindowCreated\", function(event) {\n var window = event.target.defaultView.wrappedJSObject;\n if (window != targetWindow) {\n return;\n }\n document.removeEventListener(\"DOMWindowCreated\", arguments.callee, false);\n\n prepareWindow(window);\n }, false);\n\n if (callback) {\n iframe.addEventListener(\"DOMContentLoaded\", function(event) {\n iframe.removeEventListener(\"DOMContentLoaded\", arguments.callee, false);\n callback();\n }, false);\n }\n\n iframe.webNavigation.loadURI(htmlSpec, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);\n}", "function pageLoad() {\n\t\t\t\t\twindow.location.assign(\"blue.html\");\n\t\t\t\t}", "function loadContent(id,get){\n\t\tget=get||'';\n\t\tvar i,len=c.length,cont;\n\t\tconsole.log('loadcontent id: '+id+get);\n\t\tif($('container').data('id')==id+get) return;\n\t\tfor(i=0;i<len&&!cont;i++){\n\t\t\tif($(c[i]).data('id')==id+get) cont=c.splice(i,1)[0];\n\t\t}\n\t\tif(cont){\n\t\t\tconsole.log('loaded cached page. id: '+$(cont).data('id'));\n\t\t\tchangeContainer(cont);\n\t\t}else{\n\t\t\tvar url='view.php?pageid='+id+get.replace('#','%23');\n\t\t\tconsole.log('loading page: '+url);\n\t\t\tlc_url=url;\n\t\t\t//$('#btnTourActive').hide();\n\t\t\t$$.ajax({\n\t\t\t\ttype:'POST',\n\t\t\t\turl:url,\n\t\t\t\tdataType:'html',\n\t\t\t\tsuccess:function(data){\n\t\t\t\t\tif(lc_url==url){\n\t\t\t\t\t\tif(data=='404')\n\t\t\t\t\t\tif(isLogged()){\n\t\t\t\t\t\t\tconsole.log('wrong');\n\t\t\t\t\t\t\tif($.local('enableLogs'))\n\t\t\t\t\t\t\t\tdata='Error 404. Page not found.';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\thistoryBack();\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t\treturn loadContent('home');\n\t\t\t\t\t\tif(data!='404'){\n\t\t\t\t\t\t\twindow.lastPage=data;\n\t\t\t\t\t\t\tif(!data.match(/<container/i)) data='<container>'+data+'</container>';\n\t\t\t\t\t\t\tchangeContainer(data,id+get);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function loadThePage(url) {\n const options = {\n uri: url,\n transform: function (body) {\n return cheerio.load(body);\n }\n };\n\n return request(options);\n}", "function loadPage$1(_ref, done) {\n\t var page = _ref.page,\n\t parent = _ref.parent,\n\t _ref$params = _ref.params,\n\t params = _ref$params === undefined ? {} : _ref$params,\n\t replace = _ref.replace;\n\t\n\t internal$1.getPageHTMLAsync(page).then(function (html) {\n\t if (replace) {\n\t util.propagateAction(parent, '_destroy');\n\t parent.innerHTML = '';\n\t }\n\t\n\t var element = util.createElement(html.trim());\n\t parent.appendChild(element);\n\t\n\t done({\n\t element: element,\n\t unload: function unload() {\n\t return element.remove();\n\t }\n\t });\n\t });\n\t}", "function ShowPage(pUrl) {\n ShowLoading(true);\n GetPage(pUrl, \n function(pResponse) {\n $('#page').html(pResponse);\n AttachLinkEvents();\n ShowLoading(false);\n CurrentPage = pUrl;\n var anchor = pUrl.hash;\n if(anchor) {\n document.location.hash = anchor;\n }\n }\n ,\n function() {\n ShowLoading(false); \n alert('Error communicating with the server, please try again');\n }\n );\n}", "function loadPage(page, title) {\n console.log(page + \" \" + title);\n var activePage = $.mobile.pageContainer.pagecontainer(\"getActivePage\");\n $.get(page, function (data) {\n $(\"#content\", activePage).html(data).enhanceWithin();\n $(\"#titlepage\").html(title);\n });\n }", "function loadPage(url, get = {}, post = {}, options = {}) {\n\toptions = {\n\t\t...{\n\t\t\tfill_main: true,\n\t\t\tcache: true\n\t\t},\n\t\t...options\n\t};\n\n\t// Ci sono casi in cui non è possibile cachare il template\n\tif (currentPageDetails.type === 'Custom' || Object.keys(post).length)\n\t\toptions.cache = false;\n\n\tif (options.fill_main) {\n\t\tif (!checkBeforePageChange())\n\t\t\treturn false;\n\n\t\tclearMainPage();\n\n\t\tpageLoadingHash = url + JSON.stringify(get) + JSON.stringify(post);\n\t}\n\n\tlet cacheKey = url + '?' + queryStringFromObject(get);\n\n\treturn (new Promise((resolve, reject) => {\n\t\tif (options.cache) {\n\t\t\tif (cachedPages.get(cacheKey))\n\t\t\t\treturn resolve(cachedPages.get(cacheKey));\n\t\t}\n\n\t\tajax(url, get, post).then(resolve).catch(reject);\n\t})).then((function (hash) {\n\t\treturn function (response) {\n\t\t\tif (options.fill_main && hash !== pageLoadingHash)\n\t\t\t\treturn false;\n\n\t\t\tif (options.cache)\n\t\t\t\tcachedPages.set(cacheKey, response);\n\n\t\t\tif (options.fill_main) {\n\t\t\t\t_('main-loading').addClass('d-none');\n\t\t\t\t_('main-content').jsFill(response);\n\n\t\t\t\tif (window.resetAllInstantSearches)\n\t\t\t\t\tresetAllInstantSearches();\n\n\t\t\t\tresize();\n\t\t\t\treturn changedHtml().then(() => {\n\t\t\t\t\treturn response;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t})(pageLoadingHash));\n}", "function loadPage( targetUrl ) {\n\tvar persistenceOn = jQuery( 'body.loadsaved' ).length;\n\tif ( jQuery( 'body' ).hasClass( 'ajax-on' ) ) {\n\t\tjQuery( 'body' ).append( '<div id=\"progress\"></div>' );\n\t\tjQuery( '#progress' ).viewportCenter();\n\t\tjQuery( document ).unbind();\n\t\tjQuery( '#outer-ajax' ).load( targetUrl + ' #inner-ajax', function( allDone ) {\n\t\t\tjQuery( '#progress' ).addClass( 'done' );\n\t\t\tif ( persistenceOn ) {\n\t\t \t\tWPtouchCreateCookie( 'wptouch-load-last-url', targetUrl, 365 );\n\t\t\t} else {\n\t\t\t \tWPtouchEraseCookie( 'wptouch-load-last-url' );\t\n\t\t\t}\n\t\t\tdoClassicReady();\n\t\t\tscrollTo( 0, 0, 100 );\n\t\t});\n\t} else {\n\t\tjQuery( 'body' ).append( '<div id=\"progress\"></div>' );\n\t\tjQuery( '#progress' ).viewportCenter();\n\t\tif ( persistenceOn ) {\n\t \t\tWPtouchCreateCookie( 'wptouch-load-last-url', targetUrl, 365 );\n\t\t}\n\t\tsetTimeout( function () { window.location = targetUrl; }, 550 );\n\t}\n}", "function htmlLoad() {\n}", "function loadPage(_ref, done) {\n var page = _ref.page,\n parent = _ref.parent,\n _ref$params = _ref.params;\n\n internal$1.getPageHTMLAsync(page).then(function (html) {\n var pageElement = util$1.createElement(html);\n parent.appendChild(pageElement);\n\n done(pageElement);\n });\n}", "function loadContent(_targetKey){\r\n\t$.ajax({\r\n\t\turl:'pages/'+_targetKey+'.html',\r\n\t\tcache:false,\r\n\t\tsuccess:function(data){\r\n\t\t\t$('.content').empty();\r\n\t\t\t$('.content').html(data);\r\n\t\t}\r\n\t});\r\n}", "function loadContent(loadURL, target, callback) {\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : loadURL,\n\t\tcache : false,\n\t\tsuccess : function(returndata) {\n\t\t\tif (target) {\n\t\t\t\t$(target).html(returndata);\n\t\t\t}\n\t\t\tif (callback) {\n\t\t\t\tsetTimeout(callback, 15, target, returndata);\n\t\t\t}\n\t\t}\n\t});\n}", "buildContentPage(url)\n {\n let ph = this.pageHandlers[url];\n if(!ph)\n {\n app.error(\"no page handler for \" + url);\n this._loadHtml(`<div class=\"ERROR\">No Page Handler for ${url}</div>`);\n }\n else\n {\n ph.buildPage(this._loadHtml.bind(this));\n }\n return ph;\n }", "function includeAndReplace(tag, url) {\n\t\ttag.innerHTML = \"Loading...\";\n\n\t\tvar xhr = getXHRObject();\n\t\txhr.open(\"GET\", url, true);\t\t// false == synchronous\n\t\txhr.onload = function() {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tsetOuterHTML(tag, xhr.responseText);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\txhr.send(null);\n\t\t} catch (e) {\n\t\t\ttag.innerHTML = \"Error loading page \"+url\n\t\t}\n\t\t\n\t}", "function updateContent(url){\n\t\t$('#container').remove();\n\t\t$('#content').load(url + ' #container').hide().fadeIn('700');\n\t}", "function loadDemoPage_1 () {\n console.log ('\\n ====== loadDemoPage_1 ..3 =======\\n');\n\n \n fetch ('https://jsonplaceholder.typicode.com')\n // input = the fetch reponse which is an html page content\n // output to the next then() ==>> we convert it to text\n .then (response => response.text())\n // input text, which represnts html page\n // & we assign it to the page body\n .then (htmlAsText => {\n document.body.innerHTML = htmlAsText;\n });\n}", "function loadPage(page) {\n let urlTeamParameter = window.location.hash.substr(9);\n const xhr = new XMLHttpRequest();\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n const content = document.querySelector('#body-content');\n\n // ngecek page nya\n if (page === 'ligaIng') {\n getStandingIng();\n } else if (page === 'ligaJer') {\n getStandingJer();\n } else if (page === 'ligaSpn') {\n getStandingSpn();\n } else if (page === 'ligaPrc') {\n getStandingPrc();\n } else if (urlTeamParameter.length > 0) {\n getTeamsByID();\n urlTeamParameter = '';\n } else if (page === 'saved') {\n getSavedTeams();\n }\n\n // perkondisian status XMLHttpRequest\n if (xhr.status === 200) {\n content.innerHTML = xhr.responseText;\n } else if (xhr.status === 404) {\n content.innerHTML = '<p>Halaman tidak ditemukan.</p>';\n } else {\n content.innerHTML = '<p>Ups.. halaman tidak dapat diakses.</p>';\n }\n }\n };\n if (\n page === 'ligaIng'\n || page === 'ligaJer'\n || page === 'ligaSpn'\n || page === 'ligaPrc'\n ) {\n xhr.open('GET', '/pages/standings.html', true);\n xhr.send();\n } else if (urlTeamParameter.length > 0) {\n xhr.open('GET', '/pages/teams.html', true);\n xhr.send();\n } else if (page === 'saved') {\n xhr.open('GET', '/pages/saved.html', true);\n xhr.send();\n } else {\n xhr.open('GET', `pages/${page}.html`, true);\n xhr.send();\n }\n}", "function loadPage( url ){\n\tif(url == null){\n\t\t//home page first call\n\t\tpages[0].style.display = 'block';\n\t\thistory.replaceState(null, null, \"#home\");\t\n\t}else{\n \n for(var i=0; i < numPages; i++){\n if(pages[i].id == url){\n pages[i].style.display = \"block\";\n history.pushState(null, null, \"#\" + url);\t\n }else{\n pages[i].style.display = \"none\";\t\n }\n }\n for(var t=0; t < numLinks; t++){\n links[t].className = \"\";\n if(links[t].href == location.href){\n links[t].className = \"activetab\";\n }\n }\n\t}\n}", "static async loadPage(url){\n const response = await fetch(url);\n const data = await response.text();\n // fs.writeFileSync(\"debug.html\", data);\n return {\n $: cheerio.load(data),\n html: data\n };\n }", "function loadElementHtml(element, url, callback = undefined) {\n $$.get(url, undefined, function (data) {\n $$(element).html(data);\n if (typeof callback !== 'undefined') { callback(); }\n });\n}", "function loadPage(path, anchor) {\n $('div.non-sidebar').load(path, function () {\n formatPage();\n goToAnchor(anchor);\n });\n }", "function gethtm(url, id, is) {\n var doc = $(\"#\"+id);\n load(id);\n var xmlhttp = false;\n if (doc != null) {\n doc.css(\"visibility\",\"visible\");\n if (doc.css(\"visibility\") == \"visible\") {\n\t\t\t$.ajax({\n\t\t\t\ttype:'GET',\n\t\t\t\turl:url,\n\t\t\t\tdataType:'html',\n\t\t\t\t//ifModified:true,\n\t\t\t\ttimeout:90000,\n\t\t\t\tsuccess: function(s){\n if (is || is == null) {\n doc.html(s);\n } else {\n var data = {};\n data = eval('(' + s + ')');\n doc.html(data.main);\n eval(data.js);\n };\n\t\t\t\t}\n\t\t\t});\n }\n }\n}", "async function loadContent(id) {\n console.log(`Loading content for id=${id}`);\n let response = await fetch(`${window.location.origin}/${id}.html`);\n try {\n if (response.ok) {\n let content = await response.text();\n document.querySelector(\"#main\").innerHTML = content;\n if (id == \"pedidos\") {\n initOrders();\n } \n } else {\n console.log(\"Error loading\" + id);\n }\n } catch(error) {\n console.log(error);\n } \n }", "function OpenwebPage(url) {\n setWEBPAGEURL(url)\n setOpenWebPage(true)\n }", "function getPageContent(url) {\n return new Promise((resolve, reject) => {\n request(url, (err, res, body) => {\n if (!err) {\n resolve(body);\n } else {\n reject(err);\n }\n });\n });\n}", "function WBU_LoadPartPage(url, block=''){\n var $div = $('<div>');//// Creation d'une div en memoire \n var $html = $('<section>');\n var result = $div.load(url+' '+block, function( response, status, xhr ){\n $html.html($(this).html()); \n console.log(this);\n console.log($(this).html());\n console.log(response);\n console.log(status);\n console.log(xhr);\n console.log($div);\n //return ($(this).html());\n });\n if(result && result.length > 0){\n return $html.html();\n }\n }", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "function loadPage(htmlId, variables) {\n const str = document.getElementById(htmlId, variables).innerHTML;\n document.getElementById(\"element\").innerHTML = Handlebars.compile(str)(\n variables\n );\n}", "function viewCompany_page() {\r\n\t$(document).ready(function() {\r\n\t\t$('#content').load('html_files/company_html/viewCompany.html');\r\n\t});\r\n\t\r\n\t$(document).ready(function() {\r\n\t\tviewCompany();\r\n\t});\r\n}", "function addPage(page){\r\n $(\"#\" + page + \"Page\").remove();\r\n var t = '<div class=\"page\" id=\"'+ page + 'Page\" style=\"display: none;\"></div>';\r\n $(t).appendTo(\"body\");\r\n $(\"#\" + page + \"Page\").load(page + \".html\");\r\n}", "function loadPage (pageName, putWhere, callBack) {\n\t// don't laugh at this ...\n\tvar putHere = putWhere\n\t// show page Loader\n\tpageLoader.show()\n\n\t// ajax call\n\n\t$.ajax({url:pageName, dataType: \"text\", accept: \"text/html\"}).done( function( data ) {\n\t\t// remove loader\n\t\tpageLoader.hide()\n\t\tlastUrl = location.href\n\t\t// insert the data gotten\n\t\tif ($(putHere).text() !== data) {\n\t\t\t$(putHere).html(\"\")\n\t\t\t$(putHere).html(data)\n\t\t\t//pushHistory(pageName)\n\t\t}\n\n\n\n\t\t// run the callBack funtion if there is one\n\t\tif (typeof(callBack) !== \"undefined\") {\n\t\t\tcallBack()\n\n\t\t}\n\n\t\t// load tooltip script\n\t\tif (isLoaded == false) {\n\t\t\tvar url = \"http://localhost/idv/assets/js/kawo-tooltip.js\"\n\t\t\t$.getScript(url)\n\t\t\tisLoaded = true;\n\t\t}\n\n\n\n\t\t// vital tool for setting all click listeners since page loades dynamically. We set the listeners when a new page is dynamically loaded\n\t\tsetClickListeners()\n\n\t})\n}", "function getContent(content, url) {\n $.ajax({\n type: 'GET',\n url: url,\n async: true,\n beforeSend: function () {\n $(content).html(string);\n },\n success: function (data) {\n $(content).html(data);\n },\n error: function () {\n $(content).html(string);\n }\n });\n}", "function embed_page(data) {\n $(\"#mainNav\").html(data);\n setTimeout(function() {\n loader();\n }, 0);\n}", "function loadURL(url, step)\n{\n\t// TODO:\n\tif (step)\n\t\tcounterDepth -= 1;\n\n\tURLToBeLoaded = url;\n\n\tcountcount = 0;\n\tpage.open(url);\n}", "function loadPage(url=\"\"){\n let app = document.getElementById(\"app\");\n app.style.opacity = \"0\";\n let preload = document.getElementById(\"spin-loader\");\n preload.style.display = \"flex\";\n preload.style.opacity = \"1\";\n\n if(!isEmpty(url)){\n loadUrl(url);\n }\n }", "function showContent(url) {\n\trequestContent(url).then(function (body) {\n\t\tvar content = parseContent(body);\n\t\tprintArticle(content);\n\t}, function () {\n\t\tconsole.log('Oops! Something went wrong!');\n\t});\n}", "function loadMyContent () {\n // do your page operations here\n}", "function includeHTmlFile(pageUrl) {\n if(pageId > 0) {\n $(\".pageView\").attr(\"include-html\", pageUrl+\".html\");\n $(\".pageView\").attr(\"id\", \"pageHTML\"+pageId);\n }\n \n $(\"*[include-html]\").each(function(){\n var t = $(this).attr(\"include-html\"),\n u = this.id;\n jQuery.ajax({\n url: t,\n success: function(t) {\n $(\"#\" + u).html(t)\n },\n error: function(n,c,i) {\n var s = n.status + \": \" + n.statusText;\n $(\"#\" + u).html(t + \"-\" + s)\n }\n })\n })\n \n}", "function loadAndPushDocument(url) {\n var loadingDocument = loadingTemplate();\n navigationDocument.pushDocument(loadingDocument);\n var request = new XMLHttpRequest();\n request.open(\"GET\", url, true);\n \n request.onreadystatechange = function() {\n if (request.readyState != 4) {\n return;\n }\n if (request.status == 200) {\n var document = request.responseXML;\n document.addEventListener(\"select\", handleSelectEvent);\n navigationDocument.replaceDocument(document, loadingDocument)\n }\n else {\n navigationDocument.popDocument();\n var alertDocument = alertTemplate();\n navigationDocument.presentModal(alertDocument);\n }\n };\n request.send();\n}", "function loadPageContent(page_id) {\n getStudents(page_id)\n .then(function (data) {\n setBody(data);\n setPagination(data, page_id);\n });\n}", "function ksfData_copyPageletInto(URI, targetID, executeOnLoading)\n{\n\tksfReq.fetch( \tURI,\n\t\t\t\t\tfunction(response)\n\t\t\t\t \t{\n\t\t\t\t \t\tvar pagelet = ksfData.pagelet(response);\n\t\t\t\t \t \t$(targetID).html(pagelet.body);\n\t\t\t\t \t \tif (executeOnLoading) {\n\t\t\t\t \t \t\texecuteOnLoading();\n\t\t\t\t \t \t}\n\t\t\t\t \t} );\n}", "async function getHTML(url){\n if(!url){\n throw new Error('URL is missing');\n }\n logger.info(`Starting scrape of ${url}`);\n\n /* Headless browser to get lazy load content */\n /* Note: should be using to get all images from NYT times page (fully loaded html not returning atm) */\n // const browser = await puppeteer.launch();\n // const page = await browser.newPage();\n // await page.goto(url, {waitUntil: 'load', timeout: 0});\n // const renderedContent = await page.evaluate(() => new XMLSerializer().serializeToString(document));\n // await browser.close();\n // return renderedContent;\n\n const options = {\n method: 'GET',\n url,\n headers: requestHeaders(),\n encoding: 'utf8', //some sites will require other encodings, so should load headers/encoding from host template\n };\n\n return await requestPromise(options);\n}", "function fetchPage(page) {\n /*fetchPage nome da função (parametros que quero receber (page)) */\n /* const cria uma constante (content) pode ser qualquer nome */\n const content = $(\"#mainContent\");\n fetch(page)\n /* Função do js (pegar) */\n .then((resp) => resp.text())\n .then((rawPage) => content.html(rawPage)); /* pegar page */\n}", "function getHtmlFromFile(url, callback) {\n $$.get(url, undefined, function (data) {\n callback(data);\n });\n}", "function fetch_content(id, url, cont) {\n var node = document.getElementById(id);\n read_from_url(url,\n function(responseText) {\n node.innerHTML = responseText;\n var undefined;\n if (cont != undefined) cont();\n },\n function(errmsg) {\n node.innerHTML = 'Could not read from ' + url +\n ': Error ' + req.status;\n });\n}", "function privateGetPage(url) {\n let dfd = jQuery.Deferred();\n\n jQuery.get(url, function() {\n\n })\n .done(function(data, status) {\n return dfd.resolve(data);\n });\n\n return dfd.promise();\n }", "function req_html(url) {\n return new Promise(function(fulfill, reject) {\n request(url, function(err, resp, html) {\n if (err) return reject(err);\n if (resp.statusCode !== 200 && resp.statusCode !== 201) {\n var err = new Error('Unexpected status code ' + resp.statusCode);\n err.res = resp;\n return reject(err);\n }\n fulfill(html);\n });\n });\n}", "function posthtm(url, id, verbs, is) { //is null or 1\n var doc = $(\"#\"+id);\n load(id);\n //\tdoc.innerHTML='<span><img src=\"image/load.gif\"/>Loading...</span>';\n var xmlhttp = false;\n if (doc != null) {\n doc.css(\"visibility\",\"visible\");\n if (doc.css(\"visibility\") == \"visible\") {\n\t\t\t$.ajax({\n\t\t\t\ttype:'POST',\n\t\t\t\tdata:verbs,\n\t\t\t\turl:url,\n\t\t\t\tdataType:'html',\n\t\t\t\t//ifModified:true,\n\t\t\t\ttimeout:90000,\n\t\t\t\tsuccess: function(s){\n if (is || is == null) {\n doc.html(s);\n } else {\n var data = {};\n data = eval('(' + s + ')');\n doc.html(data.main);\n eval(data.js);\n }\n\t\t\t\t}\n\t\t\t});\n }\n }\n}", "function loadPage(url) {\n if (url == null) {\n //home page first call\n pages[0].style.display = 'block';\n history.replaceState(null, null, \"#home\");\n } else {\n\n for (var i = 0; i < numPages; i++) {\n if (pages[i].id == url) {\n pages[i].style.display = \"block\";\n pages[i].className = \"active\";\n history.pushState(null, null, \"#\" + url);\n } else {\n pages[i].className = \"\";\n pages[i].style.display = \"block\";\n }\n }\n for (var t = 0; t < numLinks; t++) {\n links[t].className = \"\";\n if (links[t].href == location.href) {\n links[t].className = \"activetab\";\n }\n }\n }\n}", "function urlView(url) {\n CLS();\n clearline(0);\n iplot(0, 0, 'Loading '+url+' ...');\n let start = Date.now();\n wget(\n url,\n function(h, err, nid, url) {\n showPage(h, err, nid, url,\n\t Date.now()-start);\n });\n}", "function loaded(error, response, body) {\n // Check for errors\n if (!error && response.statusCode == 200) {\n // The raw HTML is in body\n res.send(body);\n } else {\n res.send(response);\n }\n }", "function pageLoad() {\n\t\t\t\t\twindow.location.assign(\"fly.html\");\n\t\t\t\t}", "function renderPage() {\r\n let html = addHtml();\r\n $('main').html(html);\r\n\r\n}", "function getPageHTML(url, callback) {\n\t\thttp.get(url, function (stream) {\n\t\t console.log(\"Got response: \" + res.statusCode);\n\t\t stream.pipe(bl(function (err, data) {\n\t\t \tif (err) {\n\t\t \t\treturn console.error(\"There was an error: \", err);\n\t\t \t}\n\t\t \tcallback(data.toString());\n\t\t }));\n\t\t}).on('error', function (err) {\n\t\t console.log(\"Got error: \" + err.message);\n\t\t});\n\t}", "function requestContent(filename) {\n $('main').load(filename);\n}", "function pageLoader(page, blogpost) {\n\t\t//console.log(page);\n\t\tblogpost = blogpost || \"\";\n\t\t$(\"#loading-icon\").show();\n\t\t$.ajax({\n\t\t url: \"./views/\" + page + \".html\",\n\t\t dataType: \"text\",\n\t\t success: function(data){\n\t\t \t$(\"#page-insertion\").html(data);\n\t\t \t$(\"#loading-icon\").hide();\n\t\t \t$(\"body\").attr(\"class\", $(\"#page\").attr(\"class\") );\n\t\t \t//console.log( $(\"#page\").attr(\"class\") );\n\t\t \t$(\"meta[property='og:url']\").attr(\"content\", window.location.href);\n\t\t \tdocument.body.scrollTop = 0;\n\t\t\t},\n\t error: function(errmsg1, errmsg2, errmsg3) {\n\t $(\"#loading-icon\").hide();\n\t console.log(errmsg1.status);\n\t console.log(errmsg2);\n\t console.log(errmsg3.message);\n\t pageLoader(\"home\");\n\t\t\t\treplaceState(\"home\");\n\t }\n\t\t});\n\t}", "function loadPage(){\n var target = document.getElementById('url').value;\n console.log(target);\n document.getElementById('iframePosition').src = target;\n}", "function loadToc(url ){\n\n var topic = top.frames[\"body\"].frames[\"content\"].location.href;\n topic = topic.substring(topic.lastIndexOf('/')+1,topic.indexOf('.htm'));\n top.frames[\"body\"].frames[\"toc\"].location.href=url+\"?item=\"+topic+\"&section=none\";\n}", "function retrievePage(url, options) {\n\t$.ajax(url, options);\n}", "function loadPage() {\n window.location.href = \"generatePage.html\";\n}", "function constructPage( url, settings, element ) {\n\n $.ajax({\n async: true,\n url: url,\n dataType: 'HTML',\n method: settings.navigation.options.method,\n data: settings.navigation.options.method,\n beforeSend: function() {\n\n $( 'body' ).addClass( 'loading' );\n\n //Call outside function\n settings.navigation.beforeCall.call('');\n\n },\n success: function( data ) {\n\n $( 'body' ).removeClass( 'loading' );\n\n let body = data.substring( data.indexOf(\"<body>\"), data.indexOf(\"</body>\") + 7 ),\n title = $( data ).filter('title').text(),\n scripts = getScripts( data, url );\n\n //Load asynchronous scripts in page\n let deferred = new $.Deferred(),\n promise = deferred.promise();\n\n for ( let i in scripts ) {\n\n (function () {\n\n promise = promise.then( function() {\n\n return loadScript( scripts[i] );\n\n });\n\n }());\n\n }\n\n deferred.resolve();\n\n //Construct page\n $( settings.navigation.options.appendTo ).html( body );\n\n //Update URL\n if( settings.navigation.options.urlUpdate ) history.pushState( body, title, url );\n\n //Update Title\n if( settings.navigation.options.titleUpdate ) $( document ).attr( 'title', title );\n\n //Call outsite function\n settings.navigation.onPageLoad.call('', element, url);\n\n },\n error: function( jqXHR, textStatus, errorThrown ) {\n\n //Call outside function\n settings.navigation.onError( jqXHR, textStatus, errorThrown );\n\n }\n });\n\n }", "function getDocHtml(url){\n \tvar xHttp = new XMLHttpRequest();\n \t/*\nonreadystatechange => Defines a function to be called when the readyState property changes*/\n \txHttp.onreadystatechange = function(){\n \t\tif(this.readyState == 4 && this.status == 200){\n \t\t\tdocument.getElementById('demo').innerHTML = this.responseText;\n \t\t\tconsole.log(xHttp.statusText);\n \t\t\t// responseText => Returns the response data as a string\n \t\t\t// responseXML => Returns the response data as XML data\n \t\t}\n \t};\n \t// \n// To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object:\n \txHttp.open('GET',url,true);\n \txHttp.send();\n }", "function craeteNewTabAndLoadUrl(parms, url, loadDivSelector) {\n //$(\"\" + loadDivSelector).html('<iframe frameborder=1 width=\"100%\" height=\"800\" src=\"'+url+'\">IFRAME</iframe>');\n $(\"\" + loadDivSelector).load(url, function (response, status, xhr) {\n if (status == \"error\") {\n var msg = \"Sorry but there was an error getting details ! \";\n $(\"\" + loadDivSelector).html(msg + xhr.status + \" \" + xhr.statusText);\n $(\"\" + loadDivSelector).html(\"Load Ajax Content Here...\");\n }\n });\n\n}", "function loadURL(target,title) {\n\t// show pageload message\n\tshowMessage(\"page\");\n\t\n\tExt.Ajax.request({\n\t\turl: \"com/parser.cfc\",\n\t\tparams: {method:\"loadPage\",returnformat:\"json\",target:target,title:title},\n\t\tsuccess: loadPage\n\t});\n\tExt.Ajax.request({\n\t\turl: \"com/comments.cfc\",\n\t\tparams: {method:\"getComments\",returnformat:\"json\",target:target,title:title},\n\t\tsuccess: loadComments\n\t});\n}", "_loadPage() {\n this._loadWithCurrentLang();\n\n let url = navigation.getCurrentUrl();\n if (url != '/') {\n navigation.navigatingToUrl(url, this.lang, this.DOM.pagesContent, false);\n }\n\n navigation.listenToHistiryPages(this.lang, this.DOM.pagesContent);\n }", "function _loadContent(href) {\n\t\tviewercontent.load(href, {}, _prepareText);\n\t}", "async function fetchHTML(url) {\n\tconst { data } = await axios.get(url) // get page using axios\n\treturn cheerio.load(data); // loads the DOM for parsing\n}", "function load_page(callback) {\n var page_url = window.document.location + 'page/' + page + '.yaws';\n $(\"#power_msg\").val('');\n $.get(page_url, function(data) {\n pageDiv.html(data);\n if (callback != undefined)\n callback();\n });\n}", "function LoadCurrentPage(){\n\t// The URL determines which page is fetched, in this case by ?view=<filename>\n\tvar view = getParameterByName('view');\n\tif (view) {\n\t\tLoadDiv('main',view,false);\n\t}\n\telse {\n\t\t// Default page\n\t\tLoadDiv('main','coding',false);\n\t}\t\t\t\n}", "function state (url, no_push) {\n $('#main').load(url+(url.indexOf('?')>0?'&':'?')+'_main');\n load_page_data(url);\n if (no_push !== 'no push') {\n history.pushState({}, undefined, url);\n }\n}", "function getHTML(loc, insertArea){\n\tajax(loc, \"GET\", function(){\n\t\tif(this.readyState == 4 && this.status == 200){\n\t\t\t// console.log(this.responseText);\n\t\t\tinsertArea.innerHTML = this.responseText;\n\t\t}\n\t});\n}", "function loadPageData() {\n\tvar cC = '#mw-content-text';\n\t$(cC).load(location.href + \" \" + cC + \" &gt; *\", function (data) {\n\t\tif (doRefresh) {\n\t\t\tajaxTimer = setTimeout(loadPageData, ajaxRefresh);\n\t\t}\n\t});\n}", "function getUrl(e) {\n e.preventDefault();\n url = e.target.href;\n console.log(url);\n // Call the function loadContent to load the \n // updated content:\n loadContent(url);\n \n}", "static getHtmlTemplate(url, id, callback) {\n console.log(id);\n $.ajax({\n type: 'GET',\n url: url,\n dataType: 'text',\n }).done((res) => {\n document.getElementById(id).innerHTML = res;\n });\n }", "function loadPageData() {\n\tvar cC = '#mw-content-text';\n\t$( cC ).load( location.href + \" \" + cC + \" > *\", function ( data ) {\n\t\tif ( doRefresh ) {\n\t\t\tajaxTimer = setTimeout( loadPageData, ajaxRefresh );\n\t\t}\n\t} );\n}" ]
[ "0.72878", "0.70443434", "0.6654676", "0.6397467", "0.6391386", "0.62999713", "0.62387264", "0.6182824", "0.61464417", "0.6141637", "0.6113012", "0.6099956", "0.6098753", "0.60514396", "0.6050539", "0.60404617", "0.60300356", "0.5970459", "0.5961327", "0.59513694", "0.5937839", "0.5923676", "0.58937097", "0.5884379", "0.5844946", "0.5840857", "0.5834732", "0.58265597", "0.5818887", "0.5818356", "0.58160454", "0.5807837", "0.5799223", "0.5796705", "0.5788904", "0.57813156", "0.57430035", "0.5724133", "0.57186514", "0.5684645", "0.56795245", "0.5678136", "0.5671233", "0.56660634", "0.56626654", "0.56619656", "0.56532747", "0.5640242", "0.56273013", "0.5619913", "0.5617367", "0.5601483", "0.55976", "0.55904025", "0.5588431", "0.557376", "0.55556226", "0.5554353", "0.5552695", "0.55432624", "0.554318", "0.5532058", "0.55278903", "0.5525008", "0.55203027", "0.5517729", "0.5503503", "0.5497626", "0.54894793", "0.5481097", "0.5475939", "0.5475611", "0.54732513", "0.54342246", "0.5429102", "0.54274696", "0.5422624", "0.5412413", "0.5388925", "0.538855", "0.53860754", "0.5371545", "0.5365061", "0.53615296", "0.53600234", "0.53352684", "0.53313905", "0.5317412", "0.5316608", "0.5310431", "0.5309089", "0.53074527", "0.5296095", "0.5291284", "0.52897406", "0.5288344", "0.52758515", "0.5272497", "0.5256133", "0.5241661" ]
0.5821569
28
Callback Assign directly a tag
function processHTML(temp, target) { target.innerHTML = temp.innerHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "function addTag(id, tag){\n\t\n}", "onReplaceTagAtIndex() {}", "function __(tag, block) {\n block.tag = tag;\n return block;\n }", "function addTagInternal( tag ) {\n if( typeof tag === 'string' && attrs.tagTitleField ) {\n var tmp = {};\n tmp[attrs.tagTitleField] = tag;\n tag = tmp;\n }\n\n scope.tags.push( tag );\n scope.inputText = '';\n scope.selection = -1;\n }", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "function setTag(key, value) {\n\t getCurrentHub().setTag(key, value);\n\t}", "function onTagChange() {\n\n\t}", "onUpdateTagAtIndex() {}", "onAddTag() {}", "function onTagChange($e,$data){\n\t\t\taddTag($data.item.value);\n\t\t}", "function setTag(key, value) {\n hub.getCurrentHub().setTag(key, value);\n}", "function Tagged() {\r\n}", "handleAddTag(cardId, text = '') {}", "function setMapTagName(tag, x, y) {\n\t\tthis.tagName = tag;\n\t\tthis.tagNameXPos = x == null ? 0 : eval(x);\n\t\tthis.tagNameYPos = y == null ? 0 : eval(y);\n\t}", "function onentertag() {\n currentTag = {\n type: 'mdxTag',\n name: null,\n close: false,\n selfClosing: false,\n attributes: []\n }\n }", "function construct_tag(tag_name){\n render_tag = '<li class=\"post__tag\"><a class=\"post__link post__tag_link\">' + tag_name + '</a> </li>'\n return render_tag\n}", "addNewTag() {\n this.$emit('add-tag', this.newTag, this.listIndex, this.cardIndex);\n this.newTag = {\n name: \"\",\n color: \"\"\n };\n }", "addTag (callback) {\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: `/codemarks/${this.codemark.id}/add-tag`,\n\t\t\t\tdata: {\n\t\t\t\t\ttagId: this.tagId\n\t\t\t\t},\n\t\t\t\ttoken: this.users[1].accessToken\n\t\t\t},\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tthis.message = response;\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "function addTag(tag, index) {\n var input = $('#new-tags');\n input.val(input.val() + ', ' + tag);\n var a = $('#tag-' + index);\n a.attr('onclick', 'return false;');\n a.find('span').removeClass('label-success').text('Birka pievienota pasākumam');\n a.css('cursor', 'default');\n}", "function Tag(tag_value, bin) {\n\tcmt_txt = bin ? document.forms.addform.bincomment : document.forms.addform.comment;\n\tvar TagLookup = {\n\t\t'p'\t\t\t:\t'<p></p>',\n\t\t'div'\t\t:\t'<div class=\"\"></div>',\n\t\t'span'\t\t:\t'<span class=\"\"></span>',\n\t\t'strong'\t:\t'<strong></strong>',\n\t\t'img'\t\t:\t'<img src=\"./resources/\" width=\"\" height=\"\" alt=\"\" />',\n\t\t'a'\t\t\t:\t'<a href=\"\" title=\"\"></a>',\n\t\t'ul'\t\t:\t'<ul>\\n<li></li>\\n</ul>',\n\t\t'ol'\t\t:\t'<ol>\\n<li></li>\\n</ol>',\n\t\t'li' \t\t: '<li></li>',\n\t\t'quote'\t\t:\t'<blockquote cite=\"http://\" title=\"\">\\n<p></p>\\n</blockquote>',\n\t\t'br'\t\t:\t'<br />',\n\t\t'code' : '<code></code>',\n\t\t'abbr' : '<abbr title=\"\"></abbr>',\n\t\t'tag'\t\t:\t'&lt;&gt;'\n\t};\n cmt_txt.focus();\n insertAtCursor(cmt_txt, TagLookup[tag_value]);\n}", "setTagTextNode(tagElm, HTML){\n this.getTagTextNode(tagElm).innerHTML = escapeHTML(HTML)\n }", "constructor(parser) { super(JXONAttribute.TAG, parser) }", "constructor(parser) { super(JXONValue.TAG, parser) }", "loadTag(replace, tag) {\n this.loadArticles({\n type: 'tag',\n tag: tag,\n from: replace ? 0 : this.articles.length,\n num: this.defaultNewArticlesNum\n }, replace);\n }", "get tag() {}", "get tag() {}", "get tag() {}", "get tag() {}", "function addTag(tag) {\n // If we entered from payload we have some additional info\n if ($('#eview_sub2')[0]) { \n var longTag = tag.split(\",\")[0];\n var theClass = tag.split(\",\")[1];\n var t_tag = truncTag(longTag,20);\n } else {\n var t_tag = truncTag(tag,20);\n } \n\n // Hide empty\n $('.tag_empty').hide();\n\n // Check if tag exists\n var tag_exists = 0;\n $('.tag').each(function() {\n if ($(this).text() == t_tag) {\n $(this).addClass('tag_active');\n tag_exists = 1;\n }\n }); \n\n // Add tag to left pane\n if (tag_exists == 0) {\n var newTag = \"<div title=\\\"\" + tag + \"\\\" data-val=\\\"\" + tag + \"\\\" class=tag>\" + t_tag + \"</div>\";\n $('#tg_box').prepend(newTag);\n }\n \n // If we have the payload open, add here as well\n if ($('#eview_sub2')[0]) {\n if($('#pickbox_label').is(\":visible\")) {\n theClass = $('#pickbox_label').data('sord')[0];\n }\n // Remove placeholder\n if ($('#tag_none')[0]) $('#tag_none').remove();\n var newTag = \"<div title=\\\"\" + longTag + \"\\\" data-val=\\\"\" + longTag + \"\\\" class=tag_\" + theClass + \">\" + t_tag + \"</div>\"; \n $('#tag_area').prepend(newTag);\n }\n\n }", "__init5() {this.tags = {};}", "__init5() {this.tags = {};}", "__init5() {this.tags = {};}", "function addTag(tag_index,tag_name,tag_content,tagArray) {\r\n var tag={tag_index,tag_name,tag_content};\r\n tagArray.push(tag);\r\n}", "tagChange(tag) {\n let tagPos = this.tags.indexOf(tag);\n if (tagPos === this.tags.length-1 && (tag.name !== '' || tag.value !== '')) this.addEmptyTag();\n }", "tryToSetTag(tag) {\n if (this.validateTagString(tag.tag)) {\n if (this.hasTag(tag.tag)) {\n this.removeTag(tag.tag);\n }\n this.__tags[tag.tag] = tag.value;\n this.__combinedTagString += `${tag.tag}:${tag.value}` + ' ';\n return true;\n }\n return false;\n }", "async handleTagCreated(tag) {\n this.setState({\n tags: [...this.state.tags, tag],\n draftTags: [...this.state.draftTags, tag]\n });\n }", "openTag() {\n var _a;\n this.processAttribs();\n const { tags } = this;\n const tag = this.tag;\n tag.isSelfClosing = false;\n // There cannot be any pending text here due to the onopentagstart that was\n // necessarily emitted before we get here. So we do not check text.\n // eslint-disable-next-line no-unused-expressions\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n tags.push(tag);\n this.state = S_TEXT;\n this.name = \"\";\n }", "function createTag($parent, config) {\n $(`<span id=\"tag-${config['tag_name']}\" class=\"tag\">${config['tag_name']}</span>`)\n .appendTo($parent)\n .click(() => { articlesBigContainer.loadTag(true, config['tag_name'] )});\n}", "function addTag() {\n idIndex = idUpdate();\n let tagpointId = \"tag\" + idIndex;\n var tagpoint = jQuery(\"<div/>\", {\n id: tagpointId,\n class: \"all tagshared tagcont\",\n });\n\n let inputId = \"i\" + idIndex;\n var inputpoint = jQuery(\"<input/>\", {\n id: inputId,\n class: \"all ibox\",\n value: \"...\",\n });\n\n var buttonpoint = jQuery(\"<span/>\", {\n id: \"b\" + idIndex,\n class: \"all\",\n html: \"&otimes;\",\n });\n\n $(this).parent().prepend(tagpoint);\n\n $(\"#\" + tagpointId).append(inputpoint);\n $(\"#\" + tagpointId).append(buttonpoint);\n $(\"#\" + inputId).on(\"blur\", processTagInput);\n}", "makeCustomTag (n, callback) {\n\t\tconst tagId = UUID().split('-').join('');\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'post',\n\t\t\t\tpath: '/team-tags/' + this.team.id,\n\t\t\t\tdata: {\n\t\t\t\t\tid: tagId,\n\t\t\t\t\tcolor: RandomString.generate(8),\n\t\t\t\t\tlabel: RandomString.generate(10),\n\t\t\t\t\tsortOrder: Math.floor(Math.random(100))\n\t\t\t\t},\n\t\t\t\ttoken: this.users[1].accessToken\n\t\t\t},\n\t\t\terror => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tthis.tagIds.push(tagId);\n\t\t\t\tif (n === 0 && !this.tagId) {\n\t\t\t\t\tthis.tagId = tagId;\n\t\t\t\t}\n\t\t\t\telse if (n === 1) {\n\t\t\t\t\tthis.otherTagId = tagId;\n\t\t\t\t}\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "function activateTag(tag) {\n //clear all tags in list of tag-active class\n var items = document.getElementsByClassName('tag-item');\n for(var i=0; i < items.length; i++) {\n items[i].classList.remove(\"tag-active\");\n }\n\n // set the selected tag's item to active\n var item = document.getElementById(tag + '-item');\n if(item) {\n item.classList.add(\"tag-active\");\n }\n}", "function pushTagAtCaret(){\n var caret = getCaret(inputElement[0]);\n var text = tagInput.text();\n var subtext = text.substring(0, caret);\n $timeout(function(){\n if(tagInput.pushTag(subtext)){\n tagInput.text(text.substring(caret));\n $timeout(function(){\n setCaret(inputElement[0], 0);\n });\n }else{\n //failed to create tag\n inputElement.addClass('error');\n }\n });\n }", "function getTag(tag, defval) {\n return (typeof tag === \"undefined\") ? defval||\"\" : tag[0];\n}", "function tag_click(tagButton) {\n let id = tagButton.className.substring(40);\n uploadTagArray[parseInt(id)].tag = tagButton.innerHTML;\n $(\"#word\" + id).css(\"background-color\", getTagColor(tagButton.innerHTML, availableOptionArray));\n}", "updateCurrentTag(newTag) {\n this.setState({ currentTag: newTag });\n }", "function updateTagNameDisplayer(element) {\n $(\"#tag-name\").text(\"<\" + element.tagName + \">\");\n}", "addCustomTag (n, callback) {\n\t\tconst tagId = UUID().split('-').join('');\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'post',\n\t\t\t\tpath: '/team-tags/' + this.team.id,\n\t\t\t\tdata: {\n\t\t\t\t\tid: tagId,\n\t\t\t\t\tcolor: RandomString.generate(8),\n\t\t\t\t\tlabel: RandomString.generate(10),\n\t\t\t\t\tsortOrder: Math.floor(Math.random(100))\n\t\t\t\t},\n\t\t\t\ttoken: this.users[1].accessToken\n\t\t\t},\n\t\t\terror => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tthis.tagIds.push(tagId);\n\t\t\t\tif (n === 0 && !this.tagId) {\n\t\t\t\t\tthis.tagId = tagId;\n\t\t\t\t}\n\t\t\t\telse if (n === 1) {\n\t\t\t\t\tthis.otherTagId = tagId;\n\t\t\t\t}\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "_createTag(item) {\n const tagFragment = document.createRange().createContextualFragment(tagTemplate({\n removable: this.options.removable,\n style: this.options.tagClass,\n text: item.text,\n value: item.value\n }));\n const tag = tagFragment.firstElementChild;\n\n // Attach tag click event to select it\n tag.addEventListener('click', this._onTagClick);\n\n if (this.options.removable) {\n // Find delete button and attach click event\n const deleteButton = tag.querySelector('.delete');\n if (deleteButton) {\n deleteButton.addEventListener('click', this._onTagDeleteClick);\n }\n }\n\n // insert new tag at the end (ie just before input)\n this.container.insertBefore(tag, this.input);\n }", "function addTagLabel(name) {\n let tagList = document.getElementById(\"tag-line\");\n let newTag = document.createElement(\"span\");\n let newText = document.createElement(\"span\");\n let newRemove = document.createElement(\"a\");\n let newIcon = document.createElement(\"i\");\n let input = document.getElementById(\"tag-add\");\n\n input.value = \"\";\n\n newTag.className = \"tag-label tag\";\n newTag.id = name;\n\n let aElement = document.createElement('a');\n aElement.innerText = name;\n newText.appendChild(aElement);\n\n newIcon.className = \"remove glyphicon glyphicon-remove-sign glyphicon-white\";\n\n newRemove.onclick = function() {\n tagList.removeChild(newTag);\n toAddTagList.delete(name.toLowerCase());\n removeTagFromItem(name);\n };\n newText.onclick = function() {\n window.location.href = '/tags/display/' + encodeURIComponent(name.toLowerCase());\n };\n newRemove.appendChild(newIcon);\n newTag.appendChild(newText);\n newTag.appendChild(newRemove);\n\n if(!toAddTagList.has(name)) {\n toAddTagList.add(name);\n tagList.appendChild(newTag);\n }\n}", "constructor(tag = '', template = () => '', data = 'default') {\n super()\n this.tagName = tag\n this.template = template.bind(this)\n this.data = data\n // Should Choose to register the element.\n }", "mapGenericTag(tag, warnings) {\n tag = { id: tag.id, value: tag.value }; // clone object\n this.postMap(tag, warnings);\n // Convert native tag event to generic 'alias' tag\n const id = this.getCommonName(tag.id);\n return id ? { id, value: tag.value } : null;\n }", "function tags(tags) { }", "function generateTag(newTag){\n var tag = $(\"<li> </li>\");\n tag.addClass(\"list-inline-item\");\n tag.addClass(\"w-25\");\n tag.addClass(\"mb-2\");\n\n var link = $(\"<a>\" + newTag + \"</a>\");\n link.addClass(\"tagList_tag\");\n\n tag.append(link);\n\n return tag;\n}", "function renderTitle(tag) {\n $(\"#tagTitle\").text(tag);\n}", "function generateTagHTML (tag){//generates HTML for a given tag\n return `<li class='tag'><div class='tag-box'>${tag}</div></li>`;\n}", "constructor(shownName) {\n\t\tsuper(shownName, 'tag')\n\t}", "updateTag(tag, selector) {\n if (!tag) return null;\n selector = selector || this._parseSelector(tag);\n const meta = this.getTag(selector);\n\n if (meta) {\n return this._setMetaElementAttributes(tag, meta);\n }\n\n return this._getOrCreateElement(tag, true);\n }", "function tagForObject(object, tag) {\n\tvar index = object.tags.indexOf(tag);\n\tif (index != -1) {\n\t\t//if it includes the tag\n\t\tobject.tags.splice(index, 1);\n\t} else {\n\t\tobject.tags.push(tag);\n\t}\n}", "function populateTagField (tagArray){\n\t\ttagArray.forEach(addTag);\n\t}", "onTagged(doclet, tag) {\n doclet._isVueDoc = true;\n doclet._vueEvent = doclet._vueEvent || [];\n doclet._vueEvent.push(tag.value || {});\n }", "function Tag(label,id,created) {\n this.label = label;\n this.id = id;\n this.created = created;\n}", "function tag(templateObject) {\n previousObject = templateObject;\n}", "function CreateTag(text) {\n var newTag = $('<span />').addClass(\"label label-primary tag\").append($(\n '<span />').html(text));\n if (defaults[\"allowInput\"]) {\n var removeButton = $(\n '<a class=\"rj-js-tag-delete\"><i class=\"fa fa-times fa-1\" aria-hidden=\"true\"></i></a>'\n );\n $(newTag).append(removeButton);\n }\n $(\"#rj-tag-box\").append(newTag);\n }", "function setTagOpt( id, opt, val ){\n \"use strict\";\n var el = document.getElementById(id);\n el[opt] = val;\n}", "function pushTag(gun, tag) {\n gun.get(scope + tag).val(function (group) {\n gun.get(scope + 'all tags').init().path(tag).put(group);\n });\n}", "function replaceSelection(tTag, tAttr, tVal) {\n\n // first, prevent to conflict of different jqte editors\n if (editor.not(\":focus\"))\n editor.focus();\n\n // for webkit, mozilla, opera\n if (window.getSelection) {\n var selObj = selectionGet(), selRange, newElement, documentFragment;\n\n if (selObj.anchorNode && selObj.getRangeAt) {\n selRange = selObj.getRangeAt(0);\n\n // create to new element\n newElement = document.createElement(tTag);\n\n // add the attribute to the new element\n $(newElement).attr(tAttr, tVal);\n\n // extract to the selected text\n documentFragment = selRange.extractContents();\n\n // add the contents to the new element\n newElement.appendChild(documentFragment);\n\n selRange.insertNode(newElement);\n selObj.removeAllRanges();\n\n // if the attribute is \"style\", change styles to around tags\n if (tAttr == \"style\")\n affectStyleAround($(newElement), tVal);\n // for other attributes\n else\n affectStyleAround($(newElement), false);\n }\n }\n // for ie\n else if (document.selection && document.selection.createRange && document.selection.type != \"None\") {\n var range = document.selection.createRange();\n var selectedText = range.htmlText;\n\n var newText = '<' + tTag + ' ' + tAttr + '=\"' + tVal + '\">' + selectedText + '</' + tTag + '>';\n\n document.selection.createRange().pasteHTML(newText);\n }\n }", "function onattributename(token) {\n currentTag.attributes.push({\n type: 'mdxAttribute',\n name: slice(token),\n value: null,\n position: position(token)\n })\n }", "function addTagExternal( tag ) {\n var validated = scope.onAddTag( tag );\n if( ! validated )\n return;\n\n scope.tags.push( validated );\n scope.inputText = '';\n scope.selection = -1;\n }", "function selectTag(tagElem) {\n tagElem.toggleClassName('selectedTag');\n var selected_tags = buildTagList();\n $('record_tags').value = selected_tags;\n $('record_tags').focus();\n}", "function setTags(tags) {\n callOnHub('setTags', tags);\n}", "function setTags(tags) {\n callOnHub('setTags', tags);\n}", "function setTags(tags) {\n callOnHub('setTags', tags);\n}", "constructor(parser) { super(JXONList.TAG, parser, JXONValue.TAG) }", "function replaceEl (selector, newTag) {\n selector.each(function(){\n var myAttr = $(this).attr();\n var myHtml = $(this).html();\n $(this).replaceWith(function(){\n return $(newTag).html(myHtml).attr(myAttr);\n });\n });\n}", "function replaceEl (selector, newTag) {\n selector.each(function(){\n var myAttr = $(this).attr();\n var myHtml = $(this).html();\n $(this).replaceWith(function(){\n return $(newTag).html(myHtml).attr(myAttr);\n });\n });\n}", "function tag() {\n return next => action => {\n next({\n type: `tagged_${action.tag}`,\n value: action,\n })\n }\n}", "function addTag(word){\n var x = addkey(word)\n if (!x){\n var t = document.createElement('text')\n var n = document.createTextNode(word)\n t.appendChild(n)\n t.classList.add('tagword') \n t.style.margin = '100px 5px' \n var par = document.getElementById(\"taghold\")\n var end = document.getElementById('tend')\n t.addEventListener('click',(ev) =>{\n removekey(word)\n par.removeChild(t)\n })\n par.insertBefore(t,end)\n\n } \n}", "function addTag (name) {\n $('#post_current_tags').val(function () {\n return $(this).val().concat(name, ',')\n })\n $('.current-tags').append(\"<span class='badge badge-pill badge-primary tag'>\" + name + '</span>')\n }", "function addTag(tag) {\n var node = document.createElement(\"li\");\n $(node).append('<span>' + tag + '</span><a href=\"#\" title=\"Remove tag\">x</a>');\n\n // When clicked, remove the node and save the tags list.\n $(node).find('a').click(function() {\n $(node).remove();\n saveTags();\n })\n\n // Add to the list.\n $list.append(node);\n }", "function newTag(){\n\tdocument.getElementById('__validation_tag_innetHTML').innerHTML = \"\";\n $('#__tag_color').val('');\n $('#__tag_name').val('');\n \n document.getElementById(\"_save_button\").onclick = addTags;\n document.getElementById(\"_restore_button\").onclick = newTag;\n document.getElementById(\"_cancel_button\").onclick = function(){\n YAHOO.ccm.container.updateReportAdminTags.cancel();\n };\n \n judgeNamePasses();\n judgeColorPasses();\n \n YAHOO.ccm.container.updateReportAdminTags.show();\n}", "write_tag(tag, arg) {\n this.write_varint(tag | (arg << 3));\n }", "function onTagClick($e){\n\t\t\tvar el = $($e.currentTarget);\n\t\t\tvar str = el.text();\n\t\t\t\n\t\t\taddTag(str);\n\t\t}", "addCustomTags (callback) {\n\t\tthis.tagIds = [];\n\t\tBoundAsync.timesSeries(\n\t\t\tthis, \n\t\t\t2,\n\t\t\tthis.addCustomTag,\n\t\t\tcallback\n\t\t);\n\t}", "function commonSetValue(tag, value)\n{\n\n//alert(tag + '<<<>>>>' + value);\n\n var s = document.getElementById(tag);\n s.value = value;\n\n}", "updateTag(tag, selector) {\n if (!tag)\n return null;\n selector = selector || this._parseSelector(tag);\n const meta = this.getTag(selector);\n if (meta) {\n return this._setMetaElementAttributes(tag, meta);\n }\n return this._getOrCreateElement(tag, true);\n }", "updateTag(tag, selector) {\n if (!tag)\n return null;\n selector = selector || this._parseSelector(tag);\n const meta = this.getTag(selector);\n if (meta) {\n return this._setMetaElementAttributes(tag, meta);\n }\n return this._getOrCreateElement(tag, true);\n }", "updateTag(tag, selector) {\n if (!tag)\n return null;\n selector = selector || this._parseSelector(tag);\n const meta = this.getTag(selector);\n if (meta) {\n return this._setMetaElementAttributes(tag, meta);\n }\n return this._getOrCreateElement(tag, true);\n }", "updateTag(tag, selector) {\n if (!tag)\n return null;\n selector = selector || this._parseSelector(tag);\n const meta = this.getTag(selector);\n if (meta) {\n return this._setMetaElementAttributes(tag, meta);\n }\n return this._getOrCreateElement(tag, true);\n }", "updateTag(tag, selector) {\n if (!tag)\n return null;\n selector = selector || this._parseSelector(tag);\n const meta = this.getTag(selector);\n if (meta) {\n return this._setMetaElementAttributes(tag, meta);\n }\n return this._getOrCreateElement(tag, true);\n }", "function parseTag(tagText) {\n \n}", "onAddTags() {}", "function $Tag(tagName,args){\n // cl\n var $i = null\n var elt = null\n var elt = $DOMNode(document.createElement(tagName))\n elt.parent = this\n if(args!=undefined && args.length>0){\n $start = 0\n $first = args[0]\n // if first argument is not a keyword, it's the tag content\n if(!isinstance($first,$Kw)){\n $start = 1\n if(isinstance($first,[str,int,float])){\n txt = document.createTextNode($first.toString())\n elt.appendChild(txt)\n } else if(isinstance($first,$TagSum)){\n for($i=0;$i<$first.children.length;$i++){\n elt.appendChild($first.children[$i])\n }\n } else {\n try{elt.appendChild($first)}\n catch(err){throw ValueError('wrong element '+$first)}\n }\n }\n // attributes\n for($i=$start;$i<args.length;$i++){\n // keyword arguments\n $arg = args[$i]\n if(isinstance($arg,$Kw)){\n if($arg.name.toLowerCase().substr(0,2)===\"on\"){ // events\n eval('elt.'+$arg.name.toLowerCase()+'=function(){'+$arg.value+'}')\n }else if($arg.name.toLowerCase()==\"style\"){\n elt.set_style($arg.value)\n } else {\n if($arg.value!==false){\n // option.selected=false sets it to true :-)\n try{\n elt.setAttribute($arg.name.toLowerCase(),$arg.value)\n }catch(err){\n throw ValueError(\"can't set attribute \"+$arg.name)\n }\n }\n }\n }\n }\n }\n return elt\n}", "function phyloxmlOnopentag(tag) {\n _tagStack.push(tag.name);\n switch (tag.name) {\n case CLADE:\n newClade(tag);\n break;\n case ACCESSION:\n newAccession(tag);\n break;\n case ANNOTATION:\n newAnnotation(tag);\n break;\n case CLADE_RELATION:\n if (_tagStack.get(1) === PHYLOGENY) {\n newCladeRelation(tag);\n }\n break;\n case COLOR:\n newBranchColor();\n break;\n case CONFIDENCE:\n newConfidence(tag);\n break;\n case CROSS_REFERENCES:\n newCrossReferences();\n break;\n case DATE:\n if (_tagStack.get(1) === CLADE) {\n newDate(tag);\n }\n break;\n case DISTRIBUTION:\n newDistribution(tag);\n break;\n case DOMAIN_ARCHITECTURE:\n newDomainArchitecture(tag);\n break;\n case EVENTS:\n newEvents();\n break;\n case ID:\n newId(tag);\n break;\n case MOLSEQ:\n newMolecularSequence(tag);\n break;\n case POINT:\n newPoint(tag);\n break;\n case PROTEINDOMAIN:\n newProteinDomain(tag);\n break;\n case PHYLOGENY:\n newPhylogeny(tag);\n break;\n case PROPERTY:\n newProperty(tag);\n break;\n case REFERENCE:\n newReference(tag);\n break;\n case SEQUENCE:\n newSequence(tag);\n break;\n case SEQUENCE_RELATION:\n if (_tagStack.get(1) === PHYLOGENY) {\n newSequenceRelation(tag);\n }\n break;\n case TAXONOMY:\n newTaxonomy(tag);\n break;\n case URI:\n newUri(tag);\n break;\n case X_SIMPLE_CHARACTERISTICS:\n //To be deprecated.\n newSimpleCharacteristics();\n break;\n default:\n }\n }", "function makeTag (tagName, strValue) {\n return \"<\"+tagName+\">\"+strValue+\"</\"+tagName+\">\"\n}", "function addTag(elementId, textNodeNumber, textNodeCount, tagName, tagAttributes) {\n var tagAction = function(elementId) {\n addJSONTag(elementId, tagName, tagAttributes);\n }\n\n return splitNodeSet(elementId, textNodeNumber, textNodeCount, tagAction);\n }" ]
[ "0.77069604", "0.77069604", "0.77069604", "0.77069604", "0.6721587", "0.6617568", "0.64636", "0.6403452", "0.6338535", "0.6338535", "0.6338535", "0.62873125", "0.62832475", "0.62603307", "0.6228817", "0.61790305", "0.6139829", "0.6120483", "0.6118738", "0.6028711", "0.5979836", "0.5968523", "0.5958742", "0.5875061", "0.5873157", "0.58729404", "0.5867245", "0.5855537", "0.5842969", "0.58001703", "0.5756778", "0.5756778", "0.5756778", "0.5756778", "0.5753255", "0.5746385", "0.5746385", "0.5746385", "0.5737601", "0.57338375", "0.57310766", "0.5712817", "0.5699551", "0.5689178", "0.5666285", "0.56659335", "0.56106234", "0.56106144", "0.5594367", "0.5591919", "0.55865836", "0.5579066", "0.5572205", "0.5546036", "0.55272335", "0.55212516", "0.55212456", "0.55198395", "0.55003005", "0.5500077", "0.54973334", "0.54881054", "0.5484", "0.5483321", "0.5477478", "0.5477088", "0.54711413", "0.5467162", "0.5463909", "0.5459106", "0.5457163", "0.5456728", "0.54564226", "0.5442788", "0.543537", "0.5434679", "0.5434679", "0.5434679", "0.54250693", "0.54167897", "0.54167897", "0.5397036", "0.53959864", "0.5391503", "0.537905", "0.5376233", "0.53715676", "0.5368857", "0.5353455", "0.5347639", "0.5347402", "0.5347402", "0.5347402", "0.5347402", "0.5347402", "0.5341697", "0.5330117", "0.53277695", "0.5327556", "0.532568", "0.532001" ]
0.0
-1
Create responseHTML for acces by DOM's methods
function processByDOM(responseHTML, target) { target.innerHTML = "Extracted by id:<br />"; // does not work with Chrome/Safari //var message = responseHTML.getElementsByTagName("div").namedItem("two").innerHTML; var message = responseHTML.getElementsByTagName("div").item(1).innerHTML; target.innerHTML += message; target.innerHTML += "<br />Extracted by name:<br />"; message = responseHTML.getElementsByTagName("form").item(0); target.innerHTML += message.dyn.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exractBody(response) {\n let dom1 = document.createElement(\"html\");\n dom1.innerHTML = response;\n let bodyText = dom1.getElementsByTagName(\"body\")[0].innerHTML;\n return bodyText;\n}", "function XJRResponse(data) {\n\tvar resp = document.getElementById(data.id);\n\tresp.innerHTML = data.html;\n}", "get html() {\n let html = '<div style=\"background: #fff; border: solid 1px #000; border-radius: 5px; font-weight: bold; margin-bottom: 1em; overflow: hidden;\">';\n html += '<div style=\"background: #000; color: #fff; text-align: center;\">' + this._header + '</div>';\n html += '<div style=\"padding: 5px;\">' + this._content + '</div>';\n html += '</div>';\n return html;\n }", "renderHTML() {\n \n }", "function makeHtmlElement(html){\n\t\tcallbacks = {};\n\t\tvar result = parseHtmlJson(html, callbacks);\n\n\t\t//make result not display, then add it to body so that jQuery selector\n\t\t//callbacks on it will work\n\t\tvar oldDisplay = result.style.display;\n\t\tresult.style.display = \"none\";\n\t\tdocument.body.appendChild(result);\n\n\t\tfor (var id in callbacks){\n\t\t\tvar element = getByDataId(result, id);\n\t\t\tcallbacks[id](element);\n\t\t\telement.removeAttribute(dataIdName);\n\t\t}\n\n\t\t//remove result from body, then restore its display attribute\n\t\tdocument.body.removeChild(result);\n\t\tresult.style.display = oldDisplay;\n\n\t\treturn result;\n\t}", "function getResponse(data) {\n responseDiv.innerHTML = data;\n}", "createMarkup(html) {\n return {\n __html: html\n };\n }", "function generateDOM(response) {\n console.log('inside dom response is ', response);\n \n //console.log('inside generateDOM des: ', response.description);\n // var description = JSON.stringify(response.description);\n // var text = $('<td>').html(description);\n //console.log('inside generateDOM genre: ', response.genre);\n //console.log('inside generateDOM id: ', response.id);\n var tr = $('<tr>');\n var tdAppName = $('<td>', {\n text: response['app_name']\n });\n \n var tdID = $('<td>', {\n text: response.id\n });\n var tdgenre = $('<td>', {\n text: response.genre\n });\n var tdDescription = $('<td>', {\n //text: text\n text: response.price\n });\n\n tr.append(tdAppName);\n tr.append(tdID);\n tr.append(tdgenre);\n tr.append(tdDescription);\n\n $('.app-list tbody').append(tr);\n}", "function pagehtml(){\treturn pageholder();}", "function finalResponseHtml() {\n let finalResponseText = `<h1>${array[0]}</h1><br>\n <h2>You scored a ${score}0% with ${score} out of 10 answered correctly.</h2><br>\n <p>${array[1]} Click the restart button below to try again.</p>\n <button type=\"submit\" class=\"restartButtonEnd button\">Restart</button>`;\n\n return finalResponseText;\n}", "function serveHTML(resource, sekiResponse, queryResponse) {\n\n\t// set up HTML builder\n\tvar viewTemplater = templater(htmlTemplates.viewTemplate);\n\t// verbosity(\"GOT RESPONSE \");\n\n\tvar saxer = require('./srx2map');\n\tvar stream = saxer.createStream();\n\n\tsekiResponse.pipe(stream);\n\n\tqueryResponse.on('data', function(chunk) {\n\t\tstream.write(chunk);\n\t});\n\n\tqueryResponse.on('end', function() {\n\n\t\tstream.end();\n\n\t\tvar bindings = stream.bindings;\n\t\tif (bindings.title) { // // this is ugly\n\t\t\tverbosity(\"GOT: \" + JSON.stringify(bindings));\n\t\t\t// verbosity(\"TITLE: \" + bindings.title);\n\t\t\tverbosity(\"WRITING HEADERS \" + JSON.stringify(sekiHeaders));\n\t\t\tsekiResponse.writeHead(200, sekiHeaders);\n\t\t\tvar html = viewTemplater.fillTemplate(bindings);\n\t\t} else {\n\t\t\tverbosity(\"404\");\n\t\t\tsekiResponse.writeHead(404, sekiHeaders);\n\t\t\t// /////////////////////////////// refactor\n\t\t\tvar creativeTemplater = templater(htmlTemplates.creativeTemplate);\n\t\t\tvar creativeMap = {\n\t\t\t\t\"uri\" : resource\n\t\t\t};\n\t\t\tvar html = creativeTemplater.fillTemplate(creativeMap);\n\t\t\t// ///////////////////////////////////////////\n\t\t\t// serveFile(sekiResponse, 404, files[\"404\"]);\n\t\t\t// return;\n\t\t}\n\t\t// sekiResponse.writeHead(200, {'Content-Type': 'text/plain'});\n\t\t// verbosity(\"HERE \"+html);\n\t\t// sekiResponse.write(html, 'binary');\n\t\tsekiResponse.end(html);\n\t});\n}", "function convertToHtml(response){\n return response.text().then(html => {\n return domParser.parseFromString(html, \"text/html\")\n })\n}", "getHTML() {\n return this._executeAfterInitialWait(() => this.currently.getHTML());\n }", "function getHTML(loc, insertArea){\n\tajax(loc, \"GET\", function(){\n\t\tif(this.readyState == 4 && this.status == 200){\n\t\t\t// console.log(this.responseText);\n\t\t\tinsertArea.innerHTML = this.responseText;\n\t\t}\n\t});\n}", "handleResponse(response) {\n // the key of pages is a number so need to look for it\n if (\n typeof this.searchResponse !== typeof undefined &&\n this.searchResponse.query\n ) {\n for (var key in this.searchResponse.query.pages) {\n // skip anything that's prototype object\n if (!this.searchResponse.query.pages.hasOwnProperty(key)) continue;\n // load object response, double check we have an extract\n if (this.searchResponse.query.pages[key].extract) {\n let html = this.searchResponse.query.pages[key].extract;\n html = html.replace(/<script[\\s\\S]*?>/gi, \"&lt;script&gt;\");\n html = html.replace(/<\\/script>/gi, \"&lt;/script&gt;\");\n html = html.replace(/<style[\\s\\S]*?>/gi, \"&lt;style&gt;\");\n html = html.replace(/<\\/style>/gi, \"&lt;/style&gt;\");\n // need to innerHTML this or it won't set\n this.shadowRoot.querySelector(\"#result\").innerHTML = html;\n }\n }\n }\n }", "function createResponseLog(){\n if(!document.getElementById('responseLog')){\n var rLog = document.createElement(\"div\");\n rLog.setAttribute(\"id\", \"responseLog\");\n rLog.setAttribute(\"class\", \"hidden\");\n document.body.appendChild(rLog);\n }\n\t}", "function toHTMLResponse(data) {\n const init = {\n headers: { 'content-type': 'text/html;charset=UTF-8' },\n }\n const body = data\n return new Response(body, init)\n}", "function _getRulaiHtml(content){\n\n}", "function success(response){\n //div1.innerHTML = response;\n }", "getHTML() {\n const result = browser.selectorExecute(\n // tslint:disable-next-line:ter-prefer-arrow-callback\n [this._node.getSelector()], function (elems, elementSelector) {\n const error = {\n notFound: [],\n };\n if (elems.length === 0) {\n error.notFound.push(elementSelector);\n }\n if (error.notFound.length > 0) {\n return error;\n }\n const elem = elems[0];\n return elem.innerHTML;\n }, this._node.getSelector());\n if (isJsError(result)) {\n throw new Error(`${this._node.constructor.name} could not be located on the page.\\n( ${this._node.getSelector()} )`);\n }\n else {\n return result || '';\n }\n }", "generateHTML(){\n var self = this;\n var html = \"<div class='\"+self.class_name+ \"'> \\\n </div>\";\n $(\"body\").append(html);\n \n //THIS WILL DEPEND ON VIEW- CHANGE LATER\n self.footer.generateHTML();\n self.us_state_map.generateMap();\n self.profile_page.generateHTML();\n self.profile_page.unfocus();\n self.header.generateHTML();\n \n }", "get html() {\n return this._html;\n }", "function doGet() {\n \n var docText = htmlContent();\n return HtmlService.createHtmlOutput(docText);\n}", "function responseWriter (result_op){\n\n var responseWriter=new HTMLRewriter()\n .on('title', new TitleWriter())\n .on('h1[id=\"title\"]', new TitleWriter())\n .on('p[id=\"description\"]', new DescriptionWriter())\n .on('a[id=\"url\"]', new URLWriter())\n .transform(result_op);\n\n return responseWriter\n}", "function createHTML(responseJson) {\n $('#results-list').empty();\n for (let i = 0; i < responseJson.data.length; i++){\n const physicalAddress = responseJson.data[i].addresses.find(addy => addy.type === 'Physical');\n $('#results-list').append(\n `<li><h3>${responseJson.data[i].fullName}</h3>\n <p>${responseJson.data[i].description}</p>\n <address>\n <p>${physicalAddress.line1}</p>\n <p>${physicalAddress.line2} ${physicalAddress.line3}</p>\n <p>${physicalAddress.city}, ${physicalAddress.stateCode} ${physicalAddress.postalCode}</p>\n </address>\n <p><a href='${responseJson.data[i].url}'>Click for More Info</a></p>\n </li>`\n );\n }\n $('#results').removeClass('hidden');\n}", "function createHTML(resultArray) {\n let htmlString = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Cars</title>\n </head>\n <body>\n <h1>Search result</h1>\n <table>\n <thead>\n <th>Model</th>\n <th>Licence</th>\n </thead>\n <tbody>`;\n\n for (let car of resultArray) {\n htmlString += `<tr>\n <td>${car.model}</td><td>${car.licence}</td></tr>`;\n }\n\n htmlString += `</tbody> \n </table>\n </body>\n </html>`;\n}", "_render(html){this.$.container.innerHTML=html}", "static get html() {\n return '';\n }", "createHtml() {\n this.container = document.createElement('div');\n this.container.className = 'container';\n this.container.innerHTML = `\n <div class=\"quiz-container display-flex-center\">\n <div class=\"question-text display-flex-center\">What would you say cross-sells best when magazines and publications are selling a lot?</div>\n <ul id=\"questionContainer\" class=\"display-flex-center\"></ul> \n </div>\n `;\n\n document.body.appendChild(this.container);\n this.createButtons();\n }", "function _mkdom(html) {\n var match = html && html.match(/^\\s*<([-\\w]+)/), tagName = match && match[1].toLowerCase(), rootTag = rootEls[tagName] || GENERIC, el = mkEl(rootTag);\n el.stub = true;\n if (checkIE && tagName && (match = tagName.match(SPECIAL_TAGS_REGEX)))\n ie9elem(el, html, tagName, !!match[1]);\n else\n el.innerHTML = html;\n return el\n }", "function genFinalHtml() {\r\n ` </div> \r\n\r\n </body>\r\n </html`;\r\n}", "function render() {\n\tcontainer.innerHTML = htmlStr;\n}", "function theHTTPResponse(strHTML)\n{\nalert('inside theResponse');\n\tif(myreq.readyState==4)\n\t{\n\tif(myreq.status==200)\n\t{\n\t\tvar respstring=myreq.responseXML.getElementsByTagName('respstring')[0];\n\t\tdocument.getElementById(strHTML+\"_div\").innerHTML=respstring.childNodes[0].nodevalue;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(strHTML+\"_div\").innerHTML='waiting...';\n\t}\n\t}\n}", "function getHtml() {\n jsdom.env(\n options.url,\n parseHtml\n );\n }", "function newHTML(html) {\n\t\tvar box = document.createElement(\"div\");\n\t\tbox.innerHTML = html;\n\t\tvar o = document.createDocumentFragment();\n\t\twhile(box.childNods.length) {\n\t\t\to.appendChild(box.childNodes[0]);\n\t\t}\n\t\tbox = null;\n\t\treturn o;\n\t}", "function addHtml(url) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n finalHtml= xhttp.responseText;\n }\n };\n xhttp.open(\"GET\",url, false);\n xhttp.send();\n}", "getHTML() {\n return getHTMLFromFragment(this.state.doc.content, this.schema);\n }", "function processResponse(respObj) {\r\n $(position1).html(respObj);\r\n }", "createHTML() {\n var tile = document.createElement('li'),\n targetElement = this.tilesView.tilesWrapper.querySelector(\n '.list.' + this.shader.status\n );\n\n if (!targetElement) {\n let list = document.createElement('ul'),\n listElement = document.createElement('li');\n\n list.classList.add('list', this.shader.status);\n list.setAttribute('data-status', this.shader.statusOrginal);\n listElement.appendChild(list);\n this.tilesView.tilesWrapper.appendChild(list);\n targetElement = list;\n }\n\n tile.classList.add('shader');\n tile.innerHTML = TILE_TEMPLATE.replace(\n '{previewUrl}',\n getPreviewUrlById(this.shader.id)\n )\n .replace('{shaderUrl}', getShaderUrlById(this.shader.id))\n .replace('{shaderTitle}', this.shader.title);\n targetElement.appendChild(tile);\n }", "function render() {\n container.innerHTML = htmlStr;\n}", "function writeResponse(response) {\n console.log(response);\n var creator = response.creator.email;\n var calendarEntry = response.htmlLink;\n var infoDiv = document.getElementById(\"info\");\n var infoMsg = document.createElement(\"P\");\n infoMsg.appendChild(\n document.createTextNode(\"האירוע \" + 'נוצר בהצלחה ע\"י ' + creator)\n );\n infoDiv.appendChild(infoMsg);\n var entryLink = document.createElement(\"A\");\n entryLink.href = calendarEntry;\n entryLink.appendChild(document.createTextNode(\"צפה באירוע שנוצר ביומנך\"));\n infoDiv.appendChild(entryLink);\n}", "toHtml()\n\t{\n //to finish \n var answer = '<div class=\"student-project-panel\"><div class=\"personal-row\"> <h3>' \n\t\t+ this.name + '</h3><span class=\"'+ map_dot[this.status]+'\"></span></div></div>'\n\t\treturn answer;\n\t}", "function htmlWriteResults(cases) {\r\n var myHTML = '';\r\n myHTML +=\r\n `<article><div class=\"col-md-4\">\r\n <div class=\"well text-center\">`;\r\n if (filterMovies(cases.imdbID)) {\r\n myHTML +=\r\n `<div class=\"alert alert-success\" id=\"${cases.imdbID}inCollection\"><p><i class=\"fa fa-cloud-download\"></i> In Collection</p></div>`;\r\n } else {\r\n myHTML +=\r\n `<div class=\"alert alert-danger\" id=\"${cases.imdbID}notInCollection\"><p><i class=\"fa fa-exclamation-triangle\"></i> Not in Collection</p></div>`;\r\n }\r\n myHTML +=\r\n `<figure><img src=\"${posterError(cases.Poster)}\" alt=\"${cases.Title}\"></figure>\r\n <h5 class=\"whiteheader\">${cases.Title} (${cases.Year.substring(0, 4)})</h5>\r\n <div class=\"btn-group\">\r\n <a onclick=\"movieSelected('${cases.imdbID}')\" class=\"btn btn-primary btn-rounded\" href=\"#\"><i class=\"fa fa-info-circle\"></i> ${upperFirst(cases.Type)} Details</a>\r\n </div>\r\n </div>\r\n </div></article>\r\n `;\r\n return myHTML;\r\n}", "prepareHTML(html) {\n if (html instanceof HTMLElement) {\n html = html.outerHTML;\n }\n\n const target = DomHelper.createElement({\n parent: document.body,\n style: {\n visibility: 'hidden',\n position: 'absolute'\n },\n html\n });\n const elements = target.querySelectorAll('img');\n\n for (let i = 0, l = elements.length; i < l; i++) {\n elements[i].setAttribute('src', elements[i].src);\n }\n\n const result = target.innerHTML;\n target.remove();\n return result;\n }", "function getDOM(html) {\n var bodyTagPos = html.search(/<body/i),\n bodyStartPos = html.substring(bodyTagPos).search(/>/) + bodyTagPos + 1,\n bodyEndPos = html.search(/<\\/body/i),\n bodyContent;\n\n if (bodyEndPos >= bodyStartPos) {\n bodyContent = html.substring(bodyStartPos, bodyEndPos);\n bodyContent = bodyContent.replace(/[\\r\\n]/g, ' ');\n // Remove unicode space characters.\n bodyContent = bodyContent.replace(/[^\\x00-\\x7F]/, ' ');\n bodyContent = bodyContent.replace(/\\s+/g, ' ');\n\n bodyContent = stripScripts(bodyContent);\n bodyContent = stripStylesheets(bodyContent);\n bodyContent = stripIFrames(bodyContent);\n bodyContent = stripImages(bodyContent);\n return $('<div>' + bodyContent + '</div>').get(0);\n }\n }", "function getPageHTML() {\n let language = getLanguage()\n // get all the server-rendered html in our desired language\n $.ajax({\n beforeSend: console.log('getting html for language...'),\n url: '/getHtml',\n type: 'POST',\n data: { language },\n success: (data) => {\n if (data.err) {\n console.error('Error getting html!')\n } else {\n $('#full-page').html(data)\n // now we load the rest of the site\n GetRestOfSiteData()\n }\n },\n complete: (xhr, status) => {\n if (status == 'error') {\n $('#full-page').html(xhr.responseText)\n }\n },\n })\n}", "function buildDom(htmlString) {\n var div = document.createElement(\"div\");\n\n div.innerHTML = htmlString;\n\n return div.children[0];\n}", "function processByDOM(responseHTML, target) {\n target.innerHTML = \"Extracted by id:<br />\";\n\n // does not work with Chrome/Safari\n //var message = responseHTML.getElementsByTagName(\"div\").namedItem(\"two\").innerHTML;\n var message = responseHTML.getElementsByTagName(\"div\").item(1).innerHTML;\n\n target.innerHTML += message;\n\n target.innerHTML += \"<br />Extracted by name:<br />\";\n\n message = responseHTML.getElementsByTagName(\"form\").item(0);\n target.innerHTML += message.dyn.value;\n}", "function drawOutput(responseText) {\n var container = document.getElementById('output'); \n container.innerHTML = responseText;\n}", "html()\n{\n console.log(\"Rendering\");\n const html = ` <h2>${this.name}</h2>\n <div class=\"image\"><img src=\"${this.imgSrc}\" alt=\"${this.imgAlt}\"></div>\n <div>\n <div>\n <h3>Distance</h3>\n <p>${this.distance}</p>\n </div>\n <div>\n <h3>Difficulty</h3>\n <p>${this.difficulty}</p>\n </div>\n </div>`;\n\n return html;\n}", "function buildWebPage(result){\n document.getElementById('article').innerHTML = result.description;\n document.getElementById('article-title').innerHTML = result.title;\n}", "createHTML(html) {\n return htmlPolicy.createHTML(html);\n }", "render(){return html``}", "function _mkdom(html) {\n\n var match = html && html.match(/^\\s*<([-\\w]+)/),\n tagName = match && match[1].toLowerCase(),\n rootTag = rootEls[tagName] || GENERIC,\n el = mkEl(rootTag)\n\n el.stub = true\n\n if (checkIE && tagName && (match = tagName.match(SPECIAL_TAGS_REGEX)))\n ie9elem(el, html, tagName, !!match[1])\n else\n el.innerHTML = html\n\n return el\n }", "renderResponseConcrete(responseURI, response) {\n return __awaiter(this, void 0, void 0, function* () {\n const parsedDocument = HTMLRenderer_1.parseResponseAsHTMLDocument(responseURI, response);\n yield this.viewport.renderHTML(parsedDocument.documentElement.outerHTML);\n });\n }", "function extractResponse() {\n // parse user login name, add it to the html\n setLoginName(validUserNameJason.login);\n // create html for repositories, pass repos url api and number of repositories\n setRepositories(validUserNameJason.repos_url, validUserNameJason.public_repos);\n // create html for followers repositories, pass followers url api and number of followers\n setFollowers(validUserNameJason.followers_url, validUserNameJason.followers);\n // show the user info html the was generated from the response\n let userSection = document.getElementById(\"userInfo\");\n showElement(userSection);\n }", "function apiDataToHTML(result) {\n var htmlString = `\n <a href=\"https://en.wikipedia.org/?curid=${result.pageid}\">\n <div class='panel panel-default searchresult'>\n <div class='panel-heading'>\n <h3 class='panel-title'>${result.title}</h2>\n </div>\n <div class='panel-body'>${result.snippet}</div>\n </div>\n </a>`;\n return htmlString;\n }", "function buildDom(htmlString) {\n //tempDiv lo creamos para tener un elemento HTML (div) sobre el que transformar\n //nuestro string (htmlString) a formato HTML usando innerHTML\n //los strings que contengan el HTML deven tener UN SOLO ELEMENTO PADRE\n const tempDiv = document.createElement(\"div\");\n tempDiv.innerHTML = htmlString;\n //console.log(“tempDiv.children”, tempDiv.children)\n return tempDiv.children[0];\n}", "function createDomArray (o) {\n var h = __document.createElement('div')\n h.innerHTML = o.html\n return __slice.call(h.childNodes)\n}", "function appendheros(response){\r\n return `\r\n <div><img src = ${response.image.url}></div>\r\n <div>${response.name}</div>\r\n <div>\r\n <button class = \"delete-btn\">remove</button>\r\n </div>\r\n `\r\n}", "function appendDom(response) {\n console.log('server says:', response);\n $('#container').append('<p class = \"totalanswer\">'+ response + '</p>');\n}", "function drawOutput2(responseText) {\n\tvar container = document.getElementById('outputsg');\n\tcontainer.innerHTML = responseText;\n}", "function drawOutput2(responseText) {\n\tvar container = document.getElementById('outputsg');\n\tcontainer.innerHTML = responseText;\n}", "processMarkup(response) {\n const responseDiv = getWithDefault(response || {}, 'div', false);\n\n if (responseDiv) {\n const gist = document.createElement('div');\n gist.innerHTML = responseDiv;\n this.element.appendChild(gist.firstChild);\n\n this.processStylesheet(response);\n\n return true;\n }\n\n this.set('isError', true);\n\n return false;\n }", "function tableBuilder(response) {\n console.log('tableBuilder');\n var output = \"\";\n for (var i in response) {\n output += \"<tr><td>\" +\n response[i].place_name +\n \"</td><td>\" +\n response[i].addr_line1 +\n \" \" +\n response[i].addr_line2 +\n \"</td><td>\" +\n response[i].open_time + \" - \" +\n response[i].close_time +\n \"</td><td>\" +\n response[i].add_info +\n \"</td><td>\" +\n response[i].add_info_url +\n \"</td></tr>\";\n }\n document.getElementsByTagName(\"tbody\")[0].innerHTML = output;\n }", "function showHttpResult(response, action, currForm, terminator){\n //var currForm = document.createElement('div');\n\n var br = document.createElement('BR');\n currForm.appendChild(br);\n var br = document.createElement('BR');\n currForm.appendChild(br);\n\n // get header result\n currForm.appendChild(getHeaderDom('HTTP Header'));\n\n var br = document.createElement('BR');\n currForm.appendChild(br);\n\n var retHttpHeaders = '';\n\n // iterate over all headers\n for (let [key, value] of response.headers) {\n retHttpHeaders = retHttpHeaders + `${key} = ${value}` + '\\n';\n }\n\n // http header result\n var hdres = document.createElement('pre');\n hdres.setAttribute('class', 'terminus-api-signature-pre');\n var txt = document.createTextNode(retHttpHeaders);\n hdres.appendChild(txt);\n\n var cm = stylizeCodeDisplay(terminator, hdres, currForm, 'message/http');\n if(!cm) currForm.appendChild(hdres);\n\n return response.json()\n .then(function(response){\n getResponse(currForm, action, response, terminator); // get return response\n })\n\n} // UTILS.showHttpResult()", "get outerHTML(){ \n\t\t return this.xml; \n\t\t \n\t }", "get outerHTML(){ \n\t\t return this.xml; \n\t\t \n\t }", "function createMarkup(data) {\n return { __html: data };\n}", "function DOMRenderer() {}", "function httpResponse()\n{\n var http=httpRequest();\n \n http.onreadystatechange=function state()\n {\n // check the readystate i.e response received\n if(this.readyState==4)\n {\n var responseArray=JSON.parse(this.responseText);\n // pass responseArray to function(create HTML elements)\n newElement(responseArray);\n \n }\n // check for the status 429 (Too many responses)\n else if(this.status==429)\n {\n alert(\"Too many requests!!!\");\n window.location.reload();\n }\n else{\n console.log(this.status)\n }\n }\n}", "createHTMLtask() {\n const htmlstring = '<div class=\"task\" draggable=\"true\" id=\"' + this.id + '\" ondragstart=\"drag(event)\" ondrop=\"drop(event)\" ondragover=\"allowDrop(event)\">' +\n '<big><strong>' + this.name + \" \" + '</strong></big>' +\n this.date.replace('T', ' ').substring(0, 19) +\n '<button id=\"' + this.id + '\" onClick=\"viewTask(this.id)\"' + ' class=\"view\" type=\"button\">&#128065;</button>' +\n this.priorityButton() + '<br><br>' +\n \"<p>\" + this.minimizeDescription() +\n this.changePhaseButton() +\n '<p>Assignee: ' + this.assignee + '..........Priority: ' + this.priority + '</p>' +\n '</div><br><br><br><br><br>';\n\n return htmlstring;\n }", "function updateDom(response){\n\t$( \".response-line\" ).empty();\n\t$( \"#response\" ).append(response);\n}", "function buildDom(htmlString) {\n //tempDiv lo creamos para tener un elemento HTML (div) sobre el que transformar\n //nuestro string (htmlString) a formato HTML usando innerHTML\n //los strings que contengan el HTML deven tener UN SOLO ELEMENTO PADRE\n const tempDiv = document.createElement(\"div\");\n tempDiv.innerHTML = htmlString;\n //console.log(“tempDiv.children”, tempDiv.children)\n return tempDiv.children[0];\n}", "generateHTML() {\n let HTML = '';\n HTML += `<img class=\"headerLogo\" src=\"${this.logoPath + this.data.logoHeader}\" alt=\"${this.data.logoalt}\">`;\n return HTML;\n }", "function fillInResponse(response){\n $(\"#response\").text(response.responseText);\n }", "toString() {\n return this.body().innerHTML;\n }", "static getHtmlTemplate(url, id, callback) {\n console.log(id);\n $.ajax({\n type: 'GET',\n url: url,\n dataType: 'text',\n }).done((res) => {\n document.getElementById(id).innerHTML = res;\n });\n }", "getResponseHtml(heading, errors, displayBack) {\n const styles = require(\"fs\").readFileSync(\n __dirname + \"/../css/main.css\",\n \"utf-8\"\n );\n const minifyOptions = {\n collapseWhitespace: true,\n removeComments: true,\n collapseInlineTagWhitespace: true,\n minifyCSS: true\n };\n\n return minify(\n `\n <!doctype html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title></title>\n <style>${styles}</style>\n <meta name=\"robots\" content=\"noindex,nofollow\">\n </head>\n <body>\n <div class=\"wrapper\">\n <div class=\"little-box\">\n ${this.getHeadingMarkup(heading)}\n ${this.getErrorsMarkup(errors)}\n ${this.getBackMarkup(displayBack)}\n </div>\n </div>\n </body>\n </html>\n `,\n minifyOptions\n );\n }", "function jsdomEndpoint(req, res, urlFile) {\r\n let data = fs.readFileSync(\"./html/\" + urlFile);\r\n let mioJsdom = new JSDOM(data);\r\n let tagAccedi = mioJsdom.window.document.getElementById(\"Accedi\");\r\n tagAccedi.innerHTML = \"Benvenuto \" + giocatore.getUsername();\r\n let tagHumburger = mioJsdom.window.document.getElementById(\"AccediHumburger\");\r\n tagHumburger.innerHTML = \"Benvenuto \" + giocatore.getUsername();\r\n res.send(mioJsdom.window.document.documentElement.outerHTML);\r\n}", "html(argHTML) {\n if (argHTML === undefined) return this.elementArray[0].innerHTML;\n this.each(ele => {\n ele.innerHTML = argHTML;\n });\n }", "function jsonToHTML (data) {\n \n var html;\n \n \n \n return html;\n}", "function getBotResponseAsHTML(msg){\r\n\treturn \"<div class='custom-msg-wrapper'> \"+\r\n\t\t\t\t\t\t\" <div class='col-xs-10 p-r-0 '> \"+\r\n\t\t\t\t\t\t\t\" <span class='custom-text-wraper custom-response-boot'> \" + \r\n\t\t\t\t\t\t\t\t\tmsg +\r\n\t\t\t\t\t\t\" </div>\" +\r\n\t\t\t\t\t\t\" <div class='col-xs-2 p-l-0 p-r-0'> \"+\r\n\t\t\t\t\t\t\t\"<a href='#modal1' class='modal-trigger'> <img src='\"+BOT_ICON+\"' class=' img-responsive pull-right' alt='Bot' /></a> \" +\r\n\t\t\t\t\t\t\" </div> \"+\r\n\t\t\t\t\t\" </div>\";\r\n}", "function mergeHtml(url) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n html= xhttp.responseText;\n }\n };\n xhttp.open(\"GET\",url, false);\n xhttp.send();\n}", "function drawRegistrationOutput(responseText) {\r\n var container = document.getElementById('welcome');\r\n container.innerHTML = responseText;\r\n}", "function handleResponse11() {\n\tif(http.readyState == 4){\n var response = http.responseText;\n document.getElementById(idName1).innerHTML = response;\n }\n}", "function getRealContent(resList,url,success){\n var $ = Zepto;\n var distUrl = pathJoin(location.href,url);\n \n $.ajax({\n url:distUrl,\n dataType:'html',\n cache:false,\n success:function(data){\n //alert(window.DOMParser);\n //var dp = new DOMParser();\n //var dom = dp.parseFromString(data,'text/html');\n //remove datatype\n \n data = data.replace(/<!\\s*doctype[^>]+>/i,'');\n var hp = htmlParser(data,{fix:true});\n \n \n var resource = {\n styleList:[],\n scriptList:[],\n linkList:[]\n };\n \n var tokenState = 0;//0:无状态。1:标签开始。2:内容。3:结束\n var tokenText = [];\n var token;\n var resData = '';\n var bodyData = '';\n var isInHeader = false;\n \n while(token = hp.readToken()){\n if(token.type === 'atomicTag'){\n if(token.tagName === 'script'){\n var src = token.attrs.src;\n if(src){\n src = pathJoin(location.href,src);\n if(src && (src in resList)){\n \n }else{\n resData += token.text;\n resource.scriptList.push(token);\n }\n }else{\n resData += token.text;\n resource.scriptList.push(token);\n }\n }else if(token.tagName === 'style'){\n \n if(isInHeader){\n resource.styleList.push(token);\n }\n \n if(tokenState === 1){\n bodyData += token.text;\n }\n \n }else{\n resData += token.text;\n if(tokenState === 1){\n bodyData += token.text;\n }\n }\n continue;\n }\n \n if(token.type === 'startTag'){\n if(tokenState === 1){\n bodyData += token.text;\n }\n if(token.unary === true){\n if(token.tagName !== 'link'){\n resData += token.text;\n }else{\n //\n var href = pathJoin(location.href,token.attrs.href);\n if(href && (href in resList)){\n \n }else{\n resource.linkList.push(token); \n }\n }\n }\n if(token.tagName === 'head'){\n isInHeader = true;\n }\n if(token.tagName === 'body'){\n bodyData += token.text;\n tokenState = 1;\n }\n resData += token.text;\n continue;\n }\n \n if(token.type === 'endTag'){\n if(tokenState === 1){\n bodyData += token.text;\n }\n if(token.tagName === 'head'){\n isInHeader = false;\n }\n if(token.tagName === 'body'){\n tokenState = 0;\n }\n resData += token.text;\n continue;\n }\n resData += token.text;\n bodyData += token.text;\n }\n \n //显示数据\n success.call(null,bodyData,resource);\n }\n });\n \n }", "function toHTML (svelteOutput) {\n return [\n '<!DOCTYPE html>',\n '<html><head>',\n svelteOutput.head,\n '</head><body>',\n svelteOutput.html,\n '</body></html>'\n ].join('\\n')\n}", "function showResponse(response) {\r\n var responseString = JSON.stringify(response, '', 2);\r\n document.getElementById('response').innerHTML += responseString;\r\n}", "function displayHTML()\n{\n document.getElementById( \"outputDiv\" ).innerHTML = outputHTML;\n} // end function displayDoc", "renderHTML() {\n let domPurify = createDomPurify(new JSDOM().window);\n return { __html: domPurify.sanitize(this.state.post.html) }; //Sanitize html so no hackers can inject\n }", "function createHtmlForQueryResults(){\n var memberResults = responseResult.result;\n\n if(memberResults.length > 0){\n\n if(memberResults[0].member != undefined || memberResults[0].member != null){\n //console.log(\"member wise results found..\"); \n for(var i=0; i<memberResults.length; i++){\n //console.log(memberResults[i].member);\n $('#memberAccordion').append(createHtmlForMember(memberResults[i]));\n }\n }else{\n //console.log(\"cluster level results found..\");\n var accordionContentHtml = \"\";\n accordionContentHtml = createClusterAccordionContentHtml(memberResults);\n var resultHtml = \"<div class=\\\"accordion-content2\\\">\"+ accordionContentHtml +\"</div>\";\n $('#memberAccordion').append(resultHtml);\n }\n }else{\n $('#memberAccordion').append(\"<span> No Results Found...</span>\");\n }\n}", "getHTML() {\n const endIndex = this.strings.length - 1;\n let html = '';\n for (let i = 0; i < endIndex; i++) {\n const s = this.strings[i];\n // This exec() call does two things:\n // 1) Appends a suffix to the bound attribute name to opt out of special\n // attribute value parsing that IE11 and Edge do, like for style and\n // many SVG attributes. The Template class also appends the same suffix\n // when looking up attributes to create Parts.\n // 2) Adds an unquoted-attribute-safe marker for the first expression in\n // an attribute. Subsequent attribute expressions will use node markers,\n // and this is safe since attributes with multiple expressions are\n // guaranteed to be quoted.\n const match = lastAttributeNameRegex.exec(s);\n if (match) {\n // We're starting a new bound attribute.\n // Add the safe attribute suffix, and use unquoted-attribute-safe\n // marker.\n html += s.substr(0, match.index) + match[1] + match[2] +\n boundAttributeSuffix + match[3] + marker;\n }\n else {\n // We're either in a bound node, or trailing bound attribute.\n // Either way, nodeMarker is safe to use.\n html += s + nodeMarker;\n }\n }\n return html + this.strings[endIndex];\n }", "function displayUnitTests(req)\n{\n document.getElementById('unit-tests').innerHTML = req.responseText;\n}", "function NavBar_CreateHTMLObject(theObject)\n{\n\t//create the div\n\tvar theHTML = document.createElement(\"div\");\n\t//simple add\n\ttheHTML = Basic_SetParent(theHTML, theObject);\n\t//set its Basic Properties\n\tBasic_SetBasicProperties(theHTML, theObject);\n\t//set interpreter methods\n\ttheHTML.UpdateProperties = NavBar_UpdateProperties;\n\ttheHTML.GetHTMLTarget = NavBar_GetHTMLTarget;\n\t//update the content\n\tNavBar_UpdateContent(theHTML, theObject);\n\t//return the newly created object\n\treturn theHTML;\n}", "createDom() {\n var tempElement = this.getDomHelper().createElement('temp');\n\n this.updateBeforeRedraw();\n\n tempElement.innerHTML = this.buildHTML(true);\n\n this.setElementInternal(this.getDomHelper().\n getFirstElementChild(tempElement));\n }", "function getHtmlResult() {\n http.get(url, (res) => {\n const { statusCode } = res;\n let err;\n if (statusCode != 200) {\n err = new Error('请求失败.\\n' + `状态码:${statusCode}`);\n }\n if (err) {\n console.log(err.message);\n res.resume();\n return;\n }\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', (chunk) => {\n rawData += chunk;\n });\n res.on('end', () => {\n try {\n let htmlMd5 = md5.update(rawData).digest('hex');\n console.log(Date());\n console.log(htmlMd5);\n } catch (e) {\n console.error(e.message);\n }\n });\n })\n}", "function createHTML() {\n $(\".container\").append(\" <header>\\n <nav class=\\\"navbar navbar-expand-lg navbar-dark bg-primary\\\">\\n <button class=\\\"navbar-toggler\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarNavAltMarkup\\\" aria-controls=\\\"navbarNavAltMarkup\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n <span class=\\\"navbar-toggler-icon\\\"></span>\\n </button>\\n <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarNavAltMarkup\\\">\\n <div class=\\\"navbar-nav\\\">\\n <a class=\\\"nav-item nav-link\\\" id = \\\"home\\\" href=\\\"#\\\">Home</a>\\n <a class=\\\"nav-item nav-link\\\" id =\\\"all\\\" href=\\\"#\\\">Space</a>\\n <a class=\\\"nav-item nav-link\\\" id =\\\"newLocation\\\" href=\\\"#\\\">Add Locations</a>\\n\\n </div>\\n </div>\\n </nav>\\n \\n <br>\\n <h1 id=title> Space<br>Travel </h1>\\n <h3 style=\\\"color:lightgreen\\\">\" + user.user + \" online</h3>\\n <hr>\\n <content class=\\\"cont\\\">\\n </content>\\n </header><!-- /header -->\\n <main>\\n <content class=\\\"cont0\\\">\\n </content>\\n <div class=\\\"typewriter\\\">\\n <content class=\\\"cont1\\\">\\n </content></div>\\n </main>\\n <footer class=\\\"page-footer font-small blue\\\">\\n\\n \\t\\t<div class=\\\"text-center py-3\\\" >\\n \\t\\t<p style: \\\"color: blue\\\">\\u00A9 2019 Copyright: Philipp<p>\\n \\t\\t</div>\\n\\t\\t</footer>\");\n yx();\n }", "function call_into_innerhtml(x,y)\n{\n\tlet the_response=[];\n\tlet pagelocaction=x;\n\tlet callbacklocation=y;\n\t//button id\n\t//let thebtn=\"#\"+z;\n\t//let btnz=$(thebtn).html();\n\t//change the button state to loading\n\tcall_loader();\n\t$.ajax({\n\t\turl : pagelocaction,\n\t\ttype : \"POST\",\n\t\tsuccess : function(data)\n\t\t{\n\t\t\tif (data==\"\") {Toastz('warning','No Data Returned','');close_loader();return;}\n\t\t\tclose_loader();\n\t\t\t$(\"#\"+callbacklocation).html(data);\n\t\t\t\n\t\t\treturn;\t\n\t\t},\n\t\terror : function(data) \n\t\t{\n\t\t\tToastz('danger','Error Occured','');\n\t\t\t\n\t\t}\n\t}\n\t);\n\tclose_loader();\n\treturn;\n}", "render() {\n return html ``;\n }" ]
[ "0.67058796", "0.6376604", "0.6268358", "0.62579644", "0.61839056", "0.6179392", "0.6166648", "0.61453015", "0.6088579", "0.60719585", "0.6041743", "0.6038999", "0.6005426", "0.5968968", "0.59531385", "0.5945219", "0.59088063", "0.5899462", "0.5885394", "0.58508724", "0.58482647", "0.5825214", "0.57976097", "0.57962936", "0.57948685", "0.57740927", "0.5772851", "0.57660013", "0.5760358", "0.5754668", "0.57482576", "0.5742188", "0.57309127", "0.57285225", "0.57123196", "0.5708509", "0.57067645", "0.56904316", "0.56876683", "0.56861806", "0.5674623", "0.566959", "0.5651488", "0.56508917", "0.56362826", "0.56224084", "0.5622173", "0.56213695", "0.56102127", "0.5609739", "0.5587516", "0.55845696", "0.5577961", "0.5577174", "0.5574763", "0.55741906", "0.55689895", "0.55651116", "0.55588734", "0.55530363", "0.5550737", "0.5550714", "0.5550714", "0.5545745", "0.55416054", "0.5538023", "0.55376405", "0.55376405", "0.55356", "0.5526845", "0.55213577", "0.5515857", "0.5515703", "0.5512766", "0.551033", "0.5508893", "0.5505726", "0.54871064", "0.5486764", "0.5485578", "0.5478067", "0.5474914", "0.5473899", "0.5472647", "0.54703796", "0.546699", "0.54536736", "0.5451383", "0.5450626", "0.544897", "0.54409313", "0.54268205", "0.54249465", "0.5422501", "0.5416258", "0.541574", "0.5413148", "0.5409833", "0.54093647", "0.540379" ]
0.56767845
40
Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body
function openNav() { document.getElementById("mySideBar").style.width = "250px"; document.getElementById("main").style.marginLeft = "250px"; document.getElementById("main").style.width = "83%"; document.body.style.backgroundColor = "rgba(0,0,0,0.4)"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n if (screen.width<=630) {\n document.getElementById(\"mySidebar\").style.width = \"100%\";\n document.getElementById(\"mySidebar\").style.Left = \"0px\";\n\n }\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n\n}", "function openNav() {\n\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n // document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n}", "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n}", "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n}", "function centerMenu() {\r\n navHeight = nav.offsetHeight;\r\n winHeight = window.innerHeight;\r\n contentHeight = winHeight - (navHeight + header.offsetHeight);\r\n // check window width\r\n if (window.innerWidth > 1205) {\r\n // check window height\r\n // change the layout .. decrease the space bettween elements.. padding and margin\r\n if (winHeight > 710) {\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.3);\r\n sideMenu.querySelector('.data-container').style.marginBottom = '30px';\r\n sideMenu.querySelector('.title').style.marginBottom = '15px';\r\n sideMenu.querySelector('.title').style.paddingTop = '20px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '20px';\r\n } else if (winHeight <= 710 && winHeight > 600) {\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.2); \r\n } else if (winHeight <= 600 && winHeight >= 566) {\r\n sideMenu.querySelector('.data-container').style.marginBottom = '13px';\r\n sideMenu.querySelector('.title').style.marginBottom = '5px';\r\n sideMenu.querySelector('.title').style.paddingTop = '5px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '5px';\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.15);\r\n } else {\r\n num = 0;\r\n sideMenu.style.position = 'static';\r\n sideMenu.querySelector('.data-container').style.marginBottom = '20px';\r\n sideMenu.querySelector('.title').style.marginBottom = '15px';\r\n sideMenu.querySelector('.title').style.paddingTop = '15px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '15px';\r\n }\r\n if (num < 161) {\r\n num = 161.4;\r\n }\r\n sideMenu.style.top = num + 'px';\r\n } else {\r\n // set side menu to static position\r\n sideMenu.style.position = 'static';\r\n sideMenu.style.zIndex = 0;\r\n }\r\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"210px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n // document.canvas.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function setContentWidth(){\n\n\t\tvar sidebarNav = false;\n\t\tvar sidebarWidget = false;\n\t\tvar hiddenSideBarFlag = false;\n\n\t\t//used on pages\n\t\tif ($(\".sidebar_menu div.noSideBarMenuItems\")[0]){\n\n\t\t\tsidebarNav = false;\n\t\t} else {\n\n\t\t\tsidebarNav = true;\n\t\t}\n\n\t\tif ($(\".spotlight .widget-area\")[0] || $(\".page-widget-sidebar\")[0]) {\n\n\t\t\tsidebarWidget = true;\n\t\t} else {\n\n\t\t\tsidebarWidget = false;\n\t\t}\n\n\t\tif($(\"#page\").hasClass(\"hiddenSidebar\")) {\n\t\t\thiddenSideBarFlag = true;\n\t\t} else {\n\t\t\thiddenSideBarFlag = false;\n\t\t}\n\n\t\tif(sidebarWidget || sidebarNav) {\n\n\t\t\tif(hiddenSideBarFlag == true) {\n\n\t\t\t\t$(\"#content\").removeClass(\"has_nav\");\n\t\t\t} else {\n\t\t\t\t$(\"#content\").addClass(\"has_nav\");\n\t\t\t}\n\n\t\t} else {\n\t\t\t$(\"#content\").removeClass(\"has_nav\");\n\t\t}\n\n\n\t\t//used on posts\n\t\tif ($(\".post-content .widget-area\")[0]) {\n\t\t\t$(\".content-area\").addClass(\"span-66 right_margin\");\n\t\t} else {\n\t\t\t$(\".content-area\").removeClass(\"span-66 right_margin\");\n\t\t}\n\n\n\t}", "function navController(){\n if ( document.getElementById(\"mySidenav\").style.width == \"0px\" ){\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"250px\";\n }\n else {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"0px\";\n }\n }", "function openSidebar() {\n docBar.style.width = '250px';\n document.getElementById('main').style.marginLeft = '250px';\n}", "function openNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"250px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n }", "function openNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"250px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"auto\";\n document.getElementById(\"main\").style.marginLeft = \"400px\";\n }", "function openNav() {\n\t\tif (window.outerWidth ==768){\n\t\t\tdocument.getElementById(\"mySidenav\").style.width = \"220px\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"210px\";\n\t\t}\n\t\telse if (window.outerWidth >480){\n\t\t\tdocument.getElementById(\"mySidenav\").style.width = \"250px\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"250px\";\n\t\t}\n else{\n\t\t document.getElementById(\"mySidenav\").style.width = \"100%\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"100%\";\n\t\t}\n \n\t}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"70%\";\n // document.getElementById(\"flipkart-navbar\").style.width = \"50%\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function mainContentPaneWidth() { //What to do when the window is***************************resize\n\t//Recalculate the height of the navpane\n\tsideNav.style.height = mainContentPane.offsetHeight + \"px\";\n\t//Change the width of the main div\n\tvar navPaneW = sideNav.offsetWidth;\n\tvar mainDivWidth = window.innerWidth; //get the window size\n\tvar width = mainDivWidth - navPaneW + \"px\"; //Width for maincontentpane\n\t//mainContentPane.style.width=width;\n\t//fix the size of the horizontal navbar\n\t//hide the navigation pane when the window size is <1000px\t\n\t//Maximize the main content container\t\n\tif(mainDivWidth<1000) {\n\t\t\n\t\tsideNav.className=\"nphidden\"; //np=navepane\n\t\t\n\t\tmainContentPaneid.className = \"cpnarrow\";\n\t\tdocument.getElementsByClassName(\"contentdiv\")[0].style.width=\"100%\";\n\t\tsidepane.style.display=\"none\";\n\t}\n\telse if(mainDivWidth>=1000) { //put everything back when the width>1000\n\t\t\n\t\tif((sideNav.className==\"nphidden\" | sideNav.className==\"navpanescroll\") && horNavBar.className==\"hornavbarscrolled\") {\n\t\t\tsideNav.className=\"navpanescroll\";\n\t\t} else {\n\t\t\tsideNav.className=\"navpane\";\n\t\t}\n\t\tmainContentPaneid.className = \"maincontentpane floatmenu\";\n\t\tdocument.getElementsByClassName(\"contentdiv\")[0].style.width=\"80%\";\n\t\tsidepane.style.display=\"block\";\n\t}\n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width=\"250px\";\n document.getElementById(\"main\").style.marginLeft=\"250px\";\n document.getElementById(\"main_content\").style.marginLeft=\"250px\";\n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"242px\";\n document.getElementById(\"enhed\").style.marginLeft = \"242px\";\n}", "function openNav() {\n$('#mySidenav').css('width', '250px');\n$('#main').css('marginLeft', '250px');\n\n}", "function openSideBar(){\n document.getElementById(\"left-nav\").style.width=\"80px\";\n document.getElementById(\"main\").style.marginLeft=\"80px\";\n\n}", "function openNav() {\n // $(\"#body-div\").css(\"margin-left\", \"250px\");\n $(\"#mySidenav\").css(\"width\", \"250px\");\n // $(\"#body-div\").css(\"background-color\", \"rgba(0,0,0,0.4)\");\n $(\"#body-div\").css(\"opacity\", \"0.5\");\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n\n sideopen.style.marginLeft = \"250px\"; \n sideclose.style.visibility = \"visible\";\n sideclose.style.marginLeft = \"250px\";\n sideclose.style.zIndex = \"15\";\n sideopen.style.visibility = \"hidden\";\n \n}", "function openNav() {\n var windowWidth = $(window).width();\n console.log(windowWidth);\n if (windowWidth < 1000) {\n document.getElementById(\"mySidenav\").style.width = \"100%\";\n } else {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n document.getElementById(\"main\").style.paddingLeft = \"500px\";\n }\n}", "function sideNavResize() {\n let navArray = getNavWidth(); //Get sideNav width and offset values\n let navWidth = navArray[0];\n let navOffset = navArray[1];\n\n if (sideNavState() === \"closed\") { //If the sideNav is closed, apply the calculated width and offset\n document.getElementById(\"sideNav\").style.width = navWidth;\n document.getElementById(\"sideNav\").style.left = navOffset;\n } else { //Otherwise, apply the width value to the sideNav element width and sideNavDocOverlay element left properties\n document.getElementById(\"sideNav\").style.width = navWidth;\n document.getElementById(\"sideNavDocOverlay\").style.left = navWidth;\n }\n}", "function openNav() {\n document.getElementById(\"menubar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n }", "function closeNav() {\n document.getElementById(\"mySideBar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"5%\";\n\tdocument.getElementById(\"main\").style.width = \"90%\";\n document.body.style.backgroundColor = \" #fffdf4\";\n}", "function lockSidebarWidth() {\n var parent = $sideBar.parent();\n navHeight = $('.navbar').outerHeight(true);\n //console.log('Adjusting sidebar width: ' + parent.width());\n $sideBar.width(parent.width());\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function openNav() {\n document.getElementById(\"Sidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function showNav() {\n let navWidth = getNavWidth()[0]; //Get the sideNav Width\n document.getElementById(\"sideNav\").style.left = \"0px\"; //Set the sideNav left style property to 0 - this will transition the sideNav from it's offset position onto the window\n document.getElementById(\"sideNavDocOverlay\").style.zIndex = \"999\"; //Set the sideNavDocOverlay zIndex to 999. This will ensure that it appears over all content except the sideNav\n document.getElementById(\"sideNavDocOverlay\").style.backgroundColor = \"rgba(0,0,0,0.7)\"; //Set the sideNavDocOverlay backgroundColor style property to 70% translucent black (from 100% default)\n document.getElementById(\"sideNavDocOverlay\").style.left = navWidth; //Set the sideNavDocOverlay left style property to match the navWidth. This will transition the overlay from the left in line with the sideNav transition\n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n // document.canvas.style.backgroundColor = \"white\";\n}", "function setFullWidth() {\n var offset = $('.site-main').offset();\n\n $sections.css('width', $(window).width()).css(isRtl ? 'margin-right' : 'margin-left', -offset.left);\n }", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginRight = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function menuOpenClicked() {\n document.getElementById('leftSideBar').style.left = \"0\";\n document.getElementById('emptyPage').style.left = \"0\";\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "function displaySidebar(){\n var w = document.documentElement.clientWidth;\n\n var toggleButton = document.getElementById(\"openNav\");\n var main = document.getElementById(\"main\");\n var sidebar = document.getElementById(\"mySidebar\");\n var navbar = document.getElementById(\"navbar\");\n\n if(w >= 993) {\n\n main.style.marginLeft = \"300px\";\n sidebar.style.width = \"300px\";\n sidebar.style.display = \"block\";\n navbar.classList.add('w3-hide-large');\n }\n \n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"20%\";\n document.getElementById(\"main\").style.width = \"80%\";\n document.getElementById(\"main\").style.marginLeft = \"20%\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n\n}", "function open_sidenav() {\n document.getElementById(\"main-sidenav\").style.width = \"250px\";\n document.getElementById(\"home\").style.marginLeft = \"250px\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.body.style.marginLeft = \"250px\";\n document.body.style.marginRight = \"-250px\";\n document.getElementById(\"opacitified\").style.opacity = \"0.3\";\n document.getElementById(\"opacitified\").style.transition = \"1s\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function closeNav() {\n document.getElementById(\"sideNav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n }", "function closeNav() {\n document.getElementById(\"side_nav\").style.width = \"0%\";\n document.getElementById(\"info\").style.marginLeft = \"2%\";\n document.getElementById(\"logo\").style.left = \"1%\";\n document.body.style.backgroundColor = \"white\";\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"30%\";\n document.getElementById(\"main\").style.marginLeft = \"30%\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"18%\";\n document.getElementById(\"main\").style.marginLeft = \"18%\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function openNav(data) {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n getNavBar_html(data);\n document.getElementById(\"main\").style.marginLeft = \"500px\";\n document.body.style.backgroundColor = \"rgba(0,0,0)\";\n document.getElementById(\"main\").style.opacity = \"0.2\";\n}", "function openNav() {\n\tdocument.getElementById(\"mySidenav\").style.width = \"260px\";\n }", "static openNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"250px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"250px\");\n ElementHandler.hideElementById('openSidebar');\n }", "function sidePanel() {\n strokeWeight(0);\n textSize(36);\n textStyle(BOLD);\n textAlign(CENTER);\n textFont(\"Cambria\");\n\n //This makes the side pannel\n fill(0, 45, 72);\n rect(width - 400, 0, width, height);\n\n //This is for the dividers on the side pannel\n fill(0, 140, 174);\n rect(width - 400, 445, width, 8);\n rect(width - 400, 545, width, 8);\n rect(width - 400, 715, width, 8);\n\n //This is just used to label the pen color and pan size sliders\n fill(200, 241, 247);\n text(\"Pen Color\", width - 200, 40);\n text(\"Pen Size\", width - 200, 490);\n}", "function set_sidebar() {\n\n\tset_sidebar_pos(\".main .outer .row01 .navi_outer\");\n\tif ($(window).width() > 767) {\n\t\tset_sidebar_pos(\".main .outer .row02 .countdown_div .countdown_outer\");\n\t}\n\t$(window).resize(function () {\n\t\tset_sidebar_pos(\".main .outer .row01 .navi_outer\");\n\t\tif ($(window).width() > 767) {\n\t\t\tset_sidebar_pos(\".main .outer .row02 .countdown_div .countdown_outer\");\n\t\t}\n\t});\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function getContentMargin() {\n var margin = options.jq.contentWell.css('margin-left');\n contentMargin = (margin === options.params.closedNavMargin) ? contentMargin : margin;\n }", "function closeNav() {\n document.getElementById(\"ePontiSideNav\").style.width = \"0\";\n document.getElementById(\"header\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function openNav() {\n closeRightNav();\n document.getElementById(\"mySidenav\").style.width = \"550px\";\n document.getElementById(\"mySidenav\").style.left = \"0\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"200px\";\n document.getElementById(\"myContent\").style.opacity = 0.85;\n document.getElementById(\"footer\").style.display = \"none\";\n}", "function sidebarTopWidth() {\n\t\tif ( body.hasClass('sidebar-top-fixed') ) {\n\n\t\t\tif( parseInt( sidebarTop.attr('data-fullwidth'), 10 ) === 1) {\n\n\t\t\t\tsidebarTop.css({\n\t\t\t\t\t'left' : '0',\n\t\t\t\t\t'max-width' : 'none'\n\t\t\t\t});\n\n\t\t\t\tsidebarTop.children('div').css({\n\t\t\t\t\t'width' : mainWrap.outerWidth() +'px',\n\t\t\t\t\t'margin' : '0 auto'\n\t\t\t\t});\n\n\t\t\t} else {\n\t\t\t\tsidebarTop.css( 'width', mainWrap.outerWidth() +'px' );\n\t\t\t}\n\n\t\t}\n\t}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n }", "function leftMenuWidth(){\n\tif($(window).width() > 960){\n\t\ta = $(\"#content-wrap\").height();\n\t\t$(\"#header-wrap .fixedMenuBar\").height(a);\n\t\t$(\"#header-wrap .fixedMenuBar\").find('ul').height(a);\n\t}\n\tif($(window).width() < 960){\n\t\t$(\"#content-wrap .fixedMenuBar\").height(450);\n\t}\n}", "function openNav() {\n document.getElementById(\"navbar-side\").style.width = \"80%\";\n }", "function openNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"250px\";\r\n}", "function sidebarTopWidth() {\n\n\t\tif ( body.hasClass('sidebar-top-fixed') ) {\n\n\t\t\tif( parseInt( sidebarTop.attr('data-fullwidth'), 10 ) === 1) {\n\n\t\t\t\tsidebarTop.children('div').css({\n\t\t\t\t\t'width' \t: mainWrap.outerWidth() +'px',\n\t\t\t\t\t'margin' \t: '0 auto'\n\t\t\t\t});\n\n\t\t\t\tsidebarTop.css({\n\t\t\t\t\t'left'\t\t: '0',\n\t\t\t\t\t'width' \t: '100%',\n\t\t\t\t\t'max-width' : 'none'\n\t\t\t\t});\n\n\t\t\t} else {\n\n\t\t\t\tsidebarTop.css({\n\t\t\t\t\t'width' \t: mainWrap.outerWidth() +'px',\n\t\t\t\t\t'max-width' : 'none',\n\t\t\t\t\t'left' \t\t: 'auto',\n\t\t\t\t});\n\n\t\t\t\t// reset\n\t\t\t\tsidebarTop.children('div').css({\n\t\t\t\t\t'width' \t: '100%',\n\t\t\t\t\t'margin' \t: '0 auto'\n\t\t\t\t});\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tsidebarTop.css( 'width', '100%' );\n\n\t\t\tsidebarTop.children('div').css({\n\t\t\t\t'width' \t: '100%',\n\t\t\t\t'margin' \t: '0 auto'\n\t\t\t});\n\n\t\t}\n\n\t\tif ( sidebarTop.children('div').css('display') === 'inline-block' ) {\n\t\t\tsidebarTop.children('div').css('width', 'auto');\t\t\n\t\t}\n\t\t\n\t}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = '#ffefef';\n}", "function openNav() {\n document.getElementById(\"left_nav\").style.width = \"300px\";\n document.getElementById(\"main\").style.marginLeft = \"300px\";\n document.getElementById(\"navbarOnIndex\").style.marginLeft = \"300px\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"page-top\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n $(\"#OpenSidebar\").css('visibility', 'visible').hide().show(500);\n //document.getElementById('page1-text').style.marginLeft=\"10%\";\n}", "function setWHAside(){\n\tif (!$('body').hasClass('noaside')){\n\t\tif ($(window).width() > 1210){\n\t\t\t$('body').addClass('whaside');\n\t\t} else {\n\t\t\t$('body').removeClass('whaside');\n\t\t}\n\t}\n}", "function openNav() {\r\n\t\tdocument.getElementById(\"mySidenav\").style.width = \"100%\";\r\n\t}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n hideDivs();\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n //document.getElementById(\"main\").style.marginLeft = \"0\";\n //document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n //document.getElementById(\"main\").style.marginLeft = \"0\";\n //document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n $(\".user_sidebar\").css('width', '0%');\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.getElementById(\"headArticle\").style.width = \"98vw\";\n document.getElementById(\"boxArticle\").style.width = \"98vw\";\n}", "function openSideBar() \n{\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n}", "function fixWidth() {\r\n if (\r\n $(\".header-style-10\").length &&\r\n $(\".home-page-10\").length &&\r\n full_width > 768\r\n ) {\r\n var header_width = $(\".header-wrapper > .container\").width();\r\n $(\"#maincontent\").css({ width: header_width + 60, display: \"block\" });\r\n $(\".header-wrapper\").css({\r\n width: header_width + 60,\r\n display: \"block\",\r\n });\r\n }\r\n }", "function openNav() {\n $(\"#mySidenav\").css(\"width\", \"15%\");\n $(\"#main\").css(\"marginLeft\", \"15%\");\n $(\"#main\").css(\"Opacity\", \".4\");\n}", "function openNav() {\r\n\r\n if (x.matches) width = \"30%\";\r\n else width = \"50%\"; \r\n document.getElementById(\"mySidenav\").style.width = width;\r\n //document.getElementById(\"main\").style.marginLeft = width;\r\n}" ]
[ "0.6467901", "0.64344347", "0.64197123", "0.6400105", "0.6400105", "0.6362734", "0.6362734", "0.6362734", "0.6340359", "0.6322647", "0.6274176", "0.6102225", "0.6093096", "0.60584486", "0.60584486", "0.60437936", "0.60437936", "0.60370016", "0.5982772", "0.5978939", "0.59720117", "0.5955332", "0.5932818", "0.59249794", "0.5903675", "0.58689874", "0.5859035", "0.582191", "0.58210695", "0.5819874", "0.58187366", "0.5815498", "0.5808335", "0.5808335", "0.5808335", "0.5805777", "0.57948536", "0.57832766", "0.57822895", "0.5770852", "0.577", "0.5766577", "0.57626957", "0.5756506", "0.5756506", "0.5756506", "0.5756506", "0.574309", "0.57430714", "0.5714601", "0.5704729", "0.5702883", "0.57017416", "0.5684915", "0.567464", "0.5662666", "0.5658529", "0.56510025", "0.56510025", "0.56510025", "0.56510025", "0.56510025", "0.5622751", "0.5607268", "0.560597", "0.56028754", "0.5601088", "0.55926704", "0.55926704", "0.55926704", "0.55813676", "0.55754673", "0.5572124", "0.5572124", "0.5572124", "0.55697674", "0.5547213", "0.55471826", "0.55397713", "0.5539684", "0.55370724", "0.55216277", "0.5519164", "0.5511673", "0.550875", "0.55042315", "0.55015504", "0.5492939", "0.5487527", "0.548398", "0.5479289", "0.5479289", "0.54791486", "0.54791486", "0.5473936", "0.5473327", "0.5473239", "0.5470722", "0.54675305", "0.5462001" ]
0.6563949
0
Set the width of the side navigation to 0 and the left margin of the page content to 0, and the background color of body to white
function closeNav() { document.getElementById("mySideBar").style.width = "0"; document.getElementById("main").style.marginLeft = "5%"; document.getElementById("main").style.width = "90%"; document.body.style.backgroundColor = " #fffdf4"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeNav() {\n document.getElementById(\"sideNav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n // document.canvas.style.backgroundColor = \"white\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginRight = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function menuOpenClicked() {\n document.getElementById('leftSideBar').style.left = \"0\";\n document.getElementById('emptyPage').style.left = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n }", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n document.body.style.backgroundColor = \"white\";\r\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n //document.getElementById(\"main\").style.marginLeft = \"0\";\n //document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n //document.getElementById(\"main\").style.marginLeft = \"0\";\n //document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"page-top\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"ePontiSideNav\").style.width = \"0\";\n document.getElementById(\"header\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.backgroundColor = \"white\";\n}", "function hideNav() {\n let navOffset = getNavWidth()[1]; //Get the sideNav Width\n document.getElementById(\"sideNav\").style.left = navOffset; //Set the sideNav left style property to negative width - this will transition the sideNav fully off of the left side of the window\n document.getElementById(\"sideNavDocOverlay\").style.zIndex = \"-1000\"; //Set the sideNavDocOverlay zIndex to -1000, ensuring that it drops behind all other content\n document.getElementById(\"sideNavDocOverlay\").style.backgroundColor = \"rgba(0,0,0,0.0)\"; //Set the sideNavDocOverlay backgroundColor style property to the default of 100% translucent\n document.getElementById(\"sideNavDocOverlay\").style.left = \"0px\"; //Set the sideNavDocOverlay left style property to 0. This will transition the overlay across the window in line with the sideNav transition\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = '#ffefef';\n}", "function openNav() {\n document.getElementById(\"mySideBar\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n\tdocument.getElementById(\"main\").style.width = \"83%\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function navController(){\n if ( document.getElementById(\"mySidenav\").style.width == \"0px\" ){\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"250px\";\n }\n else {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"0px\";\n }\n }", "function closeNav() {\n document.getElementById(\"side_nav\").style.width = \"0%\";\n document.getElementById(\"info\").style.marginLeft = \"2%\";\n document.getElementById(\"logo\").style.left = \"1%\";\n document.body.style.backgroundColor = \"white\";\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"210px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n // document.canvas.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function closeNav() {\n $(\".user_sidebar\").css('width', '0%');\n document.body.style.backgroundColor = \"white\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.backgroundColor = \"lightyellow\";\n\n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n if (screen.width<=630) {\n document.getElementById(\"mySidebar\").style.width = \"100%\";\n document.getElementById(\"mySidebar\").style.Left = \"0px\";\n\n }\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n\n}", "function openNav() {\n\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n // document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n\n}", "function closeNav() {\n document.getElementById('mySidebar').style.width = '0'\n\n setContent(false)\n }", "function centerMenu() {\r\n navHeight = nav.offsetHeight;\r\n winHeight = window.innerHeight;\r\n contentHeight = winHeight - (navHeight + header.offsetHeight);\r\n // check window width\r\n if (window.innerWidth > 1205) {\r\n // check window height\r\n // change the layout .. decrease the space bettween elements.. padding and margin\r\n if (winHeight > 710) {\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.3);\r\n sideMenu.querySelector('.data-container').style.marginBottom = '30px';\r\n sideMenu.querySelector('.title').style.marginBottom = '15px';\r\n sideMenu.querySelector('.title').style.paddingTop = '20px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '20px';\r\n } else if (winHeight <= 710 && winHeight > 600) {\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.2); \r\n } else if (winHeight <= 600 && winHeight >= 566) {\r\n sideMenu.querySelector('.data-container').style.marginBottom = '13px';\r\n sideMenu.querySelector('.title').style.marginBottom = '5px';\r\n sideMenu.querySelector('.title').style.paddingTop = '5px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '5px';\r\n num = (contentHeight * 0.5) - (sideMenu.offsetHeight * 0.15);\r\n } else {\r\n num = 0;\r\n sideMenu.style.position = 'static';\r\n sideMenu.querySelector('.data-container').style.marginBottom = '20px';\r\n sideMenu.querySelector('.title').style.marginBottom = '15px';\r\n sideMenu.querySelector('.title').style.paddingTop = '15px';\r\n sideMenu.querySelector('.title').style.paddingBottom = '15px';\r\n }\r\n if (num < 161) {\r\n num = 161.4;\r\n }\r\n sideMenu.style.top = num + 'px';\r\n } else {\r\n // set side menu to static position\r\n sideMenu.style.position = 'static';\r\n sideMenu.style.zIndex = 0;\r\n }\r\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n $(\"#OpenSidebar\").css('visibility', 'visible').hide().show(500);\n //document.getElementById('page1-text').style.marginLeft=\"10%\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n }", "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n}", "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n}", "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"200px\";\r\n document.getElementById(\"main\").style.marginLeft = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n }", "function closeNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n}", "function closeNav() {\n $(\"#mySidenav\").css(\"width\", \"0\");\n // $(\"#body-div\").css(\"margin-left\", \"0\");\n // $(\"#body-div\").css(\"background-color\", \"white\");\n $(\"#body-div\").css(\"opacity\", \"1\");\n}", "function setContentWidth(){\n\n\t\tvar sidebarNav = false;\n\t\tvar sidebarWidget = false;\n\t\tvar hiddenSideBarFlag = false;\n\n\t\t//used on pages\n\t\tif ($(\".sidebar_menu div.noSideBarMenuItems\")[0]){\n\n\t\t\tsidebarNav = false;\n\t\t} else {\n\n\t\t\tsidebarNav = true;\n\t\t}\n\n\t\tif ($(\".spotlight .widget-area\")[0] || $(\".page-widget-sidebar\")[0]) {\n\n\t\t\tsidebarWidget = true;\n\t\t} else {\n\n\t\t\tsidebarWidget = false;\n\t\t}\n\n\t\tif($(\"#page\").hasClass(\"hiddenSidebar\")) {\n\t\t\thiddenSideBarFlag = true;\n\t\t} else {\n\t\t\thiddenSideBarFlag = false;\n\t\t}\n\n\t\tif(sidebarWidget || sidebarNav) {\n\n\t\t\tif(hiddenSideBarFlag == true) {\n\n\t\t\t\t$(\"#content\").removeClass(\"has_nav\");\n\t\t\t} else {\n\t\t\t\t$(\"#content\").addClass(\"has_nav\");\n\t\t\t}\n\n\t\t} else {\n\t\t\t$(\"#content\").removeClass(\"has_nav\");\n\t\t}\n\n\n\t\t//used on posts\n\t\tif ($(\".post-content .widget-area\")[0]) {\n\t\t\t$(\".content-area\").addClass(\"span-66 right_margin\");\n\t\t} else {\n\t\t\t$(\".content-area\").removeClass(\"span-66 right_margin\");\n\t\t}\n\n\n\t}", "function closeNav() \n{\n document.getElementById(\"sideNav\").style.width = \"0%\";\n document.getElementById(\"main\").style.marginLeft = \"0%\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.paddingLeft = \"0\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n //document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\n document.querySelector(\"#mySidebar\").style.width = \"0\";\n document.querySelector(\"#main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n $('#mySidenav').css('width', '0');\n $('#main').css('margin-left', '0');\n}", "function closeNav() {\n document.getElementById(\"sideNav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\n$('#mySidenav').css('width', '0');\n$('#main').css('marginLeft','0');\n}", "function closeNav(){\n document.getElementById(\"mySidebar\").style.width=\"0\";\n document.getElementById(\"main\").style.marginLeft=\"0\";\n document.getElementById(\"main_content\").style.marginLeft=\"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.getElementById(\"headArticle\").style.width = \"98vw\";\n document.getElementById(\"boxArticle\").style.width = \"98vw\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n }", "function closeSidebar() {\n docBar.style.width = '0';\n document.getElementById('main').style.marginLeft = '0';\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"-8px\";\n document.getElementById(\"enhed\").style.marginLeft = \"-8px\";\n}", "function sidebarOut() {\n let sidebarWidth = window.innerWidth\n let outerContainer = document.getElementById('container54')\n\n document.getElementById('sidenav').style.left = \"0%\" // I'm using left to make it look animated like the sidenav is moving\n document.getElementById('main').style.marginLeft = '20%'\n document.getElementById('main').style.paddingLeft = '20px'\n\n if(sidebarWidth<1000) {\n document.getElementById('styledit').innerHTML += \"<div id=\\'styledit2\\'><style>#firstcontainer54 {opacity: 0.3}</style></div>\"\n }\n document.getElementById('showsetting').onclick = function() {sidebarIn()}\n document.getElementById('showsetting').innerHTML = \"Hide Settings\"\n}", "function cleanMainAside() {\n /* Empty main and empty side bar */\n cleanMain();\n cleanAside();\n /* Remove error class in case it was set. */\n resetErrorMsgElement();\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginRight = \"0\";\n document.getElementById(\"nav_body\").style.paddingBottom = \"7%\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \"#2a2a2b\";\n document.getElementById(\"main\").style.opacity = \"1\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\r\n document.getElementById(\"menuSidebar\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.getElementById(\"menu\").style.color = \"#212529\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft= \"0\";\n document.getElementById(\"box\").style.marginLeft = \"0\";\n document.getElementById(\"box1\").style.marginLeft = \"0px\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.body.style.backgroundColor = \" rgba(111, 111, 182, 0.158)\";\n\n sideclose.style.marginLeft = \"0px\"; \n sideopen.style.visibility = \"visible\";\n sideopen.style.marginLeft = \"0px\";\n sideopen.style.zIndex = \"20\";\n sideclose.style.visibility = \"hidden\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function openNav() {\ndocument.getElementById(\"sidenav\").style.left = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.body.style.marginLeft = \"0px\";\n document.body.style.marginRight = \"0px\";\n document.getElementById(\"opacitified\").style.transition = \"1s\";\n document.getElementById(\"opacitified\").style.opacity = \"1\";\n document.body.style.backgroundColor = \"#EBF6F6\";\n}", "function setBaseStyles(){\n document.body.style.margin = 0;\n document.body.style.fontFamily = \"Helvetica, Arial, sans-serif\";\n document.body.style.fontSize = (window.innerWidth >= 600) ? \"16px\" : \"13px\";\n document.body.style.margin = document.documentElement.style.margin = 0;\n document.body.style.padding = document.documentElement.style.padding = 0;\n document.body.style.color = COLORS.DRK_GRAY;\n document.body.style.width = document.documentElement.style.width = '100%';\n document.body.style.height = document.documentElement.style.height = '100%';\n document.body.style.overflow = document.documentElement.style.overflow ='hidden';\n app.style.width = '100%';\n}", "function lockSidebarWidth() {\n var parent = $sideBar.parent();\n navHeight = $('.navbar').outerHeight(true);\n //console.log('Adjusting sidebar width: ' + parent.width());\n $sideBar.width(parent.width());\n }", "closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"auto\";\n document.getElementById(\"main\").style.marginLeft = \"400px\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "deactivateCondensedSidebar() {\n this.body.removeAttr('data-leftbar-compact-mode');\n }", "function closeNav() {\n document.getElementById(\"menubar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function setFullWidth() {\n var offset = $('.site-main').offset();\n\n $sections.css('width', $(window).width()).css(isRtl ? 'margin-right' : 'margin-left', -offset.left);\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}" ]
[ "0.64571106", "0.64564526", "0.63776743", "0.63110507", "0.62765867", "0.6269704", "0.6269704", "0.6269704", "0.6269704", "0.6269704", "0.6187079", "0.6187079", "0.6187079", "0.6186469", "0.6186469", "0.6186053", "0.6186053", "0.6186053", "0.61744153", "0.61616695", "0.6135777", "0.6135777", "0.61248606", "0.6107742", "0.61037755", "0.60438424", "0.6037957", "0.6032936", "0.6022847", "0.5999486", "0.5997536", "0.5971778", "0.5966587", "0.5942396", "0.59004545", "0.58935684", "0.58921164", "0.58921164", "0.58921164", "0.5883156", "0.5883156", "0.5883156", "0.5883156", "0.5883156", "0.58808327", "0.58808327", "0.5862643", "0.5862643", "0.58573717", "0.58517534", "0.5846792", "0.58358014", "0.5828537", "0.582161", "0.58182997", "0.58143544", "0.5811741", "0.57967395", "0.57936215", "0.57784075", "0.5775502", "0.5772911", "0.5770953", "0.576702", "0.5764472", "0.57565945", "0.5751828", "0.5745374", "0.574449", "0.5735223", "0.5731336", "0.5731336", "0.5731336", "0.5731336", "0.5731336", "0.5731336", "0.5731336", "0.5728823", "0.5726999", "0.57222253", "0.57205445", "0.5710226", "0.5710226", "0.57089776", "0.57089776", "0.57089776", "0.5688075", "0.56835735", "0.56831485", "0.5680997", "0.5659106", "0.5646395", "0.5645139", "0.5645139", "0.5645139", "0.563508", "0.5628883", "0.56266105", "0.56216407", "0.56216407" ]
0.62138486
10
Our component just got rendered
componentDidMount() { this.shouldNavigateAway(() => { this.props .dispatch(getAuthedUser(this.props.auth, this.props.id)) .then(() => this.setState({ loading: false })); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "onAfterRendering() {}", "static rendered () {}", "static rendered () {}", "onRender () {\n\n }", "didRender() {\n console.log('didRender ejecutado!');\n }", "onBeforeRendering() {}", "afterRender() { }", "afterRender() { }", "_didRender(_props, _changedProps, _prevProps) { }", "function render() {\n\n\t\t\t}", "_firstRendered() { }", "handleRendered_() {\n\t\tthis.isRendered_ = true;\n\t}", "onRender()/*: void*/ {\n this.render();\n }", "function render() {\n\t\t\t}", "postRender()\n {\n super.postRender();\n }", "render(){\r\n\r\n\t}", "willRender() {\n console.log('willRender ejecutado!');\n }", "render() {\n\n\t}", "render() {\n\n\t}", "render() {\n // Subclasses should override\n }", "postRender() {\n // Take component render method and apply UUID\n const componentElement = this.render();\n\n componentElement.setAttribute('data-component', this.uuid);\n\n this._element = componentElement;\n this.postUpdate();\n }", "render() {\n this.update();\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 }", "onBeforeRender () {\n\n }", "render() {\n if (!this.initialized) this.init();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "render() { return super.render(); }", "connectedCallback() {\r\n this.addComponentContent()\r\n }", "render() {\n return this.renderContent();\n }", "function handleRender() {\n\t view._isRendered = true;\n\t triggerDOMRefresh();\n\t }", "render() {\n return this.renderContent()\n }", "render(){\n console.log('Render Fired')\n return(\n <div>Lifecycle Method Examples</div>\n )\n }", "render() {\n\n return (\n <div>\n {this.renderContent()}\n </div>\n );\n \n }", "render() {\n if (!this.initialized) {\n this.init();\n }\n }", "function render() {\n\t}", "connectedCallback() {\n self.addComponentContent()\n }", "connectedCallback() {\n this.render();\n }", "function render() {\n\t\t\n\t}", "onRender () {\n console.log(this.component);\n if(undefined !== this.component) {\n this.el.querySelector(`[data-id=\"${this.component}\"]`).classList.add(\"active\");\n }\n\n var Navigation = new NavigationView();\n App.getNavigationContainer().show(Navigation);\n Navigation.setItemAsActive(\"components\");\n this.showComponent(this.component);\n\n }", "beforerender (el) {\n console.log('Component is about to be rendered for the first time')\n\n // this is where you can register other lifecycle events:\n // on.resize()\n // on.ready()\n // on.intersect()\n // on.idle()\n }", "render() {\n // always reinit on render\n this.init();\n }", "render() {\n // always reinit on render\n this.init();\n }", "_renderScreen() {\n\t\tif (this._el && this._component) {\n\t\t\tthis._component.render(this._el);\n\t\t}\n\t}", "rendered() {\n\t\t\t\tthis.hasStorePropsChanged_ = false;\n\t\t\t\tthis.hasOwnPropsChanged_ = false;\n\t\t\t}", "render() { }", "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "static finishedRenderingComponent() {\n\t\trenderingComponents_.pop();\n\t}", "render(){}", "render(){}", "render( ) {\n return null;\n }", "render() {\r\n return;\r\n }", "connectedCallback(){\n this.render()\n }", "beforeRender() { }", "render() {\r\n document.body.insertBefore(this.element, document.querySelector('script'));\r\n\r\n this.append(this.PageContent.element, [this.NewsList, this.Footer]);\r\n this.append(this.Sidebar.element, [this.SidebarTitle, this.SourcesList]);\r\n this.append(this.element, [this.Spinner, this.PageContent, this.Sidebar, this.ToggleBtn]);\r\n }", "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "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 this.el.innerHTML = this.template();\n\n setTimeout(() => {\n this.bindUIElements();\n }, 0);\n }", "render() {\n this.refresh();\n }", "componentDidUpdate(){\n console.log('my component just updated- it rendered');\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n\n }", "render() {\n this._addChooserHandler();\n this._addLoggerListeners();\n this._addButtonHandler();\n }", "connectedCallback () {\n console.log('connected')\n\n this.render()\n }", "function init() { render(this); }", "render() {\n }", "render() {\n\n }", "render() {\n\n }", "render() {\n\n }", "onRender () {\n\t\tthis.registerComponent(App.Compontents, \"app-controls\", TopBarControls, this.$el.find(\"#topbar-container\"), { title: \"Home\" });\n }", "didRender() {\n if (!this[STATE]) {\n this[STATE] = {\n $holder: this.$(\".holder\"),\n $runBtn: this.$(\"button\")\n };\n this[STATE].$runBtn.addEventListener(\"click\", this);\n this.onPropsChange(this._handleAutoRun, \"autoRun\");\n }\n }", "ready() {\n super.ready();\n\n const that = this;\n\n that._render();\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "function render() {\r\n\r\n}", "function render() {\r\n\r\n}", "function render() {\n\n isRendered = true;\n\n renderSource();\n\n }", "build() {\n const componentsRenderer =\n this.namespace().ComponentRenderer.new({ rootComponent: this })\n\n this.renderWith(componentsRenderer)\n }", "render(...args) {\n if (this._render) {\n this.__notify(EV.BEFORE_RENDER);\n this._render(...args);\n this.__notify(EV.RENDERED);\n }\n\n this.rendered = true;\n }", "_render() {\n this._reactComponent = this._getReactComponent();\n if (!this._root) this._root = createRoot(this._container.getElement()[0]);\n this._root.render(this._reactComponent);\n }", "render()\n {\n return super.render();\n }", "_afterRender () {\n this.adjust();\n }", "onComponentConstructed() {}", "onComponentConstructed() {}", "update () {\n this.render();\n }", "$render(displayRef) {\n if(this.$alive)\n this.render.apply(this, [this, displayRef]);\n }", "_render()\n {\n if (this.isDisabled())\n return;\n\n this._setContentSizeCss();\n this._setDirection();\n const paragraph = html`<p>${this.text}</p>`;\n let anchor = \"\";\n let action = \"\";\n if (this.link && this.linkText)\n anchor = html`<a href=\"${this.link}\" target=\"_blank\">${this.linkText}</a>`;\n if (this.action && this.actionText)\n action = html`${anchor ? \" | \" : \"\"}<a href=\"javascript:void(0)\" @click=${this.action}>${this.actionText}</a>`;\n let heading = \"\";\n if (this.heading)\n heading = html`<h4>${this.heading}</h4>`;\n\n render(html`${heading}${paragraph}<div id=\"links\">${anchor}${action}</div>`, this.tooltipElem);\n }", "render() {\n\t\treturn <div>{this.renderContent()}</div>;\n\t}", "componentDidMount() {\r\n console.log(\"El componente se renderizó\");\r\n }", "function render() {\n\n\t\t\tisRendered = true;\n\n\t\t\trenderSource();\n\n\t\t}", "renderContent() {\n return null;\n }" ]
[ "0.7532576", "0.73727936", "0.7353397", "0.7353397", "0.7323151", "0.72538215", "0.72395265", "0.7210754", "0.7210754", "0.7200434", "0.71859515", "0.7182143", "0.716166", "0.71540457", "0.7137834", "0.710127", "0.6953705", "0.69468975", "0.69430166", "0.69430166", "0.69411296", "0.69203925", "0.68583614", "0.68553483", "0.68553483", "0.68553483", "0.6786047", "0.6776191", "0.67662966", "0.67662966", "0.6760947", "0.675333", "0.675333", "0.6753123", "0.6744714", "0.6736186", "0.6726246", "0.6718184", "0.6718", "0.67082983", "0.6682428", "0.6676708", "0.66599697", "0.6649318", "0.66480446", "0.6645434", "0.66419613", "0.66384554", "0.66384554", "0.6638109", "0.663037", "0.66148674", "0.6603675", "0.65948135", "0.6585134", "0.6585134", "0.65820616", "0.65775144", "0.65742195", "0.65581316", "0.65552014", "0.6542406", "0.6533421", "0.6529325", "0.6525489", "0.6514007", "0.65123373", "0.65058243", "0.65052277", "0.6495968", "0.6495594", "0.64953977", "0.6490401", "0.6490401", "0.6490401", "0.6488221", "0.64814675", "0.6472409", "0.64718103", "0.64718103", "0.6463708", "0.6463708", "0.6463708", "0.6463708", "0.64552724", "0.64552724", "0.644623", "0.6446092", "0.64352036", "0.64295137", "0.64226085", "0.64224625", "0.64174783", "0.64174783", "0.6412937", "0.6412864", "0.64092505", "0.6404034", "0.63981605", "0.6387119", "0.6382306" ]
0.0
-1
Our component just got updated
componentDidUpdate() { this.shouldNavigateAway(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update() {\n // ... no implementation required\n }", "updated() {}", "updated(){\n console.log('Updated');\n }", "update() {\n // Subclasses should override\n }", "componentDidUpdate() {\n console.log('[Order Summary] DidUpdate'); \n }", "afterupdate (el) {\n console.log('Component was updated')\n }", "componentDidUpdate() {}", "componentDidUpdate() {}", "componentDidUpdate() {}", "componentDidUpdate() {}", "componentDidUpdate() {}", "componentDidUpdate() {\n console.log(\"Component Did Update\")\n }", "_update() {\n }", "componentDidUpdate() { }", "componentDidUpdate() { }", "componentDidUpdate()\n {\n console.log(\"Update acquired\");\n }", "componentDidUpdate() {\n console.log(\"Component updated\");\n }", "update()\n {\n \n }", "update() {\n \n }", "componentDidUpdate() {\n console.log('[OrderSummary] did update');\n }", "firstUpdated(e){}", "didUpdate() {}", "function update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "componentDidUpdate() {\n console.log(\"The component just updated\");\n }", "shouldComponentUpdate(){\n console.log(\"LifeCcyleB shouldComponeentUpdate\")\n return true\n }", "componentDidUpdate() {\n console.log('After updating a component');\n }", "componentDidUpdate() {\n this.componentData();\n }", "update() {\n this.forceUpdate();\n }", "update() {\n this.forceUpdate();\n }", "refreshUpdateStatus() {}", "componentDidUpdate(){\n console.log('componentDidUpdate Fired')\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 }", "_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 }", "componentDidUpdate(){\n console.log(\"componentDidUpdate called\")\n }", "update() {\n this._checkEvents();\n }", "componentDidUpdate(){\n console.log(\"ComponentDidUpdate........\");\n }", "update () {}", "update() { }", "update() { }", "componentDidUpdate() {\n console.log(\"Component - App - updated\");\n }", "willUpdate() {\n }", "afterUpdate() {}", "update() {\n // ...\n }", "componentDidUpdate() {\n\n }", "componentDidUpdate() {\n\n }", "componentDidUpdate() {\n\n }", "didUpdate() { }", "componentDidUpdate () {\n console.log('methode componentDidUpdate a ete appele')\n }", "componentDidUpdate() {\n }", "componentDidUpdate() {\n this.update();\n }", "componentDidUpdate() {\n this.update();\n }", "componentDidUpdate() {\n this.update();\n }", "componentDidUpdate() {\n console.log('componentDidUpdate');\n }", "componentDidUpdate() {\n console.log(\"My component was just updated\");\n }", "getRefresh() {\r\n this.forceUpdate();\r\n }", "function update() {\n updateBodyCostDisplay();\n updateAddedComponentDisplay();\n updateBodyStringDisplay();\n updateComponentCountDisplay();\n updateComponentCountTable();\n updateProgressBar();\n }", "onEntityModelComponentUpdate(userViewId) {\n // we don't want to update components if we were the ones who updated it\n if (userViewId === this.viewId) {\n this.lastTimeComponentsWereUpdated = this.lastTimeComponentsWereSet;\n } else {\n this.updateComponents();\n }\n }", "shouldComponentUpdate(){\n\t\tconsole.log('Should component update')\n\t\treturn true;\n\t}", "beforeUpdate(){\n console.log('beforeUpdate');\n }", "function update() {\n\t\t\n\t}", "shouldComponentUpdate() {\n\t\tconsole.log('Function called: %s', 'shouldComponentUpdate');\n\t}", "update() {\n }", "update() {\n }", "update() {\n }", "updated(_changedProperties) { }", "componentDidUpdate() { //triggered if data changed in the database\n this.setData()\n }", "componentDidUpdate(prevProps, prevState, snapshot){\n console.info(this.constructor.name+' Did my component updated?');\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "componentDidUpdate() {\n }", "update() {\n\t\tif (this.hasChangedBesidesElement_() && this.shouldUpdate(this.changes_)) {\n\t\t\tthis.patch();\n\t\t\tthis.eventsCollector_.detachUnusedListeners();\n\t\t\tthis.disposeUnusedSubComponents_();\n\t\t}\n\t}", "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "componentDidUpdate(){\n console.log('After Update')\n }", "componentDidUpdate(prevProps,prevState,snapshot){\n console.log(\"I am in Component Did Update\");\n console.log(\"------------------------------------------\");\n }", "update() {\n }", "update() {\n }", "firstUpdated() {}", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "componentDidUpdate(){\n console.log('Component Did update');\n }", "componentDidUpdate(prevProps){\nconsole.log('componentdidUpdate',prevProps);\n}", "componentDidUpdate() {\n console.log(`Se actualizó el componente y se ejecutó componentDidUpdate. El valor del contador es: ${this.state.valor}`)\n }", "updated(e){}", "componentDidUpdate(preProps,preState,a){\n console.log(\"componentDidUpdate\",a)\n }", "update() {\n\n }", "update() {\n\n }" ]
[ "0.75659233", "0.7549686", "0.75179875", "0.7468388", "0.73158187", "0.73153985", "0.7197263", "0.7197263", "0.7197263", "0.7197263", "0.7197263", "0.7138228", "0.71340305", "0.7129429", "0.7129429", "0.71273214", "0.7121043", "0.70975786", "0.70770305", "0.7062664", "0.704556", "0.7043772", "0.70388055", "0.70254815", "0.70254815", "0.70254815", "0.70254815", "0.70254815", "0.70254815", "0.70254815", "0.70254815", "0.70254815", "0.70090663", "0.7008269", "0.70055217", "0.6997498", "0.6997157", "0.6997157", "0.6983285", "0.6983189", "0.6973783", "0.6972624", "0.6967188", "0.6962423", "0.6961436", "0.6955684", "0.6944843", "0.6944843", "0.6933881", "0.69258624", "0.6924118", "0.6920489", "0.6913301", "0.6913301", "0.6913301", "0.69069403", "0.6905123", "0.68951833", "0.6889963", "0.6889963", "0.6889963", "0.68855363", "0.6883503", "0.68755966", "0.6867714", "0.6862261", "0.6860009", "0.6850662", "0.68470776", "0.6846999", "0.6841913", "0.6841913", "0.6841913", "0.68407255", "0.6839842", "0.6838831", "0.68336695", "0.68336695", "0.68336695", "0.68336695", "0.68336695", "0.68336695", "0.68336695", "0.6832", "0.68213457", "0.6800588", "0.67921835", "0.6792047", "0.6787384", "0.6787384", "0.6777477", "0.6773664", "0.6773664", "0.6773664", "0.6773655", "0.67733496", "0.6764114", "0.6757206", "0.6755672", "0.67464274", "0.67464274" ]
0.0
-1
positive modulo for outofbounds array access
function modulo(arr, index) { return (arr.length + (index % arr.length)) % arr.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_mod(val) {\r\n if (this.pillar === false) return val\r\n return (val + this.largezero) % this.grid.length\r\n }", "_mod(val) {\n if (this.pillar === false) return val\n return (val + this.largezero) % this.width\n }", "function evansMod(i, mod) {\n while (i < 0) {\n i += mod;\n }\n return i % mod;\n}", "wrap(index) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function multipleOfIndex(array){\n\n// loop through the imput array with filter()\n// for each element, check to see if the modulus % of each element's INDEX, divided by itself, is == 0.\n// if it is, push that element into a new array.\n\nreturn array.filter((e, i) => e % i === 0)\n\n}", "function mod (x, y) {return x < 0? y - (-x % y) : x % y;}", "function testRemainder_17() {\n assertEquals(-0, -0 % Number.MAX_VALUE);\n}", "function mod(n,m){\n n = n%m;\n if(n<0) n+=m;\n return n;\n}", "function mod( a, b ){ let v = a % b; return ( v < 0 )? b+v : v; }", "function negativeindex(array, num){\n array=array[array.length+num]\n return array\n}", "function mod(n, m) {\r\n return ((n % m) + m) % m;\r\n}", "function modulo(r, l){\n\n return modulo(r-2, l);\n}", "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "function mod(input, div){\n return (input % div + div) % div;\n}", "function Wrap(index, length) {\n\t if (index < 0)\n\t index += Math.ceil(-index/length)*length;\n\t return index % length;\n\t}", "function mod (n, m) {\n return ((n % m) + m) % m\n}", "function mod(n, m) {\n return ((n % m) + m) % m\n}", "function moduloWithUnusedNegativeZeroDividend(a, b, c)\n{\n var temp = a * b;\n return (temp % c) | 0;\n}", "function mod(n, m)\n{\n\treturn ((n % m) + m) % m;\n}", "function mod(n, m) {\n return ((n % m) + m) % m\n}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}" ]
[ "0.67774326", "0.65961987", "0.6526993", "0.64628106", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.6273249", "0.62558407", "0.6192013", "0.61744505", "0.5914202", "0.5910607", "0.58757424", "0.58575726", "0.584661", "0.58375114", "0.58375114", "0.58375114", "0.58375114", "0.58375114", "0.58375114", "0.58375114", "0.5790813", "0.5780816", "0.5764649", "0.5758614", "0.5756594", "0.57526994", "0.57470304", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823", "0.5705823" ]
0.7100841
0
Function gets a new movie then fills the appropriate html info
function getNewMovie(args) { console.log("Getting new movie"); var req = new XMLHttpRequest(); req.open("GET", request_path+"/recommendations/"+user_id, true); req.onload = function() { var response = JSON.parse(req.response); movie_id = response["movie_id"]; getMovieInfo(args); } req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMovieInformation() {\n document.querySelector( '.movie-information' ).innerHTML = getTemplate();\n }", "function printMovieDetail() {\n if (movie.bkgimage != null) {\n bkgImageElt.css('background-image', `url(${movie.bkgimage})`);\n }\n else {\n bkgImageElt.css('background-image', `linear-gradient(rgb(81, 85, 115), rgb(21, 47, 123))`);\n }\n\n titleElt.text(movie.title);\n modalTitle.text(movie.title);\n originaltitleElt.text(movie.originaltitle);\n resumeElt.text(movie.resume);\n dateElt.text(printDateFr(movie.date));\n durationElt.text(printDuration(movie.duration));\n imgElt.attr('src', movie.image);\n iframe.attr('src', movie.traileryt + \"?version=3&enablejsapi=1\");\n // Afficher la liste des acteurs\n var actorsStr = '';\n for (var actor of movie.actors) {\n actorsStr += actor + ' | ';\n }\n actorsElt.text(actorsStr);\n // afficher le réalisteur\n directorElt.text(movie.director);\n}", "function showMovies() {\r\n movies.forEach(function(movie) \r\n {\r\n fetch('https://www.omdbapi.com/?t=' + movie.title + '&apikey=789d41d5')\r\n .then(response => {\r\n return response.json();\r\n })\r\n .then(data =>\r\n {\r\n //creating the DOM elements for the movies to be displayed and adding attributes to give them function and styling\r\n \r\n const section = document.createElement('section');\r\n const article = document.createElement('article');\r\n const images = document.createElement('img');\r\n const imgDiv = document.createElement('div');\r\n imgDiv.setAttribute('class', 'imgDiv');\r\n\r\n images.src = data.Poster;\r\n images.alt = data.Title + 'poster';\r\n\r\n const h2 = document.createElement('h2');\r\n h2.innerHTML = data.Title;\r\n\r\n const button = document.createElement('button');\r\n button.innerHTML = 'Watch trailer';\r\n \r\n button.setAttribute('onClick', \"buttonClick(\"+movie.youtubeId+\")\");\r\n\r\n\r\n\r\n const expandDiv = document.createElement('div');\r\n expandDiv.setAttribute('class', 'description');\r\n const h3 = document.createElement('h3');\r\n const plot = document.createElement('p');\r\n const div2 = document.createElement('div');\r\n div2.setAttribute('class', 'rating');\r\n const ratingSource = document.createElement('p');\r\n const ratingValue = document.createElement('p');\r\n const age = document.createElement('p');\r\n\r\n h3.innerHTML = 'Description'\r\n plot.innerHTML = data.Plot;\r\n ratingSource.innerHTML = data.Ratings[0].Source;\r\n ratingValue.innerHTML = data.Ratings[0].Value;\r\n \r\n // Calculate the age of the movie using current date and the movies release date\r\n let today = new Date();\r\n let currentYear = today.getFullYear();\r\n\r\n age.innerHTML = currentYear - data.Year + \" years old\";\r\n \r\n // Creating DOM elements for the movie trailer\r\n const videoDiv = document.createElement('div');\r\n videoDiv.setAttribute('class', 'videoModal')\r\n const video = document.createElement('iframe');\r\n video.src = youtube.generateEmbedUrl(movie.youtubeId);\r\n videoDiv.setAttribute('class','videoModal');\r\n videoDiv.setAttribute('id',movie.youtubeId);\r\n\r\n // Append elements to the body\r\n section.appendChild(article);\r\n article.appendChild(imgDiv);\r\n imgDiv.appendChild(images);\r\n article.appendChild(h2);\r\n article.appendChild(button);\r\n article.appendChild(expandDiv);\r\n expandDiv.appendChild(h3);\r\n expandDiv.appendChild(plot);\r\n expandDiv.appendChild(div2);\r\n div2.appendChild(ratingSource);\r\n div2.appendChild(ratingValue);\r\n expandDiv.appendChild(age);\r\n article.appendChild(videoDiv);\r\n videoDiv.appendChild(video);\r\n\r\n document.getElementById('body').appendChild(section);\r\n })\r\n \r\n }\r\n \r\n ) \r\n}", "function createMovie(movie) {\n let elMovie = movieTemplate.cloneNode(true);\n\n elMovie.querySelector(\".movie-img\").src = movie.poster;\n elMovie.querySelector(\".movie-img\").width = \"300\";\n elMovie.querySelector(\".movie-title\").textContent = movie.title;\n\n movie.genres.forEach((genre) => {\n let newGenreLi = makeElement(\"li\");\n\n newGenreLi.textContent = genre;\n elMovie.querySelector(\".genre-list\").appendChild(newGenreLi);\n\n getMovieGenre(genre);\n });\n\n elMovie.querySelector(\".movie-year\").textContent = date(movie.release_date);\n elMovie.querySelector(\".item-btn\").dataset.id = movie.id;\n elMovie.querySelector(\".bookmark-btn\").dataset.id = movie.id;\n\n movieList.appendChild(elMovie);\n}", "function getMovie() {\n\n let movieId = sessionStorage.getItem('movieId');\n api_key = '98325a9d3ed3ec225e41ccc4d360c817';\n\n $.ajax({\n\n url: `https://api.themoviedb.org/3/movie/${movieId}`,\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n },\n\n //get acess to movie information;\n success: function(data) {\n\n\n\n var movie = data;\n let output = `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" class=\"thumbnail\">\n <div id=\"visitS\">\n <a id=\"visitSite\" target=\"_blank\" href=\"${movie.homepage}\"> Visit Movie Site</a>\n </div>\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title}</h2>\n <ul class=\"list-group\" id=\"list-group\">\n\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.release_date}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.vote_average}</li>\n <li class=\"list-group-item\"><strong>Runtime:</strong> ${movie.runtime} min.</li>\n <li class=\"list-group-item\"><strong>Production Companies:</strong> ${movie.production_companies[0].name} min.</li>\n </ul>\n <div>\n <div id=\"overview\">\n <h3>Overview</h3> ${movie.overview}\n </div>\n <div id=\"imdbb\">\n <a id=\"imdb\" href=\"http://imdb.com/title/${movie.imdb_id}\" target=\"_blank\" <i class=\"fab fa-imdb fa-3x\"></i></a>\n </div>\n <div>\n <a class=\"navbar-brand\" id=\"go2\" href=\"index.html\">Go Back</a>\n \n </div>\n \n </div> \n \n `;\n //print movie selected information\n $('#movie').html(output);\n\n\n }\n\n })\n\n}", "function showMovie(response) {\n let movie = response;\n\n //neki filmovi/serije imaju vise rezisera, glumaca i zanrova i da bi ljepse mogli da ih prikazemo na stranici od stringa koji dobijemo napravimo niz elemenata\n var str = movie.Actors;\n var str2 = movie.Director;\n var str3 = movie.Genre;\n\n var stars = str.split(\", \");\n var directors = str2.split(\", \");\n var genres = str3.split(\", \");\n\n //ukoliko nemamo podatke o slici prikazemo default sliku iz foldera\n if (movie.Poster == \"N/A\") {\n movie.Poster = \"./Images/default.jpg\";\n }\n\n //prikazujemo redom podatke\n $(\"#movie-title-name\").append(movie.Title + ' <span id=\"movie-year\"></span>');\n $(\"#movie-year\").append(movie.Year);\n\n //ukoliko IMDb ocjene nisu dostupne, prikazemo odgovarajucu poruku\n if (movie.imdbRating === 'N/A') {\n $(\"#movie-rating\").append('<span>Ratings are not available<span>');\n } else {\n $(\"#movie-rating\").append(movie.imdbRating + '/10 <span>' + movie.imdbVotes + ' votes </span>');\n }\n\n $(\"#img\").append('<img src=' + movie.Poster + ' alt=\"\">');\n\n if (movie.Plot === 'N/A') {\n $('#movie-description').append('Plot is not available at this moment. :)');\n } else {\n $('#movie-description').append(movie.Plot);\n }\n\n directors.forEach(director => {\n $('#movie-director').append('<p>' + director + '</p>');\n });\n\n stars.forEach(star => {\n $('#movie-stars').append('<p>' + star + '</p>');\n });\n\n genres.forEach(genre => {\n $('#movie-genre').append('<p>' + genre + '</p>');\n });\n\n $('#movie-released').append(movie.Released);\n $('#movie-runtime').append(movie.Runtime);\n\n //ukoliko je Type -> serija onda prikazemo ukupan broj sezona \n //prikazemo i select sa svim sezonama te serije gdje na klik mozemo prikazati sve epizode odredjene sezone\n //po defaultu je selectovana poslednja sezona serije, kako bi odmah pri ulasku u seriju imali izlistane epizode \n if (movie.Type == 'series') {\n $('#movie-seasons').append('<h3>Seasons:</h3><p>' + movie.totalSeasons + '</p>');\n\n $('#series-season').append(\n '<p class=\"heading-des\">Episodes> ' +\n '<select onchange=\"getSeason(\\'' + movie.Title + '\\')\" id=\"select-episodes\">' +\n '</select>' +\n '</p>' +\n '<hr class=\"about\">' +\n '<div class=\"description\">' +\n '<div id=\"episodes\">' +\n '</div>' +\n '</div>'\n )\n }\n\n $('#movie-cast').append(\n '<p>Director: ' + movie.Director + '</p>' +\n '<p>Writer: ' + movie.Writer + '</p>' +\n '<p>Stars: ' + movie.Actors + '</p>'\n )\n\n if (movie.Ratings.length == 0) {\n $('#movie-reviews').append('<p>Ratings are not available at this moment. :)</p>')\n } else {\n movie.Ratings.forEach(rating => {\n $('#movie-reviews').append('<p>' + rating.Source + ' --> ' + rating.Value + '</p>')\n });\n }\n\n if (movie.Awards === 'N/A') {\n $('#movie-awards').append('Awards are not available at this moment. :)');\n } else {\n $('#movie-awards').append(movie.Awards);\n }\n\n $('#movie-imdb-btn').append(\n '<button onClick=\"openImdbPage(\\'' + movie.imdbID + '\\')\" class=\"btn-imdb\">' +\n '<i class=\"fab fa-imdb\"></i> IMDb' +\n '</button>'\n )\n\n //za ukupan broj sezona serije ispunimo select sa tolikim brojem opcija\n for (i = 1; i <= movie.totalSeasons; i++) {\n $('#select-episodes').append(\n '<option selected=\"selected\" value=\"\\'' + i + '\\'\">Season ' + i + '</option>'\n )\n }\n\n if (movie.Type === \"series\") {\n\n //prikazemo sve epizode selektovane sezone\n getSeason(movie.Title);\n\n }\n\n //ukoliko smo otvorili epizodu prikazemo na stranici na kojoj smo epizodi i sezoni \n //i prikazemo dugme za povratak na seriju\n if (movie.Type === \"episode\") {\n $(\"#episode-details\").append(\n '<span class=\"episode-span\">Season ' + movie.Season + ' </span>' +\n '<span class=\"season-span\">Episode ' + movie.Episode + '</span>'\n )\n $(\"#button-tvshow\").append(\n '<button onClick=\"openMovie(\\'' + movie.seriesID + '\\')\" class=\"btn-search\">' +\n '<i class=\"fas fa-chevron-left\"></i>' +\n ' Back to TV Show' +\n '</button>'\n )\n }\n}", "function populateModal(movie){\n document.title = movie['movieName'] + \" - FilmDags\";\n $('#posterTitle').text(movie['movieName']);\n $('#genreAge').text(movie['genreName'] + \", \" + movie['age'] + \" - \" + movie['formattedLength']);\n $('.embed-responsive-item').attr('src', movie['highQualityTrailerLink']);\n var actorList = \"\";\n for (i = 0; i <= movie['actors'].length-1; i++){\n if(i != movie['actors'].length-1){\n actorList += movie['actors'][i]['name'] + \", \";\n }\n else{\n actorList += movie['actors'][i]['name']\n }\n }\n $('#actors').text(actorList);\n $('#desc').text(movie['shortDescription']);\n $('#directors').text(movie['directors'][0]['name']);\n}", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "function displayMovieInfo() {\n\n$(\"#movies-view\").empty();\n$(\"#movies-photo\").empty();\n\nvar movie = $(this).attr(\"data-name\");\nvar queryURL = \"https://www.omdbapi.com/?t=\" + movie + \"&apikey=trilogy\";\n\n// Creating an AJAX call for the specific movie button being clicked\n$.ajax({\nurl: queryURL,\nmethod: \"GET\"\n}).then(function(response) {\n\nconsole.log(response);\n\n// Creating an element to have the rating displayed\nvar pOne = $(\"<p>\").text(response.Ratings[1].Source + \": \");\nvar rating = $(\"<span>\").text(response.Ratings[1].Value);\n$(pOne).append(rating); \n\n\n// Creating an element to hold the release year\nvar pTwo = $(\"<p>\").text(\"Released: \");\nvar released = $(\"<span>\").text(response.Released);\n$(pTwo).append(released); \n\n// Creating an element to hold the release year\nvar pSix = $(\"<p>\").text(\"Director: \");\nvar diretor = $(\"<span>\").text(response.Director);\n$(pSix).append(diretor); \n\n// Creating an element to hold the plot\nvar pThree = $(\"<p>\").text(\"Plot: \");\nvar plot = $(\"<span>\").text(response.Plot);\n$(pThree).append(plot); \n\n// Creating an element to hold the Actors \nvar qFour = $(\"<p>\").text(\"Actors: \");\nvar actor = $(\"<span>\").text(response.Actors); \n$(qFour).append(actor); \n\n\nvar qFive = $(\"<p>\").text(\"Awards: \")\nvar awards = $(\"<span>\").text(response.Awards);\n$(qFive).append(awards); \n\n\n// Retrieving the URL for the image\nvar imgURL = response.Poster;\n\n// Creating an element to hold the image\nvar image = $(\"<img>\").attr({\"src\": imgURL,\n \"height\": \"430px\",\n \"width\": \"320px\" });\n$(\"#movies-photo\").append(image);\n\n// Putting the entire movie above the previous movies\n//$(\"#movies-view\").prepend(movieDiv);\n$(\"#movies-view\").append(pOne, pTwo, pSix, pThree, qFour, qFive);\n});\n\n}", "function performPage() {\r\n var movie_title = $('[class^=TitleHeader__TitleText]').text().trim();\r\n // reference\r\n if (movie_title === \"\") {\r\n movie_title = $('h3[itemprop=\"name\"]').text().trim();\r\n movie_title = movie_title.substring(movie_title.lastIndexOf(\"\\n\") + 1, -1 ).trim();\r\n }\r\n var movie_title_orig = $('[class^=OriginalTitle__OriginalTitleText]').text().trim().replace(\"Original title: \", \"\");\r\n // reference\r\n if (movie_title_orig === \"\" && $('h3[itemprop=\"name\"]').length) {\r\n movie_title_orig = $.trim($($('h3[itemprop=\"name\"]')[0].nextSibling).text());\r\n }\r\n // not found\r\n if (movie_title_orig === \"\") {\r\n movie_title_orig = movie_title;\r\n }\r\n\r\n var movie_id = document.URL.match(/\\/tt([0-9]+)\\//)[1].trim('tt');\r\n var is_tv = Boolean($('title').text().match('TV Series'));\r\n // newLayout || reference : check if 'title' has just a year in brackets, eg. \"(2009)\"\r\n var is_movie = (Boolean($('[class^=TitleBlock__TitleMetaDataContainer]').text().match('TV')) || Boolean($('li.ipl-inline-list__item').text().match('TV Special'))) ? false : Boolean($('title').text().match(/.*? \\(([0-9]*)\\)/));\r\n // newLayout || reference\r\n if (Boolean($('[class^=GenresAndPlot__Genre]').text().match('Documentary')) || Boolean($('li.ipl-inline-list__item').text().match('Documentary'))) {\r\n is_tv = false;\r\n is_movie = false;\r\n }\r\n\r\n // Start of External ratings code\r\n if (GM_config.get(\"ratings_cfg_imdb\") || GM_config.get(\"ratings_cfg_metacritic\") || GM_config.get(\"ratings_cfg_rotten\") || GM_config.get(\"ratings_cfg_letterboxd\")) {\r\n externalRatings(movie_id, movie_title, movie_title_orig);\r\n }\r\n // Call to iconSorterCount() for the icons/sites sorting.\r\n iconSorterCount(is_tv, is_movie);\r\n\r\n // Create areas to put links in\r\n addIconBar(movie_id, movie_title, movie_title_orig);\r\n perform(getLinkArea(), movie_id, movie_title, movie_title_orig, is_tv, is_movie);\r\n if (GM_config.get('load_second_bar') && !GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaSecond();\r\n } else if (!GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && !GM_config.get('switch_bars')) {\r\n getLinkAreaSecond();\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && GM_config.get('switch_bars')) {\r\n getLinkAreaThird();\r\n getLinkAreaSecond();\r\n }\r\n}", "function displayMovieInfo() {\n\n // YOUR CODE GOES HERE!!! HINT: You will need to create a new div to hold the JSON.\n\n }", "function Display_Movie_Bios(film)\n{\n var indexNumber = movieIndex.indexOf(film);\n document.getElementById(\"Movie_Name\").innerHTML = film;\n document.getElementById(\"Movie_Description\").innerHTML = movies[indexNumber][0];\n\n var img = document.createElement('img');\n img.setAttribute('src', movies[indexNumber][1]);\n document.getElementById('Movie_Poster').appendChild(img);\n}", "function appendMovieInfo(info, movie) {\n const targetMovie = document.getElementById(movie.imdbID);\n targetMovie.innerHTML = targetMovie.innerHTML + info;\n}", "function loadMovieDescription(pos) {\n $('.movie-plot').text(movies[pos].summary);\n // $('#moviegenres').text(movies[pos].Genres);\n //$('#moviedirector').text(movies[pos].director);\n $('.movie-cast').text(movies[pos].cast);\n $(\".movie_img\").show();\n}", "function movieResultSection(response) {\n //Title\n let newMovieTitle = response.Title;\n $('#movie-title').html(newMovieTitle);\n \n //Pass this title in case it needs to be saved to local storage\n results(\"movie\", newMovieTitle);\n\n //Poster\n let newMoviePosterURL = response.Poster;\n $('#movie-poster').attr('src', newMoviePosterURL);\n\n //Rated\n let newMovieRating = response.Rated;\n $('#movie-rating').html(`Rated: ${newMovieRating}`);\n \n //Plot\n let newMoviePlot = response.Plot;\n $('#movie-plot').html(newMoviePlot);\n\n //Score\n let newMovieScore = response.imdbRating;\n $('#movie-score').html(`imdbRating: ${newMovieScore} / 10`);\n\n //URL\n newImdbURL = \"https://www.imdb.com/title/\" + response.imdbID;\n $('#movie-url').attr('href',newImdbURL);\n}", "function displayMovieInfo(title, year, plot, rating) {\n let movieInfoString = `<h3>${title} (${year})</h3>\n <aside>IMDB Rating: ${rating}</aside>\n <article>${plot}</article>\n <video></video>`;\n $(\"#one-movie-description\").html(movieInfoString);\n }", "displaySingleMovie(movie) {\n // console.log('MOVIE IS DISPLAYED')\n\n this.movieEl.movieName.innerHTML = movie.original_title\n this.movieEl.movieTagline.innerHTML = movie.tagline\n this.movieEl.movieStory.innerHTML = movie.overview\n this.movieEl.movieGenre.innerHTML = this.movieDataStructuring(movie.genres, 'name')\n this.movieEl.movieProduction.innerHTML = this.movieDataStructuring(movie.production_companies, 'name')\n this.movieEl.movieReleaseDate.innerHTML = movie.release_date\n this.movieEl.movieIncome.innerHTML = `$${movie.revenue}`\n this.movieEl.voteAverage.innerHTML = `${movie.vote_average} / 10`\n this.movieEl.runningTime.innerHTML = `${movie.runtime} mins`\n this.movieEl.moviePoster.src = `https://image.tmdb.org/t/p/original${movie.poster_path}`\n this.movieEl.body.style.backgroundImage = `url(https://image.tmdb.org/t/p/original${movie.backdrop_path})`\n }", "function showMovies(movies) {\n //loop through the data and for each movie we create a new div\n movies.forEach((movie)=> {\n //destructure the object\n const {poster_path, title, overview } = movie\n\n //create a div\n const movieCard = document.createElement(\"div\");\n movieCard.classList.add(\"card\");\n \n movieCard.innerHTML= `\n <img src=${IMGPATH + poster_path } alt=${title} />\n <h1>${title}</h1>\n <p>${overview}</p>\n `;\n //implement movie properties into the inner HTML of movieCard\n main.appendChild(movieCard);\n });\n \n}", "function renderMovie(data) {\n $(\"#movie-modal-body\").empty();\n var movieTitle = data.Title;\n var moviePosterURL = data.Poster;\n var genre = data.Genre;\n var releaseDate = data.Released;\n var plot = data.Plot;\n var titleEl = $(\"#movie-title\");\n var genreEl = $(\"<p>\");\n var plotEl = $(\"<p>\");\n var imgEl = $(\"<img>\");\n var releasedEl = $(\"<p>\");\n console.log(titleEl);\n\n titleEl.text(movieTitle);\n genreEl.text(genre);\n plotEl.text(plot);\n imgEl.attr({ src: moviePosterURL, alt: \"movie poster\" });\n releasedEl.text(\"Released: \" + releaseDate);\n\n $(\"#findBooks\").attr(\"data-movie\", movieTitle);\n $(\"#movie-modal-body\").append(genreEl, imgEl, plotEl, releasedEl);\n $(\"#movieModal\").modal(\"show\");\n}", "function showMovieDetails(movie)\n{\n movieTitle.html(movie.title);\n movieDesc.html(movie.description);\n moviePoster.attr(\"src\", movie.posterImage.attr(\"src\"));\n movieView.on(\"click\", function() {\n window.location.href = \"/movie.html?imdb=\" + movie.imdb;\n });\n\n // Show info to user\n movieDetails.modal(\"show\");\n}", "function displaySelectedMovie(movieData) {\n movieSelectorContainer.style.display = \"none\";\n movieSelectedScreen.style.display = \"block\";\n\n var posterUrl = \"https://image.tmdb.org/t/p/w500\" + movieData.poster_path;\n\n var filmTitle = document.getElementById(\"film-title\");\n filmTitle.textContent = movieData.original_title;\n var posterImage = document.getElementById(\"poster\");\n posterImage.setAttribute(\"src\", posterUrl);\n var ageCertificate = document.getElementById(\"age\");\n ageCertificate.textContent = movieData.adult;\n ageCertificate.style.color = \"orange\";\n var countryLanguage = document.getElementById(\"country\");\n countryLanguage.textContent = movieData.original_language;\n countryLanguage.style.color = \"orange\";\n var yearReleased = document.getElementById(\"year-released\");\n yearReleased.textContent = movieData.release_date;\n yearReleased.style.color = \"orange\";\n var filmSynopsis = document.getElementById(\"synopsis\");\n filmSynopsis.textContent = movieData.overview;\n filmSynopsis.classList.add(\"filmSynopsis\");\n document\n .getElementById(\"back-btn\")\n .addEventListener(\"click\", function goBack() {\n window.history.back();\n });\n document.getElementById(\"save-btn\").addEventListener(\"click\", function (e) {\n e.preventDefault();\n saveFilmHistory(movieData.id);\n });\n}", "function movieList() {\r\n for (let i = 0; i < movieInfo.length; i++) {\r\n //Generate list for nowshowing movies\r\n if (movieInfo[i].type == \"now\") {\r\n document.getElementById(\"nowVideoDiv\").innerHTML +=\r\n \"<div>\" +\r\n \"<dt><span>Movie: </span>\" +\r\n movieInfo[i].name +\r\n \"</dt>\" +\r\n '<dd class=\"thumbnail\"><img onclick=\"switchVideo(' +\r\n (movieInfo[i].id - 1) +\r\n ')\" src=\"../image/' +\r\n movieInfo[i].thumbnail +\r\n '\" alt=\"' +\r\n movieInfo[i].name +\r\n '\"></dd>' +\r\n \"<dd><span>Cast: </span>\" +\r\n movieInfo[i].cast +\r\n \"</dd>\" +\r\n \"<dd><span>Director: </span>\" +\r\n movieInfo[i].director +\r\n \"</dd>\" +\r\n \"<dd><span>Duration: </span>\" +\r\n movieInfo[i].duration +\r\n \" mins</dd>\" +\r\n \"</div>\";\r\n }\r\n\r\n //Generate list for upcoming movies\r\n if (movieInfo[i].type == \"upcoming\") {\r\n document.getElementById(\"upcomingVideoDiv\").innerHTML +=\r\n \"<div>\" +\r\n \"<dt><span>Movie: </span>\" +\r\n movieInfo[i].name +\r\n \"</dt>\" +\r\n '<dd class=\"thumbnail\"><img onclick=\"switchVideo(' +\r\n (movieInfo[i].id - 1) +\r\n ')\" src=\"../image/' +\r\n movieInfo[i].thumbnail +\r\n '\" alt=\"' +\r\n movieInfo[i].name +\r\n '\"></dd>' +\r\n \"<dd><span>Cast: </span>\" +\r\n movieInfo[i].cast +\r\n \"</dd>\" +\r\n \"<dd><span>Director: </span>\" +\r\n movieInfo[i].director +\r\n \"</dd>\" +\r\n \"<dd><span>Duration: </span>\" +\r\n movieInfo[i].duration +\r\n \" mins</dd>\" +\r\n \"</div>\";\r\n }\r\n }\r\n}", "function movieFetch() {\n fetch(movieURL)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n var titleSpot = document.getElementById('post-header')\n // if no movie data is pulled\n if (data.Error) {\n titleSpot.textContent = 'Sorry, not a valid movie title';\n var movieStuffEl = document.getElementById('movieStuff')\n var relatedStuffEl = document.getElementById('relatedContent')\n while (poster.firstChild) {\n poster.removeChild(poster.childNodes[0]);\n }\n while (movieStuffEl.firstChild) {\n movieStuffEl.removeChild(movieStuffEl.childNodes[0]);\n }\n while (relatedStuffEl.firstChild) {\n relatedStuffEl.removeChild(relatedStuffEl.childNodes[0]);\n }\n\n } else {\n // resets title\n while (titleSpot.textContent) {\n titleSpot.textContent = '';\n }\n // sets title\n titleSpot.textContent = data.Title;\n \n poster = document.getElementById(\"poster\"); \n\n // resets poster\n while (poster.firstChild) {\n poster.removeChild(poster.childNodes[0]);\n }\n\n // sets poster\n img = document.createElement('img'); \n img.src = data.Poster\n poster.appendChild(img); \n\n // Contains all the ratings\n var ratings = data.Ratings\n var allRatings =[\n ratings[0]['Source'] + ': ' + ratings[0]['Value'] + '\\n' +\n ratings[1]['Source'] + ': ' + ratings[1]['Value'] + '\\n' +\n 'IMDB Rating: ' + data.imdbRating + '\\n' +\n 'Metascore: ' + data.Metascore\n ]\n \n // All information stored in array\n var infoArr = [\n 'MPA Rating: ' + data.Rated,\n 'Runtime: ' + data.Runtime,\n 'Genres: ' + data.Genre,\n 'Summary: ' + data.Plot,\n 'Release Date: ' + data.Released,\n allRatings,\n 'Actors: ' + data.Actors,\n 'Directors: ' + data.Director,\n 'Writers: ' + data.Writer,\n 'Box Office Earnings: ' + data.BoxOffice,\n 'Production Team: ' + data.Production\n ]\n\n // Loops through array and populates webpage and console\n var movieStuffEl = document.getElementById('movieStuff')\n\n while (movieStuffEl.firstChild) {\n movieStuffEl.removeChild(movieStuffEl.childNodes[0]);\n }\n\n for (var i = 0; i < infoArr.length; i++) {\n if (document.getElementById('checkbox' + i).checked) {\n var infoItem = document.createElement('p')\n infoItem.textContent = infoArr[i]\n movieStuffEl.append(infoItem)\n }\n }\n\n\n\n // Starts fetches for wiki.\n wikiFetch();\n }\n });\n}", "function buildMovie(url, name, year, id) {\n let genre;\n let rating;\n //console.log(info(id))\n info(id).then(value => {\n genre = value[0];\n rating = value[1];\n });\n //console.log(info(id))\n\n let image = document.createElement(\"div\");\n\n let title = document.createElement(\"div\");\n image.appendChild(title);\n title.classList.toggle('blockFilm_adv');\n\n let nameOfFilm = document.createElement(\"h1\");\n image.appendChild(nameOfFilm);\n nameOfFilm.classList.toggle('span1');\n\n let ratingOfFilm = document.createElement(\"div\");\n title.appendChild(ratingOfFilm);\n ratingOfFilm.classList.toggle('span4');\n\n let imgRating = document.createElement(\"IMG\");\n title.appendChild(imgRating);\n imgRating.classList.toggle('img');\n\n let genreOfFilm = document.createElement(\"span\");\n title.appendChild(genreOfFilm);\n genreOfFilm.classList.toggle('span2');\n\n let yearOfFilm = document.createElement(\"span\");\n title.appendChild(yearOfFilm);\n yearOfFilm.classList.toggle('span3');\n\n\n let newImg = new Image;\n newImg.onload = function() {\n //console.log('55');\n image.src = this.src;\n }\n newImg.src = url;\n //console.log(newImg.src);\n\n if (newImg.src[0] === 'h') {\n \n image.classList.add(\"blockFilm\");\n image.style.background = `url(\"${url}\")`;\n\n image.addEventListener(\"mouseover\", function () {\n document.body.style.cursor = \"pointer\";\n image.style.background = `linear-gradient( 180deg, rgba(0, 0, 0, 0) 26.43%, rgba(0, 0, 0, 0.8) 72.41% ), url(\"${url}\")`;\n nameOfFilm.textContent = name;\n yearOfFilm.textContent = year;\n genreOfFilm.textContent = genre;\n ratingOfFilm.textContent = rating;\n const currentRatingImg = currentRating (rating);\n imgRating.src = \"img/png/r0\" + currentRatingImg + \".png\";\n imgRating.style.display = 'inline';\n });\n image.addEventListener(\"mouseout\", function() {\n document.body.style.cursor = \"auto\";\n image.style.backgroundImage = `url(\"${url}\")`;\n nameOfFilm.textContent = '';\n yearOfFilm.textContent = '';\n genreOfFilm.textContent = '';\n ratingOfFilm.textContent = '';\n imgRating.style.display = 'none';\n });\n\n image.addEventListener(\"click\", () => {\n window.open(\"https://www.imdb.com/title/\" + id);\n });\n\n } else {\n image.classList.add(\"blockNoWords\"); \n nameOfFilm.textContent = name;\n yearOfFilm.textContent = year;\n genreOfFilm.textContent = genre;\n }\n\n\n\n //console.log(nameOfFilm)\n\n\n return image;\n}", "function getDetails () {\ndocument.getElementById('details').innerHTML = `\n<h2>${movieData.title}</h2>\n<p>${movieData.overview}</p>\n<img src=\"${movieData.poster}\" alt=\"${movieData.title}\">\n`\n}", "function appendMovieDetails(STMovieObject) {\n // gets movie info for clicked on movie from local storage\n let storedOmbdMovieInfo = localStorage.getItem(STMovieObject.title);\n let parsedOmdbMovieInfo = JSON.parse(storedOmbdMovieInfo);\n\n \n let movieDetailsDiv = document.querySelector('[data-info-pop]');\n \n // draws summary into pop up div\n let movieSummaryH2 = document.createElement('h2');\n movieSummaryH2.textContent = parsedOmdbMovieInfo.Plot;\n\n movieDetailsDiv.append(movieSummaryH2);\n\n // draws movie MCAA rating into pop up div\n let MCAARatingH2 = document.createElement('h2')\n MCAARatingH2.textContent = parsedOmdbMovieInfo.Rated\n\n movieDetailsDiv.append(MCAARatingH2);\n\n\n // draws IMDB review into pop up div\n let ratingsH2 = document.createElement('h2');\n ratingsH2.textContent = `IMDB Rating: ${parsedOmdbMovieInfo.imdbRating} / 10`;\n\n if (parsedOmdbMovieInfo.imdbRating === \"N/A\") {\n ratingsH2.textContent = \"\";\n }\n movieDetailsDiv.append(ratingsH2);\n\n}", "function popUpMovie(elem) {\n\tparent = $(elem).parent();\n\tvar title = parent.find(\"td:first-child\").text();\n\tvar movieID = parent.find(\"td:nth-child(3) div\").attr('data-tmdbId');\n\tvar rating = parent.find(\"td:nth-child(3)\").html();\n\n\t$.getJSON(\"https://api.themoviedb.org/3/movie/\" + movieID + \"?api_key=179888c2888c0074bf9579eb0dfca026&language=\" + lookUp[currentLanguage], function(tmdb) {\n\t\tif (tmdb) {\n\t\t\tvar toAdd = \"<img src='http://image.tmdb.org/t/p/w185\"+tmdb.poster_path+\"'/>\";\n\t\t\ttoAdd += \"<div class='movieRight'>\";\n\t\t\ttoAdd += rating;\n\t\t\ttoAdd += \"<div id='movieRating'>\" + tmdb.vote_average * 10 + \"<span id='percent'>%</span> </div>\";\n\t\t\ttoAdd += \"<div id='movieRelease'>\" + new Date(tmdb.release_date).toLocaleDateString() + \"</div>\";\n\t\t\ttoAdd += \"<div id='movieRuntime'>\" + tmdb.runtime + lan[\"minutes\"] + \"</div>\";\n\t\t\ttoAdd += \"<div id='movieOverview'>\" + tmdb.overview + \"</div>\";\n\t\t\ttoAdd += \"</div>\";\n\n\t\t\t// add our info in\n\t\t\t$(\"#movieModal #movieBody\").html(toAdd);\n\n\t\t\t// empty table\n\t\t\t$(\"#simliarMovies tbody\").html(\"\");\n\n\t\t\t$.ajax({\n\t\t\t\turl: \"/getSimilar\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tdata: {\"title\" : title},\n\t\t\t\tcache: false,\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t// would error if not logged in\n\t\t\t\t\t\t\n\t\t\t\t\tif (data != \"error\") {\n\t\t\t\t\t\tlan = dict[currentLanguage];\n\t\t\t\t\t\tdata = JSON.parse(data); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// convert back to array\n\n\t\t\t\t\t\tfor (e in data) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// loop through all movies\n\n\t\t\t\t\t\t\tmovie = data[e];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// get movie\n\t\t\t\t\t\t\tgenre = movie[1].split(\"|\");\n\n\t\t\t\t\t\t\tfor (w in genre)\n\t\t\t\t\t\t\t\tgenre[w] = lan[genre[w]];\n\n\t\t\t\t\t\t\tgenre = genre.join(\", \");\n\t\t\t\t\t\t\trating = Math.ceil(movie[2]);\n\n\t\t\t\t\t\t\tif (rating == 0) {\n\t\t\t\t\t\t\t\trating = Math.ceil(movie[3]);\n\t\t\t\t\t\t\t\textraClass = \"dim\"\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\titem = \"<tr>\" +\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// new row\n\t\t\t\t\t\t\t\t\"<td>\" + movie[0] + \"</td>\" +\n\t\t\t\t\t\t\t\t\"<td>\" + genre + \"</td>\" +\n\t\t\t\t\t\t\t\t\"<td>\" +\n\t\t\t\t\t\t\t\t\t\"<div class='starContainer \"+ extraClass + \" highlight\" + rating + \"' \" +\n\t\t\t\t\t\t\t\t\t\"data-tmdbId='\"+ movie[4] +\"' \" +\n\t\t\t\t\t\t\t\t\t\"data-title='\"+ movie[0] +\"'>\" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='1' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='2' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='3' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='4' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='5' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t\"</div></td>\";\n\n\t\t\t\t\t\t\t$(\"#simliarMovies tbody\").append(item); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// append movie to table\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if no results were returned\n\t\t\t\t\t\tif(data.length == 0) {\n\t\t\t\t\t\t\t$(\"#simliarMovies tbody\").append(lan[\"notEnough\"]);\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$(\"#movieModal #movieModalTitle\").text(title);\n\t$(\"#movieModal\").modal(\"show\");\n}", "function renderMovieDetails(poster, title, score, releaseDate, length, plot, error) {\n\n $('#inputBox').val(\"\");\n\n let posterImg = $('<img class=\"movie-poster\">').attr('src', poster);\n let titleText = $('<h1>').addClass(\"movie-title\").text(title);\n let scoreText = $('<p>').addClass(\"movie-details\").text(`Score: ${score}`);\n let releaseText = $('<p>').addClass(\"movie-details\").text(`Release Date: ${releaseDate}`);\n let lengthText = $('<p>').addClass(\"movie-details\").text(`Movie Length: ${length}`);\n let plotText = $('<p>').addClass(\"movie-details\").text(plot);\n // let errorText = $('<p>').addClass(\"error-message\").text(`Movie not found!`);\n\n let newRow = $(`<div class=\"columns\">`);\n let newCol1 = $(`<div class=\"column\" id=\"col1\">`);\n let newCol2 = $(`<div class=\"column\" id=\"col2\">`);\n\n newCol1.append(posterImg);\n newCol2.append(titleText);\n newCol2.append(scoreText);\n newCol2.append(releaseText);\n newCol2.append(lengthText);\n newCol2.append(plotText);\n\n newRow.append(newCol1, newCol2);\n\n $(\".movie-screen\").append(newRow);\n\n // error message\n // if (error === \"Movie not found!\") {\n // $('#col2').append(errorText);\n // }\n\n }", "function displayNewMovie(movie) {\n\n let divNode = document.createElement(\"div\");\n divNode.setAttribute(\"id\", `movieID${movie.id}`);\n\n\n //create title node and append\n let ttlNode = document.createElement(\"p\");\n ttlNode.setAttribute(\"class\", \"title\");\n ttlNode.innerHTML = `${movie.title}`;\n divNode.appendChild(ttlNode);\n\n\n //create year node and append\n let yrNode = document.createElement(\"p\");\n yrNode.setAttribute(\"class\", \"year\");\n yrNode.innerHTML = `${movie.year}`;\n divNode.appendChild(yrNode);\n\n //create rating node and append\n let rtNode = document.createElement(\"p\");\n rtNode.setAttribute(\"class\", \"rating\");\n rtNode.innerHTML = `${movie.rating}`;\n divNode.appendChild(rtNode);\n\n let genreNode = document.createElement(\"p\");\n genreNode.setAttribute(\"class\", \"genre\");\n genreNode.innerHTML = `${movie.genre}`;\n divNode.appendChild(genreNode);\n\n let usrRtNode = document.createElement(\"p\");\n usrRtNode.setAttribute(\"class\", \"usrRating\");\n usrRtNode.innerHTML = `${movie.userRating}`;\n divNode.appendChild(usrRtNode);\n\n let imgNode = document.createElement(\"p\");\n imgNode.setAttribute(\"class\", \"image\");\n imgNode.innerHTML = `${movie.image}`;\n divNode.appendChild(imgNode);\n\n //create edit node and append\n let ediNode = document.createElement(\"p\");\n ediNode.setAttribute(\"class\", \"edit\");\n ediNode.innerHTML = `<img src=\"pen1.png\" alt=\"pen icon\"> Edit`;\n divNode.appendChild(ediNode);\n\n //create delete node and append\n let delNode = document.createElement(\"p\");\n delNode.setAttribute(\"class\", \"dlt\");\n delNode.innerHTML = `<img src=\"trash1.jpg\" alt=\"trash icon\"> Delete`;\n divNode.appendChild(delNode);\n\n outEl.appendChild(divNode);\n\n\n setTimeout(() => {\n var editBtnsList = document.getElementsByClassName('edit');\n var dletBtnsList = document.getElementsByClassName('dlt');\n\n for (let i = 0; i < editBtnsList.length; i++) {\n editBtnsList.item(i).addEventListener(\"click\", editMovie);\n dletBtnsList.item(i).addEventListener(\"click\", deleteMovie);\n }\n }, 0);\n}", "function getInfos(movie, doc){\n getMovies(moviePath + movie.id).then(function(response){\n\n var movie = new Movie(\n response.image_url, response.title,\n response.genres, response.date_published, response.rated,\n response.imdb_score, response.directors, response.actors,\n response.duration, response.countries,\n response.worldwilde_gross_income, response.description\n );\n\n let newImage = document.createElement('img');\n newImage.src = movie.image_url;\n newImage.title = movie.title;\n\n var modalImg = document.getElementById(\"img01\");\n var captionText = document.getElementById(\"caption\");\n\n newImage.onclick = function(){\n modal.style.display = \"block\";\n modalImg.src = newImage.src;\n captionText.innerHTML = \"Film: \" + movie.title + \"<br>\" + \"Genre: \" + movie.genre + \"<br>\" +\n \"Date de sortie: \" + movie.date_published + \"<br>\" + \"Rated: \" + movie.rated + \"<br>\" +\n \"Imdb score: \" + movie.imdb_score + \"<br>\" + \"Réalisateurs: \" + movie.directors + \"<br>\" +\n \"Acteurs: \" + movie.actors + \"<br>\" + \"Durée: \" + movie.duration + \"min\" + \"<br>\" +\n \"Pays: \" + movie.countries + \"<br>\" + \"Entrées Box office: \" + movie.box_office_score + \"<br>\" +\n \"Résumé: \" + movie.resume; \n \n }\n doc.append(newImage);\n })\n}", "function showMovie(movie){\n if(movie.Poster == \"N/A\"){\n var generalPoster = \"https://www.movieinsider.com/images/none_175px.jpg\" //In case the DB doesnt have poster\n var newMovie = $('<div id=\"'+movie.imdbID+'\" class=\"found-movie\">' +\n '<img src=\"'+generalPoster+'\">' +\n '<div class=\"found-info\">' +\n '<p class=\"movie-title\">'+movie.Title+'</p>' +\n '<p class=\"movie-year\">'+movie.Year+'</p>' +\n '</div>' + \n '<span class=\"add-btn\">+</span>' +\n '</div>');\n } else {\n var newMovie = $('<div id=\"'+movie.imdbID+'\" class=\"found-movie\">' +\n '<img src=\"'+movie.Poster+'\">' +\n '<div class=\"found-info\">' +\n '<p class=\"movie-title\">'+movie.Title+'</p>' +\n '<p class=\"movie-year\">'+movie.Year+'</p>' +\n '</div>' + \n '<span class=\"add-btn\">+</span>' +\n '</div>');\n }\n $(\"#found-movies\").append(newMovie);\n}", "function showData(index) {\n // Get current movie to display\n var movie = movies[index];\n\n var movieArticle = document.createElement('article');\n\n var movieTitle = document.createElement('h2');\n movieTitle.textContent = movie.title;\n\n var moviePlot = document.createElement('p');\n moviePlot.textContent = movie.simple_plot;\n\n var movieCover = document.createElement('img');\n movieCover.src = movie.cover;\n\n currentReviews = movie.reviews;\n\n movieArticle.appendChild(movieTitle);\n movieArticle.appendChild(moviePlot);\n movieArticle.appendChild(movieCover);\n movieArticle.id = 'movie';\n\n section.appendChild(movieArticle);\n}", "function getMovie(){\n\tspinner.style.display = \"block\";\n\tsetTimeout(() => {\n\t\tspinner.style.display = \"none\";\n\t\tcontainer.style.display = \"block\";\n\t}, 1000);\n\n\tlet movieId = sessionStorage.getItem(\"movieId\");\n\n\tfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'?api_key='+API_KEY+'&language=es-ES')\n\t\t.then(function(response) {\n\t\t\treturn response.json()\n\t\t})\n\t\t.then(function(movieInfoResponse) {\n\t\t\tfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/credits?api_key='+API_KEY)\n\t\t\t\t.then(function(response2) {\n\t\t\t\t\treturn response2.json()\n\t\t\t\t})\n\t\t\t\t.then(function(movieCastResponse) {\n\n\t\t\t\t\tconst movie = movieInfoResponse;\n\t\t\t\t\tconst cast = movieCastResponse.cast;\n\t\t\t\t\tconst genres = movieInfoResponse.genres;\n\t\t\t\t\tcast.length = 5;\n\n\t\t\t\t\t//Redondea el numero de popularidad de la pelicula\n\t\t\t\t\tpopularity = movieInfoResponse.popularity;\n\t\t\t\t\tpopularity = Math.floor(popularity)\n\n\n\t\t\t\t\tlet revenue = movieInfoResponse.revenue;\n\t\t\t\t\trevenue = new Intl.NumberFormat('de-DE', {style: 'currency', currency: 'EUR'}).format(revenue);\n\n\t\t\t\t\tlet output = `\n\t\t\t\t\t<div class=\"moviePage\">\n\t\t\t\t\t<div class=\"poster\"><img src=\"http://image.tmdb.org/t/p/w300/${movie.poster_path}\"></div>\n\t\t\t\t\t<div class=\"info\">\n\t\t\t\t\t\t<h2>${movie.title}</h2>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li><strong>Elenco:</strong> `;\n\t\t\t\t\t\t\tfor (let i = 0; i < cast.length; i++) {\n\t\t\t\t\t\t\t\tif (i != cast.length - 1) {\n\t\t\t\t\t\t\t\t\toutput += `${cast[i].name}, `;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toutput += `${cast[i].name}.`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toutput += `</li>\n\t\t\t\t\t\t\t<li><strong>Genros:</strong> `;\n\t\t\t\t\t\t\tfor(let i = 0; i < genres.length; i++){\n\t\t\t\t\t\t\t\tif ( i != genres.length -1){\n\t\t\t\t\t\t\t\t\toutput += `${genres[i].name}, `;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toutput += `${genres[i].name}.`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toutput += `<ul>\n\t\t\t\t\t\t\t\t<li><strong>estreno:</strong> ${movie.release_date}</li>\n\t\t\t\t\t\t\t\t<li><strong>duracion:</strong> ${movie.runtime} (min)</li>\n\t\t\t\t\t\t\t\t<li><strong>Rating:</strong> ${movie.vote_average} / 10 <span id=\"smallText\">(${movie.vote_count} votes)</span></li>\n\t\t\t\t\t\t\t\t<li><strong>recaudacion:</strong> ${revenue}</li>\n\t\t\t\t\t\t\t\t<li><strong>estado:</strong> ${movie.status}</li>\n\t\t\t\t\t\t\t\t<li><strong>Productora:</strong> ${movie.production_companies[0].name}</li>\n\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"plot\">\n\t\t\t\t\t\t<h3>resumen</h3>\n\t\t\t\t\t\t<p>${movie.overview}</p>\n\t\t\t\t\t</div>`;\n\n\n\t\t\t\t\tconst info = document.getElementById(\"movie\");\n\t\t\t\t\tinfo.innerHTML = output;\n\t\t\t\t})\n\t\t})\n\n\nfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/videos?api_key='+API_KEY+'&language=es-ES')\n.then(function(response) {\n\treturn response.json();\n})\n.then(function(response) {\n\n let movie = response.results;\n\tlet trailer = response.results;\n\n\t// Se muestra un trailer distinto cada vez\n\tlet min = 0;\n\t// -1 so it takes into account if theres only 1 item in the trailer length( at position 0).\n\tlet max = trailer.length - 1;\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\tlet trailerNumber = Math.floor(Math.random() * (max-min +1)) + min;\n\n\tlet output = `\n\t\t<div class=\"video\">\n\t\t<iframe width=\"620\" height=\"400\" src=\"https://www.youtube.com/embed/${trailer[trailerNumber].key}\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen></iframe>\n\t\t</div>`;\n\t// Muestra el trailer\n\tlet video = document.getElementById(\"trailer\");\n\tvideo.innerHTML = output;\n})\n// recomendaciones\nfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/recommendations?api_key='+API_KEY+'&language=es-ES&page=1')\n .then(function(response) {\n return response.json();\n })\n .then(function(response) {\n\n\t\tconst movie = response.results;\n\t\t//Set the movie length (output) to 4.\n\t\tmovie.length = 4;\n\t\tlet output = \"\";\n\t\tfor(let i = 0; i < movie.length; i++){\nlet favoriteMovies = JSON.parse(localStorage.getItem(\"favoriteMovies\")) || [];\n\t\t\toutput += `\n\t\t\t<div class=\"peliculas\">\n\t\t\t\t<div class=\"overlay\">\n\t\t\t\t<div class=\"movie\">\n\t\t\t\t\t<h2>${movie[i].title}</h2>\n\t\t\t\t\t\t<p><strong>Release date:</strong> <span>${movie[i].release_date} <i class=\"material-icons date\">date_range</i> </span></p>\n\t\t\t\t\t\t\t<a onclick=\"movieSelected('${movie[i].id}')\" >Detalles</a>\n\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"peliculas_img\">\n\t\t\t\t\t<img src=\"http://image.tmdb.org/t/p/w400/${movie[i].poster_path}\" onerror=\"this.onerror=null;this.src='../images/imageNotFound.png';\">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t`;\n\t\t}\n\n\t\tlet recommended = document.getElementById(\"recommended\");\n\t\trecommended.innerHTML = output;\n\n\t\tdocument.getElementById(\"prev\").style.display = \"none\";\n\t})\n\n\t.catch ((err)=>{\n\t\tlet recommended = document.getElementById(\"recommended\");\n\n\t\t `<div class=\"recommendations_error\">\n\t\t\t<h3>Perdon! </h3>\n\t\t\t<br>\n\t\t\t<p>No hay recomendacones</p>\n\t\t </div>`;\n\t})\n}", "function addMovieDetail(data){\n var $target = $(\".movie-details\");\n\n if (data.Title === undefined) {\n $target.empty();\n $target.append(\"<h2>Sorry, never heard of it!</h2>\");\n } else {\n var poster = data.Poster === \"N/A\" ? \"http://i.imgur.com/rXuQiCm.jpg?1\" : data.Poster;\n $target.empty();\n $target.append(\"<img src=\" + poster + \"></img>\");\n $target.append(\"<h1>\" + data.Title + \"</h1>\");\n $target.append(\"<h2> Year: \" + data.Year + \"</h2>\");\n $target.append(\"<h2> IMDB Rating: \" + data.imdbRating + \"</h2>\");\n\n $target.append(\"<button class='btn btn-default btn-xs add-movie'>Add Movie</button>\");\n }\n}", "temporaryMovie(movie) {\n this.displaySingleMovie(movie)\n }", "function addMovie(title, summary) {\n console.log(title, summary)\n const displaySection = document.getElementById(\"movieDetails\")\n const titleSection = displaySection.querySelector(\"h4\")\n const summarySection = displaySection.querySelector(\"p\")\n\n titleSection.textContent = title\n summarySection.textContent = summary\n}", "function PickNewVideo(iVideoInfo, iAutoPlay, iQuote, iPageObjectIds)\r\r\n{\r\r\n DebugLn(\"PickNewVideo\");\r\r\n if (isObject(iVideoInfo))\r\r\n {\r\r\n DebugLn(\"iVideoInfo.Description = \" + iVideoInfo.Description);\r\r\n DebugLn(\"iVideoInfo.Link = \" + iVideoInfo.Link);\r\r\n \r\r\n if (iVideoInfo.Link && \r\r\n iVideoInfo.Link.length > 0)\r\r\n {\r\r\n pageObjectIds = {VideoDiv: \"VideoDiv\", \r\r\n NamePar: \"VideoName\", \r\r\n DescPar: \"VideoDesc\"};\r\r\n \r\r\n if (isObject(iPageObjectIds))\r\r\n {\r\r\n if (StringLength(iPageObjectIds.VideoDiv) > 0)\r\r\n pageObjectIds.VideoDiv = iPageObjectIds.VideoDiv;\r\r\n if (StringLength(iPageObjectIds.NamePar) > 0)\r\r\n pageObjectIds.NamePar = iPageObjectIds.NamePar;\r\r\n if (StringLength(iPageObjectIds.DescPar) > 0)\r\r\n pageObjectIds.DescPar = iPageObjectIds.DescPar;\r\r\n }\r\r\n \r\r\n // Reset video division\r\r\n SetElementHtml(pageObjectIds.VideoDiv,LoadingHtml());\r\r\n\r\r\n // Set video link \r\r\n DebugLn(\"iVideoInfo.AudioPlayer = \" + iVideoInfo.AudioPlayer);\r\r\n videoLink = iVideoInfo.Link;\r\r\n if (StringLength(iVideoInfo.AudioPlayer) > 0)\r\r\n {\r\r\n videoLink = iVideoInfo.AudioPlayer;\r\r\n }\r\r\n DebugLn(\"videoLink = \" + videoLink);\r\r\n\r\r\n // Put video on page.\r\r\n var so = new SWFObject(videoLink, \"VideoEmbed\", \"425\", \"355\", \"9\", \"#6f7a9e\");\r\r\n if (so)\r\r\n {\r\r\n DebugLn(\"Have swf object.\");\r\r\n\r\r\n if (iVideoInfo.Attribute)\r\r\n\t{\r\r\n DebugLn(\"iVideoInfo.Attribute.length = \" + iVideoInfo.Attribute.length);\r\r\n for (iiAtt=0; iiAtt<iVideoInfo.Attribute.length; iiAtt++)\r\r\n {\r\r\n DebugLn('iiAtt = ' + iiAtt + \": \" + \r\r\n iVideoInfo.Attribute[iiAtt].Name + \" = \" + iVideoInfo.Attribute[iiAtt].Value);\r\r\n so.addVariable(iVideoInfo.Attribute[iiAtt].Name, iVideoInfo.Attribute[iiAtt].Value);\r\r\n }\r\r\n\t}\r\r\n\r\r\n if (iAutoPlay)\r\r\n so.addVariable(\"autoplay\", 1);\r\r\n\r\r\n if (StringLength(iVideoInfo.AudioPlayer) > 0)\r\r\n so.addVariable(\"playlist_url\", iVideoInfo.Link);\r\r\n\r\r\n swfHtml = so.getSWFHTML();\r\r\n if (swfHtml && \r\r\n swfHtml.length > 0)\r\r\n\t{\r\r\n DebugLn(\"swfHtml = \" + swfHtml.replace(/</, \"@\"));\r\r\n SetElementHtml(pageObjectIds.VideoDiv,swfHtml);\r\r\n //so.write(pageObjectIds.VideoDiv);\r\r\n }\r\r\n else\r\r\n {\r\r\n SetElementHtml(pageObjectIds.VideoDiv,BadFlashErrorHtml());\r\r\n }\r\r\n }\r\r\n else\r\r\n {\r\r\n SetElementHtml(pageObjectIds.VideoDiv,JavascriptErrorHtml());\r\r\n }\r\r\n\r\r\n // Put name with video.\r\r\n videoName = iVideoInfo.Name;\r\r\n DebugLn(\"videoName = \" + videoName);\r\r\n SetElementHtml(pageObjectIds.NamePar, videoName);\r\r\n \r\r\n // Put description with video.\r\r\n videoDesc = \"\";\r\r\n if (StringLength(iVideoInfo.Description) > 0)\r\r\n {\r\r\n videoDesc = iVideoInfo.Description;\r\r\n if (iQuote)\r\r\n videoDesc = '\"' + videoDesc +'\"';\r\r\n else\r\r\n videoDesc = videoDesc;\r\r\n }\r\r\n else if (StringLength(iVideoInfo.Date) > 0)\r\r\n {\r\r\n if (StringLength(iVideoInfo.Number) > 0)\r\r\n videoDesc += \"Message \" + iVideoInfo.Number;\r\r\n videoDesc += \"<br/>\" + iVideoInfo.Date;\r\r\n if (StringLength(iVideoInfo.Speaker) > 0)\r\r\n videoDesc += \"<br/>\" + iVideoInfo.Speaker;\r\r\n }\r\r\n DebugLn(\"videoDesc = \" + videoDesc);\r\r\n SetElementHtml(pageObjectIds.DescPar, videoDesc);\r\r\n }\r\r\n }\r\r\n}", "function movieDomCreator(movie) {\n movie.forEach(elem => {\n var div = document.createElement(\"div\");\n\n div.classList.add(\"box\");\n div.id = `${id}`;\n var img = document.createElement(\"img\");\n var p = document.createElement(\"p\");\n var heart = document.createElement(\"i\");\n heart.classList.add(\"heart\");\n\n var moreInfo = document.createElement(\"btn\");\n moreInfo.classList.add(\"button\");\n moreInfo.classList.add(\"is-primary\");\n moreInfo.textContent = \"More Info\";\n\n heart.classList.add(\"far\");\n heart.classList.add(\"fa-heart\");\n\n p.textContent = elem.title;\n\n if (elem.poster_path != undefined) {\n img.src = `${imageTemplate}${elem.poster_path}`;\n } else {\n img.src = \"not found\";\n }\n div.appendChild(img);\n div.appendChild(p);\n div.appendChild(moreInfo);\n div.appendChild(heart);\n contain.appendChild(div);\n id++;\n\n moreInfo.addEventListener(\"click\", function() {\n movieId = elem.id;\n getMoreDetails();\n console.log(\"card\");\n });\n });\n\n // Corner hearts inside box\n var hearts = document.querySelectorAll(\".heart\");\n\n hearts.forEach(function(heart) {\n heart.addEventListener(\"click\", function(e) {\n if (!heart.classList.contains(\"fontScale\")) {\n heart.classList.add(\"fontScale\");\n clonedTag = heart.parentNode.cloneNode(true);\n\n // appending each liked movie to watchlistBody\n clonedTag.removeChild(clonedTag.childNodes[3]);\n clonedTag.removeChild(clonedTag.childNodes[2]);\n\n var bigDiv = document.createElement(\"div\");\n bigDiv.appendChild(clonedTag);\n console.log(clonedTag);\n\n watchListInner.appendChild(bigDiv);\n allClones.push(clonedTag);\n }\n });\n });\n}", "function movieThis(movieTitle) {\n request(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&plot=short&apikey=trilogy\", function (error, response, body) {\n if (JSON.parse(body).Response === 'False') {\n return console.log(JSON.parse(body).Error);\n }\n if (!movieTitle) {\n request(\"http://www.omdbapi.com/?t=Mr+Nobody&plot=short&apikey=trilogy\", function (error, response, body) {\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n })\n } else if (!error && response.statusCode === 200) {\n\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n }\n })\n}", "function movied() {\n var movieTitle =\"\"; \n if (userInput[3] === undefined){\n movieTitle = \"mr+nobody\"\n } else {\n movieTitle = userInput[3];\n }; \n\tvar queryUrl = \"http://www.omdbapi.com/?apikey=f94f8000&t=\" + movieTitle\n\n\trequest(queryUrl, function(err, response, body) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t} else {\n\t\t console.log(\"\\n========== Movie Info ========\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Values);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\t\n console.log(\"=================================\\n\");\n\t\t}\n\n\t})\n}", "function getMovieContent() {\n\tvar queryURL = 'https://www.omdbapi.com/?t=' + searchTerm + '&y=&plot=short&apikey=trilogy';\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tvar movieRatingLong = response.Ratings[0].Value;\n\t\tvar movieRatingDouble = movieRatingLong.substr(0, 3);\n\t\tvar movieRatingUnround = movieRatingDouble / 2;\n\t\tmovieRating = Math.round(movieRatingUnround * 10) / 10;\n\t\tvar moviePosterUrl = response.Poster;\n\t\tmoviePoster = $('<img>');\n\t\tmoviePoster.attr('id', 'movieposterThumbnail');\n\t\tmoviePoster.attr('src', moviePosterUrl);\n\t\tmoviePlot = response.Plot;\n\t\tmovieTitle = response.Title;\n\t\tsetContent();\n\t});\n}", "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "function addCard(movie) {\n // there go searchResults, later\n\n let new_card = card_template.clone(); // makes a copy of card template, puts in new_card\n\n // change movie-img, different to others cause we change attributes, not the content of the div\n let movie_img = new_card.find(\".movie-img\");\n movie_img.attr(\"src\", `https://image.tmdb.org/t/p/w500${movie.poster_path}`);\n\n // change movie-title\n let movie_title = new_card.find(\".movie-title\");\n movie_title.html(movie.title);\n\n // change movie-description\n // let movie_description = new_card.find(\".movie-description\")\n // movie_description.html(movie.overview)\n\n // change movie-rate-link\n let movie_rate_link = new_card.find(\".movie-rate-link\");\n movie_rate_link.attr(\"href\", `/details/${movie.id}`);\n\n // let new_card = $(`<div>Name: ${movie.title} (${movie.release_date})</div>`)\n results_container.append(new_card);\n}", "function retrieveMovie(address){\n\t\n $.ajax({\n url: address,\n success:\n function(text)\n {\n //Update other input fields\n $(\"#updateTitle\").val(text.title);\n $(\"#updateYear\").val(text.year);\n $(\"#updateDirector\").val(text.director);\n $(\"#updateStars\").val(text.stars);\n $(\"#updateReview\").val(text.review);\n }\n \n });\n}", "function createMovie(e) {\n e.preventDefault();\n const title = $(\"#title\").val();\n if (title.length < 2) {\n return;\n }\n const rating = $(\"#rating\").val();\n const movieData = { title, rating, id: currentMovieID };\n movieMap.push(movieData);\n\n $(\"#movie-table\").append(createMovieHTML(movieData));\n $(\"#movie-form\").trigger(\"reset\");\n currentMovieID++;\n}", "function getMovieInfo(args){\n\tconsole.log(\"Getting info for movie \"+movie_id);\n\tvar req = new XMLHttpRequest();\n\treq.open(\"GET\", request_path+\"/movies/\"+movie_id, true);\n\treq.onload = function() {\n\t\tvar response = JSON.parse(req.response);\n\t\targs[0].setText(response[\"title\"]);\n\t\targs[2].setImage(args[3]+response[\"img\"]);\n\t\tgetMovieRating(args);\n\t}\n\treq.send();\n}", "function movieThis() {\n\t//takes in user input for movie title\n\tvar movieTitle = input;\n\n\t// if no movie is provided, the program will default to \"mr. nobody\"\n\tif (input === \"\") {\n\t\tmovieTitle = \"Mr. Nobody\";\n\t}\n\n\t// variable for the OMDb API call\n\tvar OMDb = \"http://omdbapi.com?t=\" + movieTitle + \"&r=json&tomatoes=true\";\n\n\t// this takes in the movie request and searches for it in OMDb via request\n\trequest(OMDb, function (err, response, body) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Error: \" + err);\n\t\t\treturn;\n\t\t}\n\t\telse if (response.statusCode === 200) {\n\t\t\tvar movie = JSON.parse(body);\n\t\t\tvar movieData = \"\";\n\n\t\t\tvar title = \"\\n\" + \"Movie Title: \" + movie.Title + \"\\n\";\n\t\t\tmovieData += title;\t\n\n\t\t\tvar year = \"\\n\" + \"Year Released: \" + movie.Year + \"\\n\";\n\t\t\tmovieData += year;\n\n\t\t\tvar rating = \"\\n\" + \"IMDB Rating: \" + movie.imdbRating + \"\\n\";\n\t\t\tmovieData += rating;\t\n\n\t\t\tvar country = \"\\n\" + \"Country: \" + movie.Country + \"\\n\";\n\t\t\tmovieData += country;\n\n\t\t\tvar language = \"\\n\" + \"Language: \" + movie.Language + \"\\n\";\n\t\t\tmovieData += language;\n\n\t\t\tvar plot = \"\\n\" + \"Movie Plot: \" + movie.Plot + \"\\n\";\n\t\t\tmovieData += plot;\t\n\n\t\t\tvar actors = \"\\n\" + \"Actors: \" + movie.Actors + \"\\n\";\n\t\t\tmovieData += actors;\n\n\t\t\tvar tomatoMeter = \"\\n\" + \"Rotten Tomato Rating: \" + movie.tomatoUserMeter + \"\\n\";\n\t\t\tmovieData += tomatoMeter;\n\n\t\t\tvar tomatoURL = \"\\n\" + \"Rotten Tomato Rating Link: \" + movie.tomatoURL + \"\\n\";\n\t\t\tmovieData += tomatoURL;\n\n\t\t\tconsole.log(\"\\n\" + \"OMDb:\");\n\t\t\tconsole.log(movieData);\n\t\t\tdataLog(movieData);\t\t\t\t\t\t\t\n\t\t}\n\t});\n}", "function makeCard(movie) {\n const movieHTML = $('<div class=\"movie-div\">')\n .append(\n `<span class=\"movie-title-tooltip\" id=\"${movie.id}\">${movie.title}</span>`\n )\n .append(\n `<a href=\"/movies/${movie.id}\"><img src=\"${image_URL}${movie.poster_path}\" alt=\"${movie.title} poster \"onerror=\"this.onerror=''; this.src='./assets/blank.jpg'\"></a>`\n ); // If poster load error: load blank.jpg\n $.get(`http://localhost:3000/rating/${movie.id}/user`, function (data) {\n if (data.length === 1 ) {\n // Convert score to out of 5\n let score = data[0].rating\n score%2==0 ? stars = '★'.repeat(score / 2) : stars = '★'.repeat((score / 2)) + '½'\n $(movieHTML).append(`<div id=\"star\" class=\"rating\">${stars}</div>`);\n }\n })\n // Get community score by fetching route with SQL for average, convert to percentage and add if community rating exists add badge to poster\n $.get(`http://localhost:3000/rating/`, function (data) {\n let find = data.find(item => {return item.movie_id == movie.id})\n if (find) {\n let score = find.avg * 10;\n let votes = find.count\n $(movieHTML).prepend(`<div id=\"score\" class=\"score\">${score}%</div>`);\n $(movieHTML).prepend(`<div class=\"score-count score\">${votes} vote/s</div>`);\n }\n })\n $('#api-content').append(movieHTML);\n}", "function movieDisplay(movieTitle) {\n // console.log(\"Movie Display Function\");\n var queryURL = `http://www.omdbapi.com/?t=${movieTitle}&y=&plot=short&apikey=trilogy`\n // console.log(queryURL);\n\n request(queryURL, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n var movieData = JSON.parse(body);\n\n console.log(`Title:${movieData.Title}\\n` +\n `Release Year: ${movieData.Year}\\n` +\n `IMDB Rating: ${movieData.imdbRating}/10\\n` +\n `Rotten Tomatoes Rating: ${movieData.Ratings[1].Value}\\n` +\n `Production Location: ${movieData.Country}\\n` +\n `Movie Language(s): ${movieData.Language}\\n` +\n `Plot: ${movieData.Plot}\\n` +\n `Actors: ${movieData.Actors}\\n`\n )\n }\n\n })\n}", "function stampa_film (movies){\n for (var i = 0; i < movies.length; i++) {\n var movie = movies[i];\n var titolo = movie.title;\n var titolo_originale = movie.original_title;\n var lingua = disegna_bandiere(movie.original_language);\n var voto = movie.vote_average;\n var voto_ridotto = arrotonda_voto(voto);\n var voto_in_stelle = disegna_stelle(voto_ridotto);\n //per evitare i casi in qui il campo è vuoto\n if(typeof movie.type !=='undefined'){\n var tipo = movie.type;\n }\n if(movie.poster_path == null){\n var url_poster = 'image-not-available.jpg'\n } else{\n var url_poster = img_url_base + dimensione_poster + movie.poster_path;\n }\n\n // inizializzo le variabili di handlebars\n var handlebars_variable = {\n 'title' : titolo,\n 'original_title' : titolo_originale,\n 'language' : lingua,\n 'rating' : voto_in_stelle,\n 'type' : tipo,\n 'image_cover' : url_poster\n }\n var html_locandina = template_function(handlebars_variable);\n $('#locandine').append(html_locandina);\n }\n }", "function foundmovie(movieid){\n var url = 'https://api.themoviedb.org/3/movie/' + movieid + '?api_key=224dda2ca82558ef0e550aa711aae69c';\n jQuery.ajax({\n type: 'GET',\n url: url,\n async: false,\n contentType: \"application/json\",\n dataType: 'jsonp',\n success: function(json) {\n clear_page();\n jQuery(\"#current\").addClass('active'); \n jQuery(\"#current\").css('background-image',\"url(http://image.tmdb.org/t/p/w500/\" + json.backdrop_path +\")\");\n jQuery(\"#current\").append(\"<img src='http://image.tmdb.org/t/p/w500\" + json.poster_path + \"' width:=200px' height='280px' />\");\n \tjQuery(\"#current\").append(\"<div class='current_info'><p>Current Match: \" + json.original_title + \"</p>\");\n jQuery(\"#current\").append(\"<p>Released: \" + json.release_date +\"</p>\");\n jQuery(\"#current\").append(\"<p>Rating: \" + json.vote_average + \"</p></div>\");\n jQuery('#current').slideDown(\"2000\", function(){\n getSimilar(json.id);\n });\n\t },\n\t error: function(e) {\n\t console.log(e.message);\n\t }\n });\n}", "displayRelatedMovie(movies) {\n // It create all html element with movie data\n this.createRelatedMovie(movies)\n }", "function ShowMovieInfo(id)\n{\n $.ajax\n ({\n url: 'jsonfargo.php?action=info&media=movies' + '&id=' + id,\n async: false,\n dataType: 'json',\n success: function(json)\n { \n var buttons = \"\"; \n var aInfo = [{left:\"Director:\", right:json.media.director},\n {left:\"Writer:\", right:json.media.writer},\n {left:\"Studio:\", right:json.media.studio},\n {left:\"Genre:\", right:json.media.genre},\n {left:\"Year:\", right:json.media.year},\n {left:\"Runtime:\", right:json.media.runtime},\n {left:\"Rating:\", right:json.media.rating},\n {left:\"Tagline:\", right:json.media.tagline},\n {left:\"Country:\", right:json.media.country},\n {left:\"Path:\", right:json.media.path}];\n \n // Show info.\n ShowInfoTable(aInfo);\n \n // Change space size for movie info and fanart.\n $(\"#info_left\").css(\"margin-right\", 395); // 460\n $(\"#info_right\").toggleClass(\"fanart_space\", true).toggleClass(\"cover_space\", false); \n \n // Show fanart.\n $(\"#info_fanart img\").error(function(){\n $(this).attr('src', 'images/no_fanart.jpg');\n })\n .attr('src', json.params.fanart + '/' + json.media.fanart + '.jpg' + '?v=' + json.media.refresh)\n .css(\"width\", 385);\n \n // Show media flags. Path and filename is generated by PHP (jsonfargo.php).\n $(\"#info_video\").html(json.media.video);\n $(\"#info_audio\").html(json.media.audio);\n $(\"#info_aspect\").html(json.media.aspect);\n $(\"#info_mpaa\").html(json.media.mpaa); \n \n // Show plot.\n $(\"#info_plot\").text(\"Plot\");\n $(\"#info_plot_text\").html(json.media.plot).slimScroll({\n height:'120px',\n color:'gray',\n alwaysVisible:true\n });\n \n // Hide close button and add buttons (imdb, trailer).\n if (json.media.imdbnr || json.media.trailer) \n {\n $(\"#info_box .close\").hide();\n \n if (json.media.imdbnr){\n buttons += '<button type=\"button\" class=\"url\" value=\"' + json.media.imdbnr + '\">IMDb</button>';\n }\n \n if (json.media.trailer){\n buttons += '<button type=\"button\" class=\"url\" value=\"' + json.media.trailer + '\">Trailer</button>';\n }\n \n $(\"#info_box .button\").append(buttons); \n }\n else {\n $(\"#info_box .close\").show();\n }\n \n // Show popup.\n ShowPopupBox(\"#info_box\", \"<div>\" + json.media.title + \"</div>\");\n SetState(\"page\", \"popup\"); \n } // End succes.\n }); // End Ajax. \n}", "function displayMovies(movies) {\n console.log(movies);\n for (let i=0; i < movies.length; i++) {\n const movieId = cleanTitle(movies[i]);\n fetch(`https://imdb8.p.rapidapi.com/title/get-plots?tconst=${movieId}`, {\n\t \"method\": \"GET\",\n\t \"headers\": {\n\t\t\"x-rapidapi-host\": \"imdb8.p.rapidapi.com\",\n\t\t\"x-rapidapi-key\": rapidApiKey\n\t }\n })\n .then(resp => resp.json())\n .then(addMoviesHMTL)\n // when the last movie is added to the html shows the \"get movie recommendations\" button\n .then(() => {\n if (i+1 === movies.length) {\n recomButtton.style.display = 'block';\n }\n })\n }\n // function to clean the title info to fetch the api\n function cleanTitle(stringT) {\n let begins = stringT.indexOf('/', 1) + 1;\n let title = stringT.slice(begins, stringT.length - 1);\n return title;\n }\n}", "function bestMovieRecorded() {\n fetch('http://localhost:8000/api/v1/titles/?sort_by=-imdb_score&page_size=10&page=1')\n .then(res => res.json())\n .then(res => res.results)\n .then(function(value) {\n let bestMovie_url = value[0].image_url;\n let bestMovie_name = value[0].title;\n let bestMovie_url_des = value[0].url;\n let bestMovie_des = \"\";\n fetch(bestMovie_url_des)\n .then((res) => res.json())\n .then((res) => {\n bestMovie_des = res.description;\n document\n .getElementById(\"video_centrale\")\n .innerHTML = `\n <div><img src= ${bestMovie_url} alt='video centrale'></img></div>\n <div><H3>${bestMovie_name}</H3>\n <p>${bestMovie_des}</p>\n </div>`;\n });\n var btn = document.querySelector(\"#best_movie\");\n btn.onclick = function() {\n myModal.style.display = \"block\";\n getMovieData(bestMovie_url_des);\n }\n for (let i = 1; i < value.length; i++) {\n let movie = value[i].image_url;\n let name = value[i].id;\n let movie_url = value[i].url;\n //console.log(movie);\n let elt = document.getElementById(\"carousel_best_movies\");\n let elt_item = document.createElement('div');\n elt_item.setAttribute('class', 'casourel_item');\n elt.appendChild(elt_item);\n let div = document.createElement('div');\n div.setAttribute('id', name);\n div.innerHTML = `<img src= ${movie} alt='img_casourel'></img>`;\n elt_item.appendChild(div);\n let img = document.getElementById(`${name}`);\n img.onclick = function() {\n myModal.style.display = \"block\";\n getMovieData(movie_url);\n }\n\n }\n });\n}", "function getMovie() {\n //GETTING THE ID FROMSESSION STORAGE\n let movieId = sessionStorage.getItem(\"movieId\");\n axios\n .get(\"https://www.omdbapi.com?apikey=af465f0e&i=\" + movieId)\n .then(response => {\n console.log(response);\n let movie = response.data;\n let imdbid = movie.imdbID;\n // UPDATING THE UI WITH THE SELECTED MOVIE INFO\n let output = `\n\n <div class=\"container__single\">\n <div class=\"container__single__img\">\n <img class=\"img__single\" src=\"${movie.Poster}\"\n alt=\"\" />\n </div>\n <div class=\"container__single__details\">\n <h1 class=\"container__single__details-name\">${movie.Title}</h1>\n <div class=\"container__single__details-details\">\n <div class=\"details-year\" title=\"Release Date\">\n <img src=\"img/calendar.svg\" class=\"icon\"> ${movie.Year}\n </div>\n <div class=\"details-director\" title=\"Movie Director\">\n <img src=\"img/announcer.svg\" class=\"icon\"> ${movie.Director}\n </div>\n <div class=\"details-time\" title=\"Total time\">\n <img src=\"img/time.svg\" class=\"icon\"> ${movie.Runtime}\n </div>\n <div class=\"details-rating\" title=\"Internet Movie Database Value\">\n <img src=\"img/award.svg\" class=\"icon\">\n </div>\n <div class=\"details-rating\" title=\"Internet Movie Database Value\">\n <img src=\"img/cinema.svg\" class=\"icon\">${movie.Genre}\n </div>\n </div>\n <div class=\"container__single__details-plot\">\n ${movie.Plot}\n </div>\n <div class=\"container__single__buttons\">\n <a href=\"https://www.imdb.com/title/${\n movie.imdbID\n }\" target=\"_blank\" title=\"IMDB\" class=\"button details__imdb\">\n IMDB <span class=\"imdb__score\">${\n movie.imdbRating\n }</span>\n </a>\n <a href=\"${\n movie.Website\n }\" title=\"\" target=\"_blank\"class=\"button details__imdb\">WEBSITE\n </a>\n <a href=\"#\" title=\"IMDB\" class=\"button details__imdb\" onclick=\"openModal('${imdbid}')\">\n <img src=\"img/cinema.svg\" alt=\"CINEMA\" class=\"icon\"> <span class=\"imdb__score\">MOVIE</span>\n </a>\n </div>\n <a class=\"button details__go-back\" href=\"index.html\">\n BACK\n </a>\n </div>\n </div>\n `;\n document.querySelector(\".container\").innerHTML = output;\n })\n .catch(err => {\n console.log(err);\n });\n}", "function putData(movie,data){\n var table = $(\"#shows\");\n var genre = $(\"#genre\");\n var film = $(\"#film\");\n var watch = $(\"#watch\");\n var h4 = $(\"<h4>\").append(\"Watch\")\n var link = $(\"<li>\").append(h4);\n watch.append(link);\n var li = $(\"<li>\").append(\"GENRE :\")\n genre.append(li);\n var cast = $(\"#cast\")\n var names = $(\"<li>\").append(\"CAST :\");\n cast.append(names);\n var length = $(\"#length\")\n var len = $(\"<li>\").append(\"LENGTH :\");\n length.append(len);\n var head = table.find(\"thead\");\n var body = table.find(\"tbody\");\n head.empty();\n body.empty();\n var row = $(\"<tr>\");\n var theater = $(\"<th>\").append(\"Theater\")\n row.append(theater);\n head.append(row);\n\n for(a of data.BookMyShow.arrEvent ){\n if(a.EventTitle == movie){\n var image = $(\"<img>\").attr({src:a.BannerURL,class:'img-responsive'}).addClass(\"img-rounded\")\n $(\"#banner\").html(image);\n for(hall of a.arrVenues){\n var tr = $(\"<tr>\");\n var italicHAll = $(\"<i>\").attr(\"style\",\"font-weight:800;color:black\").append(hall.VenueName)\n var name = $(\"<td>\").append(italicHAll);\n tr.append(name);\n body.append(tr);\n }\n //...adding TRAILER URL\n var headTrailer = $(\"<h4>\").append(\"trailer\")\n var hyperlink = $(\"<a>\").attr({href:a.TrailerURL,target:'_blank'}).append(headTrailer);\n var trailer = $(\"<li>\").append(hyperlink);\n watch.append(trailer);\n //..displaying MOVIE'S NAME\n var name = $(\"<h2>\").attr(\"style\",\"font-weight:900;color:darkmagenta\").append(a.EventTitle);\n var italic = $(\"<i>\").append(name);\n var filmName = $(\"<li>\").append(italic); //name\n var censor = $(\"<h3>\").attr(\"style\",\"color:crimson;font-weight:900\").append(a.EventCensor);\n var addCensor = $(\"<li>\").append(censor);\n film.append(filmName);\n film.append(addCensor);\n //..displaying movie's length\n var movieLength = $(\"<li>\").append(a.Length);\n length.append(movieLength);\n //.. displaying genres\n for(j=0;j<3;j++){\n var list = $(\"<li>\").append(a.GenreArray[j]);\n genre.append(list);\n }\n //.. displaying actors' name\n var actors = a.Actors.split(\",\");\n for(i=0;i<4;i++){\n var link = $(\"<a>\").attr({href:\"https://en.wikipedia.org/wiki/\"+actors[i],target:\"_blank\"}).append(actors[i]);\n var li = $(\"<li>\").append(link);\n cast.append(li);\n }\n }\n }\n}", "function displayMovies() {\n area = document.getElementById(\"theatre\").value; //get a element called theatre from the XML file and bind it to area\n\ttimeValue = document.getElementById(\"time\").value; //get a element called time from the XML file and bind it to timeValue\n\tvar customSchedule= new XMLHttpRequest();\n\tcustomSchedule.open(\"GET\",\"https://www.finnkino.fi/xml/Schedule/?area=\"+area+\"&dt=\"+timeValue,true);\n\tcustomSchedule.send();\n\tcustomSchedule.onreadystatechange=function() {\n\t\tif (customSchedule.readyState==4 && customSchedule.status==200){\n\t\tvar xmlResult = customSchedule.responseXML;\n var i;\n var table = \"<tr><th>Movie Name</th><th>Theatre</th><th>Start time</th></tr>\"; // draw the table structure\n var x = xmlResult.getElementsByTagName(\"Show\");\n for (i = 0; i <x.length; i++) {\n table += \"<tr><td id=movieCol><img src=\" +\n x[i].getElementsByTagName(\"EventSmallImagePortrait\")[0].childNodes[0].nodeValue+ \">\" + x[i].getElementsByTagName(\"Title\")[0].childNodes[0].nodeValue +\n \"</td><td>\" +\n x[i].getElementsByTagName(\"Theatre\")[0].childNodes[0].nodeValue +\n \"</td><td>\" +\n x[i].getElementsByTagName(\"dttmShowStart\")[0].childNodes[0].nodeValue.substring(11,16) +\n \"</td></tr>\";\n }\n document.getElementById(\"movies\").innerHTML = table;\n}\n}\n}", "function getMovie(search_movie) {\n bg.innerHTML = `<img id=\"img1\" crossOrigin=\"anonymous\" src='${\n movies[search_movie.id].Poster\n }' width=\"100%\"></img>`;\n\n img = document.querySelector('img');\n title_image.innerHTML = bg.innerHTML;\n header.innerText = movies[search_movie.id].Title;\n changeBackgroundColor();\n search_results.innerHTML = '';\n search_box.value = '';\n let movie = fetch(\n `https://www.omdbapi.com/?i=${\n movies[search_movie.id].imdbID\n }&plot=full&apikey=${key}`\n )\n .then((response) => response.json())\n .then((json) => {\n summary.innerText = json.Plot;\n\n //GENERATING A LINK TO THE MOVIE ON IMDB\n score_wrapper.children[0].href = `https://www.imdb.com/title/${json.imdbID}`;\n score_wrapper.children[0].children[1].innerText =\n json.Ratings[0].Value;\n\n //GENERATING A LINK TO THE MOVIE ON ROTTEN TOMATOES\n try {\n let formatted_title_rotten = json.Title.split(' ')\n .join('_')\n .toLowerCase();\n score_wrapper.children[1].href = `https://www.rottentomatoes.com/m/${formatted_title_rotten}`;\n score_wrapper.children[1].children[1].innerText =\n json.Ratings[1].Value;\n } catch {\n score_wrapper.children[1].href = 'javascript:;';\n score_wrapper.children[1].children[1].innerText = 'N/A';\n }\n //GENERATING A LINK TO THE MOVIE ON METACRITIC\n try {\n let formatted_title_metacritic = json.Title.split(' ')\n .join('-')\n .toLowerCase();\n score_wrapper.children[2].href = `https://www.metacritic.com/movie/${formatted_title_metacritic}`;\n score_wrapper.children[2].children[1].innerText =\n json.Ratings[2].Value;\n } catch {\n score_wrapper.children[2].href = 'javascript:;';\n score_wrapper.children[2].children[1].innerText = 'N/A';\n }\n\n stats.style.display = 'flex';\n start_screen.style.display = 'none';\n title_image.style.display = 'block';\n score_wrapper.style.display = 'flex';\n\n stats.children[1].innerText = json.Director;\n stats.children[3].innerText = json.Production;\n stats.children[5].innerText = json.Released;\n stats.children[7].innerText = json.Genre;\n stats.children[9].innerText = json.Country;\n stats.children[11].innerText = json.Awards;\n stats.children[13].innerText = json.BoxOffice;\n\n let actor_names = json.Actors.split(', ');\n actors.innerHTML = '<div class=\"starring\"><h1>Starring</h1></div>';\n for (let actor of actor_names) {\n let formatted_name = actor.split(' ').join('-').toLowerCase();\n let actor_data = fetch(\n `https://api.tvmaze.com/search/people?q=${formatted_name}`\n )\n .then((actor_response) => actor_response.json())\n .then((actor_json) => {\n actors.innerHTML += `<div class=\"actor-image\"><img src=\"${actor_json[0].person.image.medium}\"><p>${actor_json[0].person.name}</p></div>`;\n })\n .catch((error) => {\n //DO NOTHING BUT BAD DATA IS HIDDEN\n });\n }\n });\n }", "function movieGenreRequest(){\n\n// REQUESTED API + The GENRE ID provided by MOVIE-DB\nvar movieApi = 'https://api.themoviedb.org/3/discover/movie?with_genres=' + movieCode + '&api_key=b16247e3c7a3350acf15d3581ce27109&language=en-US';\n\nfetch (movieApi)\n.then(function(response){\n return response.json();\n}).then (function(results){\n console.log(results)\n\n movieDiv.innerHTML = \"\";\n\n// DYNAMICALLY create table elements used to display\n var table = document.createElement(\"table\");\n var tablePoster = document.createElement(\"th\")\n var tableTitle = document.createElement(\"th\")\n var tableRow = document.createElement(\"tr\");\n\n // APPEND table\n tableRow.appendChild(tablePoster);\n tableRow.appendChild(tableTitle);\n table.appendChild(tableRow);\n movieDiv.appendChild(table);\n\n\n// FOR LOOP dynamically creates the DYNAMIC elements and append movie data\n\n for(var i = 10; i < results.results.length; i++) {\n\n// DATA/RESULTS pulled from API object\n var title = results.results[i].original_title;\n var postImg = results.results[i].poster_path;\n var description = results.results[i].overview;\n var ratingScore = results.results[i].vote_average;\n\n// DYNAMICALLY creating elements \n var posterData = document.createElement(\"td\")\n var row = document.createElement(\"tr\")\n var titleData = document.createElement(\"td\")\n var likeBtn = document.createElement(\"button\")\n var poster = document.createElement(\"img\")\n var itemDisplay = document.createElement(\"h3\")\n var textDesc = document.createElement(\"p\")\n var rating = document.createElement(\"h4\")\n\n var posterImgURL = 'https://image.tmdb.org/t/p/w500' + postImg;\n \n \n// SET text/attributes to created elements\n likeBtn.textContent = \"Favorite\"\n likeBtn.id = \"favoriteBtn\"\n likeBtn.setAttribute(\"data-title\", title);\n poster.setAttribute(\"src\", posterImgURL);\n\n itemDisplay.textContent = title\n textDesc.textContent = description\n rating.textContent = \"Voter Rating: \" + ratingScore + \" / 10\"\n\n// APPEND all items to dynamically created elements\n titleData.appendChild(itemDisplay)\n titleData.appendChild(textDesc)\n titleData.appendChild(rating)\n posterData.appendChild(poster)\n titleData.appendChild(likeBtn)\n row.appendChild(titleData)\n row.appendChild(posterData)\n table.appendChild(row)\n\n \n // document.querySelector(\".Movie-display\").appendChild(title)\n }\n var favBtn = document.getElementById(\"favoriteBtn\")\n \n var favorites = JSON.parse(localStorage.getItem(\"favoritesList\")) || []\n \n favBtn.addEventListener('click',function() {\n console.log(\"clicked\")\n \n var favoritesClicked = this.getAttribute(\"data-title\")\n favorites.push(favoritesClicked)\n \n localStorage.setItem(\"favoritesList\", JSON.stringify(favorites))\n \n console.log(favoritesClicked)\n})\n})\n}", "function moviethis(movie_name) {\n request(\"http://www.omdbapi.com/?t=\" + movie_name + \"&y=&plot=short&apikey=trilogy\", function (error, response, body, Title) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n\n console.log(\"*Title of the movie: \" + JSON.parse(body).Title);\n console.log(\"* Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"* Country produced:\" + JSON.parse(body).Country);\n console.log(\"* Language of the movie:\" + JSON.parse(body).Language);\n console.log(\"* Plot of the movie:\" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"* IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n }\n });\n} // end of movie function----------------------", "function movie() {\n\t// Then run a request to the OMDB API with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + command2 + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(queryURL, function (error, response, body) {\n\t\t// if the request is successful, run this\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\tconsole.log(\" \");\n\t\t\tconsole.log(queryURL);\n\t\t\tconsole.log(\"\\nMovie Title: \" +command2);\n\t\t\tconsole.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"Country where the movie is produced: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"\\nPlot of the movie: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"\\nThe IMDB rating is: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes rating is: \" + JSON.parse(body).Ratings[2].Value);\n\t\t\tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t}\n\t});\n}", "function getRandomMovie() {\n $.ajax({\n url: 'https://raw.githubusercontent.com/peetck/IMDB-Top1000-Movies/master/IMDB-Movie-Data.csv',\n dataType: 'text',\n }).done(successFunction);\n\n function successFunction(data) {\n var movie = [];\n let randomMovie = \"\";\n\n\n let movieRow = data.split(/\\r?\\n|\\r/);\n for (let i = 1; i < movieRow.length; i++) {\n let movieItems = movieRow[i].split(',');\n movie.push(movieItems[1]);\n\n }\n let number = Math.floor(Math.random() * 1000)\n\n randomMovie = movie[number];\n\n getOMDBInfo(randomMovie);\n\n }\n\n // Fetches movie info from OMDB and renders movie card with movie info\n function getOMDBInfo(randomMovie) {\n axios.get('https://www.omdbapi.com?t=' + randomMovie + '&apikey=6753c87c')\n .then((response) => {\n let movie = response.data;\n let output = `\n <div class=\"moviedscrpt\">\n <div class=\"centerbox\">\n <img src=\"${movie.Poster}\" class=\"thumbnail\">\n <h2 style = \"color: white;\">${movie.Title}</h2>\n </div>\n <ul class=\"list-group\">\n <li class=\"list-group-item\"><strong>Genre:</strong> ${movie.Genre}</li>\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.Released}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.Rated}</li>\n <li class=\"list-group-item\"><strong>IMDB Rating:</strong> ${movie.imdbRating}</li>\n <li class=\"list-group-item\"><strong>Director:</strong> ${movie.Director}</li>\n <li class=\"list-group-item\"><strong>Writer:</strong> ${movie.Writer}</li>\n <li class=\"list-group-item\"><strong>Actors:</strong> ${movie.Actors}</li>\n </ul>\n <div class=\"well\" style=\"margin:4%\">\n <h3 style = \"color: white\" >Plot</h3>\n <p style = \"color: white\">${movie.Plot}</p>\n <hr>\n <div class=\"centerbox\">`;\n $('#movies').html(output);\n })\n .catch((err) => {\n console.log(err);\n });\n }\n}", "function displayMovies(){\n \n\n allMovies.forEach(movie => {\n\n function func() {\n movieRental.transferMovie(movie.title);\n refreshMovies();\n }\n\n \n let movieDiv = Html.createDivElement({class:'singleMovie'});\n movieDiv.style.backgroundColor = '#'+ Math.floor(Math.random()*16777215).toString(16);\n\n\n let movieImgDiv = Html.createDivElement({class: 'movieImgDiv'})\n let clickMeText = Html.createHeading({text:'Double Click to Rent',size:5});\n\n let header = Html.createHeading({text:movie.title, size:2});\n let releaseDate = Html.createHeading({text:movie.release.toString(),size:4});\n let img = Html.createImageElement({className: 'imgClass', width:100, height:200, src:movie.img, alt:'no image',click:func});\n let link = Html.createLinkElement({text: movie.title, href: movie.imbd});\n \n document.body.appendChild(movieDiv);\n\n movieDiv.appendChild(header);\n \n \n movieDiv.appendChild(releaseDate);\n movieDiv.appendChild(movieImgDiv);\n movieImgDiv.appendChild(img);\n movieImgDiv.appendChild(clickMeText);\n movieDiv.appendChild(link);\n\n if(movie.available >0){\n document.getElementById('availableDiv').appendChild(movieDiv);\n }\n else if(movie.available === 0){\n document.getElementById('rentedDiv').appendChild(movieDiv);\n \n }\n\n });\n \n}", "async function populateModal(movieID) {\n // Creates the title slot\n movie = await getMoviesInfos(movieID);\n console.log(\"VOILA LES RESULTATS\");\n console.log(movie);\n\n const movieTitle = document.createElement(\"div\");\n movieTitle.classList.add(\"popup\");\n movieTitle.setAttribute(\"id\", \"popup-title\");\n movieTitle.innerHTML = `<p>${movie[\"title\"]}</p>`;\n // Image slot\n const movieImg = document.createElement(\"img\");\n movieImg.src = movie.image_url;\n movieImg.alt = movie.title;\n movieImg.setAttribute(\"id\", \"popup-img\");\n\n // Genre Slot\n console.log(movie);\n const movieGenres = document.createElement(\"div\");\n movieGenres.classList.add(\"popup\");\n movieGenres.setAttribute(\"id\", \"popup-genres\");\n const genresAsString = movie[\"genres\"].join(\", \");\n movieGenres.innerHTML = `<p>Genres : ${genresAsString}</p>`;\n\n // Release Date\n const releaseDate = document.createElement(\"div\");\n releaseDate.classList.add(\"popup\");\n releaseDate.setAttribute(\"id\", \"popup-releaseDate\");\n releaseDate.innerHTML = `<p>Release Date : ${movie.date_published}</p>`;\n\n // Rated\n const rated = document.createElement(\"div\");\n rated.classList.add(\"popup\");\n rated.setAttribute(\"id\", \"popup-rated\");\n rated.innerHTML = `<p>Rated : ${movie.rated}</p>`;\n // imdb_score\n const imdbScore = document.createElement(\"div\");\n imdbScore.classList.add(\"popup\");\n imdbScore.setAttribute(\"id\", \"popup-imdb_score\");\n imdbScore.innerHTML = `<p>Imdb Score : ${movie.imdb_score} / 10</p>`;\n //directors\n const directors = document.createElement(\"div\");\n directors.classList.add(\"popup\");\n directors.setAttribute(\"id\", \"popup-directors\");\n const directorsAsString = movie[\"directors\"].join(\", \");\n directors.innerHTML = `<p>Directed by : ${directorsAsString}</p>`;\n\n // actors\n const actorsBox = document.createElement(\"div\");\n actorsBox.setAttribute(\"id\", \"popup-actorsBox\");\n const actors = document.createElement(\"div\");\n actors.classList.add(\"popup\");\n actors.setAttribute(\"id\", \"popup-actors\");\n const actorsAsString = movie[\"actors\"].join(\", \");\n actors.innerHTML = `<p>Starring : ${actorsAsString}</p>`;\n // We append the actors to the box, so it will be automatically added to the document\n // When the box will be too\n actorsBox.appendChild(actors);\n\n // duration\n const duration = document.createElement(\"div\");\n duration.classList.add(\"popup\");\n duration.setAttribute(\"id\", \"popup-duration\");\n duration.innerHTML = `<p>${movie.duration} mns</p>`;\n\n // countries\n const countries = document.createElement(\"div\");\n countries.classList.add(\"popup\");\n countries.setAttribute(\"id\", \"popup-countries\");\n const countriesAsString = movie[\"countries\"].join(\", \");\n countries.innerHTML = `<p>From ${countriesAsString}</p>`;\n\n // worldwide_gross_income / box office\n const boxOffice = document.createElement(\"div\");\n boxOffice.classList.add(\"popup\");\n boxOffice.setAttribute(\"id\", \"popup-boxOffice\");\n boxOffice.innerHTML = `<p>Box Office : ${\n movie.worldwide_gross_income || \"Test\"\n }</p>`;\n\n // long_description / Resume\n const resume = document.createElement(\"div\");\n resume.classList.add(\"popup\");\n resume.setAttribute(\"id\", \"popup-resume\");\n resume.innerHTML = `<p>Resume : ${movie.long_description}</p>`;\n\n // Append every element we want to add into a list so we can loop & add them later on\n const modalElements = [\n movieTitle,\n movieImg,\n movieGenres,\n releaseDate,\n rated,\n imdbScore,\n directors,\n actorsBox,\n duration,\n countries,\n boxOffice,\n resume,\n ];\n return modalElements;\n}", "function getMovieData(movie_url_des) {\n fetch(movie_url_des)\n .then((res) => res.json())\n .then((res) => {\n movie_title = res.original_title;\n movie_type = res.genres;\n movie_des = res.description;\n movie_url = res.image_url;\n movie_release_date = res.date_published;\n movie_rated = res.rated;\n movie_imbd = res.imdb_score;\n movie_directors = res.directors;\n movie_actors = res.actors;\n movie_duration = res.duration;\n movie_countries = res.countries;\n movie_votes = res.avg_vote;\n document\n .getElementById(\"movie_data\")\n .innerHTML = `\n <div><img src= ${movie_url} alt='movie'></img></div>\n <div><H2>${movie_title}</H2>\n <p> <B>Durée :</B>${movie_duration}</p>\n <p> <B>Genre : </B> ${movie_type} </p>\n <p> <B>Date de sortie : </B>${movie_release_date}</p>\n <p> <B>Moyenne des votes :</B> ${movie_rated} </p>\n <p> <B>Score Imbd :</B> ${movie_rated}</p>\n <p> <B>Réalisateur :</B>${movie_directors}</p>\n <p> <B>Pays d'origine : </B> ${movie_countries} </p>\n <p> <B>Liste des acteurs :</B> ${movie_actors}</p>\n <p> <B>Résultat box office : </B> ${movie_votes} </p>\n <p> <B>Résumé :</B> ${movie_des} </p>\n </div>`\n });\n}", "function genMovies(movies){\n let imp = document.createElement('div');\n imp.className = \"list-group\";\n imp.id = \"usermovies\";\n \n for (let i = 0; i<movies.length; i++){\n let ap = document.createElement(\"a\");\n if (i%2 === 0){\n ap.className = \"list-group-item flex-column align-items-start\";\n } else {\n ap.className = \"list-group-item\";\n }\n //ap.href = sim_results[i].href; //TO DO generate movie url\n\n let div1 = document.createElement('div')\n div1.className = \"d-flex w-100 justify-content-between\";\n let div2 = document.createElement('div');\n div2.id = movies[i].id;\n let h = document.createElement(\"h3\");\n h.textContent = movies[i].original_title.trim();\n h.className = \"mb-1\";\n let p = document.createElement('p');\n p.textContent = movies[i].overview;\n let img = document.createElement(\"img\");\n if (movies[i].poster_path != null){\n img.src = getPoster(movies[i].poster_path);\n } else {\n img.src = \"./assets/img/genposter.jpg\";\n }\n img.className = \"img-thumbnail rounded float-right\";\n \n div2.append(h);\n div2.append(p);\n div1.append(div2);\n div1.append(img);\n ap.append(div1);\n imp.append(ap);\n }\n document.getElementById(\"usermovies\").replaceWith(imp);\n}", "function openMovie(query) {\n\n //kada otvorimo odredjeni film/seriju sakrijemo elemente koji su do sada bili prikazani i prikazemo div za film\n $(\"#content\").hide();\n $(\"#top-part\").hide();\n $(\"#movie-show\").show();\n\n //ukoliko prikazemo neki film pa se vratimo na pretragu i otvorimo novi, prikazali bi se rezultati oba filma u div-u movie-show\n //zbog toga pozivamo pomocnu funkciju cleanMovie() kako bi ispraznili sve elemente movie-showa ukoliko su vec bili popunjeni\n cleanMovie();\n\n //div series-season se koristi prilikom prikaza odredjene epizode i on nam nije potreban kada prikazujemo film ili seriju\n //iz tog razloga ga ispraznimo kako se ne bi prikazivao bez kad je potreban\n $('#series-season').empty();\n\n //ajax reuquest prema API-u gdje izvlacimo podatke o odredjenom filmu/seriji\n $.ajax({\n type: \"GET\",\n url: \"https://www.omdbapi.com/?apikey=39c93cf7&i=\" + query,\n success: (response) => {\n //pomocna funkcija koja popunjava elemente potrebne za prikaz filma/serije\n showMovie(response);\n }\n })\n}", "function movieThis(receivedMovie) {\n\n\n var movie = receivedMovie ? receivedMovie : \"Mr. Nobody\";\n\n // request to omdbapi using movie entered and trilogy api key\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=full&tomatoes=true&r=json&y=&plot=short&apikey=trilogy\", function (error, response, data) {\n\n // IF the request is successful. The status code is 200 if the status returned is OK\n if (!error && response.statusCode === 200) {\n\n // log the command issued to the log.txt file\n logCommand();\n\n // Display Data\n // TITLE, YEAR, IMDB RATING, COUNTRY, LANGUAGE(S), PLOT, ACTORS, ROTTEN TOMATO RATING, ROTTEN TOMATO URL\n console.log(\"Movie Title: \" + JSON.parse(data).Title);\n console.log(\"Release Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"TOMATOMETER: \" + JSON.parse(data).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors/Actresses: \" + JSON.parse(data).Actors);\n }\n\n });\n}", "function saveMovieToList() {\n let addMovSect = document.querySelector(\"#addMovieSec\");\n // Get input fields values\n let fName = document.querySelector(\"#movName\").value;\n let fMovUrl = document.querySelector(\"#movUrl\").value;\n let fPostUrl = document.querySelector(\"#postUrl\").value;\n let fType = document.querySelector(\"#movType\").value;\n // create new movie\n let newMovie = new Movie(fName, fMovUrl, fPostUrl, fType);\n // add new movie to the collection\n movies.addMovie(newMovie);\n addMovSect.style.display = \"none\";\n reloadPosters();\n addImageEvents();\n //reset input fields\n fName.value = \"\";\n fMovUrl.value = \"\";\n fPostUrl.value = \"\";\n fType.value = \"\";\n}", "function displayMovie(data) {\n\n let movies = data.results;\n let output = ''\n\n $.each(movies, function(index, movie) {\n\n output += `\n\n <div class=\"col-md-4\">\n <div class=\"well text-center\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" onError=\"this.onerror=null;this.src='img/nopic.png';\">\n <h5>${movie.title}</h5>\n <div onclick=\"movieSelected('${movie.id}')\" class=\"btn btn-primary\" id=\"buttonIndex\" href=\"#\">Movie Details</div>\n </div>\n </div>\n `;\n });\n\n $('#movies').html(output);\n\n if (movies == 0) {\n window.alert('ERROR: PLEASE INSERT A CORRECT MOVIE NAME');\n }\n}", "function newRatings(){\r\n\tif(pageType==\"LIST\"){\r\n\t\ttitle=$(\".bobMovieHeader\").children(\".title\").text();\r\n\t\tyear=$(\".bobMovieHeader\").children(\".year\").text().split('-')[0];\r\n\t\tif(lastTitle!=title){\r\n\t\t\tlastTitle=title\r\n\t\t\tgetRating(title,year)\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsetResults(imdbRating,tomatoMeter,imdbId);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\ttitle = $('.title-wrapper').children('.title').text();\r\n\t\tyear = $('.titleArea').children(\".year\").text().split('-')[0];\r\n\t\tgetRating(title,year);\r\n\t}\r\n}", "function updateMovies(movie){\n if(movie.destinationId){\n var form = FormApp.openById(movie.formId);\n form.setDescription(' \\n Format: ' + movie.format + \n ' \\n DCP Drive Type: ' + movie.dcpDriveType + \n ' \\n DCP File Size: ' + movie.dcpFileSize +\n ' \\n DCP Encription: ' + movie.dcpEncryption + \n ' \\n DCP Notes: ' + movie.dcpNotes +\n ' \\n Aspect Ratio: ' + movie.aspectRatio + \n ' \\n Sound Format: ' + movie.soundFormat +\n ' \\n Runtime: ' + movie.runtime + \n ' \\n Backup: ' + movie.backupFormat\n );\n }\n \n}", "function cardMovieGenerator(movie) {\n const card = document.createElement(\"article\");\n card.classList.add(\"carousel-item\");\n setAttributes(card, {\n onclick: `showModal(${movie.id})`,\n \"data-id\": `${movie.id}`,\n });\n\n card.innerHTML = `\n <img class=\"carousel-item-img\" src=\"${movie.medium_cover_image}\" alt=\"Poster de ${movie.title}\" />\n <div class=\"carousel-details\">\n <div class=\"buttons-contact\">\n <a href=\"${movie.torrents[0].url}\">\n <img src=\"./src/img/icons8-play-64.png\" alt=\"Ver pelicula\" srcset=\"\">\n </a>\n <img src=\"./src/img/icons8-plus-64.png\" alt=\"Agregar\" srcset=\"\">\n </div>\n <p class=\"carousel-item-title ellipsis\">${movie.title}</p>\n <p class=\"carousel-item-subtitle\">${movie.year} ${movie.language} ${movie.runtime} min</p>\n </div>`;\n\n return card;\n}", "function getMovie(movieID) {\n\n axios.get('https://www.omdbapi.com?i=' + movieID + '&apikey=5623718')\n .then((response) => {\n let movie = response.data;\n let output = `\n <div class=\"moviedscrpt\">\n <div class=\"centerbox\">\n <img src=\"${movie.Poster}\" class=\"thumbnail\">\n <h2 style = \"color: white;\">${movie.Title}</h2>\n </div>\n <ul class=\"list-group\">\n <li class=\"list-group-item\"><strong>Genre:</strong> ${movie.Genre}</li>\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.Released}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.Rated}</li>\n <li class=\"list-group-item\"><strong>IMDB Rating:</strong> ${movie.imdbRating}</li>\n <li class=\"list-group-item\"><strong>Director:</strong> ${movie.Director}</li>\n <li class=\"list-group-item\"><strong>Writer:</strong> ${movie.Writer}</li>\n <li class=\"list-group-item\"><strong>Actors:</strong> ${movie.Actors}</li>\n </ul>\n <div class=\"well\" style=\"margin:4%\">\n <h3 style = \"color: white\" >Plot</h3>\n <p style = \"color: white\">${movie.Plot}</p>\n <hr>\n <div class=\"centerbox\">\n <a href=\"post-review.html?${movie.imdbID}\"; id = \"postreview\" class=\"anotest\">\n <span></span>\n <span></span>\n <span></span>\n <span></span>\n Leave a Comment</a>\n <a onclick=\"a()\"; id = \"Addfavourite\" class=\"anotest\">\n <span></span>\n <span></span>\n <span></span>\n <span></span>\n Add Favourite</a>\n <a href=\"profile_favorite.html\" ; class=\"anotest\">\n <span></span>\n <span></span>\n <span></span>\n <span></span>\n Favourite List</a>\n </div>\n </div>\n </div>\n <script>\n function check() {\n let string = decodeURIComponent(window.location.search); // from \"10b Lecture Javascript Relevant Bits-1\"\n let query = string.split(\"?\"); // Projects 1800 lecture slides\n let movieId = query[1];\n const db = firebase.firestore();\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n axios.get('https://www.omdbapi.com?i=' + movieId + '&apikey=5623718')\n .then((response) => {\n var checka = db.collection('users');\n let movie = response.data;\n checka.where('favouriteLists', 'array-contains', movieId).get().then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n if (doc.exists) {\n $('#Addfavourite').text('Remove Favourite');\n } else {\n console.log(\"No such document!\");\n }\n });\n })\n .catch((error) => {\n console.log(\"Error getting documents: \", error);\n });\n });\n };\n });\n }\n check();\n function a() {\n let string = decodeURIComponent(window.location.search); // from \"10b Lecture Javascript Relevant Bits-1\"\n let query = string.split(\"?\"); // Projects 1800 lecture slides\n let movieId = query[1];\n const db = firebase.firestore();\n var addFavBtn = $(\"#Addfavourite\").text();\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n axios.get('https://www.omdbapi.com?i=' + movieId + '&apikey=5623718')\n .then((response) => {\n let movie = response.data;\n console.log(addFavBtn.trim() );\n if (addFavBtn.trim().localeCompare(\"Remove Favourite\") != 0) {\n db.collection(\"users\").doc(user.uid).update({\n \"favouriteLists\": firebase.firestore.FieldValue.arrayUnion(movieId),\n });\n $('#Addfavourite').text('Remove Favourite');\n addFavBtn = $(\"#Addfavourite\").text();\n } else if (addFavBtn.trim().localeCompare(\"Remove Favourite\") == 0) {\n db.collection(\"users\").doc(user.uid).update({\n \"favouriteLists\": firebase.firestore.FieldValue.arrayRemove(movieId),\n });\n $('#Addfavourite').text('Add Favourite');\n addFavBtn = $(\"#Addfavourite\").text();\n }\n });\n };\n });\n }\n </script>`;\n $('#movies').html(output);\n\n })\n .catch((err) => {\n console.log(err);\n });\n}", "function createMovie() {\n var title = document.querySelector(\"#movie-title\").value.trim();\n var length = document.querySelector(\"#movie-length\").value;\n var formSelect = document.querySelector(\"#movie-genre\");\n var genre = formSelect.options[formSelect.selectedIndex].value;\n\n var movie = new Movie(title, length, genre);\n\n // Check if movie already exists\n if (listOfMovies.hasElem(movie)) {\n alert(\"movie already exist\");\n return;\n }\n\n var movieItem = document.createElement(\"li\");\n var movieText = document.createTextNode(movie.getData());\n\n movieItem.appendChild(movieText);\n movieUlList.appendChild(movieItem);\n\n // Push created movie to global list of movies and get it's index\n var movieIndex = listOfMovies.push(movie) - 1;\n\n // Put created movie to the drop-down menu\n var option = document.createElement(\"option\");\n option.value = movieIndex;\n var text = document.createTextNode(movie.title);\n option.appendChild(text);\n movieSelector.appendChild(option);\n\n // Reset form\n document.querySelector(\"#movie-form\").reset();\n}", "function chosenMovie(userMovieInput){\n request(`http://www.omdbapi.com/?t=${userMovieInput}&y=&i=&plot=short&tomatoes=true&r=json`, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var parseUserInput = JSON.parse(body)\n var movieOutput = \"Movie Title: \" + parseUserInput.Title + \"\\n\" +\n \"Year Release: \" + parseUserInput.Year + \"\\n\" +\n \"Country Produced: \" + parseUserInput.Country + \"\\n\" +\n \"Language: \" + parseUserInput.Language + \"\\n\" +\n \"Plot: \" + parseUserInput.Plot + \"\\n\" +\n \"Actors: \" + parseUserInput.Actors + \"\\n\" +\n \"IMBD Rating: \" + parseUserInput.imdbRating + \"\\n\" +\n \"Rotten Tomatoes Rating: \" + parseUserInput.tomatoRating + \"\\n\" +\n \"Rotten Tomatoes URL: \" + parseUserInput.tomatoURL + \"\\n\";\n // console.log(movieOutput);\n logText(movieOutput);\n }\n // Reenable the start prompt until the user exits the app.\n start();\n });\n}", "function movieThis(){\n\tif (movie === undefined) {\n\tmovie = 'Mr.Nobody';\n\t};\n\tvar url = 'http://www.omdbapi.com/?t=' + movie +'&y=&plot=long&tomatoes=true&r=json';\n\trequest(url, function(error, body, data){\n \t\tif (error){\n \t\t\tconsole.log(\"Request has returned an error. Please try again.\")\n \t\t}\n \tvar response = JSON.parse(data);\n\t\tconsole.log(\"******************************\")\n\t\tconsole.log(\"Movie title: \" + response.Title);\n\t\tconsole.log(\"Release Year: \" + response.Year);\n\t\tconsole.log(\"IMDB Rating: \" + response.imdbRating);\n\t\tconsole.log(\"Country where filmed: \" + response.Country);\n\t\tconsole.log(\"Language: \" + response.Language);\n\t\tconsole.log(\"Movie Plot: \" + response.Plot);\n\t\tconsole.log(\"Actors: \" + response.Actors);\n\t\tconsole.log(\"Rotten Tomatoes URL: \" + response.tomatoURL);\n\t\tconsole.log(\"******************************\")\n\t});\n}", "function printMovieTv(InsertedFilm, url, container) {\n $('#insert-film-name').val('');\n $(container).html('');\n $.ajax({\n url: url,\n method: 'GET',\n data: {\n api_key: '25046906a5edc120a00e8cdb72843203',\n query: InsertedFilm,\n language: 'it-IT',\n },\n success: function (risposta) {\n var source = document.getElementById(\"films-template\").innerHTML;\n var template = Handlebars.compile(source);\n var movieId;\n var ThisResults;\n for (var i = 0; i < risposta.results.length; i++) {\n ThisResults = risposta.results[i];\n movieId = ThisResults.id;\n var context = {\n poster_path: printPoster(ThisResults.poster_path),\n title: ThisResults.title,\n original_title: ThisResults.original_title,\n language: ThisResults.original_language,\n name: ThisResults.name,\n original_name: ThisResults.original_name,\n vote_average: printStars(ThisResults),\n overview: ThisResults.overview,\n movieId: movieId\n };\n var html = template(context);\n $(container).append(html);\n SearchActors(movieId);\n $('.film').show();\n $('.serie').show();\n }\n },\n error: function (request, state, errors) {\n console.log(errors);\n }\n });\n}", "function searchMovie(searchWord, page) {\n fetch(\n `http://www.omdbapi.com/?s=${searchWord}&apikey=dd68f9f&page=${page}&plot=short`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n let searchResults = data.Search;\n results.innerHTML = \"\";\n return searchResults.map(function(movie) {\n let movieDiv = createNode(\"div\");\n let movieTitle = createNode(\"h1\");\n let moviePoster = createNode(\"img\");\n let more = createNode(\"div\");\n let movieDetails = createNode(\"p\");\n let movieID = movie.imdbID;\n let movieActors = createNode(\"p\");\n let movieDirector = createNode(\"p\");\n let movieRating = createNode(\"p\");\n\n movieDiv.className = \"movie-div\";\n\n movieTitle.textContent = `${movie.Title} (${movie.Year})`;\n movieTitle.className = \"movie-title\";\n\n moviePoster.src = movie.Poster;\n moviePoster.className = \"movie-images\";\n\n more.textContent = \"More...\";\n more.className = \"more\";\n\n movieDetails.className = \"movie-details--off\";\n\n append(results, movieDiv);\n append(movieDiv, movieTitle);\n append(movieDiv, moviePoster);\n append(movieDiv, more);\n append(more, movieActors);\n append(more, movieDirector);\n append(more, movieRating);\n append(more, movieDetails);\n\n more.addEventListener(\"click\", function(event) {\n event.preventDefault();\n if (movieDetails.className == \"movie-details--off\") {\n fetch(\n `http://www.omdbapi.com/?i=${movieID}&apikey=dd68f9f&plot=full`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n console.log(data);\n movieActors.textContent = `Cast: ${data.Actors}`;\n if (movie.Director !== \"N/A\") {\n movieDirector.textContent = `Directed by: ${data.Director}`;\n }\n movieRating.textContent = `${data.Ratings[0].Source}: ${\n data.Ratings[0].Value\n }\n ${data.Ratings[1].Source}: ${data.Ratings[1].Value}\n ${data.Ratings[2].Source}: ${data.Ratings[2].Value}`;\n\n movieDetails.className = \"movie-plot\";\n movieDetails.textContent = `Plot: ${data.Plot}`;\n });\n\n movieDetails.classList.toggle(\"movie-details--on\");\n } else if (movieDetails.className == \"movie-details--on\") {\n movieDetails.classList.toggle(\"movie-details--off\");\n }\n });\n });\n });\n}", "function renderDOM(movieInfo){\n loaderEl.classList.toggle(\"invisible\");\n console.log(\"Rendering movie results\");\n var article = document.querySelector(\"article\");\n article.innerHTML = \"\";\n movieInfo.forEach(function(movie){\n var section = document.createElement('section');\n var title = document.createElement('h2');\n var span = document.createElement('span');\n title.innerHTML = movie.Title;\n span.innerHTML = movie.Year;\n section.appendChild(title);\n section.appendChild(span);\n article.appendChild(section);\n });\n}", "function updatePage(movieData) {\n\n // Error handler if movie isn't available for streaming\n if (movieData.results.length === 0) {\n $(\"#movie-section\").html(\"Title not found, please enter another movie\");\n }\n else {\n // Var for array of available locations to stream:\n var locations = movieData.results[0].locations;\n\n // Var for movie title\n var movieTitle = $(\"#movie-search\").val().trim().toUpperCase();\n\n // Create header with title and append to page\n var titleHeader = $(\"<h2 id='movie-title'>\");\n titleHeader.html(movieTitle);\n $(\"#movie-section\").append(titleHeader);\n $(\"#movie-section\").append($(\"<br>\"));\n\n\n // Loop through different streaming services available and display name and link:\n for (var i = 0; i <= locations.length - 1; i++) {\n\n // Create div for response info\n var streamDiv = $(\"<div id='all-links'>\");\n\n // Create div for name of streaming service and append to streamDiv\n var serviceDiv = $(\"<div id='service-name'>\");\n serviceDiv.html(\"<strong>Available on: </strong>\" + locations[i].display_name);\n streamDiv.append(serviceDiv);\n\n // Create div for link to streaming service and append to streamDiv\n var linkDiv = $(\"<div id='service-link'>\");\n var link = $(\"<a>\");\n\n link.attr(\"href\", locations[i].url);\n link.attr(\"target\", \"_blank\");\n link.text(\"Click here to stream!\");\n\n linkDiv.text(\"Link: \");\n linkDiv.append(link);\n streamDiv.append(linkDiv);\n streamDiv.append($(\"<hr>\"));\n\n // Append streamDiv to page\n $(\"#movie-links\").append(streamDiv);\n }\n\n // Create OMDb query using movie title and call that API\n var omdbQuery = \"https://www.omdbapi.com/?t=\" + movieTitle + \"&apikey=724592e7\";\n\n $.ajax({\n url: omdbQuery,\n method: \"GET\"\n }).then(function (response) {\n\n // Create image for poster and append to page\n var poster = $(\"<img id='moviePic' style='height:200px'>\");\n poster.attr(\"src\", response.Poster);\n $(\"#movie-section\").append(poster);\n\n // Create div for plot and append to page\n var plotDiv = $(\"<div id='plotDiv'>\");\n plotDiv.html(\"<strong>Plot summary: </strong>\" + response.Plot);\n $(\"#movie-section\").append(plotDiv);\n\n // Create div for runtime and append to page\n var timeDiv = $(\"<div id='runtimeDiv'>\");\n timeDiv.html(\"<strong>Runtime: </strong>\" + response.Runtime);\n $(\"#movie-section\").append(timeDiv);\n });\n }\n}", "function displayMovie(event){\n let target = event.target || event.srcElement;\n\n // Retrieves title if parent element selected\n if(target.className == \"movie\"){\n target = target.getElementsByClassName(\"title\")\n target = target[0];\n }\n\n // sends an API request for the specific movie to be displayed\n searchByTitle(target).then(result => {\n let movies = result[\"Title\"];\n displayMovieResult(result);\n });\n}", "function doMovie(name) {\n\n if (name == null) {\n name = 'Mr. Nobody';\n };\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + name + \"&y=&plot=short&apikey=trilogy\";\n\n axios.get(queryUrl).then(\n function (response) {\n\n console.log(\"\\nMovie Name: \" + response.data.Title +\n \"\\nYear: \" + response.data.Year +\n \"\\nIMDB Rating: \" + response.data.imdbRating +\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\nCountry it was produced: \" + response.data.Country +\n \"\\nMovie Language: \" + response.data.Language +\n \"\\nMovie Plot: \" + response.data.Plot +\n \"\\nActors: \" + response.data.Actors);\n\n\n appendFile(\"\\nMovie Name: \" + response.data.Title +\n \"\\nYear: \" + response.data.Year +\n \"\\nIMDB Rating: \" + response.data.imdbRating +\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\nCountry it was produced: \" + response.data.Country +\n \"\\nMovie Language: \" + response.data.Language +\n \"\\nMovie Plot: \" + response.data.Plot +\n \"\\nActors: \" + response.data.Actors);\n });\n}", "function enrichMovie(id) {\n var templateFn = _.template(document.getElementById(\"full-result-template\").innerHTML);\n var resultTemplate = $(\".more[data-value='\" + id + \"']\").parent('div.details');\n var url = apiURL + '?apikey=' + apiKey + '&i=' + id + '&plot=full';\n fetch(url).then(function(response) {\n return response.json();\n }).then(function(movie){\n var templateHTML = templateFn({ // Execute Template Function\n 'title' : movie[\"Title\"],\n 'plot': movie[\"Plot\"],\n 'poster': movie[\"Poster\"],\n 'year': movie[\"Year\"],\n 'awards': movie[\"Awards\"],\n 'runtime': movie[\"Runtime\"],\n 'genre': movie[\"Genre\"],\n 'rating': movie[\"imdbRating\"],\n 'rotten': _.get(movie, \"Ratings[1].Value\"),\n 'metacritic': movie[\"Metascore\"],\n 'director': movie[\"Director\"],\n 'actors': movie[\"Actors\"],\n 'imdbid': movie[\"imdbID\"]\n });\n resultTemplate.html(templateHTML); // Replace The Content\n //$(resultTemplate).css({'margin-left':'1%'}) // hard-fix the replaced content in same position\n });\n}", "function getMovie() {\n let movieId = sessionStorage.getItem('movieId');\n\n $.ajax({\n type: \"GET\",\n url: `https://api.themoviedb.org/3/movie/${movieId}?api_key=${apiKey}&language=en-US`,\n dataType: 'json',\n success: function(data) {\n $(\"#moviePoster\").html(\n `<div class=\"carousel-item active\">\n <img class=\"d-block w-100\" style = \"opacity:0.6\" src=\"https://image.tmdb.org/t/p/original${data.backdrop_path}\" alt=\"First slide\" >\n <div id = \"movieBackground\">\n <a href=\"javascript:history.back()\"><i id=\"back\" class=\"fas fa-3x fa-arrow-left w3-animate-left\" style=\"font-size: 3vw;color:white\"></i></a>\n <a onclick=\"favouritesSelected(${movieId})\"><i id = \"heart\" class=\"fas fa-heart fa-3x w3-animate-right\" style=\"font-size: 3vw;color:white;\"></i></a>\n <a onclick=\"shareSelect()\"><i id = \"share\" class=\"fas fa-share-square fa-3x\" style=\"font-size: 3vw;color:white\"></i></a>\n <a target=\"_blank\" href=\"mailto:?Subject=Cool%20Movie%20App!&amp;Body=https://the-movie-hub.web.app/\"><i id = \"mail\" class=\"fas fa-envelope-square fa-3x\" style=\"font-size: 3vw;color:#228B22\"></i></a>\n <a target=\"_blank\" href=\"https://twitter.com/share?url=https://the-movie-hub.web.app&amp;text=The%20Movie%20Hub%20&amp;hashtags=moviehub\"><i id = \"twitter\" class=\"fab fa-twitter-square fa-3x\" style=\"font-size: 3vw;color:#1DA1F2\"></i></a>\n <a target=\"_blank\" href=\"http://www.facebook.com/sharer.php?u=https://the-movie-hub.web.app/\"><i id = \"facebook\" class=\"fab fa-facebook-square fa-3x\" style=\"font-size: 3vw;color:#3b5998\"></i></a>\n <a target=\"_blank\" href=\"http://reddit.com/submit?url=https://the-movie-hub.web.app&amp;title=The%20Movie%20Hub\"><i id = \"reddit\" class=\"fab fa-reddit-square fa-3x\" style=\"font-size: 3vw;color:#FF5700\"></i></a>\n </div>\n </div>`\n )\n $(\"#summary\").html(\n `<p>${data.overview}</p>`\n )\n $(\"#movieInfo\").html(\n `<div class=\"col-sm-3\">\n <img src=\"https://image.tmdb.org/t/p/original${data.poster_path}\" class=\"card-img-top\" alt=\"...\">\n </div>\n <div style=\"color:white\" class=\"col-sm-6\">\n <h2 style=\"font-weight:bold;letter-spacing: 0.1rem;\">${data.title}</h2>\n <p>Rating: ${data.vote_average} </p>\n <p>Release Date: ${data.release_date} </p>\n <p>Genre: ${data.genres[0] === undefined ? `N/A`: `${data.genres[0].name}`}</p>\n <p>Language: ${data.original_language.toUpperCase()} </p>\n <p>Runtime: ${data.runtime} minutes</p>\n </div>`\n )\n let array = JSON.parse(localStorage.getItem(\"data\")) || [];\n if (array.indexOf(data.id) == -1) {\n $('#heart').css('color', 'white');\n } else {\n $('#heart').css('color', 'red');\n }\n\n },\n error: function(_request, status, error) {\n alert(status + \", \" + error);\n }\n });\n\n $.ajax({\n type: \"GET\",\n url: `https://api.themoviedb.org/3/movie/${movieId}/videos?api_key=${apiKey}&language=en-US`,\n dataType: 'json',\n success: function(data) {\n $(\"#trailer\").html(\n `<h2 style=\"letter-spacing: .3rem;\">TRAILER</h2>\n <iframe width=\"450\" height=\"370\" src=\"https://www.youtube.com/embed/${data.results[0].key}\">\n</iframe>`\n )\n\n\n },\n error: function(_request, status, error) {\n alert(status + \", \" + error);\n }\n });\n\n $.ajax({\n type: \"GET\",\n url: `https://api.themoviedb.org/3/movie/${movieId}/reviews?api_key=${apiKey}&language=en-US`,\n dataType: 'json',\n success: function(data) {\n $(\"#reviews\").html(\n `<h2 style=\"letter-spacing: .3rem;\">REVIEWS</h2>\n <h4>${data.results[0].author}</h4>\n <p style = \"font-size:1em;letter-spacing:normal;\">${data.results[0].content.length > 400 ? `${data.results[0].content.substr(0,400).replace(/.$/,'...')}` : `${data.results[0].content}`}</p><a target=\"_blank\" style = \"text-decoration: none;color: #007bff;\" href=\"${data.results[0].url}\"><p style=\"font-size:1em;letter-spacing:normal;\">View full review</p></a>\n <h4>${data.results[1].author}</h4>\n <p style = \"font-size:1em;letter-spacing:normal;\">${data.results[1].content.length > 400 ? `${data.results[1].content.substr(0,400).replace(/.$/,'...')}` : `${data.results[1].content}`}</p><a target=\"_blank\" style = \"text-decoration: none;color: #007bff;\" href=\"${data.results[1].url}\"><p style=\"font-size:1em;letter-spacing:normal;\">View full review</p></a>`\n )\n\n\n },\n error: function(_request, status, error) {\n alert(status + \", \" + error);\n }\n });\n\n $.ajax({\n type: \"GET\",\n url: `https://api.themoviedb.org/3/movie/${movieId}/credits?api_key=${apiKey}&language=en-US`,\n dataType: 'json',\n success: function(data) {\n $(\"#creditsRow1\").html(\"\");\n $(\"#creditsRow2\").html(\"\");\n\n for (let i = 0; i < 5; i++) {\n $(\"#creditsRow1\").append(\n `<div class=\"col\">\n <a id = \"item1\" class=\"text-decoration-none\">\n <div class=\"card\">\n <img src=\"https://image.tmdb.org/t/p/original${data.cast[i].profile_path}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center fa-1x\">${data.cast[i].name}</h5>\n </div>\n </div></a>\n </div>`\n )\n }\n for (let j = 5; j < 10; j++) {\n $(\"#creditsRow2\").append(\n `<div class=\"col\">\n <a id = \"item1\" class=\"text-decoration-none\">\n <div class=\"card\">\n <img src=\"https://image.tmdb.org/t/p/original${data.cast[j].profile_path}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center fa-1x\">${data.cast[j].name}</h5>\n </div>\n </div></a>\n </div>`\n )\n }\n\n },\n error: function(_request, status, error) {\n alert(status + \", \" + error);\n }\n });\n\n}", "function getMovie(){\r\n movieId = sessionStorage.getItem('movieId');\r\n axios.get('https://api.themoviedb.org/3/movie/'+movieId+'?api_key=7719d9fc54bec69adbe2d6cee6d93a0d&language=en-US')\r\n .then((response) => {\r\n imdbId = response.data.imdb_id;\r\n axios.get('http://www.omdbapi.com?apikey=c1c12a90&i='+imdbId)\r\n .then((response1) => {\r\n console.log(response1);\r\n let movie = response1.data;\r\n let output = '';\r\n const dict = {\r\n 'Jan': 1,\r\n 'Feb': 2,\r\n 'Mar': 3,\r\n 'Apr': 4,\r\n 'May': 5,\r\n 'Jun': 6,\r\n 'Jul': 7,\r\n 'Aug': 8,\r\n 'Sep': 9,\r\n 'Oct': 10,\r\n 'Nov': 11,\r\n 'Dec': 12\r\n };\r\n var arr = movie.Released.split(\" \");\r\n var today = new Date();\r\n var t = new Date(today.getFullYear()+','+(today.getMonth()+1)+','+today.getDate());\r\n var r = new Date(arr[2]+','+dict[arr[1]]+','+arr[0]);\r\n if(movie.Poster != null){\r\n output += `\r\n <h1 class=\"my-4 heading\">${movie.Title}</h1>\r\n\r\n <div class=\"row\">\r\n\r\n <div class=\"col-md-5\">\r\n <img style=\"\" class=\"img-fluid\" src=\"${movie.Poster}\" alt=\"\">\r\n </div>\r\n\r\n <div class=\"col-md-7\">\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\"><strong>Genre: </strong>${movie.Genre}</li>\r\n <li class=\"list-group-item\"><strong>Released: </strong>${movie.Released}</li>\r\n <li class=\"list-group-item\"><strong>Rated: </strong>${movie.Rated}</li>\r\n <li class=\"list-group-item\"><strong>IMDB Rating: </strong>${movie.imdbRating}</li>\r\n <li class=\"list-group-item\"><strong>Director: </strong>${movie.Director}</li>\r\n <li class=\"list-group-item\"><strong>Writer: </strong>${movie.Writer}</li>\r\n <li class=\"list-group-item\"><strong>Actors: </strong>${movie.Actors}</li>\r\n </ul>\r\n <li class=\"list-group-item\"><strong>Overview: </strong>${movie.Plot}</li>\r\n <a href=\"http://imdb.com/title/${movie.imdbID}\" target=\"blank\" class=\"btn btn-primary\">View IMDB</a> `+\r\n (t > r ? `<a href=\"#\" onClick=\"addMovie(${movieId}, ${1})\" class=\"btn btn-primary\">Add to Watched</a> ` : ``)\r\n +`\r\n <a href=\"#\" onClick=\"addMovie(${movieId}, ${0})\" class=\"btn btn-primary\">Add to Wished</a>\r\n </div>\r\n\r\n </div>\r\n `\r\n }\r\n $('#movieSingle').html(output);\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n}", "function getMovieDetails(e){\n e.preventDefault();\n if(e.target.classList.contains('info-btn')){\n let movieItem = e.target.parentElement.parentElement;\n fetch(`https://www.omdbapi.com/?apikey=${apiKey}&i=${movieItem.dataset.id}`)\n .then((response)=>response.json())\n .then((data)=>{\n console.log(data);\n let output = `\n <div class=\"logo-img\">\n <img src=\"${data.Poster}\" alt=\"\">\n </div>\n\n <div class=\"Titles\">\n <h1 class=\"movie-title\">${data.Title}</h1>\n <h3 class=\"movie-category\"><strong>CATEGORY -</strong> ${data.Type}</h3>\n </div>\n\n <div class=\"details\">\n <h2>Details:</h2>\n <ul>\n <li><strong>Genre -</strong> ${data.Genre}</li>\n <li><strong>Released -</strong> ${data.Released}</li>\n <li><strong>Actors -</strong> ${data.Actors}</li>\n <li><strong>Director</strong> ${data.Director}</li>\n <li><strong>Language</strong> ${data.Language}</li>\n <li><strong>Ratings</strong> ${data.imdbRating}</li>\n <li><strong>Language</strong> ${data.Language}</li> \n <li><strong>Box Office</strong> ${data.BoxOffice}</li> \n </ul>\n </div> \n <div class=\"link\"> \n <a href=\"https://imdb.com/title/${data.imdbID}\" target=\"_blank\">get imdb</a>\n </div>\n `;\n movieDetailsContent.innerHTML = output;\n movieDetailsContent.parentElement.classList.add('showMovies')\n\n })\n }\n \n}", "function fscommandMovie(){\n\tdocument.write(\"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" codebase=\\\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\\\" id=\\\"laxChalkboardDesign\\\" width=\\\"577\\\" height=\\\"450\\\" align=\\\"middle\\\">\");\n\tdocument.write(\"<param name=\\\"allowScriptAccess\\\" value=\\\"sameDomain\\\" />\");\n\tdocument.write(\"<param name=\\\"movie\\\" value=\\\"movies/laxChalkboardDesign2.swf\\\" />\");\n\tdocument.write(\"<param name=\\\"loop\\\" value=\\\"false\\\" />\");\n\tdocument.write(\"<param name=\\\"quality\\\" value=\\\"high\\\" />\");\n\tdocument.write(\"<param name=\\\"bgcolor\\\" value=\\\"#ffffff\\\" />\");\n\tdocument.write(\"<embed src=\\\"movies/laxChalkboardDesign2.swf\\\" loop=\\\"false\\\" quality=\\\"high\\\" bgcolor=\\\"#ffffff\\\" width=\\\"577\\\" height=\\\"450\\\" swLiveConnect=true id=\\\"laxChalkboardDesign\\\" name=\\\"laxChalkboardDesign\\\" align=\\\"middle\\\" allowScriptAccess=\\\"sameDomain\\\" type=\\\"application/x-shockwave-flash\\\" pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\" />\");\n\tdocument.write(\"</object>\");\n}", "function renderSingleMoviePage(details) {\n\t\tvar page = $('.single-movie');\n\t\tvar container = $('.preview-large');\n\n\t\t// Show the page.\n\t\tpage.addClass('visible');\n\t}", "function Movie(title,newRelease,times) {\n this.title = title;\n this.newRelease = newRelease;\n this.times = times; \n}", "function movieInfo() {\n let tit = document.getElementById(\"title\")\n tit.innerText = allFilms[0].title\n\n let rntm = document.getElementById(\"runtime\")\n rntm.innerText = `${allFilms[0].runtime} minutes`\n\n let desc = document.getElementById(\"film-info\")\n desc.innerText = allFilms[0].description\n\n let shwt = document.getElementById(\"showtime\")\n shwt.innerText = allFilms[0].showtime\n\n let tix = document.getElementById(\"ticket-num\")\n let tixRem = (allFilms[0].capacity - allFilms[0].tickets_sold)\n tix.innerText = `${parseInt(tixRem)}`\n}", "async function displayMovieResult(result){\n\n // Some ratings may not exist and will cause errors if not handled\n // before trying to push the data as HTML\n let ratings = result[\"Ratings\"];\n\n let imdb = ratings[0];\n let rt = ratings[1];\n let mc = ratings[2];\n\n imdb = criticChecker(imdb);\n rt = criticChecker(rt);\n mc = criticChecker(mc);\n\n // Checks that the movie has a poster and if not, replace it with a default no poster image\n if(result[\"Poster\"] == null || result[\"Poster\"] == \"N/A\"){\n result[\"Poster\"] = \"/NoMoviePoster.jpg\"\n }\n\n // Generates a large block of HTML that forms the main display of information for the selected movie\n // Includes: Poster, Title, Details(Rating, Actors, Release Year, Genres), Plot/Description, and Ratings\n document.getElementById(\"movieDisplay\").innerHTML = \n `<div class=\"displayHead\">\n <img src=\"${result[\"Poster\"]} alt=\"\" class=\"displayImage\">\n <div class=\"displayMain\">\n <p class=\"displayTitle\">${result[\"Title\"]}</p>\n <p class=\"displayDetails\">${result[\"Rated\"]} | ${result[\"Year\"]} | ${result[\"Genre\"]} | ${result[\"Runtime\"]}</p>\n <p class=\"displayActors\">${result[\"Actors\"]}</p>\n </div>\n </div>\n\n <div class=\"displayBody\">\n <p class=\"displayDescription\">\n ${result[\"Plot\"]}\n </p>\n </div>\n\n <div class=\"displayFoot\">\n <div class=\"displayIMDB\">\n <p> ${imdb} </p> \n <label for=\"\">Internet Movie Database</label>\n </div>\n <div class=\"displayRT\">\n <p> ${rt} </p>\n <label for=\"\">Rotten Tomatoes</label>\n </div>\n <div class=\"displayMC\">\n <p> ${mc} </p>\n <label for=\"\">Metacritic</label>\n </div>\n </div>`;\n}", "function showOutput(data) {\n $(\"#title\").text(data.title);\n $(\"#poster\").attr(\"src\", data.poster);\n $(\"#story\").text(data.plot);\n $(\"#released\").text(data.released);\n $(\"#rated\").text(data.rated);\n $(\"#genre\").text(data.genre);\n $(\"#runtime\").text(data.runtime);\n $(\"#director\").text(data.director);\n $(\"#writer\").text(data.writer);\n $(\"#actors\").text(data.actor);\n $(\"#lang\").text(data.language);\n $(\"#country\").text(data.country);\n $(\"#awards\").text(data.awards);\n $(\"#metascore\").text(data.metascore);\n $(\"#imdbrating\").text(data.imdbRating);\n $(\"#imdbvotes\").text(data.imdbVotes);\n $(\"#type\").text(data.type);\n $(\"#year\").text(data.year);\n if (data.type != \"movie\") {\n $(\"#tSeasons\").attr(\"style\", \"visibility: visible\");\n $(\"#totalseason\").attr(\"style\", \"visibility: visible\");\n $(\"#tSeasons\").text(data.tSeason);\n }\n else {\n $(\"#totalseason\").attr(\"style\", \"visibility: hidden\");\n $(\"#tSeasons\").attr(\"style\", \"visibility: hidden\");\n }\n}", "function renderMovieListing(movies){\n let filmstrip = '';\n let movieGenres = [];\n\n let availableGenres = localStorage.getItem(\"currentGenres\") ? JSON.parse(localStorage.getItem(\"currentGenres\")) : getGenres();\n\n for(let movie of movies){\n movieGenres.push(... new Set(movie.genre_ids));\n const filmGenres = filterArray(\"id\", availableGenres, movie.genre_ids);\n filmstrip += `\n <figure class=\"movie\">\n <img class=\"movie--poster\" srcset=\"https://image.tmdb.org/t/p/w342/${movie.poster_path} 320w, https://image.tmdb.org/t/p/w500/${movie.poster_path} 480w, https://image.tmdb.org/t/p/original/${movie.poster_path} 800w\" sizes=\"(max-width: 320px) 280px, (max-width: 480px) 440px, 800px\" src=\"https://image.tmdb.org/t/p/w92/${movie.poster_path}\" alt=\"${movie.title} Poster\" />\n <figcaption class=\"movie--credits\">\n <h2 class=\"movie--title\">${movie.title}</h2>\n <h3 class=\"movie--rating\">Rating: ${movie.vote_average}</h3>\n <ul class=\"movie--genres tags\">\n ${filmGenres.map(genre => (`<li class=\"genre tag\"><span class=\"tag-label\">${genre.name}</span></li>`)).join('')}\n </ul>\n </figcaption>\n </figure>\n `;\n }\n//set the cinema content to the template strings\n document.getElementById('cinema').innerHTML = filmstrip;\n//get unique set of genres to filter against available genres from api\n const currentGenres = [...new Set(movieGenres)];\n//filter the current genres to create a new object\n const filmGenres = filterArray(\"id\", availableGenres,currentGenres);\n\n let genres = '';\n\n for(let genre of filmGenres ){\n let name = genre.name.replace(\" \",\"_\").toLowerCase();\n let id = genre.id;\n genres += `\n <li class=\"genre tag\">\n <input class=\"genre--selector\" type=\"checkbox\" id=\"${name}-${id}\" name=\"genre-tags\" value=\"${id}\">\n <label class=\"tag-label\" for=\"${name}-${id}\" name=\"${name}-label\">${genre.name}</label>\n </li>`;\n }\n document.getElementById('genres').innerHTML = genres;\n\n}", "watchTrailer(xhr, index, element, movieId) {\n\n\n let data = JSON.stringify({});\n\n xhr = new XMLHttpRequest();\n xhr.withCredentials=false;\n\n let name=document.querySelector(\"#movie_title_iframe\");\n\n xhr.addEventListener(\"readystatechange\", function () {\n\n if (xhr.readyState === xhr.DONE && [200,201,203].includes(xhr.status)) {\n\n let results=JSON.parse(xhr.responseText).results;\n\n let selectedListContent = document.querySelectorAll(\".create_list\" );\n selectedListContent[0].style.display=\"none\";\n\n element.forEach(function (el) {\n\n\n if(![undefined].includes(results)){\n if(results.length===0){\n name.textContent=\"An error occurred. Please try again later\";\n el.src=\"https://www.youtube.com/embed/\"+movieId+\"?controls=1&autoplay=1\";\n\n return false;\n }\n\n results.forEach(function (val) {\n\n name.textContent=val.name.substr(0,34);\n if(val.hasOwnProperty('key')){\n el.src=\"https://www.youtube.com/embed/\"+val.key+\"?controls=1&autoplay=1\";\n\n\n }\n return false;\n })\n\n }\n\n\n });\n\n\n }\n\n });\n\n\n\n xhr.open(\"GET\", \"http://api.themoviedb.org/3/movie/\"+movieId+\"/videos?api_key=a8ac0ce418f28d6ec56424ebad76ed12&append_to_response=videos\",true);\n xhr.responseType=\"text\";\n\n xhr.send(data);\n\n\n }", "function showMovies() {\n console.log(\"showMovies()\");\n\n // find the container\n const moviesContainer = document.querySelector(\"#container\");\n\n // loop through all the people listed in the Airtable data. Inside is the code we are applying for EACH person in the list of people.\n movies.forEach((movie) => {\n\n // Print out what a single person's data looks like by printing out its fields\n console.log(\"SHOWING THE MOVIE\")\n console.log(movie.fields);\n\n const movieContainer = document.createElement(\"div\")\n // movieContainer.appendChild(movieImage);\n\n\n const movieImage = document.createElement(\"img\");\n movieImage.src = movie.fields.images[0].url;\n movieImage.classList.add(\"image-container\")\n movieContainer.appendChild(movieImage);\n\n const movieTitle = document.createElement(\"h2\");\n movieTitle.classList.add(\"movie-title\")\n movieTitle.innerText = movie.fields.title;\n movieContainer.appendChild(movieTitle);\n\n const movieDate = document.createElement(\"p\");\n movieDate.classList.add(\"movie-info\")\n movieDate.innerText = movie.fields.date;\n movieContainer.appendChild(movieDate);\n\n const moviePrice = document.createElement(\"p\");\n moviePrice.classList.add(\"movie-info\")\n moviePrice.innerText = movie.fields.price;\n movieContainer.appendChild(moviePrice);\n\n const movieSelect = document.createElement(\"p\");\n movieSelect.classList.add(\"movie-info\")\n movieSelect.innerText = movie.fields.select;\n movieContainer.appendChild(movieSelect);\n\n\n const movieTheatre = document.createElement(\"p\");\n movieTheatre.classList.add(\"movie-info\")\n movieTheatre.innerText = movie.fields.theatre;\n movieContainer.appendChild(movieTheatre);\n\n // const movieGenre = document.createElement(\"p\");\n // movieGenre.classList.add(\"movie-info\")\n // movieGenre.innerText = movie.fields.genre;\n // movieContainer.appendChild(movieGenre);\n\n const movieDuration = document.createElement(\"p\");\n movieDuration.classList.add(\"movie-info\")\n let duration = movie.fields.duration \n\n var hrs = ~~(duration/ 3600);\n var mins = ~~((duration % 3600) / 60);\n var secs = ~~ duration % 60;\n\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n\n console.log(ret)\n\n\n movieDuration.innerText = ret;\n movieContainer.appendChild(movieDuration);\n\n //genre feild from airtable \n //look through the array\n\n let movieGenre = movie.fields.genre;\n\n movieGenre.forEach(function(genre){\n // movieGenre.innerText = genre;\n // moviesContainer.appendChild(genreElement);\n movieContainer.classList.add(genre);\n\n });\n // add event listener to our filter \n //to add an active class to our song\n\n var filterAction = document.querySelector('#action');\n filterAction.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"action\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterAdventure = document.querySelector('#adventure');\n filterAdventure.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"adventure\")){\n songContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterAnimation = document.querySelector('#animation');\n filterAnimation.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"animation\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterBiography = document.querySelector('#biography');\n filterBiography.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"biography\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterCrime = document.querySelector('#crime');\n filterCrime.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"crime\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterDrama = document.querySelector('#drama');\n filterDrama.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"drama\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterFamily = document.querySelector('#family');\n filterFamily.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"family\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterFantasy = document.querySelector('#fantasy');\n filterFantasy.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"fantasy\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterHistory = document.querySelector('#history');\n filterHistory.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"history\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n }); \n\n var filterHorror = document.querySelector('#horror');\n filterHorror.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"horror\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n }); \n\n var filterMusic = document.querySelector('#music');\n filterMusic.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"music\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterMystery = document.querySelector('#mystery');\n filterMystery.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"mystery\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n var filterRomance = document.querySelector('#romance');\n filterRomance.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"romance\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n\n var filterScifi = document.querySelector('#scifi');\n filterScifi.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"scifi\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n \n var filterThriller = document.querySelector('#thriller');\n filterThriller.addEventListener(\"click\", function(){\n\n if (movieContainer.classList.contains(\"mystery\")){\n movieContainer.style.display = \"block\";\n } else {\n movieContainer.style.display = \"none\";\n }\n });\n\n\n\n moviesContainer.appendChild(movieContainer);\n\n\n\n\n\n\n\n\n\n });\n}", "function displayMoreInformationAboutMovie(theId) {\n let displayMoreInformation = `\n <h2>${theId.Title}</h2>\n <div class=\"moviePoster\"><img src=\"${theId.Poster}\" alt=\"Picture of the movie\"></div>\n <p><span class=\"plot\">\"${theId.Plot}\"</span></p>\n <p><span class=\"bold\">Imdb rating: </span> ${theId.imdbRating}</p>\n <p><span class=\"bold\">Actors: </span>${theId.Actors}</p>\n <p><span class=\"bold\">Genres: </span>${theId.Genre}</p>\n <p><span class=\"bold\">Runtime: </span>${theId.Runtime}</p>\n <p><span class=\"bold\">Writer(s): </span>${theId.Writer}</p>\n <p><span class=\"bold\">Released: </span>${theId.Released}</p>\n \n`;\n\n movieInformation.innerHTML = displayMoreInformation;\n}", "function loadMovies() {\n\t// Loop through first half array\n\tfor (var i=0;i<items.length/2;i++) {\n\t\tvar object = get_one_recommended_movie(i);\n\n\t\titems[i].children[0].children[1].children[0].innerHTML = object.name;\n\n\t\t// Set link to go to the indiviual title page\n\t\t$(items[i]).attr(\"href\", \"title/title.php?id=\" + object.id + \"&type=movie\");\n\n\t\t// Apply imdb poster image\n\t\tapplyImdbThumbnail(items[i].children[0].children[0].children[0], false, object.id);\n\t}\n}", "function addMovie(movieText) {\n console.log(movieText);\n fetch(url, {\n method: \"POST\",\n headers: { \"Content-type\": \"application/json\" },\n body: JSON.stringify({\n title: movieText,\n watched: false,\n created_at: moment().format(),\n }),\n })\n .then((response) => response.json())\n .then((movie) => createMovieBox(movie));\n}" ]
[ "0.7241745", "0.70697844", "0.69527066", "0.6943384", "0.6919568", "0.68991745", "0.68914515", "0.6854918", "0.681705", "0.6789709", "0.6726539", "0.67135084", "0.6683075", "0.66331136", "0.66168493", "0.66092485", "0.6604751", "0.6603469", "0.6592809", "0.65871656", "0.6585115", "0.6578777", "0.65581495", "0.65542275", "0.65502435", "0.65222424", "0.6497401", "0.6492138", "0.64607614", "0.6436317", "0.64214087", "0.6404825", "0.6402296", "0.639837", "0.6394688", "0.6393651", "0.63686734", "0.6361186", "0.6354979", "0.6353103", "0.63374764", "0.6317398", "0.631655", "0.6315702", "0.6309021", "0.6302619", "0.6299274", "0.6298758", "0.6295046", "0.6287321", "0.6278194", "0.6264057", "0.6252893", "0.62527007", "0.6252209", "0.6240049", "0.62397915", "0.62390894", "0.6227115", "0.6226625", "0.6218092", "0.62081116", "0.6204898", "0.62041014", "0.62031853", "0.619792", "0.61923456", "0.6190969", "0.619018", "0.6184807", "0.6176635", "0.6172188", "0.61689144", "0.6164731", "0.6160764", "0.6152537", "0.6151829", "0.61514133", "0.6145066", "0.61434793", "0.6140918", "0.6140446", "0.61396295", "0.6137537", "0.61286104", "0.6126888", "0.61234206", "0.6121667", "0.6119738", "0.6105355", "0.6100796", "0.6094221", "0.6089208", "0.6087416", "0.60868734", "0.60855633", "0.6064047", "0.6062648", "0.6059886", "0.60587865" ]
0.66813093
13
Function gets the movie information
function getMovieInfo(args){ console.log("Getting info for movie "+movie_id); var req = new XMLHttpRequest(); req.open("GET", request_path+"/movies/"+movie_id, true); req.onload = function() { var response = JSON.parse(req.response); args[0].setText(response["title"]); args[2].setImage(args[3]+response["img"]); getMovieRating(args); } req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n request(queryUrl, function(e, resp, data) {\n if (!e && resp.statusCode === 200) {\n\n console.log(\"*************************************************\")\n console.log(\"Title: \" + JSON.parse(data).Title);\n console.log(\"Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors: \" + JSON.parse(data).Actors);\n console.log(\"*************************************************\")\n }\n });\n}", "function movieInfo(movieURL) {\n request(movieURL, function(err, response, body) {\n if (!err && response.statusCode == 200) {\n //convert body to string\n body = JSON.parse(body);\n console.log(\"Title: \" + body.Title);\n console.log(\"Year: \" + body.Year);\n console.log(\"Rating: \" + body.Rated);\n console.log(\"Country: \" + body.Country);\n console.log(\"Language: \" + body.Language);\n console.log(\"Plot: \" + body.Plot);\n console.log(\"Cast: \" + body.Actors);\n console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n } else {\n log(\"error_log.txt\", command + \" Error: \" + err);\n return;\n };\n });\n}", "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "function getMovieInfo() {\n\n\t//Then, run a request to the OMDB API with the movieName the user enters.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function(error, response, body) {\n\n\t\t//Create variable to hold all the movie info that we will output to the console.\n\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\tvar movieInfo = JSON.parse(body);\n\t\t//Title of movie\n\t\tvar movieTitle = \"Title: \" + movieInfo.Title;\n\t\t//Year the movie came out.\n\t\tvar movieYear = \"Year movie was released: \" + movieInfo.Year;\n\t\t//IMDB Rating of the movie.\n\t\tvar IMDBRating = \"IMDB movie rating (out of 10): \" + movieInfo.imdbRating;\n\t\t//Rotten Tomatoes rating of the movie.\n\t\tvar rottenTomatoes = \"Rotten Tomatoes rating (out of 100%): \" + movieInfo.Ratings[1].Value;\n\t\t//Country where the movie was produced.\n\t\tvar countryProduced = \"Filmed in: \" + movieInfo.Country;\n\t\t//Language of the movie.\n\t\tvar movieLanguage = \"Language: \" + movieInfo.Language;\n\t\t//Plot of the movie.\n\t\tvar moviePlot = \"Movie plot: \" + movieInfo.Plot;\n\t\t//Actors in the movie.\n\t\tvar movieActors = \"Actors: \" + movieInfo.Actors;\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//console.log(JSON.parse(body));\n\t\t\t//Output the following information to terminal window.\n\t\t\t//Title of the movie.\n\t\t\tconsole.log(movieTitle);\n\t\t \t//Year the movie came out.\n\t\t \tconsole.log(movieYear);\n\t\t \t//IMDB Rating of the movie.\n\t\t \tconsole.log(IMDBRating);\n\t\t \t//Rotten Tomatoes rating of the movie.\n\t\t \tconsole.log(rottenTomatoes);\n\t\t \t//Country where the movie was produced.\n\t\t \tconsole.log(countryProduced);\n\t\t \t//Language of the movie.\n\t\t \tconsole.log(movieLanguage);\n\t\t \t//Plot of the movie.\n\t\t \tconsole.log(moviePlot);\n\t\t \t//Actors in the movie.\n\t\t \tconsole.log(movieActors);\n\t\t}\n\t});\n}", "function getMovieInfo() {\n\n\t//If the movie name is longer than one word, join the words together on one line so that the movie name is all one string.\n\t//Rather than having separate lines for each word.\n\tfor (var i = 3; i < input.length; i++) {\n\n\t\tif (i > 2 && i < input.length) {\n\t\t\tmovieName = movieName + \" \" + input[i];\n\t\t}\n\t\t//For example, if the user enters \"node liri.js movie this social network\", movieName should be \"social network\" when the value is logged the terminal.\n\t\t//console.log(movieName);\n\t}\n\n\t//If no movie name is specified on the command line, then show the movie info for the movie, Mr. Nobody.\n\tif (!movieName) {\n\t\t//If no movie is specified, set movieName equal to Mr. Nobody.\n\t\tmovieName = \"Mr Nobody\";\n\t\tconsole.log(\"If you haven't watched Mr. Nobody, then you should: http://www.imdb.com/title/tt0485947/\");\n\t\tconsole.log(\"It's on Netflix!\")\n\t}\n\n\t//Use the figlet npm package to convert the movieName text to art/drawing.\n\tfiglet(movieName, function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\n\t//Then, run a request to the OMDB API with the movieName value.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function (error, response, body) {\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\t\tvar movieInfo = JSON.parse(body);\n\t\t\t//console.log(movieInfo);\n\n\t\t\t// Create variable to hold Rotten Tomatoes Rating.\n\t\t\tvar tomatoRating = movieInfo.Ratings[1].Value;\n\n\t\t\t//Output the following information about movieName.\n\t\t\t// \\r\\n is used as a new line character in Windows: https://stackoverflow.com/questions/15433188/r-n-r-n-what-is-the-difference-between-them \n\t\t\tvar movieResult =\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Output the liri command plus movieName\n\t\t\t\t\"liri command: movie-this \" + movieName + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Title of the movie.\n\t\t\t\t\"Title: \" + movieInfo.Title + \"\\r\\n\" +\n\t\t\t\t//Year the movie came out.\n\t\t\t\t\"Year movie was released: \" + movieInfo.Year + \"\\r\\n\" +\n\t\t\t\t//IMDB Rating of the movie.\n\t\t\t\t\"IMDB movie rating (out of 10): \" + movieInfo.imdbRating + \"\\r\\n\" +\n\t\t\t\t//Rotten Tomatoes rating of the movie.\n\t\t\t\t\"Rotten Tomatoes rating (out of 100%): \" + tomatoRating + \"\\r\\n\" +\n\t\t\t\t//Country where the movie was produced.\n\t\t\t\t\"Filmed in: \" + movieInfo.Country + \"\\r\\n\" +\n\t\t\t\t//Language of the movie.\n\t\t\t\t\"Language: \" + movieInfo.Language + \"\\r\\n\" +\n\t\t\t\t//Plot of the movie.\n\t\t\t\t\"Movie plot: \" + movieInfo.Plot + \"\\r\\n\" +\n\t\t\t\t//Actors in the movie.\n\t\t\t\t\"Actors: \" + movieInfo.Actors + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\"\n\n\t\t\t//Output the movie information to the terminal.\n\t\t\tconsole.log(movieResult);\n\t\t\t//Output the movie information to the log.txt file.\n\t\t\tlogData(movieResult);\n\t\t}\n\t});\n}", "function movieInfo(movie) {\n\t// If a movie has been passed into the function\n\t// then set parameters to the specified movie. \n\t// Otherwise set it to \"Mr. Nobody\"\n\tif (typeof(movie) != \"undefined\") {\n\t\tvar queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n\t} else {\n\t\tvar queryURL = \"http://www.omdbapi.com/?t=Mr.Nobody&y=&plot=short&apikey=40e9cece\";\n\t};\n\t\t// Run a request to the OMDB API with the movie specified\n\t\trequest(queryURL, function(error, response, body) {\n\n\t \t// If the request is successful (i.e. if the response status code is 200)\n\t \tif (!error && response.statusCode === 200) {\n\n\t\t // Parse the body of the site and recover just the movie title\n\t\t console.log(\"Movie Title: \" + JSON.parse(body).Title);\n\t\t // Year the movie came out\n\t\t console.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t // IMDB rating of the movie\n\t\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t // Country where the movie was produced\n\t\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t\t // Language of the movie\n\t\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t\t // Plot of the movie\n\t\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t // Actors in the movie\n\t\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t // Rotten tomoatoes rating\n\t\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\t// Append the results to the log file log.txt\n\t\t\tfs.appendFile(\"log.txt\",';'+ \"Movie Title: \" + JSON.parse(body).Title + ';' + \n\t\t\t\t\t\t\t\"Release Year: \" + JSON.parse(body).Year + ';' +\n\t\t\t\t\t\t\t\"IMDB Rating: \" + JSON.parse(body).imdbRating + ';' +\n\t\t\t\t\t\t\t\"Country: \" + JSON.parse(body).Country + ';' +\n\t\t\t\t\t\t\t\"Language: \" + JSON.parse(body).Language + ';' +\n\t\t\t\t\t\t\t\"Plot: \" + JSON.parse(body).Plot + ';' +\n\t\t\t\t\t\t\t\"Actors: \" + JSON.parse(body).Actors + ';' +\n\t\t\t\t\t\t\t\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value , function(err){\n\t\t\t\t//If the code experiences any errors it will log the error to the console.\n\t\t\t if (err) {\n\t\t\t return console.log(err);\n\t\t\t };\n\t\t\t});\n\n\t\t};\n\t});\n}", "function getMovieInfo(movieTitle) {\n\n\t// Runs a request to the OMDB API with the movie specified.\n\n\tvar queryUrl = \"http://www.omdbapi.com/?s=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json&apikey=trilogy\";\n\n\tomdb(queryUrl, function (error, response, body) {\n\t\t// console.log(\"Here\",body)\n\n\t\tif (error) {\n\t\t\tconsole.log(error)\n\t\t}\n\n\t\t// If the request is successful...\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parses the body of the site and recovers movie info.\n\n\t\t\tvar movie = JSON.parse(body);\n\n\t\t\t// Prints out movie info form omdb server.\n\n\t\t\tlogOutput(\"Movie Title: \" + movie.Title);\n\n\t\t\tlogOutput(\"Release Year: \" + movie.Year);\n\n\t\t\tlogOutput(\"IMDB Rating: \" + movie.imdbRating);\n\n\t\t\tlogOutput(\"Country Produced In: \" + movie.Country);\n\n\t\t\tlogOutput(\"Language: \" + movie.Language);\n\n\t\t\tlogOutput(\"Plot: \" + movie.Plot);\n\n\t\t\tlogOutput(\"Actors: \" + movie.Actors);\n\n\t\t\t// Had to set to array value, as there seems to be a bug in API response,\n\n\t\t\t// that always returns N/A for movie.tomatoRating.\n\n\t\t\tlogOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n\n\t\t\tlogOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n\n\t\t}\n\n\t});\n\n}", "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=//!InsertKey\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "function getMovieInfo(movie) {\n // If no movie is provided, get the deets for Mr. Nobody\n if (movie === \"\") {\n movie = \"Mr. Nobody\";\n }\n // Variable to hold the query URL\n let queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n // API request\n request(queryURL, function (error, response, body) {\n let movieResponse = JSON.parse(body);\n if (error || movieResponse.Response == \"False\") {\n console.log(\"Something went wrong. Try again?\", error);\n }\n else {\n let arrLog = [];\n arrLog.push(\"Title: \" + movieResponse.Title);\n arrLog.push(\"Year: \" + movieResponse.Year);\n arrLog.push(\"IMDB Rating: \" + movieResponse.Ratings[0].Value);\n arrLog.push(\"Rotten Tomatoes Rating: \" + movieResponse.Ratings[1].Value);\n arrLog.push(\"Produced in: \" + movieResponse.Country);\n arrLog.push(\"Language: \" + movieResponse.Language);\n arrLog.push(\"Plot: \" + movieResponse.Plot);\n arrLog.push(\"Actors: \" + movieResponse.Actors);\n arrLog.push(logSeparator);\n logAndStoreResults(arrLog);\n }\n });\n}", "function movieInfo(movieURL) {\r\n request(movieURL, function(err, response, body) {\r\n if (!err && response.statusCode == 200) {\r\n //convert body to string\r\n body = JSON.parse(body);\r\n console.log(\"\\n\".red);\r\n console.log(\"Title: \".blue + body.Title.red);\r\n console.log(\"Year: \".blue + body.Year.red);\r\n console.log(\"Rating: \".blue + body.Rated.red);\r\n console.log(\"Country: \".blue + body.Country.red);\r\n console.log(\"Language: \".blue + body.Language.red);\r\n console.log(\"Plot: \".blue + body.Plot.red);\r\n console.log(\"Cast: \".blue + body.Actors.red);\r\n console.log(\"Rotten Tomatoes Rating: \".blue + body.tomatoRating.red);\r\n console.log(\"Rotten Tomatoes URL: \".blue + body.tomatoURL.red);\r\n console.log(\"\\n\");\r\n } else {\r\n log(\"error.txt\", command + \" Error: \" + err);\r\n return;\r\n };\r\n });\r\n}", "function movieThis(){\n\tif (movie === undefined) {\n\tmovie = 'Mr.Nobody';\n\t};\n\tvar url = 'http://www.omdbapi.com/?t=' + movie +'&y=&plot=long&tomatoes=true&r=json';\n\trequest(url, function(error, body, data){\n \t\tif (error){\n \t\t\tconsole.log(\"Request has returned an error. Please try again.\")\n \t\t}\n \tvar response = JSON.parse(data);\n\t\tconsole.log(\"******************************\")\n\t\tconsole.log(\"Movie title: \" + response.Title);\n\t\tconsole.log(\"Release Year: \" + response.Year);\n\t\tconsole.log(\"IMDB Rating: \" + response.imdbRating);\n\t\tconsole.log(\"Country where filmed: \" + response.Country);\n\t\tconsole.log(\"Language: \" + response.Language);\n\t\tconsole.log(\"Movie Plot: \" + response.Plot);\n\t\tconsole.log(\"Actors: \" + response.Actors);\n\t\tconsole.log(\"Rotten Tomatoes URL: \" + response.tomatoURL);\n\t\tconsole.log(\"******************************\")\n\t});\n}", "function getMovie(movieName) {\n axios.get(`http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`)\n .then(function(movie){\n console.log(\"\");\n console.log(\n `Title: ${movie.data.Title}\\n`,\n `Released: ${movie.data.Year}\\n`,\n `Rating from IMDB: ${movie.data.Ratings[0].Value}\\n`,\n `Country of origin: ${movie.data.Country}\\n`,\n `Plot: ${movie.data.Plot}\\n`,\n `Cast: ${movie.data.Actors}\\n`\n )\n })\n .catch(function(err){\n console.log(err)\n });\n}", "function movieThis(movieName) {\n var queryUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Console log all necessary data points\n console.log(JSON.parse(body));\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"Rated: \" + JSON.parse(body).Rated);\n console.log(\n \"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value\n );\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Produced In: \" + JSON.parse(body).Country);\n console.log(\"Laguage: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n}", "function getMovieInfo(movieTitle) {\n\n // Runs a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?apikey=8b309cfb&t=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful...\n if (!error && response.statusCode === 200) {\n\n // Parses the body of the site and recovers movie info\n var movie = JSON.parse(body);\n\n // Prints out movie info\n logOutput(\"Movie Title: \" + movie.Title);\n logOutput(\"Release Year: \" + movie.Year);\n logOutput(\"IMDB Rating: \" + movie.imdbRating);\n logOutput(\"Country Produced In: \" + movie.Country);\n logOutput(\"Language: \" + movie.Language);\n logOutput(\"Plot: \" + movie.Plot);\n logOutput(\"Actors: \" + movie.Actors);\n logOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n logOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n }\n });\n}", "function getMovieInfo() {\n let movieName = name;\n // if no movie name entered, 'Mr. Nobody' will appear\n if (!movieName) {\n movieName = \"Mr. Nobody \";\n }\n\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n axios.get(queryUrl).then(function (response) {\n movieInfo = [\"Title: \" + response.data.Title,\n \"Year Released: \" + response.data.Year,\n \"IMDB Rating: \" + response.data.Ratings[0].Value,\n \"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value,\n \"Country: \" + response.data.Country,\n \"Language: \" + response.data.Language,\n \"Plot: \" + response.data.Plot,\n \"Actors: \" + response.data.Actors];\n console.log(\"\\nTitle: \" + response.data.Title,\n \"\\nYear Released: \" + response.data.Year,\n \"\\nIMDB Rating: \" + response.data.Ratings[0].Value,\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value,\n \"\\nCountry: \" + response.data.Country,\n \"\\nLanguage: \" + response.data.Language,\n \"\\nPlot: \" + response.data.Plot,\n \"\\nActors: \" + response.data.Actors);\n });\n\n}", "function getMovie(movie) {\n\tif (!movie) {\n\t\tmovie = \"Mr. Nobody\"\n\t}\n\n\trequest(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\n\t\t\t// If the request is successful (i.e. if the response status code is 200)\n\t\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parse the body of the site and recover just the imdbRating\n\t\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n\t\t\tvar result = \"Title: \" + JSON.parse(body).Title + \"\\n\" +\n\t\t\t\t\t\"Year: \" + JSON.parse(body).Year + \"\\n\" +\n\t\t\t\t\t\"IMDB Rating: \" + JSON.parse(body).imdbRating + \"\\n\" +\n\t\t\t\t\t\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value + \"\\n\" +\n\t\t\t\t\t\"Country: \" + JSON.parse(body).Country + \"\\n\" +\n\t\t\t\t\t\"Lang: \" + JSON.parse(body).Language + \"\\n\" +\n\t\t\t\t\t\"Plot: \" + JSON.parse(body).Plot + \"\\n\" +\n\t\t\t\t\t\"Actors: \" + JSON.parse(body).Actors ;\n\t\t\tconsole.log(result)\n\t\t\treturn result\n\t\t\t\t \n\n\t\t\t}\n\t\t\t});\n\n}", "function getMovieInfo(movieName) {\n console.log(\"Get Movie\");\n if (movieName === undefined) {\n movieName = \"Mr Nobody\";\n }\n\n var movieURL =\n \"http://www.omdbapi.com/?t=\" +\n movieName +\n \"&y=&plot=full&tomatoes=true&apikey=trilogy\";\n axios\n .get(movieURL)\n .then(function(response) {\n var jsonData = response.data;\n var movieData = [\n divider,\n \"Title: \" + jsonData.Title,\n \"Year: \" + jsonData.Year,\n \"Country: \" + jsonData.Country,\n \"Language: \" + jsonData.Language,\n \"Plot: \" + jsonData.Plot,\n \"Actors: \" + jsonData.Actors,\n divider\n ].join(\"\\n\\n\");\n console.log(movieData);\n })\n .catch(function(error) {\n console.log(error);\n })\n .finally(function() {});\n}", "function movieThis(movieName) {\n\n // Default set as Mr. Nobody if user doesn't specify a movie.\n if (movieName == \"\") {\n movieName = \"Mr. Nobody\"\n }\n // Call to and responce from omdb API\n axios.get(\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=\" + process.env.MOVIE_SECRET)\n .then(function (response) {\n\n var data = response.data\n\n console.log(\"-------------------------------\");\n console.log(\"* Title: \" + data.Title);\n console.log(\"* Year: \" + data.Year);\n console.log(\"* IMDB: \" + data.Ratings[0].Value);\n console.log(\"* Roten Tomatoes: \" + data.Ratings[1].Value);\n console.log(\"* Country: \" + data.Country);\n console.log(\"* Language: \" + data.Language);\n console.log(\"* Plot: \" + data.Plot);\n console.log(\"* Actors: \" + data.Actors);\n console.log(\"---------------------------------\");\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "function lookupSpecificMovie () {\n //Calls upon the OMDB api to get data related to the 2009 movie MR. Nobody\n axios.get('http://www.omdbapi.com/?apikey=trilogy&t=Mr.+Nobody')\n .then(function (response) {\n //Node command\n logOutput('Command: node liri.js movie-this ' + response.data.Title);\n //Title of the movie.\n logOutput('Title: ' + response.data.Title);\n //Year the movie came out.\n logOutput('Year: ' + response.data.Year);\n //IMDB Rating of the movie.\n logOutput('IMDB Rating: ' + response.data.Ratings[0].Value);\n //Rotten Tomatoes Rating of the movie.\n logOutput('Rotton Tomatoes Rating ' + response.data.Ratings[1].Value);\n //Country where the movie was produced.\n logOutput('Country ' + response.data.Country);\n //Language of the movie.\n logOutput('Language ' + response.data.Language);\n //Plot of the movie.\n logOutput('Plot ' + response.data.Plot);\n //Actors in the movie.\n logOutput('Actors ' + response.data.Actors);\n logOutput(\"------------\");\n})\n.catch(function (error) {\n //Logs any errors to the log.txt files\n logOutput(error);\n});\n}", "function movie() {\n if (process.argv[3]) {\n var movieName = process.argv[3];\n } else {\n var movieName = 'mr nobody';\n }\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = 'http://www.omdbapi.com/?t=' + movieName + '&y=&plot=short&apikey=' + omdb_key;\n // Then run a request to the OMDB API with the movie specified\n request(queryUrl, function(error, response, body) {\n // If the request is successful \n if (!error && response.statusCode === 200) {\n var data = JSON.parse(body);\n // Then log info about the movie\n console.log('movie: ' + data.Title);\n console.log('year released: ' + data.Year);\n console.log('imdb rating: ' + data.Ratings[0].Value);\n console.log('rt rating: ' + data.Ratings[1].Value);\n console.log('country: ' + data.Country);\n console.log('language: ' + data.Language);\n console.log('plot: ' + data.Plot);\n console.log('actors: ' + data.Actors);\n } else {\n return console.log('error: ' + error);\n }\n });\n}", "function getMovieInfo(url) {\n let rankPattern = /<strong class=\"ll rating_num\" property=\"v:average\">([0-9.]+)<\\/strong>/\n let NamePattern = /<span property=\"v:itemreviewed\">(.+?)<\\/span>/\n let summaryPattern = /<span property=\"v:summary\" .*?>(.+?)<\\/span>/\n\n return request.get({\n url:url,\n // headers: options.headers\n })\n .promise()\n .then(function(html){\n let $ = cheerio.load(html)\n let $genres = $('#info > span[property=\"v:genre\"]')\n let genres = ''\n $genres.each(function(i, el){\n genres += $(this).text() + ' '\n })\n genres = genres.trimRight()\n genres = genres.replace(/ /g, '|')\n let rank = html.match(rankPattern) ? html.match(rankPattern)[1] : null\n let movieName = html.match(NamePattern) ? html.match(NamePattern)[1] : null\n\n return {\n newUrls: getUrls(html),\n rank,\n movieName,\n genres\n }\n })\n}", "function movieThis(movie) {\n\n if (movie.length === 0) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + searchQuery + \"&y=&plot=short&apikey=trilogy\";\n }\n\n // axios method to recieve and print data\n axios.get(queryURL).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMBD Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n\n );\n}", "function movied() {\n var movieTitle =\"\"; \n if (userInput[3] === undefined){\n movieTitle = \"mr+nobody\"\n } else {\n movieTitle = userInput[3];\n }; \n\tvar queryUrl = \"http://www.omdbapi.com/?apikey=f94f8000&t=\" + movieTitle\n\n\trequest(queryUrl, function(err, response, body) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t} else {\n\t\t console.log(\"\\n========== Movie Info ========\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Values);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\t\n console.log(\"=================================\\n\");\n\t\t}\n\n\t})\n}", "function movie() {\n\t// Then run a request to the OMDB API with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + command2 + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(queryURL, function (error, response, body) {\n\t\t// if the request is successful, run this\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\tconsole.log(\" \");\n\t\t\tconsole.log(queryURL);\n\t\t\tconsole.log(\"\\nMovie Title: \" +command2);\n\t\t\tconsole.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"Country where the movie is produced: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"\\nPlot of the movie: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"\\nThe IMDB rating is: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes rating is: \" + JSON.parse(body).Ratings[2].Value);\n\t\t\tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t}\n\t});\n}", "function movie() {\n //****************** OMDB movies API ********************\n var API2 = \"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\"\n\n axios.get(API2).then(\n function (response) {\n console.log(\"================================================\");\n console.log(\"Title of the Movie: \" + response.data.Title);\n console.log(\"Year Released: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country Produced in: \" + response.data.Country);\n console.log(\"Language of the Movie: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Cast: \" + response.data.Actors);\n }\n )\n}", "function movie() {\n\n\tvar movieName = '';\n\n\tif(process.argv.length >= 4){\n\t\tfor (var i = 3; i < dataArr.length; i++){\n\t\t\tif (i > 3 && i < dataArr.length) {\n\t\t\t\tmovieName = movieName + \"+\" + dataArr[i];\n\t\t\t} else {\n\t\t\t\tmovieName += dataArr[i];\n\t\t\t}\n\t\t} // closes for loop for dataArr\n\t} else {\n\t\tmovieName = 'Mr Nobody';\n\t}\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&tomatoes=true&r=json\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t \tconsole.log(\"\");\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Release Year: \" + JSON.parse(body).Released);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rating: \" + JSON.parse(body).imdbRating);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Produced In: \" + JSON.parse(body).Country);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t}\n\t});\t\t\t\n\n}", "function movieDisplay(movieTitle) {\n // console.log(\"Movie Display Function\");\n var queryURL = `http://www.omdbapi.com/?t=${movieTitle}&y=&plot=short&apikey=trilogy`\n // console.log(queryURL);\n\n request(queryURL, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n var movieData = JSON.parse(body);\n\n console.log(`Title:${movieData.Title}\\n` +\n `Release Year: ${movieData.Year}\\n` +\n `IMDB Rating: ${movieData.imdbRating}/10\\n` +\n `Rotten Tomatoes Rating: ${movieData.Ratings[1].Value}\\n` +\n `Production Location: ${movieData.Country}\\n` +\n `Movie Language(s): ${movieData.Language}\\n` +\n `Plot: ${movieData.Plot}\\n` +\n `Actors: ${movieData.Actors}\\n`\n )\n }\n\n })\n}", "function MovieInfo (title, plot, year, imdb, rottenTomoatoes, country, actors) { // constructor for movie info\n this.movieName = title;\n this.moviePlot = plot;\n this.movieYear = year;\n this.movieImdbRating = imdb;\n this.movieRtRating = rottenTomoatoes;\n this.movieCountry = country;\n this.movieActors = actors;\n }", "function movieThis(){\n var movie = process.argv[3];\n if(!movie){\n movie = \"Wonder Woman\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?&t=\" + params + \"&apikey=40e9cece\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject)\n var movieResults =\n (\"Title: \" + movieObject.Title);\n (\"Year: \" + movieObject.Year);\n (\"Imdb Rating: \" + movieObject.imdbRating);\n (\"Country: \" + movieObject.Country);\n (\"Language: \" + movieObject.Language);\n (\"Plot: \" + movieObject.Plot);\n (\"Actors: \" + movieObject.Actors);\n (\"Rotten Tomatoes Rating: \" + movieObject.tomatoRating);\n (\"Rotten Tomatoes URL: \" + movieObject.tomatoURL);\n\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\"+ error);\n return;\n }\n });\n }", "function moviethis(movie_name) {\n request(\"http://www.omdbapi.com/?t=\" + movie_name + \"&y=&plot=short&apikey=trilogy\", function (error, response, body, Title) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n\n console.log(\"*Title of the movie: \" + JSON.parse(body).Title);\n console.log(\"* Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"* Country produced:\" + JSON.parse(body).Country);\n console.log(\"* Language of the movie:\" + JSON.parse(body).Language);\n console.log(\"* Plot of the movie:\" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"* IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n }\n });\n} // end of movie function----------------------", "function movieThis (movieName) {\n\t//if user does not provide any movie, then default then we assign it a movie\n\tif(movieName === \"\"){\n\t\tmovieName = \"Mr. Nobody\"\n\t}\n\n\t//making custom url for OMDB query search. \n\tvar customURL = \"http://www.omdbapi.com/?t=\"+ movieName +\"&y=&plot=short&tomatoes=true&r=json\";\n\n\t//getting data and printing it on terminal\n\trequestFS(customURL, function (error, response, body) {\n\t\tvar movieData = JSON.parse(body);\n\t\tif (!error && response.statusCode == 200) {\n\t\t\tconsole.log(\"Title: \" + movieData.Title);\n\t\t\tconsole.log(\"Year: \" + movieData.Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + movieData.imdbRating);\n\t\t\tconsole.log(\"Country: \" + movieData.Country);\n\t\t\tconsole.log(\"Lanugage(s): \" + movieData.Language);\n\t\t\tconsole.log(\"Plot: \" + movieData.Plot);\n\t\t\tconsole.log(\"Actors: \" + movieData.Actors);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + movieData.tomatoMeter);\n\t\t\tconsole.log(\"Rotten Tomatoes Link: \" + movieData.tomatoURL);\n\t \t}\n\t});\n}", "function movieThis(option1) {\n if (typeof option1 === \"undefined\") {\n option1 = \"Mr. Nobody\"\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + option1 + \"&y=&plot=short&apikey=trilogy\"\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n console.log();\n console.log(\"Movie\");\n console.log(\"=====\");\n movie = JSON.parse(body);\n console.log(movie.Title);\n console.log(movie.Year);\n console.log(movie.Language);\n console.log(\"Made in: \" + movie.Country);\n console.log(\"Ratings\");\n movie.Ratings.forEach(element => {\n if (element.Source === 'Internet Movie Database') {\n console.log(\" IMDB: \" + element.Value);\n }\n if (element.Source === 'Rotten Tomatoes') {\n console.log(\" Rotten Tomatoes: \" + element.Value);\n }\n });\n console.log(\"Starring\");\n movie.Actors.split(\",\").forEach(element => {\n console.log(\" \" + element.trim());\n })\n console.log(movie.Plot);\n }\n });\n\n}", "function movieOutput(movie) {\n const queryUrl = `http://www.omdbapi.com/?t=${movie}&y=&plot=short&apikey=trilogy`;\n axios.get(queryUrl).then((response) => {\n const { data } = response;\n // console.log(response.data);\n console.log(`Movie title: ${data.Title}`);\n console.log(`Year the movie came out: ${data.Year}`);\n console.log(`IMDB Rating: ${data.imdbRating}`);\n console.log(`Rotten Tomatoes rating: ${data.Ratings[1].Value}`);\n console.log(`Country The Movie was produced: ${data.Country}`);\n console.log(`Language of the movie: ${data.Language}`);\n console.log(`Plot of the movie: ${data.Plot}`);\n console.log(`Actors: ${data.Actors}`);\n }).catch((error) => {\n if (error.response) {\n console.log('---------------Data---------------');\n console.log(error.response.data);\n }\n });\n}", "function movieData() {\n var request = require('request');\n request('http://www.omdbapi.com/?apikey=Trilogy&t='+ name , function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"\\nTitle of the movie: \" + JSON.parse(body).Title);\n console.log(\"Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n console.log(\"Country where the movie was produced: \" + JSON.parse(body).Country);\n console.log(\"Language of the movie: \" + JSON.parse(body).Language);\n console.log(\"Plot of the movie: \" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL + \"\\n\");\n \n }\n\n }); \n}", "function getMovie() {\n // import the request package\n var request = require(\"request\");\n // call to OMDB API\n if (process.argv[3] === undefined) {\n var queryUrl = \"http://www.omdbapi.com/?t=\" + \"Mr.\" + \"Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover necessary output\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(body).County);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n } else {\n var movieName = process.argv[3]\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover necessary output\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(body).County);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n }\n}", "function getMovie(movieName) {\n\n // If no movie name, do a search for Mr.Nobody\n if (!movieName) {\n var movieName = \"Mr. Nobody\";\n }\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=[key]\";\n axios.get(queryURL).then(\n function (response) {\n\n // Movie info\n console.log(`Title: ${response.data.Title}\nYear: ${response.data.Year}\nRated: ${response.data.Rated}\nRotten Tomatoes Rating: ${response.data.tomatoRating}\nCountry Produced in: ${response.data.Country}\nLanguage: ${response.data.Language}\nPlot: ${response.data.Plot}\nActors: ${response.data.Actors}`\n );\n }\n )\n}", "function movieThis() {\n var movie = \"Mr. Nobody\";\n if (searchTerm) {\n var movie = searchTerm;\n };\n let movieUrl = \"http://www.omdbapi.com/?apikey=715b0924&t=\" + movie\n axios.get(movieUrl).then(response => {\n let data = response.data;\n console.log(\"Title: \" + data[\"Title\"] + \"\\nYear: \" + data[\"Year\"] + \"\\nIMDB Rating: \" + data[\"imdbRating\"] + \"\\nRotten Tomatoes Rating: \" + data[\"Ratings\"][1][\"Value\"] + \"\\nCountry of Production: \" + data[\"Country\"] + \"\\nLanguage: \" + data[\"Language\"] + \"\\nPlot: \" + data[\"Plot\"]\n + \"\\nActors: \" + data[\"Actors\"]);\n }).catch(error => {\n console.log(error);\n });\n}", "function movieThis(movie){\n //This will pull from the omdb API and pull data about the movie\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n //console.log(response.data);\n console.log(\"-------------\");\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n //Add in the rotten tomatoes rating\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n console.log(\"-------------\");\n });\n}", "function getMovieInfo (title, year, rating) {\n return fetch(`${omdbMainURL}&t=${title}&y=${year}`)\n .then(res => res.json())\n .then(data => {\n return new Constructor({\n title: data.Title,\n year: data.Year,\n criticRatings: data.Ratings,\n userRating: rating,\n poster: data.Poster,\n genre: data.Genre,\n director: data.Director,\n plot: data.Plot,\n actors: data.Actors,\n id: Date.now()\n });\n })\n .catch(console.error);\n }", "function getMovie(){\n // this is exactly the same logic as the spotify function starts with\n // if there are search terms (aka userParameters), use them in the query\n // if there are not search terms, use a pre-defined default search\n let movieSearchTerm;\n\tif(userParameters === undefined){\n\t\tmovieSearchTerm = \"Mr. Nobody\";\n\t}else{\n\t\tmovieSearchTerm = userParameters;\n\t};\n // this is the queryURL that will be used to make the call - it holds the apikey, returns a \"short\" plot, type json, and \n // the tomatoes flag attempts to return rottenTomatoes data although most of that is now deprecated as of may 2017 \n let queryURL = 'http://www.omdbapi.com/?t=' + movieSearchTerm +'&apikey=trilogy&y=&plot=short&tomatoes=true&r=json';\n request(queryURL, function(error, response, body){\n\t if(!error && response.statusCode == 200){\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value);\n\t console.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW MOVIE SEARCH EVENT:\\nTitle: ${JSON.parse(body).Title}\\nYear: ${JSON.parse(body).Year}\\nIMDB Rating: ${JSON.parse(body).imdbRating}\\nRotten Tomatoes Score: ${JSON.parse(body).Ratings[1].Value}\\nCountry of Production: ${JSON.parse(body).Country}\\nLanguage: ${JSON.parse(body).Language}\\nPlot: ${JSON.parse(body).Plot}\\nActors: ${JSON.parse(body).Actors}\\n------\\n`, function(err) {\n });\n }\n });\n}", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }", "function getMovieDetails(movieName) {\n return new Promise((resolve, reject) => {\n\n var omdbQueryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n request(omdbQueryUrl, function(error, response, body) {\n if (error && response.statusCode != 200) {\n reject(error);\n }\n resolve(JSON.parse(body));\n });\n });\n}", "function movieThis(receivedMovie) {\n\n\n var movie = receivedMovie ? receivedMovie : \"Mr. Nobody\";\n\n // request to omdbapi using movie entered and trilogy api key\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=full&tomatoes=true&r=json&y=&plot=short&apikey=trilogy\", function (error, response, data) {\n\n // IF the request is successful. The status code is 200 if the status returned is OK\n if (!error && response.statusCode === 200) {\n\n // log the command issued to the log.txt file\n logCommand();\n\n // Display Data\n // TITLE, YEAR, IMDB RATING, COUNTRY, LANGUAGE(S), PLOT, ACTORS, ROTTEN TOMATO RATING, ROTTEN TOMATO URL\n console.log(\"Movie Title: \" + JSON.parse(data).Title);\n console.log(\"Release Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"TOMATOMETER: \" + JSON.parse(data).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors/Actresses: \" + JSON.parse(data).Actors);\n }\n\n });\n}", "function movieThis(show) {\n // when called, show will be replaced with var = title.\n axios.get('http://www.omdbapi.com/?t=' + show + '&plot=short&apikey=trilogy')\n .then(function (response) {\n // console.log('////////////////AXIOS NO ERROR////////////')\n // console.log(response)\n // * Title of the movie.\n console.log(`Movie: ${response.data.Title}`)\n // * IMDB Rating of the movie.\n console.log(`IMDB Rating is: ${response.data.imdbRating}`)\n // * Year the movie came out.\n console.log(`Year Released : ${response.data.Released}`)\n // * Rotten Tomatoes Rating of the movie.\n console.log(`Rotten Tomatoes Rating : ${response.data.Ratings[1].Value}`)\n // * Country where the movie was produced.\n console.log(`Country : ${response.data.Country}`)\n // * Language of the movie.\n console.log(`Language : ${response.data.Language}`)\n // * Plot of the movie.\n console.log(`Plot : ${response.data.Plot}`)\n // * Actors in the movie.\n console.log(`Actors in movie : ${response.data.Actors}`)\n })\n // log error\n .catch(function (error) {\n console.log('//////////ERROR!!!/////////////')\n console.log(error);\n });\n}", "function getMovie() {\n\n var omdbApi = require('omdb-client');\n\n var params = {\n apiKey: 'XXXXXXX',\n title: 'Terminator',\n year: 2012\n }\n omdbApi.get(params, function (err, data) {\n // process response...\n });\n}", "function getMovie() {\n\n var movie = \"Pacific Rim\"\n\n request(\"https://www.omdbapi.com/?apikey=\"+ process.env.OMDB_API_KEY +\"&t=\" + value, function (error, response, body) {\n if(error){\n console.log(error)\n }\n\n console.log(JSON.parse(body)['Title'])\n console.log(JSON.parse(body).Title)\n \n });\n}", "function movieThis(movieName) {\n console.log(\"movie is working\");\n if (movieName === undefined) {\n movieName = \"Mr Nobody\";\n }\n\n var movieUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=trilogy\";\n\n axios.get(movieUrl).then(\n function (response) {\n var movieData = response.data;\n\n console.log(\"Title: \" + movieData.Title);\n console.log(\"Year: \" + movieData.Year);\n console.log(\"Rated: \" + movieData.Rated);\n console.log(\"IMDB Rating: \" + movieData.imdbRating);\n console.log(\"Country: \" + movieData.Country);\n console.log(\"Language: \" + movieData.Language);\n console.log(\"Plot: \" + movieData.Plot);\n console.log(\"Actors: \" + movieData.Actors);\n console.log(\"Rotten Tomatoes Rating: \" + movieData.Ratings[1].Value);\n }\n );\n}", "function printMovieDetail() {\n if (movie.bkgimage != null) {\n bkgImageElt.css('background-image', `url(${movie.bkgimage})`);\n }\n else {\n bkgImageElt.css('background-image', `linear-gradient(rgb(81, 85, 115), rgb(21, 47, 123))`);\n }\n\n titleElt.text(movie.title);\n modalTitle.text(movie.title);\n originaltitleElt.text(movie.originaltitle);\n resumeElt.text(movie.resume);\n dateElt.text(printDateFr(movie.date));\n durationElt.text(printDuration(movie.duration));\n imgElt.attr('src', movie.image);\n iframe.attr('src', movie.traileryt + \"?version=3&enablejsapi=1\");\n // Afficher la liste des acteurs\n var actorsStr = '';\n for (var actor of movie.actors) {\n actorsStr += actor + ' | ';\n }\n actorsElt.text(actorsStr);\n // afficher le réalisteur\n directorElt.text(movie.director);\n}", "function movieThis(movieTitle) {\n request(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&plot=short&apikey=trilogy\", function (error, response, body) {\n if (JSON.parse(body).Response === 'False') {\n return console.log(JSON.parse(body).Error);\n }\n if (!movieTitle) {\n request(\"http://www.omdbapi.com/?t=Mr+Nobody&plot=short&apikey=trilogy\", function (error, response, body) {\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n })\n } else if (!error && response.statusCode === 200) {\n\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n }\n })\n}", "function writeMovieInfo(mvName){\n // console.log(\"The movie name is \" + mvName);\n\n // If the user doesn't type a movie in, the program will output data for the movie 'Mr. Nobody.'\n if ((mvName===\"\") || (mvName===undefined))\n {\n mvName = \"Mr.+Nobody\"; \n }\n\n // console.log(\"The movie name is \" + mvName);\n // * Title of the movie.\n // * Year the movie came out.\n // * IMDB Rating of the movie.\n // * Rotten Tomatoes Rating of the movie.\n // * Country where the movie was produced.\n // * Language of the movie.\n // * Plot of the movie.\n // * Actors in the movie.\n var axios = require(\"axios\");\n // Then run a request with axios to the OMDB API with the movie specified\n axios.get(\"http://www.omdbapi.com/?t=\" + mvName + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n // console.log(JSON.stringify(response.data, null, 2));\n // first some error handling\n if (response.data.Response === \"False\")\n {\n console.log(\"Sorry, the movie \" + movieResponse.movieName + \" was not found, try another one.\");\n return;\n }\n // console.log(JSON.stringify(response.data, null, 2));\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n // need to parse array of ratings to find the Rotten Tomatoes one\n ratings = response.data.Ratings;\n var rtRating = \"\";\n for (var i=0; i<ratings.length; i++){\n if (ratings[i].Source === \"Rotten Tomatoes\")\n rtRating = ratings[i].Value;\n }\n \n console.log(\"Rotten Tomatoes Rating: \" + rtRating);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n });// end of axios call then\n }", "function getMovieInfo() {\n if (searchTerm === \"\") {\n searchTerm = \"Star Wars\";\n }\n axios\n .get(\"http://omdbapi.com/?apikey=trilogy&s=\" + searchTerm)\n .then(function(response) {\n logString +=\n \"\\n\\n\\nYou Searched For: \" +\n searchTerm +\n \"\\nThis Search Resulted in \" +\n response.data.Search.length +\n \" results\" +\n \"\\n******** Results *********\\n\\n\";\n response.data.Search.forEach(movie => {\n logString +=\n \"Movie Title - \" +\n movie.Title +\n `\\nMovie Year - ${movie.Year}` +\n `\\nMovie IMDB ID - ${movie.imdbID}` +\n \"\\nMedia Type - \" +\n movie.Type +\n \"\\nPoster URL - \" +\n movie.Poster +\n \"\\n\\n\";\n });\n logString += \"\\n******** End *********\\n\";\n console.log(logString);\n logResults();\n });\n}", "function getMovie() {\n\n let movieId = sessionStorage.getItem('movieId');\n api_key = '98325a9d3ed3ec225e41ccc4d360c817';\n\n $.ajax({\n\n url: `https://api.themoviedb.org/3/movie/${movieId}`,\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n },\n\n //get acess to movie information;\n success: function(data) {\n\n\n\n var movie = data;\n let output = `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" class=\"thumbnail\">\n <div id=\"visitS\">\n <a id=\"visitSite\" target=\"_blank\" href=\"${movie.homepage}\"> Visit Movie Site</a>\n </div>\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title}</h2>\n <ul class=\"list-group\" id=\"list-group\">\n\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.release_date}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.vote_average}</li>\n <li class=\"list-group-item\"><strong>Runtime:</strong> ${movie.runtime} min.</li>\n <li class=\"list-group-item\"><strong>Production Companies:</strong> ${movie.production_companies[0].name} min.</li>\n </ul>\n <div>\n <div id=\"overview\">\n <h3>Overview</h3> ${movie.overview}\n </div>\n <div id=\"imdbb\">\n <a id=\"imdb\" href=\"http://imdb.com/title/${movie.imdb_id}\" target=\"_blank\" <i class=\"fab fa-imdb fa-3x\"></i></a>\n </div>\n <div>\n <a class=\"navbar-brand\" id=\"go2\" href=\"index.html\">Go Back</a>\n \n </div>\n \n </div> \n \n `;\n //print movie selected information\n $('#movie').html(output);\n\n\n }\n\n })\n\n}", "function findMovie(title){\n\tvar title = processInput(title);\n\n\tif(title != undefined){\n\t\tvar formattedTitle = title.replace(\" \", \"+\");\t\n\t\tvar query = \"http://www.omdbapi.com/?t=\" + formattedTitle;\n\n\t\trequest(query, function (error, response, body) {\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else{\n\t\t\t\tvar movieTitle = JSON.parse(body).Title;\n\t\t\t\tvar year = JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = JSON.parse(body).Ratings[0].Value;\n\t\t\t\tvar country = JSON.parse(body).Country;\n\t\t\t\tvar language = JSON.parse(body).Language;\n\t\t\t\tvar plot = JSON.parse(body).Plot;\n\t\t\t\tvar actors = JSON.parse(body).Actors;\n\t\t\t\tvar rottenRating = JSON.parse(body).Ratings[1].Value;\n\t\t\t\tvar rottenURL = \"blah\";\n\n\t\t\t\tvar output = \"\\nMovie Title: \" + movieTitle + \"\\nYear Released: \" \n\t\t\t\t\t+ year + \"\\nCountry Filmed: \" + country + \"\\nLanguages Released In: \"\n\t\t\t\t\t + language + \"\\nActors: \" + actors + \"\\n\\nPlot: \" + plot + \"\\n\\nIMDB Rating: \" \n\t\t\t\t\t + imdbRating + \"\\nRotten Tomatoes Rating: \" + rottenRating + \"\\nRotten Tomatoes URL: \" \n\t\t\t\t\t + rottenURL;\n\n\t\t\t\tconsole.log(output);\n\t\t\t\twriteFS(output);\n\n\t\t\t};\n\t\t});\n\t};\n}", "function movie(movieName){\n\tvar request = require('request');\n\n\tvar nodeArgs = process.argv;\n\n\tvar movieName = \"\";\n\n\tif (process.argv[3] == null){\n\n\t\tmovieName = \"Mr.Nobody\";\n\n\t}else{\n\n\t\tfor (var i=3; i<nodeArgs.length; i++){\n\n\t\t\tif (i>3 && i< nodeArgs.length){\n\n\t\t\tmovieName = movieName + \"+\" + nodeArgs[i];\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\tmovieName = movieName + nodeArgs[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\trequest('http://www.omdbapi.com/?t='+ movieName + '&y=&plot=short&r=json&tomatoes=true', function (error, response, body) {\n // If the request is successful (i.e. if the response status code is 200)\n\t\n\tif (!error && response.statusCode == 200) {\n\t\t\n\t\t// Parse the body of the site and recover just the imdbRating\n\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it). \n\t\tconsole.log( \"The movie title: \" + JSON.parse(body)[\"Title\"] +\n\t\t\t\"\\nThe movie release year: \" + JSON.parse(body)[\"Year\"] +\n\t\t\t\"\\nThe movie imdb rating: \" +JSON.parse(body)[\"imdbRating\"] +\n\t\t\t\"\\nThe movie Country of origin: \" +JSON.parse(body)[\"Country\"] +\n\t\t\t\"\\nThe movie language: \" +JSON.parse(body)[\"Language\"] +\n\t\t\t\"\\nThe movie plot: \" +JSON.parse(body)[\"Plot\"] +\n\t\t\t\"\\nThe movie actors: \" +JSON.parse(body)[\"Actors\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes score: \" +JSON.parse(body)[\"tomatoMeter\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes url: \" +JSON.parse(body)[\"tomatoURL\"]);\n\t\t}\n\t});\n}", "function movie() {\n\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + userInput + \"&y=&plot=short&apikey=40e9cece\";\n\n //console.log(queryUrl);\n\n request(queryUrl, function(error, response, body) {\n\n //console.log(response);\n if (error) throw error;\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n // console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).Year); --doesnt have it\n }\n });\n}", "function movieThis(movie) {\n // if no argument entered, default argument\n if (!argument) {\n movie = \"Mr. Nobody\";\n }\n // search ombd API movie with movie\n axios\n .get(`https://www.omdbapi.com/?t=${movie}&apikey=trilogy`)\n // function to console log response when data is received\n .then(function(response) {\n console.log(\"\\n------------------------------------------\");\n console.log(`Movie Title: ${response.data.Title}`);\n console.log(`Year Released: ${response.data.Year}`);\n console.log(`Actors: ${response.data.Actors}`);\n console.log(`IMBD Rating: ${response.data.imdbRating}`);\n console.log(`Rotten Tomatoes Rating: ${response.data.Ratings[1].Value}`);\n console.log(`Produced in: ${response.data.Country}`);\n console.log(`Language: ${response.data.Language}`);\n console.log(`Plot: ${response.data.Plot}`);\n console.log(\"\\n\");\n })\n // if error, console logs error message\n .catch(function(err) {\n console.error(err);\n })\n}", "function moviethis(){\n var movieName = '';\n var theArg = process.argv;\n \n if(input===undefined){\n // if no movie name is entered\n movieName = 'Mr.'+\"+\"+\"Nobody\"; \n } else {\n // otherwise this captures movie names with 1 or more words\n for(i=3; i<theArg.length; i++){\n movieName += theArg[i]+\"+\";\n }\n \n }\n \n //run axios using OMDB API\n var url = \"http://www.omdbapi.com/?t=\"+movieName+\"&y=&plot=short&apikey=trilogy\";\n axios.get(url)\n .then(\n function(response) { \n console.log(\"Title: \"+response.data.Title);\n console.log(\"Release Year: \"+response.data.Year);\n console.log(\"IMDB Rating: \"+response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \"+response.data.Ratings[0].Value);\n console.log(\"Country Produced: \"+response.data.Country);\n console.log(\"Language: \"+response.data.Language);\n console.log(\"Plot: \"+response.data.Plot);\n console.log(\"Actors :\"+response.data.Actors);\n }\n );\n }", "async function getMovieInfo(id) {\n let response = await fetch('https://swapi.dev/api/films/');\n let json = await response.json();\n let selectedFilm;\n json.results.forEach((film) => {\n if (film.episode_id == id) {\n selectedFilm = {\n name: film.title,\n episodeID: film.episode_id,\n characters: film.characters,\n };\n }\n });\n return selectedFilm;\n}", "function movieThis() {\n console.log('===========================================');\n console.log(\"Netflix and Chill....?\");\n // console.log(\"Pizza and a fuck?.....WHAT???.....you dont like pizza?\")\n var searchMovie;\n // use undefined for default search!\n if (arguTwo === undefined) {\n searchMovie = \"Mr. Nobody\";\n } else {\n searchMovie = arguTwo;\n };\n // add tomatoes url and json format // request required here\n var movieUrl = 'http://www.omdbapi.com/?t=' + searchMovie + '&y=&plot=long&tomatoes=true&r=json';\n request(movieUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n \n\n var movieData = JSON.parse(body)\n\n console.log('================ Movie Info ================');\n console.log('Title: ' + movieData.Title);\n console.log('Year: ' + movieData.Year);\n console.log('IMDB Rating: ' + movieData.imdbRating);\n console.log('Country: ' + movieData.Country);\n console.log('Language: ' + movieData.Language);\n console.log('Plot: ' + movieData.Plot);\n console.log('Actors: ' + movieData.Actors);\n console.log('Rotten Tomatoes Rating: ' + movieData.tomatoRating); //notworkings\n console.log('Rotten Tomatoes URL: ' + movieData.tomatoURL);\n console.log('===========================================');\n }\n });\n}", "function getMovieInfo() {\n // if no movie entered, default to \"Mr. Nobody\"\n if (userQuery === undefined) {\n userQuery = \"Mr. Nobody\";\n }\n\n axios.get(`http://www.omdbapi.com/?t=${userQuery}&y=&plot=short&apikey=trilogy`)\n .then(function (response) {\n displayMovieInfo(response)\n })\n}", "function movieCommand() {\n\tvar inputMovie = process.argv[3];\n\tif(!inputMovie){\n\t\tinputMovie = \"Mr. Nobody\"; //default movie INPUT\n\t}\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + inputMovie + \"&y=&plot=short&&apikey=40e9cece&r=json&tomatoes=true\";\n\n\trequest(queryUrl, function(error, response, body) {\n \n \tif (!error && response.statusCode) {\n \tvar movieData = JSON.parse(body);\n \tvar movieInfo = \n\t\t\t\"\\r\\n\" +\n \"Title: \" + movieData.Title + \"\\r\\n\" +\n \"Year: \" + movieData.Year + \"\\r\\n\" +\n \"IMDB Rating: \" + movieData.imdbRating + \"\\r\\n\" +\n \"Country: \" + movieData.Country + \"\\r\\n\" +\n \"Language: \" + movieData.Language + \"\\r\\n\" +\n \"Plot: \" + movieData.Plot + \"\\r\\n\" +\n \"Actors: \" + movieData.Actors + \"\\r\\n\" +\n \"Rotten Tomatoes URL: \" + movieData.tomatoURL + \"\\r\\n\";\n console.log(movieInfo);\n log(movieInfo);\n \t}\t\n});\n}", "function MovieSearch(movie) {\n request(omdb.url + movie, function (error, response, body) {\n if (error) {\n console.log('error:', error);\n console.log('statusCode:', response && response.statusCode);\n }\n //Convert string to JSON object\n var data = JSON.parse(body)\n //Desired properties to log\n var properties = [data.Title, data.Year, data.Rated, data.Ratings[1].Value,\n data.Country, data.Language, data.Plot, data.Actors\n ];\n //Property text (aesthetics)\n var text = ['Title: ', 'Year: ', 'Rated: ', 'Rotten Tomatoes: ',\n 'Country: ', 'Language: ', 'Plot: ', 'Actors: '\n ];\n //Log results\n for (var i = 0; i < properties.length; i++) {\n console.log(text[i], properties[i]);\n }\n });\n}", "function movieThis(movie){\n //console.log(\"Movie This\");\n\n if (movie === undefined){\n movie = \"Mr. Nobody\";\n }\n //else movie = inputs[3];\n\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&apikey=\" + omdb).then(\n results => {\n //console.log(results.data);\n console.log(\"Title: \" + results.data[\"Title\"]);\n console.log(\"Year: \" + results.data[\"Year\"]);\n //console.log(\"IMDB Rating: \" + results.data[\"Ratings\"][0][\"Value\"]);\n console.log(\"IMDB Rating: \" + results.data[\"imdbRating\"]);\n console.log(\"Rotten Tomatoes Rating: \" + results.data[\"Ratings\"][1][\"Value\"]);\n console.log(\"Country: \" + results.data[\"Country\"]);\n console.log(\"Language: \" + results.data[\"Language\"]);\n console.log(\"Plot: \" + results.data[\"Plot\"]);\n console.log(\"Actors: \" + results.data[\"Actors\"]);\n },\n err => {\n console.log(err);\n }\n );\n}", "function getMovie(title) {\n var year;\n var rating;\n var country;\n var language;\n var plot;\n var actors;\n var rottenTomatoesRating;\n var rottentomatoesURL;\n if (title) {\n var titleParam = title;\n } else {\n var titleParam = \"Mr. Nobody\";\n }\n // /assugning request url using that title\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + titleParam + '&tomatoes=true&r=json';\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(response);\n rBody = JSON.parse(body);\n // rJson = JSON.parse(response);\n titleParam = rBody['Title'];\n year = rBody['Year'];\n rating = rBody['Rated'];\n country = rBody['Country'];\n language = rBody['Language'];\n plot = rBody['Plot'];\n actors = rBody['Actors'];\n rottenTomatoesRating = rBody['tomatoRating'];\n rottentomatoesURL = rBody['tomatoURL'];\n\n console.log('the title is ', titleParam);\n console.log('the year is ', year);\n console.log('the rating is ', rating);\n console.log('the country is ', country);\n console.log('the language is', language);\n console.log('the plot is', plot);\n console.log('the actors are', actors);\n console.log('the Rotten Tomatoes Ratings are', rottenTomatoesRating);\n console.log('the Rotten Tomatoes URL is', rottentomatoesURL);\n // console.log(rBody);\n // console.log(response);\n // console.log(rJson);\n }\n // else {\n // request('http://www.omdbapi.com/?t=remember+the+titans&y=&plot=short&r=json', function (error, response, body) { \n // console.log(response);\n // })\n // }\n })// body...\n\n}", "function fetchMovie() {\n axi.get(\"/api/v1\").then(r => setMovie(r.data.movie));\n }", "function movie(){\n\n /**You can follow the in-class request exercise for this**/\n console.log(\"Movie Time!\");\n\n var movieSearch;\n if(search === undefined){\n movieSearch = \"Sharknado\";\n }\n else{\n movieSearch = search;\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieSearch + \"&y=&plot=short&apikey=40e9cece\";\n console.log(\"movie time?\");\n request((queryUrl), function(error,response,body){\n console.log(\"got hear\");\n if(!error && response.statusCode === 200){\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors & Actresses: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n }\n });\n}", "function loadMovieDescription(pos) {\n $('.movie-plot').text(movies[pos].summary);\n // $('#moviegenres').text(movies[pos].Genres);\n //$('#moviedirector').text(movies[pos].director);\n $('.movie-cast').text(movies[pos].cast);\n $(\".movie_img\").show();\n}", "function movieInfo(input) {\n \n if(!input){\n // If no input data has been entered... default to Mr. Nobody\n axios.get(\"http://www.omdbapi.com/?t=Mr.+Nobody&apikey=trilogy\").then(function(response){\n // log(response.data); \n\n // Stores data from the omdb API \n var movieSearch = \n title_3(\"\\n -\") + titleCommand(\"| MOVIE-THIS |\") + title_3(\"-----------------------------------------------------------------------------------------------------------\\n\") +\n title_3(\"\\n If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\" + titleCommand.underline(\"\\n\" + \"\\n _____It's on Netflix!_____\\n\")) +\n title_3(\"\\n * Movie Title: \") + bodyText(response.data.Title) +\n title_3(\"\\n * Plot: \") + bodyText(response.data.Plot) + \n title_3(\"\\n\" + \"\\n * Actors: \") + bodyText(response.data.Actors) + \n title_3(\"\\n * IMDB Rating: \") + bodyText(response.data.imdbRating) +\n title_3(\"\\n * Rotten Tomatoes Rating: \") + bodyText(response.data.Ratings[1].Value) +\n title_3(\"\\n * Release Date: \") + bodyText(response.data.Released) + \n title_3(\"\\n * Language(s): \") + bodyText(response.data.Language) + \n title_3(\"\\n * Production Location(s): \") + bodyText(response.data.Country) + \"\\n\" +\n title_3(\"\\n--------------------------------------------------------------------------------------------------------------------------\\n\");\n\n // Logs and separates the movie data colorfully with Chalk\n log(wrapAnsi(movieSearch, 124));\n\n // Stores data from the omdb API \n var movieSearch_log = \n \"\\n -| MOVIE-THIS |-------------------------------------------------------------------------------------------------------------\\n\" +\n \"\\n If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\" + \"\\n\" + \"\\n It's on Netflix!\\n\" +\n \"\\n * Movie Title: \" + response.data.Title +\n \"\\n * Plot: \" + response.data.Plot + \n \"\\n\" + \"\\n * Actors: \" + response.data.Actors + \n \"\\n * IMDB Rating: \" + response.data.imdbRating +\n \"\\n * Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\n * Release Date: \" + response.data.Released + \n \"\\n * Language(s): \" + response.data.Language + \n \"\\n * Production Location(s): \" + response.data.Country + \"\\n\" +\n \"\\n-----------------------------------------------------------------------------------------------------------------------------\\n\";\n \n // Appends the movie's information to the log.txt file \n fs.appendFileSync(\"log.txt\", movieSearch_log, (err) => {\n if (err) throw err;\n });\n })\n \n } else {\n // If input data is entered... run the following code \n axios.get(\"http://www.omdbapi.com/?t=\" + input + \"&apikey=trilogy\").then(function(response){\n // log(response.data); \n\n // Stores data from the omdb API - this variable will appear in the terminal\n var movieSearch = \n title_3(\"\\n -\") + titleCommand(\"| MOVIE-THIS |\") + title_3(\"-----------------------------------------------------------------------------------------------------------\\n\") +\n title_3(\"\\n * Movie Title: \") + bodyText(response.data.Title) +\n title_3(\"\\n * Plot: \") + bodyText(response.data.Plot) + \n title_3(\"\\n\" + \"\\n * Actors: \") + bodyText(response.data.Actors) + \n title_3(\"\\n * IMDB Rating: \") + bodyText(response.data.imdbRating) +\n title_3(\"\\n * Rotten Tomatoes Rating: \") + bodyText(response.data.Ratings[1].Value) +\n title_3(\"\\n * Release Date: \") + bodyText(response.data.Released) + \n title_3(\"\\n * Language(s): \") + bodyText(response.data.Language) + \n title_3(\"\\n * Production Location(s): \") + bodyText(response.data.Country) + \"\\n\" + \n title_3(\"\\n---------------------------------------------------------------------------------------------------------------------------\\n\");\n \n // Stores data from the omdb API - this variable will appear in the lox.txt file\n var movieSearch_log = \n \"\\n -| MOVIE-THIS |-------------------------------------------------------------------------------------------------------------\\n\" +\n \"\\n * Movie Title: \" + response.data.Title +\n \"\\n * Plot: \" + response.data.Plot + \n \"\\n\" + \"\\n * Actors: \" + response.data.Actors + \n \"\\n * IMDB Rating: \" + response.data.imdbRating +\n \"\\n * Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\n * Release Date: \" + response.data.Released + \n \"\\n * Language(s): \" + response.data.Language + \n \"\\n * Production Location(s): \" + response.data.Country + \"\\n\" + \n \"\\n-----------------------------------------------------------------------------------------------------------------------------\\n\";\n \n // Logs and separates the movie data colorfully with Chalk\n log(wrapAnsi(movieSearch, 124));\n\n // Appends the movie's information to the log.txt file \n fs.appendFileSync(\"log.txt\", movieSearch_log, (err) => {\n // throws an error, you could also catch it here\n if (err) throw err;\n \n });\n\n })\n\n .catch(function(err) {\n log(err);\n });\n \n } \n }", "function displayMovieInfo() {\n\n // YOUR CODE GOES HERE!!! HINT: You will need to create a new div to hold the JSON.\n\n }", "function movieDetails(imdbId, cb) {\n request(`http://www.omdbapi.com/?apikey=${omdbKey}&i=${imdbId}&plot=full&r=json`, function (error, response, body) {\n\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n return cb(JSON.parse(body));\n }\n\n });\n }", "function showMovie(response) {\n let movie = response;\n\n //neki filmovi/serije imaju vise rezisera, glumaca i zanrova i da bi ljepse mogli da ih prikazemo na stranici od stringa koji dobijemo napravimo niz elemenata\n var str = movie.Actors;\n var str2 = movie.Director;\n var str3 = movie.Genre;\n\n var stars = str.split(\", \");\n var directors = str2.split(\", \");\n var genres = str3.split(\", \");\n\n //ukoliko nemamo podatke o slici prikazemo default sliku iz foldera\n if (movie.Poster == \"N/A\") {\n movie.Poster = \"./Images/default.jpg\";\n }\n\n //prikazujemo redom podatke\n $(\"#movie-title-name\").append(movie.Title + ' <span id=\"movie-year\"></span>');\n $(\"#movie-year\").append(movie.Year);\n\n //ukoliko IMDb ocjene nisu dostupne, prikazemo odgovarajucu poruku\n if (movie.imdbRating === 'N/A') {\n $(\"#movie-rating\").append('<span>Ratings are not available<span>');\n } else {\n $(\"#movie-rating\").append(movie.imdbRating + '/10 <span>' + movie.imdbVotes + ' votes </span>');\n }\n\n $(\"#img\").append('<img src=' + movie.Poster + ' alt=\"\">');\n\n if (movie.Plot === 'N/A') {\n $('#movie-description').append('Plot is not available at this moment. :)');\n } else {\n $('#movie-description').append(movie.Plot);\n }\n\n directors.forEach(director => {\n $('#movie-director').append('<p>' + director + '</p>');\n });\n\n stars.forEach(star => {\n $('#movie-stars').append('<p>' + star + '</p>');\n });\n\n genres.forEach(genre => {\n $('#movie-genre').append('<p>' + genre + '</p>');\n });\n\n $('#movie-released').append(movie.Released);\n $('#movie-runtime').append(movie.Runtime);\n\n //ukoliko je Type -> serija onda prikazemo ukupan broj sezona \n //prikazemo i select sa svim sezonama te serije gdje na klik mozemo prikazati sve epizode odredjene sezone\n //po defaultu je selectovana poslednja sezona serije, kako bi odmah pri ulasku u seriju imali izlistane epizode \n if (movie.Type == 'series') {\n $('#movie-seasons').append('<h3>Seasons:</h3><p>' + movie.totalSeasons + '</p>');\n\n $('#series-season').append(\n '<p class=\"heading-des\">Episodes> ' +\n '<select onchange=\"getSeason(\\'' + movie.Title + '\\')\" id=\"select-episodes\">' +\n '</select>' +\n '</p>' +\n '<hr class=\"about\">' +\n '<div class=\"description\">' +\n '<div id=\"episodes\">' +\n '</div>' +\n '</div>'\n )\n }\n\n $('#movie-cast').append(\n '<p>Director: ' + movie.Director + '</p>' +\n '<p>Writer: ' + movie.Writer + '</p>' +\n '<p>Stars: ' + movie.Actors + '</p>'\n )\n\n if (movie.Ratings.length == 0) {\n $('#movie-reviews').append('<p>Ratings are not available at this moment. :)</p>')\n } else {\n movie.Ratings.forEach(rating => {\n $('#movie-reviews').append('<p>' + rating.Source + ' --> ' + rating.Value + '</p>')\n });\n }\n\n if (movie.Awards === 'N/A') {\n $('#movie-awards').append('Awards are not available at this moment. :)');\n } else {\n $('#movie-awards').append(movie.Awards);\n }\n\n $('#movie-imdb-btn').append(\n '<button onClick=\"openImdbPage(\\'' + movie.imdbID + '\\')\" class=\"btn-imdb\">' +\n '<i class=\"fab fa-imdb\"></i> IMDb' +\n '</button>'\n )\n\n //za ukupan broj sezona serije ispunimo select sa tolikim brojem opcija\n for (i = 1; i <= movie.totalSeasons; i++) {\n $('#select-episodes').append(\n '<option selected=\"selected\" value=\"\\'' + i + '\\'\">Season ' + i + '</option>'\n )\n }\n\n if (movie.Type === \"series\") {\n\n //prikazemo sve epizode selektovane sezone\n getSeason(movie.Title);\n\n }\n\n //ukoliko smo otvorili epizodu prikazemo na stranici na kojoj smo epizodi i sezoni \n //i prikazemo dugme za povratak na seriju\n if (movie.Type === \"episode\") {\n $(\"#episode-details\").append(\n '<span class=\"episode-span\">Season ' + movie.Season + ' </span>' +\n '<span class=\"season-span\">Episode ' + movie.Episode + '</span>'\n )\n $(\"#button-tvshow\").append(\n '<button onClick=\"openMovie(\\'' + movie.seriesID + '\\')\" class=\"btn-search\">' +\n '<i class=\"fas fa-chevron-left\"></i>' +\n ' Back to TV Show' +\n '</button>'\n )\n }\n}", "function movies(input) {\n\n var movieTitle;\n if (input === undefined) {\n movieTitle = \"Cool Runnings\";\n } else {\n movieTitle = input;\n };\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=b41b7cf6\";\n\n request(queryURL, function (err, res, body) {\n var bodyOf = JSON.parse(body);\n if (!err && res.statusCode === 200) {\n logged(\"\\n---------\\n\");\n logged(\"Title: \" + bodyOf.Title);\n logged(\"Release Year: \" + bodyOf.Year);\n logged(\"Actors: \" + bodyOf.Actors);\n logged(\"IMDB Rating: \" + bodyOf.imdbRating);\n logged(\"Rotten Tomatoes Rating: \" + bodyOf.Ratings[1].Value);\n logged(\"Plot: \" + bodyOf.Plot);\n logged(\"\\n---------\\n\");\n }\n });\n}", "function getOMDB(movieName) {\n request('http://www.omdbapi.com/?t=' + movieName + '&r=json&apikey=trilogy&', function (error, response, body) {\n if (error) {\n return console.log('Error occurred: ' + error);\n }\n var data = JSON.parse(body);\n console.log('Movie Title:', data.Title);\n console.log('Year Released:', data.Year);\n console.log('IMDB Rating:', data.Ratings[0].Value);\n console.log('Rotten Tomatoes Rating:', data.Ratings[1].Value);\n console.log('Country:', data.Country);\n console.log('Language:', data.Language);\n console.log('Plot:', data.Plot);\n console.log('Actors:', data.Actors);\n });\n}", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "function getMovie(title) {\n return $.getJSON('https://omdbapi.com?t={title}&apikey=thewdb');\n}", "function movieThis() {\n\n\t// if user enters a value - process.argv[3]\n\n\tif (value) {\n\n\t \t// Create an empty variable for holding the movie name\n\n\t\tvar movieName = \"\";\n\n\t} // end of if no movie title was entered\n\n\t// else no movie title was entered search Mr. Nobody\n\n\telse {\n\n\t\tmovieName = \"Mr. Nobody\";\n\n\t} // end of else\n\n\t// Change any \" \" to + in the movie title\n\n\tfor (var i = 3; i < nodeArgs.length; i++){\n\n\t\t// if the movie has more than one word\n\n\t if (i > 3 && i < nodeArgs.length){\n\n\t movieName = movieName + \"+\" + nodeArgs[i];\n\n\t } // end of if there are spaces\n\n\t // the first word of the movie title\n\n\t else {\n\n\t movieName = movieName + nodeArgs[i];\n\n\t } // end of else\n\n\t} // end of for loop\n\n\t// OMDB API request \n\n\tvar queryUrl = 'http://www.omdbapi.com/?t=' + movieName +'&tomatoes=true';\n\n\trequest(queryUrl, function (error, response, body) {\n\n\t // If the request is successful \n\n\t if (!error && response.statusCode == 200) {\n\n\t // Parse the body of the site so that we can pull different keys more easily\n\t \n\t body = JSON.parse(body);\n\t console.log(\"Title: \" + body.Title);\n\t console.log(\"Year: \" + body.Year);\n\t console.log(\"IMDB Rating: \" + body.imdbRating);\n\t console.log(\"Country: \" + body.Country);\n\t console.log(\"Language: \" + body.Language);\n\t console.log(\"Plot: \" + body.Plot);\n\t console.log(\"Actors: \" + body.Actors);\n\t console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n\t console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n\n\t // store information as a string\n\n\t\t\tlogText = JSON.stringify({\n\t\t\t\ttitle: body.Title,\n\t\t\t\tyear: body.Year,\n\t\t\t\timdbRating: body.imdbRating,\n\t\t\t\tcountry: body.Country,\n\t\t\t\tlanguage: body.Language,\n\t\t\t\tplot: body.Plot,\n\t\t\t\tactors: body.Actors,\n\t\t\t\trottenRating: body.tomatoRating,\n\t\t\t\trottenURL: body.tomatoURL\n\t\t\t}); // end of logText stringify\n\n\t\t\t// log information in logText in log.txt\n\n\t\t\tlogInfo();\n\n\t \n\t } // end of if the request is successful\n\t}); // end of request\n\n} // end of movie-this function", "function movieThis() {\n\t//takes in user input for movie title\n\tvar movieTitle = input;\n\n\t// if no movie is provided, the program will default to \"mr. nobody\"\n\tif (input === \"\") {\n\t\tmovieTitle = \"Mr. Nobody\";\n\t}\n\n\t// variable for the OMDb API call\n\tvar OMDb = \"http://omdbapi.com?t=\" + movieTitle + \"&r=json&tomatoes=true\";\n\n\t// this takes in the movie request and searches for it in OMDb via request\n\trequest(OMDb, function (err, response, body) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Error: \" + err);\n\t\t\treturn;\n\t\t}\n\t\telse if (response.statusCode === 200) {\n\t\t\tvar movie = JSON.parse(body);\n\t\t\tvar movieData = \"\";\n\n\t\t\tvar title = \"\\n\" + \"Movie Title: \" + movie.Title + \"\\n\";\n\t\t\tmovieData += title;\t\n\n\t\t\tvar year = \"\\n\" + \"Year Released: \" + movie.Year + \"\\n\";\n\t\t\tmovieData += year;\n\n\t\t\tvar rating = \"\\n\" + \"IMDB Rating: \" + movie.imdbRating + \"\\n\";\n\t\t\tmovieData += rating;\t\n\n\t\t\tvar country = \"\\n\" + \"Country: \" + movie.Country + \"\\n\";\n\t\t\tmovieData += country;\n\n\t\t\tvar language = \"\\n\" + \"Language: \" + movie.Language + \"\\n\";\n\t\t\tmovieData += language;\n\n\t\t\tvar plot = \"\\n\" + \"Movie Plot: \" + movie.Plot + \"\\n\";\n\t\t\tmovieData += plot;\t\n\n\t\t\tvar actors = \"\\n\" + \"Actors: \" + movie.Actors + \"\\n\";\n\t\t\tmovieData += actors;\n\n\t\t\tvar tomatoMeter = \"\\n\" + \"Rotten Tomato Rating: \" + movie.tomatoUserMeter + \"\\n\";\n\t\t\tmovieData += tomatoMeter;\n\n\t\t\tvar tomatoURL = \"\\n\" + \"Rotten Tomato Rating Link: \" + movie.tomatoURL + \"\\n\";\n\t\t\tmovieData += tomatoURL;\n\n\t\t\tconsole.log(\"\\n\" + \"OMDb:\");\n\t\t\tconsole.log(movieData);\n\t\t\tdataLog(movieData);\t\t\t\t\t\t\t\n\t\t}\n\t});\n}", "async function getMovie(){\n const movie = movieInput.value\n const movieUrl = `https://api.themoviedb.org/3/search/movie?api_key=${apiKey}&query=${movie}`;\n try{\n const response = await fetch(movieUrl);\n if(response.ok){\n const jsonResponse = await response.json();\n const topResult = jsonResponse.results[0];\n console.log(topResult);\n // render the description of the top result\n renderDescription(topResult);\n // get hero section movie title\n renderHeroMovieTitle(topResult);\n // ger the average vote for movie\n renderHeroMovieStars(topResult);\n // get the image of the top result\n getMovieImages(topResult);\n // get the trailer for the movie\n getMovieTrailer(topResult);\n // get the general info about a movie - for genres\n getMovieInfo(topResult);\n }\n }catch(error){\n console.log(error);\n }\n}", "async function getMoviesInfos(movieID) {\n const extraInfos = [];\n // const urlBase = \"http://localhost:8000/api/v1/titles/\";\n // alert(movieID);\n const url = `http://localhost:8000/api/v1/titles/${movieID}`;\n const response = await fetch(url);\n // alert(apiURL);\n const data = await response.json();\n console.log(data);\n return data;\n}", "function getMovieContent() {\n\tvar queryURL = 'https://www.omdbapi.com/?t=' + searchTerm + '&y=&plot=short&apikey=trilogy';\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tvar movieRatingLong = response.Ratings[0].Value;\n\t\tvar movieRatingDouble = movieRatingLong.substr(0, 3);\n\t\tvar movieRatingUnround = movieRatingDouble / 2;\n\t\tmovieRating = Math.round(movieRatingUnround * 10) / 10;\n\t\tvar moviePosterUrl = response.Poster;\n\t\tmoviePoster = $('<img>');\n\t\tmoviePoster.attr('id', 'movieposterThumbnail');\n\t\tmoviePoster.attr('src', moviePosterUrl);\n\t\tmoviePlot = response.Plot;\n\t\tmovieTitle = response.Title;\n\t\tsetContent();\n\t});\n}", "function movieThis (movie) {\n\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=\" + omdb.key;\n\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var info = JSON.parse(body);\n console.log(\"\");\n console.log(('***** \"' + info.Title + '\" *****').inverse);\n console.log(\"Released in \" + info.Year);\n console.log(\"IMDB \" + info.Ratings[0].Value);\n console.log(\"Rotten Tomatoes \" + info.Ratings[1].Value);\n console.log(\"Produced in \" + info.Country);\n console.log(\"Language: \" + info.Language);\n console.log(\"Plot: \" + info.Plot);\n console.log(\"Actors: \" + info.Actors);\n console.log(\"\");\n console.log(\"**************************************\");\n console.log(\"\");\n // Append every full return to the log.txt file.\n fs.appendFile(\"log.txt\", \"\\n\" + '***** \"' + info.Title + '\" *****' + \"\\nReleased in \" + info.Year + \"\\nIMDB \" + info.Ratings[0].value + \"\\nRotten Tomatoes \" + info.Ratings[1].Value + \"\\nProduced in \" + info.Country + \"\\nLanguage: \" + info.Language + \"\\nPlot: \" + info.Plot + \"\\nActors: \" + info.Actors + \"\\n\", function(error) {\n if (error) {\n console.log(error);\n };\n });\n } else {\n console.log('An error occurred: ' + error);\n }\n })\n}", "function movie() {\n\n var args = process.argv;\n var movieName = \"\";\n\n for (i = 3; i < args.length; i++) {\n if (i > 3 && i < args.length) {\n movieName = movieName + \"+\" + args[i];\n } else {\n movieName = args[i];\n }\n };\n\n if (movieName === \"\") {\n movieName = \"Mr.\" + \"+\" + \"Nobody\"\n };\n\n //run a request to the OMDB API with the specified movie\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"-------------------------------------------------------------------------------------------\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n console.log(\"-------------------------------------------------------------------------------------------\");\n } else {\n console.log(\"ya' messed up\");\n }\n });\n}", "function movieThis() {\n var movieName = \"\";\n\n //move over all of the entered words to \n for (var i = 3; i < input.length; i++) {\n if (i > 3 && i < input.length) {\n movieName = movieName + \"+\" + input[i];\n } else {\n movieName += input[i];\n }\n }\n if (movieName === \"\") {\n movieName = \"Mr. Nobody\";\n }\n\n var movieQueryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=plot=short&apikey=trilogy\" + omdb;\n\n //npm call and arrangement of data into information.\n request(movieQueryURL, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var movieData = JSON.parse(body);\n console.log(\"Title: \" + movieData.Title + \"\\nRelease Year: \" + movieData.Year);\n\n for (var i = 0; i < movieData.Ratings.length; i++) {\n console.log(\"Rating: \" + movieData.Ratings[i].Source + \" \" + movieData.Ratings[i].Value)\n }\n console.log(\"Country Produced: \" + movieData.Country + \"\\nLanguage: \" + movieData.Language +\n \"\\nActors: \" + movieData.Actors + \"\\nPlot: \" + movieData.Plot);\n } else {\n return console.log(error);\n }\n });\n}", "function getMovie(){\n\tspinner.style.display = \"block\";\n\tsetTimeout(() => {\n\t\tspinner.style.display = \"none\";\n\t\tcontainer.style.display = \"block\";\n\t}, 1000);\n\n\tlet movieId = sessionStorage.getItem(\"movieId\");\n\n\tfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'?api_key='+API_KEY+'&language=es-ES')\n\t\t.then(function(response) {\n\t\t\treturn response.json()\n\t\t})\n\t\t.then(function(movieInfoResponse) {\n\t\t\tfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/credits?api_key='+API_KEY)\n\t\t\t\t.then(function(response2) {\n\t\t\t\t\treturn response2.json()\n\t\t\t\t})\n\t\t\t\t.then(function(movieCastResponse) {\n\n\t\t\t\t\tconst movie = movieInfoResponse;\n\t\t\t\t\tconst cast = movieCastResponse.cast;\n\t\t\t\t\tconst genres = movieInfoResponse.genres;\n\t\t\t\t\tcast.length = 5;\n\n\t\t\t\t\t//Redondea el numero de popularidad de la pelicula\n\t\t\t\t\tpopularity = movieInfoResponse.popularity;\n\t\t\t\t\tpopularity = Math.floor(popularity)\n\n\n\t\t\t\t\tlet revenue = movieInfoResponse.revenue;\n\t\t\t\t\trevenue = new Intl.NumberFormat('de-DE', {style: 'currency', currency: 'EUR'}).format(revenue);\n\n\t\t\t\t\tlet output = `\n\t\t\t\t\t<div class=\"moviePage\">\n\t\t\t\t\t<div class=\"poster\"><img src=\"http://image.tmdb.org/t/p/w300/${movie.poster_path}\"></div>\n\t\t\t\t\t<div class=\"info\">\n\t\t\t\t\t\t<h2>${movie.title}</h2>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li><strong>Elenco:</strong> `;\n\t\t\t\t\t\t\tfor (let i = 0; i < cast.length; i++) {\n\t\t\t\t\t\t\t\tif (i != cast.length - 1) {\n\t\t\t\t\t\t\t\t\toutput += `${cast[i].name}, `;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toutput += `${cast[i].name}.`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toutput += `</li>\n\t\t\t\t\t\t\t<li><strong>Genros:</strong> `;\n\t\t\t\t\t\t\tfor(let i = 0; i < genres.length; i++){\n\t\t\t\t\t\t\t\tif ( i != genres.length -1){\n\t\t\t\t\t\t\t\t\toutput += `${genres[i].name}, `;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toutput += `${genres[i].name}.`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toutput += `<ul>\n\t\t\t\t\t\t\t\t<li><strong>estreno:</strong> ${movie.release_date}</li>\n\t\t\t\t\t\t\t\t<li><strong>duracion:</strong> ${movie.runtime} (min)</li>\n\t\t\t\t\t\t\t\t<li><strong>Rating:</strong> ${movie.vote_average} / 10 <span id=\"smallText\">(${movie.vote_count} votes)</span></li>\n\t\t\t\t\t\t\t\t<li><strong>recaudacion:</strong> ${revenue}</li>\n\t\t\t\t\t\t\t\t<li><strong>estado:</strong> ${movie.status}</li>\n\t\t\t\t\t\t\t\t<li><strong>Productora:</strong> ${movie.production_companies[0].name}</li>\n\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"plot\">\n\t\t\t\t\t\t<h3>resumen</h3>\n\t\t\t\t\t\t<p>${movie.overview}</p>\n\t\t\t\t\t</div>`;\n\n\n\t\t\t\t\tconst info = document.getElementById(\"movie\");\n\t\t\t\t\tinfo.innerHTML = output;\n\t\t\t\t})\n\t\t})\n\n\nfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/videos?api_key='+API_KEY+'&language=es-ES')\n.then(function(response) {\n\treturn response.json();\n})\n.then(function(response) {\n\n let movie = response.results;\n\tlet trailer = response.results;\n\n\t// Se muestra un trailer distinto cada vez\n\tlet min = 0;\n\t// -1 so it takes into account if theres only 1 item in the trailer length( at position 0).\n\tlet max = trailer.length - 1;\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\tlet trailerNumber = Math.floor(Math.random() * (max-min +1)) + min;\n\n\tlet output = `\n\t\t<div class=\"video\">\n\t\t<iframe width=\"620\" height=\"400\" src=\"https://www.youtube.com/embed/${trailer[trailerNumber].key}\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen></iframe>\n\t\t</div>`;\n\t// Muestra el trailer\n\tlet video = document.getElementById(\"trailer\");\n\tvideo.innerHTML = output;\n})\n// recomendaciones\nfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/recommendations?api_key='+API_KEY+'&language=es-ES&page=1')\n .then(function(response) {\n return response.json();\n })\n .then(function(response) {\n\n\t\tconst movie = response.results;\n\t\t//Set the movie length (output) to 4.\n\t\tmovie.length = 4;\n\t\tlet output = \"\";\n\t\tfor(let i = 0; i < movie.length; i++){\nlet favoriteMovies = JSON.parse(localStorage.getItem(\"favoriteMovies\")) || [];\n\t\t\toutput += `\n\t\t\t<div class=\"peliculas\">\n\t\t\t\t<div class=\"overlay\">\n\t\t\t\t<div class=\"movie\">\n\t\t\t\t\t<h2>${movie[i].title}</h2>\n\t\t\t\t\t\t<p><strong>Release date:</strong> <span>${movie[i].release_date} <i class=\"material-icons date\">date_range</i> </span></p>\n\t\t\t\t\t\t\t<a onclick=\"movieSelected('${movie[i].id}')\" >Detalles</a>\n\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"peliculas_img\">\n\t\t\t\t\t<img src=\"http://image.tmdb.org/t/p/w400/${movie[i].poster_path}\" onerror=\"this.onerror=null;this.src='../images/imageNotFound.png';\">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t`;\n\t\t}\n\n\t\tlet recommended = document.getElementById(\"recommended\");\n\t\trecommended.innerHTML = output;\n\n\t\tdocument.getElementById(\"prev\").style.display = \"none\";\n\t})\n\n\t.catch ((err)=>{\n\t\tlet recommended = document.getElementById(\"recommended\");\n\n\t\t `<div class=\"recommendations_error\">\n\t\t\t<h3>Perdon! </h3>\n\t\t\t<br>\n\t\t\t<p>No hay recomendacones</p>\n\t\t </div>`;\n\t})\n}", "function getMovieDetail(imdbid) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&i=\" + imdbid)\n .then((response) => response.json())\n .then((result) => result);\n}", "function getOMDBInfo(randomMovie) {\n axios.get('https://www.omdbapi.com?t=' + randomMovie + '&apikey=6753c87c')\n .then((response) => {\n let movie = response.data;\n let output = `\n <div class=\"moviedscrpt\">\n <div class=\"centerbox\">\n <img src=\"${movie.Poster}\" class=\"thumbnail\">\n <h2 style = \"color: white;\">${movie.Title}</h2>\n </div>\n <ul class=\"list-group\">\n <li class=\"list-group-item\"><strong>Genre:</strong> ${movie.Genre}</li>\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.Released}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.Rated}</li>\n <li class=\"list-group-item\"><strong>IMDB Rating:</strong> ${movie.imdbRating}</li>\n <li class=\"list-group-item\"><strong>Director:</strong> ${movie.Director}</li>\n <li class=\"list-group-item\"><strong>Writer:</strong> ${movie.Writer}</li>\n <li class=\"list-group-item\"><strong>Actors:</strong> ${movie.Actors}</li>\n </ul>\n <div class=\"well\" style=\"margin:4%\">\n <h3 style = \"color: white\" >Plot</h3>\n <p style = \"color: white\">${movie.Plot}</p>\n <hr>\n <div class=\"centerbox\">`;\n $('#movies').html(output);\n })\n .catch((err) => {\n console.log(err);\n });\n }", "function getReleaseDate(movieTitle){\n\tvar movieUrl = 'https://api.themoviedb.org/3/search/movie?api_key=feae45a67d6335347f12949a4fe25c77&language=en-US&query='+ movieTitle+ '&page=1&include_adult=false&region=US';\n\n\tvar json = JSON.parse(Get(movieUrl));\n\n\tconsole.log(json);\n\tconsole.log(json.total_results);\n\n\tif(json.total_results !== 0){\n\t\tfor(var i = 0; i < json.results.length; i++){\n\t\t\tif(json.results[i].title.toUpperCase() === movieTitle.toUpperCase()){\n\t\t\t\tvar movieInfo = makeMovie(json.results[i].title, json.results[i].release_date);\n\t\t\t\treturn movieInfo;\n\t\t\t}\n\t\t}\n\t\treturn \"Nothing\";\n\t}\n\telse{\n\t\treturn \"Nothing\";\n\t}\n\n}", "function MovieDetail(movie, $vivContext) {\n // Get Featured People.\n var api = new _api.API();\n var featuredPeople = api.getCredits(movie['id']);\n for (var i=0; i < featuredPeople['crew'].length; i++) {\n if (featuredPeople['crew'][i]['job'] == 'Director') {\n this.director = featuredPeople['crew'][i]['name'];\n break;\n }\n };\n cast = []\n for (var i=0; i < featuredPeople['cast'].length; i++) {\n if (featuredPeople['cast'][i]['order'] <= 10) {\n cast.push(featuredPeople['cast'][i]['name']);\n } else {\n break;\n }\n }\n this.cast = cast.join(', ');\n\n // Get Synopsis\n this.synopsis = movie['overview'];\n\n // Get IMDB Link\n if (movie['imdb_id'] && movie['imdb_id'] != undefined && movie['imdb_id'] != \"\") {\n this.imdbID = movie['imdb_id'];\n // accessing $vivContext to get the device\n var device = $vivContext.device ;\n if (device == 'bixby-mobile') {\n this.url = 'https://m.imdb.com/title/' + this.imdbID;\n } else {\n this.url = 'https://www.imdb.com/title/' + this.imdbID;\n }\n }\n}", "function movieTime() {\n\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\";\n\n\n\n axios\n .get(queryUrl)\n\n .then(\n\n function (response) {\n var movieD = response.data;\n // console.log(response)\n console.log(\n \"\\n ========== Movie Search ==========\\n\"\n )\n\n // * Title of the movie.\n console.log(\"Movie Title: \" + movieD.Title\n // * Year the movie came out.\n + \"\\nYear the movie came out: \" + movieD.Year\n // * IMDB Rating of the movie.\n + \"\\nIMDB Rating: \" + movieD.imdbRating\n // * Rotten Tomatoes Rating of the movie.\n + \"\\nRotten Tomatoes Rating: \" + movieD.Ratings[2].Value\n // * Country where the movie was produced.\n + \"\\nThe country the movie was produced in: \" + movieD.Country\n // * Language of the movie.\n + \"\\nLanguage of the movie: \" + movieD.Language\n // * Plot of the movie.\n + \"\\nMovie Plot: \" + movieD.Plot\n // * Actors in the movie.\n + \"\\nActors/Actresses: \" + movieD.Actors + \"\\n\");\n }\n )\n}", "function getMovie(){\r\n movieId = sessionStorage.getItem('movieId');\r\n axios.get('https://api.themoviedb.org/3/movie/'+movieId+'?api_key=7719d9fc54bec69adbe2d6cee6d93a0d&language=en-US')\r\n .then((response) => {\r\n imdbId = response.data.imdb_id;\r\n axios.get('http://www.omdbapi.com?apikey=c1c12a90&i='+imdbId)\r\n .then((response1) => {\r\n console.log(response1);\r\n let movie = response1.data;\r\n let output = '';\r\n const dict = {\r\n 'Jan': 1,\r\n 'Feb': 2,\r\n 'Mar': 3,\r\n 'Apr': 4,\r\n 'May': 5,\r\n 'Jun': 6,\r\n 'Jul': 7,\r\n 'Aug': 8,\r\n 'Sep': 9,\r\n 'Oct': 10,\r\n 'Nov': 11,\r\n 'Dec': 12\r\n };\r\n var arr = movie.Released.split(\" \");\r\n var today = new Date();\r\n var t = new Date(today.getFullYear()+','+(today.getMonth()+1)+','+today.getDate());\r\n var r = new Date(arr[2]+','+dict[arr[1]]+','+arr[0]);\r\n if(movie.Poster != null){\r\n output += `\r\n <h1 class=\"my-4 heading\">${movie.Title}</h1>\r\n\r\n <div class=\"row\">\r\n\r\n <div class=\"col-md-5\">\r\n <img style=\"\" class=\"img-fluid\" src=\"${movie.Poster}\" alt=\"\">\r\n </div>\r\n\r\n <div class=\"col-md-7\">\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\"><strong>Genre: </strong>${movie.Genre}</li>\r\n <li class=\"list-group-item\"><strong>Released: </strong>${movie.Released}</li>\r\n <li class=\"list-group-item\"><strong>Rated: </strong>${movie.Rated}</li>\r\n <li class=\"list-group-item\"><strong>IMDB Rating: </strong>${movie.imdbRating}</li>\r\n <li class=\"list-group-item\"><strong>Director: </strong>${movie.Director}</li>\r\n <li class=\"list-group-item\"><strong>Writer: </strong>${movie.Writer}</li>\r\n <li class=\"list-group-item\"><strong>Actors: </strong>${movie.Actors}</li>\r\n </ul>\r\n <li class=\"list-group-item\"><strong>Overview: </strong>${movie.Plot}</li>\r\n <a href=\"http://imdb.com/title/${movie.imdbID}\" target=\"blank\" class=\"btn btn-primary\">View IMDB</a> `+\r\n (t > r ? `<a href=\"#\" onClick=\"addMovie(${movieId}, ${1})\" class=\"btn btn-primary\">Add to Watched</a> ` : ``)\r\n +`\r\n <a href=\"#\" onClick=\"addMovie(${movieId}, ${0})\" class=\"btn btn-primary\">Add to Wished</a>\r\n </div>\r\n\r\n </div>\r\n `\r\n }\r\n $('#movieSingle').html(output);\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n}", "function movieData(title) {\n\n // This conditional statement handles the case where the user does not put a movie by returning the default movie selection: Do The Right Thing\n if (title === undefined) {\n\n title = 'Do The Right Thing';\n console.log('Since you didn\\'t request a specific movie title, I suggest that you watch this one!\\n');\n\n };\n\n // The request docs provide the sytax for its use which I followed here to make an api call to omdb\n request(\"http://www.omdbapi.com/?apikey=49544f9c&t=\" + title, function (error, response, body) {\n\n // If there is an error display the error message otherwise do not\n if (error == true) {\n console.log('error:', error);\n };\n\n let omdbResponse = JSON.parse(body);\n console.log(omdbResponse);\n\n if (omdbResponse.Error === 'Movie not found!') {\n console.log(`Movie not found. Sorry about that!\\n`)\n } else {\n // this for loop loops through the ratings array (which has three little objects in it) so that i can scope the Ratings key and pull out the Rotten Tomatoes Value\n for (let i = 0; i < omdbResponse.Ratings.length; i++) {\n\n // I left this console log in here so that you can see what the result of the for loop looks like and why I used it\n // console.log(omdbResponse.Ratings[i])\n\n };\n\n // These console.logs are printing out different bits of information from the body of the response\n console.log(`Movie title: ${omdbResponse.Title}`);\n console.log(`This movie was released: ${omdbResponse.Released}`);\n console.log(`The IMDB rating for this movie is: ${omdbResponse.imdbRating}`);\n console.log(`Rotten Tomatoes gives this move a rating of: ${omdbResponse.Ratings[1].Value}`);\n console.log(`This movie was filmed in: ${omdbResponse.Country}`);\n console.log(`This movie is in: ${omdbResponse.Language}`);\n console.log(`Here is a brief synopsis of the plot: ${omdbResponse.Plot}`);\n console.log(`Starring: ${omdbResponse.Actors} \\n\\nThis concludes the information for your current request. Thank you for using Liri. \\n`);\n }\n\n });\n\n}", "function movie (term) {\n\n var url = \"http://www.omdbapi.com/?t=\" + term + \"&y=&plot=short&apikey=trilogy\";\n\n request(url, function(error, response, body) {\n\n // If there were no errors and the response code was 200 (i.e. the request was successful)...\n \n if (!error && response.statusCode === 200) {\n\n // Then we print out the desired info\n console.log(divider);\n console.log(\"Title of the movie: \" + JSON.parse(body).Title);\n console.log(\"The movie's rating is: \" + JSON.parse(body).imdbRating);\n console.log(\"Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"The country where the movie was produced: \" + JSON.parse(body).Country);\n // unable to search using rottentomato api field.\n console.log(\"Rotten Tomatoes Rating of the movie: \" + JSON.parse(body).tomatoRating);\n console.log(\"Language of the movie: \" + JSON.parse(body).Language);\n console.log(\"Plot of the movie: \" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(divider);\n \n }\n \n\n\n});\n\n}", "function movieThis() {\n // Variable to store OMDB API key\n var movieAPI = \"7fc81b28\";\n // Variable to store the API URl and key \n var movieQueryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=\" + movieAPI;\n\n // Then run a request to the OMDB API with the movie specified\n request(movieQueryUrl, function (error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover the movie details\n var movieDetails = JSON.parse(body);\n // To log the information required for the assignment\n console.log(\"* Title of the movie: \" + movieDetails.Title);\n console.log(\"* Release Year: \" + movieDetails.Year);\n console.log(\"* IMDB Rating: \" + movieDetails.imdbRating);\n // Variable to set and hold movie ratings\n var movieRating = movieDetails.Ratings;\n // If ratings is not blank...\n if (movieRating != \"\") {\n // For loop to get and log the Rotten Tomatoes ratings\n for (var i = 0; i < movieRating.length; i++) {\n if (movieRating[i].Source === \"Rotten Tomatoes\") {\n console.log(\"* Rotten Tomatoes Rating: \" + movieRating[i].Value);\n }\n }\n // If it is blank, it logs a message saying that is no rating available \n } else {\n console.log(\"* Rotten Tomatoes Rating: Rating information is not available\");\n }\n // To log the information required for the assignment\n console.log(\"* Country where the movie was produced: \" + movieDetails.Country);\n console.log(\"* Language of the movie: \" + movieDetails.Language);\n console.log(\"* Plot of the movie: \" + movieDetails.Plot);\n console.log(\"* Actors in the movie: \" + movieDetails.Actors);\n }\n });\n}", "function movieThis(functionParameters) {\n\tif (functionParameters.length < 1) {\n\t\tfunctionParameters = \"Mr. Nobody\";\n\t};\n\trequest(\"http://www.omdbapi.com/?t=\" + functionParameters + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\t\tif(!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"imdbRating: \" + JSON.parse(body).imdbRating);\n\t\t\t// console.log(\"Title: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\tvar rotten;\n\t\t if(!JSON.parse(body).Ratings || !JSON.parse(body).Ratings[1]){\n rotten = \"No Rotten Tomatoes Score\"\n }\n else {\n rotten = JSON.parse(body).Ratings[1].Value\n }\n\n console.log(\"Rotten Tomatoes Rating: \" + rotten);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t} else {\n\t\t\tconsole.log(\"Movie Search Error\")\n\t\t}\n\n\t\t\n\n\t});\n}", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function thisMovie(movieName) {\n}", "function movieThis(user) {\n if (user.length === 0) {\n user = \"Mr.Nobody\";\n }\n axios\n .get(\"http://www.omdbapi.com/?apikey=trilogy&t=\" + user)\n .then(function(response) {\n // console.log(response);\n // console.log(response.data);\n var rottenTomatoes = response.data.Ratings[1];\n // console.log(rottenTomatoes);\n if (rottenTomatoes === undefined) {\n rottenTomatoes = \"Unavailable\";\n } else {\n rottenTomatoes = response.data.Ratings[1].Value;\n }\n console.log(\"\");\n console.log(\n \"===== MOVIE ==========[ Searched: \" + response.data.Title + \" ]=====\"\n );\n console.log('===================================================================================================================================');\n // * Title of the movie.\n console.log(\"Title Of Movie: [ \" + response.data.Title + ' ]');\n // * Year the movie came out.\n console.log(\"Year Movie Published: [ \" + response.data.Year + ' ]');\n // * IMDB Rating of the movie.\n console.log(\"IMDB Rating: [ \" + response.data.imdbRating + ' ]');\n // * Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Rating: [ \" + rottenTomatoes + ' ]');\n // * Country where the movie was produced.\n console.log(\"Country Produced: [ \" + response.data.Country + ' ]');\n // * Language of the movie.\n console.log(\"Language: [ \" + response.data.Language + ' ]');\n // * Plot of the movie.\n console.log(\"Plot: [ \" + response.data.Plot + ' ]');\n // * Actors in the movie.\n console.log(\"Actors: [ \" + response.data.Actors + ' ]');\n console.log('===================================================================================================================================');\n })\n .catch(function(error) {\n console.log(\"MOVIE ERROR: \" + error);\n });\n}", "function getMovie(req, res, next){\n let movArr = model.getMovie(req.params.mid);\n let directorName = model.getNameArr(movArr[0].Director);\n let writerName = model.getNameArr(movArr[0].Writer);\n let actorName = model.getNameArr(movArr[0].Actors);\n let url = movArr[0].Poster;\n let recMovie = model.getRecMovie(req.params.mid);\n\n let data = renderMovie({movie: movArr, link: url, session:req.session, movName: req.params.mid,\n otherName: directorName, writerName: writerName, actorName: actorName,\n recMovie: recMovie});\n res.status(200).send(data);\n}" ]
[ "0.76905596", "0.74595827", "0.7442448", "0.74126834", "0.7398734", "0.73495376", "0.7347973", "0.7321103", "0.730877", "0.7308059", "0.729426", "0.7276822", "0.7269765", "0.7222126", "0.71885026", "0.7155367", "0.71488017", "0.71385187", "0.7136701", "0.70962274", "0.7061909", "0.7055286", "0.70203286", "0.70155424", "0.70095885", "0.70088965", "0.6985768", "0.6985661", "0.6973421", "0.6972955", "0.696813", "0.6959821", "0.6958434", "0.69542193", "0.6947574", "0.69374335", "0.69231266", "0.6913813", "0.6913217", "0.69092727", "0.6890085", "0.6881309", "0.6863634", "0.6855181", "0.68504006", "0.6850113", "0.68216175", "0.68208194", "0.68177855", "0.6803594", "0.67996424", "0.67968446", "0.6770384", "0.6761871", "0.6760409", "0.6760062", "0.6751361", "0.674014", "0.6726752", "0.67216134", "0.6710537", "0.6702379", "0.669269", "0.66801673", "0.6658687", "0.66585505", "0.66534024", "0.665207", "0.6649037", "0.664832", "0.66241676", "0.6622315", "0.6622293", "0.6621457", "0.6619995", "0.66115165", "0.6611424", "0.66092694", "0.660791", "0.6600625", "0.65840036", "0.6579442", "0.6576856", "0.6576472", "0.6566867", "0.65538347", "0.65437603", "0.65409034", "0.65405303", "0.65330416", "0.6530339", "0.6529237", "0.6529232", "0.65266246", "0.65113443", "0.6507453", "0.65033543", "0.6501761", "0.6499272", "0.6497067" ]
0.7605141
1
Function gets the movie information
function getMovieRating(args){ console.log("Getting rating for movie "+movie_id); var req = new XMLHttpRequest(); req.open("GET", request_path+"/ratings/"+movie_id, true); req.onload = function() { var response = JSON.parse(req.response); args[1].setText(Number(response["rating"]).toFixed(3)); } req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n request(queryUrl, function(e, resp, data) {\n if (!e && resp.statusCode === 200) {\n\n console.log(\"*************************************************\")\n console.log(\"Title: \" + JSON.parse(data).Title);\n console.log(\"Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors: \" + JSON.parse(data).Actors);\n console.log(\"*************************************************\")\n }\n });\n}", "function getMovieInfo(args){\n\tconsole.log(\"Getting info for movie \"+movie_id);\n\tvar req = new XMLHttpRequest();\n\treq.open(\"GET\", request_path+\"/movies/\"+movie_id, true);\n\treq.onload = function() {\n\t\tvar response = JSON.parse(req.response);\n\t\targs[0].setText(response[\"title\"]);\n\t\targs[2].setImage(args[3]+response[\"img\"]);\n\t\tgetMovieRating(args);\n\t}\n\treq.send();\n}", "function movieInfo(movieURL) {\n request(movieURL, function(err, response, body) {\n if (!err && response.statusCode == 200) {\n //convert body to string\n body = JSON.parse(body);\n console.log(\"Title: \" + body.Title);\n console.log(\"Year: \" + body.Year);\n console.log(\"Rating: \" + body.Rated);\n console.log(\"Country: \" + body.Country);\n console.log(\"Language: \" + body.Language);\n console.log(\"Plot: \" + body.Plot);\n console.log(\"Cast: \" + body.Actors);\n console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n } else {\n log(\"error_log.txt\", command + \" Error: \" + err);\n return;\n };\n });\n}", "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "function getMovieInfo() {\n\n\t//Then, run a request to the OMDB API with the movieName the user enters.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function(error, response, body) {\n\n\t\t//Create variable to hold all the movie info that we will output to the console.\n\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\tvar movieInfo = JSON.parse(body);\n\t\t//Title of movie\n\t\tvar movieTitle = \"Title: \" + movieInfo.Title;\n\t\t//Year the movie came out.\n\t\tvar movieYear = \"Year movie was released: \" + movieInfo.Year;\n\t\t//IMDB Rating of the movie.\n\t\tvar IMDBRating = \"IMDB movie rating (out of 10): \" + movieInfo.imdbRating;\n\t\t//Rotten Tomatoes rating of the movie.\n\t\tvar rottenTomatoes = \"Rotten Tomatoes rating (out of 100%): \" + movieInfo.Ratings[1].Value;\n\t\t//Country where the movie was produced.\n\t\tvar countryProduced = \"Filmed in: \" + movieInfo.Country;\n\t\t//Language of the movie.\n\t\tvar movieLanguage = \"Language: \" + movieInfo.Language;\n\t\t//Plot of the movie.\n\t\tvar moviePlot = \"Movie plot: \" + movieInfo.Plot;\n\t\t//Actors in the movie.\n\t\tvar movieActors = \"Actors: \" + movieInfo.Actors;\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//console.log(JSON.parse(body));\n\t\t\t//Output the following information to terminal window.\n\t\t\t//Title of the movie.\n\t\t\tconsole.log(movieTitle);\n\t\t \t//Year the movie came out.\n\t\t \tconsole.log(movieYear);\n\t\t \t//IMDB Rating of the movie.\n\t\t \tconsole.log(IMDBRating);\n\t\t \t//Rotten Tomatoes rating of the movie.\n\t\t \tconsole.log(rottenTomatoes);\n\t\t \t//Country where the movie was produced.\n\t\t \tconsole.log(countryProduced);\n\t\t \t//Language of the movie.\n\t\t \tconsole.log(movieLanguage);\n\t\t \t//Plot of the movie.\n\t\t \tconsole.log(moviePlot);\n\t\t \t//Actors in the movie.\n\t\t \tconsole.log(movieActors);\n\t\t}\n\t});\n}", "function getMovieInfo() {\n\n\t//If the movie name is longer than one word, join the words together on one line so that the movie name is all one string.\n\t//Rather than having separate lines for each word.\n\tfor (var i = 3; i < input.length; i++) {\n\n\t\tif (i > 2 && i < input.length) {\n\t\t\tmovieName = movieName + \" \" + input[i];\n\t\t}\n\t\t//For example, if the user enters \"node liri.js movie this social network\", movieName should be \"social network\" when the value is logged the terminal.\n\t\t//console.log(movieName);\n\t}\n\n\t//If no movie name is specified on the command line, then show the movie info for the movie, Mr. Nobody.\n\tif (!movieName) {\n\t\t//If no movie is specified, set movieName equal to Mr. Nobody.\n\t\tmovieName = \"Mr Nobody\";\n\t\tconsole.log(\"If you haven't watched Mr. Nobody, then you should: http://www.imdb.com/title/tt0485947/\");\n\t\tconsole.log(\"It's on Netflix!\")\n\t}\n\n\t//Use the figlet npm package to convert the movieName text to art/drawing.\n\tfiglet(movieName, function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\n\t//Then, run a request to the OMDB API with the movieName value.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function (error, response, body) {\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\t\tvar movieInfo = JSON.parse(body);\n\t\t\t//console.log(movieInfo);\n\n\t\t\t// Create variable to hold Rotten Tomatoes Rating.\n\t\t\tvar tomatoRating = movieInfo.Ratings[1].Value;\n\n\t\t\t//Output the following information about movieName.\n\t\t\t// \\r\\n is used as a new line character in Windows: https://stackoverflow.com/questions/15433188/r-n-r-n-what-is-the-difference-between-them \n\t\t\tvar movieResult =\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Output the liri command plus movieName\n\t\t\t\t\"liri command: movie-this \" + movieName + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Title of the movie.\n\t\t\t\t\"Title: \" + movieInfo.Title + \"\\r\\n\" +\n\t\t\t\t//Year the movie came out.\n\t\t\t\t\"Year movie was released: \" + movieInfo.Year + \"\\r\\n\" +\n\t\t\t\t//IMDB Rating of the movie.\n\t\t\t\t\"IMDB movie rating (out of 10): \" + movieInfo.imdbRating + \"\\r\\n\" +\n\t\t\t\t//Rotten Tomatoes rating of the movie.\n\t\t\t\t\"Rotten Tomatoes rating (out of 100%): \" + tomatoRating + \"\\r\\n\" +\n\t\t\t\t//Country where the movie was produced.\n\t\t\t\t\"Filmed in: \" + movieInfo.Country + \"\\r\\n\" +\n\t\t\t\t//Language of the movie.\n\t\t\t\t\"Language: \" + movieInfo.Language + \"\\r\\n\" +\n\t\t\t\t//Plot of the movie.\n\t\t\t\t\"Movie plot: \" + movieInfo.Plot + \"\\r\\n\" +\n\t\t\t\t//Actors in the movie.\n\t\t\t\t\"Actors: \" + movieInfo.Actors + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\"\n\n\t\t\t//Output the movie information to the terminal.\n\t\t\tconsole.log(movieResult);\n\t\t\t//Output the movie information to the log.txt file.\n\t\t\tlogData(movieResult);\n\t\t}\n\t});\n}", "function movieInfo(movie) {\n\t// If a movie has been passed into the function\n\t// then set parameters to the specified movie. \n\t// Otherwise set it to \"Mr. Nobody\"\n\tif (typeof(movie) != \"undefined\") {\n\t\tvar queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n\t} else {\n\t\tvar queryURL = \"http://www.omdbapi.com/?t=Mr.Nobody&y=&plot=short&apikey=40e9cece\";\n\t};\n\t\t// Run a request to the OMDB API with the movie specified\n\t\trequest(queryURL, function(error, response, body) {\n\n\t \t// If the request is successful (i.e. if the response status code is 200)\n\t \tif (!error && response.statusCode === 200) {\n\n\t\t // Parse the body of the site and recover just the movie title\n\t\t console.log(\"Movie Title: \" + JSON.parse(body).Title);\n\t\t // Year the movie came out\n\t\t console.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t // IMDB rating of the movie\n\t\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t // Country where the movie was produced\n\t\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t\t // Language of the movie\n\t\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t\t // Plot of the movie\n\t\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t // Actors in the movie\n\t\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t // Rotten tomoatoes rating\n\t\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\t// Append the results to the log file log.txt\n\t\t\tfs.appendFile(\"log.txt\",';'+ \"Movie Title: \" + JSON.parse(body).Title + ';' + \n\t\t\t\t\t\t\t\"Release Year: \" + JSON.parse(body).Year + ';' +\n\t\t\t\t\t\t\t\"IMDB Rating: \" + JSON.parse(body).imdbRating + ';' +\n\t\t\t\t\t\t\t\"Country: \" + JSON.parse(body).Country + ';' +\n\t\t\t\t\t\t\t\"Language: \" + JSON.parse(body).Language + ';' +\n\t\t\t\t\t\t\t\"Plot: \" + JSON.parse(body).Plot + ';' +\n\t\t\t\t\t\t\t\"Actors: \" + JSON.parse(body).Actors + ';' +\n\t\t\t\t\t\t\t\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value , function(err){\n\t\t\t\t//If the code experiences any errors it will log the error to the console.\n\t\t\t if (err) {\n\t\t\t return console.log(err);\n\t\t\t };\n\t\t\t});\n\n\t\t};\n\t});\n}", "function getMovieInfo(movieTitle) {\n\n\t// Runs a request to the OMDB API with the movie specified.\n\n\tvar queryUrl = \"http://www.omdbapi.com/?s=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json&apikey=trilogy\";\n\n\tomdb(queryUrl, function (error, response, body) {\n\t\t// console.log(\"Here\",body)\n\n\t\tif (error) {\n\t\t\tconsole.log(error)\n\t\t}\n\n\t\t// If the request is successful...\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parses the body of the site and recovers movie info.\n\n\t\t\tvar movie = JSON.parse(body);\n\n\t\t\t// Prints out movie info form omdb server.\n\n\t\t\tlogOutput(\"Movie Title: \" + movie.Title);\n\n\t\t\tlogOutput(\"Release Year: \" + movie.Year);\n\n\t\t\tlogOutput(\"IMDB Rating: \" + movie.imdbRating);\n\n\t\t\tlogOutput(\"Country Produced In: \" + movie.Country);\n\n\t\t\tlogOutput(\"Language: \" + movie.Language);\n\n\t\t\tlogOutput(\"Plot: \" + movie.Plot);\n\n\t\t\tlogOutput(\"Actors: \" + movie.Actors);\n\n\t\t\t// Had to set to array value, as there seems to be a bug in API response,\n\n\t\t\t// that always returns N/A for movie.tomatoRating.\n\n\t\t\tlogOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n\n\t\t\tlogOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n\n\t\t}\n\n\t});\n\n}", "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=//!InsertKey\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "function getMovieInfo(movie) {\n // If no movie is provided, get the deets for Mr. Nobody\n if (movie === \"\") {\n movie = \"Mr. Nobody\";\n }\n // Variable to hold the query URL\n let queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n // API request\n request(queryURL, function (error, response, body) {\n let movieResponse = JSON.parse(body);\n if (error || movieResponse.Response == \"False\") {\n console.log(\"Something went wrong. Try again?\", error);\n }\n else {\n let arrLog = [];\n arrLog.push(\"Title: \" + movieResponse.Title);\n arrLog.push(\"Year: \" + movieResponse.Year);\n arrLog.push(\"IMDB Rating: \" + movieResponse.Ratings[0].Value);\n arrLog.push(\"Rotten Tomatoes Rating: \" + movieResponse.Ratings[1].Value);\n arrLog.push(\"Produced in: \" + movieResponse.Country);\n arrLog.push(\"Language: \" + movieResponse.Language);\n arrLog.push(\"Plot: \" + movieResponse.Plot);\n arrLog.push(\"Actors: \" + movieResponse.Actors);\n arrLog.push(logSeparator);\n logAndStoreResults(arrLog);\n }\n });\n}", "function movieInfo(movieURL) {\r\n request(movieURL, function(err, response, body) {\r\n if (!err && response.statusCode == 200) {\r\n //convert body to string\r\n body = JSON.parse(body);\r\n console.log(\"\\n\".red);\r\n console.log(\"Title: \".blue + body.Title.red);\r\n console.log(\"Year: \".blue + body.Year.red);\r\n console.log(\"Rating: \".blue + body.Rated.red);\r\n console.log(\"Country: \".blue + body.Country.red);\r\n console.log(\"Language: \".blue + body.Language.red);\r\n console.log(\"Plot: \".blue + body.Plot.red);\r\n console.log(\"Cast: \".blue + body.Actors.red);\r\n console.log(\"Rotten Tomatoes Rating: \".blue + body.tomatoRating.red);\r\n console.log(\"Rotten Tomatoes URL: \".blue + body.tomatoURL.red);\r\n console.log(\"\\n\");\r\n } else {\r\n log(\"error.txt\", command + \" Error: \" + err);\r\n return;\r\n };\r\n });\r\n}", "function movieThis(){\n\tif (movie === undefined) {\n\tmovie = 'Mr.Nobody';\n\t};\n\tvar url = 'http://www.omdbapi.com/?t=' + movie +'&y=&plot=long&tomatoes=true&r=json';\n\trequest(url, function(error, body, data){\n \t\tif (error){\n \t\t\tconsole.log(\"Request has returned an error. Please try again.\")\n \t\t}\n \tvar response = JSON.parse(data);\n\t\tconsole.log(\"******************************\")\n\t\tconsole.log(\"Movie title: \" + response.Title);\n\t\tconsole.log(\"Release Year: \" + response.Year);\n\t\tconsole.log(\"IMDB Rating: \" + response.imdbRating);\n\t\tconsole.log(\"Country where filmed: \" + response.Country);\n\t\tconsole.log(\"Language: \" + response.Language);\n\t\tconsole.log(\"Movie Plot: \" + response.Plot);\n\t\tconsole.log(\"Actors: \" + response.Actors);\n\t\tconsole.log(\"Rotten Tomatoes URL: \" + response.tomatoURL);\n\t\tconsole.log(\"******************************\")\n\t});\n}", "function getMovie(movieName) {\n axios.get(`http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`)\n .then(function(movie){\n console.log(\"\");\n console.log(\n `Title: ${movie.data.Title}\\n`,\n `Released: ${movie.data.Year}\\n`,\n `Rating from IMDB: ${movie.data.Ratings[0].Value}\\n`,\n `Country of origin: ${movie.data.Country}\\n`,\n `Plot: ${movie.data.Plot}\\n`,\n `Cast: ${movie.data.Actors}\\n`\n )\n })\n .catch(function(err){\n console.log(err)\n });\n}", "function movieThis(movieName) {\n var queryUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Console log all necessary data points\n console.log(JSON.parse(body));\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"Rated: \" + JSON.parse(body).Rated);\n console.log(\n \"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value\n );\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Produced In: \" + JSON.parse(body).Country);\n console.log(\"Laguage: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n}", "function getMovieInfo(movieTitle) {\n\n // Runs a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?apikey=8b309cfb&t=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful...\n if (!error && response.statusCode === 200) {\n\n // Parses the body of the site and recovers movie info\n var movie = JSON.parse(body);\n\n // Prints out movie info\n logOutput(\"Movie Title: \" + movie.Title);\n logOutput(\"Release Year: \" + movie.Year);\n logOutput(\"IMDB Rating: \" + movie.imdbRating);\n logOutput(\"Country Produced In: \" + movie.Country);\n logOutput(\"Language: \" + movie.Language);\n logOutput(\"Plot: \" + movie.Plot);\n logOutput(\"Actors: \" + movie.Actors);\n logOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n logOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n }\n });\n}", "function getMovieInfo() {\n let movieName = name;\n // if no movie name entered, 'Mr. Nobody' will appear\n if (!movieName) {\n movieName = \"Mr. Nobody \";\n }\n\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n axios.get(queryUrl).then(function (response) {\n movieInfo = [\"Title: \" + response.data.Title,\n \"Year Released: \" + response.data.Year,\n \"IMDB Rating: \" + response.data.Ratings[0].Value,\n \"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value,\n \"Country: \" + response.data.Country,\n \"Language: \" + response.data.Language,\n \"Plot: \" + response.data.Plot,\n \"Actors: \" + response.data.Actors];\n console.log(\"\\nTitle: \" + response.data.Title,\n \"\\nYear Released: \" + response.data.Year,\n \"\\nIMDB Rating: \" + response.data.Ratings[0].Value,\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value,\n \"\\nCountry: \" + response.data.Country,\n \"\\nLanguage: \" + response.data.Language,\n \"\\nPlot: \" + response.data.Plot,\n \"\\nActors: \" + response.data.Actors);\n });\n\n}", "function getMovie(movie) {\n\tif (!movie) {\n\t\tmovie = \"Mr. Nobody\"\n\t}\n\n\trequest(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\n\t\t\t// If the request is successful (i.e. if the response status code is 200)\n\t\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parse the body of the site and recover just the imdbRating\n\t\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n\t\t\tvar result = \"Title: \" + JSON.parse(body).Title + \"\\n\" +\n\t\t\t\t\t\"Year: \" + JSON.parse(body).Year + \"\\n\" +\n\t\t\t\t\t\"IMDB Rating: \" + JSON.parse(body).imdbRating + \"\\n\" +\n\t\t\t\t\t\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value + \"\\n\" +\n\t\t\t\t\t\"Country: \" + JSON.parse(body).Country + \"\\n\" +\n\t\t\t\t\t\"Lang: \" + JSON.parse(body).Language + \"\\n\" +\n\t\t\t\t\t\"Plot: \" + JSON.parse(body).Plot + \"\\n\" +\n\t\t\t\t\t\"Actors: \" + JSON.parse(body).Actors ;\n\t\t\tconsole.log(result)\n\t\t\treturn result\n\t\t\t\t \n\n\t\t\t}\n\t\t\t});\n\n}", "function getMovieInfo(movieName) {\n console.log(\"Get Movie\");\n if (movieName === undefined) {\n movieName = \"Mr Nobody\";\n }\n\n var movieURL =\n \"http://www.omdbapi.com/?t=\" +\n movieName +\n \"&y=&plot=full&tomatoes=true&apikey=trilogy\";\n axios\n .get(movieURL)\n .then(function(response) {\n var jsonData = response.data;\n var movieData = [\n divider,\n \"Title: \" + jsonData.Title,\n \"Year: \" + jsonData.Year,\n \"Country: \" + jsonData.Country,\n \"Language: \" + jsonData.Language,\n \"Plot: \" + jsonData.Plot,\n \"Actors: \" + jsonData.Actors,\n divider\n ].join(\"\\n\\n\");\n console.log(movieData);\n })\n .catch(function(error) {\n console.log(error);\n })\n .finally(function() {});\n}", "function movieThis(movieName) {\n\n // Default set as Mr. Nobody if user doesn't specify a movie.\n if (movieName == \"\") {\n movieName = \"Mr. Nobody\"\n }\n // Call to and responce from omdb API\n axios.get(\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=\" + process.env.MOVIE_SECRET)\n .then(function (response) {\n\n var data = response.data\n\n console.log(\"-------------------------------\");\n console.log(\"* Title: \" + data.Title);\n console.log(\"* Year: \" + data.Year);\n console.log(\"* IMDB: \" + data.Ratings[0].Value);\n console.log(\"* Roten Tomatoes: \" + data.Ratings[1].Value);\n console.log(\"* Country: \" + data.Country);\n console.log(\"* Language: \" + data.Language);\n console.log(\"* Plot: \" + data.Plot);\n console.log(\"* Actors: \" + data.Actors);\n console.log(\"---------------------------------\");\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "function lookupSpecificMovie () {\n //Calls upon the OMDB api to get data related to the 2009 movie MR. Nobody\n axios.get('http://www.omdbapi.com/?apikey=trilogy&t=Mr.+Nobody')\n .then(function (response) {\n //Node command\n logOutput('Command: node liri.js movie-this ' + response.data.Title);\n //Title of the movie.\n logOutput('Title: ' + response.data.Title);\n //Year the movie came out.\n logOutput('Year: ' + response.data.Year);\n //IMDB Rating of the movie.\n logOutput('IMDB Rating: ' + response.data.Ratings[0].Value);\n //Rotten Tomatoes Rating of the movie.\n logOutput('Rotton Tomatoes Rating ' + response.data.Ratings[1].Value);\n //Country where the movie was produced.\n logOutput('Country ' + response.data.Country);\n //Language of the movie.\n logOutput('Language ' + response.data.Language);\n //Plot of the movie.\n logOutput('Plot ' + response.data.Plot);\n //Actors in the movie.\n logOutput('Actors ' + response.data.Actors);\n logOutput(\"------------\");\n})\n.catch(function (error) {\n //Logs any errors to the log.txt files\n logOutput(error);\n});\n}", "function movie() {\n if (process.argv[3]) {\n var movieName = process.argv[3];\n } else {\n var movieName = 'mr nobody';\n }\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = 'http://www.omdbapi.com/?t=' + movieName + '&y=&plot=short&apikey=' + omdb_key;\n // Then run a request to the OMDB API with the movie specified\n request(queryUrl, function(error, response, body) {\n // If the request is successful \n if (!error && response.statusCode === 200) {\n var data = JSON.parse(body);\n // Then log info about the movie\n console.log('movie: ' + data.Title);\n console.log('year released: ' + data.Year);\n console.log('imdb rating: ' + data.Ratings[0].Value);\n console.log('rt rating: ' + data.Ratings[1].Value);\n console.log('country: ' + data.Country);\n console.log('language: ' + data.Language);\n console.log('plot: ' + data.Plot);\n console.log('actors: ' + data.Actors);\n } else {\n return console.log('error: ' + error);\n }\n });\n}", "function getMovieInfo(url) {\n let rankPattern = /<strong class=\"ll rating_num\" property=\"v:average\">([0-9.]+)<\\/strong>/\n let NamePattern = /<span property=\"v:itemreviewed\">(.+?)<\\/span>/\n let summaryPattern = /<span property=\"v:summary\" .*?>(.+?)<\\/span>/\n\n return request.get({\n url:url,\n // headers: options.headers\n })\n .promise()\n .then(function(html){\n let $ = cheerio.load(html)\n let $genres = $('#info > span[property=\"v:genre\"]')\n let genres = ''\n $genres.each(function(i, el){\n genres += $(this).text() + ' '\n })\n genres = genres.trimRight()\n genres = genres.replace(/ /g, '|')\n let rank = html.match(rankPattern) ? html.match(rankPattern)[1] : null\n let movieName = html.match(NamePattern) ? html.match(NamePattern)[1] : null\n\n return {\n newUrls: getUrls(html),\n rank,\n movieName,\n genres\n }\n })\n}", "function movieThis(movie) {\n\n if (movie.length === 0) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + searchQuery + \"&y=&plot=short&apikey=trilogy\";\n }\n\n // axios method to recieve and print data\n axios.get(queryURL).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMBD Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n\n );\n}", "function movied() {\n var movieTitle =\"\"; \n if (userInput[3] === undefined){\n movieTitle = \"mr+nobody\"\n } else {\n movieTitle = userInput[3];\n }; \n\tvar queryUrl = \"http://www.omdbapi.com/?apikey=f94f8000&t=\" + movieTitle\n\n\trequest(queryUrl, function(err, response, body) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t} else {\n\t\t console.log(\"\\n========== Movie Info ========\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Values);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\t\n console.log(\"=================================\\n\");\n\t\t}\n\n\t})\n}", "function movie() {\n\t// Then run a request to the OMDB API with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + command2 + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(queryURL, function (error, response, body) {\n\t\t// if the request is successful, run this\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\tconsole.log(\" \");\n\t\t\tconsole.log(queryURL);\n\t\t\tconsole.log(\"\\nMovie Title: \" +command2);\n\t\t\tconsole.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"Country where the movie is produced: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"\\nPlot of the movie: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"\\nThe IMDB rating is: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes rating is: \" + JSON.parse(body).Ratings[2].Value);\n\t\t\tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t}\n\t});\n}", "function movie() {\n //****************** OMDB movies API ********************\n var API2 = \"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\"\n\n axios.get(API2).then(\n function (response) {\n console.log(\"================================================\");\n console.log(\"Title of the Movie: \" + response.data.Title);\n console.log(\"Year Released: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country Produced in: \" + response.data.Country);\n console.log(\"Language of the Movie: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Cast: \" + response.data.Actors);\n }\n )\n}", "function movie() {\n\n\tvar movieName = '';\n\n\tif(process.argv.length >= 4){\n\t\tfor (var i = 3; i < dataArr.length; i++){\n\t\t\tif (i > 3 && i < dataArr.length) {\n\t\t\t\tmovieName = movieName + \"+\" + dataArr[i];\n\t\t\t} else {\n\t\t\t\tmovieName += dataArr[i];\n\t\t\t}\n\t\t} // closes for loop for dataArr\n\t} else {\n\t\tmovieName = 'Mr Nobody';\n\t}\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&tomatoes=true&r=json\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t \tconsole.log(\"\");\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Release Year: \" + JSON.parse(body).Released);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rating: \" + JSON.parse(body).imdbRating);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Produced In: \" + JSON.parse(body).Country);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t}\n\t});\t\t\t\n\n}", "function movieDisplay(movieTitle) {\n // console.log(\"Movie Display Function\");\n var queryURL = `http://www.omdbapi.com/?t=${movieTitle}&y=&plot=short&apikey=trilogy`\n // console.log(queryURL);\n\n request(queryURL, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n var movieData = JSON.parse(body);\n\n console.log(`Title:${movieData.Title}\\n` +\n `Release Year: ${movieData.Year}\\n` +\n `IMDB Rating: ${movieData.imdbRating}/10\\n` +\n `Rotten Tomatoes Rating: ${movieData.Ratings[1].Value}\\n` +\n `Production Location: ${movieData.Country}\\n` +\n `Movie Language(s): ${movieData.Language}\\n` +\n `Plot: ${movieData.Plot}\\n` +\n `Actors: ${movieData.Actors}\\n`\n )\n }\n\n })\n}", "function MovieInfo (title, plot, year, imdb, rottenTomoatoes, country, actors) { // constructor for movie info\n this.movieName = title;\n this.moviePlot = plot;\n this.movieYear = year;\n this.movieImdbRating = imdb;\n this.movieRtRating = rottenTomoatoes;\n this.movieCountry = country;\n this.movieActors = actors;\n }", "function movieThis(){\n var movie = process.argv[3];\n if(!movie){\n movie = \"Wonder Woman\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?&t=\" + params + \"&apikey=40e9cece\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject)\n var movieResults =\n (\"Title: \" + movieObject.Title);\n (\"Year: \" + movieObject.Year);\n (\"Imdb Rating: \" + movieObject.imdbRating);\n (\"Country: \" + movieObject.Country);\n (\"Language: \" + movieObject.Language);\n (\"Plot: \" + movieObject.Plot);\n (\"Actors: \" + movieObject.Actors);\n (\"Rotten Tomatoes Rating: \" + movieObject.tomatoRating);\n (\"Rotten Tomatoes URL: \" + movieObject.tomatoURL);\n\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\"+ error);\n return;\n }\n });\n }", "function moviethis(movie_name) {\n request(\"http://www.omdbapi.com/?t=\" + movie_name + \"&y=&plot=short&apikey=trilogy\", function (error, response, body, Title) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n\n console.log(\"*Title of the movie: \" + JSON.parse(body).Title);\n console.log(\"* Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"* Country produced:\" + JSON.parse(body).Country);\n console.log(\"* Language of the movie:\" + JSON.parse(body).Language);\n console.log(\"* Plot of the movie:\" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"* IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n }\n });\n} // end of movie function----------------------", "function movieThis (movieName) {\n\t//if user does not provide any movie, then default then we assign it a movie\n\tif(movieName === \"\"){\n\t\tmovieName = \"Mr. Nobody\"\n\t}\n\n\t//making custom url for OMDB query search. \n\tvar customURL = \"http://www.omdbapi.com/?t=\"+ movieName +\"&y=&plot=short&tomatoes=true&r=json\";\n\n\t//getting data and printing it on terminal\n\trequestFS(customURL, function (error, response, body) {\n\t\tvar movieData = JSON.parse(body);\n\t\tif (!error && response.statusCode == 200) {\n\t\t\tconsole.log(\"Title: \" + movieData.Title);\n\t\t\tconsole.log(\"Year: \" + movieData.Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + movieData.imdbRating);\n\t\t\tconsole.log(\"Country: \" + movieData.Country);\n\t\t\tconsole.log(\"Lanugage(s): \" + movieData.Language);\n\t\t\tconsole.log(\"Plot: \" + movieData.Plot);\n\t\t\tconsole.log(\"Actors: \" + movieData.Actors);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + movieData.tomatoMeter);\n\t\t\tconsole.log(\"Rotten Tomatoes Link: \" + movieData.tomatoURL);\n\t \t}\n\t});\n}", "function movieThis(option1) {\n if (typeof option1 === \"undefined\") {\n option1 = \"Mr. Nobody\"\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + option1 + \"&y=&plot=short&apikey=trilogy\"\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n console.log();\n console.log(\"Movie\");\n console.log(\"=====\");\n movie = JSON.parse(body);\n console.log(movie.Title);\n console.log(movie.Year);\n console.log(movie.Language);\n console.log(\"Made in: \" + movie.Country);\n console.log(\"Ratings\");\n movie.Ratings.forEach(element => {\n if (element.Source === 'Internet Movie Database') {\n console.log(\" IMDB: \" + element.Value);\n }\n if (element.Source === 'Rotten Tomatoes') {\n console.log(\" Rotten Tomatoes: \" + element.Value);\n }\n });\n console.log(\"Starring\");\n movie.Actors.split(\",\").forEach(element => {\n console.log(\" \" + element.trim());\n })\n console.log(movie.Plot);\n }\n });\n\n}", "function movieOutput(movie) {\n const queryUrl = `http://www.omdbapi.com/?t=${movie}&y=&plot=short&apikey=trilogy`;\n axios.get(queryUrl).then((response) => {\n const { data } = response;\n // console.log(response.data);\n console.log(`Movie title: ${data.Title}`);\n console.log(`Year the movie came out: ${data.Year}`);\n console.log(`IMDB Rating: ${data.imdbRating}`);\n console.log(`Rotten Tomatoes rating: ${data.Ratings[1].Value}`);\n console.log(`Country The Movie was produced: ${data.Country}`);\n console.log(`Language of the movie: ${data.Language}`);\n console.log(`Plot of the movie: ${data.Plot}`);\n console.log(`Actors: ${data.Actors}`);\n }).catch((error) => {\n if (error.response) {\n console.log('---------------Data---------------');\n console.log(error.response.data);\n }\n });\n}", "function movieData() {\n var request = require('request');\n request('http://www.omdbapi.com/?apikey=Trilogy&t='+ name , function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"\\nTitle of the movie: \" + JSON.parse(body).Title);\n console.log(\"Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n console.log(\"Country where the movie was produced: \" + JSON.parse(body).Country);\n console.log(\"Language of the movie: \" + JSON.parse(body).Language);\n console.log(\"Plot of the movie: \" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL + \"\\n\");\n \n }\n\n }); \n}", "function getMovie() {\n // import the request package\n var request = require(\"request\");\n // call to OMDB API\n if (process.argv[3] === undefined) {\n var queryUrl = \"http://www.omdbapi.com/?t=\" + \"Mr.\" + \"Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover necessary output\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(body).County);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n } else {\n var movieName = process.argv[3]\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover necessary output\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(body).County);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n }\n}", "function getMovie(movieName) {\n\n // If no movie name, do a search for Mr.Nobody\n if (!movieName) {\n var movieName = \"Mr. Nobody\";\n }\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=[key]\";\n axios.get(queryURL).then(\n function (response) {\n\n // Movie info\n console.log(`Title: ${response.data.Title}\nYear: ${response.data.Year}\nRated: ${response.data.Rated}\nRotten Tomatoes Rating: ${response.data.tomatoRating}\nCountry Produced in: ${response.data.Country}\nLanguage: ${response.data.Language}\nPlot: ${response.data.Plot}\nActors: ${response.data.Actors}`\n );\n }\n )\n}", "function movieThis() {\n var movie = \"Mr. Nobody\";\n if (searchTerm) {\n var movie = searchTerm;\n };\n let movieUrl = \"http://www.omdbapi.com/?apikey=715b0924&t=\" + movie\n axios.get(movieUrl).then(response => {\n let data = response.data;\n console.log(\"Title: \" + data[\"Title\"] + \"\\nYear: \" + data[\"Year\"] + \"\\nIMDB Rating: \" + data[\"imdbRating\"] + \"\\nRotten Tomatoes Rating: \" + data[\"Ratings\"][1][\"Value\"] + \"\\nCountry of Production: \" + data[\"Country\"] + \"\\nLanguage: \" + data[\"Language\"] + \"\\nPlot: \" + data[\"Plot\"]\n + \"\\nActors: \" + data[\"Actors\"]);\n }).catch(error => {\n console.log(error);\n });\n}", "function movieThis(movie){\n //This will pull from the omdb API and pull data about the movie\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n //console.log(response.data);\n console.log(\"-------------\");\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n //Add in the rotten tomatoes rating\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n console.log(\"-------------\");\n });\n}", "function getMovieInfo (title, year, rating) {\n return fetch(`${omdbMainURL}&t=${title}&y=${year}`)\n .then(res => res.json())\n .then(data => {\n return new Constructor({\n title: data.Title,\n year: data.Year,\n criticRatings: data.Ratings,\n userRating: rating,\n poster: data.Poster,\n genre: data.Genre,\n director: data.Director,\n plot: data.Plot,\n actors: data.Actors,\n id: Date.now()\n });\n })\n .catch(console.error);\n }", "function getMovie(){\n // this is exactly the same logic as the spotify function starts with\n // if there are search terms (aka userParameters), use them in the query\n // if there are not search terms, use a pre-defined default search\n let movieSearchTerm;\n\tif(userParameters === undefined){\n\t\tmovieSearchTerm = \"Mr. Nobody\";\n\t}else{\n\t\tmovieSearchTerm = userParameters;\n\t};\n // this is the queryURL that will be used to make the call - it holds the apikey, returns a \"short\" plot, type json, and \n // the tomatoes flag attempts to return rottenTomatoes data although most of that is now deprecated as of may 2017 \n let queryURL = 'http://www.omdbapi.com/?t=' + movieSearchTerm +'&apikey=trilogy&y=&plot=short&tomatoes=true&r=json';\n request(queryURL, function(error, response, body){\n\t if(!error && response.statusCode == 200){\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value);\n\t console.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW MOVIE SEARCH EVENT:\\nTitle: ${JSON.parse(body).Title}\\nYear: ${JSON.parse(body).Year}\\nIMDB Rating: ${JSON.parse(body).imdbRating}\\nRotten Tomatoes Score: ${JSON.parse(body).Ratings[1].Value}\\nCountry of Production: ${JSON.parse(body).Country}\\nLanguage: ${JSON.parse(body).Language}\\nPlot: ${JSON.parse(body).Plot}\\nActors: ${JSON.parse(body).Actors}\\n------\\n`, function(err) {\n });\n }\n });\n}", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }", "function getMovieDetails(movieName) {\n return new Promise((resolve, reject) => {\n\n var omdbQueryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n request(omdbQueryUrl, function(error, response, body) {\n if (error && response.statusCode != 200) {\n reject(error);\n }\n resolve(JSON.parse(body));\n });\n });\n}", "function movieThis(receivedMovie) {\n\n\n var movie = receivedMovie ? receivedMovie : \"Mr. Nobody\";\n\n // request to omdbapi using movie entered and trilogy api key\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=full&tomatoes=true&r=json&y=&plot=short&apikey=trilogy\", function (error, response, data) {\n\n // IF the request is successful. The status code is 200 if the status returned is OK\n if (!error && response.statusCode === 200) {\n\n // log the command issued to the log.txt file\n logCommand();\n\n // Display Data\n // TITLE, YEAR, IMDB RATING, COUNTRY, LANGUAGE(S), PLOT, ACTORS, ROTTEN TOMATO RATING, ROTTEN TOMATO URL\n console.log(\"Movie Title: \" + JSON.parse(data).Title);\n console.log(\"Release Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"TOMATOMETER: \" + JSON.parse(data).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors/Actresses: \" + JSON.parse(data).Actors);\n }\n\n });\n}", "function movieThis(show) {\n // when called, show will be replaced with var = title.\n axios.get('http://www.omdbapi.com/?t=' + show + '&plot=short&apikey=trilogy')\n .then(function (response) {\n // console.log('////////////////AXIOS NO ERROR////////////')\n // console.log(response)\n // * Title of the movie.\n console.log(`Movie: ${response.data.Title}`)\n // * IMDB Rating of the movie.\n console.log(`IMDB Rating is: ${response.data.imdbRating}`)\n // * Year the movie came out.\n console.log(`Year Released : ${response.data.Released}`)\n // * Rotten Tomatoes Rating of the movie.\n console.log(`Rotten Tomatoes Rating : ${response.data.Ratings[1].Value}`)\n // * Country where the movie was produced.\n console.log(`Country : ${response.data.Country}`)\n // * Language of the movie.\n console.log(`Language : ${response.data.Language}`)\n // * Plot of the movie.\n console.log(`Plot : ${response.data.Plot}`)\n // * Actors in the movie.\n console.log(`Actors in movie : ${response.data.Actors}`)\n })\n // log error\n .catch(function (error) {\n console.log('//////////ERROR!!!/////////////')\n console.log(error);\n });\n}", "function getMovie() {\n\n var omdbApi = require('omdb-client');\n\n var params = {\n apiKey: 'XXXXXXX',\n title: 'Terminator',\n year: 2012\n }\n omdbApi.get(params, function (err, data) {\n // process response...\n });\n}", "function getMovie() {\n\n var movie = \"Pacific Rim\"\n\n request(\"https://www.omdbapi.com/?apikey=\"+ process.env.OMDB_API_KEY +\"&t=\" + value, function (error, response, body) {\n if(error){\n console.log(error)\n }\n\n console.log(JSON.parse(body)['Title'])\n console.log(JSON.parse(body).Title)\n \n });\n}", "function movieThis(movieName) {\n console.log(\"movie is working\");\n if (movieName === undefined) {\n movieName = \"Mr Nobody\";\n }\n\n var movieUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=trilogy\";\n\n axios.get(movieUrl).then(\n function (response) {\n var movieData = response.data;\n\n console.log(\"Title: \" + movieData.Title);\n console.log(\"Year: \" + movieData.Year);\n console.log(\"Rated: \" + movieData.Rated);\n console.log(\"IMDB Rating: \" + movieData.imdbRating);\n console.log(\"Country: \" + movieData.Country);\n console.log(\"Language: \" + movieData.Language);\n console.log(\"Plot: \" + movieData.Plot);\n console.log(\"Actors: \" + movieData.Actors);\n console.log(\"Rotten Tomatoes Rating: \" + movieData.Ratings[1].Value);\n }\n );\n}", "function printMovieDetail() {\n if (movie.bkgimage != null) {\n bkgImageElt.css('background-image', `url(${movie.bkgimage})`);\n }\n else {\n bkgImageElt.css('background-image', `linear-gradient(rgb(81, 85, 115), rgb(21, 47, 123))`);\n }\n\n titleElt.text(movie.title);\n modalTitle.text(movie.title);\n originaltitleElt.text(movie.originaltitle);\n resumeElt.text(movie.resume);\n dateElt.text(printDateFr(movie.date));\n durationElt.text(printDuration(movie.duration));\n imgElt.attr('src', movie.image);\n iframe.attr('src', movie.traileryt + \"?version=3&enablejsapi=1\");\n // Afficher la liste des acteurs\n var actorsStr = '';\n for (var actor of movie.actors) {\n actorsStr += actor + ' | ';\n }\n actorsElt.text(actorsStr);\n // afficher le réalisteur\n directorElt.text(movie.director);\n}", "function movieThis(movieTitle) {\n request(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&plot=short&apikey=trilogy\", function (error, response, body) {\n if (JSON.parse(body).Response === 'False') {\n return console.log(JSON.parse(body).Error);\n }\n if (!movieTitle) {\n request(\"http://www.omdbapi.com/?t=Mr+Nobody&plot=short&apikey=trilogy\", function (error, response, body) {\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n })\n } else if (!error && response.statusCode === 200) {\n\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n }\n })\n}", "function writeMovieInfo(mvName){\n // console.log(\"The movie name is \" + mvName);\n\n // If the user doesn't type a movie in, the program will output data for the movie 'Mr. Nobody.'\n if ((mvName===\"\") || (mvName===undefined))\n {\n mvName = \"Mr.+Nobody\"; \n }\n\n // console.log(\"The movie name is \" + mvName);\n // * Title of the movie.\n // * Year the movie came out.\n // * IMDB Rating of the movie.\n // * Rotten Tomatoes Rating of the movie.\n // * Country where the movie was produced.\n // * Language of the movie.\n // * Plot of the movie.\n // * Actors in the movie.\n var axios = require(\"axios\");\n // Then run a request with axios to the OMDB API with the movie specified\n axios.get(\"http://www.omdbapi.com/?t=\" + mvName + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n // console.log(JSON.stringify(response.data, null, 2));\n // first some error handling\n if (response.data.Response === \"False\")\n {\n console.log(\"Sorry, the movie \" + movieResponse.movieName + \" was not found, try another one.\");\n return;\n }\n // console.log(JSON.stringify(response.data, null, 2));\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n // need to parse array of ratings to find the Rotten Tomatoes one\n ratings = response.data.Ratings;\n var rtRating = \"\";\n for (var i=0; i<ratings.length; i++){\n if (ratings[i].Source === \"Rotten Tomatoes\")\n rtRating = ratings[i].Value;\n }\n \n console.log(\"Rotten Tomatoes Rating: \" + rtRating);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n });// end of axios call then\n }", "function getMovieInfo() {\n if (searchTerm === \"\") {\n searchTerm = \"Star Wars\";\n }\n axios\n .get(\"http://omdbapi.com/?apikey=trilogy&s=\" + searchTerm)\n .then(function(response) {\n logString +=\n \"\\n\\n\\nYou Searched For: \" +\n searchTerm +\n \"\\nThis Search Resulted in \" +\n response.data.Search.length +\n \" results\" +\n \"\\n******** Results *********\\n\\n\";\n response.data.Search.forEach(movie => {\n logString +=\n \"Movie Title - \" +\n movie.Title +\n `\\nMovie Year - ${movie.Year}` +\n `\\nMovie IMDB ID - ${movie.imdbID}` +\n \"\\nMedia Type - \" +\n movie.Type +\n \"\\nPoster URL - \" +\n movie.Poster +\n \"\\n\\n\";\n });\n logString += \"\\n******** End *********\\n\";\n console.log(logString);\n logResults();\n });\n}", "function getMovie() {\n\n let movieId = sessionStorage.getItem('movieId');\n api_key = '98325a9d3ed3ec225e41ccc4d360c817';\n\n $.ajax({\n\n url: `https://api.themoviedb.org/3/movie/${movieId}`,\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n },\n\n //get acess to movie information;\n success: function(data) {\n\n\n\n var movie = data;\n let output = `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" class=\"thumbnail\">\n <div id=\"visitS\">\n <a id=\"visitSite\" target=\"_blank\" href=\"${movie.homepage}\"> Visit Movie Site</a>\n </div>\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title}</h2>\n <ul class=\"list-group\" id=\"list-group\">\n\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.release_date}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.vote_average}</li>\n <li class=\"list-group-item\"><strong>Runtime:</strong> ${movie.runtime} min.</li>\n <li class=\"list-group-item\"><strong>Production Companies:</strong> ${movie.production_companies[0].name} min.</li>\n </ul>\n <div>\n <div id=\"overview\">\n <h3>Overview</h3> ${movie.overview}\n </div>\n <div id=\"imdbb\">\n <a id=\"imdb\" href=\"http://imdb.com/title/${movie.imdb_id}\" target=\"_blank\" <i class=\"fab fa-imdb fa-3x\"></i></a>\n </div>\n <div>\n <a class=\"navbar-brand\" id=\"go2\" href=\"index.html\">Go Back</a>\n \n </div>\n \n </div> \n \n `;\n //print movie selected information\n $('#movie').html(output);\n\n\n }\n\n })\n\n}", "function findMovie(title){\n\tvar title = processInput(title);\n\n\tif(title != undefined){\n\t\tvar formattedTitle = title.replace(\" \", \"+\");\t\n\t\tvar query = \"http://www.omdbapi.com/?t=\" + formattedTitle;\n\n\t\trequest(query, function (error, response, body) {\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else{\n\t\t\t\tvar movieTitle = JSON.parse(body).Title;\n\t\t\t\tvar year = JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = JSON.parse(body).Ratings[0].Value;\n\t\t\t\tvar country = JSON.parse(body).Country;\n\t\t\t\tvar language = JSON.parse(body).Language;\n\t\t\t\tvar plot = JSON.parse(body).Plot;\n\t\t\t\tvar actors = JSON.parse(body).Actors;\n\t\t\t\tvar rottenRating = JSON.parse(body).Ratings[1].Value;\n\t\t\t\tvar rottenURL = \"blah\";\n\n\t\t\t\tvar output = \"\\nMovie Title: \" + movieTitle + \"\\nYear Released: \" \n\t\t\t\t\t+ year + \"\\nCountry Filmed: \" + country + \"\\nLanguages Released In: \"\n\t\t\t\t\t + language + \"\\nActors: \" + actors + \"\\n\\nPlot: \" + plot + \"\\n\\nIMDB Rating: \" \n\t\t\t\t\t + imdbRating + \"\\nRotten Tomatoes Rating: \" + rottenRating + \"\\nRotten Tomatoes URL: \" \n\t\t\t\t\t + rottenURL;\n\n\t\t\t\tconsole.log(output);\n\t\t\t\twriteFS(output);\n\n\t\t\t};\n\t\t});\n\t};\n}", "function movie(movieName){\n\tvar request = require('request');\n\n\tvar nodeArgs = process.argv;\n\n\tvar movieName = \"\";\n\n\tif (process.argv[3] == null){\n\n\t\tmovieName = \"Mr.Nobody\";\n\n\t}else{\n\n\t\tfor (var i=3; i<nodeArgs.length; i++){\n\n\t\t\tif (i>3 && i< nodeArgs.length){\n\n\t\t\tmovieName = movieName + \"+\" + nodeArgs[i];\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\tmovieName = movieName + nodeArgs[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\trequest('http://www.omdbapi.com/?t='+ movieName + '&y=&plot=short&r=json&tomatoes=true', function (error, response, body) {\n // If the request is successful (i.e. if the response status code is 200)\n\t\n\tif (!error && response.statusCode == 200) {\n\t\t\n\t\t// Parse the body of the site and recover just the imdbRating\n\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it). \n\t\tconsole.log( \"The movie title: \" + JSON.parse(body)[\"Title\"] +\n\t\t\t\"\\nThe movie release year: \" + JSON.parse(body)[\"Year\"] +\n\t\t\t\"\\nThe movie imdb rating: \" +JSON.parse(body)[\"imdbRating\"] +\n\t\t\t\"\\nThe movie Country of origin: \" +JSON.parse(body)[\"Country\"] +\n\t\t\t\"\\nThe movie language: \" +JSON.parse(body)[\"Language\"] +\n\t\t\t\"\\nThe movie plot: \" +JSON.parse(body)[\"Plot\"] +\n\t\t\t\"\\nThe movie actors: \" +JSON.parse(body)[\"Actors\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes score: \" +JSON.parse(body)[\"tomatoMeter\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes url: \" +JSON.parse(body)[\"tomatoURL\"]);\n\t\t}\n\t});\n}", "function movie() {\n\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + userInput + \"&y=&plot=short&apikey=40e9cece\";\n\n //console.log(queryUrl);\n\n request(queryUrl, function(error, response, body) {\n\n //console.log(response);\n if (error) throw error;\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n // console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).Year); --doesnt have it\n }\n });\n}", "function movieThis(movie) {\n // if no argument entered, default argument\n if (!argument) {\n movie = \"Mr. Nobody\";\n }\n // search ombd API movie with movie\n axios\n .get(`https://www.omdbapi.com/?t=${movie}&apikey=trilogy`)\n // function to console log response when data is received\n .then(function(response) {\n console.log(\"\\n------------------------------------------\");\n console.log(`Movie Title: ${response.data.Title}`);\n console.log(`Year Released: ${response.data.Year}`);\n console.log(`Actors: ${response.data.Actors}`);\n console.log(`IMBD Rating: ${response.data.imdbRating}`);\n console.log(`Rotten Tomatoes Rating: ${response.data.Ratings[1].Value}`);\n console.log(`Produced in: ${response.data.Country}`);\n console.log(`Language: ${response.data.Language}`);\n console.log(`Plot: ${response.data.Plot}`);\n console.log(\"\\n\");\n })\n // if error, console logs error message\n .catch(function(err) {\n console.error(err);\n })\n}", "function moviethis(){\n var movieName = '';\n var theArg = process.argv;\n \n if(input===undefined){\n // if no movie name is entered\n movieName = 'Mr.'+\"+\"+\"Nobody\"; \n } else {\n // otherwise this captures movie names with 1 or more words\n for(i=3; i<theArg.length; i++){\n movieName += theArg[i]+\"+\";\n }\n \n }\n \n //run axios using OMDB API\n var url = \"http://www.omdbapi.com/?t=\"+movieName+\"&y=&plot=short&apikey=trilogy\";\n axios.get(url)\n .then(\n function(response) { \n console.log(\"Title: \"+response.data.Title);\n console.log(\"Release Year: \"+response.data.Year);\n console.log(\"IMDB Rating: \"+response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \"+response.data.Ratings[0].Value);\n console.log(\"Country Produced: \"+response.data.Country);\n console.log(\"Language: \"+response.data.Language);\n console.log(\"Plot: \"+response.data.Plot);\n console.log(\"Actors :\"+response.data.Actors);\n }\n );\n }", "async function getMovieInfo(id) {\n let response = await fetch('https://swapi.dev/api/films/');\n let json = await response.json();\n let selectedFilm;\n json.results.forEach((film) => {\n if (film.episode_id == id) {\n selectedFilm = {\n name: film.title,\n episodeID: film.episode_id,\n characters: film.characters,\n };\n }\n });\n return selectedFilm;\n}", "function movieThis() {\n console.log('===========================================');\n console.log(\"Netflix and Chill....?\");\n // console.log(\"Pizza and a fuck?.....WHAT???.....you dont like pizza?\")\n var searchMovie;\n // use undefined for default search!\n if (arguTwo === undefined) {\n searchMovie = \"Mr. Nobody\";\n } else {\n searchMovie = arguTwo;\n };\n // add tomatoes url and json format // request required here\n var movieUrl = 'http://www.omdbapi.com/?t=' + searchMovie + '&y=&plot=long&tomatoes=true&r=json';\n request(movieUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n \n\n var movieData = JSON.parse(body)\n\n console.log('================ Movie Info ================');\n console.log('Title: ' + movieData.Title);\n console.log('Year: ' + movieData.Year);\n console.log('IMDB Rating: ' + movieData.imdbRating);\n console.log('Country: ' + movieData.Country);\n console.log('Language: ' + movieData.Language);\n console.log('Plot: ' + movieData.Plot);\n console.log('Actors: ' + movieData.Actors);\n console.log('Rotten Tomatoes Rating: ' + movieData.tomatoRating); //notworkings\n console.log('Rotten Tomatoes URL: ' + movieData.tomatoURL);\n console.log('===========================================');\n }\n });\n}", "function getMovieInfo() {\n // if no movie entered, default to \"Mr. Nobody\"\n if (userQuery === undefined) {\n userQuery = \"Mr. Nobody\";\n }\n\n axios.get(`http://www.omdbapi.com/?t=${userQuery}&y=&plot=short&apikey=trilogy`)\n .then(function (response) {\n displayMovieInfo(response)\n })\n}", "function movieCommand() {\n\tvar inputMovie = process.argv[3];\n\tif(!inputMovie){\n\t\tinputMovie = \"Mr. Nobody\"; //default movie INPUT\n\t}\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + inputMovie + \"&y=&plot=short&&apikey=40e9cece&r=json&tomatoes=true\";\n\n\trequest(queryUrl, function(error, response, body) {\n \n \tif (!error && response.statusCode) {\n \tvar movieData = JSON.parse(body);\n \tvar movieInfo = \n\t\t\t\"\\r\\n\" +\n \"Title: \" + movieData.Title + \"\\r\\n\" +\n \"Year: \" + movieData.Year + \"\\r\\n\" +\n \"IMDB Rating: \" + movieData.imdbRating + \"\\r\\n\" +\n \"Country: \" + movieData.Country + \"\\r\\n\" +\n \"Language: \" + movieData.Language + \"\\r\\n\" +\n \"Plot: \" + movieData.Plot + \"\\r\\n\" +\n \"Actors: \" + movieData.Actors + \"\\r\\n\" +\n \"Rotten Tomatoes URL: \" + movieData.tomatoURL + \"\\r\\n\";\n console.log(movieInfo);\n log(movieInfo);\n \t}\t\n});\n}", "function MovieSearch(movie) {\n request(omdb.url + movie, function (error, response, body) {\n if (error) {\n console.log('error:', error);\n console.log('statusCode:', response && response.statusCode);\n }\n //Convert string to JSON object\n var data = JSON.parse(body)\n //Desired properties to log\n var properties = [data.Title, data.Year, data.Rated, data.Ratings[1].Value,\n data.Country, data.Language, data.Plot, data.Actors\n ];\n //Property text (aesthetics)\n var text = ['Title: ', 'Year: ', 'Rated: ', 'Rotten Tomatoes: ',\n 'Country: ', 'Language: ', 'Plot: ', 'Actors: '\n ];\n //Log results\n for (var i = 0; i < properties.length; i++) {\n console.log(text[i], properties[i]);\n }\n });\n}", "function movieThis(movie){\n //console.log(\"Movie This\");\n\n if (movie === undefined){\n movie = \"Mr. Nobody\";\n }\n //else movie = inputs[3];\n\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&apikey=\" + omdb).then(\n results => {\n //console.log(results.data);\n console.log(\"Title: \" + results.data[\"Title\"]);\n console.log(\"Year: \" + results.data[\"Year\"]);\n //console.log(\"IMDB Rating: \" + results.data[\"Ratings\"][0][\"Value\"]);\n console.log(\"IMDB Rating: \" + results.data[\"imdbRating\"]);\n console.log(\"Rotten Tomatoes Rating: \" + results.data[\"Ratings\"][1][\"Value\"]);\n console.log(\"Country: \" + results.data[\"Country\"]);\n console.log(\"Language: \" + results.data[\"Language\"]);\n console.log(\"Plot: \" + results.data[\"Plot\"]);\n console.log(\"Actors: \" + results.data[\"Actors\"]);\n },\n err => {\n console.log(err);\n }\n );\n}", "function getMovie(title) {\n var year;\n var rating;\n var country;\n var language;\n var plot;\n var actors;\n var rottenTomatoesRating;\n var rottentomatoesURL;\n if (title) {\n var titleParam = title;\n } else {\n var titleParam = \"Mr. Nobody\";\n }\n // /assugning request url using that title\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + titleParam + '&tomatoes=true&r=json';\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(response);\n rBody = JSON.parse(body);\n // rJson = JSON.parse(response);\n titleParam = rBody['Title'];\n year = rBody['Year'];\n rating = rBody['Rated'];\n country = rBody['Country'];\n language = rBody['Language'];\n plot = rBody['Plot'];\n actors = rBody['Actors'];\n rottenTomatoesRating = rBody['tomatoRating'];\n rottentomatoesURL = rBody['tomatoURL'];\n\n console.log('the title is ', titleParam);\n console.log('the year is ', year);\n console.log('the rating is ', rating);\n console.log('the country is ', country);\n console.log('the language is', language);\n console.log('the plot is', plot);\n console.log('the actors are', actors);\n console.log('the Rotten Tomatoes Ratings are', rottenTomatoesRating);\n console.log('the Rotten Tomatoes URL is', rottentomatoesURL);\n // console.log(rBody);\n // console.log(response);\n // console.log(rJson);\n }\n // else {\n // request('http://www.omdbapi.com/?t=remember+the+titans&y=&plot=short&r=json', function (error, response, body) { \n // console.log(response);\n // })\n // }\n })// body...\n\n}", "function fetchMovie() {\n axi.get(\"/api/v1\").then(r => setMovie(r.data.movie));\n }", "function movie(){\n\n /**You can follow the in-class request exercise for this**/\n console.log(\"Movie Time!\");\n\n var movieSearch;\n if(search === undefined){\n movieSearch = \"Sharknado\";\n }\n else{\n movieSearch = search;\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieSearch + \"&y=&plot=short&apikey=40e9cece\";\n console.log(\"movie time?\");\n request((queryUrl), function(error,response,body){\n console.log(\"got hear\");\n if(!error && response.statusCode === 200){\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors & Actresses: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n }\n });\n}", "function loadMovieDescription(pos) {\n $('.movie-plot').text(movies[pos].summary);\n // $('#moviegenres').text(movies[pos].Genres);\n //$('#moviedirector').text(movies[pos].director);\n $('.movie-cast').text(movies[pos].cast);\n $(\".movie_img\").show();\n}", "function movieInfo(input) {\n \n if(!input){\n // If no input data has been entered... default to Mr. Nobody\n axios.get(\"http://www.omdbapi.com/?t=Mr.+Nobody&apikey=trilogy\").then(function(response){\n // log(response.data); \n\n // Stores data from the omdb API \n var movieSearch = \n title_3(\"\\n -\") + titleCommand(\"| MOVIE-THIS |\") + title_3(\"-----------------------------------------------------------------------------------------------------------\\n\") +\n title_3(\"\\n If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\" + titleCommand.underline(\"\\n\" + \"\\n _____It's on Netflix!_____\\n\")) +\n title_3(\"\\n * Movie Title: \") + bodyText(response.data.Title) +\n title_3(\"\\n * Plot: \") + bodyText(response.data.Plot) + \n title_3(\"\\n\" + \"\\n * Actors: \") + bodyText(response.data.Actors) + \n title_3(\"\\n * IMDB Rating: \") + bodyText(response.data.imdbRating) +\n title_3(\"\\n * Rotten Tomatoes Rating: \") + bodyText(response.data.Ratings[1].Value) +\n title_3(\"\\n * Release Date: \") + bodyText(response.data.Released) + \n title_3(\"\\n * Language(s): \") + bodyText(response.data.Language) + \n title_3(\"\\n * Production Location(s): \") + bodyText(response.data.Country) + \"\\n\" +\n title_3(\"\\n--------------------------------------------------------------------------------------------------------------------------\\n\");\n\n // Logs and separates the movie data colorfully with Chalk\n log(wrapAnsi(movieSearch, 124));\n\n // Stores data from the omdb API \n var movieSearch_log = \n \"\\n -| MOVIE-THIS |-------------------------------------------------------------------------------------------------------------\\n\" +\n \"\\n If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\" + \"\\n\" + \"\\n It's on Netflix!\\n\" +\n \"\\n * Movie Title: \" + response.data.Title +\n \"\\n * Plot: \" + response.data.Plot + \n \"\\n\" + \"\\n * Actors: \" + response.data.Actors + \n \"\\n * IMDB Rating: \" + response.data.imdbRating +\n \"\\n * Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\n * Release Date: \" + response.data.Released + \n \"\\n * Language(s): \" + response.data.Language + \n \"\\n * Production Location(s): \" + response.data.Country + \"\\n\" +\n \"\\n-----------------------------------------------------------------------------------------------------------------------------\\n\";\n \n // Appends the movie's information to the log.txt file \n fs.appendFileSync(\"log.txt\", movieSearch_log, (err) => {\n if (err) throw err;\n });\n })\n \n } else {\n // If input data is entered... run the following code \n axios.get(\"http://www.omdbapi.com/?t=\" + input + \"&apikey=trilogy\").then(function(response){\n // log(response.data); \n\n // Stores data from the omdb API - this variable will appear in the terminal\n var movieSearch = \n title_3(\"\\n -\") + titleCommand(\"| MOVIE-THIS |\") + title_3(\"-----------------------------------------------------------------------------------------------------------\\n\") +\n title_3(\"\\n * Movie Title: \") + bodyText(response.data.Title) +\n title_3(\"\\n * Plot: \") + bodyText(response.data.Plot) + \n title_3(\"\\n\" + \"\\n * Actors: \") + bodyText(response.data.Actors) + \n title_3(\"\\n * IMDB Rating: \") + bodyText(response.data.imdbRating) +\n title_3(\"\\n * Rotten Tomatoes Rating: \") + bodyText(response.data.Ratings[1].Value) +\n title_3(\"\\n * Release Date: \") + bodyText(response.data.Released) + \n title_3(\"\\n * Language(s): \") + bodyText(response.data.Language) + \n title_3(\"\\n * Production Location(s): \") + bodyText(response.data.Country) + \"\\n\" + \n title_3(\"\\n---------------------------------------------------------------------------------------------------------------------------\\n\");\n \n // Stores data from the omdb API - this variable will appear in the lox.txt file\n var movieSearch_log = \n \"\\n -| MOVIE-THIS |-------------------------------------------------------------------------------------------------------------\\n\" +\n \"\\n * Movie Title: \" + response.data.Title +\n \"\\n * Plot: \" + response.data.Plot + \n \"\\n\" + \"\\n * Actors: \" + response.data.Actors + \n \"\\n * IMDB Rating: \" + response.data.imdbRating +\n \"\\n * Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\n * Release Date: \" + response.data.Released + \n \"\\n * Language(s): \" + response.data.Language + \n \"\\n * Production Location(s): \" + response.data.Country + \"\\n\" + \n \"\\n-----------------------------------------------------------------------------------------------------------------------------\\n\";\n \n // Logs and separates the movie data colorfully with Chalk\n log(wrapAnsi(movieSearch, 124));\n\n // Appends the movie's information to the log.txt file \n fs.appendFileSync(\"log.txt\", movieSearch_log, (err) => {\n // throws an error, you could also catch it here\n if (err) throw err;\n \n });\n\n })\n\n .catch(function(err) {\n log(err);\n });\n \n } \n }", "function displayMovieInfo() {\n\n // YOUR CODE GOES HERE!!! HINT: You will need to create a new div to hold the JSON.\n\n }", "function movieDetails(imdbId, cb) {\n request(`http://www.omdbapi.com/?apikey=${omdbKey}&i=${imdbId}&plot=full&r=json`, function (error, response, body) {\n\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n return cb(JSON.parse(body));\n }\n\n });\n }", "function showMovie(response) {\n let movie = response;\n\n //neki filmovi/serije imaju vise rezisera, glumaca i zanrova i da bi ljepse mogli da ih prikazemo na stranici od stringa koji dobijemo napravimo niz elemenata\n var str = movie.Actors;\n var str2 = movie.Director;\n var str3 = movie.Genre;\n\n var stars = str.split(\", \");\n var directors = str2.split(\", \");\n var genres = str3.split(\", \");\n\n //ukoliko nemamo podatke o slici prikazemo default sliku iz foldera\n if (movie.Poster == \"N/A\") {\n movie.Poster = \"./Images/default.jpg\";\n }\n\n //prikazujemo redom podatke\n $(\"#movie-title-name\").append(movie.Title + ' <span id=\"movie-year\"></span>');\n $(\"#movie-year\").append(movie.Year);\n\n //ukoliko IMDb ocjene nisu dostupne, prikazemo odgovarajucu poruku\n if (movie.imdbRating === 'N/A') {\n $(\"#movie-rating\").append('<span>Ratings are not available<span>');\n } else {\n $(\"#movie-rating\").append(movie.imdbRating + '/10 <span>' + movie.imdbVotes + ' votes </span>');\n }\n\n $(\"#img\").append('<img src=' + movie.Poster + ' alt=\"\">');\n\n if (movie.Plot === 'N/A') {\n $('#movie-description').append('Plot is not available at this moment. :)');\n } else {\n $('#movie-description').append(movie.Plot);\n }\n\n directors.forEach(director => {\n $('#movie-director').append('<p>' + director + '</p>');\n });\n\n stars.forEach(star => {\n $('#movie-stars').append('<p>' + star + '</p>');\n });\n\n genres.forEach(genre => {\n $('#movie-genre').append('<p>' + genre + '</p>');\n });\n\n $('#movie-released').append(movie.Released);\n $('#movie-runtime').append(movie.Runtime);\n\n //ukoliko je Type -> serija onda prikazemo ukupan broj sezona \n //prikazemo i select sa svim sezonama te serije gdje na klik mozemo prikazati sve epizode odredjene sezone\n //po defaultu je selectovana poslednja sezona serije, kako bi odmah pri ulasku u seriju imali izlistane epizode \n if (movie.Type == 'series') {\n $('#movie-seasons').append('<h3>Seasons:</h3><p>' + movie.totalSeasons + '</p>');\n\n $('#series-season').append(\n '<p class=\"heading-des\">Episodes> ' +\n '<select onchange=\"getSeason(\\'' + movie.Title + '\\')\" id=\"select-episodes\">' +\n '</select>' +\n '</p>' +\n '<hr class=\"about\">' +\n '<div class=\"description\">' +\n '<div id=\"episodes\">' +\n '</div>' +\n '</div>'\n )\n }\n\n $('#movie-cast').append(\n '<p>Director: ' + movie.Director + '</p>' +\n '<p>Writer: ' + movie.Writer + '</p>' +\n '<p>Stars: ' + movie.Actors + '</p>'\n )\n\n if (movie.Ratings.length == 0) {\n $('#movie-reviews').append('<p>Ratings are not available at this moment. :)</p>')\n } else {\n movie.Ratings.forEach(rating => {\n $('#movie-reviews').append('<p>' + rating.Source + ' --> ' + rating.Value + '</p>')\n });\n }\n\n if (movie.Awards === 'N/A') {\n $('#movie-awards').append('Awards are not available at this moment. :)');\n } else {\n $('#movie-awards').append(movie.Awards);\n }\n\n $('#movie-imdb-btn').append(\n '<button onClick=\"openImdbPage(\\'' + movie.imdbID + '\\')\" class=\"btn-imdb\">' +\n '<i class=\"fab fa-imdb\"></i> IMDb' +\n '</button>'\n )\n\n //za ukupan broj sezona serije ispunimo select sa tolikim brojem opcija\n for (i = 1; i <= movie.totalSeasons; i++) {\n $('#select-episodes').append(\n '<option selected=\"selected\" value=\"\\'' + i + '\\'\">Season ' + i + '</option>'\n )\n }\n\n if (movie.Type === \"series\") {\n\n //prikazemo sve epizode selektovane sezone\n getSeason(movie.Title);\n\n }\n\n //ukoliko smo otvorili epizodu prikazemo na stranici na kojoj smo epizodi i sezoni \n //i prikazemo dugme za povratak na seriju\n if (movie.Type === \"episode\") {\n $(\"#episode-details\").append(\n '<span class=\"episode-span\">Season ' + movie.Season + ' </span>' +\n '<span class=\"season-span\">Episode ' + movie.Episode + '</span>'\n )\n $(\"#button-tvshow\").append(\n '<button onClick=\"openMovie(\\'' + movie.seriesID + '\\')\" class=\"btn-search\">' +\n '<i class=\"fas fa-chevron-left\"></i>' +\n ' Back to TV Show' +\n '</button>'\n )\n }\n}", "function movies(input) {\n\n var movieTitle;\n if (input === undefined) {\n movieTitle = \"Cool Runnings\";\n } else {\n movieTitle = input;\n };\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=b41b7cf6\";\n\n request(queryURL, function (err, res, body) {\n var bodyOf = JSON.parse(body);\n if (!err && res.statusCode === 200) {\n logged(\"\\n---------\\n\");\n logged(\"Title: \" + bodyOf.Title);\n logged(\"Release Year: \" + bodyOf.Year);\n logged(\"Actors: \" + bodyOf.Actors);\n logged(\"IMDB Rating: \" + bodyOf.imdbRating);\n logged(\"Rotten Tomatoes Rating: \" + bodyOf.Ratings[1].Value);\n logged(\"Plot: \" + bodyOf.Plot);\n logged(\"\\n---------\\n\");\n }\n });\n}", "function getOMDB(movieName) {\n request('http://www.omdbapi.com/?t=' + movieName + '&r=json&apikey=trilogy&', function (error, response, body) {\n if (error) {\n return console.log('Error occurred: ' + error);\n }\n var data = JSON.parse(body);\n console.log('Movie Title:', data.Title);\n console.log('Year Released:', data.Year);\n console.log('IMDB Rating:', data.Ratings[0].Value);\n console.log('Rotten Tomatoes Rating:', data.Ratings[1].Value);\n console.log('Country:', data.Country);\n console.log('Language:', data.Language);\n console.log('Plot:', data.Plot);\n console.log('Actors:', data.Actors);\n });\n}", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "function getMovie(title) {\n return $.getJSON('https://omdbapi.com?t={title}&apikey=thewdb');\n}", "function movieThis() {\n\n\t// if user enters a value - process.argv[3]\n\n\tif (value) {\n\n\t \t// Create an empty variable for holding the movie name\n\n\t\tvar movieName = \"\";\n\n\t} // end of if no movie title was entered\n\n\t// else no movie title was entered search Mr. Nobody\n\n\telse {\n\n\t\tmovieName = \"Mr. Nobody\";\n\n\t} // end of else\n\n\t// Change any \" \" to + in the movie title\n\n\tfor (var i = 3; i < nodeArgs.length; i++){\n\n\t\t// if the movie has more than one word\n\n\t if (i > 3 && i < nodeArgs.length){\n\n\t movieName = movieName + \"+\" + nodeArgs[i];\n\n\t } // end of if there are spaces\n\n\t // the first word of the movie title\n\n\t else {\n\n\t movieName = movieName + nodeArgs[i];\n\n\t } // end of else\n\n\t} // end of for loop\n\n\t// OMDB API request \n\n\tvar queryUrl = 'http://www.omdbapi.com/?t=' + movieName +'&tomatoes=true';\n\n\trequest(queryUrl, function (error, response, body) {\n\n\t // If the request is successful \n\n\t if (!error && response.statusCode == 200) {\n\n\t // Parse the body of the site so that we can pull different keys more easily\n\t \n\t body = JSON.parse(body);\n\t console.log(\"Title: \" + body.Title);\n\t console.log(\"Year: \" + body.Year);\n\t console.log(\"IMDB Rating: \" + body.imdbRating);\n\t console.log(\"Country: \" + body.Country);\n\t console.log(\"Language: \" + body.Language);\n\t console.log(\"Plot: \" + body.Plot);\n\t console.log(\"Actors: \" + body.Actors);\n\t console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n\t console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n\n\t // store information as a string\n\n\t\t\tlogText = JSON.stringify({\n\t\t\t\ttitle: body.Title,\n\t\t\t\tyear: body.Year,\n\t\t\t\timdbRating: body.imdbRating,\n\t\t\t\tcountry: body.Country,\n\t\t\t\tlanguage: body.Language,\n\t\t\t\tplot: body.Plot,\n\t\t\t\tactors: body.Actors,\n\t\t\t\trottenRating: body.tomatoRating,\n\t\t\t\trottenURL: body.tomatoURL\n\t\t\t}); // end of logText stringify\n\n\t\t\t// log information in logText in log.txt\n\n\t\t\tlogInfo();\n\n\t \n\t } // end of if the request is successful\n\t}); // end of request\n\n} // end of movie-this function", "function movieThis() {\n\t//takes in user input for movie title\n\tvar movieTitle = input;\n\n\t// if no movie is provided, the program will default to \"mr. nobody\"\n\tif (input === \"\") {\n\t\tmovieTitle = \"Mr. Nobody\";\n\t}\n\n\t// variable for the OMDb API call\n\tvar OMDb = \"http://omdbapi.com?t=\" + movieTitle + \"&r=json&tomatoes=true\";\n\n\t// this takes in the movie request and searches for it in OMDb via request\n\trequest(OMDb, function (err, response, body) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Error: \" + err);\n\t\t\treturn;\n\t\t}\n\t\telse if (response.statusCode === 200) {\n\t\t\tvar movie = JSON.parse(body);\n\t\t\tvar movieData = \"\";\n\n\t\t\tvar title = \"\\n\" + \"Movie Title: \" + movie.Title + \"\\n\";\n\t\t\tmovieData += title;\t\n\n\t\t\tvar year = \"\\n\" + \"Year Released: \" + movie.Year + \"\\n\";\n\t\t\tmovieData += year;\n\n\t\t\tvar rating = \"\\n\" + \"IMDB Rating: \" + movie.imdbRating + \"\\n\";\n\t\t\tmovieData += rating;\t\n\n\t\t\tvar country = \"\\n\" + \"Country: \" + movie.Country + \"\\n\";\n\t\t\tmovieData += country;\n\n\t\t\tvar language = \"\\n\" + \"Language: \" + movie.Language + \"\\n\";\n\t\t\tmovieData += language;\n\n\t\t\tvar plot = \"\\n\" + \"Movie Plot: \" + movie.Plot + \"\\n\";\n\t\t\tmovieData += plot;\t\n\n\t\t\tvar actors = \"\\n\" + \"Actors: \" + movie.Actors + \"\\n\";\n\t\t\tmovieData += actors;\n\n\t\t\tvar tomatoMeter = \"\\n\" + \"Rotten Tomato Rating: \" + movie.tomatoUserMeter + \"\\n\";\n\t\t\tmovieData += tomatoMeter;\n\n\t\t\tvar tomatoURL = \"\\n\" + \"Rotten Tomato Rating Link: \" + movie.tomatoURL + \"\\n\";\n\t\t\tmovieData += tomatoURL;\n\n\t\t\tconsole.log(\"\\n\" + \"OMDb:\");\n\t\t\tconsole.log(movieData);\n\t\t\tdataLog(movieData);\t\t\t\t\t\t\t\n\t\t}\n\t});\n}", "async function getMovie(){\n const movie = movieInput.value\n const movieUrl = `https://api.themoviedb.org/3/search/movie?api_key=${apiKey}&query=${movie}`;\n try{\n const response = await fetch(movieUrl);\n if(response.ok){\n const jsonResponse = await response.json();\n const topResult = jsonResponse.results[0];\n console.log(topResult);\n // render the description of the top result\n renderDescription(topResult);\n // get hero section movie title\n renderHeroMovieTitle(topResult);\n // ger the average vote for movie\n renderHeroMovieStars(topResult);\n // get the image of the top result\n getMovieImages(topResult);\n // get the trailer for the movie\n getMovieTrailer(topResult);\n // get the general info about a movie - for genres\n getMovieInfo(topResult);\n }\n }catch(error){\n console.log(error);\n }\n}", "async function getMoviesInfos(movieID) {\n const extraInfos = [];\n // const urlBase = \"http://localhost:8000/api/v1/titles/\";\n // alert(movieID);\n const url = `http://localhost:8000/api/v1/titles/${movieID}`;\n const response = await fetch(url);\n // alert(apiURL);\n const data = await response.json();\n console.log(data);\n return data;\n}", "function getMovieContent() {\n\tvar queryURL = 'https://www.omdbapi.com/?t=' + searchTerm + '&y=&plot=short&apikey=trilogy';\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tvar movieRatingLong = response.Ratings[0].Value;\n\t\tvar movieRatingDouble = movieRatingLong.substr(0, 3);\n\t\tvar movieRatingUnround = movieRatingDouble / 2;\n\t\tmovieRating = Math.round(movieRatingUnround * 10) / 10;\n\t\tvar moviePosterUrl = response.Poster;\n\t\tmoviePoster = $('<img>');\n\t\tmoviePoster.attr('id', 'movieposterThumbnail');\n\t\tmoviePoster.attr('src', moviePosterUrl);\n\t\tmoviePlot = response.Plot;\n\t\tmovieTitle = response.Title;\n\t\tsetContent();\n\t});\n}", "function movieThis (movie) {\n\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=\" + omdb.key;\n\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var info = JSON.parse(body);\n console.log(\"\");\n console.log(('***** \"' + info.Title + '\" *****').inverse);\n console.log(\"Released in \" + info.Year);\n console.log(\"IMDB \" + info.Ratings[0].Value);\n console.log(\"Rotten Tomatoes \" + info.Ratings[1].Value);\n console.log(\"Produced in \" + info.Country);\n console.log(\"Language: \" + info.Language);\n console.log(\"Plot: \" + info.Plot);\n console.log(\"Actors: \" + info.Actors);\n console.log(\"\");\n console.log(\"**************************************\");\n console.log(\"\");\n // Append every full return to the log.txt file.\n fs.appendFile(\"log.txt\", \"\\n\" + '***** \"' + info.Title + '\" *****' + \"\\nReleased in \" + info.Year + \"\\nIMDB \" + info.Ratings[0].value + \"\\nRotten Tomatoes \" + info.Ratings[1].Value + \"\\nProduced in \" + info.Country + \"\\nLanguage: \" + info.Language + \"\\nPlot: \" + info.Plot + \"\\nActors: \" + info.Actors + \"\\n\", function(error) {\n if (error) {\n console.log(error);\n };\n });\n } else {\n console.log('An error occurred: ' + error);\n }\n })\n}", "function movie() {\n\n var args = process.argv;\n var movieName = \"\";\n\n for (i = 3; i < args.length; i++) {\n if (i > 3 && i < args.length) {\n movieName = movieName + \"+\" + args[i];\n } else {\n movieName = args[i];\n }\n };\n\n if (movieName === \"\") {\n movieName = \"Mr.\" + \"+\" + \"Nobody\"\n };\n\n //run a request to the OMDB API with the specified movie\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"-------------------------------------------------------------------------------------------\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n console.log(\"-------------------------------------------------------------------------------------------\");\n } else {\n console.log(\"ya' messed up\");\n }\n });\n}", "function movieThis() {\n var movieName = \"\";\n\n //move over all of the entered words to \n for (var i = 3; i < input.length; i++) {\n if (i > 3 && i < input.length) {\n movieName = movieName + \"+\" + input[i];\n } else {\n movieName += input[i];\n }\n }\n if (movieName === \"\") {\n movieName = \"Mr. Nobody\";\n }\n\n var movieQueryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=plot=short&apikey=trilogy\" + omdb;\n\n //npm call and arrangement of data into information.\n request(movieQueryURL, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var movieData = JSON.parse(body);\n console.log(\"Title: \" + movieData.Title + \"\\nRelease Year: \" + movieData.Year);\n\n for (var i = 0; i < movieData.Ratings.length; i++) {\n console.log(\"Rating: \" + movieData.Ratings[i].Source + \" \" + movieData.Ratings[i].Value)\n }\n console.log(\"Country Produced: \" + movieData.Country + \"\\nLanguage: \" + movieData.Language +\n \"\\nActors: \" + movieData.Actors + \"\\nPlot: \" + movieData.Plot);\n } else {\n return console.log(error);\n }\n });\n}", "function getMovie(){\n\tspinner.style.display = \"block\";\n\tsetTimeout(() => {\n\t\tspinner.style.display = \"none\";\n\t\tcontainer.style.display = \"block\";\n\t}, 1000);\n\n\tlet movieId = sessionStorage.getItem(\"movieId\");\n\n\tfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'?api_key='+API_KEY+'&language=es-ES')\n\t\t.then(function(response) {\n\t\t\treturn response.json()\n\t\t})\n\t\t.then(function(movieInfoResponse) {\n\t\t\tfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/credits?api_key='+API_KEY)\n\t\t\t\t.then(function(response2) {\n\t\t\t\t\treturn response2.json()\n\t\t\t\t})\n\t\t\t\t.then(function(movieCastResponse) {\n\n\t\t\t\t\tconst movie = movieInfoResponse;\n\t\t\t\t\tconst cast = movieCastResponse.cast;\n\t\t\t\t\tconst genres = movieInfoResponse.genres;\n\t\t\t\t\tcast.length = 5;\n\n\t\t\t\t\t//Redondea el numero de popularidad de la pelicula\n\t\t\t\t\tpopularity = movieInfoResponse.popularity;\n\t\t\t\t\tpopularity = Math.floor(popularity)\n\n\n\t\t\t\t\tlet revenue = movieInfoResponse.revenue;\n\t\t\t\t\trevenue = new Intl.NumberFormat('de-DE', {style: 'currency', currency: 'EUR'}).format(revenue);\n\n\t\t\t\t\tlet output = `\n\t\t\t\t\t<div class=\"moviePage\">\n\t\t\t\t\t<div class=\"poster\"><img src=\"http://image.tmdb.org/t/p/w300/${movie.poster_path}\"></div>\n\t\t\t\t\t<div class=\"info\">\n\t\t\t\t\t\t<h2>${movie.title}</h2>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li><strong>Elenco:</strong> `;\n\t\t\t\t\t\t\tfor (let i = 0; i < cast.length; i++) {\n\t\t\t\t\t\t\t\tif (i != cast.length - 1) {\n\t\t\t\t\t\t\t\t\toutput += `${cast[i].name}, `;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toutput += `${cast[i].name}.`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toutput += `</li>\n\t\t\t\t\t\t\t<li><strong>Genros:</strong> `;\n\t\t\t\t\t\t\tfor(let i = 0; i < genres.length; i++){\n\t\t\t\t\t\t\t\tif ( i != genres.length -1){\n\t\t\t\t\t\t\t\t\toutput += `${genres[i].name}, `;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toutput += `${genres[i].name}.`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toutput += `<ul>\n\t\t\t\t\t\t\t\t<li><strong>estreno:</strong> ${movie.release_date}</li>\n\t\t\t\t\t\t\t\t<li><strong>duracion:</strong> ${movie.runtime} (min)</li>\n\t\t\t\t\t\t\t\t<li><strong>Rating:</strong> ${movie.vote_average} / 10 <span id=\"smallText\">(${movie.vote_count} votes)</span></li>\n\t\t\t\t\t\t\t\t<li><strong>recaudacion:</strong> ${revenue}</li>\n\t\t\t\t\t\t\t\t<li><strong>estado:</strong> ${movie.status}</li>\n\t\t\t\t\t\t\t\t<li><strong>Productora:</strong> ${movie.production_companies[0].name}</li>\n\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"plot\">\n\t\t\t\t\t\t<h3>resumen</h3>\n\t\t\t\t\t\t<p>${movie.overview}</p>\n\t\t\t\t\t</div>`;\n\n\n\t\t\t\t\tconst info = document.getElementById(\"movie\");\n\t\t\t\t\tinfo.innerHTML = output;\n\t\t\t\t})\n\t\t})\n\n\nfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/videos?api_key='+API_KEY+'&language=es-ES')\n.then(function(response) {\n\treturn response.json();\n})\n.then(function(response) {\n\n let movie = response.results;\n\tlet trailer = response.results;\n\n\t// Se muestra un trailer distinto cada vez\n\tlet min = 0;\n\t// -1 so it takes into account if theres only 1 item in the trailer length( at position 0).\n\tlet max = trailer.length - 1;\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\tlet trailerNumber = Math.floor(Math.random() * (max-min +1)) + min;\n\n\tlet output = `\n\t\t<div class=\"video\">\n\t\t<iframe width=\"620\" height=\"400\" src=\"https://www.youtube.com/embed/${trailer[trailerNumber].key}\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen></iframe>\n\t\t</div>`;\n\t// Muestra el trailer\n\tlet video = document.getElementById(\"trailer\");\n\tvideo.innerHTML = output;\n})\n// recomendaciones\nfetch(\"https://api.themoviedb.org/3/movie/\"+movieId+'/recommendations?api_key='+API_KEY+'&language=es-ES&page=1')\n .then(function(response) {\n return response.json();\n })\n .then(function(response) {\n\n\t\tconst movie = response.results;\n\t\t//Set the movie length (output) to 4.\n\t\tmovie.length = 4;\n\t\tlet output = \"\";\n\t\tfor(let i = 0; i < movie.length; i++){\nlet favoriteMovies = JSON.parse(localStorage.getItem(\"favoriteMovies\")) || [];\n\t\t\toutput += `\n\t\t\t<div class=\"peliculas\">\n\t\t\t\t<div class=\"overlay\">\n\t\t\t\t<div class=\"movie\">\n\t\t\t\t\t<h2>${movie[i].title}</h2>\n\t\t\t\t\t\t<p><strong>Release date:</strong> <span>${movie[i].release_date} <i class=\"material-icons date\">date_range</i> </span></p>\n\t\t\t\t\t\t\t<a onclick=\"movieSelected('${movie[i].id}')\" >Detalles</a>\n\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"peliculas_img\">\n\t\t\t\t\t<img src=\"http://image.tmdb.org/t/p/w400/${movie[i].poster_path}\" onerror=\"this.onerror=null;this.src='../images/imageNotFound.png';\">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t`;\n\t\t}\n\n\t\tlet recommended = document.getElementById(\"recommended\");\n\t\trecommended.innerHTML = output;\n\n\t\tdocument.getElementById(\"prev\").style.display = \"none\";\n\t})\n\n\t.catch ((err)=>{\n\t\tlet recommended = document.getElementById(\"recommended\");\n\n\t\t `<div class=\"recommendations_error\">\n\t\t\t<h3>Perdon! </h3>\n\t\t\t<br>\n\t\t\t<p>No hay recomendacones</p>\n\t\t </div>`;\n\t})\n}", "function getMovieDetail(imdbid) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&i=\" + imdbid)\n .then((response) => response.json())\n .then((result) => result);\n}", "function getOMDBInfo(randomMovie) {\n axios.get('https://www.omdbapi.com?t=' + randomMovie + '&apikey=6753c87c')\n .then((response) => {\n let movie = response.data;\n let output = `\n <div class=\"moviedscrpt\">\n <div class=\"centerbox\">\n <img src=\"${movie.Poster}\" class=\"thumbnail\">\n <h2 style = \"color: white;\">${movie.Title}</h2>\n </div>\n <ul class=\"list-group\">\n <li class=\"list-group-item\"><strong>Genre:</strong> ${movie.Genre}</li>\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.Released}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.Rated}</li>\n <li class=\"list-group-item\"><strong>IMDB Rating:</strong> ${movie.imdbRating}</li>\n <li class=\"list-group-item\"><strong>Director:</strong> ${movie.Director}</li>\n <li class=\"list-group-item\"><strong>Writer:</strong> ${movie.Writer}</li>\n <li class=\"list-group-item\"><strong>Actors:</strong> ${movie.Actors}</li>\n </ul>\n <div class=\"well\" style=\"margin:4%\">\n <h3 style = \"color: white\" >Plot</h3>\n <p style = \"color: white\">${movie.Plot}</p>\n <hr>\n <div class=\"centerbox\">`;\n $('#movies').html(output);\n })\n .catch((err) => {\n console.log(err);\n });\n }", "function getReleaseDate(movieTitle){\n\tvar movieUrl = 'https://api.themoviedb.org/3/search/movie?api_key=feae45a67d6335347f12949a4fe25c77&language=en-US&query='+ movieTitle+ '&page=1&include_adult=false&region=US';\n\n\tvar json = JSON.parse(Get(movieUrl));\n\n\tconsole.log(json);\n\tconsole.log(json.total_results);\n\n\tif(json.total_results !== 0){\n\t\tfor(var i = 0; i < json.results.length; i++){\n\t\t\tif(json.results[i].title.toUpperCase() === movieTitle.toUpperCase()){\n\t\t\t\tvar movieInfo = makeMovie(json.results[i].title, json.results[i].release_date);\n\t\t\t\treturn movieInfo;\n\t\t\t}\n\t\t}\n\t\treturn \"Nothing\";\n\t}\n\telse{\n\t\treturn \"Nothing\";\n\t}\n\n}", "function MovieDetail(movie, $vivContext) {\n // Get Featured People.\n var api = new _api.API();\n var featuredPeople = api.getCredits(movie['id']);\n for (var i=0; i < featuredPeople['crew'].length; i++) {\n if (featuredPeople['crew'][i]['job'] == 'Director') {\n this.director = featuredPeople['crew'][i]['name'];\n break;\n }\n };\n cast = []\n for (var i=0; i < featuredPeople['cast'].length; i++) {\n if (featuredPeople['cast'][i]['order'] <= 10) {\n cast.push(featuredPeople['cast'][i]['name']);\n } else {\n break;\n }\n }\n this.cast = cast.join(', ');\n\n // Get Synopsis\n this.synopsis = movie['overview'];\n\n // Get IMDB Link\n if (movie['imdb_id'] && movie['imdb_id'] != undefined && movie['imdb_id'] != \"\") {\n this.imdbID = movie['imdb_id'];\n // accessing $vivContext to get the device\n var device = $vivContext.device ;\n if (device == 'bixby-mobile') {\n this.url = 'https://m.imdb.com/title/' + this.imdbID;\n } else {\n this.url = 'https://www.imdb.com/title/' + this.imdbID;\n }\n }\n}", "function movieTime() {\n\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\";\n\n\n\n axios\n .get(queryUrl)\n\n .then(\n\n function (response) {\n var movieD = response.data;\n // console.log(response)\n console.log(\n \"\\n ========== Movie Search ==========\\n\"\n )\n\n // * Title of the movie.\n console.log(\"Movie Title: \" + movieD.Title\n // * Year the movie came out.\n + \"\\nYear the movie came out: \" + movieD.Year\n // * IMDB Rating of the movie.\n + \"\\nIMDB Rating: \" + movieD.imdbRating\n // * Rotten Tomatoes Rating of the movie.\n + \"\\nRotten Tomatoes Rating: \" + movieD.Ratings[2].Value\n // * Country where the movie was produced.\n + \"\\nThe country the movie was produced in: \" + movieD.Country\n // * Language of the movie.\n + \"\\nLanguage of the movie: \" + movieD.Language\n // * Plot of the movie.\n + \"\\nMovie Plot: \" + movieD.Plot\n // * Actors in the movie.\n + \"\\nActors/Actresses: \" + movieD.Actors + \"\\n\");\n }\n )\n}", "function getMovie(){\r\n movieId = sessionStorage.getItem('movieId');\r\n axios.get('https://api.themoviedb.org/3/movie/'+movieId+'?api_key=7719d9fc54bec69adbe2d6cee6d93a0d&language=en-US')\r\n .then((response) => {\r\n imdbId = response.data.imdb_id;\r\n axios.get('http://www.omdbapi.com?apikey=c1c12a90&i='+imdbId)\r\n .then((response1) => {\r\n console.log(response1);\r\n let movie = response1.data;\r\n let output = '';\r\n const dict = {\r\n 'Jan': 1,\r\n 'Feb': 2,\r\n 'Mar': 3,\r\n 'Apr': 4,\r\n 'May': 5,\r\n 'Jun': 6,\r\n 'Jul': 7,\r\n 'Aug': 8,\r\n 'Sep': 9,\r\n 'Oct': 10,\r\n 'Nov': 11,\r\n 'Dec': 12\r\n };\r\n var arr = movie.Released.split(\" \");\r\n var today = new Date();\r\n var t = new Date(today.getFullYear()+','+(today.getMonth()+1)+','+today.getDate());\r\n var r = new Date(arr[2]+','+dict[arr[1]]+','+arr[0]);\r\n if(movie.Poster != null){\r\n output += `\r\n <h1 class=\"my-4 heading\">${movie.Title}</h1>\r\n\r\n <div class=\"row\">\r\n\r\n <div class=\"col-md-5\">\r\n <img style=\"\" class=\"img-fluid\" src=\"${movie.Poster}\" alt=\"\">\r\n </div>\r\n\r\n <div class=\"col-md-7\">\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\"><strong>Genre: </strong>${movie.Genre}</li>\r\n <li class=\"list-group-item\"><strong>Released: </strong>${movie.Released}</li>\r\n <li class=\"list-group-item\"><strong>Rated: </strong>${movie.Rated}</li>\r\n <li class=\"list-group-item\"><strong>IMDB Rating: </strong>${movie.imdbRating}</li>\r\n <li class=\"list-group-item\"><strong>Director: </strong>${movie.Director}</li>\r\n <li class=\"list-group-item\"><strong>Writer: </strong>${movie.Writer}</li>\r\n <li class=\"list-group-item\"><strong>Actors: </strong>${movie.Actors}</li>\r\n </ul>\r\n <li class=\"list-group-item\"><strong>Overview: </strong>${movie.Plot}</li>\r\n <a href=\"http://imdb.com/title/${movie.imdbID}\" target=\"blank\" class=\"btn btn-primary\">View IMDB</a> `+\r\n (t > r ? `<a href=\"#\" onClick=\"addMovie(${movieId}, ${1})\" class=\"btn btn-primary\">Add to Watched</a> ` : ``)\r\n +`\r\n <a href=\"#\" onClick=\"addMovie(${movieId}, ${0})\" class=\"btn btn-primary\">Add to Wished</a>\r\n </div>\r\n\r\n </div>\r\n `\r\n }\r\n $('#movieSingle').html(output);\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n}", "function movieData(title) {\n\n // This conditional statement handles the case where the user does not put a movie by returning the default movie selection: Do The Right Thing\n if (title === undefined) {\n\n title = 'Do The Right Thing';\n console.log('Since you didn\\'t request a specific movie title, I suggest that you watch this one!\\n');\n\n };\n\n // The request docs provide the sytax for its use which I followed here to make an api call to omdb\n request(\"http://www.omdbapi.com/?apikey=49544f9c&t=\" + title, function (error, response, body) {\n\n // If there is an error display the error message otherwise do not\n if (error == true) {\n console.log('error:', error);\n };\n\n let omdbResponse = JSON.parse(body);\n console.log(omdbResponse);\n\n if (omdbResponse.Error === 'Movie not found!') {\n console.log(`Movie not found. Sorry about that!\\n`)\n } else {\n // this for loop loops through the ratings array (which has three little objects in it) so that i can scope the Ratings key and pull out the Rotten Tomatoes Value\n for (let i = 0; i < omdbResponse.Ratings.length; i++) {\n\n // I left this console log in here so that you can see what the result of the for loop looks like and why I used it\n // console.log(omdbResponse.Ratings[i])\n\n };\n\n // These console.logs are printing out different bits of information from the body of the response\n console.log(`Movie title: ${omdbResponse.Title}`);\n console.log(`This movie was released: ${omdbResponse.Released}`);\n console.log(`The IMDB rating for this movie is: ${omdbResponse.imdbRating}`);\n console.log(`Rotten Tomatoes gives this move a rating of: ${omdbResponse.Ratings[1].Value}`);\n console.log(`This movie was filmed in: ${omdbResponse.Country}`);\n console.log(`This movie is in: ${omdbResponse.Language}`);\n console.log(`Here is a brief synopsis of the plot: ${omdbResponse.Plot}`);\n console.log(`Starring: ${omdbResponse.Actors} \\n\\nThis concludes the information for your current request. Thank you for using Liri. \\n`);\n }\n\n });\n\n}", "function movie (term) {\n\n var url = \"http://www.omdbapi.com/?t=\" + term + \"&y=&plot=short&apikey=trilogy\";\n\n request(url, function(error, response, body) {\n\n // If there were no errors and the response code was 200 (i.e. the request was successful)...\n \n if (!error && response.statusCode === 200) {\n\n // Then we print out the desired info\n console.log(divider);\n console.log(\"Title of the movie: \" + JSON.parse(body).Title);\n console.log(\"The movie's rating is: \" + JSON.parse(body).imdbRating);\n console.log(\"Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"The country where the movie was produced: \" + JSON.parse(body).Country);\n // unable to search using rottentomato api field.\n console.log(\"Rotten Tomatoes Rating of the movie: \" + JSON.parse(body).tomatoRating);\n console.log(\"Language of the movie: \" + JSON.parse(body).Language);\n console.log(\"Plot of the movie: \" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(divider);\n \n }\n \n\n\n});\n\n}", "function movieThis() {\n // Variable to store OMDB API key\n var movieAPI = \"7fc81b28\";\n // Variable to store the API URl and key \n var movieQueryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=\" + movieAPI;\n\n // Then run a request to the OMDB API with the movie specified\n request(movieQueryUrl, function (error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover the movie details\n var movieDetails = JSON.parse(body);\n // To log the information required for the assignment\n console.log(\"* Title of the movie: \" + movieDetails.Title);\n console.log(\"* Release Year: \" + movieDetails.Year);\n console.log(\"* IMDB Rating: \" + movieDetails.imdbRating);\n // Variable to set and hold movie ratings\n var movieRating = movieDetails.Ratings;\n // If ratings is not blank...\n if (movieRating != \"\") {\n // For loop to get and log the Rotten Tomatoes ratings\n for (var i = 0; i < movieRating.length; i++) {\n if (movieRating[i].Source === \"Rotten Tomatoes\") {\n console.log(\"* Rotten Tomatoes Rating: \" + movieRating[i].Value);\n }\n }\n // If it is blank, it logs a message saying that is no rating available \n } else {\n console.log(\"* Rotten Tomatoes Rating: Rating information is not available\");\n }\n // To log the information required for the assignment\n console.log(\"* Country where the movie was produced: \" + movieDetails.Country);\n console.log(\"* Language of the movie: \" + movieDetails.Language);\n console.log(\"* Plot of the movie: \" + movieDetails.Plot);\n console.log(\"* Actors in the movie: \" + movieDetails.Actors);\n }\n });\n}", "function movieThis(functionParameters) {\n\tif (functionParameters.length < 1) {\n\t\tfunctionParameters = \"Mr. Nobody\";\n\t};\n\trequest(\"http://www.omdbapi.com/?t=\" + functionParameters + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\t\tif(!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"imdbRating: \" + JSON.parse(body).imdbRating);\n\t\t\t// console.log(\"Title: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\tvar rotten;\n\t\t if(!JSON.parse(body).Ratings || !JSON.parse(body).Ratings[1]){\n rotten = \"No Rotten Tomatoes Score\"\n }\n else {\n rotten = JSON.parse(body).Ratings[1].Value\n }\n\n console.log(\"Rotten Tomatoes Rating: \" + rotten);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t} else {\n\t\t\tconsole.log(\"Movie Search Error\")\n\t\t}\n\n\t\t\n\n\t});\n}", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function thisMovie(movieName) {\n}", "function movieThis(user) {\n if (user.length === 0) {\n user = \"Mr.Nobody\";\n }\n axios\n .get(\"http://www.omdbapi.com/?apikey=trilogy&t=\" + user)\n .then(function(response) {\n // console.log(response);\n // console.log(response.data);\n var rottenTomatoes = response.data.Ratings[1];\n // console.log(rottenTomatoes);\n if (rottenTomatoes === undefined) {\n rottenTomatoes = \"Unavailable\";\n } else {\n rottenTomatoes = response.data.Ratings[1].Value;\n }\n console.log(\"\");\n console.log(\n \"===== MOVIE ==========[ Searched: \" + response.data.Title + \" ]=====\"\n );\n console.log('===================================================================================================================================');\n // * Title of the movie.\n console.log(\"Title Of Movie: [ \" + response.data.Title + ' ]');\n // * Year the movie came out.\n console.log(\"Year Movie Published: [ \" + response.data.Year + ' ]');\n // * IMDB Rating of the movie.\n console.log(\"IMDB Rating: [ \" + response.data.imdbRating + ' ]');\n // * Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Rating: [ \" + rottenTomatoes + ' ]');\n // * Country where the movie was produced.\n console.log(\"Country Produced: [ \" + response.data.Country + ' ]');\n // * Language of the movie.\n console.log(\"Language: [ \" + response.data.Language + ' ]');\n // * Plot of the movie.\n console.log(\"Plot: [ \" + response.data.Plot + ' ]');\n // * Actors in the movie.\n console.log(\"Actors: [ \" + response.data.Actors + ' ]');\n console.log('===================================================================================================================================');\n })\n .catch(function(error) {\n console.log(\"MOVIE ERROR: \" + error);\n });\n}", "function getMovie(req, res, next){\n let movArr = model.getMovie(req.params.mid);\n let directorName = model.getNameArr(movArr[0].Director);\n let writerName = model.getNameArr(movArr[0].Writer);\n let actorName = model.getNameArr(movArr[0].Actors);\n let url = movArr[0].Poster;\n let recMovie = model.getRecMovie(req.params.mid);\n\n let data = renderMovie({movie: movArr, link: url, session:req.session, movName: req.params.mid,\n otherName: directorName, writerName: writerName, actorName: actorName,\n recMovie: recMovie});\n res.status(200).send(data);\n}" ]
[ "0.76905596", "0.7605141", "0.74595827", "0.7442448", "0.74126834", "0.7398734", "0.73495376", "0.7347973", "0.7321103", "0.730877", "0.7308059", "0.729426", "0.7276822", "0.7269765", "0.7222126", "0.71885026", "0.7155367", "0.71488017", "0.71385187", "0.7136701", "0.70962274", "0.7061909", "0.7055286", "0.70203286", "0.70155424", "0.70095885", "0.70088965", "0.6985768", "0.6985661", "0.6973421", "0.6972955", "0.696813", "0.6959821", "0.6958434", "0.69542193", "0.6947574", "0.69374335", "0.69231266", "0.6913813", "0.6913217", "0.69092727", "0.6890085", "0.6881309", "0.6863634", "0.6855181", "0.68504006", "0.6850113", "0.68216175", "0.68208194", "0.68177855", "0.6803594", "0.67996424", "0.67968446", "0.6770384", "0.6761871", "0.6760409", "0.6760062", "0.6751361", "0.674014", "0.6726752", "0.67216134", "0.6710537", "0.6702379", "0.669269", "0.66801673", "0.6658687", "0.66585505", "0.66534024", "0.665207", "0.6649037", "0.664832", "0.66241676", "0.6622315", "0.6622293", "0.6621457", "0.6619995", "0.66115165", "0.6611424", "0.66092694", "0.660791", "0.6600625", "0.65840036", "0.6579442", "0.6576856", "0.6576472", "0.6566867", "0.65538347", "0.65437603", "0.65409034", "0.65405303", "0.65330416", "0.6530339", "0.6529237", "0.6529232", "0.65266246", "0.65113443", "0.6507453", "0.65033543", "0.6501761", "0.6499272", "0.6497067" ]
0.0
-1
Function to vote on a movie, then calls getNewMovie()
function rateMovie(args) { console.log("Rating movie "+movie_id+" with a rating of "+args[4]); var req = new XMLHttpRequest(); req.open("PUT", request_path+"/recommendations/"+user_id, true); req.onload = function() { console.log("Added rating to db"); getNewMovie(args); } var data = { "movie_id": movie_id, "rating": args[4], "apikey": "AaD72Feb3" }; req.send(JSON.stringify(data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewMovie(args) {\n\tconsole.log(\"Getting new movie\");\n\tvar req = new XMLHttpRequest();\n\treq.open(\"GET\", request_path+\"/recommendations/\"+user_id, true);\n\treq.onload = function() {\n\t\tvar response = JSON.parse(req.response);\n\t\tmovie_id = response[\"movie_id\"];\n\t\tgetMovieInfo(args);\n\t}\n\treq.send();\n}", "function checkForNewVotes(){\r\n //trigger updates\r\n for (var i = 0; i < friendLists.length; i++ ){\r\n displayLatestMovies(i,0); //this temporarily shows the old votes\r\n fetchMovieList(i, 1);\r\n }\r\n}", "function inputReview(movie) {\n $.post(\"/api/reviews\", movie)\n .then(getReviews);\n }", "function findMovie(genreChosen){\n //Find Movies with this same genre id\n let findMovieRecsURL = 'https://api.themoviedb.org/3/discover/movie?with_genres=' + genreChosen + '&vote_average.gte=6&api_key=d8731638c74bc1c4039ad5e0a50c36af'\n\n $.ajax({\n url: findMovieRecsURL,\n method: \"GET\"\n }).then(function(responseRecommend) {\n\n //This will call the following function to pick a movie from the results returned\n findAndUpdateMovie();\n\n function findAndUpdateMovie() {\n\n //Picks a movie result\n let allMovies = responseRecommend.results;\n let pickAMovie = Math.floor(Math.random() * allMovies.length);\n let getRandomMovie = allMovies[pickAMovie].title;\n\n //Uses the movie result to pull movie data from omdb\n let movieResult = getRandomMovie.trim().split(' ').join('+');\n let recMovieURL = \"https://www.omdbapi.com/?t=\" + movieResult + \"&apikey=c88e35f9\";\n \n $.ajax({\n url: recMovieURL,\n method: \"GET\"\n }).then(function(responseNew) {\n //If the movie title does not appear to be valid, pick a different movie result\n if(responseNew.Response === \"False\"){\n findAndUpdateMovie();\n };\n\n //If mature box isn't checked, don't include rated R or TV-MA movies (find new movie otherwise)\n if($('#mature').prop('checked') === false){\n if(responseNew.Rated === \"R\" || responseNew.Rated === \"TV-MA\")\n findAndUpdateMovie();\n };\n\n //Calls function to display the result\n movieResultSection(responseNew);\n });\n };\n });\n}", "function movied() {\n var movieTitle =\"\"; \n if (userInput[3] === undefined){\n movieTitle = \"mr+nobody\"\n } else {\n movieTitle = userInput[3];\n }; \n\tvar queryUrl = \"http://www.omdbapi.com/?apikey=f94f8000&t=\" + movieTitle\n\n\trequest(queryUrl, function(err, response, body) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t} else {\n\t\t console.log(\"\\n========== Movie Info ========\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Values);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\t\n console.log(\"=================================\\n\");\n\t\t}\n\n\t})\n}", "function thisMovie(movieName) {\n}", "function movies(favoriteMovie, name) {\n favoriteMovie(name);\n}", "function addVoteForUser(e, movieID, spoilerID) {\n e.preventDefault();\n const userSessionID = getUserConnectionId();\n $.ajax({\n url: '/Votes/Create',\n method: 'POST',\n data: {\n MovieID: movieID,\n SpoilerID: spoilerID,\n UserSessionID: userSessionID\n }\n })\n .then((resp, status, xhr) => {\n voteStatus = JSON.parse(xhr.responseText);\n if (voteStatus.voteCounted) {\n let votes = parseInt($(`.display-votes-spoiler-${spoilerID}`).text());\n\n ++votes;\n $(`.display-votes-spoiler-${spoilerID}`).text(votes);\n }\n });\n}", "getRandomMovie() {\n /* Request from TMDB randomized using release date, vote_average, and movies in the result page */\n const today = new Date();\n const randomMinMax = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);\n const randomYear = randomMinMax(1976, today.getFullYear());\n const randomMonth = String(randomMinMax(1, 12));\n const randomVoteAverage = (Math.floor(Math.random() * 10) + Math.random()).toFixed(1);\n const randomMovieInResults = randomMinMax(0, 19);\n\n fetch(`https://api.themoviedb.org/3/discover/movie?api_key=31bd793c883026448a472f7cae25d56e&language=fr&sort_by=release_date.asc&include_adult=false&include_video=false&page=1&primary_release_date.gte=${randomYear}-${randomMonth.length < 2 ? '0' + randomMonth : randomMonth}-01&vote_average.gte=${randomVoteAverage}`)\n .then(response => response.json())\n .then(movieList => {\n const randomMovie = movieList.results[randomMovieInResults] || undefined;\n /* if API response is invalid or movie already rated get a new movie */\n if (randomMovie === undefined || this.state.myRatingsId.indexOf(String(randomMovie.id)) !== -1) {\n this.getRandomMovie();\n } else {\n this.setState({\n randomMovie: movieList.results[randomMovieInResults]\n });\n }\n })\n .catch(error => console.log(error));\n }", "function addMovie(movieId, w){\r\n sessionStorage.setItem('movieId', movieId);\r\n if(w == 1)\r\n addToWatched();\r\n else\r\n addToWished();\r\n}", "temporaryMovie(movie) {\n this.displaySingleMovie(movie)\n }", "function movie() {\n\t// Then run a request to the OMDB API with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + command2 + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(queryURL, function (error, response, body) {\n\t\t// if the request is successful, run this\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\tconsole.log(\" \");\n\t\t\tconsole.log(queryURL);\n\t\t\tconsole.log(\"\\nMovie Title: \" +command2);\n\t\t\tconsole.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"Country where the movie is produced: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"\\nPlot of the movie: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"\\nThe IMDB rating is: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes rating is: \" + JSON.parse(body).Ratings[2].Value);\n\t\t\tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t}\n\t});\n}", "function newRatings(){\r\n\tif(pageType==\"LIST\"){\r\n\t\ttitle=$(\".bobMovieHeader\").children(\".title\").text();\r\n\t\tyear=$(\".bobMovieHeader\").children(\".year\").text().split('-')[0];\r\n\t\tif(lastTitle!=title){\r\n\t\t\tlastTitle=title\r\n\t\t\tgetRating(title,year)\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsetResults(imdbRating,tomatoMeter,imdbId);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\ttitle = $('.title-wrapper').children('.title').text();\r\n\t\tyear = $('.titleArea').children(\".year\").text().split('-')[0];\r\n\t\tgetRating(title,year);\r\n\t}\r\n}", "function rateMovie(id){\n var title = id.replace(/1/g, \"\");\n title = title.replace(/2/g, \"\");\n title = title.replace(/3/g, \"\");\n title = title.replace(/4/g, \"\");\n title = title.replace(/5/g, \"\");\n \n \n\n var rating = id.replace(title, \"\");\n rating = parseInt(rating);\n\n //Coloring the stars\n for(var f = 1; f <= rating; f++){\n var id = title + f;\n $(\"#\" + id).addClass(\"active\");\n }\n \n //id of the titlecell\n var titleCell = createId(title, 2);\n var movieTitle = $(\"#\" + titleCell).html();\n \n //save the Rating in Parse\n pushRatingToMovie(movieTitle, rating);\n\n //Actualize the avg rating\n getAverageRatingOfMovie(movieTitle);\n\n //Set Movie to isSeen\n updateIsSeenOnParse(movieTitle, true);\n createSeenButton(movieTitle);\n\n}", "function showMovie(movie){\n if(movie.Poster == \"N/A\"){\n var generalPoster = \"https://www.movieinsider.com/images/none_175px.jpg\" //In case the DB doesnt have poster\n var newMovie = $('<div id=\"'+movie.imdbID+'\" class=\"found-movie\">' +\n '<img src=\"'+generalPoster+'\">' +\n '<div class=\"found-info\">' +\n '<p class=\"movie-title\">'+movie.Title+'</p>' +\n '<p class=\"movie-year\">'+movie.Year+'</p>' +\n '</div>' + \n '<span class=\"add-btn\">+</span>' +\n '</div>');\n } else {\n var newMovie = $('<div id=\"'+movie.imdbID+'\" class=\"found-movie\">' +\n '<img src=\"'+movie.Poster+'\">' +\n '<div class=\"found-info\">' +\n '<p class=\"movie-title\">'+movie.Title+'</p>' +\n '<p class=\"movie-year\">'+movie.Year+'</p>' +\n '</div>' + \n '<span class=\"add-btn\">+</span>' +\n '</div>');\n }\n $(\"#found-movies\").append(newMovie);\n}", "function Movie(title,newRelease,times) {\n this.title = title;\n this.newRelease = newRelease;\n this.times = times; \n}", "function favoriteMovie(userFavorite,newSearch) {\n //omdb is not case sensitive; just trim and replace spaces with pluses\n let title = userFavorite.trim().split(' ').join('+');\n\n //Variables for the contents\n let favTitle, favPosterURL, favPlot, favRating, favScore;\n\n //API Key for omdb\n let movieURL = 'https://www.omdbapi.com/?t=' + title + '&apikey=c88e35f9';\n\n //Call API for movie data (title, poster, plot, rating, score)\n $.ajax({\n url: movieURL,\n method: 'GET',\n error: function() {\n console.log(\"error with api call\")\n return;\n }\n }).then(function(responseFav) {\n\n //If not a valid movie title, display the error message\n if(responseFav.Response === 'False'){\n $('.search-section').removeClass('hidden');\n $('.results-section').addClass('hidden');\n $('#title-error').removeClass('hidden');\n return;\n };\n\n //Add to Favorite section \n //Title\n favTitle = responseFav.Title;\n $('#favorite-title').html(favTitle);\n //Poster\n favPosterURL = responseFav.Poster;\n $('#favorite-poster').attr('src', favPosterURL);\n //Rated\n favRating = responseFav.Rated;\n $('#favorite-rating').html(`Rated: ${favRating}`);\n //Plot\n favPlot = responseFav.Plot;\n $('#favorite-plot').html(favPlot);\n //Score (movie score = imdbRating)\n favScore = responseFav.imdbRating;\n $('#favorite-score').html(`imdbRating: ${favScore} / 10`);\n //URL\n favImdbURL = \"https://www.imdb.com/title/\" + responseFav.imdbID;\n $('#favorite-full-url').attr('href',favImdbURL);\n\n //If a new search, find a result (if not a new search, will want to display saved result from local storage- separate function)\n if(newSearch){\n pickGenreFromMovie(title);\n };\n });\n}", "function nextMovie(){\n removeMoviesAction();\n }", "function popUpMovie(elem) {\n\tparent = $(elem).parent();\n\tvar title = parent.find(\"td:first-child\").text();\n\tvar movieID = parent.find(\"td:nth-child(3) div\").attr('data-tmdbId');\n\tvar rating = parent.find(\"td:nth-child(3)\").html();\n\n\t$.getJSON(\"https://api.themoviedb.org/3/movie/\" + movieID + \"?api_key=179888c2888c0074bf9579eb0dfca026&language=\" + lookUp[currentLanguage], function(tmdb) {\n\t\tif (tmdb) {\n\t\t\tvar toAdd = \"<img src='http://image.tmdb.org/t/p/w185\"+tmdb.poster_path+\"'/>\";\n\t\t\ttoAdd += \"<div class='movieRight'>\";\n\t\t\ttoAdd += rating;\n\t\t\ttoAdd += \"<div id='movieRating'>\" + tmdb.vote_average * 10 + \"<span id='percent'>%</span> </div>\";\n\t\t\ttoAdd += \"<div id='movieRelease'>\" + new Date(tmdb.release_date).toLocaleDateString() + \"</div>\";\n\t\t\ttoAdd += \"<div id='movieRuntime'>\" + tmdb.runtime + lan[\"minutes\"] + \"</div>\";\n\t\t\ttoAdd += \"<div id='movieOverview'>\" + tmdb.overview + \"</div>\";\n\t\t\ttoAdd += \"</div>\";\n\n\t\t\t// add our info in\n\t\t\t$(\"#movieModal #movieBody\").html(toAdd);\n\n\t\t\t// empty table\n\t\t\t$(\"#simliarMovies tbody\").html(\"\");\n\n\t\t\t$.ajax({\n\t\t\t\turl: \"/getSimilar\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tdata: {\"title\" : title},\n\t\t\t\tcache: false,\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t// would error if not logged in\n\t\t\t\t\t\t\n\t\t\t\t\tif (data != \"error\") {\n\t\t\t\t\t\tlan = dict[currentLanguage];\n\t\t\t\t\t\tdata = JSON.parse(data); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// convert back to array\n\n\t\t\t\t\t\tfor (e in data) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// loop through all movies\n\n\t\t\t\t\t\t\tmovie = data[e];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// get movie\n\t\t\t\t\t\t\tgenre = movie[1].split(\"|\");\n\n\t\t\t\t\t\t\tfor (w in genre)\n\t\t\t\t\t\t\t\tgenre[w] = lan[genre[w]];\n\n\t\t\t\t\t\t\tgenre = genre.join(\", \");\n\t\t\t\t\t\t\trating = Math.ceil(movie[2]);\n\n\t\t\t\t\t\t\tif (rating == 0) {\n\t\t\t\t\t\t\t\trating = Math.ceil(movie[3]);\n\t\t\t\t\t\t\t\textraClass = \"dim\"\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\titem = \"<tr>\" +\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// new row\n\t\t\t\t\t\t\t\t\"<td>\" + movie[0] + \"</td>\" +\n\t\t\t\t\t\t\t\t\"<td>\" + genre + \"</td>\" +\n\t\t\t\t\t\t\t\t\"<td>\" +\n\t\t\t\t\t\t\t\t\t\"<div class='starContainer \"+ extraClass + \" highlight\" + rating + \"' \" +\n\t\t\t\t\t\t\t\t\t\"data-tmdbId='\"+ movie[4] +\"' \" +\n\t\t\t\t\t\t\t\t\t\"data-title='\"+ movie[0] +\"'>\" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='1' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='2' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='3' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='4' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t \"<span data-rating-value='5' class='fas fa-star'></span> \" +\n\t\t\t\t\t\t\t\t\"</div></td>\";\n\n\t\t\t\t\t\t\t$(\"#simliarMovies tbody\").append(item); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// append movie to table\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if no results were returned\n\t\t\t\t\t\tif(data.length == 0) {\n\t\t\t\t\t\t\t$(\"#simliarMovies tbody\").append(lan[\"notEnough\"]);\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$(\"#movieModal #movieModalTitle\").text(title);\n\t$(\"#movieModal\").modal(\"show\");\n}", "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "function movieThis() {\n console.log('===========================================');\n console.log(\"Netflix and Chill....?\");\n // console.log(\"Pizza and a fuck?.....WHAT???.....you dont like pizza?\")\n var searchMovie;\n // use undefined for default search!\n if (arguTwo === undefined) {\n searchMovie = \"Mr. Nobody\";\n } else {\n searchMovie = arguTwo;\n };\n // add tomatoes url and json format // request required here\n var movieUrl = 'http://www.omdbapi.com/?t=' + searchMovie + '&y=&plot=long&tomatoes=true&r=json';\n request(movieUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n \n\n var movieData = JSON.parse(body)\n\n console.log('================ Movie Info ================');\n console.log('Title: ' + movieData.Title);\n console.log('Year: ' + movieData.Year);\n console.log('IMDB Rating: ' + movieData.imdbRating);\n console.log('Country: ' + movieData.Country);\n console.log('Language: ' + movieData.Language);\n console.log('Plot: ' + movieData.Plot);\n console.log('Actors: ' + movieData.Actors);\n console.log('Rotten Tomatoes Rating: ' + movieData.tomatoRating); //notworkings\n console.log('Rotten Tomatoes URL: ' + movieData.tomatoURL);\n console.log('===========================================');\n }\n });\n}", "function movieThis() {\n\t//takes in user input for movie title\n\tvar movieTitle = input;\n\n\t// if no movie is provided, the program will default to \"mr. nobody\"\n\tif (input === \"\") {\n\t\tmovieTitle = \"Mr. Nobody\";\n\t}\n\n\t// variable for the OMDb API call\n\tvar OMDb = \"http://omdbapi.com?t=\" + movieTitle + \"&r=json&tomatoes=true\";\n\n\t// this takes in the movie request and searches for it in OMDb via request\n\trequest(OMDb, function (err, response, body) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Error: \" + err);\n\t\t\treturn;\n\t\t}\n\t\telse if (response.statusCode === 200) {\n\t\t\tvar movie = JSON.parse(body);\n\t\t\tvar movieData = \"\";\n\n\t\t\tvar title = \"\\n\" + \"Movie Title: \" + movie.Title + \"\\n\";\n\t\t\tmovieData += title;\t\n\n\t\t\tvar year = \"\\n\" + \"Year Released: \" + movie.Year + \"\\n\";\n\t\t\tmovieData += year;\n\n\t\t\tvar rating = \"\\n\" + \"IMDB Rating: \" + movie.imdbRating + \"\\n\";\n\t\t\tmovieData += rating;\t\n\n\t\t\tvar country = \"\\n\" + \"Country: \" + movie.Country + \"\\n\";\n\t\t\tmovieData += country;\n\n\t\t\tvar language = \"\\n\" + \"Language: \" + movie.Language + \"\\n\";\n\t\t\tmovieData += language;\n\n\t\t\tvar plot = \"\\n\" + \"Movie Plot: \" + movie.Plot + \"\\n\";\n\t\t\tmovieData += plot;\t\n\n\t\t\tvar actors = \"\\n\" + \"Actors: \" + movie.Actors + \"\\n\";\n\t\t\tmovieData += actors;\n\n\t\t\tvar tomatoMeter = \"\\n\" + \"Rotten Tomato Rating: \" + movie.tomatoUserMeter + \"\\n\";\n\t\t\tmovieData += tomatoMeter;\n\n\t\t\tvar tomatoURL = \"\\n\" + \"Rotten Tomato Rating Link: \" + movie.tomatoURL + \"\\n\";\n\t\t\tmovieData += tomatoURL;\n\n\t\t\tconsole.log(\"\\n\" + \"OMDb:\");\n\t\t\tconsole.log(movieData);\n\t\t\tdataLog(movieData);\t\t\t\t\t\t\t\n\t\t}\n\t});\n}", "selectedMovie(movie) {\n // Display selected movie\n this.displaySingleMovie(movie)\n }", "save(movie) {\n movie.id = crypto.randomBytes(20).toString('hex'); // fast enough for our purpose\n this.movieList.push(movie);\n return 1;\n }", "function clickToAdd(e) {\n var thisMovieImdbId = e.target.id; // grabs movie in search results from id on add button\n // var thisMovieImdbId = allResults[thisMovieId].imdbID; // grabs proper movie information given correct id\n $.ajax({ // Makes the next api request to get full listing on movie, not just search results (which were abbreviated)\n url: \"http://www.omdbapi.com/?i=\" + thisMovieImdbId + \"&r=json\"\n }).done(function(fullMovieListing) {\n\n // Need If Then Poster\n if (fullMovieListing.Poster !== \"N/A\") {\n fullMovieListing.Poster = \"http://img.omdbapi.com/?i=\" + thisMovieImdbId + \"&apikey=8513e0a1\";\n }\n \n // Sends full movie listing, with user login ID, to store on website database\n grabmovies.findMovie(fullMovieListing, authInfo);\n\n });\n }", "function movieThis() {\n\t\tinquirer.prompt([\n \t\t{\n \ttype: \"input\",\n \tmessage: \"Which movie do you want to check?\",\n \tname: \"movie\"\n \t\t}\n \t\t]).then(function(user) {\n \t\t\tmovieName = user.movie;\n \t\t\tif (user.movie === \"\") {\n \t\t\t\tmovieName = \"Mr. Nobody\";\n \t\t\t}\n\t\t\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&r=json\";\n \t\t\trequest(queryUrl, function(error, response, body) {\n\t\t\t\tif (!error && response.statusCode === 200) {\n\t\t\t\t\tconsole.log(\"\");\n\t\t\t\t\tconsole.log(\"Title of the movie: \" + JSON.parse(body).Title);\n\t\t\t\t\tconsole.log(\"Year the movie came out: \" + JSON.parse(body).Year);\n\t\t\t\t\tconsole.log(\"IMBD Rating of the movie: \" + JSON.parse(body).imbdRating);\n\t\t\t\t\tconsole.log(\"Country were the movie was produced: \" + JSON.parse(body).Country);\t\t\t\t\n\t\t\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\t\t\tconsole.log(\"Plot of the movie: \" + JSON.parse(body).Plot);\n\t\t\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\t\t\tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).Website);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function movieThis(receivedMovie) {\n\n\n var movie = receivedMovie ? receivedMovie : \"Mr. Nobody\";\n\n // request to omdbapi using movie entered and trilogy api key\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=full&tomatoes=true&r=json&y=&plot=short&apikey=trilogy\", function (error, response, data) {\n\n // IF the request is successful. The status code is 200 if the status returned is OK\n if (!error && response.statusCode === 200) {\n\n // log the command issued to the log.txt file\n logCommand();\n\n // Display Data\n // TITLE, YEAR, IMDB RATING, COUNTRY, LANGUAGE(S), PLOT, ACTORS, ROTTEN TOMATO RATING, ROTTEN TOMATO URL\n console.log(\"Movie Title: \" + JSON.parse(data).Title);\n console.log(\"Release Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"TOMATOMETER: \" + JSON.parse(data).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors/Actresses: \" + JSON.parse(data).Actors);\n }\n\n });\n}", "singleMovie() {\n console.log(\"singleMovie\")\n }", "recursiveGetMovie(movies, i, numVotes, SciFiInstance, web3) {\n return SciFiInstance.votes(i).then((result)=>{\n\n const amount = result[1].c[0],\n hexname = result[2],\n retracted = result[3];\n\n if(!retracted) {\n // check if movie exists\n if(movies.find((movie)=>{ return movie.name === web3.toAscii(hexname) })){\n // adjust movie\n const objIndex = movies.findIndex((movie)=>{ return movie.name === web3.toAscii(hexname)})\n movies[objIndex].amount += amount/10000\n\n } else {\n // new movie\n movies = [...movies, {\n name : web3.toAscii(hexname),\n amount : parseFloat(amount/10000)}\n ]\n }\n }\n\n // get the next movie if we're not finished, otherwise: return the movies\n if (i === numVotes) {\n return movies;\n } else {\n return this.recursiveGetMovie(movies, i+1, numVotes, SciFiInstance, web3);\n }\n })\n }", "async addFilm(newMovie) {\n return Film.create(newMovie);\n }", "function Movie(title,genre,rating,showtimes) {\n this.title = title,\n this.genre = genre,\n this.rating = rating,\n this.showtimes = showtimes,\n\n this.getNextShowing = function () {\n var now = new Date().getTime();\n\n for (let i = 0; i< this.showtimes.length ; i++) {\n var showTime = getTimeFromString(this.showtimes[i]);\n\n if ((showTime - now) > 0) {\n return `Next showing of '${this.title}' is ${this.showtimes[i]}`;\n };\n };\n\n return null;\n }\n\n}", "function Movie (status,title,rating,genres,votes,languages,runtime,cast,director,tweets,positive_tweets,negative_tweets) {\n this.status = status;\n this.title = title;\n this.rating = rating;\n this.genres = genres;\n this.votes = votes;\n this.languages = languages;\n this.runtime = runtime;\n this.cast = cast;\n this.director = director;\n this.tweets = tweets;\n this.positive_tweets = positive_tweets;\n this.negative_tweets = negative_tweets;\n this.getStatus = getMovieStatus;\n this.getTitle = getMovieTitle;\n this.getRating = getMovieRating;\n this.getGenres = getMovieGenres;\n this.getVotes = getMovieVotes;\n this.getLanguages = getMovieLanguages;\n this.getRuntime = getMovieRuntime;\n this.getCast = getMovieCast;\n this.getDirector = getMovieDirector;\n this.getTweets = getMovieTotalTweets;\n this.getPositiveTweets = getMoviePositiveTweets;\n this.getNegativeTweets = getMovieNegativeTweets;\n }", "selectMovie(id) {\n this.movieById(movie => {\n this.selectedMovie(movie)\n }, id)\n }", "function addRatings() {\n OMDBProvider.getMovie(vm.film.imdb_id).then(movie => {\n vm.film.ratings = movie.Ratings;\n getTrailers();\n })\n }", "function movieThis(movieName) {\n\n // const movieName = process.argv.slice(3).join(\" \");\n movieName = movieName || \"Mr. Nobody\";\n var queryUrl = `http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`;\n // if (movieName === \"\") {\n // return movieName(\"mr+nobody\");\n // console.log(\"Movie Title: Mr. Nobody\");\n // console.log(\"Movie Year: 2009\");\n // console.log(\"IMDB Rating: 7.8/10\");\n // console.log(\"Rotten Tomatoes Rating: 67%\");\n // console.log(\"Country: Belgium, Germany, Canada, France, USA, UK\");\n // console.log(\"Plot Summary: A boy stands on a station platform as a train is about to leave. Should he go with his mother or stay with his father? Infinite possibilities arise from this decision. As long as he doesn't choose, anything is possible.\");\n // console.log(\"Actors: Jared Leto, Sarah Polley, Diane Kruger, Linh Dan Pham\");\n // } else {\n axios.get(queryUrl).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Movie Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot Summary: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n if (movieName === \"Mr. Nobody\") {\n console.log(\"If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\");\n console.log(\"It's on Netflix!\");\n }\n\n })\n .catch(function (err) {\n console.log(err);\n })\n}", "function makeCard(movie) {\n const movieHTML = $('<div class=\"movie-div\">')\n .append(\n `<span class=\"movie-title-tooltip\" id=\"${movie.id}\">${movie.title}</span>`\n )\n .append(\n `<a href=\"/movies/${movie.id}\"><img src=\"${image_URL}${movie.poster_path}\" alt=\"${movie.title} poster \"onerror=\"this.onerror=''; this.src='./assets/blank.jpg'\"></a>`\n ); // If poster load error: load blank.jpg\n $.get(`http://localhost:3000/rating/${movie.id}/user`, function (data) {\n if (data.length === 1 ) {\n // Convert score to out of 5\n let score = data[0].rating\n score%2==0 ? stars = '★'.repeat(score / 2) : stars = '★'.repeat((score / 2)) + '½'\n $(movieHTML).append(`<div id=\"star\" class=\"rating\">${stars}</div>`);\n }\n })\n // Get community score by fetching route with SQL for average, convert to percentage and add if community rating exists add badge to poster\n $.get(`http://localhost:3000/rating/`, function (data) {\n let find = data.find(item => {return item.movie_id == movie.id})\n if (find) {\n let score = find.avg * 10;\n let votes = find.count\n $(movieHTML).prepend(`<div id=\"score\" class=\"score\">${score}%</div>`);\n $(movieHTML).prepend(`<div class=\"score-count score\">${votes} vote/s</div>`);\n }\n })\n $('#api-content').append(movieHTML);\n}", "function doMovieThis(movie) {\n // If no movie provided, default to Mr. Nobody\n var queryUrl = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + (movie == \"\" ? \"Mr. Nobody\" : movie);\n axios.get(queryUrl)\n .then(function (response) {\n var data = response.data;\n if (data.Response == \"False\") {\n // Movie not found\n writeLog(\"We're sorry, the movie '\" + movie + \"' doesn't seem to exist.\");\n } else {\n // Print movie information\n writeLog(\"------------------------------------\");\n writeLog(\"Title: \" + data.Title);\n writeLog(\"Release Year: \" + data.Year);\n writeLog(\"IMDB Rating: \" + data.Ratings[0].Value);\n writeLog(\"Rotten Tomatoes Rating: \" + data.Ratings[1].Value);\n writeLog(\"Produced in: \" + data.Country);\n writeLog(\"Language: \" + data.Language);\n writeLog(\"Plot: \" + data.Plot);\n writeLog(\"Actors and Actresses: \" + data.Actors);\n }\n })\n .catch(function (error) {\n writeLog(error);\n });\n}", "function tmdbSelectedMovie(id) {\n $.getJSON(\n `${trendingApi.detailsBase}movie/${id}?api_key=${trendingApi.key}&language=en-US` // accesses api data\n ).then(function (detailsResponse) {\n let movieImdb = detailsResponse.imdb_id; // stores particilar data needed within a variable\n selectedMovie(movieImdb); // performs next function, selectedMovie() on search.js page\n });\n}", "function movieThis() {\n // Variable to store OMDB API key\n var movieAPI = \"7fc81b28\";\n // Variable to store the API URl and key \n var movieQueryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=\" + movieAPI;\n\n // Then run a request to the OMDB API with the movie specified\n request(movieQueryUrl, function (error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover the movie details\n var movieDetails = JSON.parse(body);\n // To log the information required for the assignment\n console.log(\"* Title of the movie: \" + movieDetails.Title);\n console.log(\"* Release Year: \" + movieDetails.Year);\n console.log(\"* IMDB Rating: \" + movieDetails.imdbRating);\n // Variable to set and hold movie ratings\n var movieRating = movieDetails.Ratings;\n // If ratings is not blank...\n if (movieRating != \"\") {\n // For loop to get and log the Rotten Tomatoes ratings\n for (var i = 0; i < movieRating.length; i++) {\n if (movieRating[i].Source === \"Rotten Tomatoes\") {\n console.log(\"* Rotten Tomatoes Rating: \" + movieRating[i].Value);\n }\n }\n // If it is blank, it logs a message saying that is no rating available \n } else {\n console.log(\"* Rotten Tomatoes Rating: Rating information is not available\");\n }\n // To log the information required for the assignment\n console.log(\"* Country where the movie was produced: \" + movieDetails.Country);\n console.log(\"* Language of the movie: \" + movieDetails.Language);\n console.log(\"* Plot of the movie: \" + movieDetails.Plot);\n console.log(\"* Actors in the movie: \" + movieDetails.Actors);\n }\n });\n}", "function chosenMovie(userMovieInput){\n request(`http://www.omdbapi.com/?t=${userMovieInput}&y=&i=&plot=short&tomatoes=true&r=json`, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var parseUserInput = JSON.parse(body)\n var movieOutput = \"Movie Title: \" + parseUserInput.Title + \"\\n\" +\n \"Year Release: \" + parseUserInput.Year + \"\\n\" +\n \"Country Produced: \" + parseUserInput.Country + \"\\n\" +\n \"Language: \" + parseUserInput.Language + \"\\n\" +\n \"Plot: \" + parseUserInput.Plot + \"\\n\" +\n \"Actors: \" + parseUserInput.Actors + \"\\n\" +\n \"IMBD Rating: \" + parseUserInput.imdbRating + \"\\n\" +\n \"Rotten Tomatoes Rating: \" + parseUserInput.tomatoRating + \"\\n\" +\n \"Rotten Tomatoes URL: \" + parseUserInput.tomatoURL + \"\\n\";\n // console.log(movieOutput);\n logText(movieOutput);\n }\n // Reenable the start prompt until the user exits the app.\n start();\n });\n}", "function movie() {\n\n var args = process.argv;\n var movieName = \"\";\n\n for (i = 3; i < args.length; i++) {\n if (i > 3 && i < args.length) {\n movieName = movieName + \"+\" + args[i];\n } else {\n movieName = args[i];\n }\n };\n\n if (movieName === \"\") {\n movieName = \"Mr.\" + \"+\" + \"Nobody\"\n };\n\n //run a request to the OMDB API with the specified movie\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"-------------------------------------------------------------------------------------------\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n console.log(\"-------------------------------------------------------------------------------------------\");\n } else {\n console.log(\"ya' messed up\");\n }\n });\n}", "function vote() {\n\t$.post(\"servlets/VoteServlet\", \n\t\t{\n\t\t\tfacebook_id: user.id, \n\t\t\timage: $(\"#selectedPictureImg\").attr(\"src\"), \n\t\t\tname: user.name\n\t\t}, function(response) {\n\t\t\thideAll();\n\t\t\tif (response === 'already_voted') {\n\t\t\t\ttoLocation(\"#alreadyVoted\");\n\t\t\t} else {\n\t\t\t\ttoLocation(\"#thanksForVoting\");\n\t\t\t}\n\t\t\tif (tutorialMode) {\n\t\t\t\tfadeOut($(\"#votePopup\"));\n\t\t\t\tshowPopup($(\"#explorePopup\"), \"fadeInRightBig\");\n\t\t\t}\n\t\t\tgetChartData();\n\t\t}\n\t);\n}", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "function foundmovie(movieid){\n var url = 'https://api.themoviedb.org/3/movie/' + movieid + '?api_key=224dda2ca82558ef0e550aa711aae69c';\n jQuery.ajax({\n type: 'GET',\n url: url,\n async: false,\n contentType: \"application/json\",\n dataType: 'jsonp',\n success: function(json) {\n clear_page();\n jQuery(\"#current\").addClass('active'); \n jQuery(\"#current\").css('background-image',\"url(http://image.tmdb.org/t/p/w500/\" + json.backdrop_path +\")\");\n jQuery(\"#current\").append(\"<img src='http://image.tmdb.org/t/p/w500\" + json.poster_path + \"' width:=200px' height='280px' />\");\n \tjQuery(\"#current\").append(\"<div class='current_info'><p>Current Match: \" + json.original_title + \"</p>\");\n jQuery(\"#current\").append(\"<p>Released: \" + json.release_date +\"</p>\");\n jQuery(\"#current\").append(\"<p>Rating: \" + json.vote_average + \"</p></div>\");\n jQuery('#current').slideDown(\"2000\", function(){\n getSimilar(json.id);\n });\n\t },\n\t error: function(e) {\n\t console.log(e.message);\n\t }\n });\n}", "function movie() {\n if (process.argv[3]) {\n var movieName = process.argv[3];\n } else {\n var movieName = 'mr nobody';\n }\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = 'http://www.omdbapi.com/?t=' + movieName + '&y=&plot=short&apikey=' + omdb_key;\n // Then run a request to the OMDB API with the movie specified\n request(queryUrl, function(error, response, body) {\n // If the request is successful \n if (!error && response.statusCode === 200) {\n var data = JSON.parse(body);\n // Then log info about the movie\n console.log('movie: ' + data.Title);\n console.log('year released: ' + data.Year);\n console.log('imdb rating: ' + data.Ratings[0].Value);\n console.log('rt rating: ' + data.Ratings[1].Value);\n console.log('country: ' + data.Country);\n console.log('language: ' + data.Language);\n console.log('plot: ' + data.Plot);\n console.log('actors: ' + data.Actors);\n } else {\n return console.log('error: ' + error);\n }\n });\n}", "function movieThis(movie){\n //This will pull from the omdb API and pull data about the movie\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n //console.log(response.data);\n console.log(\"-------------\");\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n //Add in the rotten tomatoes rating\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n console.log(\"-------------\");\n });\n}", "function Movie(title, director, rating) {\n this.title = title;\n this.director = director;\n this.rating = rating;\n}", "function addNewMovie() {\n\tconsole.log(\"\\n\");\n\tconsole.log(SPACER);\n\tlet title = PROMPT.question(\"Movie title: \");\n\tmovies.push({\n\t\ttitle: title,\n\t\tratings: []\n\t});\n}", "function movie(){\n\n /**You can follow the in-class request exercise for this**/\n console.log(\"Movie Time!\");\n\n var movieSearch;\n if(search === undefined){\n movieSearch = \"Sharknado\";\n }\n else{\n movieSearch = search;\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieSearch + \"&y=&plot=short&apikey=40e9cece\";\n console.log(\"movie time?\");\n request((queryUrl), function(error,response,body){\n console.log(\"got hear\");\n if(!error && response.statusCode === 200){\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors & Actresses: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n }\n });\n}", "function movieThis(term) {\n\n console.log(\"Running movie-this...\");\n\n if (process.argv[3]) { \n var movieName = process.argv.slice(3).join(\" \");\n }\n else if (term) {\n var movieName = term;\n }\n else {\n var movieName = \"Mr. Nobody\";\n }\n\n var movieUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n // Runs a request with axios to the OMDB API with the movie specified\n axios.get(movieUrl).then(\n function(response) {\n console.log(\"\\n\" + \"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Released);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Actors: \" + response.data.Actors + \"\\n\");\n }\n );\n}", "function movies() {\n //console.log('The Toy');\n \t\n \t\n \tfor (var i = 3; i < nodeArgs.length; i++) {\n\n \t\tvar movieTitle = \"\"; \n \t\tconsole.log()\n\n \t\tif (i >= 3 && i < nodeArgs.length) {\n \t\t\tmovieTitle = movieTitle + \"+\" + nodeArgs[i];\n \t\t}\n \n \t\telse {\n \t\t\tmovieTitle = movieTitle + nodeArgs[i];\n \t\t}\n \t}\n \tvar queryURL = 'http://www.omdbapi.com/?t=' + movieTitle +'&tomatoes=true&y=&plot=short&r=json';\n \t\n \t//these are so we can visualize our URL & user Input for debugging\n \tconsole.log(queryURL);\n \tconsole.log(movieTitle);\n \n \trequest(queryURL, function(error, response, body) {\n \n \t\tif (!error && response.statusCode == 200) {\n \t\t\tconsole.log(\"Title: \" + JSON.parse(body)[\"Title\"]);\t// Movie title\n \t\t\tconsole.log(\"Released: \" + JSON.parse(body)[\"Year\"]);\t// Movie Release Year\n \t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body)[\"imdbRating\"]);\t// IMDB rating\n \t\t\tconsole.log(\"Country of Production: \" + JSON.parse(body)[\"Country\"]); //Production Country\n \t\t\tconsole.log(\"Movie Language: \" + JSON.parse(body)[\"Language\"]);\t//Movie Language\n \t\t\tconsole.log(\"Plot: \" + JSON.parse(body)[\"Plot\"]); //Movie Plot\n \t\t\tconsole.log(\"Cast: \" + JSON.parse(body)[\"Actors\"]);\t//Movie Cast\n \t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body)[\"tomatoRating\"]); //Rotten Tomatoes Rating\n \t\t\tconsole.log(\"Rotten tomatoes URL: \" + JSON.parse(body)[\"tomatoURL\"]); //Rotten tomatoes URL\n \t\t}\n \t\telse {\n \n \t\t}\n \t});\n }", "function select(){\n // function executes when movie is cliked\n\t$(\".result\").click(function(event){\n\t\t\n\t\t// pull movie ID when element is clicked\n\t\tdocument.getElementById(\"choice\").innerHTML = \"<img id='exit' src='/img/exit.gif'/>\";\n\t\t\n\t\t// initiate GET request with omdb api through $.getJSON\n\t\tvar omdb = \"http://www.omdbapi.com/\"\n\t\tvar id = \"i=\" + event.target.id + \"&plot=full\";\t\t\n\t\t$.getJSON(omdb, id, function(data){\n\t\t\tvar info = [\"Title\", \"Year\", \"Runtime\", \"Genre\", \"Director\", \"Actors\", \"imdbRating\", \"Plot\"];\n\t\t\tvar JSON = [data.Title, data.Year, data.Runtime, data.Genre, data.Director, data.Actors, data.imdbRating, data.Plot];\n\t\t\tvar imdbID = data.imdbID;\n\t\t\t\n\t\t\t// instantiate poster\n\t\t\t$(\"#choice\").append(\"<img alt='poster' class='poster' src='\" + data.Poster + \"'/>\");\t\t\t\n\t\t\t\n\t\t\t// loops through JSON data to instantiate movie info\n\t\t\tfor (var i = 0, j = 15; i < info.length; i++, j+=25){\n\t\t\t\t$(\"#choice\").append(\"<div class='info' style='top: \" + j + \"px;'>\" + info[i] + \": \" + JSON[i] + \"</div>\");\n\t\t\t}\n\t\t\t$(\"#choice\").append(\"<button id='select' type='submit'>Add to List</button>\");\t\t\t\n\t\t\t$(\"#choice\").fadeIn();\n\n // sends movie data to php server via AJAX call once \"Add to List\" button is clicked\n\t\t\t$(\"#select\").click(function(){\n\t\t\t $.ajax({\t\t\t \n\t\t\t url: \"search.php\",\n\t\t\t method: \"POST\",\n\t\t\t dataType: \"text\",\n\t\t\t data: \"title=\" + data.Title + \"&year=\" + data.Year + \"&runtime=\" + data.Runtime +\n\t\t\t \"&genre=\" + data.Genre + \"&director=\" + data.Director + \"&actors=\" + data.Actors +\n\t\t\t \"&rating=\" + data.imdbRating + \"&plot=\" + data.Plot + \"&poster=\" + data.Poster + \"&imdbID=\" + imdbID, \n\t\t\t success: function(){\n\t\t\t $(\"#choice\").hide();\n\t\t\t\t $(\"#confirm\").fadeIn();\n\t\t\t\t setTimeout(function(){$(\"#confirm\").fadeOut()}, 1500);\n\t\t\t }\t\t\t \n\t\t\t });\t\t\t \n\t\t\t event.preventDefault();\t\t\t\t\t\t\n\t\t\t});\n\t\t});\t\n\t\t\n\t\t// closes window if exit button is clicked\n\t\t$(\"#exit\").click(function(){\n\t\t\t$(\"#choice\").hide();\n\t\t});\t\t\n\t});\t\n}", "function updOrCreateMovie(movie, method, id, resolveMovie, rejectMovie) {\n let stars = movie[3][1].split(', ');\n\n let actions = stars.map(postActor);\n Promise.all(actions)\n .then(data => data.map(el => el.Id))\n .then(idArr => {\n if (method === 'POST') {\n createMovie(movie[0][1], movie[1][1], movie[2][1], idArr, function (result) {\n });\n }\n else { // PUT\n updateMovie(movie[0][1], movie[1][1], movie[2][1], id, idArr, function (result) {\n console.log(\"Updated movie: \" + result);\n });\n }\n })\n .then(() => resolveMovie())\n .catch(error => {\n console.log(error.message);\n rejectMovie();\n });\n}", "function Movie(dataMovie) {\n this.title = dataMovie.title;\n this.overview = dataMovie.overview;\n this.average_votes = dataMovie.vote_average;\n this.total_votes = dataMovie.vote_count;\n this.image_url = dataMovie.poster_path;\n this.popularity = dataMovie.popularity;\n this.released_on = dataMovie.release_date;\n}", "function movieThis(functionParameters) {\n\tif (functionParameters.length < 1) {\n\t\tfunctionParameters = \"Mr. Nobody\";\n\t};\n\trequest(\"http://www.omdbapi.com/?t=\" + functionParameters + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\t\tif(!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"imdbRating: \" + JSON.parse(body).imdbRating);\n\t\t\t// console.log(\"Title: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\tvar rotten;\n\t\t if(!JSON.parse(body).Ratings || !JSON.parse(body).Ratings[1]){\n rotten = \"No Rotten Tomatoes Score\"\n }\n else {\n rotten = JSON.parse(body).Ratings[1].Value\n }\n\n console.log(\"Rotten Tomatoes Rating: \" + rotten);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t} else {\n\t\t\tconsole.log(\"Movie Search Error\")\n\t\t}\n\n\t\t\n\n\t});\n}", "function movieThis(user) {\n if (user.length === 0) {\n user = \"Mr.Nobody\";\n }\n axios\n .get(\"http://www.omdbapi.com/?apikey=trilogy&t=\" + user)\n .then(function(response) {\n // console.log(response);\n // console.log(response.data);\n var rottenTomatoes = response.data.Ratings[1];\n // console.log(rottenTomatoes);\n if (rottenTomatoes === undefined) {\n rottenTomatoes = \"Unavailable\";\n } else {\n rottenTomatoes = response.data.Ratings[1].Value;\n }\n console.log(\"\");\n console.log(\n \"===== MOVIE ==========[ Searched: \" + response.data.Title + \" ]=====\"\n );\n console.log('===================================================================================================================================');\n // * Title of the movie.\n console.log(\"Title Of Movie: [ \" + response.data.Title + ' ]');\n // * Year the movie came out.\n console.log(\"Year Movie Published: [ \" + response.data.Year + ' ]');\n // * IMDB Rating of the movie.\n console.log(\"IMDB Rating: [ \" + response.data.imdbRating + ' ]');\n // * Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Rating: [ \" + rottenTomatoes + ' ]');\n // * Country where the movie was produced.\n console.log(\"Country Produced: [ \" + response.data.Country + ' ]');\n // * Language of the movie.\n console.log(\"Language: [ \" + response.data.Language + ' ]');\n // * Plot of the movie.\n console.log(\"Plot: [ \" + response.data.Plot + ' ]');\n // * Actors in the movie.\n console.log(\"Actors: [ \" + response.data.Actors + ' ]');\n console.log('===================================================================================================================================');\n })\n .catch(function(error) {\n console.log(\"MOVIE ERROR: \" + error);\n });\n}", "NextMovie() {\n // We need to remove killed movies.\n if ((this.state.posterIndex + 1) > this.state.posters.length - 1) {\n let alives = this.state.posters.filter(poster => {\n return poster.alive;\n });\n this.setState({\n posters: alives,\n posterIndex: 0\n });\n } else {\n this.setState(prevState => ({\n posterIndex: ((prevState.posterIndex + 1) > prevState.posters.length - 1 ? 0 : prevState.posterIndex + 1)\n }));\n }\n\n // Generates random time to kill and set timer.\n const randomTime = (Math.floor(Math.random() * (+3 - +1)) + +1) * 1000;\n setTimeout(this.KillMovie, 1500);\n }", "function addMovie(addedMovie) {\n AJAXRequest(serverURL, 'POST', addedMovie).then(getAllMovies)\n }", "function showMovies() {\r\n movies.forEach(function(movie) \r\n {\r\n fetch('https://www.omdbapi.com/?t=' + movie.title + '&apikey=789d41d5')\r\n .then(response => {\r\n return response.json();\r\n })\r\n .then(data =>\r\n {\r\n //creating the DOM elements for the movies to be displayed and adding attributes to give them function and styling\r\n \r\n const section = document.createElement('section');\r\n const article = document.createElement('article');\r\n const images = document.createElement('img');\r\n const imgDiv = document.createElement('div');\r\n imgDiv.setAttribute('class', 'imgDiv');\r\n\r\n images.src = data.Poster;\r\n images.alt = data.Title + 'poster';\r\n\r\n const h2 = document.createElement('h2');\r\n h2.innerHTML = data.Title;\r\n\r\n const button = document.createElement('button');\r\n button.innerHTML = 'Watch trailer';\r\n \r\n button.setAttribute('onClick', \"buttonClick(\"+movie.youtubeId+\")\");\r\n\r\n\r\n\r\n const expandDiv = document.createElement('div');\r\n expandDiv.setAttribute('class', 'description');\r\n const h3 = document.createElement('h3');\r\n const plot = document.createElement('p');\r\n const div2 = document.createElement('div');\r\n div2.setAttribute('class', 'rating');\r\n const ratingSource = document.createElement('p');\r\n const ratingValue = document.createElement('p');\r\n const age = document.createElement('p');\r\n\r\n h3.innerHTML = 'Description'\r\n plot.innerHTML = data.Plot;\r\n ratingSource.innerHTML = data.Ratings[0].Source;\r\n ratingValue.innerHTML = data.Ratings[0].Value;\r\n \r\n // Calculate the age of the movie using current date and the movies release date\r\n let today = new Date();\r\n let currentYear = today.getFullYear();\r\n\r\n age.innerHTML = currentYear - data.Year + \" years old\";\r\n \r\n // Creating DOM elements for the movie trailer\r\n const videoDiv = document.createElement('div');\r\n videoDiv.setAttribute('class', 'videoModal')\r\n const video = document.createElement('iframe');\r\n video.src = youtube.generateEmbedUrl(movie.youtubeId);\r\n videoDiv.setAttribute('class','videoModal');\r\n videoDiv.setAttribute('id',movie.youtubeId);\r\n\r\n // Append elements to the body\r\n section.appendChild(article);\r\n article.appendChild(imgDiv);\r\n imgDiv.appendChild(images);\r\n article.appendChild(h2);\r\n article.appendChild(button);\r\n article.appendChild(expandDiv);\r\n expandDiv.appendChild(h3);\r\n expandDiv.appendChild(plot);\r\n expandDiv.appendChild(div2);\r\n div2.appendChild(ratingSource);\r\n div2.appendChild(ratingValue);\r\n expandDiv.appendChild(age);\r\n article.appendChild(videoDiv);\r\n videoDiv.appendChild(video);\r\n\r\n document.getElementById('body').appendChild(section);\r\n })\r\n \r\n }\r\n \r\n ) \r\n}", "function movieThis(movie){\n //console.log(\"Movie This\");\n\n if (movie === undefined){\n movie = \"Mr. Nobody\";\n }\n //else movie = inputs[3];\n\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&apikey=\" + omdb).then(\n results => {\n //console.log(results.data);\n console.log(\"Title: \" + results.data[\"Title\"]);\n console.log(\"Year: \" + results.data[\"Year\"]);\n //console.log(\"IMDB Rating: \" + results.data[\"Ratings\"][0][\"Value\"]);\n console.log(\"IMDB Rating: \" + results.data[\"imdbRating\"]);\n console.log(\"Rotten Tomatoes Rating: \" + results.data[\"Ratings\"][1][\"Value\"]);\n console.log(\"Country: \" + results.data[\"Country\"]);\n console.log(\"Language: \" + results.data[\"Language\"]);\n console.log(\"Plot: \" + results.data[\"Plot\"]);\n console.log(\"Actors: \" + results.data[\"Actors\"]);\n },\n err => {\n console.log(err);\n }\n );\n}", "function movieThis(movieTitle) {\n request(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&plot=short&apikey=trilogy\", function (error, response, body) {\n if (JSON.parse(body).Response === 'False') {\n return console.log(JSON.parse(body).Error);\n }\n if (!movieTitle) {\n request(\"http://www.omdbapi.com/?t=Mr+Nobody&plot=short&apikey=trilogy\", function (error, response, body) {\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n })\n } else if (!error && response.statusCode === 200) {\n\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n }\n })\n}", "function movieThis(movieName) {\n\n // Default set as Mr. Nobody if user doesn't specify a movie.\n if (movieName == \"\") {\n movieName = \"Mr. Nobody\"\n }\n // Call to and responce from omdb API\n axios.get(\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=\" + process.env.MOVIE_SECRET)\n .then(function (response) {\n\n var data = response.data\n\n console.log(\"-------------------------------\");\n console.log(\"* Title: \" + data.Title);\n console.log(\"* Year: \" + data.Year);\n console.log(\"* IMDB: \" + data.Ratings[0].Value);\n console.log(\"* Roten Tomatoes: \" + data.Ratings[1].Value);\n console.log(\"* Country: \" + data.Country);\n console.log(\"* Language: \" + data.Language);\n console.log(\"* Plot: \" + data.Plot);\n console.log(\"* Actors: \" + data.Actors);\n console.log(\"---------------------------------\");\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "function moviesandTv() {\n let tvShowsUrl = 'https://api.themoviedb.org/3/';\n let category = $(\"input[type='radio']:checked\").val();\n let keyWord = getKeyWord();\n\n\n let QueryUrl = keyWord =='%20'? '' : `&query=${keyWord}&page=1&include_adult=false`;\n let search = keyWord =='%20'? 'discover': 'search';\n\n let queryUrl = `${tvShowsUrl}${search}/${category}?api_key=${moviesShowsAPI}${QueryUrl}`\n\n console.log(queryUrl)\n\n\n $.getJSON(queryUrl, function (data) {\n\n tvOrMovie = data.results;\n $('tvmovie_list li').remove();\n $('#tvmovie_list').empty();\n\n let title = category == 'movie' ? 'original_title' : 'original_name';\n let date = category == 'movie' ? 'release_date' : 'first_air_date';\n\n $.each(tvOrMovie, function (index, movie) {\n\n let poster = isImage(movie.poster_path);\n\n $('#tvmovie_list').append(`<li><a id=\"to_details\" data-transition=\"pop\" href=\"#\"><img id=\"image_content\"src=${poster}>\n <h2>${movie[title]}</h2>\n <p>${dateBeautify(movie[date])}</p>\n <span id=${index} class=\"ui-li-count\">${movie.vote_average.toFixed(1)}</span></a></li>`);\n });\n\n\n $('#tvmovie_list').listview('refresh');\n })\n}", "function Movie(name, genre, rating) {\n this.name = name;\n this.genre = genre;\n this.rating = rating;\n}", "function filmPoster(films){\n allFilms = films\n firstPoster();\n movieInfo();\n}", "async addFilm(film){\n return movie.create(film)\n }", "function addEventListeners() {\n $(`.deleteButton`).click(function (e) {// delete function\n e.preventDefault();\n const movieIdToDelete = $(this).attr(`data-id`);\n console.log(movieIdToDelete);\n deleteMovie(movieIdToDelete);\n })\n $('#submit-movie').click(function (e) {// add movie function\n e.preventDefault();\n let movieTitle = $('#title-input').val();//grabs what is typed in html and puts it into new card poster\n let moviePlot = $(\"#plot-input\").val();\n let movieRating = $(\"#rating-select\").val();\n let addedMovie = {title: movieTitle, plot: moviePlot, rating: movieRating};\n addMovie(addedMovie);\n console.log(addMovie);\n })\n $('.editMovie').click(function (e) {// edit movie info/ rating function\n e.preventDefault();\n // .modal(`show`)\n // .modal(`hide`)\n\n const movieToBeEdited = $(this).attr(`data-id`);\n // const originalMovie = localMovies.filter(movie => movieID == movie.id)[0]\n // $('#titles-input').val(originalMovie.year)\n console.log(movieToBeEdited);\n updateMovie(movieToBeEdited)\n\n // let movieRating = $(\"#rating-select\").val();\n updateMovie(movieToBeEdited); //old version updateMovie(addedMovie)\n console.log(updateMovie);\n // .modal(`hide`)\n })\n $('.loading').hide();\n }", "function movie(movieName){\n\tvar request = require('request');\n\n\tvar nodeArgs = process.argv;\n\n\tvar movieName = \"\";\n\n\tif (process.argv[3] == null){\n\n\t\tmovieName = \"Mr.Nobody\";\n\n\t}else{\n\n\t\tfor (var i=3; i<nodeArgs.length; i++){\n\n\t\t\tif (i>3 && i< nodeArgs.length){\n\n\t\t\tmovieName = movieName + \"+\" + nodeArgs[i];\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\tmovieName = movieName + nodeArgs[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\trequest('http://www.omdbapi.com/?t='+ movieName + '&y=&plot=short&r=json&tomatoes=true', function (error, response, body) {\n // If the request is successful (i.e. if the response status code is 200)\n\t\n\tif (!error && response.statusCode == 200) {\n\t\t\n\t\t// Parse the body of the site and recover just the imdbRating\n\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it). \n\t\tconsole.log( \"The movie title: \" + JSON.parse(body)[\"Title\"] +\n\t\t\t\"\\nThe movie release year: \" + JSON.parse(body)[\"Year\"] +\n\t\t\t\"\\nThe movie imdb rating: \" +JSON.parse(body)[\"imdbRating\"] +\n\t\t\t\"\\nThe movie Country of origin: \" +JSON.parse(body)[\"Country\"] +\n\t\t\t\"\\nThe movie language: \" +JSON.parse(body)[\"Language\"] +\n\t\t\t\"\\nThe movie plot: \" +JSON.parse(body)[\"Plot\"] +\n\t\t\t\"\\nThe movie actors: \" +JSON.parse(body)[\"Actors\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes score: \" +JSON.parse(body)[\"tomatoMeter\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes url: \" +JSON.parse(body)[\"tomatoURL\"]);\n\t\t}\n\t});\n}", "function movieThis(movie) {\n\n if (movie.length === 0) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + searchQuery + \"&y=&plot=short&apikey=trilogy\";\n }\n\n // axios method to recieve and print data\n axios.get(queryURL).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMBD Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n\n );\n}", "function movieThis(movie) {\n // if no argument entered, default argument\n if (!argument) {\n movie = \"Mr. Nobody\";\n }\n // search ombd API movie with movie\n axios\n .get(`https://www.omdbapi.com/?t=${movie}&apikey=trilogy`)\n // function to console log response when data is received\n .then(function(response) {\n console.log(\"\\n------------------------------------------\");\n console.log(`Movie Title: ${response.data.Title}`);\n console.log(`Year Released: ${response.data.Year}`);\n console.log(`Actors: ${response.data.Actors}`);\n console.log(`IMBD Rating: ${response.data.imdbRating}`);\n console.log(`Rotten Tomatoes Rating: ${response.data.Ratings[1].Value}`);\n console.log(`Produced in: ${response.data.Country}`);\n console.log(`Language: ${response.data.Language}`);\n console.log(`Plot: ${response.data.Plot}`);\n console.log(\"\\n\");\n })\n // if error, console logs error message\n .catch(function(err) {\n console.error(err);\n })\n}", "function runMovie(movieTitle) {\n console.log(\"*******************************************\");\n\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n // Parse the body of the site and recover just the imdbRating\n\n\n // (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n\n console.log(\"Movie Title: \" + JSON.parse(body).Title)\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"Movie Rating: \" + JSON.parse(body).Rated);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Country Where Movie Was Produced: \" + JSON.parse(body).Country);\n console.log(\"Language Produced: \" + JSON.parse(body).Language)\n console.log(\"Movie Plot: \" + JSON.parse(body).Plot)\n console.log(\"List of Actors: \" + JSON.parse(body).Actors)\n }\n });\n // Title of the movie.\n // * Year the movie came out.\n // * IMDB Rating of the movie.\n // * Rotten Tomatoes Rating of the movie.\n // * Country where the movie was produced.\n // * Language of the movie.\n // * Plot of the movie.\n // * Actors in the movie.\n}", "function Movie(title, releaseYear) {\n this.title = title;\n this.releaseYear = releaseYear;\n // this.logInfo = function() {\n // console.log(`${this.title} was released in ${this.releaseYear}`);\n // };\n}", "function movie(b) {\n console.log(\"*******omdb*******\");\n\n var movieName = \"\";\n //if called from text function b will hold moviename else will be empty\n if (b == \"\") {\n // default movie\n if (term.length == 3)\n movieName = \"Mr. Nobody\";\n else {\n // get console song input\n for (var i = 2; i < term.length; i++) {\n if (i > 2 && i < term.length)\n movieName = movieName + \"+\" + term[i];\n }\n }\n } else\n movieName = b;\n\n // api call\n var url = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=40e9cece\";\n\n request(url, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n result = JSON.parse(body);\n //console.log(result);\n //Title\n console.log(\"Title: \" + result.Title);\n //Year\n console.log(\"Year: \" + result.Year);\n //IMDB Rating\n console.log(\"IMDB Rating: \" + result.Ratings[0].Value);\n //RT rating\n if (typeof result.Ratings[1] != \"undefined\")\n console.log(\"Rotten Tomatoes Rating: \" + result.Ratings[1].Value);\n else\n console.log(\"No Rotten Tomatoes Rating.\");\n //Country Produced\n console.log(\"Produced In: \" + result.Country);\n //Plot\n console.log(\"Plot: \" + result.Plot);\n //Actors\n console.log(\"Actors / Actresses: \" + result.Actors);\n\n console.log(\"*****end omdb*****\");\n }\n if (error) {\n console.log(error);\n }\n });\n} //end movie", "function createMovie(e) {\n e.preventDefault();\n const title = $(\"#title\").val();\n if (title.length < 2) {\n return;\n }\n const rating = $(\"#rating\").val();\n const movieData = { title, rating, id: currentMovieID };\n movieMap.push(movieData);\n\n $(\"#movie-table\").append(createMovieHTML(movieData));\n $(\"#movie-form\").trigger(\"reset\");\n currentMovieID++;\n}", "function getMovie(){\n // this is exactly the same logic as the spotify function starts with\n // if there are search terms (aka userParameters), use them in the query\n // if there are not search terms, use a pre-defined default search\n let movieSearchTerm;\n\tif(userParameters === undefined){\n\t\tmovieSearchTerm = \"Mr. Nobody\";\n\t}else{\n\t\tmovieSearchTerm = userParameters;\n\t};\n // this is the queryURL that will be used to make the call - it holds the apikey, returns a \"short\" plot, type json, and \n // the tomatoes flag attempts to return rottenTomatoes data although most of that is now deprecated as of may 2017 \n let queryURL = 'http://www.omdbapi.com/?t=' + movieSearchTerm +'&apikey=trilogy&y=&plot=short&tomatoes=true&r=json';\n request(queryURL, function(error, response, body){\n\t if(!error && response.statusCode == 200){\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value);\n\t console.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW MOVIE SEARCH EVENT:\\nTitle: ${JSON.parse(body).Title}\\nYear: ${JSON.parse(body).Year}\\nIMDB Rating: ${JSON.parse(body).imdbRating}\\nRotten Tomatoes Score: ${JSON.parse(body).Ratings[1].Value}\\nCountry of Production: ${JSON.parse(body).Country}\\nLanguage: ${JSON.parse(body).Language}\\nPlot: ${JSON.parse(body).Plot}\\nActors: ${JSON.parse(body).Actors}\\n------\\n`, function(err) {\n });\n }\n });\n}", "async editMovieInCollection(ctx, movie) {\n let collection = await db.collection(auth.currentUser.uid).get();\n let number = 0;\n let film = ctx.getters.getSelectedMovie;\n await collection.forEach(doc => {\n Object.keys(doc.data()).forEach(function(key) { \n if(doc.data()[key].Actors == film.Actors && doc.data()[key].Director == film.Director && \n doc.data()[key].Genre == film.Genre && doc.data()[key].Plot == film.Plot && \n doc.data()[key].Title == film.Title && doc.data()[key].edition == film.edition && \n doc.data()[key].format == film.format && doc.data()[key].shelf == film.shelf && \n doc.data()[key].rating == film.rating) {\n if(number == 0) {\n db.collection(auth.currentUser.uid).doc(doc.id).set({\n movie\n });\n number = 1;\n }\n } \n });\n });\n number = 0;\n await ctx.dispatch('fetchUserCollection', auth.currentUser.uid);\n ctx.commit('setEditMovie', false);\n }", "function showMovieDetails(movie)\n{\n movieTitle.html(movie.title);\n movieDesc.html(movie.description);\n moviePoster.attr(\"src\", movie.posterImage.attr(\"src\"));\n movieView.on(\"click\", function() {\n window.location.href = \"/movie.html?imdb=\" + movie.imdb;\n });\n\n // Show info to user\n movieDetails.modal(\"show\");\n}", "async addFilm(film){\n return Movie.create(film)\n }", "function alertMovieName() {}", "getChosenMovie () {\n\t\t\t\treturn chosenMovie;\n\t\t\t}", "function addMovie(e) {\n e.preventDefault();\n\n var movie = {\n title: $('.title').html(),\n year: $('.year').html(),\n rating: $('.rating').html(),\n genre: $('.genre').html(),\n score: $('.score').html()\n };\n\n var id = $('.id').val();\n\n firebaseRef.once('value').then(function(snapshot) {\n var movie = {\n title: $('.title').html(),\n year: $('.year').html(),\n rating: $('.rating').html(),\n genre: $('.genre').html(),\n score: $('.score').html()\n };\n\n var id = $('.id').val();\n if (snapshot.hasChild('movies/' + id)) {\n updateTime();\n clearInterval(scoretimer);\n\n swal({\n title: 'Cheater!',\n text: 'You already watched this movie, so you don\\'t get any points. However, we\\'ll be nice and reset the timer for you ;)',\n type: 'info'\n });\n } else {\n firebaseRef.child('movies/' + id).set(movie);\n\n // to see if the batman movies were watched for badges\n var bb = snapshot.hasChild('movies/tt0372784');\n var tdk = snapshot.hasChild('movies/tt0468569');\n var tdkr = snapshot.hasChild('movies/tt1345836');\n\n // updates score\n score.increment(1000);\n\n $('#title_pic').html('');\n $('#results_title').html('');\n $('#add_title').html('');\n $('#search_title').val('');\n\n // updates the firebase timestamp to be the time the movie was added\n updateTime();\n\n // when the movie is added, they have another 30 seconds before losing 100 points\n clearInterval(scoretimer);\n\n // creates alerts and redirects to stats page if they choose for a feedback loop\n swal({\n title: '\"' + movie.title + '\" was added to your watched list, bringing your total score to ' + score.scorecard().score + '!',\n text: \"Would you like to view your current statistics?\",\n type: \"success\",\n showCancelButton: true,\n confirmButtonColor: \"#337ab7\",\n confirmButtonText: \"Yes, please!\",\n closeOnConfirm: false\n },\n function() {\n window.location = 'score.php';\n });\n\n if (number_watched == 1) {\n var firstwatch = {\n title: 'First Movie',\n desc: 'Watched 1st movie.'\n };\n addBadge(firstwatch);\n swal({\n title: 'You earned a badge!',\n text: 'You got the \"First Movie\" badge! Now to watch some more! Do you want to view the rest of your stats?',\n type: 'success',\n showCancelButton: true,\n confirmButtonColor: \"#337ab7\",\n confirmButtonText: \"Yes, please!\",\n closeOnConfirm: false\n },\n function() {\n window.location = 'score.php';\n });\n }\n\n if (number_watched == 10) {\n var filmbuff = {\n title: 'Film Buff',\n desc: 'Watched 10 movies.'\n };\n addBadge(filmbuff);\n swal({\n title: 'You earned a badge!',\n text: 'You got the \"Film Buff\" badge! You now understand obscure references to them in media. Would you like to view the rest of your stats?',\n type: 'success',\n showCancelButton: true,\n confirmButtonColor: \"#337ab7\",\n confirmButtonText: \"Yes, please!\",\n closeOnConfirm: false\n },\n function() {\n window.location = 'score.php';\n });\n }\n\n if ((bb === true && tdk === true && id == 'tt1345836') || (bb === true && id == 'tt0468569' && tdkr === true) || (id == 'tt0372784' && tdk === true && tdkr === true)) {\n var batman = {\n title: 'The Hero We Deserve',\n desc: 'Watched The Dark Knight trilogy.'\n };\n addBadge(batman);\n swal({\n title: 'You earned a badge!',\n text: 'You got the \"The Hero We Deserve\" badge! You now have our permission to die. Would you like to view the rest of your stats?',\n type: 'success',\n showCancelButton: true,\n confirmButtonColor: \"#337ab7\",\n confirmButtonText: \"Yes, please!\",\n closeOnConfirm: false\n },\n function() {\n window.location = 'score.php';\n });\n }\n\n if (id == 'tt2975590') {\n var bvs = {\n title: 'Save Marrrtthhha!',\n desc: 'Watched Batman v Superman.'\n };\n addBadge(bvs);\n score.increment(1000);\n swal({\n title: 'You earned a badge!',\n text: 'You got the \"Save Marrrtthhha!\" badge! For watching this pile of trash, you got an additional 1000 points. Would you like to view the rest of your stats?',\n type: 'success',\n showCancelButton: true,\n confirmButtonColor: \"#337ab7\",\n confirmButtonText: \"Yes, please!\",\n closeOnConfirm: false\n },\n function() {\n window.location = 'score.php';\n });\n }\n\n if (id == 'tt0137523') {\n var fc = {\n title: 'First Rule of Top of the Barrel',\n desc: 'Watched Fight Club.'\n };\n addBadge(fc);\n swal({\n title: 'You earned a badge!',\n text: 'You got the \"First Rule of Top of the Barrel\" badge! We\\'re not sure we should be giving you these points because you broke the first rule... Would you like to view the rest of your stats?',\n type: 'success',\n showCancelButton: true,\n confirmButtonColor: \"#337ab7\",\n confirmButtonText: \"Yes, please!\",\n closeOnConfirm: false\n },\n function() {\n window.location = 'score.php';\n });\n }\n }\n });\n}", "function addMovieToWishlist(movie_id) {\n\t// Reset timer in case it's ticking\n\ttimerInf = \"\";\n\tshowInfo('Adding...', false);\n\t$.post('/library/add_movie_wishlist/' + movie_id + '/', function(msg) {\n\t\tif(msg == 'err_login') {\n\t\t\tshowInfo('You need to <a href=\"/login\">log in</a> or <a href=\"/register\">register</a> to add a movie to your wish list.', false);\n\t\t} else if(msg == 'alr') {\n\t\t\tshowInfo('You have already added this movie to your wish list.', true);\n\t\t} else if(msg == 'no_movie') {\n\t\t\tshowInfo('You have not selected a movie.', true);\n\t\t} else {\n\t\t\tshowInfo('The movie has been added to your wish list.', true);\n\t\t\t$('#movie_img_favorite_' + movie_id).attr('src', '/site_media/imgs/favorite_16.png');\n\t\t}\n\t});\n}", "function movieThis (movieName) {\n\t//if user does not provide any movie, then default then we assign it a movie\n\tif(movieName === \"\"){\n\t\tmovieName = \"Mr. Nobody\"\n\t}\n\n\t//making custom url for OMDB query search. \n\tvar customURL = \"http://www.omdbapi.com/?t=\"+ movieName +\"&y=&plot=short&tomatoes=true&r=json\";\n\n\t//getting data and printing it on terminal\n\trequestFS(customURL, function (error, response, body) {\n\t\tvar movieData = JSON.parse(body);\n\t\tif (!error && response.statusCode == 200) {\n\t\t\tconsole.log(\"Title: \" + movieData.Title);\n\t\t\tconsole.log(\"Year: \" + movieData.Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + movieData.imdbRating);\n\t\t\tconsole.log(\"Country: \" + movieData.Country);\n\t\t\tconsole.log(\"Lanugage(s): \" + movieData.Language);\n\t\t\tconsole.log(\"Plot: \" + movieData.Plot);\n\t\t\tconsole.log(\"Actors: \" + movieData.Actors);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + movieData.tomatoMeter);\n\t\t\tconsole.log(\"Rotten Tomatoes Link: \" + movieData.tomatoURL);\n\t \t}\n\t});\n}", "function Movie(data) {\n this.title = data.title;\n this.overview = data.overview;\n this.average_votes = data.vote_average;\n this.total_votes = data.vote_count;\n this.image_url = `https://image.tmdb.org/t/p/w500/${data.poster_path}`;\n this.popularity = data.popularity;\n this.released_on = data.release_date;\n}", "function dramaMoviesRate() {\n\n}", "function createNewItem(){\n var title = getNewMovieTitle();\n\n var user = Parse.User.current();\n var username = user.get(\"username\");\n\n var viewable;\n\n //Check if field is filled\n if(checkEmptynessOfInputfield()){\n\n //Remove Error\n $(\"#errorContainer\").html(\"\");\n destroyErrorField();\n \n //Check whether the Movie exists\n var exists = checkIfMovieExists(title);\n \n if(exists){\n //Movie already exists\n $(\"#errorContainer\").html(\"<span class='error'>Dieser Film befindet sich bereits in der Datenbank</span>\"); \n makeErrorField();\n }else{\n //Detect the User\n var user = Parse.User.current();\n\n var item = {\n \"name\":title,\n \"user\":user,\n \"isSeen\": false,\n \"ration\": 0,\n \"seenButton\":createId(title,8),\n \"owner\": username\n };\n\n if(item.isSeen){\n\n }else{\n viewable = createLoggedInObject(item);\n viewable.isSeenHtml = _.template(notSeenButtonTemplate, {provider:item});\n }\n\n //Save item to Parse\n saveItemToParse(item);\n \n //Save the rating object\n saveRateObject(title);\n\n //Append the Item\n appendNewMovie(viewable);\n\n //Toggle Toolbar to new Item\n toggleToolBar(); \n }\n\n //Clear the Field\n clearInputField();\n }else{\n $(\"#errorContainer\").html(\"<span class='error'>Feld darf nicht leer sein</span>\");\n makeErrorField();\n }\n}", "function setMostRatedMovie(movie_id){\n var req = new XMLHttpRequest()\n var url = URL_SERVER + movie_id + URL_FORMAT\n\n req.open('Get', url)\n req.responseType = 'json'\n req.addEventListener('load', function() {\n response = this.response\n title_node = body.querySelector(\"#most_rated_title\")\n title_node.textContent = response['title']\n img_node = body.querySelector(\"#most_rated_img\")\n img_node.setAttribute(\"src\",response['image_url'])\n desc_node = body.querySelector(\"#most_rated_description\")\n desc_node.textContent = response['description']\n most_rated_movie_id = response['id']\n })\n req.send()\n}", "function postMovie(e){\n\tresetFilmNumbers();\n\n\n\t//Get the 'target'; the element that the user clicks on\n\tvar target = e.target;\n\n\t//Checking for a \"generator\" case and 'explode()'s if yes\n\t\n\tif(target.id === \"generator\" && data.genStory){\n\n\t\t//checking for age appropriateness\n\t\tdata.dark = ageApp(data.filmData);\n\n\t\t//explosion\n\t\texplode();\n\n\t\t//clear button\n\t\tget(\"theButton\").innerHTML = \"\"; \n\t}\n\n\t//If it's an \"add\" case...\n\telse if(target.id === \"adder\"){\n\n\t\t//get the year\n\n\t\tvar yearInt = parseInt(elYear.value);\n\n\t\t//if input is okay...\n\n\t\tif(elMovie.value !== \"Title\" && elMovie.value && elYear.value !== \"Year\" && 2016 > yearInt && yearInt > 1890){\n\n\t\t\tvar movieTitle = elMovie.value;\n\t\t\tvar year = elYear.value;\n\n\t\t\t//smooth out the title to make it easy for the API, build the request URL\n\t\t\t// from there\n\t\t\tvar urlToCall = urlBuild(titleSmoother(movieTitle), year);\n\n\t\t\t//request the data, mrSulu! \n\t\t\tmrSulu(urlToCall);\n\t\t\t\n\t\t}\n\n\t\t//With the logic of Spock, we can determine if the fields filled out in the \n\t\t//form are okay or not. \n\n\t\t//Basically, this tests for acceptable data entered into the form field. \n\t\t//If not, it will update the \"feedback\" tag right above the form, so the \n\t\t//user can read it and act accordingly. Live long and prosper!\n\t\t\n\t\telse{\n\n\t\t\tif((elMovie.value === \"Title\" || !elMovie.value) && (isNaN(parseInt(elYear.value)) || typeof parseInt(elYear.value) !== \"number\" || 2016 < parseInt(elYear.value) || parseInt(elYear.value) < 1890)){\n\t\t\t\t//clear the feedback paragraph\n\t\t\t\tget(\"feedback\").innerHTML = \"\";\n\t\t\t\t//update with error\n\t\t\t\tdomMan(\"p\", tNode(\"Valid movie title and year required\"), get(\"feedback\"));\n\t\t\t\tget(\"movie\").focus();\n\t\t\t}\n\n\t\t\telse if(isNaN(parseInt(elYear.value)) || typeof parseInt(elYear.value) !== \"number\" || 2016 < parseInt(elYear.value) || parseInt(elYear.value) < 1890){\n\t\t\t\t//clear the feedback paragraph\n\t\t\t\tget(\"feedback\").innerHTML = \"\";\n\t\t\t\t//update with error\n\t\t\t\tdomMan(\"p\", tNode(\"Please enter valid year between 1890 and 2015\"), get(\"feedback\"));\n\t\t\t\tget(\"year\").focus();\n\t\t\t}\n\t\t\n\t\t\telse{\n\t\t\t\t//clear the feedback paragraph\n\t\t\t\tget(\"feedback\").innerHTML = \"\";\n\t\t\t\t//update with error\n\t\t\t\tdomMan(\"p\", tNode(\"Movie title required\"), get(\"feedback\"));\n\t\t\t\tget(\"movie\").focus();\n\t\t\t}\n\t\t}\n\t}\n}", "function movieThis() {\n\n\t// if user enters a value - process.argv[3]\n\n\tif (value) {\n\n\t \t// Create an empty variable for holding the movie name\n\n\t\tvar movieName = \"\";\n\n\t} // end of if no movie title was entered\n\n\t// else no movie title was entered search Mr. Nobody\n\n\telse {\n\n\t\tmovieName = \"Mr. Nobody\";\n\n\t} // end of else\n\n\t// Change any \" \" to + in the movie title\n\n\tfor (var i = 3; i < nodeArgs.length; i++){\n\n\t\t// if the movie has more than one word\n\n\t if (i > 3 && i < nodeArgs.length){\n\n\t movieName = movieName + \"+\" + nodeArgs[i];\n\n\t } // end of if there are spaces\n\n\t // the first word of the movie title\n\n\t else {\n\n\t movieName = movieName + nodeArgs[i];\n\n\t } // end of else\n\n\t} // end of for loop\n\n\t// OMDB API request \n\n\tvar queryUrl = 'http://www.omdbapi.com/?t=' + movieName +'&tomatoes=true';\n\n\trequest(queryUrl, function (error, response, body) {\n\n\t // If the request is successful \n\n\t if (!error && response.statusCode == 200) {\n\n\t // Parse the body of the site so that we can pull different keys more easily\n\t \n\t body = JSON.parse(body);\n\t console.log(\"Title: \" + body.Title);\n\t console.log(\"Year: \" + body.Year);\n\t console.log(\"IMDB Rating: \" + body.imdbRating);\n\t console.log(\"Country: \" + body.Country);\n\t console.log(\"Language: \" + body.Language);\n\t console.log(\"Plot: \" + body.Plot);\n\t console.log(\"Actors: \" + body.Actors);\n\t console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n\t console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n\n\t // store information as a string\n\n\t\t\tlogText = JSON.stringify({\n\t\t\t\ttitle: body.Title,\n\t\t\t\tyear: body.Year,\n\t\t\t\timdbRating: body.imdbRating,\n\t\t\t\tcountry: body.Country,\n\t\t\t\tlanguage: body.Language,\n\t\t\t\tplot: body.Plot,\n\t\t\t\tactors: body.Actors,\n\t\t\t\trottenRating: body.tomatoRating,\n\t\t\t\trottenURL: body.tomatoURL\n\t\t\t}); // end of logText stringify\n\n\t\t\t// log information in logText in log.txt\n\n\t\t\tlogInfo();\n\n\t \n\t } // end of if the request is successful\n\t}); // end of request\n\n} // end of movie-this function", "function movieThis(receivedMovie) {\n\n\t// first save the name of the movie if provided from command line\n\t// otherwise default to \"Mr. Nobody\"\n\t// use ternary function for ease of use\n\tvar myMovie = receivedMovie ? receivedMovie : 'Mr. Nobody';\n\n\t// Then run a request to the OMDB API with the movie specified\n\tRequest(\"http://www.omdbapi.com/?t=\" + myMovie + \"&y=&plot=short&r=json&tomatoes=true\", function (error, response, body) {\n\n\t\t// If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// log the command issued to the log.txt file\n\t\t\tlogCommand();\n\n \t\t// Parse the returned data (body) and display movie info\n \t\tlogThis('Movie Title: ' + JSON.parse(body).Title);\n \t\tlogThis('Release Year: ' + JSON.parse(body).Year);\n \t\tlogThis('IMDB Rating: ' + JSON.parse(body).imdbRating);\n \t\tlogThis('Production Country: ' + JSON.parse(body).Country);\n \t\tlogThis('Language: ' + JSON.parse(body).Language);\n \t\tlogThis('Plot: ' + JSON.parse(body).Plot);\n \t\tlogThis('Actors/Actresses: ' + JSON.parse(body).Actors);\n \t\tlogThis('Rotten Tomatoes Rating: ' + JSON.parse(body).tomatoRating);\n \t\tlogThis('Rotten Tomatoes URL: ' + JSON.parse(body).tomatoURL);\n \t\t}\n\n \t// end the request function\n\t});\n\n// end the movieThis function\n}", "function searchForMovie() {\n let userMovie = \"Django Unchained\";\n let queryURL =\n \"https://api.themoviedb.org/3/search/movie?api_key=\" +\n API_KEY +\n \"&language=en-US&query=\" +\n userMovie;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n // console.log(response);\n // let title = response.results[0].title;\n // let posterURL = response.results[0].poster_path;\n // let rating = response.results[0].vote_average;\n // let releaseDate = response.results[0].release_date;\n // let summary = response.results[0].overview;\n // let genreID = response.results[0].genre_ids[0];\n let movieID = response.results[0].id;\n let streaming = whereToWatch(movieID);\n // object.entries\n let movie = {\n title: response.results[0].title,\n year: response.results[0].release_date,\n // rated: ????,\n genre: response.results[0].genre_ids[0],\n plot: response.results[0].overview,\n poster:\n \"https://image.tmdb.org/t/p/w500\" + response.results[0].poster_path,\n rating: response.results[0].vote_average,\n streaming: streaming,\n // user: ????,\n // watched: ????\n };\n\n // Poster Path: \"https://image.tmdb.org/t/p/w500\" + POSTER_URL;\n });\n}", "function movieCommand() {\n if (process.argv[3] === undefined && randomSearch === undefined) {\n title = \"Mr. Nobody\"\n } else if (randomSearch !== undefined) {\n title = randomSearch\n } else {\n title = process.argv[3];\n };\n // Request info from omdb api\n request(\"http://www.omdbapi.com/?t=\" + title + \"&y=&plot=short&apikey=trilogy\", function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"Your search is complete! Let's take a look...\" +\n \"\\nTitle: \" + JSON.parse(body).Title +\n \"\\nYear Released: \" + JSON.parse(body).Released +\n \"\\nIMDB Rating: \" + JSON.parse(body).imdbRating +\n \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value +\n \"\\nProduction Location(s): \" + JSON.parse(body).Country +\n \"\\nLanguage: \" + JSON.parse(body).Language +\n \"\\nPlot: \" + JSON.parse(body).Plot +\n \"\\nActors: \" + JSON.parse(body).Actors);\n log(\"movie-this was run and returned the following informtion: \"+\n \"\\nTitle: \" + JSON.parse(body).Title +\n \"\\nYear Released: \" + JSON.parse(body).Released +\n \"\\nIMDB Rating: \" + JSON.parse(body).imdbRating +\n \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value +\n \"\\nProduction Location(s): \" + JSON.parse(body).Country +\n \"\\nLanguage: \" + JSON.parse(body).Language +\n \"\\nPlot: \" + JSON.parse(body).Plot +\n \"\\nActors: \" + JSON.parse(body).Actors+\n \"\\n------------------------------------------------------------\"\n );\n };\n });\n}", "function movies(input) {\n\n var movieTitle;\n if (input === undefined) {\n movieTitle = \"Cool Runnings\";\n } else {\n movieTitle = input;\n };\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=b41b7cf6\";\n\n request(queryURL, function (err, res, body) {\n var bodyOf = JSON.parse(body);\n if (!err && res.statusCode === 200) {\n logged(\"\\n---------\\n\");\n logged(\"Title: \" + bodyOf.Title);\n logged(\"Release Year: \" + bodyOf.Year);\n logged(\"Actors: \" + bodyOf.Actors);\n logged(\"IMDB Rating: \" + bodyOf.imdbRating);\n logged(\"Rotten Tomatoes Rating: \" + bodyOf.Ratings[1].Value);\n logged(\"Plot: \" + bodyOf.Plot);\n logged(\"\\n---------\\n\");\n }\n });\n}", "function omdbThis(movieEntered) {\n // if no movie is entered, defaults to \"Mr. Nobody\"\n if (movieEntered === undefined || null) {\n movieEntered = \"Mr.Nobody\";\n console.log(\"If you haven't watched 'Mr. Nobody', then you should: \")\n console.log(\"It's on Netflix!\")\n }\n\n // request to omdb api with a movie\n var searchUrl = \"http://www.omdbapi.com/?t=\" + movieEntered + \"&y=&plot=short&apikey=trilogy\";\n\n console.log(searchUrl);\n\n request(searchUrl, function (error, response, body) {\n // if request is successful \n if (!error && response.statusCode === 200) {\n //json parse\n var movieData = JSON.parse(body);\n\n console.log(\"========================\");\n // title of movie\n console.log(\"Movie Title: \" + movieData.Title +\n // year released\n \"\\nYear Released: \" + movieData.Released +\n // IMDB rating\n \"\\nIMDB Rating: \" + movieData.imdbRating +\n // Rotten Tomatoes rating\n \"\\nRotten Tomatoes Rating: \" + movieData.Ratings[1].Value +\n // countries movie was produced\n \"\\nCountry Produced: \" + movieData.Country +\n // language \n \"\\nLanguage: \" + movieData.Language +\n // plot\n \"\\nPlot: \" + movieData.Plot +\n // actors\n \"\\nActors: \" + movieData.Actors +\n \"\\n========================\");\n \n };\n });\n}", "function movieThis(movieName) {\n console.log(\"movie is working\");\n if (movieName === undefined) {\n movieName = \"Mr Nobody\";\n }\n\n var movieUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=trilogy\";\n\n axios.get(movieUrl).then(\n function (response) {\n var movieData = response.data;\n\n console.log(\"Title: \" + movieData.Title);\n console.log(\"Year: \" + movieData.Year);\n console.log(\"Rated: \" + movieData.Rated);\n console.log(\"IMDB Rating: \" + movieData.imdbRating);\n console.log(\"Country: \" + movieData.Country);\n console.log(\"Language: \" + movieData.Language);\n console.log(\"Plot: \" + movieData.Plot);\n console.log(\"Actors: \" + movieData.Actors);\n console.log(\"Rotten Tomatoes Rating: \" + movieData.Ratings[1].Value);\n }\n );\n}", "function Movie(title, runTime, yearReleased, genre, description) {\n this.title = title;\n this.runTime = runTime;\n this.yearReleased = yearReleased;\n this.genre = genre;\n this.description = description;\n this.checkedIn = true;\n}", "function showMovie(response) {\n let movie = response;\n\n //neki filmovi/serije imaju vise rezisera, glumaca i zanrova i da bi ljepse mogli da ih prikazemo na stranici od stringa koji dobijemo napravimo niz elemenata\n var str = movie.Actors;\n var str2 = movie.Director;\n var str3 = movie.Genre;\n\n var stars = str.split(\", \");\n var directors = str2.split(\", \");\n var genres = str3.split(\", \");\n\n //ukoliko nemamo podatke o slici prikazemo default sliku iz foldera\n if (movie.Poster == \"N/A\") {\n movie.Poster = \"./Images/default.jpg\";\n }\n\n //prikazujemo redom podatke\n $(\"#movie-title-name\").append(movie.Title + ' <span id=\"movie-year\"></span>');\n $(\"#movie-year\").append(movie.Year);\n\n //ukoliko IMDb ocjene nisu dostupne, prikazemo odgovarajucu poruku\n if (movie.imdbRating === 'N/A') {\n $(\"#movie-rating\").append('<span>Ratings are not available<span>');\n } else {\n $(\"#movie-rating\").append(movie.imdbRating + '/10 <span>' + movie.imdbVotes + ' votes </span>');\n }\n\n $(\"#img\").append('<img src=' + movie.Poster + ' alt=\"\">');\n\n if (movie.Plot === 'N/A') {\n $('#movie-description').append('Plot is not available at this moment. :)');\n } else {\n $('#movie-description').append(movie.Plot);\n }\n\n directors.forEach(director => {\n $('#movie-director').append('<p>' + director + '</p>');\n });\n\n stars.forEach(star => {\n $('#movie-stars').append('<p>' + star + '</p>');\n });\n\n genres.forEach(genre => {\n $('#movie-genre').append('<p>' + genre + '</p>');\n });\n\n $('#movie-released').append(movie.Released);\n $('#movie-runtime').append(movie.Runtime);\n\n //ukoliko je Type -> serija onda prikazemo ukupan broj sezona \n //prikazemo i select sa svim sezonama te serije gdje na klik mozemo prikazati sve epizode odredjene sezone\n //po defaultu je selectovana poslednja sezona serije, kako bi odmah pri ulasku u seriju imali izlistane epizode \n if (movie.Type == 'series') {\n $('#movie-seasons').append('<h3>Seasons:</h3><p>' + movie.totalSeasons + '</p>');\n\n $('#series-season').append(\n '<p class=\"heading-des\">Episodes> ' +\n '<select onchange=\"getSeason(\\'' + movie.Title + '\\')\" id=\"select-episodes\">' +\n '</select>' +\n '</p>' +\n '<hr class=\"about\">' +\n '<div class=\"description\">' +\n '<div id=\"episodes\">' +\n '</div>' +\n '</div>'\n )\n }\n\n $('#movie-cast').append(\n '<p>Director: ' + movie.Director + '</p>' +\n '<p>Writer: ' + movie.Writer + '</p>' +\n '<p>Stars: ' + movie.Actors + '</p>'\n )\n\n if (movie.Ratings.length == 0) {\n $('#movie-reviews').append('<p>Ratings are not available at this moment. :)</p>')\n } else {\n movie.Ratings.forEach(rating => {\n $('#movie-reviews').append('<p>' + rating.Source + ' --> ' + rating.Value + '</p>')\n });\n }\n\n if (movie.Awards === 'N/A') {\n $('#movie-awards').append('Awards are not available at this moment. :)');\n } else {\n $('#movie-awards').append(movie.Awards);\n }\n\n $('#movie-imdb-btn').append(\n '<button onClick=\"openImdbPage(\\'' + movie.imdbID + '\\')\" class=\"btn-imdb\">' +\n '<i class=\"fab fa-imdb\"></i> IMDb' +\n '</button>'\n )\n\n //za ukupan broj sezona serije ispunimo select sa tolikim brojem opcija\n for (i = 1; i <= movie.totalSeasons; i++) {\n $('#select-episodes').append(\n '<option selected=\"selected\" value=\"\\'' + i + '\\'\">Season ' + i + '</option>'\n )\n }\n\n if (movie.Type === \"series\") {\n\n //prikazemo sve epizode selektovane sezone\n getSeason(movie.Title);\n\n }\n\n //ukoliko smo otvorili epizodu prikazemo na stranici na kojoj smo epizodi i sezoni \n //i prikazemo dugme za povratak na seriju\n if (movie.Type === \"episode\") {\n $(\"#episode-details\").append(\n '<span class=\"episode-span\">Season ' + movie.Season + ' </span>' +\n '<span class=\"season-span\">Episode ' + movie.Episode + '</span>'\n )\n $(\"#button-tvshow\").append(\n '<button onClick=\"openMovie(\\'' + movie.seriesID + '\\')\" class=\"btn-search\">' +\n '<i class=\"fas fa-chevron-left\"></i>' +\n ' Back to TV Show' +\n '</button>'\n )\n }\n}", "displayRelatedMovie(movies) {\n // It create all html element with movie data\n this.createRelatedMovie(movies)\n }", "function Movie(response) {\n this.title = response.Title;\n this.year = response.Year;\n this.imdbRating = response.imdbRating;\n this.rottenRating = response.Ratings[1].Value;\n this.country = response.Country;\n this.language = response.Language;\n this.plot = response.Plot;\n this.actors = response.Actors;\n}" ]
[ "0.6556113", "0.6547793", "0.64192307", "0.62632614", "0.6205357", "0.6180932", "0.6112547", "0.6005892", "0.59823346", "0.59118795", "0.59071213", "0.58952785", "0.5892452", "0.5883365", "0.58751285", "0.5867206", "0.5862421", "0.5854426", "0.5840176", "0.5837168", "0.5817558", "0.57890826", "0.57720953", "0.57532555", "0.5746562", "0.57347184", "0.5726826", "0.5725873", "0.5717302", "0.57072496", "0.5701167", "0.56998223", "0.5697671", "0.56961966", "0.569459", "0.56824774", "0.5674698", "0.5672867", "0.5670195", "0.56604767", "0.56523", "0.56158936", "0.56079817", "0.5605637", "0.56047726", "0.5597352", "0.5584792", "0.5574829", "0.55734557", "0.55683386", "0.55639577", "0.5563325", "0.55584574", "0.55508035", "0.5548213", "0.554363", "0.5542436", "0.5530545", "0.55290705", "0.5519965", "0.55139774", "0.55134445", "0.5510316", "0.55083996", "0.5506898", "0.55007136", "0.54978", "0.5495148", "0.5489446", "0.5476906", "0.54731506", "0.5468704", "0.5466666", "0.5462553", "0.54579306", "0.5457697", "0.54561466", "0.54557735", "0.5454138", "0.54530895", "0.5449312", "0.54485095", "0.54469496", "0.54447377", "0.54433095", "0.544133", "0.54342526", "0.543259", "0.5428739", "0.5426731", "0.5426508", "0.5426232", "0.54116803", "0.54079354", "0.5407608", "0.54039025", "0.5398995", "0.53943163", "0.53932214", "0.5391239" ]
0.59363234
9
compoundInterest p is the principal (how much you are borrowing) r is the interest rate n is how many times per year you are adding interest t is how many years you are paying it off in Example: compoundInterest(30000, 0.08, 12, 4) Loan of 30k, 8% interest, 12 times a year, over 4 years
function compoundInterest (p, r, n, t) { return p * Math.pow(1 + (r/n) , n*t); // Math.pow(2, 8); // 2 ** 8 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compoundInterest(principle, interest_rate, time) {\n interest = principle * ((1 + interest_rate/100) * time);\n return interest\n}", "function computeCompoundInterest( principal, interestRate, frequency, timeInYears ) {\n return principal * (Math.pow( 1 + interestRate / frequency, frequency * timeInYears ) ) - principal;\n}", "function simpleInterest(p, r, t){\n return((p * r * t)/100);\n}", "function interest3(principal, rate = 3.5, years = 5) {\n return principal * rate / 100 * years;\n}", "function interest(principal, rate = 3.5, years = 5) {\n return principal * rate / 100 * 100 * years;\n}", "function interest(principal, rate = 3.5, years = 5) {\n return ((principal * rate) / 100) * years;\n}", "function interest(principal, rate, years) {\n return principal * rate / 100 * 100 * years;\n}", "function interest(principal, rate = 3.5, years = 5) {\n // rate = rate || 3.5;\n // years = years || 5;\n return principal * rate/ 100 * years;\n}", "function interest2(principal, rate, years) {\n // so if rate has a value we will use that \n // if it doesn't we will use the number we defined \n rate = rate || 3.5;\n years = years || 5;\n return principal * rate / 100 * years;\n}", "calcinterest() {\n return (this.balance * this.int_rate);\n }", "function calculatingCompound(e) {\n e.preventDefault();\n //getting the values of the inputs\n var principal = parseFloat(document.querySelector('#compoundInterest #prin').value);\n var rate = parseFloat(document.querySelector('#compoundInterest #rating').value);\n var time = parseFloat(document.querySelector('#compoundInterest #timing').value);\n\n // the compound interest formula\n var first = (1 + (rate / 100));\n var second = Math.pow(first, time);\n var result = parseFloat(principal * second);\n\n //displaying the output in the compound input\n var resultInput = document.querySelector('#compoundResult');\n resultInput.value = result;\n}", "function presentValue(interest_rate,coupon_value,years_to_maturity,par_value) {\n var sum = par_value / Math.pow(1 + interest-rate,years_to_maturity);\n for (var k = 1 ; k <= years_to_maturity ; k++) {\n sum += coupon_value / Math.pow(1 + interst_rate, k);\n }\n return sum;\n}", "function interestCalculator(r, balance, n, monthly_payment){\n \n //put all results in arrays to return out of the function\n let interest_array = [];\n let principal_array = [];\n //let remainder_array = [];\n let month_array = [];\n let balance_array = [];\n let total_interest_array = [];\n\n var interest_payment;\n var remainder;\n var x;\n let costObj = {};\n\n //iterate over the number of payment periods \n for (let i = 0; i < n; i++) {\n\n //what month are you paying?\n month_array.push(i+1);\n\n //how much interest are you paying this month?\n if (balance_array.length == 0) {\n interest_payment = r*balance.toFixed(2);\n interest_array.push(interest_payment);\n }\n else {\n interest_payment = r*balance_array[i-1].toFixed(2);\n interest_array.push(interest_payment);\n }\n \n \n //how much of payment goes towards principal?\n let prince_payment = monthly_payment - interest_payment;\n principal_array.push(prince_payment);\n \n //how much principal do you still owe? \n if (balance_array.length == 0) {\n remainder = balance - prince_payment;\n balance_array.push(remainder); // 0th item in balance remainder\n }\n else {\n remainder = balance_array[i-1] - prince_payment;\n balance_array.push(remainder); // 0th item in balance remainder\n }\n \n //update balance array that was passed into function\n //balance_array.push(remainder.toFixed(2));\n //check this out!\n x = balance_array.length;\n\n }\n\n //sum all the values in the interest array\n let int_length = interest_array.length;\n let total_interest = 0;\n\n for (let i = 0; i < int_length; i++) {\n //add the interest value for the ith, month, to the total interest\n total_interest += interest_array[i];\n //accumulated total interest\n total_interest_array.push(total_interest);\n }\n\n //Calculate total cost\n //let total_cost = balance[0] + total_interest;\n\n costObj.remaining_balance = balance_array;\n costObj.total_interest = total_interest;\n //costObj.total_cost = total_cost.toFixed(2);\n costObj.interest_payments = interest_array;\n costObj.principal_payment = principal_array;\n costObj.months = month_array;\n costObj.total_interest_array = total_interest_array;\n //costObj.principal_balance = remainder_array;\n\n return costObj;\n\n //am I allowed to return different data types from one function?\n //return [interest_array, principal_array, remainder_array, total_cost];\n\n}", "function mortgageInterest() {\n var mortgage = plan.mortgage;\n // Create an amortization schedule. Takes four parameters: principle amount, months, interest rate (percent), start date (Date object).\n // Returns an array of payment objects { principle, interest, payment, paymentToPrincipal, paymentToInterest, date }\n var amortTable = finance.calculateAmortization(plan.mortgage.initialBalance, plan.mortgage.currentTerm*12, plan.mortgage.currentRate*100, plan.mortgage.startDate);\n\n // Total up how much of the payment will go to interest over the current year.\n var current = new Date(new Date().getFullYear(), 00); // Date object for current year.\n var start = (current.getFullYear() - plan.mortgage.startDate.getFullYear())*12 + (12 - plan.mortgage.startDate.getMonth());\n var end = start + 12;\n var interestPayment = 0;\n for (var i=start; i<end; i++) {\n interestPayment += amortTable[i].paymentToInterest;\n }\n return interestPayment;\n }", "function calculateYears(principal, interest, tax, desired) {\n let p = principal\n let int = interest\n let t = tax\n let d = desired\n if(d <= p){\n return 0\n }\n \n let years = 0\n \n for( let i = 0; i < desired; i++) {\n let bonus = p * int \n bonus -= (bonus * t)\n \n p += bonus\n years ++\n if(p >= d) {\n return years\n }\n }\n }", "function simpleInterest(amount, rate, time) {\n rate = rate / 100;\n console.log(rate);\n let interest = amount * (1 + (rate * time));\n return interest;\n}", "compound(){\r\n var principal=this.$.principal.value;\r\n var annual=this.$.annual.value;\r\n var peroid=this.$.peroid.value;\r\n // calculating matured amount\r\n // this.Amount = ((principal*(1+annual)^peroid)-principal);\r\n this.Amount =(principal*annual)*(((1+annual)^peroid)/(((1+annual)^Period)-1));\r\n }", "function calcCompoundInterest(filename,callback){\n\n\t//helper funtion for prettyNr\n\t// get at most 2 decimals behind dot\n\tlet functionsObject = {\n\t\troundDecimal: (number) => {\n\t\t\treturn Math.round(number * 100) / 100;\n\t\t},\n\n\t\t//helper funtion for prettyNr\n\t\t//get commas at every 1000\n\t\taddCommas: (number) => {\n\t\t\treturn number.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n\t\t},\n\n\t\t//add commas and round to twoe decimals\n\t\tprettyNr: (number) => {\n\t\t\treturn functionsObject.addCommas(functionsObject.roundDecimal(number))\n\t\t}\n\t}\n\n\t//read the customer data json\n\t// () => {} short way to write a function\n\t// (err, data) => {} same as function(err, data){}\n\tfs.readFile(__dirname + \"/\" + filename, 'utf-8', (err, data) => {\n\t\t// let = another var: The difference is scoping. var is scoped to the nearest function block and let is scoped to the nearest enclosing block (both are global if outside any block), which can be smaller than a function block. Also, variables declared with let are not accessible before they are declared in their enclosing block. As seen in the demo, this will throw an exception.\n\t\t//parse the file to a readable (customer) object\n\t\tlet parsedData = JSON.parse(data);\n\t\t//check if it does read the json-file\n\t\t//console.log(parsedData);\n\n\t\tcalculate(parsedData, functionsObject, callback);\n\t})\n\n\t\t//test if function is working, in this one customer.pension.endamount doesn't exist\n\t\t//console.log(customer);\n\t\t//add key to object, start with 0, set end amount prop\n\t\t// customer.pension.endamount = 0;\n\t\t// change to keep track of 3 different interest cases\n\tfunction calculate(customer, functionsObject, callback){\n\t\tcustomer.pension.endamount = {\n\t\t\tpessimistic: customer.finances.startcapital,\n\t\t\taverage: \t customer.finances.startcapital,\n\t\t\toptimistic: customer.finances.startcapital\n\t\t}\n\t\t//test if it works, customer.pension.endamount should be added now\n\t\t// console.log(customer);\n\t\t//set duration prop, calculate years untill pension, that's how many years you should loop\n\n\t\tcustomer.pension.duration = (customer.pension.age - customer.age);\n\n\t\t//check if customer.pension.duration is added\n\t\t// console.log(customer);\n\n\t\t//first one is faster: because starting point is checked once, end point every time, in large file it is thus faster, count reversed\t\n\t\t// for (var i = Things.length - 1; i >= 0; i--) {\n\t\t// \tThings[i]\n\t\t// }\n\t\t// for (var i = 0; i < Things.length; i++) {\n\t\t// \tThings[i]\n\t\t// }\n\n\t\tfor (var i = customer.pension.duration - 1; i >= 0; i--) {\n\t\t\t// check if it loops 39 times 38-0\n\t\t\t//console.log(\"I looped \" + i + \" times\");\n\t\t\t//calculate monthly add\n\t\t\tcustomer.pension.endamount.pessimistic += (customer.finances.monthlyadd * 12); \n\t\t\tcustomer.pension.endamount.average \t\t+= (customer.finances.monthlyadd * 12);\n\t\t\tcustomer.pension.endamount.optimistic \t+= (customer.finances.monthlyadd * 12);\n\t\t\t//calculate added interest after a year\n\t\t\tcustomer.pension.endamount.pessimistic \t*= customer.pension.interest.pessimistic;\n\t\t\tcustomer.pension.endamount.average \t\t*= customer.pension.interest.average;\n\t\t\tcustomer.pension.endamount.optimistic \t*= customer.pension.interest.optimistic;\n\t\t}\n\tcallback(customer, functionsObject);\n\t}\n}", "function calculus(loanAmount, numberPayments, rate) {\n let monthlyPayment = 0;\n let totalCost = 0;\n let totalInterest = 0;\n let eachMonth = {\n month: [0],\n payment: 0,\n principal: [0],\n interest: [0],\n totalInterestObj: [0],\n balance: [loanAmount],\n totalInterestEnd: 0,\n totalCost: 0,\n term: 0,\n loanAmount: 0,\n };\n \n //payment est la mensualité\n monthlyPayment = (loanAmount) * (rate / 1200) / (1 - (1 + rate / 1200) ** (-60));\n //25000 × (5 ÷ 1200) ÷ (1 - (1 + 5 ÷ 1200))^(-60)=471.7808411\n eachMonth.payment = monthlyPayment;\n eachMonth.loanAmount = loanAmount;\n totalInterest = parseFloat((monthlyPayment * numberPayments) - loanAmount);\n eachMonth.totalInterestEnd = parseFloat(totalInterest);\n totalCost = parseFloat(loanAmount) + parseFloat(totalInterest);\n eachMonth.totalCost = totalCost;\n eachMonth.term = numberPayments;\n\n for (let i = 1; i <= numberPayments; i++) {\n eachMonth.month.push(i);\n eachMonth.interest.push(eachMonth.balance[i - 1] * rate / 1200);\n eachMonth.principal.push(monthlyPayment - eachMonth.interest[i]);\n eachMonth.totalInterestObj.push(eachMonth.interest[i - 1] + eachMonth.interest[i]);\n eachMonth.balance.push(eachMonth.balance[i - 1] - eachMonth.principal[i]);\n }\n return eachMonth;\n // formules a verifier:\n //balance 0 =loanAmount\n /* first Term: interest1==balance0*5/1200\n principal1==payment-interest1\n balance1==balance0-principal1\n\n eachMonth.interest[i]==eachMonth.balance[i-1]*5/1200\n principali==payment-interesti\n balancei==balance[i-1]]-principali */\n}", "function interestCalculator(array) {\n\n\t// setting applicable rate\n\tfor (let i = 0; i < array.length; i++) {\n\t\tif (\n\t\t\tarray[i].Principal >= 2500 &&\n\t\t\tarray[i].time > 1 &&\n\t\t\tarray[i].time < 3\n\t\t) {\n\t\t\trate = 3;\n\t\t}\n\t\telse if (array[i].Principal >= 2500 && array[i].time >= 3) {\n\t\t\trate = 4;\n\t\t} \n\t\telse if (array[i].Principal < 2500 || array[i].time <= 1) {\n\t\t\trate = 2;\n\t\t} \n\t\telse {\n\t\t\trate = 1;\n\t\t}\n\n\t\t// calculating interest\n\t\tinterest = (array[i].Principal * rate * array[i].time) / 100;\n\n\t\t// pushing new data into 'interestData' array\n\t\tinterestData.push({\n\t\t\tprincipal: array[i].Principal,\n\t\t\trate: rate,\n\t\t\ttime: array[i].time,\n\t\t\tinterest: interest\n\t\t});\n\t}\n\t\n\t// logging and returning 'interestData'\n\tconsole.log(interestData);\n\treturn interestData;\n}", "function calcBalance(\n balance,\n payment,\n interestRate,\n periodsPerYear,\n paymentNumber,\n accInterest,\n payTable\n) {\n if (bankerRound(balance, 2) > 0) {\n // amortize the interest to calculate the payment's interest\n var paymentInterest = (interestRate / periodsPerYear) * balance;\n accInterest = accInterest + paymentInterest;\n // calculate the balance after this payment\n var endBalance = balance - (payment - paymentInterest);\n payTable.push({\n paymentNumber: paymentNumber,\n startBalance: bankerRound(balance, 2),\n endBalance: Math.abs(bankerRound(endBalance, 2)),\n paymentPrincipal: bankerRound(payment - paymentInterest, 2),\n paymentInterest: bankerRound(paymentInterest, 2),\n accumulatedInterest: bankerRound(accInterest, 2),\n amountPaidToDate: bankerRound(payment * paymentNumber, 2),\n });\n calcBalance(\n endBalance,\n payment,\n interestRate,\n periodsPerYear,\n paymentNumber + 1,\n accInterest,\n payTable\n );\n }\n return payTable;\n}", "function calcLoanPayment(p, r, t, n){ // calculates loan payments given principal, interest rate, number of years, and number of times a year interest is compounded\n var payment = p * (r/n) * Math.pow(1 + r/n, t*n) / (Math.pow(1 + r/n, t*n) - 1); // equation for monthly payment on a mortgage\n return payment; // output for function is payment\n}", "function CalculateTotalInterest(startingBalance, monthlyPayment, interestRate) {\n var currentInterest = 0, newBalance = startingBalance, monthCount = 1;\n \n // JSON results object for displaying in a table\n var resultsObj = {};\n \n /*\n Ideally this would contain:\n \n ResultsObj {\n Month1: {1000, 100, 20, 80, 920}\n ...\n MonthN: {10, 10, 0, 10, 0}\n }\n \n ResultsObject is an object with rows of lists\n Each list has the following:\n [Month #Number, StartingBalance, Repayment, InterestPaid, PrincipalPaid, NewBalance]\n */\n \n // Calculate Interest until the loan is paid off.\n while (newBalance > 0)\n {\n var singleResult = [];\n singleResult.push(\"Month #\" + monthCount);\n \n // \"Starting Balance\" is the old newBalance\n var startingBalance = newBalance;\n singleResult.push(startingBalance); \n \n // Monthly Payment edge case: if StartingBalance is less than monthlyPayment,\n // then startingBalance is all we will pay. Since we can't pay more than\n // the actual principal amount obviously.\n if (startingBalance < monthlyPayment)\n {\n singleResult.push(startingBalance);\n }\n else\n {\n singleResult.push(monthlyPayment);\n }\n \n // Math taken from here\n // https://mozo.com.au/interest-rates/guides/calculate-interest-on-loan\n currentInterest = CalculateMonthlyInterest(startingBalance, interestRate);\n principalPaid = monthlyPayment - currentInterest;\n newBalance = newBalance - (monthlyPayment - currentInterest);\n \n singleResult.push(currentInterest);\n singleResult.push(principalPaid);\n \n // New Balance edge case: can't be less than 0, if it's negative, make it 0.\n if (newBalance < 0)\n {\n singleResult.push(0);\n }\n else\n {\n singleResult.push(newBalance);\n }\n \n // Add a row into the results object\n resultsObj[\"Month\" + monthCount] = singleResult;\n monthCount++;\n }\n \n return resultsObj;\n}", "function interestTillNextPayment(\n principal,\n dailyRate,\n previousPayDate,\n nextPayDate\n) {\n return (\n principal *\n Math.floor((nextPayDate - previousPayDate) / 86400000) *\n dailyRate\n );\n}", "function carLoanPayment(loan, duration, interest) {\n carPayment = loan * (1+(interest/100)) / (duration * 12);\n return carPayment;\n }", "calculateInterestByPeriod(p) {\n\t\treturn new AnnuitySchedule(this.options).calculateInterestByPeriod(p);\n\t}", "function calculateInterest(start, years, interests) {\n let svar = start;\n let i = 0;\n while (i < years) {\n svar += svar * (interests / 100);\n i++;\n }\n\n svar = svar.toFixed(4);\n return parseFloat(svar);\n }", "function calculateMonthlyInterestPayment(monthlyInterestRate,remainingBalance){\n\treturn monthlyInterestRate * remainingBalance;\n}", "function calculateInterestOnlyLoanPayment(loanTerms) {\n let payment;\n payment = loanTerms.principle * calculateInterestRate(loanTerms.interestRate);\n return 'The interest only loan payment is ' + payment.toFixed(2);\n}", "function interestCalculator() {\n\n for(let i = 0; i < arguments.length;i++){\n // determining the rate using following coditions below:\n\n if(arguments[i].principal>=2500 &&(arguments[i].time>1 && arguments[i].time<3))\n {\n rate=3;\n }\n else if(arguments[i].principal>=2500 && arguments[i].time>=3)\n {\n rate=4;\n }\n else if(arguments[i].principal<2500 || arguments[i].time<=1)\n {\n rate=2;\n }\n else{\n rate=1;\n }\n\n //calculating interest for each object\n\n interest = (arguments[i].principal*rate*arguments[i].time)/100;\n \n // pushing objects into the interestData array.\n interestData.push({principal:arguments[i].principal,rate:rate,time:arguments[i].time,interest:interest});\n \n }\n // loging interestData array to console.\n console.log(interestData)\n \n // return interestData.\n return interestData;\n\n}", "function CalculateMonthlyInterest(currentBalance, interestRate) {\n // Convert InterestRate to a percent\n interestRate = interestRate / 100;\n \n // Interest = (interest rate / 12 payments per year) * loan principal\n return ( (interestRate / 12) * currentBalance );\n}", "function interest(){\n var interest = parseFloat(dailyPercentage * calcAmount);\n return interest\n\n}", "function tvm(principal, interestRate, periodsPerYear, numberOfYears) {\n var n = periodsPerYear * numberOfYears;\n var r = interestRate / periodsPerYear;\n return bankerRound(principal * Math.pow(1 + r, n), 2);\n}", "function Calsimulation (price,iva,interest,numfee){\n console.log(\"price :\",price,\" iva:\",iva,\" interes:\",interest,\" cuotas:\",numfee);\n var monthInterest=0, j=0, fee=0;\n if(interest > 0){\n monthInterest = (Math.pow((1+(interest/100)),(1/12))-1);\n console.log(\"cuota interes mensual:\", monthInterest);\n j = (monthInterest*(1+(iva/100)));\n console.log(\"valor j:\",j);\n fee =(price*((j*Math.pow((1+j),numfee))/(Math.pow((1+j),numfee)-1)));\n console.log(\"valor de la cuota: \", fee);\n return fee;\n } \n else if (interest == 0 )\n {\n fee=price/numfee;\n console.log(\"fee\",fee);\n return fee;\n }\n \n }", "function calculateInterest() {\n\t// get number of years user will earn interest and convert to decimal\n\tage = document.getElementById('age').value;\n\tuserageNumber = parseFloat(age);\n\n\t// get current savings and convert to decimal\n\tsavings = document.getElementById('savings').value;\n\tsavingsNumber = parseFloat(savings);\n\t\n\t// get interest rate, convert to number, and then convert to percentage\n\trate = document.getElementById('rate').value;\n\trateNumber = parseFloat(rate);\n\tratePercentage = rateNumber / 100;\n\n\ttotal = savingsNumber;\n\n\t// for each year money will earn interest, add the total plus the interest\n\tfor (i=0; i<userageNumber; i++) {\n\t\ttotal += total * ratePercentage;\n\t}\n\n\t// Limit the total to two decimal places\n\ttotal = total.toFixed(2);\n\n\t// Check that all the numbers are actually numbers\n\t// If not, show an alert\n\t// If so, display the total\n\tif ( isNaN(total) || isNaN(userageNumber) ) {\n\t\talert('Please fill out all the fields with numbers only.');\n\t} else {\n\t\t// Display the message stating how much the total will be\n\t\t// To add commas to separate thousands, I used function outlined here: https://blog.abelotech.com/posts/number-currency-formatting-javascript/\n\t\tmessage += `<p>At ${rate}% interest, after ${userageNumber} years, you will have $${addCommas(total)} in savings.</p>`;\n\t\tdocument.getElementById('answer').innerHTML = message;\n\t\tanswer.style.display = 'block';\n\t\tanswer.style.marginTop = '2em';\n\t\tanswer.style.marginBottom = '20px';\n\n\t\t// Show the reset button and erase button\n\t\tresetButton.style.display = 'block';\n\t\teraseButton.style.display = 'block';\n\n\n\t\t// Hide the form so is it replaced with the results and reset button\n\t\tform.style.display = 'none';\n\t\t}\n\n\t}", "function homeLoanPayment(loan, duration, interest) {\n homePayment = loan * (1+(interest/100)) / (duration * 12);\n return homePayment;\n }", "function compute()\n{\n var principal = document.getElementById(\"principal\").value;\n var rate = document.getElementById(\"rate\").value;\n var years = document.getElementById(\"years\").value;\n var interest = principal*years*rate /100;\n var year = new Date().getFullYear()+parseInt(years);\n document.getElementById(\"result\").innerHTML=\"If you deposit <mark>\"+principal+\"</mark>,\\<br\\>at an interest rate of <mark>\"+rate+\"%</mark>\\<br\\>You will receive an amount of <mark>\"+interest+\"</mark>,\\<br\\>in the year <mark>\"+year+\"</mark>\\<br\\>\";\n}", "function Compound(){}", "function calculateMortgagePayment(){\n const loan = parseFloat($(\"#js-house-price\").val()) - parseFloat($(\"#js-down-payment\").val())\n const numberOfMonths = parseInt($(\"#js-amort-years\").val())* 12\n const interestRate = parseFloat($(\"#js-interest\").val())/12/100\n //console.log(loan,numberOfMonths,interestRate)\n const numerator = interestRate * Math.pow((1+interestRate),numberOfMonths) \n const denominator = Math.pow((1+interestRate),numberOfMonths)-1\n mortgagePmt = Math.round(loan * numerator / denominator*100)/100\n updatePmt()\n buildMonthlyCostsBase()\n const loanObj = {\n \"P\":loan,\n \"PMT\":mortgagePmt,\n \"I\":interestRate,\n }\n buildAmortTable(loanObj)\n buildSummary()\n \n}", "function depositProfit(deposit, rate, threshold) {\n let yearsToMature = 0\n let rateOfReturn = rate / 100\n while (deposit < threshold) {\n deposit += (deposit * rateOfReturn)\n yearsToMature++\n }\n return yearsToMature\n}", "invest(amount, { rrsp_allowance }) {\n if (!amount || amount <= 0) return;\n\n if (rrsp_allowance > 0) {\n // Now for RRSP.\n const [rrsp_amount, remainder] = (amount > rrsp_allowance) ?\n [rrsp_allowance, amount - rrsp_allowance] :\n [amount, 0];\n\n this.rrsp.invested += rrsp_amount; // more money invested\n this.rrsp.profit = tick(this.rrsp, this.stock_return); // the new profit\n\n // Personal account\n if (remainder) {\n this.personal.invested += remainder; // more money invested\n }\n this.personal.profit = tick(this.personal, this.stock_return); // the new profit\n\n // Tax credit goes into personal account.\n this.rrsp.credit += rrsp_amount;\n } else {\n // Personal account only.\n this.personal.invested += amount; // more money invested\n this.personal.profit = tick(this.personal, this.stock_return); // the new profit\n }\n }", "function CalculateDeposit(percent_In_Year, mount, capitalization, first_payment, add_summ) {\r\n var percent_In_Mount = percent_In_Year / 12;\r\n var total = first_payment;\r\n var total_interest = 0;\r\n var all_made = first_payment;\r\n\r\n var result = {};\r\n console.log(\"Сумма на момент открытия вклада: \", total, \" процент по вкладу: \", percent_In_Year, \"%\", \"Ежемесячная процентная ставка:\", percent_In_Mount, \"%\", \"капитализация :\", capitalization);\r\n result.pay_percents = [];\r\n result.pay_percents.push({\r\n 'mount': 0,\r\n 'total': first_payment.toFixed(2)\r\n });\r\n for (var i = 1; i <= mount; i++) {\r\n var pay_percent = (capitalization ? total : first_payment) / 100 * percent_In_Mount;\r\n total_interest += pay_percent;\r\n total = total + pay_percent;\r\n console.log(\"Платеж по процентам в \", i, \" месяце равен \", pay_percent)\r\n\r\n if (mount > 1) {\r\n total += add_summ;\r\n all_made += add_summ;\r\n }\r\n result.pay_percents.push({\r\n 'mount': i,\r\n 'total': total.toFixed(2)\r\n });\r\n }\r\n var effectiv_percent = (total - all_made) / (all_made * 0.01);\r\n console.log(\"Сумма на момент закрытия вклада:\", total)\r\n console.log(\"Прибыль:\", total_interest)\r\n console.log(\"Сумма выросла на\", effectiv_percent + \"%\")\r\n result.total = total.toFixed(2);\r\n result.effectiv_percent = effectiv_percent.toFixed(2);\r\n result.total_interest = total_interest.toFixed(2);\r\n return result;\r\n}", "function calculate(initial_age, initial_nest_egg, initial_salary, annual_contrib_percent, \n retire_age, annual_nest_egg_grow_percent, lame_age, death_age, \n active_years_income, lame_years_income) {\n \n /* Order of operations\n * \n * Not retired\n * - Increase salary by percent\n * - Make contribution from salary\n * - Compound the interest\n * \n * Retired\n * - Draw from nest egg\n * - Compound the interest\n */\n \n var returnData = [];\n var current_nest_egg = initial_nest_egg;\n var current_salary = initial_salary;\n \n for (var age = initial_age + 1; age <= death_age; age++) {\n var nest_egg_draw = 0;\n var actual_nest_egg_draw = 0;\n var is_retired = age >= retire_age ? true : false\n \n // Yearly salary increase\n current_salary = age >= retire_age ? 0 : current_salary + (current_salary * 0.02)\n \n // Annual contribution from salary at start of compounding period\n var contribution = age >= retire_age ? 0 : current_salary * annual_contrib_percent;\n current_nest_egg += contribution;\n \n // Draw from nest egg if retired\n if (age >= retire_age && age < lame_age) { // in active retirement years\n var rmd = getRmd(age, current_nest_egg);\n nest_egg_draw = active_years_income > rmd ? active_years_income : rmd \n } else if (age >= retire_age && age >= lame_age) { // in lame years\n var rmd = getRmd(age, current_nest_egg);\n nest_egg_draw = lame_years_income > rmd ? lame_years_income : rmd;\n }\n \n if (current_nest_egg < nest_egg_draw) {\n actual_nest_egg_draw = current_nest_egg;\n } else {\n actual_nest_egg_draw = nest_egg_draw;\n }\n current_nest_egg -= actual_nest_egg_draw;\n \n // Set nestegg to 0 if we've gone below 0\n if (current_nest_egg < 0) {\n current_nest_egg = 0;\n }\n \n // Compute interest and add to total\n var interest = current_nest_egg * annual_nest_egg_grow_percent;\n current_nest_egg += interest;\n \n var yearData = {age: age, retired: is_retired, salary: round2(current_salary),\n contrib: round2(contribution), draw: actual_nest_egg_draw, interest: round2(interest),\n nest_egg: round2(current_nest_egg)\n };\n \n returnData.push(yearData);\n }\n \n return returnData;\n}", "function calculateInvestment(investment, rate, years) {\n monthlyRate = rate / 12 / 100\n months = years * 12\n\n for (let i = 0; i < months; i++) {\n monthlyInterest = investment * monthlyRate\n investment += monthlyInterest\n }\n\n return investment\n}", "function depositProfit(deposit, rate, threshold) {\n let year = 0;\n let account = deposit;\n\n while (threshold > account) {\n account += account * (rate / 100);\n year++;\n }\n return year;\n}", "getInterestByYears(amout, year) {\n if (amout >= 100000 && year == 5) {\n let interest = (amout / 100) * 5;\n return `You will get 5% of bonus for ${interest} USD`;\n } else if (amout < 100000 && year == 2) {\n let interest = (amout / 100) * 2;\n return `You will get 2% of bonus for ${interest} USD`;\n } else {\n return `You can't get any interest for ${amount} USD in ${year} years`;\n }\n }", "getTotal(){\n this.totalPaid = this.periods * this.scPayment\n this.totalInterest = this.totalPaid - this.loanAmount\n }", "function fetchCompound(compoundId) {\n return {\n [CALL_API]: {\n types: [EXPERIMENT_REQUEST, EXPERIMENT_SUCCESS, EXPERIMENT_FAILURE],\n endpoint: `compounds/${compoundId}`,\n schema: Schemas.EXPERIMENT,\n },\n };\n}", "function calculateConventionalLoanPayment(loanTerms) {\n let interest = calculateInterestRate(loanTerms.interestRate);\n let payment;\n payment = loanTerms.principle * interest / (1 - (Math.pow(1 / (1 + interest), loanTerms.months)));\n return 'The conventional loan payment is ' + payment.toFixed(2);\n}", "getTotalWithExtra(extra){\n let numMonthes = 0\n let beginBalance = this.loanAmount\n let totalInterest = 0\n let totalPaid = 0\n let scPayment = this.scPayment + extra\n\n while (beginBalance > 0){\n numMonthes += 1\n let interest = beginBalance * this.rate\n let principal = scPayment - interest\n \n totalInterest += interest\n totalPaid += scPayment \n beginBalance -= principal\n }\n\n // If begin balance is less than 0\n totalPaid += beginBalance\n\n this.totalPaidWithExtra = totalPaid\n this.totalInterestWithExtra = totalInterest\n this.totalMonthesWithExtra = numMonthes\n this.totalYearsWithExtra = parseInt(numMonthes/12)\n this.timeSavedMonthes = this.periods - numMonthes\n this.amountSaved = this.totalPaid - this.totalPaidWithExtra\n\n }", "function amort(balance, interestRate, terms) {\n amortData = [];\n\n //Calculate the per month interest rate\n var monthlyRate = interestRate / 12;\n\n //Calculate the payment\n var payment = balance * (monthlyRate / (1 - Math.pow(1 + monthlyRate, -terms)));\n\n for (var count = 0; count < terms; ++count) {\n var interest = balance * monthlyRate;\n var monthlyPrincipal = payment - interest;\n var amortInfo = {\n Balance: balance.toFixed(2),\n Interest: balance * monthlyRate,\n MonthlyPrincipal: monthlyPrincipal\n }\n amortData.push(amortInfo);\n balance = balance - monthlyPrincipal;\n }\n\n}", "getInterest() {\n return this.interest;\n }", "function generateContrubtion(income, bracket) {\n return {\n percentage: bracket.percentage,\n total: Math.round((income / 100) * bracket.percentage + bracket.fixed),\n };\n}", "function depositProfit(deposit, rate, threshold) {\n var yr = 0;\n\n while(deposit < threshold){\n deposit += deposit * (rate/100);\n yr ++;\n }\n return yr;\n}", "function InandOut(account){\nlet positiveArray=[];\nlet negativeArray=[];\naccount.movements.forEach((element) => {\n if(element<0){\n negativeArray.push(element);\n }else{\n positiveArray.push(element);\n }\n});\nlet totalPositive =positiveArray.reduce(function(a,b){\n return a+b;\n},0); \n\nlabelSumIn.innerHTML=`${totalPositive}₹`;\n\nlet totalNegative =negativeArray.reduce(function(a,b){\n return a+b;\n},0);\nlabelSumOut.innerHTML=`${totalNegative}₹`;\n//Total Sum\naccount.balance=account.movements.reduce(function(a,b){\n return a+b;\n},0);\nlabelBalance.innerHTML=`${account.balance}₹`;\n//Interest Values\nconst interest =account.movements\n .filter(x=>x>0)\n .map(deposit=>((deposit*account.interestRate)/100))\n .filter((int,i,arr)=>{\n return int>=1;\n })\n .reduce((a,b) =>a+b,0).toFixed(2);\nlabelSumInterest.textContent=`${interest}₹`;\n\n}", "calculateIncentive(participant) {\n const incentiveModifier = 0.3;\n let { baseIncentive } = this.props;\n const { work } = participant.meta;\n\n if ((work) && (work.status.fulltime_student || work.status.parttime)) {\n const incentive = baseIncentive + (baseIncentive * incentiveModifier);\n return numeral(incentive).format('$0.00');\n }\n return numeral(baseIncentive).format('$0.00');\n }", "addSavingsAccount(interest) {\n let acctNo = Bank.nextNumber;\n let savings = new SavingsAccount(acctNo);\n Bank.nextNumber++;\n savings.setInterest(interest);\n this.bankAccounts.push(savings);\n return savings.getNumber();\n\n }", "function getPayments(loan, payment, months, mthRate) {\n let paymentArray = [];\n let totalInterest = 0;\n let balance = loan;\n let interest = 0;\n let principal = 0;\n\n for (let i = 1; i <= months; i++) {\n let obj = {};\n\n interest = balance * mthRate;\n principal = payment - interest;\n totalInterest += interest;\n balance -= principal;\n\n obj['month'] = i;\n obj['payment'] = payment;\n obj['principal'] = principal;\n obj['interest'] = interest;\n obj['totalInterest'] = totalInterest;\n obj['balance'] = Math.abs(balance); // Fix negative value\n\n paymentArray.push(obj);\n }\n\n return paymentArray;\n}", "function getTaxCap({annualIncome}) {\n let income = Number(annualIncome)\n let annualCap = 5000\n let bt = {}\n\n if (income > 5000 && income <= 20000) {\n annualCap = 20000\n } else if (income > 20000 && income <= 35000) {\n annualCap = 35000\n } else if (income > 35000 && income <= 50000) {\n annualCap = 50000\n } else if (income > 50000 && income <= 70000) {\n annualCap = 70000\n } else if (income > 70000 && income <= 100000) {\n annualCap = 100000\n } else if (income > 100000 && income <= 250000) {\n annualCap = 250000\n } else if (income > 250000 && income <= 400000) {\n annualCap = 400000\n } else if (income > 400000 && income <= 1000000) {\n annualCap = 1000000\n } else if (income > 1000000 && income <= 2000000) {\n annualCap = 2000000\n } else if (income > 2000000) {\n annualCap = 3000000\n }\n\n bt = baseTax.find((b) => b.annualCap === annualCap )\n let tax = {\n firstCapTax: bt.taxOnFirst,\n nextCap: Number(income - bt.first)\n }\n tax.progressiveTax = round(Number(tax.nextCap * bt.nextTax), 2)\n tax.total = round(Number(tax.firstCapTax + tax.progressiveTax), 2)\n tax.perMonth = round(Number(tax.total/12), 2)\n\n return Promise.resolve({\n annualIncome: income,\n baseTax: bt,\n result: tax\n })\n}", "function calc() {\n //Blank out existing values\n loanAmt = 0;rate = 0; month = 0; day = 0; year = 0; payment = 0; pmtfreq = 0;\n totInt = 0;\n //////////////////////////////////////////////////////////////////////////////\n loanAmt = document.getElementById(\"loanamt\").value;\n rate = document.getElementById(\"interest\").value;\n month = document.getElementById(\"months\").value;\n day = document.getElementById(\"days\").value;\n year = document.getElementById(\"years\").value;\n payment = document.getElementById(\"payment\").value;\n pmtfreq = document.getElementById(\"pmtfreq\").value;\n//Edits\nif(loanAmt == 0){\n alert(\"Loan Amount is required\");\n}\nif(rate == 0){\n alert(\"Interest Rate is required\")\n}\nif(payment == 0){\n alert(\"Payment is required\")\n}\n//Convert Payment Frequency to 1 or 2; 1 = Monthly; 2 = Bi-Weekly\n switch (pmtfreq) {\n case \"Monthly\":\n pmtfreq = 1;\n break;\n case \"Bi-Weekly\":\n pmtfreq = 2;\n }\n//Calculations\n intRate = rate/100; //Percent\n if (pmtfreq == 1){\n moInt = intRate/13; //Every 4 Weeks Interest rate\n }else{\n moInt = intRate/26; //Bi-Weekly Interest Rate\n }\n i = 0; //Counter\nwhile(loanAmt > 0){\n if(pmtfreq == 1){\n i++; //Increment Month Count\n }else{\n i = (i + 0.5); //Increment Month Count by Half due to Bi-Weekly Payments\n }\n int = moInt * loanAmt; //Monthly Interest Paid\n totInt += int;\n prinPayment = payment - int;\n loanAmt = loanAmt - prinPayment;\n }\n//Convert Month to be 1-12\nswitch (month) {\n case \"January\":\n month = 1;\n break;\n case \"February\":\n month = 2;\n break;\n case \"March\":\n month = 3;\n break;\n case \"April\":\n month = 4;\n break;\n case \"May\":\n month = 5;\n break;\n case \"June\":\n month = 6;\n break;\n case \"July\":\n month = 7;\n break;\n case \"August\":\n month = 8;\n break;\n case \"September\":\n month = 9;\n break;\n case \"October\":\n month = 10;\n break;\n case \"November\":\n month = 11;\n break;\n case \"December\":\n month = 12;\n}\n\n\n date = month+'/'+day+'/'+year;\n date = new Date(date);\n date = date.setMonth(date.getMonth() + i);\n date = new Date(date);\n date = date.toDateString();\n totInt = Math.round(100 * totInt)/100;\n document.getElementById(\"enddate\").textContent=date;\n document.getElementById(\"totInterest\").textContent=totInt;\n document.getElementById(\"payments\").textContent=i;\n}", "function depositProfit(deposit, rate, threshold) {\n let numberOfYears = 0;\n let account = deposit;\n\n while (account <= threshold) {\n account += (account * rate) / 100;\n numberOfYears++;\n }\n return numberOfYears;\n}", "function calculaPR(){\n let bonusRS = 0;\n if(jogador1.arma.forca == undefined){\n bonusRS = 0;\n }else{\n jogador1.powerRS = parseInt(jogador1.powerRS);\n bonusRS = jogador1.arma.forca + (jogador1.powerRS * (jogador1.arma.pBonus));\n }\n\n let bonusColete = 0;\n if(jogador1.colete.resBonus == undefined){\n bonusColete = 0;\n }else{\n jogador1.colete.resBonus = parseInt(jogador1.colete.resBonus)\n bonusColete = jogador1.colete.resBonus;\n }\n\n let pr = ((jogador1.atributosJ*4)/4)*(70/100) + bonusRS + bonusColete;\n pr = pr + (.5/100);\n pr = pr.toFixed(0);\n return pr \n}", "function calculateDeposit(arr){\n let balance = arr[0];\n let interestRate = arr[1];\n let frequencyInMonths = arr[2];\n let timeInYears = arr[3];\n let compoundFrequency = 12 * 1.0 / frequencyInMonths;\n\n let result = balance * Math.pow(1 + (interestRate / 100) / compoundFrequency,\n compoundFrequency * timeInYears);\n\n return result.toFixed(2);\n}", "setInterest(aInterest) {\n this.interest = aInterest;\n }", "function calculateMonthlyPayment(term,interestRate,loanAmount)\n{\n\tvar monthlyPayment = (loanAmount*(interestRate))/(1-Math.pow((1+(interestRate)),(-term)));\n\treturn monthlyPayment;\n}", "function PMT(ir, np, pv, fv, type) {\n\t/*\n\t * ir - interest rate per period\n\t * np - number of periods\n\t * pv - present value\n\t * fv - future value\n\t * type - when the payments are due:\n\t * 0: end of the period, e.g. end of month (default)\n\t * 1: beginning of period\n\t */\n\tvar pmt, pvif;\n\n\tfv || (fv = 0);\n\ttype || (type = 0);\n\n\tif (ir === 0)\n\t\treturn -(pv + fv)/np;\n\n\tpvif = Math.pow(1 + ir, np);\n\tpmt = - ir * pv * (pvif + fv) / (pvif - 1);\n\n\tif (type === 1)\n\t\tpmt /= (1 + ir);\n\n\treturn pmt;\n}", "payment(P, Y, R) {\n var n = 12 * Y;\n var r = R / (12 * 100);\n var payment = (P * r) / (1 - (1 + r) ^ (-n));\n console.log(\"Monthly Payment is:\" + payment);\n\n\n\n\n }", "function calcMonthlyPayment(amount, years, rate) {\n\t// console.log(amount, rate);\n let monthlyInterest = rate / 12;\n let loanMonths = years * 12;\n let divisor = 1 - Math.pow( (1 + monthlyInterest), -loanMonths)\n let numerator = (amount * monthlyInterest); \n let monthlyPayment = numerator / divisor;\n return Number(monthlyPayment.toFixed(2));\n}", "calculate({ balance, rate, term, period }) {\n if (rate === 0) {\n return;\n }\n\n const monthlyInterest = (rate * 0.01) / 12;\n const months = term * 12;\n const expression = (1 + monthlyInterest) ** months;\n const result = balance * ((monthlyInterest * expression) / (expression - 1));\n\n this.setState({\n output: ` $${parseFloat(result.toFixed(2))}`,\n });\n }", "function calculateMonthlyMortgagePayment(args){\n\tvar principal = args.loanAmount;\n\tvar interestRate = args.interestRate == 0 ? 0 : args.interestRate/100;\n\tvar monthlyInterestRate = interestRate == 0 ? 0 : interestRate/12;\n\tvar numberOfMonthlyPayments = args.termInYears * 12;\n\treturn (((monthlyInterestRate * principal * (Math.pow((1+monthlyInterestRate), numberOfMonthlyPayments)))) / ((Math.pow((1+monthlyInterestRate), numberOfMonthlyPayments)) - 1));\n}", "function getPaymentAmount(loanAmount, numberOfYears, paymentsPerYear) {\n let n = 360;\n let i = 005;\n let A = [(1 + .005) ^ 360] - 1 / [0,005 (1 + .005) ^ 360];\n let D = [(1 + .005) ^ 360] - 1 / [0,005 (1 + .005) ^ 360];\n return A / D;\n }", "function total_p(centim,age) {\r\n\treturn parseInt(centim) + (5*parseInt(age))\r\n}", "function determinePrincipal(balance, dailyRate, previousPayDate) {\n let today = new Date();\n return parseFloat(\n (\n balance /\n (1 +\n dailyRate *\n Math.round((today.valueOf() - previousPayDate.valueOf()) / 86400000))\n ).toFixed(2)\n );\n}", "function otpay(wage,hours,ot){\r\n\t\r\n\tMath.round(totalincome*100)/100;\r\n\treturn ((wage * ot) * (hours - 40) + (wage * 40)); \r\n\t\r\n}", "function brac1(calc) {\n owed.value = calc * 0.15;\n ret.value = calc * 0.85;\n taxRate.value = \"15%\";\n\n owed.value = Math.round(owed.value*100)/100;\n ret.value = Math.round(ret.value*100)/100;\n}", "function loan(income, customer) {\n let interestRate = .04\n let special = false \n if ((customer[\"Melon\"] === 'Casaba') || (customer[\"Pets\"] > 5)) {\n special = true\n }\n if (income < 100000 && special === false){\n interestRate = .08\n }\n if (income < 100000 && special === true){\n interestRate = .05 \n }\n if (200000 > income > 100000 && special === false){\n interestRate = .07 \n }\n if (200000 > income > 100000 && special === true){\n interestRate = .04 \n }\n customer.set(\"special\", special);\n // Function to return loan rate\n return interestRate\n}", "async addInterest(interest) {\n await UserService.createInterest(interest, this.props.username).then(response => {\n this.fetchInterests();\n });\n }", "calculateInterest() {\n let result\n result = this.state.web3.utils.fromWei(this.state.poolInterest.toString(), 'Ether') / this.state.ethPrice\n if(result < 1) {\n result = 'Less than $1'\n }\n return result\n}", "getTotalInterestGenerated(address, timePeriod) {\n // TODO:\n return {};\n }", "function KredittkortCalcPayment(principalAmount, totalMonths)\n{\n var montlyInterest = KREDITTKORT_NOMRENTE / (12*100);\n\n if (totalMonths > 1.5)\n {\n // calc monthly payment\n var monthlyPayment = Math.floor(principalAmount * montlyInterest / (1 - Math.pow((1 + montlyInterest), -totalMonths)));\n\n // remove decimals\n monthlyPayment = Math.floor(monthlyPayment);\n\n return monthlyPayment + \",-\";\n }\n else\n {\n return \"Rentefritt\";\n }\n}", "outstandingBalance() {\n const amountPaid = this.amountPaidOnInvoice();\n const invoiceTotal = this.amount;\n const tip = this.tip || 0;\n return (invoiceTotal + tip) - amountPaid;\n }", "function calculateRelease(currentBalanceP1,currentBalanceP2,arbPaidFee,arbFeePayorName,person1,person2,arbAccount,feeAccount) {\r\n \r\n var person1Release = 0;\r\n var person2Release = 0;\r\n var doneeRelease = 0;\r\n var totalWallet = Number(currentBalanceP1) + Number(currentBalanceP2);\r\n\r\n // validate the totalWallet\r\n if (totalWallet < 0) {\r\n outputMessage = \"error2000\";\r\n totalWallet = 0;\r\n }\r\n\r\n // check that the total wallet is bigger than the fee\r\n if (totalWallet <= Number(arbPaidFee)) {\r\n \r\n // if balances are too small, dust goes to fee\r\n arbPaidFee = totalWallet; \r\n\r\n } else {\r\n\r\n // calculate the ruling amounts from the percentages - ensure 4 decimals of precision\r\n if (Number(rulingDonee) > 0) {\r\n person1Release = (parseFloat(ruling1)/100) * totalWallet;\r\n person1Release = Number(person1Release.toFixed(4));\r\n person2Release = (parseFloat(ruling2)/100) * totalWallet;\r\n person2Release = Number(person2Release.toFixed(4));\r\n doneeRelease = totalWallet - person1Release - person2Release; \r\n } else if (Number(ruling2) > 0) { \r\n person1Release = (parseFloat(ruling1)/100) * totalWallet;\r\n person1Release = Number(person1Release.toFixed(4));\r\n person2Release = totalWallet - person1Release;\r\n doneeRelease = 0; \r\n } else {\r\n person2Release = (parseFloat(ruling2)/100) * totalWallet;\r\n person2Release = Number(person2Release.toFixed(4));\r\n person1Release = totalWallet - person2Release;\r\n doneeRelease = 0; \r\n }\r\n\r\n // remove the fee from the appropriate person\r\n if (arbFeePayorName == person1) {\r\n person1Release = Number(person1Release) - Number(arbPaidFee);\r\n }\r\n\r\n // remove the fee from the appropriate person\r\n if (arbFeePayorName == person2) {\r\n person2Release = Number(person2Release) - Number(arbPaidFee);\r\n }\r\n\r\n // validate the release amount\r\n if (person1Release < 0) { \r\n\r\n // adjust the arbPaidFee to come from donee, if person doesn't have enough balance\r\n if (Number(doneeRelease) >= Number(person1Release) * (-1)) {\r\n // person 1 is negative, so adding reduces it\r\n doneeRelease = Number(doneeRelease) + Number(person1Release); \r\n } else {\r\n // donee doesn't have enough balance either, just reduce fee rather than taking from person2\r\n // because person2 should have good ruling if no doneeRelease balance \r\n arbPaidFee = Number(arbPaidFee) + Number(person1Release);\r\n }\r\n\r\n person1Release = 0;\r\n } \r\n\r\n if (person2Release < 0) {\r\n \r\n // adjust the arbPaidFee to come from donee, if person doesn't have enough balance\r\n if (Number(doneeRelease) >= Number(person2Release) * (-1)) {\r\n // person 2 is negative, so adding reduces it\r\n doneeRelease = Number(doneeRelease) + Number(person2Release); \r\n } else {\r\n // donee doesn't have enough balance either, just reduce fee rather than taking from person1\r\n // because person1 should have good ruling if no doneeRelease balance \r\n arbPaidFee = Number(arbPaidFee) + Number(person2Release);\r\n }\r\n\r\n person2Release = 0;\r\n }\r\n\r\n\r\n // convert to 4 decimal precision\r\n person1Release = person1Release.toFixed(4);\r\n person2Release = person2Release.toFixed(4);\r\n doneeRelease = doneeRelease.toFixed(4);\r\n\r\n // validate the total released is the total wallet - 4 digits of precision\r\n if (Math.abs(Number(person1Release) + Number(person2Release) + Number(doneeRelease) + Number(arbPaidFee) - Number(totalWallet.toFixed(4))) < 0.00001 ) {\r\n \r\n // validate all balances are positive\r\n if (Number(person1Release) < 0) {\r\n outputMessage = \"error3001\";\r\n }\r\n\r\n // validate all balances are positive\r\n if (Number(person2Release) < 0) {\r\n outputMessage = \"error3002\";\r\n }\r\n\r\n // validate all balances are positive\r\n if (Number(doneeRelease) < 0) {\r\n outputMessage = \"error3003\";\r\n }\r\n\r\n // validate all balances are positive\r\n if (Number(arbPaidFee) < 0) {\r\n outputMessage = \"error3004\";\r\n }\r\n\r\n } else {\r\n\r\n // balance error, fee too big for balances\r\n outputMessage = \"error3000\";\r\n \r\n }\r\n\r\n }\r\n\r\n if (outputMessage == \"success\") {\r\n // update contract\r\n updateContract(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n } else {\r\n finalReturn(outputMessage);\r\n }\r\n \r\n}", "function calculateLoan()\r\n{ \r\n \r\n // Get UI Variables \r\n const amount = document.getElementById('amount');\r\n const interest = document.querySelector('#interest');\r\n const year = document.querySelector('#year');\r\n const monthlyPayment = document.querySelector('#mp');\r\n const totalPayment = document.querySelector('#tp');\r\n const totalInterest = document.querySelector('#ti');\r\n\r\n // Calculations \r\n const principal = parseFloat(amount.value);\r\n const calculatedInterest = parseFloat(interest.value)/100/12;\r\n const calculatedPayment = parseFloat(year.value)*12;\r\n\r\n // Monthly payment\r\n const cs = Math.pow(1+calculatedInterest, calculatedPayment);\r\n const monthly = (principal*cs*calculatedInterest)/(cs-1);\r\n\r\n if(isFinite(monthly))\r\n {\r\n monthlyPayment.value = monthly.toFixed(2);\r\n totalPayment.value = (monthly*calculatedPayment).toFixed(2);\r\n totalInterest.value = ((monthly*calculatedPayment) - principal).toFixed(2);\r\n // Show the result and prevent the loader\r\n document.querySelector('#load').style.display = 'none';\r\n document.querySelector('#result').style.display = 'block';\r\n }\r\n else\r\n {\r\n displayErrorPopup();\r\n }\r\n}", "function retire(bal,intR,nPer,mDep){\n\tvar retirement = bal;\n\tfor(var year=1;year<=nPer;year++){\n\t\tretirement*=(1+(intR/100));\n\t\tretirement+=(mDep/12);\n\t}\n\tretirement=retirement.toFixed(2);\n\treturn retirement;\n}", "function CubicN(pct, a,b,c,d) {\n var t2 = pct * pct;\n var t3 = t2 * pct;\n return a + (-a * 3 + pct * (3 * a - a * pct)) * pct\n + (3 * b + pct * (-6 * b + b * 3 * pct)) * pct\n + (c * 3 - c * 3 * pct) * t2\n + d * t3;\n }", "calcCommission(){\n\t\t\tif(this.picked == \"Quarterly\"){\n\t\t\t\t this.totalContractValue = this.addedPrice * 4;\n\t\t\t }\n\t\t\telse{\n\t\t\t\tthis.totalContractValue = this.addedPrice * 6;\n\t\t\t }\n\t\t\tthis.commission = this.totalContractValue * .5;\n\t\t}", "sumIndividualPrize(prizeRequested) {\n let sum = 0;\n if ((prizeRequested != null) && (prizeRequested.length > 0)) {\n prizeRequested.forEach(cr => {\n const idRequested = cr;\n const tempCoverageoRequested = this.coverage.find(element => {\n return (element.id === idRequested);\n });\n if (tempCoverageoRequested.premio) sum += tempCoverageoRequested.premio;\n });\n }\n this.totalPrize = sum;\n return sum;\n }", "function studentInvoice (starterPrice, maindishPrice, dessertPrice, beveragePrice) {\n return starterPrice + maindishPrice + dessertPrice + beveragePrice - (starterPrice + maindishPrice + dessertPrice)*0.1;\n}", "function percentCovered(claimArray) {\n\tfor(var i = 0; i < claimArray.length; i++){\n\tswitch (claimArray[i].visitType) {\n\t\tcase \"Optical\":\n\t\t\tclaimArray[i].coveredAmount = 0;\n\t\t\tbreak;\n\t\tcase \"Specialist\":\n\t\t\tclaimArray[i].coveredAmount = claimArray[i].visitCost * 0.10;\n\t\t\tbreak;\n\t\tcase \"Emergency\":\n\t\t\tclaimArray[i].coveredAmount = claimArray[i].visitCost;\n\t\t\tbreak;\n\t\tcase \"Primary Care\":\n\t\t\tclaimArray[i].coveredAmount = claimArray[i].visitCost * .50;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tclaimArray[i].coveredAmount = 0;\n\t\t\t}\n\t\t\tconsole.log(\"Paid out $\" + claimArray[i].coveredAmount + \" for \" + claimArray[i].patientName + \".\");\n\n\t}\n}", "function GetAreaOfInterest(interestLabel){\nvar areaOfInterest = {\n\"Accounting\":\"ACTG.GR\",\n\"Business / Data Analytics\":\"BA.GR\",\n\"Business & Management\":\"EMBA.GR\",\n\"Finance\":\"FIN.GR\",\n\"Financial Planning\":\"FINP.GR\",\n\"General Studies\":\"GS.GR\",\n\"Human Resource Management\":\"HR.GR\",\n\"International Business\":\"IB.GR\",\n\"IT Management\":\"ITM.GR\",\n\"Law\":\"LAW.LLM\",\n\"Leadership\":\"LDR.GR\",\n\"Marketing\":\"MKT.GR\",\n\"Project Management\":\"PM.GR\",\n\"Psychology\":\"PSY.GR\",\n\"Public Administration\":\"PA.GR\",\n\"Taxation\":\"TX.GR\",\n}\nif(! interestLabel) { \n return areaOfInterest;\n} \nreturn areaOfInterest[interestLabel];\n}", "function calculateSTI(peopleArray){\n\n var employeeNumber = peopleArray.employeeNumber;\n var baseSalary = parseInt(peopleArray.salary);\n var reviewScore = peopleArray.reviewScore;\n\nconsole.log (baseSalary);\n\n var bonus = getBaseSTI(reviewScore) + getYearAdjustment(employeeNumber) - getIncomeAdjustment(baseSalary);\n if(bonus > 0.13){\n bonus = 0.13;\n }\n\n //peopleArray.name = name;\n peopleArray.bonusPercent = bonus;\n peopleArray.totalSalary = Math.round(baseSalary * (1.0 + bonus)); //added Math.round\n peopleArray.totalBonus = baseSalary * bonus;\n console.log(peopleArray.name + \" \" + peopleArray.bonusPercent + \" \" + peopleArray.totalSalary + \" \" + peopleArray.totalBonus);\n return peopleArray;\n}", "function amort(balance, interestRate, terms)\n{\n //Calculate the per month interest rate\n\tvar monthlyRate = interestRate/12;\n\t\n\t//Calculate the payment\n var payment = balance * (monthlyRate/(1-Math.pow(\n 1+monthlyRate, -terms)));\n\t \n\t//begin building the return string for the display of the amort table\n var result = \"Loan amount: $\" + balance.toFixed(2) + \"<br />\" + \n \"Interest rate: \" + (interestRate*100).toFixed(2) + \"%<br />\" +\n \"Number of months: \" + terms + \"<br />\" +\n \"Monthly payment: $\" + payment.toFixed(2) + \"<br />\" +\n \"Total paid: $\" + (payment * terms).toFixed(2) + \"<br /><br />\";\n \n //add header row for table to return string\n\tresult += \"<table border='1'><tr><th>Month #</th><th>Balance</th>\" + \n \"<th>Interest</th><th>Principal</th>\";\n \n /**\n * Loop that calculates the monthly Loan amortization amounts then adds \n * them to the return string \n */\n\tfor (var count = 0; count < terms; ++count)\n\t{ \n\t\t//in-loop interest amount holder\n\t\tvar interest = 0;\n\t\t\n\t\t//in-loop monthly principal amount holder\n\t\tvar monthlyPrincipal = 0;\n\t\t\n\t\t//start a new table row on each loop iteration\n\t\tresult += \"<tr align=center>\";\n\t\t\n\t\t//display the month number in col 1 using the loop count variable\n\t\tresult += \"<td>\" + (count + 1) + \"</td>\";\n\t\t\n\t\t\n\t\t//code for displaying in loop balance\n\t\tresult += \"<td> $\" + balance.toFixed(2) + \"</td>\";\n\t\t\n\t\t//calc the in-loop interest amount and display\n\t\tinterest = balance * monthlyRate;\n\t\tresult += \"<td> $\" + interest.toFixed(2) + \"</td>\";\n\t\t\n\t\t//calc the in-loop monthly principal and display\n\t\tmonthlyPrincipal = payment - interest;\n\t\tresult += \"<td> $\" + monthlyPrincipal.toFixed(2) + \"</td>\";\n\t\t\n\t\t//end the table row on each iteration of the loop\t\n\t\tresult += \"</tr>\";\n\t\t\n\t\t//update the balance for each loop iteration\n\t\tbalance = balance - monthlyPrincipal;\t\t\n\t}\n\t\n\t//Final piece added to return string before returning it - closes the table\n result += \"</table>\";\n\t\n\t//returns the concatenated string to the page\n return result;\n}", "function studentInvoice(starterPrice, maindishPrice, dessertPrice, beveragePrice){\n var discount = 0.1\n var sum = Math.round((starterPrice+maindishPrice+dessertPrice)*(1-discount))+beveragePrice;\n return \"Your Invoice with 10% Discount: \"+sum+\" Euro\";\n}", "rate(time, balance) {\n this.mortgage_rate = this.opts.mortgage_rate();\n this.bought = time; // rate is for 5 years\n\n // Has part of the mortgage been paid up?\n if (balance) {\n this.mortgage = balance;\n this.mortgage_term -= 5;\n }\n }", "function calcInvestmentRequired(inputData) {\n var investmentReq = 0;\n var investmentReqPerMnth = 0;\n var fundReqAge = 0;\n var rateOfR = commonFormulaSvc.divide(inputData.rateOfRtrn, 100);\n fundReqAge = parseInt(inputData.years) + parseInt(inputData.currentAge);\n investmentReq = calcRevised(inputData.rateOfRtrn, inputData.fundsRequired, inputData.years);\n investmentReqPerMnth = commonFormulaSvc.round(investmentReq / 12, 0);\n $log.debug('investmentReq', investmentReq);\n wealthObj.currentAge = inputData.currentAge;\n wealthObj.fundReqAge = fundReqAge;\n wealthObj.wealthGoal = inputData.fundsRequired;\n wealthObj.wealthInYears = inputData.years;\n wealthObj.investmentReq = investmentReq;\n wealthObj.investmentReqPerMnth = investmentReqPerMnth;\n wealthObj.wealthRoR = inputData.rateOfRtrn;\n wealthCalculatorSetGetService.setSelectedData(wealthObj);\n }", "function AccountingStatistics() {\r\n let AccountingNumbers = {\r\n MarketCapitalizationRate = 0,\r\n CashOnCashReturn = 0,\r\n MonthlyROI = 0\r\n }\r\n let incomeCalc = IncomeCalculations()\r\n let userInputs = UserDefinedInputs()\r\n let initialInvestment = FirstYearOutOfPocket()\r\n\r\n //MarketCapitalizationRate -> YearlyNetOperatingIncome / subtotal\r\n AccountingNumbers.MarketCapitalizationRate = incomeCalc.NetYearlyIncome / userInputs.SubTotal\r\n //CashOnCashReturn -> initialInvestment / YearlyNetOperatingIncome\r\n AccountingNumbers.CashOnCashReturn = initialInvestment / incomeCalc.NetYearlyIncome\r\n //Monthly ROI -> Net Monthly Income/first year out of pocket\r\n AccountingNumbers.MonthlyROI = incomeCalc.NetMonthlyIncome / initialInvestment\r\n \r\n return AccountingNumbers\r\n}", "function getMortgage()\n{\n // principal is the initial value of the mortgage loan\n let principal = document.getElementById(\"principalAmount\").value;\n principal = parseFloat(principal);\n\n // this sets the value of the principal to 0 if the user enters a negative number\n if (principal < 0)\n {\n principal = 0\n }\n\n // interestRate is the expected yearly interest rate\n let interestRate = document.getElementById(\"interestRate\").value;\n interestRate = parseFloat(interestRate);\n\n // This statement sets the interest rate to 0 if the user enters a negative number\n if (interestRate < 0)\n {\n interestRate = 0;\n }\n // This statement sets the interest rate to 100 if the user enters a number above 100%\n if (interestRate > 100)\n {\n interestRate = 100;\n }\n\n // interestPct is the interestRate after being converted to a decimal\n let interestPct = interestRate / 1200;\n\n // mortgageLength is the desired number of years to payoff the loan\n let mortgageLength = document.getElementById(\"mortgageLength\").value;\n mortgageLength = parseFloat(mortgageLength);\n\n // This statement sets the mortgage length to 5 years if the user enters a value below 5 years\n if (mortgageLength < 5)\n {\n mortgageLength = 0;\n }\n\n // This statement sets the mortgage length to 50 if the user enters a value larger than 50\n if (mortgageLength > 50)\n {\n mortgageLength = 0;\n }\n\n // numPayments is the number of monthly payments until the loan is paid off\n let numPayments = mortgageLength * 12;\n\n // mortgagePayment is the value of each monthly payment\n let mortgagePayment = principal * ( ( interestPct * Math.pow((1 + interestPct), numPayments) ) / ( Math.pow( (1 + interestPct), numPayments ) - 1 ) )\n\n // mortgageField is the field where the mortgage payment displays on the page\n const mortgageField = document.getElementById(\"mortgagePayments\");\n mortgageField.value = \"$ \" + mortgagePayment.toFixed(2);\n\n // totalCost is the total dollar value you will pay over the duration of the loan\n let totalCost = numPayments * mortgagePayment;\n\n // costfield is the field where the totalCost will display on the page\n const costField = document.getElementById(\"totalCost\");\n costField.value = \"$ \" + totalCost.toFixed(2);\n}", "function amountCovered(claim){\n\tvar paidOutPerClient = '';\n\tvar percent = percentageCovered(claim);\n\t//Amount paid out rounded to the nearest dollar amount.\n\tvar amount = Math.round(claim.visitCost * (percent / 100));\n\t//Add to the total money paid out. Logged at the end.\n\ttotalPayedOut += amount;\n\tpaidOutPerClient += ('Paid out $<mark>' + amount + '</mark> for ' + claim.patientName);\n\t//Add new ol item for each client's details\n\t$('table').append('<tr><td>' + paidOutPerClient + '</td></tr>');\n\tconsole.log('Paid out $' + amount + ' for ' + claim.patientName);\n}", "function calculate() {\r\n\r\n //Old Formula Below\r\n //const interest = (amount * (interestrate * 0.01)) / months;\r\n //let payment = ((amount / months) + interest).toFixed(0);\r\n\r\n\r\n let amount=document.querySelector('#amount').value;\r\n let interestrate=document.querySelector('#interestrate').value;\r\n let months=document.querySelector('#months').value;\r\n\r\n if (amount=='' || interestrate==''|| months=='') {\r\n document.querySelector('#final').innerHTML=`<h4 style='color:#ef5350'>Enter Values</h4>`;\r\n }\r\n\r\n else {\r\n const interest = interestrate/1200;\r\n \r\n let top = Math.pow((1+interest),months);\r\n let bottom = top - 1;\r\n let ratio = top/bottom;\r\n let emi = (amount * interest * ratio).toFixed(0);\r\n\r\n document.querySelector('#final').innerHTML=`Your EMI is ${emi}`; \r\n \r\n console.log(amount, interestrate, months);\r\n }\r\n\r\n \r\n}", "function getInterests( interest ) {\n return new Promise(function(resolve, reject){\n\n\n var category = _.findWhere( g.categories, { title: interest } );\n\n if( category ) {\n\n rest.get( 'lists/' + g.listId + '/interest-categories/' + category.id + '/interests')\n .then( function (data) {\n\n var list = _.map( data.interests, function( obj ) {\n return { id: obj.id, title: obj.name };\n });\n\n console.log( 'got ' + list.length + ' ' + interest + 's ' );\n g[interest] = list;\n\n resolve( list );\n })\n .catch( function( err ) {\n reject( err );\n });\n }\n else {\n reject( new Error( 'Interest not found'));\n }\n\n });\n}" ]
[ "0.786775", "0.7559858", "0.7206405", "0.6932793", "0.692635", "0.685467", "0.6839577", "0.67644835", "0.6745944", "0.65658104", "0.6334478", "0.62171453", "0.6196766", "0.61839205", "0.59828156", "0.5972659", "0.59681845", "0.59538174", "0.59259236", "0.59230155", "0.59020513", "0.5898266", "0.5897137", "0.586618", "0.58530223", "0.5847687", "0.57915264", "0.575825", "0.5697394", "0.56267804", "0.55787855", "0.55484855", "0.54716414", "0.54426926", "0.5440749", "0.54355574", "0.53698033", "0.534884", "0.53214055", "0.5270399", "0.52573764", "0.5218207", "0.52152294", "0.5212954", "0.5203464", "0.518728", "0.51735634", "0.51646036", "0.51462907", "0.51340044", "0.5133921", "0.5121455", "0.5115362", "0.5072987", "0.503574", "0.50205016", "0.5007152", "0.49614644", "0.4955748", "0.4950529", "0.49451816", "0.49253052", "0.49249062", "0.4910028", "0.48797137", "0.48680538", "0.48663077", "0.4861973", "0.48599917", "0.48540404", "0.4840776", "0.48404068", "0.4814006", "0.48053986", "0.48047483", "0.4776277", "0.4771371", "0.47699693", "0.47599643", "0.475744", "0.47488806", "0.4733035", "0.4726332", "0.47025147", "0.46994573", "0.46910533", "0.46883428", "0.46821758", "0.46671328", "0.46667367", "0.4653291", "0.46192896", "0.4619075", "0.4618485", "0.4615647", "0.46138296", "0.4606942", "0.460455", "0.45996636", "0.45989582" ]
0.8124679
0
This function hides all main DIV elements. The caller is then responsible for reshowing the one that needs to be displayed.
function hideAllPanels() { $('#AllLeads').hide(); $('#AddLead').hide(); $('#LeadDetails').hide(); $('#AllOpps').hide(); $('#OppDetails').hide(); $('#AllSales').hide(); $('#SaleDetails').hide(); $('#AllLostSales').hide(); $('#LostSaleDetails').hide(); $('#AllReports').hide(); $('#amountPipeline').hide(); $('#countPipeline').hide(); $('#chartArea').hide(); $('#drillDown').hide(); $('#pipelineName').hide(); $('#conversionName').hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideDivs()\n{\n\tpageNavHeader.style.marginBottom = '1em';\n\tpageNavButton.innerHTML = 'Show Quick Links';\n\tpageNavDiv.style.display = 'none';\n\t\n\tinformationHeader.style.marginBottom = '1em';\n\tinformationButton.innerHTML = 'Show Information';\n\tinformationDiv.style.display = 'none';\n\t\n\tfor(var i = 0; i < collectionOfDivs.length; i++)\n\t{\n\t\tcollectionOfDivs[i].style.display = 'none';\n\t}\n\t\n\tfor(var i = 0; i < collectionOfDivs2.length; i++)\n\t{\n\t\tcollectionOfDivs2[i].style.display = 'none';\n\t}\n}", "function hideMainDivs(){\n document.getElementById(\"nav\").style.display = \"none\";\n document.getElementById(\"main-container\").style.display = \"none\";\n}", "function hideAll() {\n divInfo.forEach(function(el) {\n el.style.display = 'none';\n });\n}", "function hideAll() {\n $(\"#startContainer\").hide();\n $(\"#playContainer\").hide();\n $(\"#feedbackContainer\").hide();\n $(\"#endGameContainer\").hide();\n}", "hide() {\n this.backgroundDiv.remove();\n this.MiscDiv.remove();\n }", "function hideAll(){\n for(i=0;i<divs.length;i++){\n document.getElementById(divs[i]).style.display = \"none\"; \n }\n}", "function hideAll() {\n standardBox.hide();\n imageBox.hide();\n galleryBox.hide();\n linkBox.hide();\n videoBox.hide();\n audioBox.hide();\n chatBox.hide();\n statusBox.hide();\n quoteBox.hide();\n asideBox.hide();\n }", "function hideAllContent() {\n $(\"#overview\").hide();\n $(\"#tips\").hide();\n $(\"#sample1\").hide();\n $(\"#sample2\").hide();\n $(\"#sample3\").hide();\n }", "function hideAllDiv(hidername){ /*name can be modul1, modul2 or fach*/\n\tvar elements = document.querySelectorAll('*[data-hiderforname~=\"' + hidername + '\"]');\n\tfor (var i=0; i < elements.length; i++) {\n\t\telements[i].setAttribute(\"data-hidecontent\",\"true\");\n\t\tvar hideelement = document.getElementById(elements[i].getAttribute(\"data-hideshows\"));\n\t\tif(hideelement){\n\t\t\thideelement.setAttribute(\"data-hide\",\"true\");\n\t\t}\n\t}\n\n\tredrawFix();\n}", "function hideEverything() {\n hideNav();\n hideAllPosts();\n document.getElementById('tags').style.display = 'none';\n document.getElementById('all_posts_container').style.display = 'none';\n document.getElementById('close_tags').style.display = 'none';\n document.getElementById('clear_search_results').style.display = 'none';\n}", "function hideUnhideAllDivs(action)\n{\n //alert(\"hideUnhideAllDivs()\");\n if(runHide==true)\n {\n runHide=false;\n myDocumentElements=document.getElementsByTagName(\"div\");\n for (i=0;i<myDocumentElements.length;i++)\n {\n divisionNo = \"\" + myDocumentElements[i].id;\n if (divisionNo.indexOf(\"__hide_division_\")==0)\n {\n elem = document.getElementById(divisionNo);\n if (elem){\n //Don't hide if FF and FCK.. let FCK hide all later\n if (document.wysiwyg == \"FCKeditor\" && navigator.product == \"Gecko\")\n {\n }\n else\n {\n elem.style.display =action;\n }\n }\n }\n }\n }\n}", "function hideUnusedElements() {\n if (document.getElementsByClassName('flex-item').length === 0) {\n document.getElementById('topContacts').style.display = 'none';\n }\n if (document.getElementsByTagName('h1').length === 0) {\n document.getElementById('header').style.display = 'none';\n }\n if (document.getElementsByClassName('work-entry').length === 0) {\n document.getElementById('workExperience').style.display = 'none';\n }\n if (document.getElementsByClassName('project-entry').length === 0) {\n document.getElementById('projects').style.display = 'none';\n }\n if (document.getElementsByClassName('education-entry').length === 0) {\n document.getElementById('education').style.display = 'none';\n }\n if (document.getElementsByClassName('flex-item').length === 0) {\n document.getElementById('lets-connect').style.display = 'none';\n }\n if (document.getElementById('map') === null) {\n document.getElementById('mapDiv').style.display = 'none';\n }\n\n }", "function hideAll(){\n\t$('.resume_content').hide();\n\t$('.educ_container').hide();\n\t$('#menu').hide();\n\t$('.educ_container').hide();\n\t$('.skills_container').hide();\n\t$('.chart_container').hide();\n\t$('.soft_container').hide();\n\t$('.contact_container').hide();\n}", "function hideAll() {\n\tvar mainNavLinks = document.getElementById('mainNav').getElementsByClassName(\"toggleMenu\");\n for (var i = 0; i < mainNavLinks.length; i++) {\n\t\tmainNavLinks[i].classList.remove(\"activeSubNav\"); // Remove 'activeSubNav' class from all the main nav links\n\t\tmainNavLinks[i].setAttribute(\"aria-expanded\", false);\n\t}\n var mainNavList = document.getElementById('mainNav').querySelectorAll('ul#mainNavList > li');\n for (var k = 0; k < mainNavList.length; k++) {\n\t\tmainNavList[k].classList.remove(\"active\"); // Remove 'active' class from all the main nav <li>\n }\n var divsToHide = document.getElementsByClassName(\"dtSubNav\");\n for (var j = 0; j < divsToHide.length; j++) {\n\t\tdivsToHide[j].style.display = \"none\"; // Hide all divs\n }\n document.getElementById(\"desktopFade\").style.display = \"none\";\t// Remove black overlay\n}", "function show() {\n $.forEach(this.elements, function(element) {\n element.style.display = '';\n });\n\n return this;\n }", "function showAllDiv(hidername){\n\tvar elements = document.querySelectorAll('*[data-hiderforname~=\"' + hidername + '\"]');\n\tfor (var i=0; i < elements.length; i++) {\n\t\telements[i].setAttribute(\"data-hidecontent\",\"false\");\n\t\tvar hideelement = document.getElementById(elements[i].getAttribute(\"data-hideshows\"));\n\t\tif(hideelement){\n\t\t\thideelement.setAttribute(\"data-hide\",\"false\");\n\t\t}\n\t}\n\n\tredrawFix();\n}", "hide ()\n\t{\n\t\t//hide the elements of the view\n\t\tthis.root.style.display= 'none';\n\t}", "function hide() {\n $.forEach(this.elements, function(element) {\n element.style.display = 'none';\n });\n\n return this;\n }", "function hideStuff(){\n\t$('#layout').fadeOut();\n\tparent.$(\"#exclusionTableWrapper\").hide();\n\t// hide plate exclusion divs\n\t$('.excludedPlateContainer').hide();\n}", "hide() {\n this.backgroundDiv.remove();\n this.BasementFloorDiv.remove();\n }", "function hideElements(){\n\t\n\tvar screenWidth = window.innerWidth\n\tif(screenWidth>1120) hide = true //this is so if the screen goes from small to big the device has permission to hide elements again onces the screen gets smaller\n\t\n\tif(screenWidth<=1120){\n\t\tif(hide == true){\n\t\t$('#view-attendees').show()//button\n\t\t$('#view-event').hide()//button\n\t\t$('#list-attendees-div').hide()\n\t\t}//if\n\t}//if\n\telse{\n\t\t$('#view-attendees').hide()\n\t\t$('#view-event').hide()//button\n\t\t$('#list-attendees-div').hide()\n\t\t$('#event-info-container').show()\n\t\t$('#list-attendees-div').css('display','inline-block')\n\t\t$('#event-info-container').css('display','inline-block')\n\t}\n\tif(screenWidth<=1120) hide = false //this is so device knows it has already hidden elements\n}", "function hideAll(){\n $$('.contenido').each(function(item){\n item.hide();\n })\n}", "function hideElements(){\n\t$(\".trivia\").toggle();\n\t$(\".navbar\").toggle();\n\t$(\".end\").toggle();\n}", "_hideAll() {\n this.views.directorySelection.hide();\n this.views.training.hide();\n this.views.messages.hide();\n this.views.directorySelection.css('visibility', 'hidden');\n this.views.training.css('visibility', 'hidden');\n this.views.messages.css('visibility', 'hidden');\n }", "function hideAll() {\n $(\"#header\").hide();\n $(\"#keyword-type\").hide();\n $(\"#url\").hide();\n $(\"#option-choose\").hide();\n $(\"#submit\").hide();\n $(\"#name\").addClass('hide');\n}", "function hidePaymentDivs (elems){\n for( i = 0; i < elems.length; i++){\n elems[i].style.display = \"none\";\n };\n }", "function clearDisplay() {\n hideContainers();\n resetCopyNotes();\n resetClipboardNote();\n }", "function hideAll() {\n\t\t// Hide counter\n\t\t$('.counter').animate({\n\t\t\ttop: \"-18em\"\n\t\t}, 600, \"swing\", function() {\n\t\t});\n\t\t\n\t\t// Hide highlight\n\t\t$('.highlight, .glow').addClass('highlight-hide');\n\t\tsetTimeout(function() {\n\t\t\t// Slide away main content\n\t\t\t$('.main').animate({\n\t\t\t\tmarginTop: \"150vh\"\n\t\t\t}, 1200, \"swing\", function() {\n\t\t\t\tlocation.reload();\n\t\t\t});\n\t\t}, 400);\n\t\t\n\t\t// Hide nav button and menu\n\t\t$('.collapse').collapse('hide');\n\t\t$('.navbar-toggle').animate({\n\t\t\tbottom: \"-100vh\"\n\t\t}, 800, \"swing\", function() {\n\t\t});\n\t}", "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $sectionUserProfile\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $favoritedArticles\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "function nextDiv(){ \r\n var x = document.getElementsByClassName(\"subDivMTN\"); \r\n for ( var i = 0; i < x.length; i++) {\r\n x[i].style.display = 'none';\r\n}\r\n\r\n var y = document.getElementById(\"subDiv6\");\r\n y.style.display = 'block';\r\n}", "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}", "function hideDivs(){\n $('#results').hide();\n $('#information').hide();\n $('#content').hide();\n $('#blog').hide();\n $('#oneBack').hide();\n $('#twoBack').hide();\n// if($(window).width() > 1100) {\n// $('#content').show();\n// }\n}", "function hideAll() {\n $('.cms').hide();\n $('#products-list').hide();\n $('#cart-container').hide();\n}", "function hideMainScreen() {\n\t$(\"#main\").addClass(\"hidden\");\n}", "function main() {\n\t$('#change1').hide('fast');\n\t$('#change2').hide('fast');\n\t$('#change3').hide('fast');\n\t$('#change4').hide('fast');\n\t$('#change5').hide('fast');\n}", "function hideElements() {\n \n $('div').hide(); // hides all divs\n $(':button').hide(); // hides all buttons\n $(':button').unbind(); // unbinds all buttons\n}", "function hideAll(){\n $$('.contenido').each(function(item){\n item.hide();\n //console.log(item);\n })\n counter=0;\n}", "function hideAllShowOne(idToShow) {\n document.getElementById(\"about_html\").style = \"display:none\"\n document.getElementById(\"ex1_html\").style = \"display:none\"\n document.getElementById(\"ex2_html\").style = \"display:none\"\n document.getElementById(\"ex3_html\").style = \"display:none\"\n document.getElementById(idToShow).style = \"display:block\"\n}", "function hideAllShowOne(idToShow) {\n document.getElementById(\"about_html\").style = \"display:none\"\n document.getElementById(\"ex1_html\").style = \"display:none\"\n document.getElementById(\"ex2_html\").style = \"display:none\"\n document.getElementById(\"ex3_html\").style = \"display:none\"\n document.getElementById(idToShow).style = \"display:block\"\n}", "function hideAllShowOne(idToShow) {\n document.getElementById(\"about_html\").style = \"display:none\"\n document.getElementById(\"ex1_html\").style = \"display:none\"\n document.getElementById(\"ex2_html\").style = \"display:none\"\n document.getElementById(\"ex3_html\").style = \"display:none\"\n document.getElementById(idToShow).style = \"display:block\"\n}", "function hideAllShowOne(idToShow) {\n document.getElementById(\"about_html\").style = \"display:none\"\n document.getElementById(\"ex1_html\").style = \"display:none\"\n document.getElementById(\"ex2_html\").style = \"display:none\"\n document.getElementById(\"ex3_html\").style = \"display:none\"\n document.getElementById(idToShow).style = \"display:block\"\n}", "function hideAllShowOne(idToShow) {\n document.getElementById(\"about_html\").style = \"display:none\"\n document.getElementById(\"ex1_html\").style = \"display:none\"\n document.getElementById(\"ex2_html\").style = \"display:none\"\n document.getElementById(\"ex3_html\").style = \"display:none\"\n document.getElementById(idToShow).style = \"display:block\"\n}", "function hideAllShowOne(idToShow) {\n document.getElementById(\"about_html\").style = \"display:none\"\n document.getElementById(\"ex1_html\").style = \"display:none\"\n document.getElementById(\"ex2_html\").style = \"display:none\"\n document.getElementById(\"ex3_html\").style = \"display:none\"\n document.getElementById(idToShow).style = \"display:block\"\n}", "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n // **** added favorite article, submit story, user profile hide\n $submitStoryForm,\n $favoriteArticles,\n $userProfile,\n // ****\n ];\n elementsArr.forEach(($elem) => $elem.hide());\n }", "function hideElements() {\n $(\"#collapse_icon\").html(\"show\");\n $(\".sidebar_elements\").addClass(\"hidden\").fadeTo(600, 0).css('dispaly', 'flex');\n $(\"#cross\").removeClass(\"hidden\").fadeTo(600, 1).css('dispaly', 'flex');\n}", "function unHideComponents(){\r\n tank.style.visibility = \"visible\";\r\n missile.style.visibility = \"visible\";\r\n score.style.visibility = \"visible\";\r\n}", "function showElements() {\n $(\"#collapse_icon\").html(\"hide\");\n $(\".sidebar_elements\").removeClass(\"hidden\").fadeTo(600, 1);\n $(\".range_options\").css('display', 'flex');\n $(\"#cross\").addClass(\"hidden\").fadeTo(600, 0);\n}", "function unhideControls() {\n\tdocument.querySelector('.hidden').style.visibility = 'visible';\n}", "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach(val => val.hide());\n }", "function hideAll(){\n\t$('#legendCompare').addClass('hide');\n\t$(\"#setupInfos\").hide(\"blind\");\n\t$(\"#compareDemos\").hide(\"blind\");\n\t$(\"#loadSeeConfig\").hide(\"blind\");\n}", "function hideDiv(sElementID) {\n el(sElementID).style.display = \"none\";\n}", "function hideAll(keepType) {\n\tvar result = document.getElementsByClassName('search-result-panel');\n\tfor ( var ePanel in result) {\n\t\tif (ePanel.match(\"\\\\d+\") == null) {\n\t\t} else {\n\t\t\tvar eDivs = result[ePanel].getElementsByTagName('div');\n\t\t\tfor ( var eDiv in eDivs) {\n\t\t\t\tif (eDiv.match(\"\\\\d+\") == null) {\n\t\t\t\t} else if (eDivs[eDiv].id.indexOf(keepType) == 0) {\n\t\t\t\t\teDivs[eDiv].style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\teDivs[eDiv].style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n}", "function unhideHtml () {\n $('.error').prop('hidden',true);\n $('main').prop('hidden',false);\n $('.slideshow').prop('hidden',true);\n}", "function allHide(){\n $(\"#timeRemaining\").hide();\n $(\"#timeUp\").hide();\n $(\"#answer\").hide();\n // $(\"#gameOverBoot\").addClass('d-none');\n }", "function frame_help_hide() {\n\treturn; \n\tvar aDivs = document.getElementsByName(\"DV_HELPTXT\");\n\tvar i = 0;\n\tfor (i=0;i<aDivs.length;i++ )\n\t{\n\t\t//aDivs[i].style.display = 'none';\n\t}\n}", "function hideAllExcept(idDiv) {\n\t\t\n\t\tif (first) {\n\t\t\tfor(key in ongletsArray) {\n\t\t\t\tongletsArray[key]['content'].hide();\n\t\t\t}\n\t\t\tfirst = false;\n\t\t}\n\t\tongletsArray['onglet-'+ongletActuel+'_agmk_chat']['content'].hide();\n\t\tongletsArray[idDiv]['content'].show();\n\t}", "function displayDiv(divName){\n var divNames = [\"AddDataDiv\", \"FindDocDiv\", \"ReplaceDocDiv\", \"RemoveDocDiv\", \"AdapterIntegrationDiv\", \"ChangePasswordDiv\"];\n for(i=0; i<divNames.length; i++){\n document.getElementById(divNames[i]).style.display = \"none\";\n }\n document.getElementById(divName).style.display = \"block\";\n}", "function hideAll()\r\n{\r\n $(\"#loading\").show();\r\n $(\"#titleTop\").hide()\r\n $(\".pagination-container\").hide();\r\n $(\"#formulaire\").hide();\r\n $(\"#titleMid\").hide();\r\n}", "function hideall(){\r\n\tdocument.getElementById(\"homepage\").style.display=\"none\";\r\n\tdocument.getElementById(\"Expert\").style.display=\"none\";\r\n\tdocument.getElementById(\"gameid\").style.display=\"none\";\r\n\tdocument.getElementById(\"Logout\").style.display=\"none\";\r\n\tdocument.getElementById(\"GameInfo\").style.display=\"none\";\r\n\tdocument.getElementById(\"jogo\").style.display=\"none\";\r\n\tdocument.getElementById(\"rst\").style.display=\"none\";\r\n\tdocument.getElementById(\"bck\").style.display=\"none\";\r\n\tdocument.getElementById(\"back\").style.display=\"none\";\r\n\tdocument.getElementById(\"str\").style.display=\"none\";\r\n\tdocument.getElementById(\"titulo\").style.display=\"none\";\r\n\tdocument.getElementById(\"form\").style.display=\"none\";\r\n\tdocument.getElementById(\"Play\").style.display=\"none\";\r\n\tdocument.getElementById(\"instructions\").style.display=\"none\";\r\n\tdocument.getElementById(\"honor_board\").style.display=\"none\";\r\n\tdocument.getElementById(\"Begin\").style.display=\"none\";\r\n\tdocument.getElementById(\"Interm\").style.display=\"none\";\r\n\tdocument.getElementById(\"message\").style.display=\"none\";\r\n\tdocument.getElementById(\"leave\").style.display=\"none\";\r\n\tdocument.getElementById(\"vs\").style.display=\"none\";\r\n\tdocument.getElementById(\"ownrank\").style.display=\"none\";\r\n}", "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $loadMore ,\n $favoriteStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $userProfile\n ];\n elementsArr.forEach(($elem) => $elem.addClass(\"hidden\"));\n }", "function hide() {\n\t\tdashboardContent.empty();\n\n\t}", "function hideall(){ \n\t\t$('.counties-container').css(\"display\",\"none\");\n\t}", "function HideDiv()\n{\n\tezDiv.style.visibility=\"hidden\"\n\tezDiv.innerHTML=\"\";\n\t//Following code is to display back previously hided list boxes\n\tlistBoxIds=document.getElementsByTagName(\"select\")\n\tif(listBoxIds!=null)\n\t{\n\t for(i=0;i<listBoxIds.length;i++)\n\t {\n\t if(listBoxIds[i].id==\"CalendarDiv\")\n\t listBoxIds[i].style.visibility=\"visible\"\n\t } \n\t} \n}", "function hideMainSearch() {\n $(\"#main-search\").hide();\n $(\"#rulette-search\").hide();\n }", "function hideSelectorContainers(){\n\thideTypeSelector();\n\thidePlayerSelector();\n\thideYearSelector();\n\thideWeekSelector();\n\thideStatNameSelector();\n\thideTeamSelector();\n}", "function Display_hideInvite() {\n\tthis.clear(document.getElementById(\"divAboveAll\"));\n}", "function hideGameContainers() {\n $(\"#question\").hide();\n $(\"#choice-1\").hide();\n $(\"#choice-2\").hide();\n $(\"#choice-3\").hide();\n $(\"#choice-4\").hide();\n }", "function unhideContent(){\n for(var j=0;j<4;j++){\n document.getElementsByClassName(\"show-after-start\")[j].style.cssText = \"display:contents;\";\n document.getElementsByClassName(\"show-after-start\")[j].style.cssText = \"animation: fadein 1s;\";\n }\n\n}", "function hideAllChildren(){\n uki.map( screens, function(screen){\n screen.visible(false);\n });\n }", "function hide() {\n\t\t\tdiv.hide();\n\t\t\tEvent.stopObserving(div, 'mouseover', onMouseMove);\n\t\t\tEvent.stopObserving(div, 'click', onClick);\n\t\t\tEvent.stopObserving(document, 'click', hide);\n\t\t\tEvent.stopObserving(textarea, 'click', hide);\n\t\t\tEvent.stopObserving(textarea, 'keydown', onKeyDown);\n\t\t\tvisible = false;\n\t\t}", "function hideAllCards(){\n for(i=0; i<divItems.length;i++){\n if(divItems[i].className !='off') divItems[i].className='hidden';\n }\n}", "function clearDisplay() {\n // Removing all children from an element\n var element = document.getElementById(\"rightSideBar\");\n document.getElementById(\"docDisplay\").innerHTML = \"\";\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}", "function hideContent(){\n for(var i=0;i<4;i++){\n document.getElementsByClassName(\"hide-after-start\")[i].style.cssText = \"display:none;\";\n }\n}", "function showDiv(item) {\n var arr = $('.divsMain');\n var ob = $(item);\n\n for (var i = 0; i < arr.length; i++) {\n $(arr[i]).fadeOut(300);\n // $(arr[i]).css({\n // top: '1000px'\n // });\n }\n ob.fadeIn(300);\n // ob.animate({\n // top: '0px'\n // });\n\n\n\n // this is for making visible the others.\n // var others = $('.divsSec');\n // for(var i = 0;i<others.length;i++) {\n // $(others[i]).show();\n // $(others[i]).css({\n // top: '0px'\n // });\n // }\n}", "function hideAll () {\n\t\tvar all = document.querySelectorAll (\"div.thumbnail-item.gallery\");\n\t\tfor (var i = 0; i < all.length; i++)\n\t\t\tall [i].className = \"hidden\";\n\t}", "function clearScreen() {\r\n document.querySelector(\"div.c\").style.display = \"none\";\r\n document.querySelector(\"div.d\").style.display = \"none\";\r\n document.querySelector(\"div.e\").style.display = \"none\";\r\n document.querySelector(\"div.f\").style.display = \"none\";\r\n }", "function escondeDiv(sBoxID) {\n document.getElementById(sBoxID).style.visibility = 'hidden';\n}", "function hideTools() {\n\t\t\thideAllBtn();\n\t\t\t$('#colorelement').css('display','none');\n\t\t\t$('#fntEdit').css('display','none');\n\t\t}", "function hidMainSection() {\n mainSection.addClass(\"main-section_hidden\");\n }", "function hideWorking() {\n if (hidedepth > 0) {\n hidedepth -= 1;\n }\n if (hidedepth == 0) {\n $(\"#loading\").hide();\n $(\"#navigation\").show();\n }\n }", "function hideAll() {\n allTheContent.style.opacity = 0;\n modal.style.display = \"none\";\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 _hideAllPages() {\n var i = 0;\n var l = _containers.length;\n for (i; i < l; i++) {\n var container = document.getElementById(_containers[i]);\n Main.hidePage(container);\n }\n }", "function hideMenuDivs(){\n document.getElementById(\"favourites\").style.display = \"none\";\n document.getElementById(\"history\").style.display = \"none\";\n document.getElementById(\"your-cars\").style.display = \"none\";\n document.getElementById(\"your-parks\").style.display = \"none\";\n document.getElementById(\"credit-details\").style.display = \"none\";\n document.getElementById(\"payment-details\").style.display = \"none\";\n document.getElementById(\"lease-summary\").style.display = \"none\";\n document.getElementById(\"add-car\").style.display = \"none\";\n document.getElementById(\"add-park\").style.display = \"none\";\n document.getElementById(\"add-credit-card\").style.display = \"none\";\n document.getElementById(\"add-debit-card\").style.display = \"none\";\n document.getElementById(\"about\").style.display = \"none\";\n}", "function CacherBas(){\r\n\tdivBasMenu.style.display = \"none\";\r\n\tdivBasAttaque.style.display = \"none\";\r\n\tdivBasPokemon.style.display = \"none\";\r\n\tdivBasSoin.style.display = \"none\";\r\n\tdivBasTexte.style.display = \"none\";\r\n}", "function HideDiv(Type, Action){\r\n //! This function is used by the function UserFilter(). \r\n //^ Type = div to be toggled, Action = display/hide\r\n //? The For-Loop is used because getElementsByClass returns an array\r\n for (let index = 0; index < Type.length; index++) {\r\n Type[index].style.display=Action; \r\n }\r\n}", "unhide() {\n document.getElementById(\"guiArea\").classList.remove(\"hideMe\");\n document.getElementById(\"guiAreaToggle\").classList.remove(\"hideMe\");\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}", "function hideComparisonData() {\n\n // Hide the comparison remote station elements\n lCompDataElements = document.getElementsByClassName(\"CompObs\"); \n for (let lElement of lCompDataElements) {lElement.style.display = \"none\";}\n\n // Show the local station data elements\n lOrigDataElements = document.getElementsByClassName(\"CompOrig\"); \n for (let lElement of lOrigDataElements) {lElement.style.display = \"inline\";}\n\n}", "function hideInitialScreen() {\n for (var i = 0; i < startMsg.length; i++) {\n startMsg[i].style.display = \"none\";\n }\n // hide start question button\n\n for (var i = 0; i < startBtn.length; i++) {\n startBtn[i].style.display = \"none\";\n }\n //hide viewHighScore button\n for (var i = 0; i < viewHighScore.length; i++) {\n viewHighScore[i].style.display = \"none\";\n }\n}", "hide()\n\t{\n\t\t// hide the decorations:\n\t\tsuper.hide();\n\n\t\t// hide the stimuli:\n\t\tif (typeof this._items !== \"undefined\")\n\t\t{\n\t\t\tfor (let i = 0; i < this._items.length; ++i)\n\t\t\t{\n\t\t\t\tif (this._visual.visibles[i])\n\t\t\t\t{\n\t\t\t\t\tconst textStim = this._visual.textStims[i];\n\t\t\t\t\ttextStim.hide();\n\n\t\t\t\t\tconst responseStim = this._visual.responseStims[i];\n\t\t\t\t\tif (responseStim)\n\t\t\t\t\t{\n\t\t\t\t\t\tresponseStim.hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// hide the scrollbar:\n\t\t\tthis._scrollbar.hide();\n\t\t}\n\t}", "function hideInterferingElements(){\r\n\tdisplaySelectBoxes(false);\r\n\tdocument.getElementById(\"flash_search\").style.display='none';\r\n}", "function hide() {\r\n\tluck = \"\";\r\n\t document.getElementById(\"spin\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"results\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"title\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"ui1\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"postForm\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"ui\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"bucks\").style.visibility = \"hidden\"; \r\n\t \r\n\r\n\t}", "function hideContent() {\n var cards = document.getElementsByClassName('card');\n\n _.forEach(cards, function (card) {\n card.style.display = \"none\";\n card.style.top = 0;\n card.style.left = 0;\n card.style.width = 0;\n card.style.height = 0;\n });\n}", "function displayNone()\n{\n var i;\n // looping all possible containers\n for(i = 1; i <= possibleContainers; i++)\n {\n document.getElementById(\"container\"+i).style.display = \"none\";\n }\n}", "function menuHideAll() {\n\t$('#shop').hide();\n\t$('#highscore').hide();\n\t$('#milestones').hide();\n\t$('#options').hide();\n\t$('#chat').hide();\n}", "function hideDivMenu(thisObject) {\n\tthisObject.style.visibility='hidden';\n}", "doHidden( root ) {\n root.style.display = 'none';\n }" ]
[ "0.7335277", "0.7247037", "0.7201496", "0.69616705", "0.68890977", "0.6862547", "0.6859901", "0.68153554", "0.67900854", "0.6702604", "0.66901237", "0.6677316", "0.66563046", "0.6650601", "0.66383094", "0.662691", "0.65512073", "0.6538004", "0.6517151", "0.65132976", "0.649363", "0.6490423", "0.6479145", "0.64631367", "0.6461358", "0.6448229", "0.64448273", "0.6437119", "0.6429648", "0.6429648", "0.6422156", "0.6418764", "0.64166903", "0.6415069", "0.64091915", "0.6407342", "0.64009863", "0.6387118", "0.6378316", "0.63718677", "0.63640183", "0.63640183", "0.63640183", "0.63640183", "0.63640183", "0.63640183", "0.6359102", "0.633597", "0.6320933", "0.6319137", "0.63139224", "0.6308026", "0.63042545", "0.6302269", "0.6298127", "0.62896454", "0.6282251", "0.62773144", "0.6236356", "0.62306446", "0.6226185", "0.62261045", "0.62245464", "0.6220034", "0.62194705", "0.6216964", "0.62147886", "0.61969304", "0.6186858", "0.6181744", "0.617685", "0.61661226", "0.6164732", "0.6160485", "0.6152394", "0.6146291", "0.614061", "0.6135135", "0.61314106", "0.61272526", "0.6122684", "0.6119699", "0.6119519", "0.61191845", "0.61189365", "0.6117337", "0.6102272", "0.61009115", "0.6099574", "0.60988116", "0.609848", "0.6092341", "0.6090423", "0.6085934", "0.6085472", "0.60829264", "0.6081851", "0.60771024", "0.6068926", "0.6064208", "0.60594916" ]
0.0
-1
This function retrieves all leads.
function showLeads() { //Highlight the selected tile $('#LeadsTile').css("background-color", "orange"); $('#OppsTile').css("background-color", "#0072C6"); $('#SalesTile').css("background-color", "#0072C6"); $('#LostSalesTile').css("background-color", "#0072C6"); $('#ReportsTile').css("background-color", "#0072C6"); var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var hasLeads = false; hideAllPanels(); var LeadList = document.getElementById("AllLeads"); list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var leadTable = document.getElementById("LeadList"); // Remove all nodes from the lead <DIV> so we have a clean space to write to while (leadTable.hasChildNodes()) { leadTable.removeChild(leadTable.lastChild); } // Iterate through the Prospects list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Lead") { // Create a DIV to display the organization name var lead = document.createElement("div"); var leadLabel = document.createTextNode(listItem.get_fieldValues()["Title"]); lead.appendChild(leadLabel); // Add an ID to the lead DIV lead.id = listItem.get_id(); // Add an class to the lead DIV lead.className = "item"; // Add an onclick event to show the lead details $(lead).click(function (sender) { showLeadDetails(sender.target.id); }); // Add the lead div to the UI leadTable.appendChild(lead); hasLeads = true; } } if (!hasLeads) { var noLeads = document.createElement("div"); noLeads.appendChild(document.createTextNode("There are no leads. You can add a new lead from here.")); leadTable.appendChild(noLeads); } $('#AllLeads').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get Leads. Error: " + args.get_message())); errArea.appendChild(divMessage); $('#LeadList').fadeIn(500, null); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static leadsOfcampaign(campaignId, processStep) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n let camp = yield this.findById(campaignId);\n if (camp == null) {\n return [];\n }\n else {\n return lead_1.Lead\n .findAll({\n where: {\n CampId: campaignId,\n IsDeleted: false,\n ProcessStep: processStep\n }\n });\n }\n }\n catch (error) {\n throw error;\n }\n });\n }", "function loadAll() {\n return AirportService.fetch();\n }", "function fetchAllBlogs() {\n var deferred = $q.defer();\n\n $http.get(REST_API_URI + 'blogs').then(function (response) {\n deferred.resolve(response.data);\n },\n function (errorResponse) {\n console.log('Error While Fetching Blogs');\n deferred.reject(errorResponse);\n }\n );\n return deferred.promise;\n }", "function loadAllRaids()\n{\n reloadUser();\n\n if ( gUser == null )\n return;\n\n $(\"#body\").empty();\n\n var Parameters = {\n offset : 0,\n count : 30\n };\n\n asyncQuery( \"raid_list\", Parameters, generateRaidList );\n}", "static async getAll() {\n try {\n return await ingWrapper.http\n .get('accounts')\n .toObjectArray(Account);\n } catch (getAccountsErr) {\n if (getAccountsErr.res.statusCode === 404) {\n return [];\n }\n throw getAccountsErr;\n }\n }", "getAllJournals () {\n\t\t\tthis.$axios.get('/api/JournalContrlr').then(res => {\n\t\t\t\tthis.allJournals = res.data\n\t\t\t});\n\t\t}", "async _list(options = {}, { eventId } = {}) {\n /* Looks for an extra record past the limit to determine\n last page. */\n if (options.offset === null || options.offset === undefined) {\n if (options.limit !== undefined) delete options.limit;\n } else {\n if (!options.limit) options.limit = 21;\n else options.limit += 1;\n }\n\n /* Get a list of records. */\n let models, err;\n [err, models] = await to(this.Model.findAll(options));\n if (err) this._handleErrors(err, { eventId });\n\n this.cache.list = models;\n if (!models) return [];\n else return models.map(e => e.get({ plain: true }));\n }", "static async findAllContacts() {\n const ContactList = await Contact.find({});\n return ContactList;\n }", "function getAll() {\n activityService.getAll()\n .success(function(data) {\n $scope.activityList = data;\n })\n .error(function(error) {\n $scope.status = error.message;\n });\n }", "async getAll() {\n try {\n const db = await this.conexion.conectar();\n const collection = db.collection('Encargados');\n const findResult = await collection.find({}).toArray();\n await this.conexion.desconectar();\n return (findResult);\n }\n catch (e) {\n throw e;\n }\n }", "static async getAll() {\n let projection = {\n shipmentStatus: 1,\n referenceNo: 1,\n courier: 1,\n receivedBy: 1,\n nosOfSamples: 1\n };\n try {\n let result = await DatabaseService.getAll(collectionName, projection);\n return result;\n } catch (err) {\n throw err;\n }\n }", "getAll() {\n return this._get(1);\n }", "async function loadAllLeads(z, bundle, pages, from, to, page_1) {\n\n var outputObject = page_1;\n\n //loop through page count, fetching each page of results and adding to outputObject\n for (counter = 2; counter <= pages; counter++) {\n var request = await fetch(`https://transmission.confection.io/${bundle.authData.account_id}/leads/between/${from}/${to}/page/${counter}`, {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n 'key': bundle.authData.secret_key\n })\n });\n var data = await request.json();\n\n outputObject = Object.assign(outputObject, data.collection)\n\n }\n return outputObject;\n }", "getLinks() {\n var self = this\n fetchLinkList(function(links) {\n self.links = links;\n })\n\n }", "getAll(){\n\n return this.contactos;\n\n }", "getAll() {\n const all = FighterRepository.getAll();\n if (!all) {\n return null;\n }\n return all;\n }", "function getAll(stop_id) {\n\n return setStops().then(function () {\n return (0, _db2.default)();\n }).then(function getStops(db) {\n\n var transaction = db.transaction('stops');\n var stopsStore = transaction.objectStore('stops');\n\n return stopsStore.getAll();\n });\n}", "function getAll (){\n return Mentor.find({});\n}", "async fetchAll() {\n try {\n // Make the request\n const response = await axios.get(\n `${this.DB_READ_URL}/${this.DB_DEFAULTS_CONFIG.plugin_id}/${this.DB_DEFAULTS_CONFIG.collection_name}/${this.DB_DEFAULTS_CONFIG.organization_id}`,\n );\n\n if (response.data.data == null) {\n return { data: [] };\n }\n\n // Return the response\n return response.data;\n } catch (error) {\n if (\n error.response.data.status === 404\n && error.response.data.message === 'collection not found'\n ) {\n return { data: [] };\n }\n\n throw new CustomError(`Unable to Connect to Zuri Core DB [READ ALL]: ${error}`, '500');\n }\n }", "static async getAll() {\n try {\n let result = await DatabaseService.getAll(collectionName);\n return result;\n } catch (err) {\n throw err;\n }\n\n }", "async function getAllActivities() {\n try {\n const { rows } = await client.query(`\n SELECT * FROM activities;\n `);\n return rows;\n } catch (error) {\n throw error;\n }\n}", "function fetchAllVehicles() {\n return Restangular.all('/api/vehicle/GetAllVehicles').getList().then(function (allVehiclesResponse) {\n return allVehicles = allVehiclesResponse;\n });\n }", "async getAllGiveaways() {\n // Get all giveaways from the database\n return giveawayDB.fetchEverything().array();\n }", "static async list(){\n let sql = 'Select * from theloai';\n let list =[];\n try {\n let results = await database.excute(sql);\n results.forEach(element => {\n let tl = new TheLoai();\n tl.build(element.id,element.tenTheLoai,element.moTa);\n list.push(tl);\n });\n return list;\n\n } catch (error) {\n throw error; \n } \n }", "static async fetchAllBookings() {\n return api.get('/booking').then((response) => {\n return response.data.map((b) => new Booking(b));\n });\n }", "static async getAll () {\n const feeds = await Feed.getAll()\n const associations = await Promise.all(feeds.map(this.getFeedAssociations))\n return feeds.map((feed, i) => new FeedData({\n feed,\n profile: associations[i].profile,\n subscribers: associations[i].subscribers,\n filteredFormats: associations[i].filteredFormats\n }))\n }", "async function getActivities(req, res) {\n try {\n const activities = await Activity.findAll({ include: [Destination] });\n successMsg(res, 200, 'correcto', activities)\n } catch (error) {\n errorMsg(res, 500, 'Ha ocurrido un error', error);\n }\n}", "getAll(req, res, next) {\n try {\n const knights = knightsService.getAll()\n res.send(knights)\n } catch (error) {\n next(error)\n }\n }", "function all() {\n var deferred = $q.defer();\n\n $http.get('/api/desembolsos/?format=json')\n .success(function (data) {\n deferred.resolve(data);\n });\n\n return deferred.promise;\n }", "static async getAll() {\n try {\n const result = await db.queryNoParams(\n 'SELECT * FROM accounts ORDER BY id'\n );\n return result.rows;\n } catch (err) {\n return err.code;\n }\n }", "async function getAll(){\r\n let _contract = await getContract();\r\n let l = [];\r\n\r\n const count = await _contract.methods.offersIndex().call();\r\n //get list of offers\r\n for (let i = 0; i <= count-1; i++) {\r\n const offer = await _contract.methods.offers(i).call();\r\n\r\n if(offer[\"purchased\"] === false){\r\n let newOffer = {\"id\":web3.utils.hexToNumber(offer[\"id\"][\"_hex\"]),\r\n \"owner\":offer[\"owner\"],\r\n \"purchased\":offer[\"purchased\"],\r\n \"price\":web3.utils.hexToNumber(offer[\"price\"][\"_hex\"]),\r\n \"tokens\":web3.utils.hexToNumber(offer[\"tokens\"][\"_hex\"])};\r\n \r\n l.push(newOffer);\r\n }\r\n }\r\n return(l);\r\n}", "function getAllLeadsInfo() {\n \n var urrl = window.location.href; \n var serached = urrl.substr(urrl.search(\"leads\"), urrl.lastIndexOf(\"edit\"));\n // alert(urrl.search(\"leads\"));\n // alert(urrl);\n // alert(urrl.substr(urrl.search(\"leads\"), urrl.lastIndexOf(\"edit\")) );\n // alert(\"done\"+serached.match( numberPattern ));\n return $.ajax({\n method: \"GET\",\n url: \"/leads/edits/\"+serached.match( numberPattern ),\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n },\n success: function (response) {\n let result = JSON.parse(response);\n EditInfo = result['EditLeadInfo'];\n console.log('here get all edit leads info response: ', EditInfo);\n \n },\n error: function () {\n console.log('here get leads info error');\n }\n });\n }", "getAll(){\n this.server.get('/api/get-users-banned', (req, res) => {\n try {\n this.App.BanOrm.getAll((err, rows) => {\n if (err) this.App.throwErr(err, this.prefix, res);\n else res.send(rows)\n })\n }\n catch (err){\n this.App.throwErr(err, this.prefix, res)\n }\n })\n }", "static getAll() {\n return this.this_model().find();\n }", "list() {\n this._followRelService(\"list\", \"List\");\n }", "function listAllHotel(req, res) {\n Hotel.findAll((err, hotel) => {\n if (err) {\n res.status(500).send({ status: false, message: \"Fallo al listar los Hoteles\" });\n } else {\n res.status(200).send({ status: true, message: \"Hoteles listados exitosamente\", data: hotel });\n }\n });\n}", "static async getAll() {\n const results = await db.query(`\n SELECT * FROM companies\n `)\n return results.rows\n }", "getAllRestaurants() {\n return get(\n this.supportsOffline,\n getRestaurants,\n arrayCacheService(\n async (dbService, storename) => {\n const store = getStore(storename)(dbService);\n return store.getAll();\n },\n RESTAURANTS_STORE\n )\n );\n }", "function getEntriesFromLessons(){\n console.log(\"Getting Lesson Entries\");\n dbShellLessons.transaction(function(tx){\n tx.executeSql(\"select lessonRow_id,teacher_id,lesson_id,exercise_id,exercise_title,exercise_detail,\\\n exercise_voice,exercise_image from lessons group by lesson_id\",[]\n ,renderEntriesForLessons,dberrorhandlerForLessons);\n },dberrorhandlerForLessons);\n}", "function all(vehicleId) {\n var params = '{\"vehicleId\":\"' + vehicleId + '\"}';\n \n var deferr = $q.defer();\n $http.get(mongoLab.baseUrl + 'fuel?q='+ params + '&' + mongoLab.keyParam).success(function(fuelRecords){\n deferr.resolve(fuelRecords);\n }).error(function(err){\n alert(err); \n });\n return deferr.promise;\n }", "async actionGetAll() {\n const self = this;\n\n let payments;\n let error = null;\n try {\n let where = { householdId: self.param('hid') };\n\n if (self.param('start') && self.param('end')) {\n where['createdAt'] = {\n [Op.gte]: new Date(self.param('start')),\n [Op.lte]: new Date(self.param('end')),\n };\n } else if (self.param('start')) {\n where['createdAt'] = {\n [Op.gte]: new Date(self.param('start')),\n };\n } else if (self.param('end')) {\n where['createdAt'] = {\n [Op.lte]: new Date(self.param('end')),\n };\n }\n\n if (self.param('moneypoolId')) {\n if (self.param('moneypoolId') == 'null') {\n where['moneypoolId'] = { [Op.is]: null };\n } else {\n where['moneypoolId'] = self.param('moneypoolId');\n }\n }\n\n if (self.param('id')) {\n where['id'] = self.param('id');\n }\n\n let limit;\n if (self.param('limit')) {\n limit = Number(self.param('limit'));\n }\n\n payments = await self.db.Payment.findAll({\n include: self.db.Payment.extendInclude,\n where: where,\n order: [['createdAt', 'DESC']],\n limit: limit,\n });\n\n if (!payments) {\n // throw a standard 404 nothing found\n throw new ApiError('No payments found', 404);\n }\n } catch (err) {\n error = err;\n }\n\n if (error) {\n self.handleError(error);\n } else {\n self.render(\n {\n payments: payments,\n },\n {\n statusCode: 200,\n }\n );\n }\n }", "async getAllContacts() {\n return await axios.get(endpoint + \"contacts\");\n }", "getAll() {\n return this._get(undefined);\n }", "getAll(request, response, next) {\n this.model.find({}, (err, data) => {\n if (err) {\n return next(err);\n }\n response.json(data);\n });\n }", "function getContacts() {\n return contacts;\n}", "async get() {\r\n let params = {\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n group: this.getGroup()\r\n };\r\n\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findAll(params);\r\n\r\n return result;\r\n }", "list(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/list`, ...params);\n }", "list(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/list`, ...params);\n }", "getAll() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n return yield this.repository.find();\r\n });\r\n }", "getAll() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n return yield this.repository.find();\r\n });\r\n }", "function fetchAllVehicles(){\r\n\t\t\t\tVehicleService.fetchAllVehicles()\r\n\t\t\t\t\t.then(\r\n\t\t\t\t\t\t\tfunction (vehicle) {\r\n\t\t\t\t\t\t\t\tself.vehicles = vehicle;\r\n\t\t\t\t\t\t\t\tself.Filtervehicles = self.vehicles;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tpagination();\r\n\t\t\t\t\t\t\t\t/*console.log(self.vehicles);*/\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tfunction (errResponse) {\r\n\t\t\t\t\t\t\t\t/*console.log('Error while fetching vehicles');*/\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t );\r\n\t\t\t}", "function getBlogs() {\n\t\tblogsReference.onSnapshot((querySnapshot) => {\n\t\t\tconst blogs = [];\n\t\t\tquerySnapshot.forEach((doc) => {\n\t\t\t\tconst blog = doc.data();\n\t\t\t\tblog.id = doc.id;\n\t\t\t\tblogs.push(blog);\n\t\t\t});\n\t\t\tsetBlogs(blogs);\n\t\t});\n\t}", "getAll() {\n return new Promise((resolve, reject) =>\n this.db.query(\"SELECT * FROM articles ORDER BY list_id, articles\")\n .then(res => resolve(res.rows))\n .catch(e => reject(e)))\n }", "all() {\n return Doctor().findAll()\n .then((doctors) => {\n if (doctors.length === 0) {\n log.info('No doctors to scrape');\n return;\n }\n\n log.info(`Scraping [${doctors.length}] doctors.`);\n emit('scrape:all:start', { scraping: true });\n const scrapePromises = [];\n for (const doctor of doctors) {\n scrapePromises.push(this.single(doctor));\n }\n\n return Promise.all(scrapePromises).then(() => {\n emit('scrape:all:finish', { scraping: false });\n log.info('Scraping for all doctors finished');\n });\n })\n .catch((err) => {\n log.error('Error finding all doctors');\n emit('scrape:all:failed', Object.assign({ err }, { scraping: false }));\n throw err;\n });\n }", "function getAllTheBLs(){\n db.collection('listOfBLs').get()\n .then(function(querySnapshot) {\n querySnapshot.forEach(function(doc) {\n allBLs.push(doc.data().name);\n allBLsid.push(doc.id);\n });\n })\n .catch(function(error) {\n console.log(\"Error: \" , error);\n })\n }", "async function all (req, res) {\n try {\n const archives = await Archives.find()\n res.json(archives)\n } catch (error) {\n res.json({message : error.message})\n }\n}", "static getAll() {\r\n return new Promise((next) => {\r\n db.query('SELECT id, nom FROM outil ORDER BY nom')\r\n .then((result) => next(result))\r\n .catch((err) => next(err))\r\n })\r\n }", "function getAllExistingOffers() {\n var query = datastore.createQuery(\"Offer\");\n\n return datastore.runQuery(query)\n .then(res => {\n return res[0];\n })\n}", "function listAll() {\n var bgms = db.get('bgms').map(({id, name, rss, feeds}) => {\n let feed = feeds.length > 0 ? feeds[0] : {title: 'Yet', addedAt: 'Yet'}\n return {\n id,\n name,\n rss,\n latest: feed.title,\n addedAt: feed.addedAt\n }\n })\n for(let {id, name, rss, latest, addedAt} of bgms) {\n print(`ID: : ${id}`)\n print(`Name : ${name}`)\n print(`RSS : ${rss}`)\n print(`Latest : ${latest}`)\n print(`AddedAt: ${addedAt}`)\n print()\n }\n}", "getall(){\nreturn this.get(Config.API_URL + Constant.AGENT_GETALL);\n}", "function getRespondents() {\n\n var respondents = new Array();\n\n nlapiLogExecution('DEBUG', 'Getting all respondents', 'Collector Id ' + this.collectorId);\n\n // Need to force the content type to be JSON for Rails\n // You need both content types, dont know why\n var requestHeaders = new Array();\n requestHeaders['CONTENT-TYPE'] = 'application/json';\n requestHeaders['CONTENT_TYPE'] = 'application/json';\n requestHeaders['Authorization'] = basicAuth.createAuthString(WEBSERVICE_USERNAME, WEBSERVICE_PASSWORD);\n\n // Build URL for webservice\n webServiceUrl = GET_ALLRESPONSES_URL.replace('<%id%>', collectorId);\n\n nlapiLogExecution('DEBUG', 'URL', webServiceUrl);\n\n // Make URL request to Ladybird\n ladybirdResponse = nlapiRequestURL(webServiceUrl, null, requestHeaders);\n\n nlapiLogExecution('DEBUG', 'Got Response code', ladybirdResponse.getCode());\n\n // Check the response code\n switch(parseInt(ladybirdResponse.getCode())) {\n\n case 200:\n nlapiLogExecution('DEBUG', 'Response 200', 'Got all respondents');\n break;\n\n default:\n nlapiLogExecution('DEBUG', 'Response ' + ladybirdResponse.getCode(), 'Error getting respondents ' + ladybirdResponse.getBody());\n return false;\n break;\n }\n\n // Parse the response from JSON into an array\n try {\n respondents = YAHOO.lang.JSON.parse(ladybirdResponse.getBody());\n } catch (e) {\n nlapiLogExecution('DEBUG', 'Error parsing JSON', e.getCode() + '\\n' + e.getDetails());\n return false;\n }\n\n // Store the respondents in the object\n this.respondents = respondents;\n this.totalRespondents = respondents.length;\n\n return respondents;\n }", "getAll() {\n return this.getDataFromServer(this.path);\n }", "async list(req, res){\n const loja = await Loja.findAll();\n\n res.send(loja);\n }", "async getRecords() {\n const sitemap = new sitemapper({\n url: this.sitemapUrl,\n timeout: 120000\n })\n\n const res = await sitemap.fetch();\n\n const excludes = new Set(this.ignoreUrls);\n const fullList = new Set([\n ...res.sites,\n ...this.additionalUrls\n ]).filter(url => !excludes.has(url));\n\n return fullList; \n }", "function getAllLists() {\n var deferred = $.Deferred();\n var listingRequest = Bacon.once({\n type: 'post',\n url: 'list/all'\n }).ajax();\n\n listingRequest.onValue(function(data) {\n deferred.resolve(data);\n })\n\n listingRequest.onError(function(err) {\n deferred.reject(err);\n })\n\n return deferred;\n }", "function fetchAll(entity, listName, options) {\n var response = _retry(function() {\n return DoubleClickCampaigns[entity].list(profileId, options)\n }, constants.DEFAULT_RETRIES, constants.DEFAULT_SLEEP);\n var result = [];\n\n while (response && response[listName] && response[listName].length > 0) {\n result = result.concat(response[listName]);\n\n if (response.nextPageToken) {\n response = _retry(function() {\n return DoubleClickCampaigns[entity].list(profileId, {'pageToken': response.nextPageToken});\n }, constants.DEFAULT_RETRIES, constants.DEFAULT_SLEEP);\n } else {\n response = null;\n }\n }\n\n return result;\n }", "function getAll(req, res) {\n // On récupère la date demandée.\n const date = req.params.date;\n\n retrieveAll(date, (jsonRes) => {\n res.status(200).json(jsonRes);\n });\n}", "async function fetchBlogs() {\n try {\n const BlogData = await API.graphql(graphqlOperation(listBlogs))\n const Blog = BlogData.data.listBlogs.items\n SetBlogs(Blog)\n console.log(Blog)\n } catch (err) {\n console.log('error fetching blogs ')\n }\n }", "async indexAll(){\n return Appointment.findAll();\n }", "getAll() {\n const fighters = FighterRepository.getAll();\n return fighters.length ? fighters : null;\n }", "async getAllReports() {\n return await axios.get(endpoint + \"reports\");\n }", "getAllBills() {\n return HTTP.get(\"/getBills\");\n }", "function getContacts() {\n return contacts;\n }", "function getAllPosts(){\n\n return db.many(`\n SELECT * FROM posts;\n `)\n .then((posts)=> {\n posts.forEach((blog)=> {\n console.log(blog)\n return blog;\n })\n })\n .catch((e) =>{\n console.log(e)\n })\n}", "function getList() {\n return fetch(\n 'https://5f91384ae0559c0016ad7349.mockapi.io/departments',\n ).then((data) => data.json());\n }", "static getAll(){\n return [...all]\n }", "function _getAirlines(req, res, next) {\n\tvar query = {};\n\tvar countQuery = {};\n\tvar limit = (req.body.limit)? req.body.limit : 10;\n\tvar pageCount = (req.body.pageCount)? req.body.pageCount : 0;\n\tvar skip = (limit * pageCount);\n\tvar totalRecords = 0;\n\n\tAIRLINES_COLLECTION.count(countQuery,function(err,count){\n\t\ttotalRecords = count;\n\n\t\tAIRLINES_COLLECTION.find(query, function (airlineerror, airlines) {\n\t\t\tif (airlineerror || !airlines) {\n\t\t\t\tjson.status = '0';\n\t\t\t\tjson.result = { 'message': 'Airlines not found!' };\n\t\t\t\tres.send(json);\n\t\t\t} else {\n\t\t\t\tjson.status = '1';\n\t\t\t\tjson.result = { 'message': 'Airlines found successfully.', 'airlines': airlines, 'totalRecords':totalRecords };\n\t\t\t\tres.send(json);\n\t\t\t}\n\t\t}).skip(skip).limit(limit);\n\t});\n}", "async getAllAdmins(){\r\n\r\n try{\r\n const admins = await Admin.find();\r\n return [200, admins];\r\n }catch{\r\n return [500, 'SERVER ERROR: couldn\\'t get all admins'];\r\n }\r\n \r\n }", "async function getAll(){\n const reservationCollections = await reservations();\n const targets = await reservationCollections.find({}).toArray();\n return targets;\n}", "function allDepartments() {\n connection.query(\"SELECT * FROM departments\", function (err, res) {\n if (err) throw err;\n console.table(\"Departments\", res);\n start();\n });\n}", "function getAll(req, res) {\n clientdata.findAll().then(clidata => {\n return res.status(200).json({\n ok: true,\n clidata\n });\n }).catch(err => {\n return res.status(500).json({\n message: 'Ocurrió un error al buscar los datos de los clientes',\n err\n });\n });\n}", "function getAll() {\n return $http.get(this.apiUrl).then(successCallback, erroCallback);\n }", "static all() {\n return allDoges\n }", "retrieveAll() {\n return this._rooms.allRooms;\n }", "getAll(req, res) {\n // Blank .find param gets all\n Assembly.find({})\n .then(Assemblies => res.json(Assemblies))\n .catch(err => res.status(400).json(err))\n }", "function getAllJournals(req, res, next) {\n\tJournals.findAll({ \n\t\twhere: {\n\t\t\tuserID: req.params.id\n\t\t}\n\t})\n .then(found => res.json(found))\n .catch(err=>next(err));\n}", "function RetrieveFeeds() {\n feeds.forEach(function (feed) {\n GetDataFeed(feed);\n });\n }", "function getOffers() {\n $http.get(\"/api/term_deposits/offers\").then(function (response) {\n response.data.offers.forEach(function (element) {\n offers.push(element);\n });\n loadOffers();\n });\n }", "async getAllOffers(owner, networkId){\n !!this.connection.models ? this.createDbConnection() : null\n var offerModel = OffersModel(this.connection)\n var find = (resolve, reject) => {\n offerModel.find({networkId: networkId}, (err, offers)=>{\n !err ? resolve(offers) : resolve(err)\n })\n }\n this.connection.close();\n return new Promise(find)\n }", "async fetchAll () {\n const orders = await Order.find()\n return orders\n }", "function getAll() {\n for(key in urlDatabase) {\n return urlDatabase;\n }\n}", "function getList() {\n vm.loading = true;\n vm.limit = 8;\n vm.offset = 0;\n vm.list = [];\n vm.noData = false;\n listService.getList(vm.query, vm.limit, vm.offset).then(function (data) {\n vm.offset += vm.limit;\n vm.list = data;\n vm.loading = false;\n vm.noData = !data.length;\n })\n }", "getAll() {\n\t\treturn this.dao.all(`SELECT * FROM items`);\n\t}", "function BlogsMainList(req, res, next) {\n blogsOptions.filters = {};\n const blogsApiUrl = parser.getCompleteApi(blogsOptions);\n\n fetchData(blogsApiUrl, 'blogs', req, res, next);\n}", "function getAll() {\n if (!$rootScope.isSubscribed) {\n $('#jump').modal('show')\n }\n else {\n $http.get(API.BaseUrl + 'events/catchup/ads/list', {\n // params: {\n // page: 1, limit: 15\n // },\n headers: {\n 'Authorization': 'Bearer ' + $rootScope.userAccessToken,\n 'Content-Type': 'application/json'\n }\n }).then(function (res) {\n $scope.events = res.data.data;\n if ($scope.event_id) {\n $scope.event = $scope.events.find(function (f) {\n return f._id == $scope.event_id\n })\n if ($scope.event) {\n playVideo($scope.event)\n }\n }\n }).catch(function (res) {\n if (res.data && res.data.msg)\n toaster.pop('error', res.data.msg)\n });\n }\n }", "function getAll(){\n return db.any('SELECT * FROM Locations');\n}", "function getContacts() {\n\t\t$.get('/api/contacts', function(data) {\n\t\t\tvar rowsToAdd = [];\n\t\t\tfor (var i = 0; i < data.dbContacts.length; i++) {\n\t\t\t\trowsToAdd.push(createContactsRow(data.dbContacts[i]));\n\t\t\t}\n\t\t\trenderContactsList(rowsToAdd);\n\t\t\tnameInput.val('');\n\t\t});\n\t}", "function retrieveAllOnDate(req, res, next){\n // *Getting the master resource id:\n let id = req.params.id;\n let date = req.params.date;\n\n // *Querying the database for all resources:\n let options = {\n sql: 'select ??.*, ??.* from ?? inner join ?? on ?? = ??.?? where ?? = ? and ? between DATE(??) and DATE(??)',\n nestTables: true\n };\n pooler.query(options, ['vehicle', 'schedule', 'vehicle', 'schedule', 'id_vehicle_fk', 'vehicle', 'id', 'id_user_fk', id, date, 'start_date', 'end_date'])\n .then(result => {\n // *Sending the resources as response:\n res.status(200)\n .json(result.rows)\n .end();\n })\n .catch(err => {\n // *If something went wrong:\n // *Sending a 500 error response:\n res.status(500)\n .json({err_code: 'ERR_INTERNAL', err_message: 'Something went wrong'})\n .end();\n });\n}", "async function getAll(){\n const roomCollections = await rooms();\n const targets = await roomCollections.find({}).toArray();\n return targets;\n}", "static get all() {\n return new Promise(async (resolve, reject) => {\n try {\n const postsData = await db.query(`SELECT * FROM thoughts;`)\n const posts = postsData.rows.map(p => new Post(p))\n resolve(posts);\n } catch (err) {\n reject(\"Sorry No Posts Found\")\n }\n })\n }", "listOfAllRestaurants(req,res) {\n\t\treturn Restaurant.all().then((restaurants)=> {\n\t\t\tres.status(200).send(restaurants)\n\t\t}).catch((error)=>{\n\t\t\tres.status(400).send({message:error})\n\t\t})\n\t}" ]
[ "0.5870157", "0.58543706", "0.57299566", "0.5640385", "0.5637337", "0.56351227", "0.56073624", "0.5598634", "0.5568519", "0.55490696", "0.550896", "0.54997504", "0.5499062", "0.54932797", "0.5492179", "0.549086", "0.5464971", "0.54624695", "0.5456106", "0.5440093", "0.54370105", "0.5425907", "0.54257476", "0.54176867", "0.541433", "0.540632", "0.53987557", "0.53981197", "0.53943175", "0.5390453", "0.5385052", "0.5370214", "0.5365108", "0.53614604", "0.53570396", "0.53397226", "0.53338605", "0.5332876", "0.5326978", "0.5322403", "0.5319449", "0.5314567", "0.53088176", "0.5298425", "0.5289485", "0.5288809", "0.527818", "0.527818", "0.5275493", "0.5275493", "0.5269004", "0.5265477", "0.52603495", "0.5256904", "0.5256069", "0.52487075", "0.5248114", "0.52453", "0.5240053", "0.5239702", "0.52386546", "0.5235941", "0.5234115", "0.52332497", "0.5231905", "0.52290684", "0.5225297", "0.52087885", "0.5208664", "0.5199261", "0.5193527", "0.51925856", "0.51925594", "0.51841366", "0.51675516", "0.5158011", "0.51562154", "0.5154621", "0.515411", "0.51537836", "0.5149336", "0.5149237", "0.51478404", "0.51449615", "0.5128707", "0.5128524", "0.5117959", "0.511448", "0.511165", "0.51111", "0.51095414", "0.51086974", "0.51076615", "0.5107367", "0.5097461", "0.5097306", "0.50970477", "0.50965697", "0.50948393", "0.50909233", "0.50906634" ]
0.0
-1
This function shows the form for adding a new lead
function addNewLead() { $('#LeadDetails').hide(); $('#AddLead').fadeIn(500, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAddCommitmentForm() {\n vm.form.data = {\n category: null,\n question: null,\n name: null,\n description: null,\n status: null,\n dueDate: null\n };\n vm.form.title = \"Add Commitment\";\n vm.form.onSave = vm.add;\n vm.form.onClose = vm.form.show = false;\n\n vm.form.show = true;\n }", "function addNewItem() { switchToView('edit-form'); }", "function addLead(props) {\n // las props se las pasa useForm al momento de pasarlo como callback dentro de handleSubmit\n firestore.collection(\"leads\").add(props); // pasa el objeto de nuestros 'inputs' ya validados como objeto a la colleccion\n }", "function newContact() {\n document.getElementById('txtName').value = \"\";\n document.getElementById('txtSurname').value = \"\";\n document.getElementById('txtPhone').value = \"\";\n document.getElementById('txtAddress').value = \"\";\n\n let title = document.getElementById('titleContactForm');\n title.innerHTML = '<h2 id=\"titleContactForm\">Add a new contact</h2>';\n $('#contactForm').show();\n}", "navigateAdd() {\n this.channel.trigger('show:form');\n }", "function showPersonForm(req, res){\n res.render('add-person.ejs');\n}", "function showAddNewDiyForm() {\n cleanUp();\n show($addOrEditDiy);\n $(\"#diy-form-title\").text(\"Add New DIY Recipe\");\n $recName.val(\"\");\n $imgURL.val(\"\");\n $recIngredients.val(\"\");\n $recDescription.val(\"\");\n $(\"#submitNewDiyBtn\").removeClass('d-none');\n $(\"#submitEditDiyBtn\").addClass('d-none');\n }", "function getAddForm(req,res) {\r\n res.render('digimonExam/add');\r\n}", "function addFormToPage() {\n const formDivNode = document.getElementById(\"create-monster\")\n\n const addForm = document.createElement(\"form\")\n addForm.addEventListener(\"submit\", createNewMonster)\n addForm.id = \"add-monster-form\"\n \n let nameField = document.createElement(\"input\")\n nameField.id = \"name\";\n nameField.placeholder = \"Name...\";\n \n let ageField = document.createElement(\"input\")\n ageField.id = \"age\";\n ageField.placeholder = \"Age...\";\n \n let descriptionField = document.createElement(\"input\")\n descriptionField.id= \"description\"\n descriptionField.placeholder = \"description...\";\n \n let newMonsterBtn = document.createElement(\"button\")\n newMonsterBtn.innerText = \"Create Monster\"\n \n addForm.append(nameField, ageField, descriptionField, newMonsterBtn)\n formDivNode.innerHTML = \"<h3>Create a New Monster</h3>\"\n //adds form to page \n formDivNode.append(addForm)\n\n\n}", "function AddNew() {\n debugger;\n Resetform();\n openNav();\n ChangeButtonPatchView('DepositAndWithdrawals', 'btnPatchAdd', 'AddSubIncoming');\n\n\n}", "function show(dialog) {\n\t\n\t//ADD LEAD BUTTON\n\t$('#add_lead').click(function (e) {\n\t\te.preventDefault();\n\t\t\n\t\t//Get fields off modal\n\t\tvar leadcat = $(\"#lead_category :selected\").val();\n\t\tvar first = $(\"#first_name\").val();\n\t\tvar last = $(\"#last_name\").val();\n\t\tvar phone = $(\"#phone\").val();\n\t\tvar email = $(\"#email\").val();\n\t\tvar priority = $(\"#lead_priority :selected\").val();\n\t\tvar leadnotes = $(\"#lead_notes\").val();\n\t\t\n\t\t$.ajax({\n\t\t\turl:\"ajax_add_new_lead.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdata: { category: leadcat,\n\t\t\t\t\tfirst_name: first,\n\t\t\t\t\tlast_name: last,\n\t\t\t\t\tphone: phone,\n\t\t\t\t\temail: email,\n\t\t\t\t\tlead_priority: priority,\n\t\t\t\t\tlead_notes: leadnotes},\n\t\t\tdataType: \"html\",\t\t\n\t\t\tsuccess:function(result){\n\t\t\t\t//alert(result);\n\t\t\t\t$(\".leadcontentright\").html(result);\n\t\t\t},\t//end success:function\n\t\t\terror:function(jqXHR, textStatus, errorThrown){\n\t\t\t\t$(\".leadcontentright\").html(errorThrown);\n\t\t\t}\n\t\t}); //end $.ajax\n\t\t\n\t});\t\t//END ADD_LEAD BUTTON\n\t//*********************************************************\n\t\n\t\n\t//EDIT Lead BUTTON\n\t$('#edit_lead').click(function (e) {\n\t\te.preventDefault();\n\t\t\n\t\tvar dataChanged = false;\n\t\t\n\t\t//Get fields off modal\n\t\tvar lid = $(\"#lid\").val();\n\t\tvar leadcat = $(\"#lead_category :selected\").val();\n\t\tvar first = $(\"#first_name\").val();\n\t\tvar last = $(\"#last_name\").val();\n\t\tvar phone = $(\"#phone\").val();\n\t\tvar email = $(\"#email\").val();\n\t\tvar priority = $(\"#lead_priority :selected\").val();\n\t\tvar leadnotes = $(\"#lead_notes\").val();\n\t\t\t\t\n\t\t//Original Values\n\t\tvar ogleadcat = $(\"#og_category\").val();\n\t\tvar ogfirst = $(\"#og_firstname\").val();\n\t\tvar oglast = $(\"#og_lastname\").val();\n\t\tvar ogphone = $(\"#og_phone\").val();\n\t\tvar ogemail = $(\"#og_email\").val();\n\t\tvar ogpriority = $(\"#og_priority\").val();\n\t\tvar ogleadnotes = $(\"#og_notes\").val();\n\t\t\n\t\t\t\t\t \n\t\t//Check for data changes\n\t\tif (leadcat != ogleadcat) {dataChanged = true;}\n\t\tif (first.toLowerCase() != ogfirst.toLowerCase()) {dataChanged = true;}\n\t\tif (last.toLowerCase() != oglast.toLowerCase()) {dataChanged = true;}\n\t\tif (email != ogemail) {dataChanged = true;}\n\t\tif (phone != ogphone) {dataChanged = true;}\n\t\tif (priority != ogpriority) {dataChanged = true;}\n\t\tif (leadnotes != ogleadnotes) {dataChanged = true;}\n\t\t\n\t\tif (dataChanged) {\n\t\t\t//set hidden form var data_changed to true\n\t\t\t$(\"#data_changed\").val('true');\n\t\t}\t\n\t\t\n\t\tvar datachange = $(\"#data_changed\").val();\n\t\t\n\t\t$.ajax({\n\t\t\turl:\"ajax_update_lead.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdata: { lid: lid,\n\t\t\t\t\tcategory: leadcat,\n\t\t\t\t\tfirst_name: first,\n\t\t\t\t\tlast_name: last,\n\t\t\t\t\tphone: phone,\n\t\t\t\t\temail: email,\n\t\t\t\t\tlead_priority: priority,\n\t\t\t\t\tlead_notes: leadnotes,\n\t\t\t\t\togleadcat: ogleadcat,\n\t\t\t\t\togfirst: ogfirst,\n\t\t\t\t\toglast: oglast,\n\t\t\t\t\togphone: ogphone,\n\t\t\t\t\togemail: ogemail,\n\t\t\t\t\togpriority: ogpriority,\n\t\t\t\t\togleadnotes: ogleadnotes,\n\t\t\t\t\tdata_changed: datachange},\n\t\t\tdataType: \"html\",\t\t\n\t\t\tsuccess:function(result){\n\t\t\t\t//alert(result);\n\t\t\t\t$(\".leadcontentright\").html(result);\n\t\t\t},\t//end success:function\n\t\t\terror:function(jqXHR, textStatus, errorThrown){\n\t\t\t\t$(\".leadcontentright\").html(errorThrown);\n\t\t\t}\n\t\t}); //end $.ajax\n\t\t\n\t\t//Have to reset the original values equal to what\n\t\t//was just submitted to start fresh for any\n\t\t//subsequent update!\n\t\t//\n\t\t//SET og hiddens to the extracted js variables from form fields\n\t\t//after ajax runs\n\t\t$(\"#og_category\").val(leadcat);\n\t\t$(\"#og_firstname\").val(first);\n\t\t$(\"#og_lastname\").val(last);\n\t\t$(\"#og_phone\").val(phone);\n\t\t$(\"#og_email\").val(email);\n\t\t$(\"#og_priority\").val(priority);\n\t\t$(\"#og_notes\").val(leadnotes);\n\t\t\n\t\t//reset the data_changed hidden flag\n\t\t$(\"#data_changed\").val('false');\n\t\t\n\t});\t\t//END EDIT_LEAD BUTTON\n\t\n\t//**************************************\n\t//\t\t'MOVE TO PROSPECTS' BUTTON\n\t//**************************************\n\t$('#make_prospect').click(function (e) {\n\t\te.preventDefault();\n\t\t\n\t\t$(\".leadcontentright\").html(\"\");\n\t\t\n\t\t//Get the OG values to send over to contacts\n\t\t//table\n\t\t//Original Values\n\t\tvar lid = $(\"#lid\").val();\n\t\tvar ogleadcat = $(\"#og_category\").val();\n\t\tvar ogfirst = $(\"#og_firstname\").val();\n\t\tvar oglast = $(\"#og_lastname\").val();\n\t\tvar ogphone = $(\"#og_phone\").val();\n\t\tvar ogemail = $(\"#og_email\").val();\n\t\tvar ogpriority = $(\"#og_priority\").val();\n\t\tvar ogleadnotes = $(\"#og_notes\").val();\n\t\t\n\t\t$.ajax({\n\t\t\turl:\"ajax_convert_lead_to_prospect.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdata: { lid: lid,\n\t\t\t\t\tcategory: ogleadcat,\n\t\t\t\t\tfirst_name: ogfirst,\n\t\t\t\t\tlast_name: oglast,\n\t\t\t\t\tphone: ogphone,\n\t\t\t\t\temail: ogemail,\n\t\t\t\t\tlead_notes: ogleadnotes},\n\t\t\tdataType: \"html\",\t\t\n\t\t\tsuccess:function(result){\n\t\t\t\t//alert(result);\n\t\t\t\t$(\".leadcontentright\").html(result);\n\t\t\t},\t//end success:function\n\t\t\terror:function(jqXHR, textStatus, errorThrown){\n\t\t\t\t$(\".leadcontentright\").html(errorThrown);\n\t\t\t}\n\t\t}); //end $.ajax\n\t\t\n\t\t\n\t});\t\t//END MAKE PROSPECT BUTTON\n}", "showAdd(){\n document.getElementById(\"add-form\").style.display = \"block\"; \n }", "function AddNew()\n{\n debugger;\n Resetform();\n openNav();\n ChangeButtonPatchView('DepositAndWithdrawals', 'btnPatchAdd', 'AddSub');\n}", "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficulty);\n crDom.createRangeSlider(this.filter.limit);\n crDom.createStartButton();\n }", "function NewAppt() {\n $(\"#add-appt\").css(\"display\", \"none\");\n $(\"#appt-form\").css(\"display\", \"block\");\n $(\"#add-btn\").css(\"display\", \"inline-block\");\n $(\"#cancel-btn\").css(\"display\", \"inline-block\");\n}", "function openULForm(data){\n\t$m.open(\"Edit Lead for IPT\", \"/IncomePlanner/UpdateLeadForm.html\",data.data);\n}", "function addNewButton(formElement) {\n formElement.append('<button type=\"submit\" id=\"new-contact-button\"> Create New Contact </button>');\n $('#new-contact-button').click(function (e) {\n e.preventDefault(); // Prevent querystring from showing up in address bar\n createContact();\n });\n }", "function createForm() {\n var formElement = $(\"[name='contactForm']\").empty();\n // Add form elements and their event listeners\n formFields.forEach(function (formField) {\n var labelElement = $(\"<label>\")\n .attr(\"for\", formField.name)\n .text(formField.des);\n formElement.append(labelElement);\n var inputElement = $(\"<input>\")\n .attr(\"type\", formField.type)\n .attr(\"name\", formField.name)\n .attr(\"value\", (anime[formField.name] || \"\"));\n if (formField.required) {\n inputElement.prop(\"required\", true).attr(\"aria-required\", \"true\");\n }\n if (formField.type == \"date\"){\n inputElement.get(0).valueAsDate = new Date(anime[formField.name]);\n }\n formElement.append(inputElement);\n inputElement.on('input', function () {\n var thisField = $(this);\n inputHandler(formField.name, thisField.val());\n });\n // clear the horizontal and vertical space next to the \n // previous element\n formElement.append('<div style=\"clear:both\"></div>');\n });\n if (editForm) {\n addUpdateAndDeleteButtons(formElement);\n } else {\n addNewButton(formElement);\n }\n\n }", "function addNewRecord() {\n let country = $('#newCountryText').val();\n let capital = $('#newCapitalText').val();\n if (country.length === 0 || capital.length === 0) return; // Do not add empty records\n addRow(country, capital);\n fixActionFieldOptions();\n }", "create() {\n this.id = 0;\n this.familyName = null;\n this.givenNames = null;\n this.dateOfBirth = null;\n\n this.validator.resetForm();\n $(\"#form-section-legend\").html(\"Create\");\n this.sectionSwitcher.swap('form-section');\n }", "function displayNewContactForm(event, myMainMenu) {\n\n // construct the form\n //\n // <fieldset>\n // <legend>New Player</legend>\n // <input type=\"text\" id=\"jersey\" placeholder=\"Jersey Number\"><br>\n // <input type=\"text\" id=\"position\" placeholder=\"Position?\"><br>\n // <input type=\"text\" id=\"weight\" placeholder=\"How fat is he?\"><br>\n // <button id=\"new_player\">New Player</button><br>\n // </fieldset>\n\n // <div id=\"container\">\n // <h1>Add Contact</h1>\n // <form action=\"\" method=\"post\" id=\"customtheme\">\n // <p>\n // <label for=\"firstname\">First name</label>\n // <input type=\"text\" name=\"firstname\" id=\"firstname\" placeholder=\"First Name\"/>\n // </p>\n\n // <p>\n // <label for=\"lastname\">Last name</label>\n // <input type=\"text\" name=\"lastname\" id=\"lastname\" placeholder=\"Last Name\"/>\n // </p>\n\n // <p>\n // <label for=\"email\">Email</label>\n // <input type=\"text\" name=\"email\" id=\"email\" placeholder=\"[email protected]\"/>\n // </p>\n\n // <p>\n // <input type=\"button\" name=\"submit\" value=\"Submit\" id=\"submitbutton\"/>\n // </p>\n // </form>\n // </div>\n\n\n // <fieldset>\n // <legend>New Player</legend>\n // <input type=\"text\" id=\"jersey\" placeholder=\"Jersey Number\"><br>\n // <input type=\"text\" id=\"position\" placeholder=\"Position?\"><br>\n // <input type=\"text\" id=\"weight\" placeholder=\"How fat is he?\"><br>\n // <button id=\"new_player\">New Player</button><br>\n // </fieldset>\n\n // var tr = $(\"<fieldset>\").appendTo(myMainMenu);\n // $(\"legend\").text(\"New Player\").appendTo(myMainMenu);\n // $(\"<td>\").text(contact.firstname).appendTo(tr);\n // $(\"<td>\").text(contact.lastname).appendTo(tr);\n // $(\"<td>\").text(contact.email).appendTo(tr);\n\n\n $.ajax({\n url: 'add_contact_form.html',\n method: 'GET',\n success: function (morePostsHtml) {\n var temp = 100;\n\n myMainMenu.replaceWith(morePostsHtml);\n registerAddContactSubmitForm();\n }\n });\n\n }", "function createLead() {\n $( \"#progress\" ).dialog({\n resizable: false,\n modal: true\n });\n $.ajax({\n url: 'leads/add',\n data: '',\n type: 'POST',\n cache: false,\n success: function(data) {\n $(\"#ajaxmodal\").dialog(\"close\");\n $(\"#progress\").dialog(\"close\");\n loadPage('leads/view/' + data);\n },\n error: function(data) {\n $(\"#progress\").dialog(\"close\");\n notify (\"Oups, an error occured ! Please try again, if the error persist, please contact the administrator.\", \"Error\", \"error\");\n }\n });\n}", "function buildAddPlayer() {\n var pane = buildBaseForm(\"Add a new player account\", \"javascript: addPlayer()\");\n var form = pane.children[0];\n\n form.appendChild(buildBasicInput(\"player_username\", \"Username\"));\n form.appendChild(buildPasswordInput(\"player_password\", \"Password\"));\n form.appendChild(buildPasswordInput(\"player_password_confirm\", \"Password (Confirmation)\"));\n\n var birthdateLabel = document.createElement(\"span\");\n birthdateLabel.className = \"form_label\";\n birthdateLabel.textContent = \"Birthdate\";\n form.appendChild(birthdateLabel);\n\n form.appendChild(buildDateInput(\"player_birthdate\"));\n\n var countryLabel = document.createElement(\"span\");\n countryLabel.className = \"form_label\";\n countryLabel.textContent = \"Country\";\n form.appendChild(countryLabel);\n\n\n form.appendChild(buildSelector(\"player_country\", Object.keys(countries)));\n form.appendChild(buildBasicSubmit(\"Add\"));\n}", "function showDialogAdd() {\n var title = 'Add Parts to Locations'; \n var templateName = 'addUi'; \n var width = 600; \n \n // custom function to insert part data into the dialog box. For code modularity and simplicity\n createDialogWithPartData(title,templateName,width);\n}", "showCreateForm(data) {\n this.clearNewOrgan(data);\n this.changeFormMode(this.FORM_MODES.CREATE);\n }", "renderNewItemForm(e) {\n const form = e.target.parentElement.querySelector('form')\n form.style.display = 'block'\n }", "function AddNewDetail() {\r\n navigation.navigate('DetailRegister', { edit: false, step: {} });\r\n }", "function createTeamForm () {\n var item = team_form.addMultipleChoiceItem();\n \n // Create form UI\n team_form.setShowLinkToRespondAgain(false);\n team_form.setTitle(name + \" game\");\n team_form.setDescription(\"Game RSVP form\");\n // Set the form items\n item.setTitle(\"Will you attend the game?\");\n item.setChoices([\n item.createChoice(rsvp_opts[0]),\n item.createChoice(rsvp_opts[1]),\n item.createChoice(rsvp_opts[2]),\n item.createChoice(rsvp_opts[3])]);\n team_form.addSectionHeaderItem().setTitle(\n \"Do not change if you want your reply to count.\");\n team_form.addTextItem();\n team_form.addTextItem();\n\n // Attach the form to its destination [spreadsheet]\n team_form.setDestination(destination_type, destination);\n }", "function addCampaign(form) {\n vm.form = form;\n CampaignService.addCampaign(vm.campaign)\n .then(closeModal)\n .catch(handleError);\n }", "function showEditParticipantForm() {\n app.getView().render('account/giftregistry/eventparticipant');\n}", "function makeCreditDialog(id){\n\t$(\"body\").append(\"<div id='creditForm\"+id+\"' class='creditDiv'><h2>Credit</h2><form id='credit-form-form'><label>Total:</label>\"+currencyStmbol+\"<input id='creditTotalDollarsEntered' type='number' step='1' value='0' min='0'/>.<input id='creditTotalCentsEntered' type='number' step='1' value='0' min='0' max='99'/><label>Credit From:</label><input type='text' id='creditFromEntered'/><label>Notes:</label><textarea rows='4' cols='20' id='creditNotesEntered'/><label>Date:</label><input type='date' id='creditDateEntered'/></form></div>\");\n}", "function add(event) {\n event.preventDefault();\n // clear inputs set button\n $('#bomForm input').each(function (index, val) {\n $(this).val('');\n });\n $post.prop(\"hidden\", false);\n $put.prop(\"hidden\", true);\n // set title\n $('#modalTitle').text(\"Add New bom\");\n // spawn modal\n $('#formModal').modal();\n}", "function addForm(normalizeAllafterAdd)\n {\n if (typeof normalizeAllafterAdd == 'undefined') {\n normalizeAllafterAdd = true;\n }\n \n if(!selected_template) return;\n\n var newForm = templates[selected_template].addForm();\n \n if(newForm){\n headerRow.show();\n (options.insertNewForms == 'after') ? newForm.insertBefore(noFormsTemplate) : newForm.insertAfter(noFormsTemplate);\n }\n else{\n selected_template = false;\n return false;\n }\n \n if(normalizeAllafterAdd) normalizeAll();\n\n // After add callBack function\n if (typeof options.afterAdd === \"function\") {\n options.afterAdd(source, newForm);\n }\n\n return true;\n }", "function add_new_language_designer(){\n\n\t$.get('/admin/designers/add_new_language',\n\t\tfunction(result)\n\t\t{\t\n\t\t\t$('#language_designer').append(result);\n\t\t\t\n\t\t\ttotalBox = $('#language_designer').find('.form-sub-container');\n\t\t\t\n\t\t\tif(totalBox.size()%4 == 0)\n\t\t\t{\n\t\t\t\t//Define ultimo elemento como omega\n\t\t\t\t$(totalBox[totalBox.size() - 1]).addClass('omega');\n\t\t\t\t\n\t\t\t\t//Oculta link para add mais linguas. Limite eh 4\n\t\t\t\tlink = $('.add_new_language_designer').find('a');\n\t\t\t\t$(link[0]).replaceWith('&nbsp;');\n\t\t\t}\n\t\t});\n}", "function openFormCreate(elem)\n{\n\t//Clean form data\n\tdocument.getElementById('formEnreg').reset();\t\n\t//Cache table list film\n\trendreInvisible(elem);\n\t//Display form\n\t$(\"#divFormFilm\").show();\n}", "function buildNewForm() {\n return `\n <form id='js-new-item-form'>\n <div>\n <legend>New Bookmark</legend>\n <div class='col-6'>\n <!-- Title -->\n <label for='js-form-title'>Title</label>\n <li class='new-item-li'><input type='text' id='js-form-title' name='title' placeholder='Add Title'></li>\n <!-- Description -->\n <label for='js-form-description'>Description</label>\n <li class='new-item-li'><textarea id='js-form-description' name='description' placeholder=\"Add Description\"></textarea>\n </div>\n <div class='col-6'>\n <!-- URL -->\n <label for='js-form-url'>URL</label>\n <li class='new-item-li'><input type='url' id='js-form-url' name='url' placeholder='starting with https://'></li>\n <!-- Rating -->\n <label for='js-form-rating' id='rating-label'>Rating: </label>\n <select id='js-form-rating' name='rating' aria-labelledby='rating-label'>\n <option value='5' selected>5</option>\n <option value='4'>4</option>\n <option value='3'>3</option>\n <option value='2'>2</option>\n <option value='1'>1</option>\n </select>\n </div>\n <!-- Add button -->\n <div class='add-btn-container col-12'>\n <button type='submit' id='js-add-bookmark' class='add-button'>Click to Add!</button>\n <button type='button' id='js-cancel-bookmark'>Cancel</button>\n </div>\n </div>\n </form>\n `;\n }", "function lead(id) \n\t\t{\n\t\t\tpreviewPath = \"../leads_information.php?id=\"+id;\n\t\t\twindow.open(previewPath,'_blank','width=700,height=800,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,scrollbars=yes,status=no');\n\t\t}", "function createOne() {\n var participantForm = session.forms.giftregistry.event.participant;\n\n Form.get(session.forms.giftregistry).clear();\n\n participantForm.firstName.value = customer.profile.firstName;\n participantForm.lastName.value = customer.profile.lastName;\n participantForm.email.value = customer.profile.email;\n\n app.getView().render('account/giftregistry/eventparticipant');\n}", "addNew() {\n this.props.addMember();\n this.toggleCircle(document.getElementById('new-member-circle'));\n this.toggleFormDisplay();\n }", "@api\n form(isCreate, fields) {\n let augmentedFields = fields.map((field) => {\n return {\n ...field,\n options:\n field.dataType === \"Picklist\"\n ? this.wiredPicklistOptions.data[field.apiName]\n : []\n };\n });\n return `\n <form action=\"{{FORM_ACTION}}\" method=\"get\" style=${elementStyles.form}>\n ${augmentedFields.map(elementString).join(\"\")}\n ${\n isCreate\n ? `<input type=\"hidden\" value='{{RECORD_ID}}' name=\"recordId\"/>`\n : \"\"\n }\n <input type=\"hidden\" value='${this.objectApiName}' name=\"objectApiName\"/>\n <input type=\"hidden\" value='{{FORM_ID}}' name=\"formId\"/>\n <button type=\"submit\" style=\"${elementStyles.button}\">Submit</button>\n </form>\n `;\n }", "function createAd() {\n\n let form = $('#formCreateAd');\n\n let title = escHtml(form.find($('input[name=\"title\"]')).val());\n let description = escHtml(form.find($('textarea[name=\"description\"]')).val());\n let publisher = escHtml(storage.username());\n let datePublished = escHtml(form.find($('input[name=\"datePublished\"]')).val());\n let price = escHtml(parseFloat(form.find($('input[name=\"price\"]')).val().toString()).toFixed(2));\n let imageUrl = escHtml(form.find($('input[name=\"imageUrl\"]')).val());\n\n if (!title || !description || !publisher || !datePublished || !price) return;\n form.trigger('reset');\n\n ajax.postToCollection('ads',\n {\n title,\n description,\n publisher,\n datePublished,\n price: helper.pad(price),\n imageUrl,\n viewCount: helper.pad(0),\n }\n )\n .then(function (res) {\n listAds();\n views.showInfo('Ad created.')\n })\n .catch(ajax.handleAjaxError);\n }", "function add() {\r\n DlgHelper.AjaxAction(\"/schedule/add/\", \"POST\", function (data) {\r\n\r\n if (data != null && data != \"\") {\r\n refresh().done(function () { DlgHelper.ShowDialogSuccess(\"Добавлено: \" + data, 1000); });\r\n } else {\r\n DlgHelper.ShowDialogError(\"Неверный ввод...\", 2000);\r\n }\r\n\r\n });\r\n }", "function addNewForm() {\n var prototype = $collectionHolder.data('prototype')\n var index = $collectionHolder.data('index')\n var newForm = prototype\n newForm = newForm.replace(/__name__/g, index)\n $collectionHolder.data('index', index+1)\n // création panel\n var $panel = $(\n '<div class=\"panel panel-warning\"><div class=\"panel-heading\"></div></div>',\n )\n var $panelBody = $('<div class=\"panel-body\"></div>').append(newForm)\n $panel.append($panelBody)\n addRemoveButton($panel)\n $addNewItem.before($panel)\n}", "function showAddForm(quad, linkClicked) {\n $(`#quad-${ quad}`).prepend('<li><span></span><input name=\"newToDoLabel\" value=\"\" type=\"text\"></li>');\n // $('[name=\"newToDoQuad\"]').val(quad);\n // $('.addNewShortcutFormSpace').appendTo('#addNewQuad' + quad).show();\n $('[name=\"newToDoLabel\"]').trigger('focus');\n}", "function mostrarAltaPersona() {\n ocultarFormularios();\n formAltaConductor.style.display = \"block\";\n}", "function add_link(link_name) {\n document.querySelector(\"#link-view\").style.display = \"none\"\n document.querySelector(\"#add_link-view\").style.display = \"block\"\n \n document.querySelector(\"#add_link-view\").innerHTML = `<form id='add_link'><div class=\"input-group mb-3\">\n <input type=\"text\" class=\"form-control\" placeholder=\"URL\" id=\"basic_url\" aria-describedby=\"basic-addon3\"> </div>\n <div class=\"input-group mb-3\"> <input type=\"text\" class=\"form-control\" placeholder=\"Name\" id=\"basic_name\" aria-describedby=\"basic-addon3\"> \n </div> <button type=\"submit\" class=\"add_link btn btn-dark\" name=\"add_link\">Add Link</button></form>`\n\n // Submit link and add to database\n document.querySelector('#add_link').onsubmit = function() {\n fetch(`/add`, {\n method: 'POST',\n body: JSON.stringify({\n name: document.querySelector('#basic_name').value,\n subject: link_name,\n link: document.querySelector('#basic_url').value\n }) \n })\n } \n }", "function aDashboardActionCreatePerson( p, el ) {\n\tlet windowTitle = `New Person...`;\n\n\tlet values = { name: 'Please, provide a name', descr: 'Please, provide a description...', position: 'Please, provide a position', icon:null };\n\t\n\tlet keyProperties = { descr: { height:'200px' } };\n\tlet rightPaneHTML = `<h1 align=center>Creating a New Person</h1>`;\n\n\tlet keys = [ 'name', 'position', 'descr', 'icon' ];\n\n\taDisplayDashboardDataArrayEditWindow( windowTitle, keys, values, \n\t\t{ rightPaneHTML:rightPaneHTML, keyProperties:keyProperties, saveURL:'/a_persons_new' } );\n}", "function createForm() {\n let form = document.createElement(`form`);\n form.id = `form`;\n document.getElementById(`create-monster`).appendChild(form);\n\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Name`));\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Age`));\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Description`));\n\n let button = document.createElement('button');\n button.innerHTML = `Create`;\n document.getElementById(`form`).appendChild(button);\n\n\n}", "function monsterForm(){\n const formLocation = document.getElementById('create-monster')\n const createMonster = document.createElement('form')\n createMonster.id = 'monster-form'\n createMonster.innerHTML=`<input id=\"name\" placeholder=\"name...\"><input id=\"age\" placeholder=\"age...\"><input id=\"description\" placeholder=\"description...\"><button>Create Monster</button>`\n formLocation.append(createMonster)\n}", "function createNewPlantForm(e){\n clearDivPlantField()\n clearDivNewPlantForm()\n let targetGardenId = parseInt(e.target.parentNode.id)\n let newPlantField = document.querySelector(`#new-plant-form-${targetGardenId}`)\n newPlantField.innerHTML = `\n <input hidden id=\"plant\" value=\"${targetGardenId}\" />\n Plant Name:\n <input id=\"plant\" type=\"text\"/>\n <br>\n Plant Type:\n <input id=\"plant\" type=\"text\"/>\n <br>\n Plant Family:\n <input id=\"plant\" type=\"text\"/>\n <br>\n <span class=\"plant-submit\" id=\"${targetGardenId}\">Submit</span>\n `\n let plantSubmit = document.querySelector(`.plant-submit`)\n plantSubmit.addEventListener(\"click\", handleNewPlantSubmit)\n}", "function addParentForm() {\n $('.add-parent-popup').show();\n $('.overlay').show();\n $('#edit-button').hide();\n $('#add-button').show();\n $(\"#pin-label\").text(\"* PIN #:\")\n $(\"#header\").text(\"Add Parent(s)\");\n $(\"#sign-instructions\").text(\"Please add parent first and last name(s) for one family.\");\n $('#p1-fn-input').focus();\n document.getElementById(\"PIN\").required = true;\n}", "function setupForm() {\n var index = 1;\n document.getElementById(\"name\").focus();\n document.getElementById(\"colors-js-puns\").classList.add(\"is-hidden\");\n document.getElementById(\"other-title\").classList.add(\"is-hidden\");\n document.getElementById(\"payment\").selectedIndex = index;\n\n createTotal();\n togglePaymentDiv(index);\n }", "rentalFormShow() {\n this.set('addNewRental', true);\n }", "function newProjectForm() {\n\t\t$.get(\"/projects/new\", function(projectForm) {\n\t\t\tdocument.getElementById('js-new-project-form').innerHTML = projectForm;\n\t\t}).done(function() {\n\t\t\tlistenerSaveProject();\n\t\t})\n}", "function showAddVisitForm(){\n // tworzę tabelke, tbody oraz wiersze\n let $table=$(\"<table></table>\");\n $table.attr(\"id\",\"addVisitList\");\n $tbody=$(\"<tbody></tbody>\");\n $tbody.attr('id','addVisitListTbody');\n $tbody.append(\"<tr><td class='tdAddAnimalSelect'>Zwierzę: </td><td class='tdAddAnimalSelect'><select class='inputAddAnimal' id='animals'></select></td></tr>\");\n $tbody.append(\"<tr><td>Data: </td><td class='darkTheme tdDuringAnimalEdit'><input type='date' id='date'></td></tr>\");\n $table.append($tbody);\n $(\"#contentDescription\").append($table);\n $addButton = $(\"<button></button>\");\n $addButton.prop('id', 'btnAddVisit');\n $addButton.prop('class', 'btnAddVisit btnAddVisitDisabled');\n $addButton.html('Umów wizytę');\n $(\"#content\").append($addButton);\n // pobranie listy zwierząt z bazy\n getCustomerAnimals();\n // change event przy zmianie daty\n $('#date').change(function(){\n selectedDate = new Date($(this).val());\n currentDate = new Date();\n $('#trWithDoctors').remove();\n $('#trWithHours').remove();\n // gdy wybrana data dotyczy przeszłosci lub tego samego dnia to błąd\n if(selectedDate < currentDate){\n $(this).css('background',\"#ffa8a8\");\n errorService(true, \"Data nie może być z przeszłości\", $(this).id + \"Error\");\n $addButton.addClass(\"btnAddVisitDisabled\");\n } else {\n $(this).css('background',\"white\");\n errorService(false, \"\" , $(this).id + \"Error\");\n $addButton.removeClass(\"btnAddVisitDisabled\");\n visitDataToAdd['DATE'] = $(\"#date\").val();\n selectedDay = days[selectedDate.getDay()];\n getDoctorsListWorkingOnSelectedDay();\n }\n });\n // click event dla zapisania danych wizyty\n $addButton.on('click', function(){\n if(!$(this).hasClass('btnAddVisitDisabled')){\n console.log(visitDataToAdd);\n makeAnAppointment();\n } \n })\n}", "function NewEntryForm() {\n $(\"#addCancel\").click(this.clearForm);\n $(\"#addButton\").click(this.submitForm);\n }", "createAddForm() {\n this.addForm = document.createElement('form')\n this.addForm.setAttribute('hidden', '')\n\n let sourceLabel = document.createElement('label')\n sourceLabel.innerText = 'Source:'\n this.addForm.appendChild(sourceLabel)\n this.addForm.appendChild(document.createElement('br'))\n\n let sourceInput = document.createElement('input')\n sourceInput.setAttribute('type', 'text')\n this.addForm.appendChild(sourceInput)\n this.addForm.appendChild(document.createElement('br'))\n\n let amountLabel = document.createElement('label')\n amountLabel.innerText = 'Amount:'\n this.addForm.appendChild(amountLabel)\n this.addForm.appendChild(document.createElement('br'))\n\n let amountInput = document.createElement('input')\n amountInput.setAttribute('type', 'number')\n this.addForm.appendChild(amountInput)\n this.addForm.appendChild(document.createElement('br'))\n\n let submitButton = document.createElement('input')\n submitButton.setAttribute('type', 'submit')\n submitButton.setAttribute('hidden', '')\n this.addForm.appendChild(submitButton)\n\n this.addForm.addEventListener('submit', (e) => {\n e.preventDefault()\n this.addFlow({\n 'source': sourceInput.value,\n 'amount': parseFloat(amountInput.value).toFixed(2)\n })\n })\n\n this.div.appendChild(this.addForm)\n }", "function addDefinitionForm()\n{\n \n \n formp = $(getFormPalabra());\n $(\"#forms_conceptos\").append(formp);\n //inserta una animacion usa magic.css\n formp.addClass('magictime spaceInDown');\n $(\"#sec_\"+items_conceptos).find(\"select\").selectpicker();\n\n \n\t\n}", "function show_form()\n{\n $.get('forms/form_asset.html', function(data) {\n $('#insert-form').html(data);\n });\n $('#insert-form').trigger('create');\n}", "function editForm(wizardId) {\n let createEditForm = document.createElement('form')\n createEditForm.id = \"edit\"\n createEditForm.className = \"form-inline\"\n\n let editDiv = document.createElement('div')\n editDiv.className = \"edit-group\"\n editDiv.id = `editform-${wizardId}`\n editDiv.style.display = \"none\"\n\n createEditForm.addEventListener('submit', editFetchCall)\n\n createEditForm.appendChild(editDiv)\n editDiv.appendChild(editNameInput(wizardId))\n editDiv.appendChild(editURLInput(wizardId))\n editDiv.appendChild(editPetInput(wizardId))\n editDiv.appendChild(editPatronusInput(wizardId))\n editDiv.appendChild(editHouseInput(wizardId))\n editDiv.appendChild(editWandInput(wizardId))\n editDiv.appendChild(editDoneBtn(wizardId))\n\n return createEditForm\n}", "function insertAnswerForm(id) {\n\t$(\".ideaCloud_idea > form\").remove(); /* clean any forms - really don't know why this line is needed */\n\tvar form = $('<form method=\"post\" action=\"route.php\">');\n\tvar fieldset = $('<fieldset class=\"s_column\">');\n\tfieldset.append('<legend>answer to an idea</legend>');\n\tfieldset.append(' <div><input type=\"hidden\" id=\"idea_id\" name=\"idea_id\" value=\"'+id+'\" /></div>');\n\tfieldset.append(' <div><label for=\"answer_name\">your name</label><input type=\"text\" id=\"answer_name\" required=\"required\" class=\"box_shadow\" name=\"answer_name\" /></div>');\n\tfieldset.append('<div><label for=\"answer_mail\">your mail</label><input type=\"email\" id=\"answer_mail\" required=\"required\" class=\"box_shadow\" min=\"10\" name=\"answer_mail\"/></div>');\n\tfieldset.append('<div><label for=\"answer_text\">your text for idea owner</label><textarea class=\"box_shadow textarea\" name=\"answer_text\" id=\"answer_text\" cols=\"30\" rows=\"10\"></textarea></div>');\n\tfieldset.append('<input type=\"submit\" value=\"answer &rarr;\" />');\n\tform.append(fieldset);\n\t$(\".ideaCloud_idea\").append(form);\n}", "function addNewActivity() {\n\n // get the name of the activity\n // and check that it's not empty\n var name = view.activityName.val();\n if (name == '') {\n event.preventDefault();\n event.stopPropagation();\n view.activityNameErrorLabel.addClass('error');\n return;\n }\n\n // get the length of the activity\n // and check that the value is numerical and greater than 0\n var length = view.activityLength.val();\n if (isNumber(length)) {\n if (length <= 0) {\n event.preventDefault();\n event.stopPropagation();\n view.activityLengthErrorLabel.html('Length must be greater than 0.');\n view.activityLengthErrorLabel.addClass('error');\n return;\n }\n } else {\n event.preventDefault();\n event.stopPropagation();\n view.activityLengthErrorLabel.html('Value must be numerical.');\n view.activityLengthErrorLabel.addClass('error');\n return;\n }\n // the value we got from the dialog is a string and we have to convert\n // it to an integer, otherwise we get weird results when computing the total\n // length of a day (found out the hard way ;-))\n length = parseInt(length);\n\n // get the type of the activity\n var type = view.activityType.val();\n switch (type) {\n case '0':\n type = 0; break;\n case '1':\n type = 1; break;\n case '2':\n type = 2; break;\n case '3':\n type = 3; break;\n default:\n console.log(\"Error: unknown activity type\");\n }\n\n // get the description of the activity\n var description = view.activityDescription.val();\n\n // create new activity and add it to the model\n var newActivity = new Activity(name, length, type, description);\n model.addParkedActivity(newActivity);\n\n }", "function showNewInfo(data) {\n modalBody.html('')\n modalBody.append(`\n <form class=\" bg-mute\"> \n <div class=\"mb-2\">\n <label for=\"name\" class=\"form-label\">name : </label>\n <input type=\"text\" class=\"form-control \" name=\"name\" required>\n </div>\n <div class=\"mb-2\">\n <label for=\"cin\" class=\"form-label text-uppercase\">cin: </label>\n <input type=\"text\" class=\"form-control\" name=\"cin\" required>\n </div>\n <div class=\"mb-2\">\n <label for=\"city\" class=\"form-label\">city: </label>\n <input type=\"text\" class=\"form-control\" name=\"city\" required>\n </div>\n <div class=\"mb-2\">\n <label for=\"province\" class=\"form-label\">province: </label>\n <input type=\"text\" class=\"form-control\" name=\"province\" required>\n </div>\n <div class=\"mb-2\">\n <label for=\"register-date\" class=\"form-label\">register date: </label>\n <input type=\"date\" class=\"form-control\" name=\"register-date\" required>\n </div>\n <div class=\"\">\n <label for=\"telephone\" class=\"form-label\">telephone: </label>\n <input type=\"text\" class=\"form-control\" name=\"telephone\" required>\n </div>\n </form>\n `)\n\n modalFooter.html(`\n <button id=\"create-button\" class=\"text-white btn btn-outline-success offset-left\"> Create </button>\n `)\n}", "function renderNewGardenForm(){\n\tmain.appendChild(gFormDiv)\n}", "function cancelNewLead() {\n clearNewLeadForm();\n}", "function showAddPatientForm(){\n\tvar f = document.createElement(\"form\");\n\n\tvar table = document.createElement(\"table\");\n\n\n\t/**Surname row**/\n\tvar row = document.createElement(\"tr\");\n\tvar data1 = document.createElement(\"td\");\n\tvar text1 = document.createTextNode(\"Surname: \");\n\t\tdata1.appendChild(text1);\n\n\tvar surname = document.createElement(\"input\"); //input element, text\n\tsurname.setAttribute('type',\"text\");\n\tsurname.setAttribute('name',\"surname\");\n\tsurname.setAttribute('id',\"surname\");\n\tvar data2 = document.createElement(\"td\");\n\tdata2.appendChild(surname);\n\t//creating row structure\n\t\trow.appendChild(data1);\n\t\trow.appendChild(data2);\n\ttable.appendChild(row);\n\n\t/**Name row**/\n\tvar row = document.createElement(\"tr\");\n\tvar data1 = document.createElement(\"td\");\n\tvar text1 = document.createTextNode(\"Name: \");\n\t\tdata1.appendChild(text1);\n\n\tvar name = document.createElement(\"input\"); //input element, text\n\tname.setAttribute('type',\"text\");\n\tname.setAttribute('name',\"name\");\n\tname.setAttribute('id',\"name\");\n\tvar data2 = document.createElement(\"td\");\n\tdata2.appendChild(name);\n\t//creating row structure\n\t\trow.appendChild(data1);\n\t\trow.appendChild(data2);\n\ttable.appendChild(row);\n\n\t/**Age row**/\n\tvar row = document.createElement(\"tr\");\n\tvar data1 = document.createElement(\"td\");\n\tvar text1 = document.createTextNode(\"Age: \");\n\t\tdata1.appendChild(text1);\n\n\tvar age = document.createElement(\"input\"); //input element, text\n\tage.setAttribute('type',\"text\");\n\tage.setAttribute('name',\"age\");\n\tage.setAttribute('id',\"age\");\n\tvar data2 = document.createElement(\"td\");\n\tdata2.appendChild(age);\n\t//creating row structure\n\t\trow.appendChild(data1);\n\t\trow.appendChild(data2);\n\ttable.appendChild(row);\n\n\t//BUTTONS\n\n\tvar row = document.createElement(\"tr\");\n\tvar data1 = document.createElement(\"td\");\n\tvar s = document.createElement(\"input\"); //input element, Submit button\n\ts.setAttribute('type',\"button\");\n\ts.setAttribute('onclick', \"addPatient();\")\n\ts.setAttribute('value',\"Submit\");\n\tdata1.appendChild(s);\n\ttable.appendChild(data1);\t\n\n\n\tf.appendChild(s);\n\tf.appendChild(table);\n\n\tdocument.getElementsByTagName('article')[0].innerHTML = \"\";\n\tdocument.getElementsByTagName('article')[0].appendChild(f);\n\n\t//Adding element to print the addPatient result\n\tvar result = document.createElement(\"p\"); //input element, Submit button\n\tresult.setAttribute('id',\"addPatientResult\");\n\tdocument.getElementsByTagName('article')[0].appendChild(result);\n}", "function addFormationForm($formation, $newLinkLiFormation) {\n \n //contenu du data attribute prototype qui contient le HTML d'un champ\n var newFormFormation = $formation.data('prototype');\n //le nombre de champs déjà présents dans la collection\n var index = $formation.data('index');\n //on remplace l'emplacement prévu pour l'id d'un champ par son index dans la collection\n newFormFormation = newFormFormation.replace(/__name__/g, index);\n //on modifie le data index de la collection par le nouveau nombre d'éléments\n $formation.data('index', index+1);\n\n //on construit l'élément li avec le champ et le bouton supprimer\n var $newFormLiFormation = $('<li></li>').append(newFormFormation).append(generateDeleteButton($formation));\n //on ajoute la nouvelle li au dessus de celle qui contient le bouton \"ajouter\"\n $newLinkLiFormation.before($newFormLiFormation);\n}", "function addContact(event){\n event.preventDefault();\n let valid = validateForm(event);\n let confirmation = \"<div id='confirm'><h2>Thank you!</h2><p>We'll get back to you soon!</p></div>\";\n\n if(valid){\n name.value = \"\";\n email.value = \"\";\n phone.value = \"\";\n message.value = \"\";\n contactSubmit.setAttribute(\"class\", \"disabled\");\n contactSubmit.insertAdjacentHTML(\"afterend\", confirmation);\n }\n else{\n alert = createAlert();\n contactForm.insertAdjacentElement(\"beforeend\", alert);\n }\n }", "function addComment(form) {\r\n var dorm; // select control for dorm\r\n var newComment; // textarea for the new comment\r\n var allComments; // textarea for combined comments\r\n var addedVerbiage; // text to add to blog\r\n\r\n dorm = form.elements[\"dorm\"];\r\n newComment = form.elements[\"newComment\"];\r\n allComments = form.elements[\"allComments\"];\r\n\r\n if (!form.checkValidity()) {\r\n document.getElementById(\"error\").style.display = \"block\";\r\n }\r\n else {\r\n document.getElementById(\"error\").style.display = \"none\";\r\n if (allComments.value == \"\") {\r\n addedVerbiage = dorm.value + \":\\n\" + newComment.value;\r\n }\r\n else {\r\n addedVerbiage = dorm.value + \":\\n\" + newComment.value + \"\\n\\n\";\r\n }\r\n allComments.value = addedVerbiage + allComments.value;\r\n dorm.selectedIndex = 0;\r\n newComment.value = \"\";\r\n } // end else\r\n} // end addComment", "showDJForm(data) {\n\t\t// reset login to null when filling out default values\n\t\tif (data && data.login) data.login = null;\n\n\t\tthis.newDjModal.body = ``;\n\n\t\tthis.newDjModal.iziModal(\"open\");\n\n\t\tlet _djs = this.find();\n\n\t\t$(this.newDjModal.body).alpaca({\n\t\t\tschema: {\n\t\t\t\ttitle: data ? \"Edit DJ\" : \"New DJ\",\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {\n\t\t\t\t\tID: {\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t},\n\t\t\t\t\tname: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\ttitle: \"Name of DJ as used on radio\",\n\t\t\t\t\t\tmaxLength: 255,\n\t\t\t\t\t},\n\t\t\t\t\trealName: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\ttitle: \"Real full name of person\",\n\t\t\t\t\t\tmaxLength: 255,\n\t\t\t\t\t},\n\t\t\t\t\temail: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tformat: \"email\",\n\t\t\t\t\t\ttitle: \"Change email address\",\n\t\t\t\t\t\tmaxLength: 255,\n\t\t\t\t\t},\n\t\t\t\t\tlogin: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tformat: \"password\",\n\t\t\t\t\t\ttitle: \"Change login password\",\n\t\t\t\t\t\tmaxLength: 255,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\toptions: {\n\t\t\t\tfields: {\n\t\t\t\t\tID: {\n\t\t\t\t\t\ttype: \"hidden\",\n\t\t\t\t\t},\n\t\t\t\t\tname: {\n\t\t\t\t\t\thelper:\n\t\t\t\t\t\t\t\"This is the name that appears publicly on shows, the website, etc. You may not use the same DJ name twice.\",\n\t\t\t\t\t\tvalidator: function (callback) {\n\t\t\t\t\t\t\tlet value = this.getValue();\n\t\t\t\t\t\t\tlet _dj = _djs.find((dj) => dj.name === value);\n\t\t\t\t\t\t\tif (value.includes(\" -\") || value.includes(\";\")) {\n\t\t\t\t\t\t\t\tcallback({\n\t\t\t\t\t\t\t\t\tstatus: false,\n\t\t\t\t\t\t\t\t\tmessage: `DJ names may not contain \" - \" or semicolons. These are used by the system as separators. If you are adding multiple DJs, please add each one by one.`,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((!data || data.name !== value) && _dj) {\n\t\t\t\t\t\t\t\tif (_dj.active) {\n\t\t\t\t\t\t\t\t\tcallback({\n\t\t\t\t\t\t\t\t\t\tstatus: false,\n\t\t\t\t\t\t\t\t\t\tmessage: `An active DJ with the specified name already exists. Please choose another name.`,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcallback({\n\t\t\t\t\t\t\t\t\t\tstatus: false,\n\t\t\t\t\t\t\t\t\t\tmessage: `An inactive DJ with the specified name already exists. Please remove the inactive DJ first, or mark the DJ as active and edit that one instead.`,\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\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcallback({\n\t\t\t\t\t\t\t\tstatus: 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\trealName: {\n\t\t\t\t\t\thelper:\n\t\t\t\t\t\t\t\"Used for directors to help easily identify who this person is.\",\n\t\t\t\t\t},\n\t\t\t\t\temail: {\n\t\t\t\t\t\thelper:\n\t\t\t\t\t\t\t\"Change the email address used to send the DJ show changes / cancellations and analytics. Type [email protected] to remove their email address. <strong>Campus email is highly recommended.</strong>\",\n\t\t\t\t\t},\n\t\t\t\t\tlogin: {\n\t\t\t\t\t\thelper:\n\t\t\t\t\t\t\t\"DJs will use this to log in to their online DJ panel. In the future, this may be used to log in to prod / onair computers during schedule shows or bookings. You might choose to use their door PIN. Type remove to remove their password.\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tform: {\n\t\t\t\t\tbuttons: {\n\t\t\t\t\t\tsubmit: {\n\t\t\t\t\t\t\ttitle: data ? \"Edit DJ\" : \"Add DJ\",\n\t\t\t\t\t\t\tclick: (form, e) => {\n\t\t\t\t\t\t\t\tform.refreshValidationState(true);\n\t\t\t\t\t\t\t\tif (!form.isValid(true)) {\n\t\t\t\t\t\t\t\t\tform.focus();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlet value = form.getValue();\n\t\t\t\t\t\t\t\tif (data) {\n\t\t\t\t\t\t\t\t\tthis.editDJ(value, (success) => {\n\t\t\t\t\t\t\t\t\t\tif (success) {\n\t\t\t\t\t\t\t\t\t\t\tthis.djsModal.iziModal(\"close\");\n\t\t\t\t\t\t\t\t\t\t\tthis.newDjModal.iziModal(\"close\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.addDJ(value, (success) => {\n\t\t\t\t\t\t\t\t\t\tif (success) {\n\t\t\t\t\t\t\t\t\t\t\tthis.djsModal.iziModal(\"close\");\n\t\t\t\t\t\t\t\t\t\t\tthis.newDjModal.iziModal(\"close\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\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\tdata: data ? data : [],\n\t\t});\n\t}", "function showAddTodoList() {\n hideTodosLayers();\n $(\"addNewListDiv\").style.display=\"inline\";\n document.forms.addNewListForm.name.focus();\n}", "createNew(options) {\n return this.wizardInvokeService.openWizard(Object.assign(options, {\n title: this._buildTitle(options.service.entityName, 'wizard_create_caption'),\n isNew: true,\n readonly: false\n }));\n }", "function handleAddNewStep(newStepP, pipeline, formFields, stageId) {\n var selected = document.querySelector('input[name=\"newStepType-' + stageId + '\"]:checked');\n var name = $('#newStepName-' + stageId).val();\n newStepP.popover('toggle');\n if (selected) {\n if (!name) {\n name = \"New Step\";\n }\n var newStep = {\"type\": selected.value, \"name\": name};\n var insertResult = wf.insertStep(pipeline, stageId, newStep);\n writeOutChanges(pipeline, formFields);\n refreshStepListing(stageId, insertResult.stepContainer.steps);\n lines.autoJoinDelay(pipeline, 0); // redraw immediately ... no delay\n openEditor(pipeline, insertResult.actionId, formFields); \n }\n}", "function add() {\n vm.error = null;\n vm.form.submitted = true;\n\n // Show validation messages if needed.\n if (!vm.form.$valid) {\n return;\n }\n\n // Save and show feedback to the user.\n playbookDataService.createCommitmentForPlaybook(vm.playbookId, vm.form.data)\n .then(function (data) {\n vm.info = \"Commitment created successfully\";\n $timeout(function () {\n vm.info = null;\n }, 2000);\n\n // Update cat name of the commitment since it's not returned.\n data.categoryName = vm.form.data.categoryName;\n vm.commitments.push(data);\n })\n .catch(function () {\n vm.error = \"Failed to create commitment.\";\n })\n .finally(function () {\n vm.form.submitted = false;\n vm.form.show = false;\n vm.form.data = {};\n });\n }", "'click .add'(e, t) {\n \t\te.preventDefault();\n\n \t/*-------------- Get the value of form elements ---------*/ \n\n \t\tvar fname = t.find('#fname').value;\n \t\tvar lname = t.find('#lname').value;\n \t\tvar email = t.find('#email').value;\n \t\tvar address = t.find('#address').value;\n\n \t/*------------ Call insertRecord method -------------*/\n\n\t\tMeteor.call(\"insertRecord\", fname, lname, email, address);\n \t}", "function makeDebitDialog(id){\n\t$(\"body\").append(\"<div id='debitForm\"+id+\"' class='debitDiv'><h2>Debit</h2><form id='debit-form-form'><label>Total:</label>\"+currencyStmbol+\"<input id='debitTotalDollarsEntered' type='number' step='1' value='0' min='0'/>.<input id='debitTotalCentsEntered' type='number' step='1' value='0' min='0' max='99'/><label>Debit To:</label><input type='text' id='debitFromEntered'/><label>Notes:</label><textarea rows='4' cols='20' id='debitNotesEntered'/><label>Date:</label><input type='date' id='debitDateEntered'/></form></div>\");\n}", "create(e) {\n e.preventDefault();\n let id = $(\"#id\").val();\n let des = $(\"#description\").val();\n let price = $(\"#price\").val();\n let rooms = $(\"#rooms\").val();\n let mail = $(\"#mail\").val();\n let name = $(\"#name\").val();\n let pho = $(\"#phoneNr\").val();\n let re = new Rent(id, des, price, rooms, mail, name, pho);\n reReg.create(re, function () {\n window.location.href='/view/Rent.html';\n });\n }", "newArticleListener() {\r\n let newArticleBtn = document.querySelector(\"button.article-button\")\r\n newArticleBtn.addEventListener(\"click\", () => {\r\n let newsCreator = new Form(\"Add Article\", \"news-editor\", newsInputs.articleInputs)\r\n let newsCreate = newsCreator.build()\r\n newsCreate.render(\".form-container\")\r\n newArticleBtn.classList.add(\"hide\")\r\n addNewArticle()\r\n })\r\n }", "insertForm() {\n this.builder = new Builder(this.container, this.options.template, {\n style: this.options.style,\n formContainerClass: this.options.formContainerClass,\n inputGroupClass: this.options.inputGroupClass,\n inputClass: this.options.inputClass,\n labelClass: this.options.labelClass,\n btnClass: this.options.btnClass,\n errorClass: this.options.errorClass,\n successClass: this.options.successClass,\n });\n this.build();\n }", "function handleSubmit(e) {\n // function to create a new contact and then close the model\n e.preventDefault();\n createContact(idRef.current.value,nameRef.current.value);\n closeModal();\n\n // create contact\n }", "function showAddForm(courseId, addType, studentId) {\n // alert(`Post assignment goes here.\\ncourseId: ${courseId}\\naddType: ${addType}\\nstudentId: ${studentId}`);\n\n // Modal add form behavior:\n // When the user clicks anywhere outside of the modal form, close it\n var modal = document.getElementById('addAssDiv');\n window.onclick = function(event) {\n\n if (event.target == modal) {\n modal.style.display = \"none\";\n\n // Clear any error messages\n document.getElementById('errMsg').style.display = \"none\";\n }\n }\n \n /* Populate data structure with default names for new iSupervision assignments,\n to make it easier for the Web page to suggest names for new assignments.\n\n Build a unique name for a new iSupervision assignment for each student.\n The name adds a numbered suffix to the specified user's email login ID.\n e.g. If user login is \"[email protected]\", then assignment names\n look like \"abcdef-1\", \"abcdef-2\" etc.\n */\n \n // Make it easy to lookup existing assignment names\n // const term = window.CST_OVERRIDES.terms.find( e => e.course_id === courseId);\n const term = findTermWithCourse(courseId);\n const student = term.students.find( e => e.id === studentId);\n const assignmentNames = student.assignment_overrides.map( e => { return e.name; });\n \n var loginName = student.login_id.split('@')[0];\n var defaultName = '';\n var n = 1;\n do {\n defaultName = loginName + '-' + n++;\n } while (assignmentNames.includes(defaultName));\n \n // Populate the add form with values we'll need to know when it's time to submit the add\n document.getElementById('assignmentName').value = defaultName;\n // document.getElementById('courseId').value = term.iSupe_course_id; // Add to iSupervision course\n document.getElementById('courseId').value = student.iSupe_course_id; // Add to iSupervision course\n document.getElementById('sectionId').value = student.iSupe_course_section_id; // Add to student's section\n document.getElementById('addType').value = addType;\n document.getElementById('studentId').value = studentId;\n\n // Use more specific label in add form\n const addTypeTxt = (addType === 'CritiqueIt') ? 'iSupervision' : 'Google Observation';\n const lblAdd = document.getElementById('lblAdd');\n lblAdd.textContent = 'Add ' + addTypeTxt + ' assignment with name:';\n\n // Display modal form\n document.getElementById('addAssDiv').style.display = 'block';\n document.getElementById('assignmentName').focus();\n}", "function setUpAdd() {\n refreshId();\n $('input[name=_method]').val('post');\n $('h2.title').text('Add New Record Page');\n $('input[name=product]').val('');\n $('input[name=quantity]').val('');\n $('input[name=price]').val('');\n $('.add-record').hide();\n }", "function onClickAddContact() {\n\t$('#contact-form').trigger('reset'); // supprime éléments qui seraient déjà dans le formulaire\n \t$('#contact-form').data('mode', 'add').fadeIn('fast');//affiche l'élément qui correspond à l'id \"contact-form\" avec un effet de fondu (display:none display:block) en lui mettant un attribut data-mode='add'\n}", "addNew(code, description, project, id){\n let error = !code || !description\n if(error){\n set(project,'error',error);\n }\n else{\n let step = this.get('store').findRecord('step',1);\n let story = this.get('store').createRecord('story',{code:code,description:description,step:step});\n set(story,'project',project);\n story.save().then(()=>{project.save();});\n //Set des valeurs de l'input à RIEN pour avoir le form vide\n set(project,'code','');\n set(project,'description','');\n this.transitionTo('projects.stories',id);\n }}", "function help_add() {\n\n $('#help_add').modal('show');\n}", "function insert() {\n\t$(\"#descr\").val(\"\");\n\t$(\"#videourl\").val(\"\");\n\t$(\"#controls\").val(\"0\");\n\t$(\"#question\").val(\"\");\n\t$(\"#info\").val(\"\");\n\t$(\"#submit\").val(\"Create\");\n\t$(\"#action\").val(\"2\");\n $(\"#accordion\").accordion({ collapsible: true, active: false });\n\t$(\"#videoinfo\").overlay().load();\n\ttoControls($(\"#controls\").val());\n}", "function newForm(){\r\n let createNew = document.querySelector(\"form\")\r\ncreateNew.innerHTML = `\r\n<input type=\"text\" id=\"userName\" placeholder =\"Enter User Name\" >\r\n<input type=\"text\" id=\"picture\" placeholder =\"Enter Photo URL\"><br>\r\n<input class= \"donebtn\" type=\"button\" value=\"DONE\" onclick=\"adder()\">\r\n<input class= \"cancelbtn\" type=\"button\" value=\"CANCEL\" onclick=\"adder()\"><br>\r\n`\r\n}", "function popupForm(id){\n\t//TODO: apply formData.activityList to activityListHtml\n}", "function displayForm() {\r\n \"use strict\";\r\n //define all variables\r\n var volunteerForm;\r\n\r\n //find the place to put the form\r\n volunteerForm = document.getElementById(\"formArticle\");\r\n\r\n //display form\r\n volunteerForm.innerHTML = \"<!--FORM STARTS HERE -->\"\r\n + \"<form action='http://itins3.madisoncollege.edu/echo.php'\"\r\n + \"method='post'\"\r\n + \"name='newVolunteerForm'\"\r\n + \"id='newVolunteerForm'>\"\r\n + \"<fieldset>\"\r\n + \"<legend>New Volunteer Form</legend>\"\r\n + \"<!--FIRST NAME -->\"\r\n + \"<label for='firstName' class='setWidth'>First Name</label>\"\r\n + \"<input type='text' name='firstName' id='firstName' required='required' />\"\r\n + \"&emsp;\"\r\n + \"<!--LAST NAME -->\"\r\n + \"<label for='lastName' class='setWidth'>Last Name</label>\"\r\n + \"<input type='text' name='lastName' id='lastName' required='required' />\"\r\n + \"<br /><br />\"\r\n + \"<!--HOME ADDRESS -->\"\r\n + \"<label for='homeAddress' class='setWidth'>Home Address</label>\"\r\n + \"<input type='text' name='homeAddress' id='homeAddress' required='required' />\"\r\n + \"<br /><br />\"\r\n + \"<!--EMAIL -->\"\r\n + \"<label for='emailAddress' class='setWidth'>Email Address</label>\"\r\n + \"<input type='text' name='emailAddress' id='emailAddress' required='required' />\"\r\n + \"&emsp;\"\r\n + \"<!--PHONE -->\"\r\n + \"<label for='phoneNumber' class='setWidth'>Phone Number</label>\"\r\n + \"<input type='text' name='phoneNumber' id='phoneNumber' required='required' />\"\r\n + \"<br /><br />\"\r\n + \"<!--BEST WAY TO CONTACT YOU -->\"\r\n + \"<label for='bestContact'>What's the best way to contact you?</label>\"\r\n + \"<br />\"\r\n + \"<input type='radio' name='bestContact' value='email'\"\r\n + \"id='bestContactEmail' required='required' />\"\r\n + \"<label for='bestContactEmail' id='bestContactEmail'>Email</label>\"\r\n + \"&emsp;\"\r\n + \"<input type='radio' name='bestContact' value='phone'\"\r\n + \"id='bestContactPhone' required='required' />\"\r\n + \"<label for='bestContactPhone' id='bestContactPhone'>Phone</label>\"\r\n + \"<br /><br />\"\r\n + \"<!--STUDENT -->\"\r\n + \"<label for='studentStatus'>Are you a student?</label>\"\r\n + \"<br />\"\r\n + \"<input type='radio' name='studentStatus' value='yes'\"\r\n + \"id='studentStatusYes' required='required' />\"\r\n + \"<label for='studentStatusYes' id='studentStatusYes'>Yes</label>\"\r\n + \"&emsp;\"\r\n + \"<input type='radio' name='studentStatus' value='no'\"\r\n + \"id='studentStatusNo' required='required' />\"\r\n + \"<label for='studentStatusNo' id='studentStatusNo'>No</label>\"\r\n + \"<br /><br />\"\r\n + \"<!--COMMENT BOX -->\"\r\n + \"<label for='commentBox'>If you have anything else you would like to add,\"\r\n + \"you may add it here:</label>\"\r\n + \"<br />\"\r\n + \"<textarea name='commentBox' id='commentBox' rows='4' cols='85'\"\r\n + \"maxlength='1500'></textarea>\"\r\n + \"<br /><br />\"\r\n + \"<!--SUBMIT BUTTONS -->\"\r\n + \"<p id='buttonsParaph'>\"\r\n + \"<input type='submit' value='Submit Form' class='submitButton' />\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp;\"\r\n + \"<input type='reset' value='Clear Form' class='submitButton' />\"\r\n + \"</p>\"\r\n + \"</fieldset>\"\r\n + \"</form>\"\r\n + \"<!--END OF FORM -->\";\r\n innerHTML\r\n}", "function AddNew() {\n \n ResetForm();\n InvoicesTypeChange()\n $('#ddlInvoiceType').prop('disabled', false);\n $(\"#ddlSupplier\").select2();\n $(\"#ddlSupplier\").val('').trigger('change');\n\n $(\"#AccountCode\").select2();\n $(\"#AccountCode\").val('').trigger('change');\n $(\"#EmpID\").select2();\n $(\"#EmpID\").val('').trigger('change');\n\n $('#lblinvoicedAmt').text(\"₹ 0.00\");\n $('#lblpaidAmt').text(\"₹ 0.00\");\n $('#lblbalalnceAmt').text(\"₹ 0.00\");\n $('#ID').val('');\n $('#lblInvoiceNo').text(\"New Invoice\");\n openNav();\n ChangeButtonPatchView(\"SupplierInvoices\", \"btnPatchAdd\", \"Add\"); //ControllerName,id of the container div,Name of the action\n clearUploadControl();\n}", "function new_alt_loc() {\n\t \n\t $.ajax({\n\t\t type: \"POST\",\n\t\t url: \"/advertiser_admin/form_actions/advert_alt_loc_frm.deal\",\n\t\t success: function(msg){\n\t\t jQuery(\"#alt_loc_form_area\").html(msg);\n\t\t }\n\t });\n\t \n }", "function printNewForm() {\n $(\"<div/>\", {\n id: \"new_form\",\n class: \"editform\"\n }).appendTo(\"#back_form\");\n}", "function showDialogAdd() {\n\n // Print that we got here\n console.log(\"Opening add item dialog\");\n\n // Clear out the values in the form.\n // Otherwise we'll keep values from when we last\n // opened or hit edit.\n // I'm getting it started, you can finish.\n $('#firstName').val(\"\");\n $('#lastName').val(\"\");\n $('#email').val(\"\");\n $('#phone').val(\"\");\n $('#birthday').val(\"\");\n\n // Remove style for outline of form field\n $('#firstNameDiv').removeClass(\"has-error\");\n $('#firstNameGlyph').removeClass(\"glyphicon-remove\");\n $('#firstNameDiv').removeClass(\"has-success\");\n $('#firstNameGlyph').removeClass(\"glyphicon-ok\");\n $('#lastNameDiv').removeClass(\"has-error\");\n $('#lastNameGlyph').removeClass(\"glyphicon-remove\");\n $('#lastNameDiv').removeClass(\"has-success\");\n $('#lastNameGlyph').removeClass(\"glyphicon-ok\");\n $('#emailDiv').removeClass(\"has-error\");\n $('#emailGlyph').removeClass(\"glyphicon-remove\");\n $('#emailDiv').removeClass(\"has-success\");\n $('#emailGlyph').removeClass(\"glyphicon-ok\");\n $('#phoneDiv').removeClass(\"has-error\");\n $('#phoneGlyph').removeClass(\"glyphicon-remove\");\n $('#phoneDiv').removeClass(\"has-success\");\n $('#phoneGlyph').removeClass(\"glyphicon-ok\");\n $('#birthdayDiv').removeClass(\"has-error\");\n $('#birthdayGlyph').removeClass(\"glyphicon-remove\");\n $('#birthdayDiv').removeClass(\"has-success\");\n $('#birthdayGlyph').removeClass(\"glyphicon-ok\");\n\n // Show the hidden dialog\n $('#myModal').modal('show');\n}", "setUpAddForm() {\n ADD.addEventListener('click', (e) => {\n e.preventDefault();\n this.addForm();\n });\n }", "function openAddNewEntryUI() {\n var html = HtmlService.createTemplateFromFile('newEntry').evaluate()\n .setWidth(400)\n .setHeight(300);\n SpreadsheetApp.getUi()\n .showModalDialog(html, 'Add a new entry');\n}", "function onCreateNewStaffClick() {\n $('#modal-register-staff').modal('show');\n }", "function createDetailTable() {\n $(\"#detailsFormCreate\").empty();\n let markupBody0 = \"<div class='form-group'><input type='hidden' class='form-control' id='teamId' name='teamid' value = '\" + obj.TeamId + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody0);\n let markupBody1 = \"<div class='form-group'><label for='teamName'>Team Name:</label><input type='text' class='form-control' id='teamName' name='teamname' value = '\" + obj.TeamName + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody1);\n let markupBody2 = \"<div class='form-group'><label for='league'>Organization:</label><input type='text' class='form-control' id='league' name='leaguecode' value = '\" + obj.League + \"' readonly></div>\";\n $(\"#detailsFormCreate\").append(markupBody2);\n let markupBody3 = \"<div class='form-group'><label for='teamType'>Team Type:</label><input type='text' class='form-control' id='teamType' name='teamtype' value = '\" + obj.TeamType + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody3);\n let markupBody4 = \"<div class='form-group'><label for='managerName'>Team Manager Name:</label><input type='text' class='form-control' id='managerName' name='managername' value = '\" + obj.ManagerName + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody4);\n let markupBody5 = \"<div class='form-group'><label for='managerPhone'>Manager Phone Number:</label><input type='tel' class='form-control' id='managerPhone' name='managerphone' value = '\" + obj.ManagerPhone + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody5);\n let markupBody6 = \"<div class='form-group'><label for='managerEmail'>Manager Email Address:</label><input type='email' class='form-control' id='managerEmail' name='manageremail' value = '\" + obj.ManagerEmail + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody6);\n let markupBody7 = \"<div class='form-group'><label for='maxTeamMembers'>Maximum Members to a Team:</label><input type='number' class='form-control' id='maxTeamMembers' name='maxteammembers' value = '\" + obj.MaxTeamMembers + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody7);\n let markupBody8 = \"<div class='form-group'><label for='minMemberAge'>Minimum Member Age:</label><input type='number' class='form-control' id='minMemberAge' name='minmemberage' value = '\" + obj.MinMemberAge + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody8);\n let markupBody9 = \"<div class='form-group'><label for='maxMemberAge'>Maximum Member Age:</label><input type='number' class='form-control' id='maxMemberAge' name='maxmemberage' value = '\" + obj.MaxMemberAge + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody9);\n let markupBody10 = \"<div class='form-group'><label for='teamGender'>Team Gender:</label><input type='text' class='form-control' id='teamGender' name='teamgender' value = '\" + obj.TeamGender + \"' ></div>\";\n $(\"#detailsFormCreate\").append(markupBody10);\n\n //Member Count\n if (obj.Members.length == 0) {\n $(\"#memberCnt\").html(obj.Members.length);\n $(\"#memberTable\").hide();\n } else {\n $(\"#memberCnt\").html(obj.Members.length);\n }\n // end Member Count\n\n // populate the member information on page.\n $(\"#memberTableHead\").empty();\n let markupHeader = \"<tr><th>Member Name</th><th>Member Age</th><th>Member Gender</th><th>Member Email</th></tr>\";\n $(\"#memberTableHead\").append(markupHeader);\n $(\"#memberTableHead\").css(\"font-weight\", \"bold\");\n $(\"#memberTableBody\").empty();\n for (let j = 0; j < obj.Members.length; j++) {\n let markupBody11 = \"<tr><td>\" + obj.Members[j].MemberName +\n \"</td><td>\" + obj.Members[j].Age +\n \"</td><td>\" + obj.Members[j].Gender +\n \"</td><td>\" + obj.Members[j].Email + \"</td></tr>\";\n $(\"#memberTableBody\").append(markupBody11);\n } // end of if for member information load\n }", "function new_course(){\n save_method = 'add';\n $('#formNewCourse')[0].reset();\n\n $('#newCourse').modal('show');\n $('.modal-title').text('New Course');\n}", "function show_addNew_allergies_form(){\n $('#show_addNew_form').click(function(){\n addNew_form_show();\n remove_checkbox_hide();\n add_addNew_form_cancel_listener();\n });\n}", "function addFormPopUp(container, e) {\n\t\t\t\te.preventDefault()\n\t\t\t\tXenForo.ajax(\n\t\t\t\t\tadd_entry_html,\n\t\t\t\t\t{},\n\t\t\t\t\tfunction (ajaxData, textStatus) {\n\t\t\t\t\t\tif (ajaxData.templateHtml) {\n\t\t\t\t\t\t\tnew XenForo.ExtLoader(e, function() {\n\t\t\t\t\t\t\t\tXenForo.createOverlay('',ajaxData.templateHtml, '').load();\n\t\t\t\t\t\t\t\tconsole.log($(container));\n\t\t\t\t\t\t\t\t$('div.overlayHeading').text(\"Add Frag Entry\");\n\t\t\t\t\t\t\t\t$('[name=dbtc_thread_id]').val($(container).find('div#dbtc_thread_id').attr('value'));\n\t\t\t\t\t\t\t\t// id of donor is in the dbtc_username value field\n\t\t\t\t\t\t\t\t$('[name=dbtc_donor_id]').val($(container).find('div#dbtc_receiver_id').attr('value'));\n\t\t\t\t\t\t\t\t$('[name=dbtc_date]').val($(container).find('div#dbtc_date').text());\n\t\t\t\t\t\t\t\t$('[name=dbtc_parent_transaction_id]').val($(container).attr('data-id'));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}" ]
[ "0.6375686", "0.6279301", "0.6181734", "0.61438817", "0.6109383", "0.6089658", "0.60577124", "0.60405135", "0.60298336", "0.5978685", "0.5934301", "0.59329695", "0.5858318", "0.58579856", "0.5845238", "0.5805184", "0.5765164", "0.57591796", "0.57426214", "0.5735533", "0.5721059", "0.57069814", "0.56999195", "0.5690339", "0.56860596", "0.5682024", "0.56793445", "0.5660004", "0.5650227", "0.5641797", "0.5626269", "0.5623724", "0.5606832", "0.560095", "0.560095", "0.5600846", "0.55938166", "0.5585865", "0.55785656", "0.55771327", "0.5576467", "0.55736464", "0.55709183", "0.55605614", "0.5549549", "0.5540323", "0.5531318", "0.55311984", "0.5530454", "0.5528982", "0.5525737", "0.55244607", "0.5520945", "0.5517649", "0.5517146", "0.55105406", "0.55064327", "0.5496197", "0.5492097", "0.54827446", "0.54805064", "0.54804313", "0.5476363", "0.5474871", "0.5474553", "0.5471665", "0.54670924", "0.5460815", "0.5459948", "0.5456122", "0.5453494", "0.5452172", "0.54467493", "0.54409266", "0.5437392", "0.5428161", "0.54279065", "0.54276544", "0.5422555", "0.5417888", "0.5416499", "0.5416156", "0.5415901", "0.54107046", "0.5407982", "0.54037285", "0.53990847", "0.5393493", "0.53873324", "0.5385434", "0.53807306", "0.53806657", "0.5378153", "0.5375849", "0.53654623", "0.5362021", "0.5344742", "0.53442323", "0.53436303", "0.53422624" ]
0.6595563
0
This function shows the details for a specific lead
function showLeadDetails(itemID) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#AddLead').hide(); $('#LeadDetails').hide(); $('#AllOpps').hide(); $('#OppDetails').hide(); $('#AllSales').hide(); $('#SaleDetails').hide(); currentItem = list.getItemById(itemID); context.load(currentItem); context.executeQueryAsync( function () { $('#editLead').val(currentItem.get_fieldValues()["Title"]); $('#editContactPerson').val(currentItem.get_fieldValues()["ContactPerson"]); $('#editContactNumber').val(currentItem.get_fieldValues()["ContactNumber"]); $('#editEmail').val(currentItem.get_fieldValues()["Email"]); $('#editPotentialAmount').val("$"+currentItem.get_fieldValues()["DealAmount"]); //Add an onclick event to the convertToOpp div $('#convertToOpp').click(function (sender) { convertToOpp(itemID); }); $('#LeadDetails').fadeIn(500, null); }, function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lead(id) \n\t\t{\n\t\t\tpreviewPath = \"../leads_information.php?id=\"+id;\n\t\t\twindow.open(previewPath,'_blank','width=700,height=800,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,scrollbars=yes,status=no');\n\t\t}", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "function getDetails() {\n\n}", "function getShortDoctorDetails(data) {\n console.log(data);\n var detailsDiv = $(\"<div>\").addClass(\"detail-content\");\n var html = '<p><b>Name: </b>' + data.name + '</p>' +\n '<p><b>Speciality: </b>' + data.speciality + '</p>' +\n '<p><b>Address: </b>' + data.address + '</p>' +\n '<p><b>Phone: </b>' + data.phone + '</p>' +\n '<p><b>Full details: </b>' + '<a target=\"_blank\" href=\"./doctor-details.html?id='+data.id+'\">Link</a></p>';\n return detailsDiv.html(html);\n\n}", "function getById(){\n var id = $scope.profile._id\n advisor.getById(id).then(function (response){\n if(response.data.success){\n $scope.advisorData = response.data.data\n $scope.advisorData.address = response.data.data.address[0]\n //$scope.advisorData.use_logo = $scope.advisorData.use_logo.toString();\n console.log($scope.advisorData)\n }\n })\n }", "function getDetails(placeId, el) {\n let placeService = new google.maps.places.PlacesService(place);\n placeService.getDetails({placeId: placeId}, function(place, status) {\n //console.log(status);\n //console.log(place);\n\n let phoneNumber = place.formatted_phone_number;\n let hours = place.opening_hours.weekday_text;\n let website = place.website;\n let moreInfo = place.url;\n\n el.append('<br><label class=\"first\">phone number:</label> ' + phoneNumber);\n el.append('<br><label>website:</label> ' + website);\n el.append('<br><label>google page:</label> ' + moreInfo);\n\n for(let i = 0; i < hours.length; i++) {\n el.append('<span class=\"list-item\">' + hours[i] + '</span>');\n }\n });\n}", "function showDetail(d) {\n var content = `\n <div class=\"pa1 lh-title\">\n <div class=\"ttu mid-gray f6 fw6\"><span class=\"pr1\">${\n d.name\n }</span><span class=\"ph1\">&#8226;</span><span class=\"pl1\">${\n d.year\n }</span></div>\n <div class=\"pv2 f3\">$${addCommas(d.value)}</div>\n ${\n d.account\n ? `<div class=\"pb1 mid-gray f6\"><span class=\"name\">${\n english\n ? translations.fundingSource.eng\n : translations.fundingSource.esp\n }: </span><span class=\"value\">${d.account}</span></div>`\n : \"\"\n }\n ${\n d.description\n ? `<div class=\"pt2 mt2 bt b--light-gray overflow-scroll\" style=\"max-height: 8rem;\"><span class=\"name b f6\">${\n english\n ? translations.description.eng\n : translations.description.esp\n }: </span><span class=\"value f6 js-description\">${\n d.description ? d.description.substring(0, 120) : \"\"\n }...</span><a href=\"#\" class=\"link f7 mv1 dim underline-hover wola-blue pl1 js-read-more\">${\n english ? translations.readMore.eng : translations.readMore.esp\n }</a></div>`\n : \"\"\n }\n </div>\n `;\n\n return content;\n }", "function displayDetail(indice)\n{\n RMPApplication.debug(\"displayDetail : indice = \" + indice);\n v_ol = var_order_list[indice];\n c_debug(dbug.detail, \"=> displayDetail: v_ol (mini) = \", v_ol);\n\n // we want all details for the following work order before showing on the screen\n var wo_query = \"^wo_number=\" + $.trim(v_ol.wo_number);\n var input = {};\n var options = {};\n input.query = wo_query;\n // var input = {\"query\": wo_query};\n c_debug(dbug.detail, \"=> displayDetail: input = \", input);\n id_get_work_order_full_details_api.trigger(input, options, wo_details_ok, wo_details_ko);\n\n RMPApplication.debug(\"end displayDetail\");\n}", "function displayCRMInfo(id = \"-\", trackingId = \"-\", location = \"-\", pickup = \"-\", delivery = \"-\", status = \"-\") {\n const idElement = document.getElementById(\"id\");\n const trackingIdElement = document.getElementById(\"tracking-id\");\n const locationElement = document.getElementById(\"location\");\n const pickupElement = document.getElementById(\"pickup\");\n const deliveryElement = document.getElementById(\"delivery\");\n const statusElement = document.getElementById(\"status\");\n\n idElement.textContent = id;\n trackingIdElement.textContent = trackingId;\n locationElement.textContent = location;\n pickupElement.textContent = pickup;\n deliveryElement.textContent = delivery;\n statusElement.textContent = status;\n}", "function showOfficialTravelItenerary(id){\n\tajax_getOfficialTravelItenerary(id,function(official_travel_itenerary){\n\t\titenerary_count=0;\n\t\tfor(var x=0; x<official_travel_itenerary.length;x++){\n\t\t\titenerary_count++;\n\t\t\tshowTotalIteneraryCount();\n\t\t\t\n\t\t\tlet isEmptyDepTime = official_travel_itenerary[x].departure_time === '00:00:00' ? true : false\n\t\t\tlet timeString = ''\n\t\t\tlet hourEnd = official_travel_itenerary[x].departure_time.indexOf(\":\");\n\t\t\tlet H = +official_travel_itenerary[x].departure_time.substr(0, hourEnd);\n\t\t\tlet h = H % 12 || 12;\n\t\t\tlet ampm = (H < 12 || H === 24) ? \" AM\" : \" PM\";\n\t\t\ttimeString = h + official_travel_itenerary[x].departure_time.substr(hourEnd, 3) + ampm;\n\n\t\t\t//printables\n\t\t\tif(official_travel_itenerary[x].request_type==\"official\") ttURL='travel/official/print/trip_ticket'\n\t\t\tif(official_travel_itenerary[x].request_type==\"personal\") ttURL='travel/personal/print/statement_of_account'\n\t\t\tif(official_travel_itenerary[x].request_type==\"campus\") ttURL='travel/campus/print/notice_of_charges'\n\n\t\t\tvar htm=`<details id=\"official_travel_itenerary`+official_travel_itenerary[x].id+`\" data-menu=\"iteneraryMenu\" data-selection=\"`+official_travel_itenerary[x].id+ `\" class=\"contextMenuSelector official_travel_itenerary`+official_travel_itenerary[x].id+` col col-md-12\">\n\t\t\t\t\t<summary>`+official_travel_itenerary[x].location+` - `+official_travel_itenerary[x].destination+`</summary>\n\t\t\t\t\t<table class=\"table table-fluid\" style=\"background:rgba(250,250,250,0.7);color:rgb(40,40,40);\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<th>Origin</th> <th>Destination</th> <th>Date</th> <th>Time</th>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onclick=\"event.preventDefault();window.open('${ttURL}/${official_travel_itenerary[x].id}');\">`+official_travel_itenerary[x].location+`</a><br/>\n\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('travel/campus/print/notice_of_charges/${official_travel_itenerary[x].id}');\">NOC</button>`\n\n\t\t\t\t\t\t\t\t\tif(official_travel_itenerary[x].request_type=='official'){\n\t\t\n\t\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('${ttURL}/${official_travel_itenerary[x].id}');\">TT</button>`\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif(official_travel_itenerary[x].request_type=='personal'){\n\t\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('travel/official/print/trip_ticket/${official_travel_itenerary[x].id}');\">TT</button>`\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif(official_travel_itenerary[x].request_type=='campus'){\n\t\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('${ttURL}/${official_travel_itenerary[x].id}');\">TT</button>`\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('https://form.jotform.me/81214740186453');\">Feedback form</button>`\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\thtm+=\t\t\t\t`</td>\n\t\t\t\t\t\t\t\t<td>`+official_travel_itenerary[x].destination+`</td>\n\t\t\t\t\t\t\t\t<td>`+official_travel_itenerary[x].departure_date+`</td>\n\t\t\t\t\t\t\t\t<td>`+(isEmptyDepTime ? '<em>To Be Determined</em>' : timeString)+`</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</details>\n\t\t\t`\n\n\t\t\t$('.preview-itenerary').append(htm)\n\t\t}\n\n\n\t\tif(itenerary_count<=0){\n\t\t\t$('.preview-itenerary').html('<center><i class=\"material-icons md-36\">directions_car</i><h3>Empty Itinerary</h3><p class=\"text-muted\">Add new destination to your request.</p></center>')\n\t\t}\n\n\t\tsetTimeout(function(){ context() },1000);\n\t});\n\t\n}", "function markAsDetailsDisplayed(id) {\n\t\temployeesData.forEach(employee => employee.detailsDisplayed = false);\n\t\tconst employee = employeesData[id];\n\t\temployee.detailsDisplayed = true;\n\t}", "function showLeads() {\n //Highlight the selected tile\n $('#LeadsTile').css(\"background-color\", \"orange\");\n $('#OppsTile').css(\"background-color\", \"#0072C6\");\n $('#SalesTile').css(\"background-color\", \"#0072C6\");\n $('#LostSalesTile').css(\"background-color\", \"#0072C6\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n \n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n var hasLeads = false;\n hideAllPanels();\n var LeadList = document.getElementById(\"AllLeads\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n\n // Success returned from executeQueryAsync\n var leadTable = document.getElementById(\"LeadList\");\n\n // Remove all nodes from the lead <DIV> so we have a clean space to write to\n while (leadTable.hasChildNodes()) {\n leadTable.removeChild(leadTable.lastChild);\n }\n\n // Iterate through the Prospects list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n\n\n // Create a DIV to display the organization name \n var lead = document.createElement(\"div\");\n var leadLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n lead.appendChild(leadLabel);\n\n // Add an ID to the lead DIV\n lead.id = listItem.get_id();\n\n // Add an class to the lead DIV\n lead.className = \"item\";\n\n // Add an onclick event to show the lead details\n $(lead).click(function (sender) {\n showLeadDetails(sender.target.id);\n });\n\n // Add the lead div to the UI\n leadTable.appendChild(lead);\n hasLeads = true;\n }\n }\n if (!hasLeads) {\n var noLeads = document.createElement(\"div\");\n noLeads.appendChild(document.createTextNode(\"There are no leads. You can add a new lead from here.\"));\n leadTable.appendChild(noLeads);\n }\n $('#AllLeads').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get Leads. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#LeadList').fadeIn(500, null);\n });\n\n}", "async cmd_ad_journey(params) {\n return this.query({\n url: \"/user/watchadviewed/\",\n body: {\n shorten_journey_id: 1,\n },\n })\n }", "function showdetails(x){\n setShow(true);\n setModalData(dataArr[x]);\n console.log(dataArr[x].origin.name);\n }", "function openContactDetails() {\n\t\tconst contactId = Number(this.id);\n\t\tupdateContactDetails(contactId);\n\t\tmodal.style.display = \"block\";\n\t}", "function showDetails(){\n\tView.controllers.get('visitorController')['editTag']=true;\n var grid = View.panels.get('visitorsGrid');\n var selectedRow = grid.rows[grid.selectedRowIndex];\n var visitorId = selectedRow[\"visitors.visitor_id\"];\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"visitors.visitor_id\", visitorId, \"=\");\n View.panels.get('visitorsForm').refresh(restriction,false);\n}", "function leadsLink(val){\n\n //debugger;\n return '<li><a href=\"#page\" class=\"dynamic\" id=\"'+key+'\"><h2>' + val.name + '</h2><p>' + val.email + '</p><p class=\"ui-li-aside\"><strong>' + val.date +'</strong></p></a></li>';\n \n }", "async api_details({params, response}){\n\t\tconst leaderboard = await Leaderboards.find(params.id)\n\n\t\treturn response.json(leaderboard)\n\t}", "function showDetails(row){\n\tabRepmAddEditLeaseInABuilding_ctrl.abRepmAddEditLeaseInABuildingAddLease_form.show(false);\n\t\n\tvar ls_id = row.restriction.clauses[0].value;\n\t\n\trefreshPanels(ls_id);\n}", "function collegeInfo(college) {\n Modal.info({\n title: 'College Detail',\n content: (\n <div>\n <p>College ID : {college._id}</p>\n <p>Name : {college.name}</p>\n <p>Since : {college.year_founded}</p>\n <p>City : {college.city}</p>\n <p>State : {college.state}</p>\n <p>Country : {college.country}</p>\n <p>No. of Students : {college.no_of_students}</p>\n <p>Courses Offered:</p>\n <ul>\n {college.courses.map(course=>{\n return <li key={course}>{course}</li>\n })}\n </ul>\n <a href={\"/similar/?id=\"+college._id}>Show Similar Colleges</a>\n <br/>\n <a href={\"/students/?id=\"+college._id}>Show Students List</a>\n \n </div>\n ),\n onOk() {},\n });\n }", "function teamDetails(msg, done, team) {\n const snippets = robot.brain.get(team);\n if (!Array.isArray(snippets)) {\n return teamDoesNotExist(msg, team, done)\n }\n\n msg.send(`Details for ${team}:\\n${snippets.map(snippet => ` - ${snippet}`).join('\\n')}`, done);\n }", "function mealDetails(Id) {\n //calling API by ID\n const url=`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${Id}`\n fetch(url)\n .then(res => res.json())\n .then(data => {\n displayMealDetails(data.meals[0]);\n })\n}", "function showFullDetails(clicked,pgDetails){\n console.log(pgDetails);\n var div = '<div style=\"width:96%;margin-left:2%;margin-right:1%;margin-top:2%;background-color:#333;color:white;font-size:18px;\"><legend align=\"center\" style=\"color:white;\">'+pgDetails[clicked].name+'</legend>';\n div += '<div style=\"margin-left:2%;\"><label>Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].address+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>city&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].city+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Mobile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].mobile+'</span></div>';\n if(pgDetails[clicked].Sharing == \"accomodationOnly\"){\n var type = \"Accomodation Only\";\n }else{\n var type = \"Food and Accomodation\";\n }\n div += '<div style=\"margin-left:2%;\"><label>Accomodation Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+type+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Sharings Available&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>';\n var share =\"\";\n for(var i=0;i<pgDetails[clicked].pgFor.length;i++){\n if(pgDetails[clicked].pgFor[i] == \"more5\"){\n share += \"More than 5\";\n }else{\n share += pgDetails[clicked].pgFor[i]; \n share += \",\";\n }\n\n }\n div += share+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Facility Available&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>';\n \n var facility = \"\";\n for(var j=0;j<pgDetails[clicked].facility.length;j++){\n facility += pgDetails[clicked].facility[j];\n if(j != pgDetails[clicked].facility.length-1){\n facility += \", \";\n }\n \n }\n div += facility+'</span></div>';\n div += '</div>';\n var ratings = '<div style=\"width:96%;margin-left:2%;margin-right:1%;margin-top:2%;background-color:#333;color:white;font-size:18px;\">';\n ratings += '<legend style=\"color:white;\"><span style=\"margin-left:2%;\">User Ratings</span></legend>';\n //ratings += '<div style=\"margin-left:2%;\"><span>Food&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class=\"rating\" id=\"food\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"3.6\"></span></div>';\n ratings += '<div style=\"margin-left:2%;\"><label style=\"float:left;\">Food &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"food\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"3.6\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Parking Facility &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"parking\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4.2\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Hygiene &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"hygiene\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Overall Rating of PG &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"pgRating\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4.3\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br></div>';\n //ratings += '</div>';\n \n $(\"#thumbnails\").append(div);\n $(\"#thumbnails\").append(ratings); \n \n $(\"#food\").rating();\n $(\"#parking\").rating();\n $(\"#hygiene\").rating();\n $(\"#pgRating\").rating();\n \n }", "function displayAge(){\r\n for(let i=0; i<details.length;i++){\r\n if(details[i].age<= 30){\r\n console.log(details[i]);\r\n }\r\n }\r\n }", "function displayItemDetails() {\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\n var meetingSuggestions = item.getEntitiesByType(Office.MailboxEnums.EntityType.MeetingSuggestion);\n var meetingSuggestion = meetingSuggestions[0];\n\n $('#start-time').text(meetingSuggestion.start);\n }", "function showBuildingDetails(title,attributes){\n \tvar controller = View.controllers.get(\"abRplmPfadminGpdGisCtrl\");\n\tvar blId = title;\n\tcontroller.openDetailsPopUp(blId);\n}", "function displayDetails(details, source){\n\t//console.log(details,source);\n\t//Hide results div\n\tvar results = document.getElementById(source+\"-table-div\");\n\tresults.hidden = true;\n\t//Create details table\n\tvar d_table = document.getElementById(source+\"-details\");\n\td_table.innerHTML += \"<tbody></tbody>\";\n\tvar d_table_body = d_table.firstElementChild;\n\tfor(var data in details[0]){\n\t\t//this can be fixed to better display mutivalued fields (add spaces)(?)\n\t\tconsole.log(details[0][data]);\n\t\td_table_body.innerHTML += \"<tr><td>\"+usToFLUC(data.toString())+\"</td><td>\"+(details[0][data] ? dataContToString(details[0][data]):\"-\")+\"</td></tr>\";\n\t}\n\t//show details div\n\tvar details = document.getElementById(source+\"-details-div\");\n\tdetails.hidden = false;\n}", "function getAllLeadsInfo() {\n \n var urrl = window.location.href; \n var serached = urrl.substr(urrl.search(\"leads\"), urrl.lastIndexOf(\"edit\"));\n // alert(urrl.search(\"leads\"));\n // alert(urrl);\n // alert(urrl.substr(urrl.search(\"leads\"), urrl.lastIndexOf(\"edit\")) );\n // alert(\"done\"+serached.match( numberPattern ));\n return $.ajax({\n method: \"GET\",\n url: \"/leads/edits/\"+serached.match( numberPattern ),\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n },\n success: function (response) {\n let result = JSON.parse(response);\n EditInfo = result['EditLeadInfo'];\n console.log('here get all edit leads info response: ', EditInfo);\n \n },\n error: function () {\n console.log('here get leads info error');\n }\n });\n }", "function makeDetailsHTML(contactObject) {\n\t\tconst location = contactObject.location;\n\t\tconst birthdate = new Date(contactObject.dob.date);\n\t\tlet html = `\n\t\t\t<span class=\"close\">&times;</span>\n\t\t\t<div class=\"avatar-div\">\n\t\t\t\t<img src=\"${contactObject.picture.large}\" class=\"avatar\" height=\"175\" width=\"175\">\n\t\t\t</div>\n\t\t\t<div class=\"contact-summary\">\n\t\t\t\t<h3>${contactObject.name.first} ${contactObject.name.last}</h3>\n\t\t\t\t<p class=\"username\">${contactObject.login.username}</p>\n\t\t\t\t<p>${contactObject.email}</p>\n\t\t\t\t<p class=\"location\">${contactObject.location.city}</p>\n\t\t\t</div>\n\t\t\t<hr>\n\t\t\t<div class=\"additional-details\">\n\t\t\t\t<p>${contactObject.cell}</p>\n\t\t\t\t<p class=\"address\">${location.street} \n\t\t\t\t<br>${location.city}, ${location.state} ${location.city} ${location.postalcode}</p>\n\t\t\t\t<p>Birthday: ${birthdate.toLocaleDateString(\"en-US\")}</p>\n\t\t\t</div>\n\t\t`;\n\t\tif (hasPrevious(contactObject.id)) {\n\t\t\thtml += `<div id=\"previous\" class=\"button\" display=\"inline-block\">&#8249;</div>`;\n\t\t}\n\t\tif (hasNext(contactObject.id)) {\n\t\t\thtml += `<div id=\"next\" class=\"button\" display=\"inline-block\">&#8250;</div>`;\n\t\t}\n\t\treturn html;\n\t}", "function isDisplayed(employee) { \n return employee.detailsDisplayed === true;\n\t}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function showInfo(pillName) {\n fetch(`http://ec2-3-96-185-233.ca-central-1.compute.amazonaws.com:3000/pills/single?userId=${firebase.auth().currentUser.uid}&name=${pillName}`, {\n method: 'GET',\n })\n .then((response) => response.json())\n .then((responseJson) => {\n console.log(\"Response from server is (and going to pillinfo)\", responseJson['pill']);\n navigation.navigate(\"PillInfo\", {pillInfo: responseJson['pill']});\n })\n .catch((error) => {\n console.error(error);\n });\n }", "function updateContactDetails(id) {\n\t\temployeesData.forEach(employee => employee.detailsDisplayed = false); // Mark all as not displayed\n\t\tmarkAsDetailsDisplayed(id); // Mark this one as displayed\n\t\tcontactDetails.innerHTML = makeDetailsHTML(employeesData[id]); // Update HTML\n\t\t// Select elements and add relevent event listeners\n\t\tcloseSpan = document.querySelector(\".close\");\n\t\tcloseSpan.onclick = closeContactDetails;\n\t\tpreviousButton = document.querySelector(\"#previous\");\n\t\tnextButton = document.querySelector(\"#next\");\n\t\tlistenToButtons();\n\t}", "showDoctors(){\n var j=1;\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n }", "async function loadDetails() {\r\n try {\r\n setShow(true);\r\n\r\n const response = await api.get(`/etapas/${project._id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n const { data } = response;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err ', err);\r\n setErr(true);\r\n }\r\n }", "function showTournamentID(){\n console.log('Tournament name: ', tournamentID);\n }", "function showDetails(row){\n\tvar controller = View.controllers.get('abGbRptFpSrcCatCtrl');\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClauses(controller.consoleRestriction);\n\tif(typeof(row) == \"object\" && typeof(row) != \"string\" && row != \"total_row\" ){\n\t\tif(valueExistsNotEmpty(row[\"bl.site_id\"])){\n\t\t\trestriction.addClause(\"bl.site_id\", row[\"bl.site_id\"], \"=\", \"AND\", true);\n\t\t}\n\t\tif(valueExistsNotEmpty(row[\"gb_fp_totals.calc_year\"])){\n\t\t\trestriction.addClause(\"gb_fp_totals.calc_year\", row[\"gb_fp_totals.calc_year\"], \"=\", \"AND\", true);\n\t\t}\n\t}\n\tcontroller.abGbRptFpSrcCat_bl.addParameter(\"isGroupPerArea\", controller.isGroupPerArea);\n\tcontroller.abGbRptFpSrcCat_bl.refresh(restriction);\n\tshowReportColumns(controller.abGbRptFpSrcCat_bl);\n\tcontroller.abGbRptFpSrcCat_tabs.selectTab(\"abGbRptFpSrcCat_bl_tab\");\n}", "function showDetails() {\n $(this).closest('.panel-body').find('.projInfo').slideDown();\n }", "function details(params) {\n return $http.get(caDetailRoute, {params: params}).then(function (response) {\n return response.data.result;\n })\n }", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['beurlaubt'] == 0) {\n\tif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tanzeige += \"Meldung Lehrer am: <b>\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'</b><br/>';\t\n\t}\n\tif (activeDataSet['elternMeldung'] != \"0\") {\n\tanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n\t}\n\tif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\n\tanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n\t}\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"Kommentar: \" + activeDataSet['kommentar'];\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function querySalesforceLead(emailAddress, accessToken, conversationId, orgId, callbackFn) {\n\t\n\tconsole.log(\"email address is :\" + emailAddress);\t\t \n\n\n if (typeof emailAddress != 'undefined') {\n\n\n\t\tvar jsforce = require('jsforce');\n\t\tvar conn = new jsforce.Connection({\n\t\t instanceUrl : 'https://na52.salesforce.com',\n\t\t accessToken : accessToken\n\t\t});\n\n\t\t\n\t var records = [];\n\t\n\n\t\t// Customize this to change the fields you return from the Lead object\n\t\tconn.query(\"SELECT Id, Email, Existing_Account__c, Owner.Name, FirstName, LastName, Company, Country, Academics__c, Total_RM_Studio_starts__c, Last_RM_Studio_usage__c FROM Lead where Email = '\" + emailAddress + \"'\", function(err, result) {\n\t\t \n\t\t if (err) { \n\t\t console.log(\"salesforce query error\");\n\t\t return console.error(err); \n\t\t }\n\n\n\t\t var firstName = result.records[0].FirstName;\n\t\t var lastName = result.records[0].LastName;\n\t\t var Id = result.records[0].Id;\n\t\t var Company = result.records[0].Company;\n\t\t var Country = result.records[0].Country;\n\t\t var existingAccount = result.records[0].Existing_Account__c;\n\t\t var ownerName = result.records[0].Owner.Name;\n\n\t\t if (result.records[0].Last_RM_Studio_usage__c != null) {\n\t\t\tvar lastStudioUsage = result.records[0].Last_RM_Studio_usage__c \n\t\t } else {\n\t\t\tlastStudioUsage = \"None\"\n\t\t }\n\t\t \n \n\t\t if (result.records[0].Total_RM_Studio_starts__c != null) {\n\t\t\tvar totalStudioStarts = result.records[0].Total_RM_Studio_starts__c \n\t\t } else {\n\t\t\ttotalStudioStarts = \"None\"\n\t\t }\t \n\t\t \n \n\t\t if (result.records[0].Academics__c != \"\") {\n\t\t\tAcademic = \"Yeah\"\n\t\t } else {\n\t\t\tAcademic = \"Nope\"\n\t\t }\n\t\t \t\t \n\t\t if (existingAccount != null) {\n\t\t\tcompanyResponse = \"<a target='_blank' href=https://na52.salesforce.com/\" + existingAccount + \">\" + Company + \"</a>\"\n\t\t } else {\n\t\t\tcompanyResponse = Company;\n\t\t }\n\t\t\n \n\t\t // Build the Drift reply body. You can make this whatever you want. \n\t\t body = \"<a target='_blank' href=https://na52.salesforce.com/\" + Id + \">\" + firstName + \" \" + lastName + \"</a> | \" + companyResponse + \" | \" + Country + \"<br/>Owned by \" + ownerName + \"<br/>Total RM Studio Starts: \" + totalStudioStarts + \" | Last RM Studio Usage: \" + lastStudioUsage + \"<br/>Academic: \" + Academic\n\n\t\t\t\n\t\t callbackFn(body, conversationId, orgId, accessToken, existingAccount)\n\t\t }); \n\n\t\t\t\n\n\t} else {\n\t\t// No email address was found\n\t\tbody = \"Oops, we don't have an email address or the user isn't in Salesforce yet\"\n\t\tcallbackFn(body, conversationId, orgId, accessToken, \"\")\n\t\t}\t\n}", "function getRecDetail(recName){\n recName = recName.replace(\" \", \"_\");\n var recDetailUrl = mealNameSearch + recName;\n\n fetch(recDetailUrl)\n .then(function(response) {\n if (response.ok) {\n response.json().then(function(data) {\n getDetails(data, recName);\n });\n } \n })\n .catch(function(error) {\n alert(\"Unable to connect\");\n });\n}", "function getAccountDetails(params) {\n\n var result = \"<span><b>\" + params.data.accountType + \"</b><br />Account Number - \" + params.data.accountID + \"</span>\";\n var assocdatas = params.data.accountBeneficiaries;\n result += \"</br><div style='background-color:yellow;height:20px;width;950px;'>\";\n for (var i = 0; i < assocdatas.length; i++) {\n var split = assocdatas[i].split(\" - \");\n var shortname = split[0].split(\" \");\n result += \"<b>\" + split[0] + \"(\" + shortname[0].substring(0, 1) + shortname[1].substring(0, 1) + \")\" + \"</b>&nbsp;&nbsp;\" + split[1] + \"&nbsp;&nbsp;\";\n }\n result += \"</div>\";\n return result;\n }", "function viewDepatments() {\n var query = \"SELECT * FROM DEPARTMENTS\";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Name: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "getHtmlManagerDetails(id, email, officeNumber) {\n return `\n <ul>\n <li>Employee #: ${id}</li>\n <li>Email: <a href=\"mailto: ${email}\">${email}</a></li>\n <li>Office #: ${officeNumber}</li>\n </ul>`;\n }", "function seeDetails(id){\r\n localStorage.setItem(\"adId\" , id)\r\n window.location.assign(\"details\")\r\n}", "function getDetails(e, $row, id, record) {\n $('#feature-title').text(record.title);\n $('#feature-priority').text(record.client_priority);\n $('#feature-target-date').text(record.target_date);\n $('#feature-client').text(record.client);\n $('#feature-product-area').text(record.product_area_name);\n\t$('#feature-description').text(record.description);\n }", "function getAttendeeDetails() {\n api.getAttendeeDetails($scope.attendee.id, function(d) {\n $scope.attendee.fullName = d.attendees.fullName;\n $scope.attendee.dateJoined = d.attendees.dateJoined;\n $scope.attendee.messages = d.attendees.messages;\n $scope.attendee.phoneNumber = d.attendees.phoneNumber;\n });\n }", "function showFullDetails(id) {\n var item = getElementById(id); // get list item\n var fullDetails = item.getElementsByClassName('full-details')[0]; // get details section\n\n if(fullDetails != undefined) {\n if(fullDetails.style.display == 'none') {\n fullDetails.style.display = 'block';\n item.title = \"click to hide details\";\n }\n else {\n fullDetails.style.display = 'none';\n item.title = \"click to show details\";\n }\n }\n}", "function getOneLeadDeets(){\n console.log(\"test\"); \n //const oneLeadDeetsApiUrl = \"https://localhost:5001/api/feedback\";\n const oneLeadDeetsApiUrl =\"https://tas360feedbackapi.herokuapp.com/api/feedback\";\n\n fetch(oneLeadDeetsApiUrl).then(function(response){\n console.log(response); \n return response.json();\n \n }).then(function(json){\n\n let html = \"<p>\";\n json.forEach((survey)=>{\n if (survey.employee_Feedback == 'EmployeeOne' && survey.leadTotal >= 5 && survey.leadTotal <= 7){ //red \n\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-red\\\"></div></div></p>\" + \n \"<div class=\\\"d-box\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\"; \n }\n else if (survey.employee_Feedback == 'EmployeeOne' && survey.leadTotal >= 8 && survey.leadTotal <= 13) {\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-orange\\\"></div></div></p>\" + \n \"<div class=\\\"d-box\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\";\n }\n else if (survey.employee_Feedback == 'EmployeeOne' && survey.leadTotal >= 14 && survey.leadTotal <= 18) {\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-yellow\\\"></div></div></p>\" + \n \"<div class=\\\"d-box\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\";\n }\n else if (survey.employee_Feedback == 'EmployeeOne' && survey.leadTotal >= 19 && survey.leadTotal <= 21) {\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-lime\\\"></div></div></p>\" + \n \"<div class=\\\"d-box\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\";\n }\n else if (survey.employee_Feedback == 'EmployeeOne' && survey.leadTotal >= 22 && survey.leadTotal <= 25) {\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-green\\\"></div></div></p>\" + \n \"<div class=\\\"d-box\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\";\n }\n\n });\n html += \"</p>\"; \n document.getElementById(\"details\").innerHTML = html; \n }).catch(function(error){\n console.log(error);\n })\n}", "function drillLead() {\n var hasLeads = false;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n var type = \"Lead\";\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n\n // Success returned from executeQueryAsync\n var leadTable = document.getElementById(\"drillTable\");\n\n // Remove all nodes from the drillTable <DIV> so we have a clean space to write to\n while (leadTable.hasChildNodes()) {\n leadTable.removeChild(leadTable.lastChild);\n }\n\n // Iterate through the Prospects list\n var listItemEnumerator = listItems.getEnumerator();\n\n var listItem = listItemEnumerator.get_current();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n // Get information for each Lead\n var leadTitle = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n var leadPerson = document.createTextNode(listItem.get_fieldValues()[\"ContactPerson\"]);\n var leadNumber = document.createTextNode(listItem.get_fieldValues()[\"ContactNumber\"]);\n var leadEmail = document.createTextNode(listItem.get_fieldValues()[\"Email\"]);\n var leadPotentialAmt = document.createTextNode(listItem.get_fieldValues()[\"DealAmount\"]);\n drillTable(leadTitle.textContent, leadPerson.textContent, leadNumber.textContent,leadEmail.textContent, leadPotentialAmt.textContent, type, leadAmount.toLocaleString());\n }\n hasLeads = true;\n }\n\n if (!hasLeads) {\n // Text to display if there are no leads\n var noLeads = document.createElement(\"div\");\n noLeads.appendChild(document.createTextNode(\"There are no leads. You can add a new lead from here.\"));\n leadTable.appendChild(noLeads);\n }\n $('#drillDown').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get Leads. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n\n });\n}", "function Details() {\r\n}", "function displayDetails(details){\n var keys = Object.keys(details);\n for (var i=0; i<keys.length; i++){\n var elem = document.getElementById(keys[i]);\n if (elem && details[keys[i]])\n elem.innerHTML = details[keys[i]];\n else if (elem)\n elem.style.display = \"none\";\n }\n }", "async function getOpportunityDetails (req, res) {\n res.send(await service.getOpportunityDetails(req.authUser, req.params.opportunityId))\n}", "function getDetails(id, name, email) {\n console.log(\"id\", id);\n console.log(\"Name\", name);\n if (email != undefined) {\n console.log(\"email\", email);\n }\n}", "function mealDescription(m) {\n const id = m.target.id;\n for (let i = 0; i < idNum.length; i++) {\n if (id == idNum[i]) {\n fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${id}`)\n .then(res => res.json())\n .then(data => {\n const descriptionInfo = `\n Item Name : ${data.meals[0].strMeal}\n\n Ingredients :\n ${data.meals[0].strIngredient1} ${data.meals[0].strMeasure1}\n ${data.meals[0].strIngredient2} ${data.meals[0].strMeasure2}\n ${data.meals[0].strIngredient3} ${data.meals[0].strMeasure3}\n ${data.meals[0].strIngredient4} ${data.meals[0].strMeasure4}\n ${data.meals[0].strIngredient5} ${data.meals[0].strMeasure5}\n ${data.meals[0].strIngredient6} ${data.meals[0].strMeasure6}`;\n\n window.alert(descriptionInfo);\n })\n }\n }\n}", "function detailsOneDigimon(req,res) {\r\n let SQL = 'SELECT * FROM digimon WHERE id=$1;';\r\n let value = [req.params.details_id];\r\n client.query(SQL,value).then((result)=>{\r\n res.render('digimonExam/details', {data:result.rows[0]});\r\n }).catch((err)=>errorHandler(err,req,res));\r\n}", "render() {\n const { deals } = this.context\n const { dealId } = this.props.match.params\n \n \n const deal = deals.find(deal => deal.id == dealId) \n \n return (\n <div className='DealExpanded'>\n <h3 className=\"dealItemName\">{deal.name}</h3>\n <h5 className=\"dealItemPrice\">${(deal.price/100)}</h5>\n <h5 className=\"dealItemDay\">{deal.day}</h5>\n <h5 className=\"dealItemDistance\">{deal.distance} miles away from home</h5>\n <p>{deal.content}</p>\n </div>\n )\n }", "function findDetail(detail) {\n const found = trip.details.find(element => element.detail_type.label === detail);\n if (found) return found.body;\n else return null\n }", "details(id){\n\t\twindow.location.href=this.url+\"detalles-blog/\"+id;\n\t}", "handleViewDetailsClick() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: this.location.Id,\n objectApiName: LOCATION_OBJECT.objectApiName,\n actionName: 'view'\n }\n });\n }", "function showDetail(d) {\n // change outline to indicate hover state.\n d3.select(this).transition()\n .duration(500)\n .attr('fill-opacity', 1);\n\n var content = '<span class=\"people\">' +\n addCommas(d.value) + '</span><spanclass=\"people\"> People,</span><br/>' +\n '<span class=\"value\">' +\n d.id + ',</span><br/>' +\n '<span class=\"value\">' +\n d.continents +\n '</span><br/>';\n tooltip.showTooltip(content, d3.event);\n }", "function showDetails($vp) {\n var state = requests.getState();\n $('#processing').html(Object.keys(state.processingHosts).length);\n $('#queued').html(Object.keys(state.queuedHosts).length);\n $('#processed').html(Object.keys(state.allHops).length);\n\n if (freeze) {\n return;\n }\n\n var toshow, t, table = '<table><tr>', tdata = '', c;\n switch ($('#toView').val()) {\n case 'processing':\n toshow = processing;\n break;\n case 'completed':\n toshow = completed;\n break;\n default:\n toshow = $.extend({}, processing, completed);\n }\n\n $vp.html('');\n for (t in toshow) {\n c = (processing[t] ? 'processing' : 'completed');\n table += '<th class=\"' + c + '\">' + t + '</th>';\n var update = toshow[t];\n tdata += '<td class=\"' + c + '\">' + (\n $('#traceView').val() === 'details' ? summarizeUpdate(update)\n : '<pre>' + update.buffer + '</pre>'\n ) + '</td>';\n }\n $vp.append(table + '</tr><tr>' + tdata + '</tr></table>');\n }", "function Report_IDAndContactInfo() {\n //console.log(Object.keys(IDAndContactInfo))\n\n Object.keys(IDAndContactInfo).forEach(id => {\n s('[data-IDAndContactInfo]').innerHTML +=\n `\n <li class=\"col-12 py-2\">\n <ul data-${id} class=\" position-relative\">\n\n <li class=\"color_main sticky-top z_100 bg-light py-2 px-2\"> \n ${id} </li>\n \n </ul>\n \n </li>\n `\n })\n\n {\n\n // PersonalInfo\n const {\n Name: {\n FullName\n },\n DateOfBirth,\n Gender,\n Age: {\n Age\n },\n Occupation\n } = PersonalInfo;\n\n // console.log(PersonalInfo)\n\n if (PersonalInfo) {\n s('[data-PersonalInfo]').innerHTML =\n\n `\n <li class=\"color_main z_100 bg-light py-2 px-2\"> \n PersonalInfo </li>\n\n <li class=\"table-responsive-md\"> \n <table class=\"table\"> \n <thead> \n <tr> \n <th> FullName </th> \n <th> DateOfBirth </th>\n <th> Gender </th>\n <th> Age </th>\n <th> Occupation </th> </tr>\n </thead>\n\n <tbody> \n <tr>\n <td> ${FullName} </td> \n <td> ${DateOfBirth} </td>\n \n <td> ${Gender} </td>\n <td> ${Age} </td>\n <td> ${Occupation} </td>\n \n </tr>\n </tbody>\n </table>\n\n\n </li>\n \n `\n } else {\n console.log('PersonalInfo Not Found');\n // s('#APPLICANT_DETAILS').innerHTML = ''\n }\n } {\n // console.log(IdentityInfo)\n // IdentityInfo\n // console.log(IdentityInfo)\n const { PANId, PassportID, NationalIDCard, IDOther } = IdentityInfo\n // console.log(NationalIDCard)\n if (IdentityInfo) {\n s('[data-IdentityInfo]').innerHTML =\n `\n <li class=\"color_main z_100 bg-light py-2 px-2\"> \n IdentityInfo </li>\n <li class=\"table-responsive-md\"> \n <table class=\"table\">\n <thead> <tr> \n <th> Type </th> <th> ReportedDate\n </th> <th> IdNumber </th> </tr> </thead>\n <tbody>\n ${\n PANId ? ` <tr > <td> PANId </td> <td> ${PANId.attr.ReportedDate} </td> <td> ${PANId.IdNumber} </td> </tr>` :\n ''\n }\n ${\n PassportID ? `<tr > <td> PassportID </td> <td> ${PassportID.attr.ReportedDate} </td> <td> ${PassportID.IdNumber} </td> </tr>` :\n ''\n }\n ${\n NationalIDCard ? `<tr > <td> NationalIDCard </td> <td> ${NationalIDCard.attr.ReportedDate} </td> <td> ${NationalIDCard.IdNumber} </td> </tr>` :\n ''\n }\n ${\n IDOther ? `<tr > <td> IDOther </td> <td> ${IDOther.attr.ReportedDate} </td> <td> ${IDOther.IdNumber} </td> </tr>` :\n ''\n }\n\n\n </tbody>\n </table>\n </li>\n `\n\n } else {\n console.log('IdentityInfo Not Found');\n // s('#APPLICANT_DETAILS').classList.add('d-none')\n }\n }\n /*\n \n \n \n \n */\n\n {\n // AddressInfo\n // console.log(AddressInfo)\n\n\n\n // const {_seq,_ReportedDate, Address, State, Postal,Type } = AddressInfo[0];\n if (AddressInfo) {\n s('[data-AddressInfo]').innerHTML =\n\n `\n\n <li class=\"color_main z_100 bg-light py-2 px-2\"> \n AddressInfo </li>\n <li class=\"table-responsive-md\"> \n\n <table class=\"table\"> \n <thead>\n <tr data-AddressInfo-col >\n \n <th> Sequence </th> <th> ReportedDate </th> <th> Address</th><th> State</th><th> Postal</th><th>Type </th>\n </tr>\n </thead>\n\n <tbody data-AddressInfo-body > \n\n\n </tbody>\n\n </table>\n\n </li>\n `\n\n AddressInfo.map(a => {\n s('[data-AddressInfo-body]').innerHTML +=\n\n `\n <tr> <td> ${a.attr.seq} </td> <td> ${a.attr.ReportedDate} </td> <td> ${a.Address} </td>\n <td> ${a.State} </td> <td> ${a.Postal} </td> <td> ${a.Type} </td> </tr>\n \n `\n })\n } else {\n console.log('AddressInfo Not Found');\n // s('#APPLICANT_DETAILS').classList.add('d-none')\n\n }\n\n }\n\n\n {\n\n // PhoneInfo\n\n // console.log(PhoneInfo)\n\n if (PhoneInfo) {\n s('[data-PhoneInfo]').innerHTML =\n\n `\n\n <li class=\"color_main z_100 bg-light py-2 px-2\"> \n PhoneInfo </li>\n <li class=\"table-responsive-md\"> \n\n <table class=\"table\"> \n <thead>\n <tr data-PhoneInfo-col >\n \n <th> Sequence </th> <th> ReportedDate </th> <th> Number</th><th> Typecode</th>\n </tr>\n </thead>\n\n <tbody data-PhoneInfo-body > \n </tbody>\n\n </table>\n\n </li>\n `\n PhoneInfo.map(a => {\n s('[data-PhoneInfo-body]').innerHTML +=\n\n `\n <tr> <td> ${a.attr.seq} </td> <td> ${a.attr.ReportedDate} </td> <td> ${a.Number} </td>\n <td> ${a.attr.typeCode} </td> </tr>\n \n `\n })\n } else {\n console.log('PhoneInfo not Found');\n // s('#APPLICANT_DETAILS').classList.add('d-none');\n }\n\n }\n\n {\n\n // EmailAddressInfo\n // console.log(EmailAddressInfo)\n\n\n if (EmailAddressInfo) {\n s('[data-EmailAddressInfo]').innerHTML +=\n `\n <li>\n\n <table class=\"table\">\n \n <thead>\n <tr> <th> Sequence No </th> <th> ReportedDate </th> <th> EmailAddress </th> </tr>\n </thead>\n <tbody> \n <tr>\n <td> ${EmailAddressInfo.attr.seq} </td>\n <td> ${EmailAddressInfo.attr.ReportedDate} </td>\n <td> ${EmailAddressInfo.EmailAddress} </td>\n </tr>\n\n </tbody>\n\n \n \n </table>\n\n\n </li>\n `\n\n } else {\n console.log('EmailAddressInfo not Found');\n // s('#APPLICANT_DETAILS').classList.add('d-none');\n }\n }\n\n }", "function makeDetailHtml(data){\r\n var count = 0;\r\n var i = 0;\r\n var html = '<div style=\"display: none; \" class=\"detail_info\" id=\"detail_info_' + data.index + '\">'\r\n // id\r\n html += '<p class=\"detail_id\">id: DOID:' + data.info.id + '</p>';\r\n // name\r\n html += '<p class=\"detail_name\">name: ' + data.info.name + '</p>';\r\n //def\r\n if (data.info.definition != null){\r\n // html += '<p class=\"detail_def\">def: ' + data.info.definition + '</p>';\r\n var s=data.info.definition;\r\n if(s.match('url')){\r\n var t1=s.substring(s.lastIndexOf('[')+1,s.lastIndexOf(']'));\r\n var t2=s.substring(0,s.lastIndexOf('['));\r\n var txt=t2.substring(1,t2.length-2);\r\n html += '<p class=\"detail_def\">def: '+ txt+'url:';\r\n if(t1.match(',')){\r\n var t=t1.split(',');\r\n count=t.length;\r\n for(i=0;i < count;i++){\r\n if(t[i].match('http')){\r\n html+='<a href=\"'+makeUrl(t[i])+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t[i])+'</a>'+(i==(count-1)? '&nbsp;':'&nbsp;|&nbsp;'); \r\n }\r\n } \r\n }else{\r\n html +='<a href=\"'+makeUrl(t1)+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t1)+'</a>';\r\n }\r\n html+='</p>';\r\n }\r\n } \r\n // alt_id\r\n if (data.info.alt_ids != null){\r\n count = data.info.alt_ids.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_alt_id\">alt_id: DOID:' + data.info.alt_ids[i].alt_id + '</p>';\r\n }\r\n } \r\n // subset\r\n if (data.info.subsets != null){\r\n count = data.info.subsets.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_subset\">subset: ' + data.info.subsets[i].subset + '</p>';\r\n }\r\n }\r\n // synonym\r\n if (data.info.synonyms != null){\r\n count = data.info.synonyms.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_synonym\">synonym: ' + data.info.synonyms[i].synonym + '</p>';\r\n }\r\n } \r\n // xref\r\n if (data.info.xrefs != null){\r\n count = data.info.xrefs.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_xref\">xref: ' + data.info.xrefs[i].xref_name + ':' + data.info.xrefs[i].xref_value + '</p>';\r\n }\r\n } \r\n // relations\r\n if (data.info.relations != null){\r\n count = data.info.relations.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_relation\">' + data.info.relations[i].relation + ': ' + data.info.relations[i].term2_id + '</p>';\r\n }\r\n }\r\n html += '</div>';\r\n return html;\r\n}", "async details({ params, view }) {\n const post = await Post.find(params.id)\n //redirecting to the details page\n return view.render('posts.details', {\n post: post\n })\n }", "function leadsLink(obj, key){\n\n //debugger;\n return '<li id=\"'+ key+'\"><a href=\"javascript:void(0)'+ '\" onclick=\"goToLeadDetailPage(\\''+ obj.name[1] + '\\',\\''+ obj.email[1] + '\\',\\''+ key + '\\',\\''+ obj.phone[1] +'\\')\">'+ obj.name[1]\n + '</a></li>';\n}", "getLead() {\n if (this.state.lead !== null) {\n return Promise.resolve(this.state.lead)\n }\n return LeadService.createLead().then(lead => {\n this.setState({lead})\n return lead\n })\n }", "function showDetails() {\n // 'this' is the row data object\n var s1 = ('Total room area: ' + this['rm.total_area'] + ' sq.ft.');\n \n // 'this.grid' is the parent grid/mini-console control instance\n var s2 = ('Parent control ID: ' + this.grid.parentElementId);\n \n // you can call mini-console methods\n var s3 = ('Row primary keys: ' + toJSON(this.grid.getPrimaryKeysForRow(this)));\n \n alert(s1 + '\\n' + s2 + '\\n' + s3);\n}", "function onShowDetail(element) {\r\n try {\r\n var dataId = jQuery(element).attr('data-id');\r\n\r\n g_currentOperation = dataId;\r\n\r\n if (!dataId || dataId.length <= 0) {\r\n dataId = WotpUtilityCommon.CurrentOperations.None;\r\n }\r\n\r\n //passing the filter info to load detail data\r\n loadDataDetail(dataId);\r\n\r\n } catch (e) {\r\n nlapiLogExecution('ERROR', 'Error during main onShowDetail', e.toString());\r\n }\r\n}", "function detail(id){\n\tvar kelas ='.detail-'+id;\n\tvar data = $(kelas).data('id');\n\tvar links;\n\n\t$('h3.semibold').html(data.judulMateri);\n\t\t// links = '<?=base_url();?>assets/video/' + data.namaFile;\n\t\t$('#isicontent').html(data.isiMateri); \n\t\t$('.detail_materi').modal('show');\n\n\n\t}", "function renderPortal(guid) {\r\n\tvar details = window.portalDetail.get(guid);\r\n\tif (!details) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tconsole.log('details', details);\r\n\r\n\tvar lvl = details.level;\r\n\tvar isNeutral = details.resCount == 0 ? true : false;\r\n\tvar html;\r\n\tif(isNeutral) {\r\n\t\thtml = '<span class=\"portallevel\">L0</span>';\r\n\t}\r\n\telse {\r\n\t\thtml = '<span class=\"portallevel\" style=\"background: '+COLORS_LVL[lvl]+';\">L' + lvl + '</span>';\r\n\t}\r\n\t\r\n\tif(isNeutral) {\r\n\t\thtml += `<div class=\"basicinfo\">${details.title}</div>`;\r\n\t}\r\n\telse {\r\n\t\thtml += `<div class=\"basicinfo\">${details.health}% [${details.owner}] ${details.title}</div>`;\r\n\t}\r\n\t\r\n\tif(!isNeutral) {\r\n\t\thtml += renderResonators(details);\r\n\t\t\r\n\t\thtml += renderMods(details);\r\n\t}\r\n\r\n\treturn html;\r\n}", "details(context) {\r\n let {\r\n id\r\n } = context.params\r\n\r\n models.Ideas.getSingle(id)\r\n .then((res) => {\r\n let currentIdea = docModifier(res)\r\n context.idea = currentIdea\r\n console.log(context.idea)\r\n //Check for author of cause! \r\n if (currentIdea.uid !== localStorage.getItem('userId')) {\r\n context.isAuthor = false;\r\n } else {\r\n context.isAuthor = true;\r\n }\r\n\r\n extend(context).then(function () {\r\n this.partial('../templates/cause/details.hbs')\r\n })\r\n })\r\n .catch((err) => console.error(err))\r\n }", "function show(){\n loadData();\n console.log(listContact);\n}", "function showMoreInfo(location, actor1, actor2, actor3, writer, company) {\n swal({\n title: \"More Info:\",\n text: `\n Location:\n ${location}\n \n Actors:\n ${actor1}, ${actor2}, ${actor3}\n \n Writer:\n ${writer}\n \n Production Company:\n ${company}\n `,\n });\n}", "async function getLeagueDetails() {\n const league = await axios.get(\n `https://soccer.sportmonks.com/api/v2.0/leagues/${LEAGUE_ID}`,\n {\n params: {\n include: \"season\",\n api_token: process.env.api_token,\n },\n }\n );\n if (league.data.data.current_stage_id == null) {\n return {\n leagueName: league.data.data.name,\n seasonName: league.data.data.season.data.name,\n stageName: \"currently there is no stage available\",\n current_season_id: league.data.data.current_season_id,\n };\n }\n const stage = await axios.get(\n `https://soccer.sportmonks.com/api/v2.0/stages/${league.data.data.current_stage_id}`,\n {\n params: {\n api_token: process.env.api_token,\n },\n }\n );\n return {\n leagueName: league.data.data.name,\n seasonName: league.data.data.season.data.name,\n stageName: stage.data.data.name,\n current_season_id: league.data.data.current_season_id,\n };\n}", "function getEventDetails () { \n\tif (eventIndex == undefined) { // displayed when there is no event at current day\n\t\tdocument.getElementById(\"description\").style.visibility = \"hidden\"; // hide the HTML details\n\t\tdocument.getElementById(\"currentPhoto\").setAttribute(\"src\", \"NoEvent.jpg\"); // display \"no event\" picture\n\t} else { // finding details about event and displaying it\n\t\tdocument.getElementById(\"description\").style.visibility = \"visible\"; // show HTML details\n\t\t// set displayed details based on the information in the pseudo data base\n\t\tdocument.getElementById(\"startingTime\").innerHTML = eventsToDisplay[eventIndex].startingTime;\n\t\tdocument.getElementById(\"endingTime\").innerHTML = eventsToDisplay[eventIndex].endingTime;\n\t\tdocument.getElementById(\"title\").innerHTML = eventsToDisplay[eventIndex].title;\n\t\tdocument.getElementById(\"eventDescription\").innerHTML = eventsToDisplay[eventIndex].eventDescription;\n\t\tdocument.getElementById(\"place\").innerHTML = eventsToDisplay[eventIndex].place;\n\t\tdocument.getElementById(\"currentPhoto\").setAttribute(\"src\", eventsToDisplay[eventIndex].imgSource);\n\t}\n}", "function specInfo(staff) {\r\n if (staff.getRole() === \"Manager\") {\r\n return ` <li class = \"list-group-item\">Office Number: ${staff.getOffNum()}</li>`;\r\n } else if (staff.getRole() === \"Intern\") {\r\n return `<li class = \"list-group-item\">School: ${staff.getSchool()} </li>`;\r\n } else {\r\n return ` <li class = \"list-group-item\">GitHub: <a href = \"www.github.com/${staff.getGithub()}\">${staff.getGithub()}</a></li>`;\r\n }\r\n }", "function myDetails(){\r\nconsole.log(\"Name :\" + details.name); // prints Name on Console\r\nconsole.log(\"Age :\" + details.age); // prints Age on Console\r\nconsole.log(\"Date Of Birth :\" + details.dateOfBirth); // prints date of birth on Console\r\nconsole.log(\"Place Of Birth :\" + details[\"placeOfBirth\"]); // prints place of birth on Console\r\n \r\n /* Console.log functions for printing name, \r\n age, date of birth and place of birth*/\r\n }", "function onShowEstimation(){\n \tvar rest = new Ab.view.Restriction();\n\trest.addClause(\"wr.wr_id\",$(\"wr.wr_id\").value,\"=\");\n\tView.openDialog(\"ab-helpdesk-workrequest-estimation.axvw\",rest,false);\n}", "getChallengeDetail(id) {\n axios.get(`view/created-challenges?challengeId=${id}`).then(res => {\n let challenge = res.data.challenges[0];\n\n this.setState({\n challenge: challenge.title,\n aboutChallenge: challenge.challengeDescription.aboutChallenge,\n goalDescription: challenge.challengeDescription.goalDescription,\n joinDescription: challenge.challengeDescription.joinDescription,\n policyDescription: challenge.challengeDescription.policyDescription,\n challengeStartDate: challenge.startDate,\n challengeEndDate: challenge.endDate,\n image: BASE_URL + challenge.image,\n activityType: challenge.activityType,\n maxValue: challenge.totalCount,\n minValue: challenge.minCount\n });\n });\n }", "function one(id) {\n\n return lessonPlan.lessons[id]\n\n}", "function ArticlesDetails() {\n}", "function details() {\n let did = dsel.value;\n if (!did) return;\n fetch(base + \"/dispenser/\" + did)\n .then(resp => resp.json()).then(function(json) {\n let perc = Math.ceil(json[\"valor_atual\"]/json[\"vol_max\"]*100);\n curml.innerText = json[\"valor_atual\"] + \" mL (\" + perc + \"%)\";\n curdesc.innerText = json[\"desc\"];\n });\n}", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function infoRumahSakit(agent) {\n return axios({\n method: \"get\",\n url: \"https://dekontaminasi.com/api/id/covid19/hospitals\",\n }).then((data) => {\n var rs = \"\";\n for (var i = 0; i < 15; i++) {\n rs +=\n data.data[i].name +\n \" \" +\n \", Alamat : \" +\n data.data[i].address +\n \", Phone: \" +\n data.data[i].phone +\n \"\\n\\n\";\n }\n \n var rs2 = \"\";\n for (var j = 15; j < 30; j++) {\n rs2 +=\n data.data[j].name +\n \" \" +\n \", Alamat : \" +\n data.data[j].address +\n \", Phone: \" +\n data.data[j].phone +\n \"\\n\\n\";\n }\n agent.add(\n \"List Rumah Sakit Rujukan Covid-19 : \" +\n \"\\n\\n\" +\n rs\n );\n \n agent.add(\n \"List Rumah Sakit Rujukan Covid-19 : \" +\n \"\\n\\n\" +\n rs2 +\n \"Sumber API : https://dekontaminasi.com/api/id/covid19/hospitals\"\n );\n });\n }", "function viewEmpByMngr() {\n const query = `\n SELECT\n employee.id AS EmployeeID,\n CONCAT(employee.first_name, \" \", employee.last_name) AS EmployeeName,\n role.title AS Role,\n department.name AS Department,\n CONCAT(manager.first_name, \" \", manager.last_name) AS Manager \n FROM employee\n LEFT JOIN employee manager \n ON manager.id = employee.manager_id\n INNER JOIN role \n ON (role.id = employee.role_id && employee.manager_id != 'NULL')\n INNER JOIN department \n ON (department.id = role.department_id)\n ORDER BY manager;`\n db.query(query, (err, response) => {\n if (err) { \n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employee by Manager `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "function expandDetails( d ) {\n // `d` is the original data object for the row\n\n // this is pretty ugly\n var resp = '';\n\n // for now, details can be both null and empty\n var hasDescription = (d.Description && d.Description !== null);\n var hasURL = (d.URL && d.URL !== null);\n var hasSerial = (d.Serial && d.Serial !== null);\n var hasComment = (d.Comment && d.Comment !== null);\n\n // If no extra details are available, show short message\n if (hasDescription === '' && hasURL === '' && hasComment === '' && hasSerial === '') {\n resp = '<table class=\"table table-condensed\"><tr><td>No further details available.</td></tr></table>';\n } else {\n // Else: show only the available information\n resp = '<table class=\"table table-condensed\"><tr><td class=\"col-xs-5\">';\n if (hasDescription) {resp = resp +d.Description;}\n resp = resp + '</td><td class=\"col-xs-1\">';\n if (hasURL) {resp = resp + '<a href=\"' + d.URL + '\" target=\"_blank\">More Info</a>'}\n resp = resp + '</td><td class=\"col-xs-2\">';\n if (hasSerial) {resp = resp + 'Serial no: ' + d.Serial}\n resp = resp + '</td><td class=\"col-xs-2\">';\n if (hasComment) {resp = resp + 'Comment: ' + d.Comment}\n resp = resp + '</td></tr></table>';\n }\n\n return resp;\n}", "function getThreeLeadDeets(){\n console.log(\"test\"); \n //const threeLeadDeetsApiUrl = \"https://localhost:5001/api/feedback\";\n const threeLeadDeetsApiUrl =\"https://tas360feedbackapi.herokuapp.com/api/feedback\";\n\n\n fetch(threeLeadDeetsApiUrl).then(function(response){\n console.log(response); \n return response.json();\n \n }).then(function(json){\n\n let html = \"<ul>\";\n json.forEach((survey)=>{\n if (survey.employee_Feedback == 'EmployeeThree' && survey.leadTotal >= 5 && survey.leadTotal <= 7){ //red \n\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-red\\\"></div></div></p>\" + \n \"<div class=\\\"d-box-2\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\"; \n }\n else if (survey.employee_Feedback == 'EmployeeThree' && survey.leadTotal >= 8 && survey.leadTotal <= 13) {\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-orange\\\"></div></div></p>\" + \n \"<div class=\\\"d-box-2\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\";\n }\n else if (survey.employee_Feedback == 'EmployeeThree' && survey.leadTotal >= 14 && survey.leadTotal <= 18) {\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-yellow\\\"></div></div></p>\" + \n \"<div class=\\\"d-box-2\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\";\n }\n else if (survey.employee_Feedback == 'EmployeeThree' && survey.leadTotal >= 19 && survey.leadTotal <= 21) {\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-lime\\\"></div></div></p>\" + \n \"<div class=\\\"d-box-2\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\";\n }\n else if (survey.employee_Feedback == 'EmployeeThree' && survey.leadTotal >= 22 && survey.leadTotal <= 25) {\n html+= \"<p><div><div class = \\\"scoreName\\\">Leadership Score</div><div class = \\\"d-img-green\\\"></div></div></p>\" + \n \"<div class=\\\"d-box-2\\\"><div class = \\\"space2\\\"><p> ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎</p></div>\" +\n \"<p>‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‎Motivation ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎\" + survey.lead1 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏The motivation score describes an employee's ability to motivate subordinates and peers during projects. </p></div>\" +\n \"<p>‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎Decisiveness ... ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎\" + survey.lead2 + \"‎‏‏‎‏‎‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p> ‎‏‏‎ ‎‏ ‎‏‏‎The decisivness score describes an employee's ability to make concise decions & follow through on them. ‏‏‎‎</p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Acknowledgement ... ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎ ‎‏‏‎‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎\" + survey.lead3 + \"‎‏‏‎‎‏‏‎‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The acknowledgement score describes an employee's ability to recognize the effors of peers. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎Perseverance ... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead4 + \"‎‏‏‎</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The perserverance score describes an employee's ability to remain consistant through adversity. </p></div>\" +\n \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ Organization... ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎ ‎‏‏‎ \" + survey.lead5 + \"</p>\" +\n \"<div class = \\\"space2\\\"><p>‎ ‎‏‏‎ The organizaiton score describes an employee's ability to navigate project management in a diciplined manner.‎</p></div></div>\";\n }\n\n });\n html += \"</ul>\"; \n document.getElementById(\"details\").innerHTML = html; \n }).catch(function(error){\n console.log(error);\n })\n}", "function Details(place){\n var details = document.createElement('div');\n writtendetails.appendChild(details);\n\n let name = document.createElement('h1');\n name.textContent = place.name;\n details.appendChild(name);\n if (place.rating != null) {\n let rating = document.createElement('p');\n rating.innerHTML = `Rating: ${place.rating}`+\" \"+`<i class=\"fas fa-star\"></i>`;\n details.appendChild(rating);\n }\n if(place.vicinity){\n let address = document.createElement('p');\n address.textContent = place.vicinity;\n details.appendChild(address);}\n if(place.business_status===\"OPERATIONAL\"){\n let openinghours=document.createElement(\"p\");\n openinghours.textContent = \"We are open and ready to take your order\";\n details.appendChild(openinghours);\n }else if(\n place.business_status===\"CLOSED_TEMPORARILY\"){\n let notopen=document.createElement(\"p\");\n notopen.textContent=\"Sorry, we are closed temporarily.\";\n details.appendChild(notopen);\n }\n \n }", "function showAbsenceDetails_old() {\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == activeElement);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende']);\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: \" + formatDateDot(activeDataSet['adminMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\nanzeige += \"Meldung Lehrer am: \" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: \" + formatDateDot(activeDataSet['elternMeldungDatum']);\t\n}\nif (activeDataSet['kommentar'] != \"0\") {\nanzeige += \"Kommentar: \" + formatDateDot(activeDataSet['kommentar']);\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function openVehicle(vid){\n //Open Specific vehicle by clicking More-btn in popup\n var sections = document.getElementsByClassName(\"mySection\");\n activePage = 'vehicleDetails';\n var vDetails;\n for (i = 0; i < sections.length; i++) {\n if (sections[i].id == 'vehicleDetails'){\n vDetails = sections[i];\n sections[i].style.display = \"block\";\n }\n else {\n sections[i].style.display = \"none\";\n }\n }\n loadDetails(vDetails, vid);\n loadLog(vid);\n loadComments(vid);\n loadInfo(vid);\n loadDiagnose(vid);\n loadActions(vid);\n loadTests(vid, 'tests');\n}", "function render(leads) {\n let ulElItems = \"\";\n\n h1El.textContent = \"Your leads:\";\n for (let i = 0; i < leads.length; i++) {\n ulElItems += \n `\n <li>\n <a href=\"#\" target=\"_blank\">${leads[i]}</a>\n </li>\n `\n }\n ulEl.innerHTML = ulElItems;\n\n // DELETING \"YOUR LEADS:\" TITLE IF THE ARRAY IS EMPTY\n if(!leads.length)\n h1El.textContent = \"\";\n}", "function displayDoctors() {\n\n // Reading Doctors file.\n var d = readFromJson('doc');\n\n // For loop to run till all the doctor's are printed.\n for (var i = 0; i < d.doctors.length; i++) {\n\n // Printing doctor's id, name & speciality.\n console.log(d.doctors[i].id + \". \" + d.doctors[i].name + \" (\" + d.doctors[i].special + \")\");\n }\n}", "function showDetails(d, i, datum, IDs)\n{\n var content = '<p class=\"main\">' + d.label + '</span></p>';\n content += '<hr class=\"tooltip-hr\">';\n content += '<p class=\"main\">' + d.class + '</span></p>';\n content += '<p class=\"main\">Time (ms): ' + d.starting_time + '</span></p>';\n globals.tooltip.showTooltip(content, d3.event);\n if (globals.timelineType == \"1d\") {\n // show functional equivalence lines when the user mouses over the event\n if (IDs[d.fe_id].length >= 4) {\n for (var i = 0; i < IDs[d.fe_id].length-2; i += 2) {\n d3.select(\"#timeline svg\").append('line')\n .attr(\"x1\", IDs[d.fe_id][i])\n .attr(\"y1\", IDs[d.fe_id][i+1])\n .attr(\"x2\", IDs[d.fe_id][i+2])\n .attr(\"y2\", IDs[d.fe_id][i+3])\n .style(\"stroke\",\"rgb(255,0,0)\");\n }\n }\n }\n}", "function showPerson() {\n $('body').find('.name').text(\"Name: \" + muArray[number].name);\n $('body').find('.git').text(\"github: \" + muArray[number].git_username);\n $('body').find('.shoutout').text(\"Shoutout: \" + muArray[number].shoutout);\n }", "function showList() {\n \n var data = $form.formValue();\n \n function ondone(listData) {\n storage.put(\"leadlist\", data); // save settings\n var c = { leads: listData };\n $page.find(\"table.output > tbody\").html(kite(\"#lead-list\",c));\n }\n \n $.get(data.url)\n .done(ondone)\n .fail(function(err,status) { alert(\"communication \" + status); }); \n }", "function createInfoWindowContent(trailObject) {\n\n // contentString is the string that will be passed to the infowindow\n var contentString;\n\n // description is the description received from openTrailsAPI\n var description;\n\n // if name is present from openTrailsAPI add it to contentString\n if (trailObject.name) {\n var name = trailObject.name;\n name = \"<h5><em>\" + name + \"</em></h5>\";\n contentString = name;\n }\n\n // first search to see if the activities array is present in the return from the openTrailsAPI. This avoids undefined errors\n if (trailObject.activities[0]) {\n\n // if thumbnail image is present from openTrailsAPI add it to contentString\n if (trailObject.activities[0].thumbnail) {\n var picture = trailObject.activities[0].thumbnail;\n picture = \"<img src='\" + picture + \"' alt='thumbnail' class='trailImage'><br>\";\n contentString += picture;\n }\n\n // if activity_type is present from openTrailsAPI add it to contentString\n if (trailObject.activities[0].activity_type_name) {\n var activity_type = trailObject.activities[0].activity_type_name;\n activity_type = \"<br><p class='activityType'><b>Type: </b>\" + activity_type + \"</p><br>\";\n contentString += activity_type;\n }\n }\n\n // if activity_type is present from openTrailsAPI add it to contentString.\n if (trailObject.description) {\n description = trailObject.description;\n description = \"<p><b>Description:</b></p><p class='trailDescription'>\" + description + \"</p><br>\";\n contentString += description;\n } else if (trailObject.activities[0]) {\n if (trailObject.activities[0].description) {\n description = trailObject.activities[0].description;\n description = \"<p><b>Description:</b></p><p class='trailDescription'>\" + description + \"</p><br>\";\n contentString += description;\n }\n }\n\n // if directiosn is present from openTrailsAPI add it to the contentString\n if (trailObject.directions) {\n var directions = trailObject.directions;\n directions = \"<p><b>Directions:</b></p><p class='trailDirections'>\" + directions + \"</p><br>\";\n contentString += directions;\n }\n\n // add rating if present in the openTrailsAPI\n if (trailObject.activities[0]) {\n if (trailObject.activities[0].rating) {\n var rating = trailObject.activities[0].rating;\n rating = \"<p class='trailRating'><b>Rating: </b>\" + rating + \" out of 5.</p><br>\";\n contentString += rating;\n }\n }\n\n return contentString;\n }", "async function fetchAdventureDetails(adventureId) {\n // TODO: MODULE_ADVENTURE_DETAILS\n // 1. Fetch the details of the adventure by making an API call\n let details;\n try {\n details = await (\n await fetch(\n `${config.backendEndpoint}/adventures/detail?adventure=${adventureId}`\n )\n ).json();\n\n // console.log(details);\n } catch (err) {\n console.log(err);\n details = null;\n } finally {\n // Place holder for functionality to work in the Stubs\n // console.log(details);\n return details;\n }\n}", "function ShowDetails(props) {\n return (\n <div style={props.selectedDisplay === 'More Details' ? { visibility: 'visible'}: {display: 'none'}}>\n <h5 className=\"project-desc project-header\"> More Details: </h5>\n {props.detail.map((details) =>{\n return <p className=\"project-details\" key={details}>{details}</p>\n })}\n </div>\n )\n}", "getAboutDetailsById(id) {\n return axios.get(ABOUT_API_BASE_URL + id);\n }" ]
[ "0.6155748", "0.58527076", "0.576146", "0.5753577", "0.5739801", "0.5738476", "0.57344794", "0.57156134", "0.5701738", "0.5615793", "0.5600871", "0.5551276", "0.55466855", "0.5544169", "0.55083287", "0.55045277", "0.5466686", "0.54450876", "0.5427636", "0.54196763", "0.5415179", "0.54139817", "0.5390372", "0.53713983", "0.53620684", "0.53511864", "0.53507835", "0.53489816", "0.5317536", "0.5303376", "0.52747744", "0.5274012", "0.5273661", "0.52655375", "0.5258274", "0.52547294", "0.52420837", "0.52355343", "0.52302015", "0.52271926", "0.52178276", "0.520485", "0.5203872", "0.5193389", "0.5193221", "0.5188758", "0.5187147", "0.51852804", "0.5183687", "0.51773614", "0.51351523", "0.5129511", "0.5128972", "0.512364", "0.51205033", "0.51121926", "0.5107396", "0.5098345", "0.5085895", "0.5082223", "0.5080075", "0.5078301", "0.50679934", "0.50674844", "0.5065998", "0.50534344", "0.50506943", "0.5047139", "0.5047004", "0.50373125", "0.5026151", "0.5020073", "0.5016983", "0.50092155", "0.50038314", "0.5002576", "0.500109", "0.49987608", "0.49948958", "0.49926993", "0.49918658", "0.4990269", "0.4987341", "0.49869618", "0.49866244", "0.49832264", "0.49795043", "0.4978304", "0.4969827", "0.49687776", "0.49672082", "0.49664685", "0.4954422", "0.4953435", "0.49510825", "0.4946397", "0.49434167", "0.49433997", "0.49364606", "0.49363318", "0.49341267" ]
0.0
-1
This function saves the newlyentered lead
function saveNewLead() { if ($('#newPotentialAmount').val() == "" || $('#newLead').val() == "") { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Organization Name or amount field is empty.")); errArea.appendChild(divMessage); } else { var itemCreateInfo = new SP.ListItemCreationInformation(); var listItem = list.addItem(itemCreateInfo); listItem.set_item("Title", $('#newLead').val()); listItem.set_item("ContactPerson", $('#newContactPerson').val()); listItem.set_item("ContactNumber", $('#newContactNumber').val()); listItem.set_item("Email", $('#newEmail').val()); listItem.set_item("_Status", "Lead"); listItem.set_item("DealAmount", $('#newPotentialAmount').val()); listItem.update(); context.load(listItem); context.executeQueryAsync(function () { clearNewLeadForm(); showLeads(); }, function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "function onSave(selectedDate, selectedVisitor,selectedTrail, guestState) {\n const passentry = {\n visitorId: selectedVisitor.id,\n date: selectedDate,\n guests: guestState,\n trailId: selectedTrail.id\n }\n // transition(SAVING);\n console.log('passentry...........', passentry)\n\n // if (mode === EDIT) {\n // props\n // .editInterview(props.id, interview)\n // .then(() => transition(SHOW))\n // .catch(error => {\n // transition(ERROR_SAVE, true)\n // }); \n // } else { \n props.newPass(passentry)\n props.onSetVerify()\n }", "function save() {\n $log.log('CollegeFundPaymentDialogController::save called');\n if (vm.collegeFundPayment.id) {\n //update the collegeFundPayment information\n CollegeFundPayment.save(vm.collegeFundPayment, onSaveFinished);\n } else {\n // Create New CollegeFundPayment\n if (vm.collegeFundPayment.id !== null) {\n CollegeFundPayment.create(vm.collegeFundPayment, onSaveFinished);\n }\n }\n }", "function saveRide() {\n const ride = rideData();\n let u = uLog('user');\n ride.ride_user = u;\n let rides = getTableData('rides');\n ride.ride_id = rides.length + 1;\n if (ride.ride_name.length <= 0\n || ride.ride_dep.length <= 0\n || ride.ride_arr.length <= 0\n || ride.ride_dep_time.length <= 0\n || ride.ride_arr_time.length <= 0) {\n popU('No blank spaces');\n } else {\n if (ride.ride_dep === ride.ride_arr) {\n popU('The departure and arrival can\\'t called same');\n }\n if (ride.ride_dep_time >= ride.ride_arr_time) {\n popU('The arrival time can\\'t be less than the departure time')\n }\n if (ride.ride_days.length === 0) {\n popU('You must select at least one day for a ride');\n }\n else {\n insertToTable('rides', ride);\n document.getElementById('ride-add-form').reset();\n popU('Ride suscesfully added ' + u);\n renderTableRides('rides_user', 'rides');\n return true;\n }\n }\n}", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "function saveLinkedinMember(member) {\n currentMentor.linkedinID = member.id;\n currentMentor.fullName = member.firstName + \" \" + member.lastName;\n currentMentor.job = member.headline;\n try {\n currentMentor.company = member.positions.values[0].company.name;\n } catch(err) {\n currentMentor.company = \"freelance\";\n }\n try {\n currentMentor.img = member.pictureUrls.values[0];\n } catch(err) {\n currentMentor.img = \"http://www.monologuedb.com/wp-content/uploads/2011/02/yoda1.jpg\";\n }\n currentMentor.linkedinLink = member.publicProfileUrl;\n currentMentor.mail = member.emailAddress;\n //moving to the mentor fields\n document.getElementById(\"linkedinSection\").style.display = \"none\";\n document.getElementById(\"mentorFormSection\").style.display=\"block\";\n\n}", "function saveNewThought() {\n\tvar thought = $(\"#new-thought\")[0].value;\n\tif (thought == \"\") {\n\t\talert(\"Thought cannot be empty\");\n\t\treturn;\n\t}\n\tvar author = $(\"#new-author\")[0].value;\n\tvar location = $(\"#new-location\")[0].value;\n\taddThought(thought, author, location);\n}", "function storeOpportunityDetails(opportunityObj){\n\tlocalStorage.konyOpportunityDetails = opportunityObj; //storing the corresponding opportunity details in localstorage\n\tchangePage('opportunitydetailspage','');\n}", "function convertLeads() {\n\tif (!validationForm()) {\n\t\treturn;\n\t}\n\tname = document.getElementById('form-nome').value;\n email = document.getElementById('form-email').value;\n company = document.getElementById('form-empresa').value;\n\n\tleads.unshift({\"name\":name , \"email\":email , \"company\":company});\n\n\tconsole.log(name);\n\tconsole.log(email);\n\tconsole.log(company);\n\tsaveListStorage(leads);\n\t\n\tresetForm();\n}", "function saveReportDetailsLocally(model){\n \n if(model.beneficiaryIndex==0){\n var apptDate=model.data.tags[0].apptDate\n var bookingDate=model.data.tags[0].bookingDate\n var leadId=model.data.leadId\n var mobile=model.data.mobile;\n var thyrocareLeadId=model.thyroDoc.ORDERRESPONSE.PostOrderDataResponse[model.beneficiaryIndex].LEAD_ID;\n model.data={};\n model.thyrocareLeadDetails=thyrocareLeadDetails;\n model.data.mobile=mobile;\n model.data.leadId=leadId;\n model.data.bookingDate=bookingDate;\n model.data.apptDate=apptDate;\n model.data.reportStatus=false;\n }\n if(model.beneficiaryIndex<model.thyroDoc.ORDERRESPONSE.PostOrderDataResponse.length){\n model.data.thyrocareLeadId=model.thyroDoc.ORDERRESPONSE.PostOrderDataResponse[model.beneficiaryIndex].LEAD_ID;\n model.schema=ThyrocareLead\n model.dbOpsType=\"create\"\n model.beneficiaryIndex++;\n model.callBackFromDataAccess=\"callBackLeadGeneration\"+model.beneficiaryIndex;\n model.on(model.callBackFromDataAccess,saveReportDetailsLocally)\n global.emit(globalDataAccessCall,model)\n model.emit(model.dbOpsType,model) \n }\n else{\n model.status=model.leadData;\n callHandler(model);\n }\n}", "function fhArrival_save() {\n\t\n\t if (!jQuery('#fhArrival_form').valid()) {\n\t\treturn false;\n\t}\n\t\n\tvar myPostArray = DMUtil.inputsToArray('#fhArrival_form');\n\tmyPostArray.push('arrivalId=' + fhArrival_data.arrivalId);\n\tvar rowsData = escape(JSON.stringify(fhArrival_data.arrival.ldvs));\n\tmyPostArray.push('rowsData=' + rowsData);\n\t\n\tvar myPostData = myPostArray.join('&'); \n\t\n\tjQuery.post(\n\t 'index.php?controller=arrival&task=jsonSave&type=json',\n\t myPostData,\n\t function (data) {\n\t \t\n\t \tvar result = DMResponse.validateJson(data);\n\t \t\n\t \tif ((result != false) && (result.result >= 0)) {\t\n\t \t\talert(\"Documento salvato\");\n\t \t\twindow.location = 'index.php?controller=arrival';\n\t \t} else {\n\t \t\talert(\"Si è verificato un errore (\" + result.result + \"): \" + result.description);\n\t \t}\n\t \t\n\t }\n\t); \n\t\n}", "function saveEdited(){\n\tactiveDataSet = studentList.find( arr => arr.absenceId == activeElement ); \n\t$.post(\"\", {\n\t\t\t\t'type': 'editabsence',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': activeDataSet['absenceId'],\n\t\t\t\t'id': activeElement,\n\t\t\t\t'start': formatDateDash(document.getElementById('esickstart').value),\n\t\t\t\t'end': formatDateDash(document.getElementById('esickend').value),\n\t\t\t\t'comment': document.getElementById('ecomment').value,\n\t\t\t\t'evia': document.querySelector('input[name=\"evia\"]:checked').value\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}", "function saveTrip(dest, address) {\n var tripName = $('#trips')[0].value;\n var newDate = $('#date')[0].value;\n var desc = $('#description')[0].value;\n\n // the new destination\n var newDest = {\n place: dest,\n address: address,\n date: newDate,\n desc: desc\n };\n\n // update the trip\n var tripInfo = JSON.parse(localStorage.getItem(tripName));\n tripInfo.push(newDest);\n localStorage.setItem(tripName, JSON.stringify(tripInfo));\n\n // close the modal\n closeModal();\n}", "function saveContact()\n{\n\tvar contact = {};\n\tvar properties = [];\n\t$(\"#contact_form\").find(\".form-control\").each(function()\n\t{\t\n\t\tvar value = $(this).val();\n\t\tvar label = $(this).attr('name');\n\t\tvar property = {};\n\t\tif(value)\n\t\t{\n\t\t\t//console.log(label +' : '+ value);\n\t\t\tproperty.value= value;\n\t\t\tproperty.name=label;\n\t\t\tproperty.type=\"SYSTEM\";\n\t\t\tproperties.push(property);\n\t\t}\n\t});\n\tcontact.properties = properties;\n\t//console.log(contact);\n\tcrm.addContact(contact, function(resp)\n\t\t{\t\n\t\t\t$('#save_contact').attr('disabled','disabled');\n\t\t\t//console.log(resp);\n\t\t\tvar contactLink = 'https://'+USER_SETTINGS.domain+'.agilecrm.com/#contact/'+resp.id;\n\t\t\t$(\"#contact_form\").append('<div id=\"message\" class=\"alert alert-info\">Contact added to AgileCRM. Click here to <a href=\"'+contactLink+'\" target=\"_blank\">Open Contact</a></div>');\n\t\t}, \n\t\tfunction(err)\n\t\t{\n\t\t\t//console.log(err);\n\t\t\t$(\"#contact_form\").append('<div id=\"message\" class=\"alert alert-danger\">'+err.responseText+'</div>');\n\t\t});\n}", "function saveTrackLead(){\t\r\n\t\tvar string;\r\n\t\tstring = jQuery('#basicWizard').find(\":input:not(:hidden)\").filter(function(index, node){\r\n\t\t\t\r\n\t\t\tif(in_excluded_array(node.id)){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t}).serialize();\r\n\t\t\r\n\t\tjQuery.ajax({\r\n\t\t\turl: '/application/setTrackLeadAjax',\r\n\t\t\tdata: string,\r\n\t\t\tmethod:'post',\r\n\t\t\theaders:{\r\n\t\t\t\t'x-keyStone-nonce': nonce\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function saveEmployee() {\n\tif(!document.getElementById(\"hiddenRefid\"))\n\t\treturn;\n\tif(!confirm(_(\"Are you sure you want to update this employee's information?\")))\n\t\treturn;\n\t\n\tvar inpToilAdjustment = document.getElementById(\"toilAdjustment\"); \t\n\tvar inpHolsAdjustment= document.getElementById(\"holsAdjustment\");\n\t\t\n\tvar employee = new Employee();\n\temployee.refid = parseInt(document.getElementById(\"hiddenRefid\").value);\n\temployee.userType = parseInt(document.getElementById(\"userType\").value);\n\temployee.minHours = parseFloat(document.getElementById(\"minHours\").value);\n\temployee.variable = document.getElementById(\"variable\").checked;\n\temployee.toilAdjustment = parseFloat(inpToilAdjustment.value);\n\temployee.toilAdjustmentDate = trim(document.getElementById(\"toilAdjustmentDate\").value);\n\temployee.toilAdjustmentComment = trim(document.getElementById(\"toilAdjustmentComment\").value);\n\temployee.holsAdjustment = parseFloat(inpHolsAdjustment.value);\n\temployee.holsAdjustmentComment = trim(document.getElementById(\"holsAdjustmentComment\").value);\n\temployee.authorizes_subordinates = document.getElementById(\"authorizes_subordinates\").checked;\n\temployee.authorizes_invoice_codes = document.getElementById(\"authorizes_invoice_codes\").checked;\n\temployee.enrolled = document.getElementById(\"enrolled\").checked;\n\temployee.save();\n}", "function save() {\n if (!pro) {\n $ionicPopup.alert({\n title: 'Pro Feature',\n template: 'Workouts can only be saved in Ruckus Pro. You can however still share!'\n });\n return false;\n }\n\n if (vm.saved) {\n return false;\n }\n workoutService.editOrCreate(saveSnapShot.date, saveSnapShot).then(function(res) {\n vm.saved = true;\n }, function(err) {\n log.log('there was an error with saving to the datastore' + err);\n });\n }", "function saveDetails(email, phone, points, payment, lname, fname, nickname, bday){\r\n var newUsersRef = usersRef.push();\r\n newUsersRef.set({\r\n email: email,\r\n phone: phone,\r\n points: points,\r\n payment: payment,\r\n\tlname : lname,\r\n\tfname : fname,\r\n\tnickname : nickname,\r\n\tbday : bday\r\n });\r\n}", "function storeOpportunityDetails(opportunityObj){\n\tlocalStorage.konyOpportunityDetails = JSON.stringify(opportunityObj); //storing the corresponding opportunity details in localstorage\n\twindow.location.href = \"opportunityDetails.html\"; //redirecting to details page\n}", "function save() {\r\n var site_name = document.getElementById(\"site_Name\").value;\r\n dev_name = document.getElementById(\"dev_Name\").value;\r\n var test_num = document.getElementById(\"try_num\").value;\r\n var language = document.getElementById(\"language\").value;\r\n\r\n database.ref('test/' + dev_name).set({\r\n siteName : site_name,\r\n developer : dev_name,\r\n testNumber : test_num,\r\n lSitLanguage : language\r\n });\r\n\r\n alert('saved');\r\n }", "function handleSaveToDB_welcome(agent) {\n console.log('welc intent works');\n classType = agent.parameters.classType;\n /** \n return db.runTransaction(t => {\n t.set(dialogflowAgentRef, {\n classType: classType,\n hoursSpent: hoursSpent,\n professorName: professorName});\n return Promise.resolve('Write complete');\n });\n **/\n }", "function saveResults() {\n dispatch({\n type: 'UPDATE_LEAGUE',\n payload: {\n leagueName: leagueName,\n startDate: startDate,\n endDate: endDate,\n leagueId: id\n }\n })\n history.push('/admin/leagues')\n }", "save() {}", "function saveRecord()\r\n{\r\n /* On save record:\r\n\r\n\t- PURPOSE\r\n\r\n\r\n\r\n\t FIELDS USED:\r\n\r\n\t\t--Field Name--\t\t\t--ID--\t\t--Line Item Name--\r\n\r\n\r\n */\r\n\r\n\r\n // LOCAL VARIABLES\r\n\r\n\r\n\r\n // SAVE RECORD CODE BODY\r\n\r\n\r\n\treturn true;\r\n\r\n}", "_saveData(){\n this.forwardButton.classList.remove('inactive');\n this.backButton.classList.remove('inactive');\n this.homeContainer.classList.remove('inactive');\n this.homeContainer.innerHTML = \"HOME\";\n const entry = this.diaryEntry.value;\n this.diaryService.post(this.journalID,this.date, this.promptIndex,entry);\n }", "function saveEditLead() {\n if ($('#editPotentialAmount').val() == \"\" || $('#editLead').val() == \"\") {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Organization Name or amount field is empty.\"));\n errArea.appendChild(divMessage);\n }\n else {\n currentItem.set_item(\"Title\", $('#editLead').val());\n currentItem.set_item(\"ContactPerson\", $('#editContactPerson').val());\n currentItem.set_item(\"ContactNumber\", $('#editContactNumber').val());\n currentItem.set_item(\"Email\", $('#editEmail').val());\n currentItem.set_item(\"DealAmount\", $('#editPotentialAmount').val());\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditLeadForm();\n showLeads();\n },\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n }\n}", "function handleSaveToDB_final(agent) {\n console.log('final intent works');\n return db.runTransaction(t => {\n t.set(dialogflowAgentRef, {\n date: date,\n classType: classType,\n hoursSpent: hoursSpent,\n professorName: professorName,\n finalScore: finalScore,\n preparedForFinal: preparedForFinal,\n finLecturePrep: finLecturePrep,\n finHomeworkPrep: finHomeworkPrep,\n finQuizPrep: finQuizPrep,\n finMidtermPrep: finMidtermPrep,\n finalHours: finalHours,\n yourFinalScore: yourFinalScore,\n additionalInfoForFinal: additionalInfoForFinal,\n assignmentType: assignmentType});\n return Promise.resolve('Write complete');\n });\n }", "function saveNewOp() {\n let newEntry = {\n date: new Date().toJSON(),\n cat: pageDialog.category.value,\n amount: pageDialog.amount.value,\n desc: pageDialog.desc.value\n };\n entriesDb.insert(newEntry);\n displayEntries();\n }", "function handleSaveToDB_homework(agent) {\n console.log('homework intent works');\n return db.runTransaction(t => {\n t.set(dialogflowAgentRef, {\n date: date,\n classType: classType,\n hoursSpent: hoursSpent,\n professorName: professorName,\n dateDue: dateDue,\n homeworkType: homeworkType,\n homeworkName: homeworkName,\n understanding: understanding,\n difficulty: difficulty,\n assignmentType: assignmentType});\n return Promise.resolve('Write complete');\n });\n }", "function onSaveClicked(){\n date=document.getElementById(\"datepicker\").value;\n time=document.getElementById(\"timepicker\").value;\n aType=document.getElementById(\"a_type\").value; \n doctor=document.getElementById(\"doctor\").value;\n\n\n var edited_appointment = ref.child(key)\n if(validation()){\n edited_appointment.child(\"Date\").set(date);\n edited_appointment.child(\"Time\").set(time);\n edited_appointment.child(\"Appointment_Type\").set(aType);\n edited_appointment.child(\"Doctor\").set(doctor);\n edited_appointment.child(\"Appointment_Status\").set(\"Not Approved\");\n\n closeEditForm();\n window.alert(\"Saved! Please wait for approval.\");\n window.location.reload();\n }\n \n}", "function saveManageBusinessFields() {\n // Save business details in local Storage\n var businessName = document.getElementById('businessName').value;\n if (businessName != null) {\n localStorage.setItem('businessName', businessName);\n }\n\n var businessPhone = document.getElementById('businessPhone').value;\n if (businessPhone != null) {\n localStorage.setItem('businessPhone', businessPhone);\n }\n\n var businessAddress = document.getElementById('set-address').value;\n if (businessAddress != null) {\n localStorage.setItem('businessAddress', businessAddress);\n }\n}", "function saveBookingInfo() {\n\n // Make sure all default values are set.\n EventFormData.bookingInfo = angular.extend({}, {\n url : '',\n urlLabel : 'Reserveer plaatsen',\n email : '',\n phone : '',\n availabilityStarts : EventFormData.bookingInfo.availabilityStarts,\n availabilityEnds : EventFormData.bookingInfo.availabilityEnds\n }, $scope.bookingModel);\n\n $scope.savingBookingInfo = true;\n $scope.bookingInfoError = false;\n\n var promise = eventCrud.updateBookingInfo(EventFormData);\n promise.then(function() {\n controller.eventFormSaved();\n $scope.bookingInfoCssClass = 'state-complete';\n $scope.savingBookingInfo = false;\n $scope.bookingInfoError = false;\n }, function() {\n $scope.savingBookingInfo = false;\n $scope.bookingInfoError = true;\n });\n }", "function handleSave() {\n console.log('in handleSave');\n const updatedList = {\n id: trip.id,\n location: title,\n start_date: date,\n days: days,\n }\n console.log('Updated trip info:', updatedList);\n //update list to reflect changes by triggering events stemmed from update list reducer\n dispatch({ type: 'UPDATE_LIST', payload: updatedList })\n //reset edit mode to false\n setEditMode(false)\n // history.push('/user')\n }", "function saveInformation () {\n\t\t numOfCreditFun();\n\t\t bestMthContFun();\n\t\t var info = {};\n\t\t \tinfo.major = [\"Major Choice:\", $('#departments').val()];\n\t\t info.cName = [\"Course Name:\", $('#courseName').val()];\n\t\t info.cSection = [\"Course Section:\", $('#courseSection').val()];\n\t\t info.topicAndSec = [\"Topic and Section:\", $('#topicAndSection').val()];\n\t\t info.todaysDate = [\"Today's Date:\", $('#todaysDate').val];\n\t\t info.dueDate = [\"Due Date:\", $('#dueDate').val()];\n\t\t info.weeksOfClass = [\"Is the Class on Campus or Online:\", $('#weeksOfClass').val()];\n\t\t info.slideValue = [\"Due Date:\", $('#weeksOfClass').val()];\n\t\t info.courseNumCredits = [\"Number of Credits:\", numOfCreditFun];\n\t\t info.teacherName = [\"Teacher Name:\", $('#teacherName').val()];\n\t\t info.teacherEmail = [\"Teacher Email:\", $('#teacherEmail').val()];\n\t\t info.teacherPhone = [\"Teacher Phone:\", $('#teacherPhone').val()];\n\t\t info.bestMthCont = [\"Best Method To Get In Contact:\", bestMthContFun];\n\t\t info.note = [\"Note Section:\", $('#noteSection').val()];\n\t\t //localStorage.setItem(id, JSON.stringify(info));\n\t\t couchDBSave(info);\n\t\t}", "function addLesson() {\n // Date\n var userDate = $(\".new-lesson-modal__date--input\").val();\n if ( userDate ) {\n // Attendance\n if ( document.getElementById('atYes').checked ) {\n var atVal = $('#atYes').val();\n } else {\n if ( document.getElementById('atNo').checked ) {\n var atVal = $('#atNo').val();\n } else {\n alert(\"please select an attendance\");\n }\n }\n } else {\n alert(\"Please enter correct date\");\n }\n\n // Notes\n var userNotes = $(\".new-lesson-modal__lesson-notes--input\").val();\n\n // creating the lesson\n var student = loadActiveStudent();\n var id = student.id;\n var i = 0;\n var loopFind = true;\n while (loopFind == true) {\n var lessonName = id + \"L\" + i;\n if (localStorage.getItem(lessonName) === null) {\n\n /* When it does not exist */\n var lesson = {\n date: userDate,\n attended: atVal,\n notes: userNotes\n };\n localStorage.setItem(lessonName, JSON.stringify(lesson));\n alert(\"Lesson created\");\n loopFind = false;\n location.reload();\n } else {\n /* When it exists */\n i++;\n }\n }\n}", "function saveDeliver() {\n\n var deliverDate = deliverCompletedDateSelector.val();\n var deliverUserBy = userName;\n var deliverTimestamp = firebase.database.ServerValue.TIMESTAMP;\n\n // Save it to the ticket\n ticketsRef\n .child(ticketDBID)\n .update({\n deliverCompleted: true,\n deliverUserBy: deliverUserBy,\n deliverDate: deliverDate,\n deliverTimestamp: deliverTimestamp\n })\n .then( // Save it on the customer's info\n customersRef\n .child(custDBID + '/tickets/' + ticketDBID)\n .update({\n deliverCompleted: true,\n deliverUserBy: deliverUserBy,\n deliverDate: deliverDate,\n deliverTimestamp: deliverTimestamp\n }))\n .then(function(){ // Show it as delivered\n deliverButtons.hide();\n deliverCompletedCheckboxSelector.prop('disabled', true);\n })\n }", "function save() {\r\n \t\t// get busy\r\n \t\tgetBusy();\r\n \t\t\r\n \t\t/****/\r\n \t\t\r\n \t\t\r\n \t\t/*****/\r\n \t\t\r\n \t\tangular.forEach(vm.examenes, function(examen, key) {\r\n \t\t\tif(examen.create) {\r\n \t\t\t\tcreate({\r\n\t\t\t\t\t\ttmp: {\r\n\t\t\t\t\t\t\tcodigoCausaExterna: vm.examenDetail.codigoCausaExterna,\r\n\t\t\t\t\t\t\tcodigoClaseServicio: vm.examenDetail.codigoClaseServicio,\r\n\t\t\t\t\t\t\tvalorCostoEps: '',\r\n\t\t\t\t\t\t\tvalorCuotaModeradora: ''\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t_embedded: {\r\n\t\t\t\t\t\t\texamenTipo:{\r\n\t\t\t\t\t\t\t\tid: examen.tipo,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tafiliado: {\r\n\t\t\t\t\t\t\t\tid: $stateParams.afiliadoId\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tmedico: vm.examenDetail.medico\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\texamen: {}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n \t\t\t}\r\n \t\t})\r\n\t\t\t$state.go('main.afiliado.edit.examen.list', {afiliadoId: $stateParams.afiliadoId});\r\n \t\t\r\n \t}", "saveContact() {\n const contact = this.getContact();\n if (contact.isNew() || contact.isDirty()) {\n contact.save();\n }\n }", "save(callback) {\n //console.log('DEBUG: Banner.save() this=', this);\n \n // Note: We are using this.name (e.g. tickets) instead of null for a new id from Firebase\n myFirebase.writeToFirebase(myFirebase.firebaseRef,\n 'banner',\n 'banner',\n this.toObj())\n .then((id) => {\n //Success\n callback(null, \"Banner Saved!\");\n }, (e) => {\n // Error\n callback(e);\n });\n }", "function _saveLocalRecord() {\n\n // get all vars (don't worry if they've been changed).\n var columnList = [];\n columnList.push({ column: \"playername\", value: firstname });\n columnList.push({ column: \"coachname\", value: coachname });\n columnList.push({ column: \"clubname\", value: clubname });\n columnList.push({ column: \"path\", value: path });\n columnList.push({ column: \"thumbnail\", value: thumbnail });\n columnList.push({ column: \"shottype\", value: viewModel.get(\"shotTypeIndex\") });\n columnList.push({ column: \"ratingtype\", value: viewModel.get(\"ratingTypeIndex\") });\n columnList.push({ column: \"playerid\", value: playerId });\n columnList.push({ column: \"coachid\", value: coachId });\n columnList.push({ column: \"clubid\", value: clubId });\n var dateCheck = viewModel.get(\"date\");\n var timeCheck = viewModel.get(\"time\");\n columnList.push({ column: \"date\", value: new Date(dateCheck + \" \" + timeCheck) });\n \n // build query. Add each item to the query procedurally\n var query = \"INSERT INTO \" + LocalSave._tableName + \" (\";\n var first = true;\n for (var i = 0; i < columnList.length; i++) {\n var item = columnList[i];\n if (!first) {\n query += \", \";\n }\n query += item.column;\n first = false;\n }\n query += \") VALUES (\";\n first = true;\n var valList = [];\n for (var i = 0; i < columnList.length; i++) {\n var item = columnList[i];\n if (!first) {\n query += \", \";\n }\n query += \"?\";\n first = false;\n valList.push(item.value);\n }\n query += \");\";\n\n // run query.\n var complete = new Promise(function (resolve, reject) {\n db.queryExec(query, valList,\n function (id) {\n console.log(\"Saved new shot with id \" + id);\n resolve(id);\n },\n function (err) {\n reject(err);\n });\n });\n\n // handle query after it has completed\n complete.then(\n function (val) {\n if (page.android) {\n var Toast = android.widget.Toast;\n Toast.makeText(application.android.context, \"New Shot Saved\", Toast.LENGTH_SHORT).show();\n }\n // leave page\n var navigationOptions = {\n moduleName: \"record-shot-page\",\n backstackVisible: false\n };\n frameModule.topmost().navigate(navigationOptions);\n },\n function (err) {\n _unlockFunctionality();\n });\n}", "function saveEvent() {\n $('.save-button').on('click', function() {\n var trId = $(this)\n .closest('tr')\n .attr('id');\n var textAreaVal = $(this)\n .closest('tr')\n .find('textarea')\n .val()\n .trim();\n\n storedSchedule = JSON.parse(localStorage.getItem(date));\n scheduleObj = {};\n\n scheduleObj[trId] = textAreaVal;\n scheduleArr.push(scheduleObj);\n localStorage.setItem(date, JSON.stringify(scheduleArr));\n\n for (var i = 0; i < storedSchedule.length; i++) {\n if (storedSchedule[i].hasOwnProperty(trId)) {\n storedSchedule[i][trId] = textAreaVal;\n scheduleArr = storedSchedule;\n localStorage.setItem(date, JSON.stringify(scheduleArr));\n return;\n }\n }\n });\n }", "function MCH_Save() {\n console.log(\" ----- MCH_Save ----\")\n\n mod_MCH_dict.show_err_msg = true;\n const enable_save_btn = MCH_Hide_Inputboxes();\n\n if (enable_save_btn){\n const data_dict = mod_MCH_dict.data_dict;\n console.log(\" data_dict\", data_dict)\n const usercompensation_pk = data_dict.uc_id;\n\n const new_uc_meetings = mod_MCH_dict.meeting_count;\n const new_uc_meetingdate1 = (el_MCH_meetingdate1.value) ? el_MCH_meetingdate1.value : null;\n const new_uc_meetingdate2 = (el_MCH_meetingdate2.value) ? el_MCH_meetingdate2.value : null;\n let data_has_changed = false;\n\n const upload_dict = {mode: \"update\",\n usercompensation_pk: usercompensation_pk};\n if (new_uc_meetings !== data_dict.uc_meetings){\n upload_dict.meetings = new_uc_meetings;\n data_has_changed = true;\n };\n if (new_uc_meetingdate1 !== data_dict.uc_meetingdate1){\n upload_dict.meetingdate1 = new_uc_meetingdate1;\n data_has_changed = true;\n };\n if (new_uc_meetingdate2 !== data_dict.uc_meetingdate2){\n upload_dict.meetingdate2 = new_uc_meetingdate2;\n data_has_changed = true;\n };\n if (data_has_changed){\n\n // --- create mod_dict\n const url_str = urls.url_usercompensation_upload;\n\n // --- upload changes\n UploadChanges(upload_dict, url_str);\n\n // --- hide modal\n $(\"#id_mod_comphours\").modal(\"hide\");\n\n };\n };\n }", "function saveBorrowing() {\n retrieveValues();\n saveToServer();\n}", "function savePartyDetails(partyDetails) {\n debugger;\n vm.partyFactory.saveData(partyDetails);\n }", "function saveGoal() {\n\tif($('#goal_team').val() == 0) {\n\t\talert(\"Please select a team.\");\n\t\treturn false;\n\t}\t\n\tif(!$('#goal_player').val()) {\n\t\talert(\"Please provide goal player number.\");\n\t\treturn false;\n\t}\n\tif($('#goal_period').val() == 0) {\n\t\talert(\"Please select a period.\");\n\t\treturn false;\n\t}\t\n\tif(!$('#goal_time_minute').val()) {\n\t\talert(\"Please provide goal minute.\");\n\t\treturn false;\n\t}\n\tif(!$('#goal_time_second').val()) {\n\t\talert(\"Please provide goal second.\");\n\t\treturn false;\n\t}\t\n\tif(isNaN($('#goal_player').val()) || $('#goal_player').val() < 0 ) {\n\t\talert(\"Invalid player number.\");\n\t\treturn false;\n\t}\t\n\tif(isNaN($('#goal_time_minute').val()) || $('#goal_time_minute').val() < 0 || $('#goal_time_minute').val() > 59 ) {\n\t\talert(\"Invalid goal minute.\");\n\t\treturn false;\n\t}\t\t\n\tif(isNaN($('#goal_time_second').val()) || $('#goal_time_second').val() < 0 || $('#goal_time_second').val() > 59 ) {\n\t\talert(\"Invalid goal second.\");\n\t\treturn false;\n\t}\t\t\n\tvar postVars = $('#event_id, #goals :input:not(:checkbox), #goals :input:checkbox:checked').serialize();\n\t$.post('/services/eventgoals/create', postVars,\n\t\tfunction(response) {\n\t\t\tif(response.error) {\n\t\t\t\t$(\"#goals\").after(\"<tr><td colspan=6>Error occured while saving goal: \" + response.error + \"</td></tr>\");\n\t\t\t} else {\n\t\t\t\t$(\"#goals\").after(\"<tr id='goal_object_\" + response.object_id + \"'><td>\" + response.team + \"</td><td>\" +\n\t\t\t\t\tresponse.player + \"</td><td>\" + formatPeriod(response.period) + \n\t\t\t\t\t\"</td><td>\" + response.time_minute + \":\" + response.time_second + \"</td>\" +\n\t\t\t\t\t\"<td><input type='button' name='edit_goal' id='edit_goal' value='Edit' onClick='editGoal(\" + response.object_id + \")'/> \" +\n\t\t\t\t\t\"<input type='button' name='delete_goal' id='delete_goal' value='Delete' onClick='deleteGoal(\" + response.object_id + \")'/></td></tr>\");\n\t\t\t\t$('#goal_team').val(0);\n\t\t\t\t$('#goal_player').val(null);\n\t\t\t\t$('#goal_period').val(0);\n\t\t\t\t$('#goal_time_minute').val(null);\n\t\t\t\t$('#goal_time_second').val(null);\n\t\t\t}\n\t\t}, \"json\"\n\t);\n\treturn false;\n} // saveGoal()", "function SaveBot(event) {\r\n event.preventDefault();\r\n var localData = JSON.parse(localStorage.getItem('formData')) || [];\r\n var companyName = document.forms.OrderList.companyName.value;\r\n var companyPhone = document.forms.OrderList.companyPhone.value;\r\n var botName = document.forms.OrderList.botName.value;\r\n var botWebsite = document.forms.OrderList.botWebsite.value;\r\n var botTimeZone = document.forms.OrderList.botTimeZone.value;\r\n var deliveryDate = document.forms.OrderList.deliveryDate.value;\r\n var leadDeliveryEmail = [];\r\n var emails = document.querySelectorAll('.email-ids');\r\n emails.forEach(function(mail) {\r\n leadDeliveryEmail.push(mail.innerText.trim());\r\n });\r\n var sendSMS = document.forms.OrderList.sendSMS.value;\r\n var bilingual = document.forms.OrderList.bilingual.value;\r\n var billingName = document.forms.OrderList.billingName.value;\r\n var billingPhone = document.forms.OrderList.billingPhone.value;\r\n var billingAddress = document.forms.OrderList.billingAddress.value;\r\n var billingEmail = document.forms.OrderList.billingEmail.value;\r\n var data = {\r\n companyName: companyName,\r\n companyPhone: companyPhone,\r\n botName: botName,\r\n botWebsite: botWebsite,\r\n botTimeZone: botTimeZone,\r\n deliveryDate: deliveryDate,\r\n leadDeliveryEmail: leadDeliveryEmail,\r\n sendSMS: sendSMS,\r\n bilingual: bilingual,\r\n billingName: billingName,\r\n billingPhone: billingPhone,\r\n billingAddress: billingAddress,\r\n billingEmail: billingEmail\r\n }\r\n localData.push(data);\r\n localStorage.setItem('formData', JSON.stringify(localData));\r\n $('input').val('').blur();\r\n $('.email-ids').remove();\r\n localStorage.removeItem('formDraft');\r\n $('html, body').animate({\r\n scrollTop: $('#addBot').offset().top + 80\r\n }, 500);\r\n doShowAll();\r\n}", "function saveDetails(){\n let board_id = getUrlID();\n get('updateBoard', {board_id: board_id, board_name: $('#board-name').val(), board_desc: $('#board-desc').val()}).then((data) => {\n let name = data.board_name;\n let desc = data.board_desc;\n $('#board-name').val(name);\n $('#board-desc').val(desc);\n let boardData = getBoardData(board_id);\n boardData.name = name;\n boardData.desc = desc;\n saveBoardData(board_id, boardData);\n })\n}", "function saveReference() {\n const parsedURL = parseURL(window.location.pathname);\n let patientId = parsedURL.patientId;\n let exerciseId = parsedURL.exerciseId;\n parseURL(window.location.pathname);\n const redirectToUrl = 'userexercise/setting/' + exerciseId +'/' + patientId;\n\n let values = {};\n // save to referenceExercise\n values.bodyFrames = refFrames_compressed;\n let mm = getMinMax_joint(dataForCntReps.joint, refFrames, dataForCntReps.axis);\n values.refMin = mm.min;\n values.refMax = mm.max;\n values.neck2spineBase = refFrames[0].joints[0][\"depthY\"] - refFrames[0].joints[2][\"depthY\"];\n values.shoulder2shoulder = refFrames[0].joints[8][\"depthX\"] - refFrames[0].joints[4][\"depthX\"];\n let ed = localStorage.getItem(\"refEnd\");\n let st = localStorage.getItem(\"refStart\");\n localStorage.removeItem(\"refEnd\");\n localStorage.removeItem(\"refStart\");\n values.refTime = Math.round((ed - st) / 1000);\n console.log(values.refTime);\n // save also to dataForCntReps\n dataForCntReps.refTime = values.refTime;\n dataForCntReps.bodyHeight = values.neck2spineBase;\n dataForCntReps.bodyWidth = values.shoulder2shoulder;\n dataForCntReps.jointNeck = refFrames[0].joints[2];\n\n $.ajax({\n type: 'PUT',\n url: 'api/userexercise/reference/mostrecent/data/' + exerciseId + '/' + patientId,\n data: values,\n success: function (result) {\n window.location = redirectToUrl\n },\n error: function (result) {\n errorAlert(result.responseJSON.message);\n }\n });\n}", "function saveAbsenceExcuse() {\nactiveDataSet = studentList.find( arr => arr.absenceId == activeElement ); \nexcusein = document.getElementById(\"excusein\").value;\ncomment = document.getElementById(\"excusecomment\").value;\n//date = excusein.split('.');\nexcuseindate = formatDateDash(excusein);//date[2] + '-' + date[1] + '-' +date [0];\t\n//console.log(\"send to ?type=excuse&console&aid=\" + activeDataSet['absenceId'] + \"&date=\" + excuseindate + \"&comment=\" + comment);\n\n$.post(\"\", {\n\t\t\t\t'type': 'excuse',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': activeDataSet['absenceId'],\n\t\t\t\t'date': excuseindate,\n\t\t\t\t'comment': comment\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}", "function saveData(){\n \n plan = $(`[data-time=\"${event.target.dataset.time}\"]`).val();\n\n timeBlock = $(this).attr(\"data-time\");\n\n var plannerData = JSON.parse(localStorage.getItem(\"plannerDataKey\"));\n\n for(i=0;i<plannerData.length;i++)\n {\n if(plannerData[i].time == timeBlock)\n {\n plannerData[i].currentPlan = plan;\n }\n \n }\n \n localStorage.setItem(\"plannerDataKey\", JSON.stringify(plannerData));\n}", "function saveContact() {\n $.ajax({\n url: apiUrl+anime._id+\"/\",\n type: 'PUT',\n dataType: 'JSON',\n data: anime,\n success: function (data) {\n if (data) {\n window.location.href = \"./index.html\";\n } else {\n console.log(\"Could not update the anime\");\n }\n },\n error: function (request, status, error) {\n console.log(error, status, request);\n },\n complete: function(){return;}\n });\n return;\n }", "function handleSave(event) {\n event.preventDefault();\n setSaving(true);\n if (addOrEditContactType === messages.Add) onAddContact(addOrEditContact);\n else onUpdateContact(addOrEditContact);\n history.push('/contact-list');\n const contact = { ...addOrEditContact };\n const name = `${contact.firstname} ${contact.lastname}`;\n toast.success(`${messages.toastcontact} ${name} ${messages.toastsaved}`);\n }", "function saveLastVisit(book, chapter){\n refDb.get('ref_history').then(function(doc){\n doc.visit_history = [{\"book\": $('#book-chapter-btn').text(), \"chapter\": chapter, \"bookId\": book}]\n refDb.put(doc).then(function(response) {\n }).catch(function(err) {\n console.log(err);\n }); \n });\n}", "function saveEdit(num) {\n console.log(\"this is the number: \" + num)\n editReminderText = document.getElementById(\"editReminderText\");\n console.log(editReminderText.value);\n logReports = JSON.parse(dailyReport);\n logReports[num].notes = editReminderText.value;\n dailyReport = JSON.stringify(logReports);\n localStorage.setItem(\"dailyReport\", dailyReport);\n if (localStorage.getItem(\"langSelect\") === \"english\") {\n message = \"report log edited successfully!\";\n } else {\n message = '!הדו\"ח נערך בהצלחה';\n }\n $(\"#reportsModal\").modal('hide');\n if (localStorage.getItem(\"langSelect\") === \"english\") {\n setTimeout(function () { document.getElementById(\"viewReportsLog\").click(); }, 500);\n } else {\n setTimeout(function () { document.getElementById(\"viewReportsLogHeb\").click(); }, 500);\n }\n setTimeout(function () { alertToast('success', message) }, 500);\n return;\n}", "function saveRecord(offLineItem) {\n // Create a transaction on the database \"pending\"\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n // set the store\n const store = transaction.objectStore(\"pending\");\n // add the offLineItem to the store\n store.add(offLineItem);\n}", "function save_goals() {\n\tvar ltg = new Array();\n\tvar itg = new Array();\n\tvar stg = new Array();\n\tvar p = new Array();\n\t\n\t\n\tvar today = new Date();\n\tvar dd = today.getDate();\n\tvar mm = today.getMonth() + 1;\n\tvar yyyy = today.getFullYear();\n\tif (dd < 10)\n\t\tdd = \"0\" + dd;\n\tif (mm < 10)\n\t\tmm = \"0\" + mm;\n\tvar todayFormatted = yyyy + \"/\" + mm + \"/\" + dd;\n\t\n\tltg.push(document.getElementById(\"ltgPhysical\").value);\n\tltg.push(document.getElementById(\"ltgMental\").value);\n\tltg.push(document.getElementById(\"ltgEconomical\").value);\n\tltg.push(document.getElementById(\"ltgSocial\").value);\n\tltg.push(document.getElementById(\"ltgSpiritual\").value);\n\t\n\titg.push(document.getElementById(\"itgPhysical\").value);\n\titg.push(document.getElementById(\"itgMental\").value);\n\titg.push(document.getElementById(\"itgEconomical\").value);\n\titg.push(document.getElementById(\"itgSocial\").value);\n\titg.push(document.getElementById(\"itgSpiritual\").value);\n\n\tstg.push(document.getElementById(\"stgPhysical\").value);\n\tstg.push(document.getElementById(\"stgMental\").value);\n\tstg.push(document.getElementById(\"stgEconomical\").value);\n\tstg.push(document.getElementById(\"stgSocial\").value);\n\tstg.push(document.getElementById(\"stgSpiritual\").value);\n\t\n\tp.push(document.getElementById(\"planPhysical\").value);\n\tp.push(document.getElementById(\"planMental\").value);\n\tp.push(document.getElementById(\"planEconomical\").value);\n\tp.push(document.getElementById(\"planSocial\").value);\n\tp.push(document.getElementById(\"planSpiritual\").value);\n\t\n\tdocument.getElementById(\"lastUpdateText\").textContent = \"Last Update: \" + todayFormatted;\n\t\n\tconsole.log(ltg);\n\tconsole.log(itg);\n\tconsole.log(stg);\n\tconsole.log(p);\n\t\n\tchrome.storage.sync.set({\n\t\tlastGoalUpdate: todayFormatted,\n\t\tlastGoalPageViewTime: today.getTime(),\n\t\tlongTermGoals: ltg,\n\t\tintermediateTermGoals: itg,\n\t\tshortTermGoals: stg,\n\t\tplans: p\n\t}, function() {});\n}", "function saveEventDesc(event) {\n let clickedSave = event.target;\n let rowEventId = $(clickedSave).prev().attr('id');\n eventDescText = $(`#${rowEventId} textarea`).val()\n //check if the user enterd an event for the save button clicked\n if (eventDescText) {\n evntDescProp = rowEventId\n if (!dailyEvents) {\n dailyEvents = {}\n }\n dailyEvents[evntDescProp] = eventDescText\n localStorage.setItem(plannerDate.text(), JSON.stringify(dailyEvents));\n alert(\"Changes have been saved.\")\n }\n else {\n //if no data enterd for the event for the save button clicked, alert the user they clicked the wrong save\n alert(\"Please enter an event descrption before clicking SAVE.\")\n }\n}", "function saveActivity() {\n var deferred = $q.defer();\n // create activity json object\n var activity = {};\n _.each(stateConfig.tools.editor.activity.fields, function (field, key) {\n switch (field.datatype) {\n case \"string\":\n activity[key] = service.activity[key];\n break;\n case \"date\":\n activity[key] = utilService.formatShortDate(service.activity[key]);\n break;\n default:\n activity[key] = service.activity[key];\n break;\n }\n });\n // get data group id for new record\n var data_group_id = null;\n if (service.activity.id === null) {\n // TO DO: assumes only one data group, expand to include multiple data groups\n data_group_id = stateConfig.tools.editor.datagroups[0].data_group_id;\n }\n var options = {\n instance_id: pmt.instance,\n user_id: $rootScope.currentUser.user.id,\n activity_id: service.activity.id,\n data_group_id: data_group_id,\n key_value_data: activity,\n delete_record: false,\n pmtId: pmt.id[pmt.env]\n };\n var header = {\n headers: { Authorization: 'Bearer ' + $rootScope.currentUser.token }\n };\n // call the api\n $http.post(pmt.api[pmt.env] + 'pmt_edit_activity', options, header).success(function (data, status, headers, config) {\n var response = data[0].response;\n // if an id & message of success returned, resolve\n if (response.message === 'Success') {\n deferred.resolve(response.id);\n }\n // error occurred on database side, reject with database message\n else {\n service.activity.errors.push({ \"record\": \"activity\", \"id\": response.id, \"message\": response.message });\n deferred.reject(response.message);\n }\n }).error(function (data, status, headers, c) {\n service.activity.errors.push({ \"record\": \"activity\", \"id\": service.activity.id, \"message\": status });\n deferred.reject(status);\n });\n return deferred.promise;\n }", "function saveAbsence(id){\nactiveElementDiv = 'p' + activeElement;\nsickend = formatDateDash(document.getElementById(\"sickend\").value);\nsickstart = formatDateDash(document.getElementById(\"sickstart\").value);\ncomment = document.getElementById(\"comment\").value;\nif (null != addToAbsence) {\n//console.log(\"send to ?type=addtoabsence&console&aid=\"+addToAbsence+\"&end=\"+sickend);\n$.post(\"\", {\n\t\t\t\t'type': 'addtoabsence',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': addToAbsence,\n\t\t\t\t'end': sickend\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\t\n} else {\n//console.log(\"send to ?type=markabsent&console&id=\"+activeElement+\"&start=\"+sickstart+\"&end=\"+sickend+\"&comment=\"+comment);\n//xhttp.open(\"POST\", \"?type=markabsent&console&id=\"+activeElement+\"&start=\"+sickstart+\"&end=\"+sickend+\"&comment=\"+comment, true);\n$.post(\"\", {\n\t\t\t\t'type': 'markabsent',\n\t\t\t\t'console': '',\n\t\t\t\t'id': activeElement,\n\t\t\t\t'start': sickstart,\n\t\t\t\t'end': sickend,\n\t\t\t\t'comment': comment\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}\n\n\n}", "function saveInfo() {\n\n let textarea = $(this).siblings(\"textarea\");\n let textAreaValue = textarea.val();\n let timeSlot = textarea.attr(\"time\");\n\n if(textAreaValue === \"\" && schedule[timeSlot]){\n //Remove key value pair from schedule if textArea is blank\n delete schedule[timeSlot];\n } else if (textAreaValue !== \"\"){\n schedule[timeSlot] = textAreaValue;\n }\n localStorage.setItem(\"schedule\", JSON.stringify(schedule));\n}", "function saveNewEntry() {\n\n// get information from the inputs and make date\n var role = document.getElementById('role').value;\n var champion = document.getElementById('champion').value;\n var wl = document.getElementById('wl').checked ? true : false;\n var notes = document.getElementById('notes').value;\n var d = new Date();\n var datestring = (d.getMonth()+1) + \"/\" + d.getDate();\n\n \n // save(post) information to DB\n fetch('/save', {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n }, \n body: JSON.stringify({\n date: datestring,\n role,\n champion,\n wl,\n notes\n })\n })\n // append information\n .then(getDataAndRenderLogEntries())\n .catch(function(err) { console.log(err) });\n \n}", "function save() {\n $scope.broadcastFromRoot(addPageCtrl.constants.CC_PAGE_ADDED, { page: addPageCtrl.page });\n closeDialog();\n }", "function saveTrip() {\n\tvar vacationNotes = $(\"#myNotes\").val();\n\tvar fromVal = $(\"#from_date\").val();\n\tvar toVal = $(\"#to_date\").val();\n\tvar activityList = getActivityList();\n\tvar guestList = getGuestList();\n\n\t// validate from date\n\tif (!fromVal || !Date.parse(fromVal)) {\n\t\tshowModal(\"Missing values\", \"Enter a valid from date\");\n\t\treturn;\n\t}\n\n\t// validate to date\n\tif (!toVal || !Date.parse(toVal)) {\n\t\tshowModal(\"Missing values\", \"Enter a valid to date\");\n\t\treturn;\n\t}\n\n\t// validate dates range\n\tif (Date.parse(fromVal) > Date.parse(toVal)) {\n\t\tshowModal(\"Invalid Dates\", \"From date must be before To date\");\n\t\treturn;\n\t}\n\n\t// validate guests list\n\tif (guestList.length == 0) {\n\t\tshowModal(\"Missing Values\", \"Enter at least one guest\");\n\t\treturn;\n\t}\n\n\tvar plan = {\n\t\tid: new Date().getTime(),\n\t\tactivities: activityList,\n\t\tdate: {\n\t\t\tfrom: fromVal,\n\t\t\tto: toVal,\n\t\t},\n\t\tguests: guestList,\n\t\tnotes: vacationNotes,\n\t\tphoto: photoSrc,\n\t\tcity: activeCity,\n\t};\n\n\t// clean the data\n\t$(\"#myNotes\").val(\"\");\n\t$(\"#from_date\").val(\"\");\n\t$(\"#to_date\").val(\"\");\n\t$(\"#activity-list\").empty();\n\t$(\"#guest-list\").empty();\n\n\t//when the user click save trip after edit plan vacation\n\tvar planId = $(\"#save-trip\").attr(\"data-plan-id\");\n\n\tif (planId) updatePlan(plan, planId);\n\telse vacationPlans.push(plan);\n\n\tlocalStorage.setItem(\"vacationPlans\", JSON.stringify(vacationPlans));\n\tgoTravelPlans();\n}", "function saveChange() {\n let theTitle = document.getElementById('editTitle').value;\n let theSumm = document.getElementById('editSummary').value;\n\n if (theTitle == null || theTitle == '') {\n alert(\"Title Cannot be Empty\");\n document.getElementById('addTitle').value = \"\";\n document.getElementById('addSummary').value = \"\";\n } else if ( theSumm == null || theSumm == '') {\n alert(\"Summary Cannot be Empty\");\n document.getElementById('addTitle').value = \"\";\n document.getElementById('addSummary').value = \"\";\n } else {\n theTitle = DOMPurify.sanitize( theTitle );\n theSumm = DOMPurify.sanitize( theSumm );\n let strL = username.split(\"+\");\n datebase.collection(\"blog\").doc(docId).update({\n title: theTitle,\n summary: theSumm,\n date: new Date(),\n author: strL[0],\n email: strL[1],\n uid: strL[2] \n }).then(()=>{\n console.log(\"EDITED A BLOG\");\n showAllBlogs();\n closeEdit();\n }).catch((err) => {\n console.log(\"ERROR EDITING BLOG\");\n });\n }\n }", "function save() {\n vm.donateModel.post().then(function () {\n Materialize.toast('Animal cadastrado com sucesso.', 3000);\n $location.path('/core/animals');\n });\n }", "saveRecord( timelineItem ) {\n\n\t\t\tconsole.log( \"API Post: \" + this.state.config.content_api + \" Payload: \" + this.printItem(timelineItem) );\n\t\t\t\n\t\t\t// NEW/EDIT RECORD\n\t\t\taxios.post( this.state.config.content_api, {\n\t\t\t\titem: timelineItem,\n\t\t\t\tcontentType: 'application/json'\n\t\t\t})\n\t\t\t.then((result) => {\n\t\t\t\t\n\t\t\t\t// get identifier\n\t\t\t\tvar savedEvent = ( this.state.vizStyle == \"Scrapbook\" ? \"\" : result.data.title );\n\t\t \n\t\t\t\tconsole.log( \"successfully saved event \" + savedEvent );\t \n\t\t\t\t\n\t\t\t\t// @TODO - nice if we could take user to this timeline item on main page\n\t\t\t\t//\t\t\t\n\t\t\t\tthis.setState({\n\t\t\t\t\tuploadMessage: \"Successfully saved \" + savedEvent,\t\t\t\t\n\t\t\t\t\tsaveStatus: 0\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\twindow.timelineComponent.updateItem( timelineItem );\n\t\t\t\tthis.clearAndExit(this)\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tconsole.log(err);\n\t\t\t\t\n\t\t\t\tthis.setState({\n\t\t\t\t\tuploadMessage: \"Doh. Failed to save.\",\t\t\t\t\n\t\t\t\t\tsaveStatus: 0\n\t\t\t\t});\n\t\t\t\t\n\t\t\t});\t\t\t\t\t\t\n\t}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.createDefaultFields(this.data.creator);\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.showGridView();\n\t\t// LiveUpdater.refresh(); // decided to remove this for now\n\t}", "function saveCharacter() {\n // Update the model\n console.log(vm.characterData);\n vm.characterData.class = vm.class;\n vm.characterData.createdby = userId;\n vm.characterData.advancements = vm.characterData.advancements.join(',');\n vm.characterData.moves = vm.characterData.moves.join(',');\n vm.characterData.cyberware = vm.characterData.cyberware.join(',');\n vm.characterData.links = JSON.stringify(vm.characterData.links);\n\n // New / Create\n if (typeof vm.characterData.id === 'undefined') {\n SprawlCharacterService.Create(vm.characterData).then(function (data) {\n loadDude('{\"id\":' + data + '}');\n });\n } else {\n // Update\n SprawlCharacterService.Update(vm.characterData).then(function (data) {\n console.log(data);\n // reload the dude to reset arrays/objects\n loadDude('{\"id\":' + vm.characterData.id + '}');\n });\n }\n }", "function saveloa(){\nactiveElementDiv = 'p' + activeElement;\nsickend = formatDateDash(document.getElementById(\"loaend\").value);\nsickstart = formatDateDash(document.getElementById(\"loastart\").value);\ncomment = document.getElementById(\"loacomment\").value;\n//console.log(\"send to ?type=leaveofabsence&console&id=\"+activeElement+\"&start=\"+sickstart+\"&end=\"+sickend+\"&comment=\"+comment);\nxhttp.open(\"POST\", \"?type=leaveofabsence&console&id=\"+activeElement+\"&start=\"+sickstart+\"&end=\"+sickend+\"&comment=\"+comment, true);\nxhttp.send();\n\n}", "function handleSaveAppointment() {\n // console.log(\"save button click\");\n // console.log(\"appointment choice\", appointmentChoice);\n // console.log(\"userId \", userId);\n\n API.setAppt(appointmentChoice, userId)\n .then((resp) => console.log(resp))\n .then(setModalIsOpen(false))\n .catch((err) => console.log(err));\n }", "function saveRecording() {\n\tvar newTrackName = document.getElementById(\"newTrackNameInput\").value;\n\tvar newTrack = new Track(newTrackName, strokeRecording.strokeList);\n\tconsole.log(\"New track added: \" + printTrack(newTrack));\n\taddTrack(newTrack);\n\tdeleteRecording();\n}", "function saveLocalStore(){\n for(i = 0; i < generalInfo.length; i++){\n var displayNow = ($(\"#inputEvent\"+generalInfo[i].display).val());\n var notesNow = generalInfo[i].notes;\n generalInfo[i].notes = displayNow;\n console.log(\"grabo vacio\");\n\n }\n localStorage.setItem(\"generalInfo\", JSON.stringify(generalInfo));\n }", "function saveAboutMe(id) {\n endEditAboutMe();\n\n if ($edit_about_me.val() != \"\") {\n var values = {};\n values.about_me = $edit_about_me.val();\n\n ajaxSend('/profile/', 'POST', values, function () {\n $about_me.text($edit_about_me.val()).expander();\n });\n }\n }", "save() {\n }", "function handleSaveToDB_midterm(agent) {\n console.log('midterm intent works');\n return db.runTransaction(t => {\n t.set(dialogflowAgentRef, {\n date: date,\n classType: classType,\n hoursSpent: hoursSpent,\n professorName: professorName,\n midtermScore: midtermScore,\n prepared: prepared,\n midLecturePrep: midLecturePrep,\n midHomeworkPrep: midHomeworkPrep,\n midQuizPrep: midQuizPrep,\n midtermHours: midtermHours,\n yourMidtermScore: yourMidtermScore,\n additionalInfo: additionalInfo,\n assignmentType: assignmentType});\n return Promise.resolve('Write complete');\n });\n }", "function handleSaveToDB_quiz(agent) {\n //agent.add('Welcome to quiz intent!');\n console.log('quiz intent works');\n return db.runTransaction(t => {\n t.set(dialogflowAgentRef, {\n date: date,\n classType: classType,\n hoursSpent: hoursSpent,\n professorName: professorName,\n quizScore: quizScore,\n lecturePrep: lecturePrep,\n homeworkPrep: homeworkPrep,\n assignmentType: assignmentType,\n improvement: improvement});\n return Promise.resolve('Write complete');\n });\n }", "function updateSaveData() {\n if (currentMode == \"event\") {\n let saveData = missionData.Completed.Remaining.map(m => m.Id).join(',');\n setLocal(\"event\", \"Completed\", saveData);\n setLocal(\"event\", \"Id\", EVENT_ID);\n setLocal(\"event\", \"Version\", EVENT_VERSION);\n } else {\n \n // Motherland\n let curRankCompletedIds = missionData.Completed.Remaining.map(m => m.Id);\n let saveData = [...curRankCompletedIds, ...missionData.OtherRankMissionIds].join(',');\n setLocal(\"main\", \"Completed\", saveData);\n }\n \n setLocal(currentMode, \"CompletionTimes\", JSON.stringify(missionCompletionTimes));\n}", "function save(){\n\t\tvar y =$(this).attr(\"id\");\n\t\tvar g= JSON.stringify(y);\n\t\tlocalStorage.setItem(y, $(this).val()); // localStorage.setItem(\"lastname\", \"Smith\"); localStorage.getItem(\"lastname\");\n\t}", "function saveRecord(record) {\n const transaction = db.transaction(['new_transaction'], 'readwrite');\n const budgetTrackerObjectStore = transaction.objectStore('new_transaction');\n budgetTrackerObjectStore.add(record);\n}", "save() {\n this._requireSave = true;\n }", "function saveDate() {\n localStorage.getItem(currentDayId), JSON.stringify(workday);\n }", "function saveProfile(email, name, password, weight, height,gender,planName,bicepWorkout,tricepWorkout,chestWorkout,lBackWorkout,uBackWorkout,shoulderWorkout,trapWorkout,coreWorkout){\n var newProgramRef = programRef.push();\n newProgramRef.set({\n email: email,\n name: name,\n password: password,\n weight: weight,\n height: height,\n gender: gender,\n planName: planName,\n bicepWorkout: bicepWorkout,\n tricepWorkout: tricepWorkout,\n chestWorkout: chestWorkout,\n lBackWorkout: lBackWorkout,\n uBackWorkout: uBackWorkout,\n shoulderWorkout: shoulderWorkout,\n trapWorkout: trapWorkout,\n coreWorkout: coreWorkout\n });\n}", "function save(newFuelEntry) {\n //must add date\n newFuelEntry.date = new Date().getTime();\n var deferr = $q.defer();\n $http.post(mongoLab.baseUrl + 'fuel?' + mongoLab.keyParam, newFuelEntry).success(function(fuelEntry){ \n deferr.resolve(fuelEntry);\n }).error(function(err){\n alert(err); \n });\n return deferr.promise;\n }", "function saveAdate(indexDoc) {\n let first_name = document.getElementById(\"first_name\").value;\n let last_name = document.getElementById(\"last_name\").value;\n let telefonr = document.getElementById(\"telefonnumber\".value);\n myObjectContactFormular = {\n 'first_name': first_name,\n 'last_name': last_name,\n 'telefon_number': telefonr,\n }\n docsListFormulars.push(myObjectContactFormular);\n showTheFixedAppointment(indexDoc);\n}", "function saveRecord(record) {\n const transaction = db.transaction(['new_funds'], 'readwrite');\n\n const fundsObjectStore = transaction.objectStore('new_funds');\n\n fundsObjectStore.add(record);\n\n showModal(false);\n}", "function save() {\n\n // stops the loop so that it will not automatically get more updates\n stop_loop();\n loading();\n\n // display deployments again so that it disables Save button and site buttons at the same time\n saving = true;\n document.getElementById(\"save\").disabled = true;\n console.log(\"saving...\");\n obj.init = \"False\";\n display_deployments();\n\n dep = {};\n dep['new_deployments'] = new_deployments;\n DATA['deployments'] = dep;\n api.request(\"update\", \"deployments\");\n\n}", "function save(empreend){\n let new_empreend = new Empreend(empreend);\n console.log(new_empreend)\n return new_empreend.save();\n}", "function ep_Save() {\n\tvar bankAccount = nlapiGetFieldValue('custpage_2663_bank_account');\n\tvar batchId = nlapiGetFieldValue('custpage_2663_batchid');\n\tif (bankAccount && batchId) {\n\t\tif (!document.forms['main_form'].onsubmit || document.forms['main_form'].onsubmit()) {\n\t\t\tupsertBatch(bankAccount, batchId);\n\t\t\t\n\t\t\t// set the refresh flag\n\t\t nlapiSetFieldValue('custpage_2663_refresh_page', 'T', false);\n\n // set to view mode\n nlapiSetFieldValue('custpage_2663_edit_mode', 'F', false);\n \n\t\t // suppress the alert\n\t\t setWindowChanged(window, false);\n\t\t \n\t\t // submit the form -- calls submitForm function\n\t\t document.forms.main_form.submit();\n\t\t}\n\t}\n}", "function saveRecord() {\n\n var finalP = finalPrice.toString();\n var op = parseFloat(enteredPrice);\n \n setRecord((record) => [...record, enteredPrice]);\n setRecord((record) => [...record, discount]);\n setRecord((record) => [...record, finalP]);\n setIndex(index + 1);\n //setDisplay();\n }", "function saveEvent(event) {\n event.preventDefault();\n\n let sText9AM = document.querySelector(\"#sText9AM\");\n let sText10AM = document.querySelector(\"#sText10AM\");\n let sText11AM = document.querySelector(\"#sText11AM\");\n let sText12PM = document.querySelector(\"#sText12PM\");\n let sText1PM = document.querySelector(\"#sText1PM\");\n let sText2PM = document.querySelector(\"#sText2PM\");\n let sText3PM = document.querySelector(\"#sText3PM\");\n let sText4PM = document.querySelector(\"#sText4PM\");\n let sText5PM = document.querySelector(\"#sText5PM\");\n\n //let scheduleText = $('textarea[id=\"sTExt9AM\"]').val();\n let scheduleText = {\n sText9AM: sText9AM.value.trim(),\n sText10AM: sText10AM.value.trim(),\n sText11AM: sText11AM.value.trim(),\n sText12PM: sText12PM.value.trim(),\n sText1PM: sText1PM.value.trim(),\n sText2PM: sText2PM.value.trim(),\n sText3PM: sText3PM.value.trim(),\n sText4PM: sText4PM.value.trim(),\n sText5PM: sText5PM.value.trim()\n }\n\n console.log(scheduleText);\n localStorage.setItem(\"scheduleText\", JSON.stringify(scheduleText));\n}", "function saveContactInfo(email, comment, description, date) {\r\n let newContactInfo = contactInfo.push();\r\n\r\n newContactInfo.set({\r\n email: email,\r\n comment: comment,\r\n description: description,\r\n date: date\r\n });\r\n}", "function save_object_in_db(that, marker){\n marker_not_saved = false;\n // Create new Parking Object\n route_in_editing.values.parking.push({\n \"name\": that.elements[\"name\"].value,\n \"type\": that.elements[\"type\"].value,\n \"coords\": {\n \"x\": contextmenu_latlng.lat,\n \"y\": contextmenu_latlng.lng\n },\n \"capacity\":that.elements[\"capacity\"].value,\n \"price\": that.elements[\"price\"].value,\n \"description\": that.elements[\"description\"].value,\n \"picture\": that.elements[\"picture\"].value\n });\n // Save updated Routes in DB\n save_stage_in_db(route_in_editing, 'POST', '/api/' + route_in_editing.id);\n\n // Set marker to appropiate Icon\n if (that.elements[\"type\"].value === \"Parking\") {\n marker.setIcon(L.icon({iconUrl: '/images/Parking_icon.svg',iconSize: [20, 20]}));\n } else if (that.elements[\"type\"].value === \"Stands\"){\n marker.setIcon(L.icon({iconUrl: '/images/Stands.png',iconSize: [20, 20]}));\n } else {\n marker.setIcon(L.icon({iconUrl: '/images/information.png',iconSize: [20, 20]}));\n }\n // Replace Form Popup with Info Popup\n map.closePopup();\n marker.bindPopup(popup_template(that.elements[\"name\"].value,route_in_editing.values.name, that.elements[\"type\"].value)).openPopup();\n // Refresh Item List\n search_items();\n}", "function save() {\n file.writeFile(\n \"/home/admin1/Documents/javascript/OOPs_Programs/JSON_files/adressBook.json\",\n JSON.stringify(this.addressBookData),\n \"utf-8\",\n function (err) {\n if (err) throw err;\n console.log(\"File Saved!!\");\n }\n );\n }", "saveNewQualification() {\n\t\tif (this.newQualification.description !== \"\" && this.newQualification.description !== null) {\n\t\t\tthis.PersonalDependenciesService.createQualification(this.newQualification).then((response) => {\n\t\t\t\tthis.qualificationList.push(response.data);\n\t\t\t\tthis.cancelNewQualification();\n\t\t\t\talertify.success(\"Сохранено\", 5);\n\t\t\t});\n\t\t} else {\n\t\t\talertify.error(\"Квалификация не заполнена\", 5);\n\t\t}\n\t}", "function handleSaveButton() {\n $(\".main-area\").on(\"submit\", \"#js-edit-form\", function(e) {\n console.log(\"Save button clicked\");\n // stop from form submitting\n e.preventDefault();\n // create variable that holds title value\n let title = $(\"#journal-title\").val();\n // create variable that holds date value\n let travelDate = $(\"#travel-date\").val();\n // create variable that hold image value\n let coverPhoto = $(\"#main-image\").val();\n // if this (main-area) data method entry id equal undefined (meaning nothing inputted) is true\n if ($(this).data(\"entryid\") === undefined) {\n // call create entyr function with title, date and photo as parameter\n createEntry(title, travelDate, coverPhoto);\n } else {\n const id = $(this).data(\"entryid\");\n // create new entry object that has different keys\n const newEntry = {\n id,\n title,\n travelDate,\n coverPhoto\n };\n // call save entry with new entry object as a parameter\n saveEntry(newEntry);\n }\n });\n}", "function saveNewNoteInTicket() {\n \n // Confirm a radio is selected\n if(!($('input[name=\"note-type-' + ticketInternalNotesCounter + '\"]:checked')[0])) {\n $('#error-text-note').removeClass('is-invisible');\n return;\n }\n $('#error-text-note').addClass('is-invisible');\n\n // Get the values\n // Remove the '-x' before we can save it to the DB\n var newNoteTypeWithNumber = $('input[name=\"note-type-' + ticketInternalNotesCounter + '\"]:checked')[0].id;\n var newNoteType = newNoteTypeWithNumber.slice(0, newNoteTypeWithNumber.lastIndexOf('-'));\n var newNoteBy = userName;\n var newNoteDate = $('#new-ticket-date-' + ticketInternalNotesCounter).val();\n var newNoteText = $('#ticket-text-' + ticketInternalNotesCounter).val();\n\n // Confirm text is written\n if (!newNoteText) {\n $('#error-text-note').removeClass('is-invisible');\n return;\n }\n $('#error-text-note').addClass('is-invisible');\n\n // Disable the fields once validation is done\n $('#new-ticket-date-' + ticketInternalNotesCounter).prop('disabled', true);\n $('#ticket-text-' + ticketInternalNotesCounter).prop('disabled', true);\n for(var i=0; i < radioOptions.length; i++) { //Disable all radios\n $('#' + radioIDs[i]+ '-' + ticketInternalNotesCounter).prop('disabled', true);\n }\n\n\n var newNoteID = ticketsRef.child(ticketDBID + '/notes').push().key;\n database.ref('/tickets/' + ticketDBID + '/notes')\n .child(newNoteID)\n .set({\n noteType: newNoteType,\n noteDate: newNoteDate,\n noteText: newNoteText,\n noteBy: newNoteBy,\n noteID: newNoteID,\n internalNotesCounter: ticketInternalNotesCounter\n })\n .then(function() {\n ticketInternalNotesCounter++;\n\n // Save the internalNotesCounter on the ticket\n database.ref('/tickets')\n .child(ticketDBID)\n .update({\n internalNotesCounter: ticketInternalNotesCounter\n })\n })\n\n // Reenable the button to create a new note\n addNewNoteButton.show();\n saveNewNoteButton.hide();\n\n }", "function save() {\n fs.writeFile('aaddress.json', JSON.stringify(addressData), 'utf-8', function (err) {\n if (err) throw err\n console.log('saved')\n })\n }", "function articleToolsSave(title, url, clip, referrer, partner) {\n saveArticle(buildURL(title, url, clip, referrer, partner, \"articleToolsSave\"));\n return false;\n \n}", "function saveData()\n{\n\t\"use strict\";\n\n\n\tvar currentDate = new Date();\n\tvar year, month, day;\n\tyear = currentDate.getFullYear();\n\t\n\tif (currentDate.getMonth().toString().length === 1)\n\t{\n\t\tmonth = \"0\" + currentDate.getMonth().toString(); \n\t}\n\telse\n\t{\n\t\tmonth = currentDate.getMonth().toString();\n\t}\n\t\n\tif (currentDate.getDate().toString().length === 1)\n\t{\n\t\tday = \"0\" + currentDate.getDate().toString(); \n\t}\n\telse\n\t{\n\t\tday = currentDate.getDate().toString();\n\t}\n\t\n\tcreationDate = year + month + day;\n\talert(creationDate);\n\tcreationTime = currentDate.getHours() + \":\" + currentDate.getMinutes();\n\n\t\n\ttitle = document.getElementById(\"txtTitle\").value;\n content = document.getElementById(\"txtContent\").value;\n\tteacherName = document.getElementById(\"txtTeacherName\").value;\n\tsubject = document.getElementById(\"txtSubject\").value;\n\t\n\talert(\"Your information has been saved\");\n\n\tdeadline = document.getElementById(\"txtDeadline\").value;\n\n\n\t// Add code to store rest of input in variables here\n \n// Store the information in localstorage\n localStorage.setItem(\"title\", title);\n localStorage.setItem(\"content\", content);\n\tlocalStorage.setItem(\"teacherName\", teacherName);\n\n \n //alert to inform user data has been saved.\n\n}", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }" ]
[ "0.65835935", "0.6401567", "0.61969", "0.6120719", "0.60416925", "0.60043424", "0.5999269", "0.59733", "0.590907", "0.5898496", "0.5896863", "0.5872143", "0.5860919", "0.5850837", "0.5847643", "0.5830421", "0.5824442", "0.5758286", "0.5743204", "0.5736624", "0.5711586", "0.5709788", "0.57080984", "0.57036537", "0.5702362", "0.5677593", "0.5672532", "0.5643679", "0.56432015", "0.564154", "0.5630185", "0.56280386", "0.56218994", "0.5605507", "0.5594563", "0.55896294", "0.558267", "0.55773926", "0.5558347", "0.55570835", "0.5545346", "0.554264", "0.5530245", "0.55270076", "0.55066454", "0.5493485", "0.54908586", "0.54844856", "0.54835165", "0.54809076", "0.5479437", "0.54733497", "0.5471564", "0.54713213", "0.5458412", "0.545026", "0.54437", "0.5443643", "0.54419655", "0.54390395", "0.54363704", "0.5425074", "0.54239976", "0.5421077", "0.54205143", "0.54159826", "0.5410392", "0.54014933", "0.5396108", "0.53939164", "0.5391207", "0.53900844", "0.53888077", "0.53827155", "0.53818583", "0.5372188", "0.53714514", "0.53479886", "0.534662", "0.53428423", "0.53406143", "0.533699", "0.53363633", "0.5335634", "0.53320503", "0.53307086", "0.5323408", "0.53223586", "0.5318905", "0.5318651", "0.5315729", "0.53132474", "0.5305528", "0.53010565", "0.5300615", "0.52994823", "0.52993876", "0.5297964", "0.5296972", "0.5293774" ]
0.5833299
15
This function updates an existing lead's details
function saveEditLead() { if ($('#editPotentialAmount').val() == "" || $('#editLead').val() == "") { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Organization Name or amount field is empty.")); errArea.appendChild(divMessage); } else { currentItem.set_item("Title", $('#editLead').val()); currentItem.set_item("ContactPerson", $('#editContactPerson').val()); currentItem.set_item("ContactNumber", $('#editContactNumber').val()); currentItem.set_item("Email", $('#editEmail').val()); currentItem.set_item("DealAmount", $('#editPotentialAmount').val()); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearEditLeadForm(); showLeads(); }, function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateLead(contactInfo) {\n this.setState({\n contactInfo: {...this.state.contactInfo, ...contactInfo},\n loading: true\n })\n\n return this.getLead()\n .then(lead => {\n let contactState = States[contactInfo.stateCode].abbreviation\n let updatedLead = {\n id: lead.id,\n firstName: contactInfo.firstName,\n lastName: contactInfo.lastName,\n phoneNmbr: contactInfo.phoneNmbr,\n address: `${contactInfo.address} ${contactInfo.city}, ${contactState}`,\n stateCode: contactInfo.stateCode,\n zipCode: contactInfo.zipCode,\n currentCustomer: contactInfo.currentCustomer === 'Yes'\n }\n if (contactInfo.emailAddr) updatedLead.emailAddr = contactInfo.emailAddr\n if (contactInfo.question) updatedLead.question = contactInfo.question\n return LeadService.updateLead(updatedLead)\n })\n .then(lead => {\n this.setState({loading: false})\n return lead\n })\n .catch(err => this.showErrorModal(err.message))\n }", "_handleUpdate(id, worker_fname, worker_sname, worker_lname, worker_reason, date_absence) {\n this.props.navigation.navigate('updateAbsence', { id: id, worker_fname: worker_fname, worker_sname: worker_sname, worker_lname: worker_lname, worker_reason: worker_reason, date_absence: date_absence });\n }", "function update() {\n updateGym(id, name, address1, address2, town, county, openingHours)\n .then(() => {\n alert(\"Gym Information updated!\");\n })\n .catch((error) => {\n alert(error.message);\n });\n }", "function updateContactDetails(id) {\n\t\temployeesData.forEach(employee => employee.detailsDisplayed = false); // Mark all as not displayed\n\t\tmarkAsDetailsDisplayed(id); // Mark this one as displayed\n\t\tcontactDetails.innerHTML = makeDetailsHTML(employeesData[id]); // Update HTML\n\t\t// Select elements and add relevent event listeners\n\t\tcloseSpan = document.querySelector(\".close\");\n\t\tcloseSpan.onclick = closeContactDetails;\n\t\tpreviousButton = document.querySelector(\"#previous\");\n\t\tnextButton = document.querySelector(\"#next\");\n\t\tlistenToButtons();\n\t}", "function updateDetails(email, phone, payment, fname, lname, nickname, bday){\r\n database.ref(\"users/\" + dbKey).update({ \r\n\t email: email,\r\n\t phone: phone,\r\n\t payment: payment,\r\n\t fname : fname,\r\n\t lname : lname,\r\n\t nickname : nickname,\r\n\t bday : bday\r\n\t});\r\n\r\n}", "function updateAccountDetails(userID, firstname, lastname,birthday, email, streetName,postCode ){\n Account.collection.updateOne(\n {_id: mongoose.Types.ObjectId(userID)},\n {$set:{userID:userID, firstname:firstname, lastname:lastname,\n birthday:birthday, email:email, streetName:streetName,postCode:postCode}});\n}", "async function updateOpportunityDetails (req, res) {\n res.send(await service.updateOpportunityDetails(req.authUser, req.params.opportunityId, req.body))\n}", "async addUpdateDetail(values) {\n const {\n onAddDetail: onAddDetailById,\n navigation,\n route: {\n params: {slotId},\n },\n } = this.props;\n const {firstName, lastName, phoneNumber} = values; // current added\n const user = {firstName, lastName, phoneNumber};\n await onAddDetailById(user, slotId);\n navigation.navigate('Home');\n }", "function update(model){ \n var updateProperty={\n \"mod\" : \"guard\",\n \"operation\" : \"update\",\n \"data\" : {\t\n \"key\" : guardKey,\n \"schema\": \"Lead\",\n \"id\" : model.documentToUpdateId,\n \"data\" : {\n \"tags\" : model.data.tags \n }\n } \n }; \n \n var updateRequestParams = {\n url : commonAccessUrl,\n method : 'POST',\n headers : headers,\n body : JSON.stringify(updateProperty)\n }\n request(updateRequestParams, function (error, response, body){\n \n if(body){\n try{\n if(!body.error){\n body=JSON.parse(body);\n }\n else{\n model.info=body.error\n model.emit(globalCallBackRouter,model)\n }\n }\n catch(err){\n model.info=err\n model.emit(globalCallBackRouter,model)\n }\n model.leadData=model.data;\n model.beneficiaryIndex=0\n saveReportDetailsLocally(model);\n \n }\n else if(response){\n model.info=response;\n model.emit(globalCallBackRouter,model)\n }\n else if(error){\n model.info=error;\n model.emit(globalCallBackRouter,model)\n }\n else{\n model.info=\"Error while updating lead details : Thyrocare API \\n\"+body;\n model.emit(globalCallBackRouter,model)\n }\n \n }) \n\n}", "function updateRecord(contact) {\n const option = {\n method: \"PUT\",\n body: JSON.stringify(contact),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n }\n fetch(`${url}/${selectedRow.cells[0].innerHTML}`, option)\n .then((respons) => view())\n .catch((error) => console.error(`error: ${error}`))\n\n}", "updateRecord(\n table,\n recordId,\n recordDetails,\n baseId = this.defaultBaseId,\n apiKey = this.defaultApiKey\n ) {\n //console.log(\"updating record: \", recordId);\n const base = this.getOrConnect(baseId, apiKey);\n if (base == null) {\n return;\n }\n\n return base(table)\n .update(recordId, recordDetails)\n .then(record => {\n return record.fields;\n })\n .catch(err => {\n console.log(\"airtable update record error: \", err);\n return;\n });\n }", "async editEmployeeData(name, joining_date, phone, address, id) {\r\n await this.checkLogin();\r\n var response = await axios.put(\r\n Config.employeeApiUrl + \"\" + id + \"/\",\r\n {\r\n name: name,\r\n joining_date: joining_date,\r\n phone: phone,\r\n address: address,\r\n },\r\n {\r\n headers: { Authorization: \"Bearer \" + AuthHandler.getLoginToken() },\r\n }\r\n );\r\n return response;\r\n }", "async function createUpdateCleanLead(contactToDB, labels) {\n console.log('🚀 Aqui *** -> contactToDB', contactToDB);\n let cleanLeadId = '';\n if (contactToDB.phone && contactToDB.phone != '') {\n // creando lead del bot\n console.log('entrando a hacer algo...');\n let cleanPhone = formatPhone(contactToDB.phone);\n let cleanLead = await searchCleanLead(cleanPhone);\n if (cleanLead) {\n // actualizando array del lead\n console.log('existe lead...agregar fuente');\n // if (leadsMatch.some((el) => el.fuente != leadsMatch[0].fuente))\n // console.log('los repetidos: ', leadsMatch);\n let sameFuente = cleanLead.details.find(\n (el) =>\n el.fuente == getFuente(getUrl(contactToDB.url)) &&\n el.type === 'PAGINA',\n );\n if (getFuente(getUrl(contactToDB.url)) && !sameFuente) {\n cleanLead.details.push({\n type: 'PAGINA',\n fuente: getFuente(getUrl(contactToDB.url)),\n msnActivaDefault: '',\n nombre: `${contactToDB.first_name} ${contactToDB.last_name}`,\n email: contactToDB.email,\n ciudad: contactToDB.city,\n labels: [],\n pais: contactToDB.country,\n });\n } else {\n console.log('editando fuente....');\n if (sameFuente.type && sameFuente.type == 'PAGINA') {\n console.log('dddddd');\n let fullname = `${contactToDB.first_name} ${contactToDB.last_name}`;\n if (fullname.length > sameFuente.nombre) sameFuente.nombre = fullname;\n if (contactToDB.email && contactToDB.email.length > 0) {\n sameFuente.email = contactToDB.email;\n }\n if (contactToDB.ciudad && contactToDB.ciudad.length > 0) {\n sameFuente.ciudad = contactToDB.city;\n }\n }\n }\n cleanLead.estado = 'RE-CONECTAR';\n increaseCount('leadReconectarCount', contactToDB.country); // incrementando conteo\n cleanLead.fuente = getFuente(getUrl(contactToDB.url));\n await cleanLead.save();\n cleanLeadId = cleanLead._id; // recuperando id\n console.log('agregado nuevo detail!!');\n } else {\n // creando\n console.log('entrando a crear...');\n let leadDB = new CleanLeads({\n details: [\n {\n type: 'PAGINA',\n fuente: getFuente(getUrl(contactToDB.url)),\n msnActivaDefault: '',\n nombre: `${contactToDB.first_name} ${contactToDB.last_name}`,\n email: contactToDB.email,\n ciudad: contactToDB.city,\n labels: [],\n pais: contactToDB.country,\n },\n ],\n estado: 'RE-CONECTAR',\n telefono: contactToDB.phone,\n telefonoId: await assignAgent(\n cleanPhone,\n getFuente(getUrl(contactToDB.url)),\n contactToDB.first_name,\n contactToDB.last_name,\n contactToDB.email,\n contactToDB.country,\n ), // asignando agente\n });\n console.log('al guardar...: ', leadDB);\n increaseCount('leadReconectarCount', contactToDB.country); // incrementando conteo\n leadDB.fuente = getFuente(getUrl(contactToDB.url)); // agregando fuente para log\n await leadDB.save();\n cleanLeadId = leadDB._id;\n console.log('creado lead clean! ');\n }\n\n // agregando etiquetas\n for (const label of labels) {\n colocarEtiquetaFB(\n getFuente(getUrl(contactToDB.url)),\n label.idLabel,\n 'details.fuente',\n cleanLeadId,\n 'PAGINA',\n );\n }\n }\n return cleanLeadId;\n}", "updateEmployeeLastName(adr) {\n\t\tconst query = `\n\t\tUPDATE employee\n\t\tSET ?\n\t\tWHERE ?;\n\t\t`;\n\t\tconst post = [\n\t\t\t{\n\t\t\t\tlast_name: adr[1],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: adr[0],\n\t\t\t},\n\t\t];\n\t\treturn this.connection.query(query, post);\n\t}", "update() {\n const {name, address1, address2, city, state: stateVal, zip, phone, creditValuePercentage, maxSpending, payoutAmountPercentage} = this.displayData.details;\n const {companyId, storeId} = state.get(this).params;\n const params = {\n name,\n address1,\n address2,\n city,\n state: stateVal,\n zip,\n phone,\n companyId,\n storeId\n };\n // Alternate usage\n if (this.alternativeGcmgr) {\n params.creditValuePercentage = creditValuePercentage;\n params.maxSpending = maxSpending;\n params.payoutAmountPercentage = payoutAmountPercentage;\n }\n // Update the store\n Service.get(this).update(params)\n .then(() => {\n // Redirect\n state.get(this).go('main.corporate.store.details', {companyId: params.companyId, storeId: params.storeId});\n });\n }", "editMedicalDetails(InjuredDetails) { \n var headers = JSON.parse(InjuredDetails); \n return new Promise((resolve, reject) => {\n Injured.update({'id': headers.id}, \n {$set:{ \"airWay\" : headers.airWay,\n \"breathing\" : headers.breathing,\n \"blood_pressure\" : headers.blood_pressure,\n \"disability\" : headers.disability,\n \"exposure\" : headers.exposure,\n \"heartbeat\" : headers.heartbeat,\n \"toHospital\" : headers.toHospital}}, (err) => {\n if (err) reject (err);\n else resolve(`edit ${headers.id}`);\n });\n })\n }", "async put (req, res) {\n try {\n console.log('details here ',req.body)\n console.log('details and now',req.body.accnumber)\n const account = await Account.update(req.body , {\n where: {\n id: req.params.accountId\n }\n })\n console.log(account)\n res.send(req.body)\n } catch (err) {\n res.status(500).send({\n error: 'an error has occured trying to update account'\n })\n }\n }", "function editAdmit() {\n dataService.get('admission', {'PATKEYID':$scope.patient.KEYID}).then(function(data){\n var admitArr = data.data;\n var currentAdmit = admitArr.slice(-1).pop();\n $scope.currentAdmitKEYID = currentAdmit.KEYID;\n\n //update admit object\n var updateAdmit = {\n KEYID: $scope.currentAdmitKEYID,\n PATSTATUS: 'D',\n DCDATE: $filter(\"date\")($scope.M0906_DC_TRAN_DTH_DT, 'yyyy/MM/dd'),\n DCREASON: $scope.DCREASON\n };\n console.log(updateAdmit);\n dataService.edit('admission', updateAdmit).then(function(response) {\n console.log(response);\n });\n });\n }", "updateAboutDetails(id, about) {\n return axios.put(ABOUT_API_BASE_URL + \"/update/\" + id, about, {headers: AuthHeader()});\n }", "function updateOrder(next){\n //function to update the order\n params.paymentdetails.reportdeliverymode = params.updateobj;\n update(params.id,{log:logs, paymentdetails:params.paymentdetails },function(e,r){\n if(e) return next(e)\n\n return next(null);\n }); \n }//end of update order ", "updateEmployeeFirstName(adr) {\n\t\tconst query = `\n\t\tUPDATE employee\n\t\tSET ?\n\t\tWHERE ?;\n\t\t`;\n\t\tconst post = [\n\t\t\t{\n\t\t\t\tfirst_name: adr[1],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: adr[0],\n\t\t\t},\n\t\t];\n\t\treturn this.connection.query(query, post);\n\t}", "updateEmployeeManager(adr) {\n\t\tconst query = `\n\t\tUPDATE employee\n\t\tSET ?\n\t\tWHERE ?;\n\t\t`;\n\t\tconst post = [\n\t\t\t{\n\t\t\t\tmanager_id: adr[1],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: adr[0],\n\t\t\t},\n\t\t];\n\t\treturn this.connection.query(query, post);\n\t}", "function update(req, res, next) {\n\n TicketModel.findById(req.params.id, function (err, ticket) {\n\n if (err) { return next(err); }\n if (ticket) {\n\n // TODO create mongoose plugin to handle multiple fields\n ticket.state = req.body.state;\n ticket.status = req.body.status;\n ticket.urgency = req.body.urgency;\n ticket.type = req.body.type;\n ticket.title = req.body.title;\n ticket.description = req.body.description;\n\n ticket.save(function (err) {\n\n if (err) { return next(err); }\n res.send(ticket);\n });\n\n } else {\n\n return next({type: 'retrieval', status: 404, message: 'not found'});\n }\n });\n }", "function _Update(objRequest, objResponse) {\n nlapiLogExecution('AUDIT','UPDATE Courses', '=====START=====');\n var stCustId = objRequest['CustomerId'];\n var httpBody = objRequest;\n nlapiLogExecution('AUDIT', 'Update Course', 'Update function in Departments executed.');\n\n var objDataResponse = {\n Response: 'F',\n Message: 'Default Value',\n ReturnId: ''\n };\n\n var loadedICourseRecord = nlapiLoadRecord('customrecord_rc_course', httpBody.Id);\n\n try {\n loadedICourseRecord.setFieldValue('custrecord_rc_course_title', httpBody.Title),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_number', httpBody.Number),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_level', httpBody.CreditLevel.Id),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_hours', httpBody.CreditHours),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_syllabi_name', httpBody.SyllabiName),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_institution', httpBody.ModeOfInstruction),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_reg_course', httpBody.RegisteredCourseId)\n objDataResponse.ReturnId = nlapiSubmitRecord(loadedICourseRecord, true)\n }\n catch (ex) {\n nlapiLogExecution('ERROR', 'Something broke trying to set fields' + ex.message)\n }\n\n if(objDataResponse.ReturnId){\n objDataResponse.Response = 'T';\n objDataResponse.Message = 'Yo it seems as though we have been successful with dis otha endevour' + JSON.stringify(loadedICourseRecord)\n }\n\n // Ask john.\n //1.)How to deal with \"missing\" values. What values must be supplied at any given stage\n // Mode up is required(looking at ns)\n\n // its either a list OR a record A list has id and value when writing i only provide an ID, don't pass anything but the id\n // think of it as an Enumerator, a number that means something else.\n //2.)How to deal with list objects\n\n nlapiLogExecution('AUDIT','UPDATE Courses', '======END======');\n return JSON.stringify(objDataResponse)\n}", "function updateDetails() {\n $.getJSON(window.location + 'details', {\n dag: _store.dag,\n id: _store.id\n }, function (data) {\n if (data.length > 0) {\n _store.owner = data[0].owner;\n }\n DetailViewStore.emit(DETAILS_UPDATE_EVENT);\n });\n}", "updateCoffeeLot(coffeeLotId, coffeeLot) {\r\n \r\n }", "updateThought({ params, body }, res) {\n Thoughts.findOneAndUpdate({ _id: params.id }, body, { new: true })\n .then(dbThoughtsData => {\n if (!dbThoughtsData) {\n res.status(404).json({ message: 'No Thoughts found with this id!' });\n return;\n }\n res.json(dbThoughtsData);\n })\n .catch(err => res.json(err));\n }", "function updateRecord(req, res) {\n BlogPost.findOneAndUpdate({ _id: req.body._id }, req.body, { new: true }, (err, doc) => {\n if (!err) { res.redirect('/post/blogPost'); }\n\n });\n}", "function updateReminderDetails(userId, noteId, updateReminderObj, done) {\n logger.info(\"Inside DAO method - update reminder\");\n let whereClause = {\n userId: userId,\n noteId: noteId\n };\n remindersModel.findOneAndUpdate(whereClause, updateReminderObj, {new: true},(err, modifiedReminderObj) => { \n if (err) return done(`Error while updating a particular Reminder ${err}.`);\n return done(null, { response: modifiedReminderObj, message: \"Reminder updated successfully.\" });\n });\n}", "updateData(per) {\r\n console.log(\"Updating \");\r\n console.log (\"PER\"+per);\r\n let id = per.PersonalUniqueID;\r\n let promise = fetch (`http://localhost:4070/api/person/${id}`, {\r\n method: \"PUT\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "function storeDetailsInDb(obj) {\n db.customers.update({phoneNumber:obj.phoneNumber}, {$set: { name : obj.firstName+\" \"+obj.lastName,email:obj.email,phoneNumber:obj.phoneNumber,currentCity:obj.currentCity,prefferdJobLocation:obj.jobLocation }}, {upsert: true}, function (err) {\n // the update is complete\n if(err) throw err\n console.log(\"inside update\")\n })\n}", "async update({ request, response, auth }) {\n try {\n let body = request.only(fillable)\n const id = request.params.id\n\n const data = await DownPayment.find(id)\n if (!data || data.length === 0) {\n return response.status(400).send(ResponseParser.apiNotFound())\n }\n /*\n As per client desicion no need to verify / send sms after verified\n const { is_verified } = request.post()\n if (is_verified && !data.verified_at) {\n const user = await auth.getUser()\n body.verified_by = user.id\n body.verified_at = new Date()\n // Send SMS\n const smsMessage = `No kwitansi: ${\n data.transaction_no\n } pelunasan 1 paket m3 dari ${\n data.name.trim().split(\" \")[0]\n } telah kami terima. Selamat Belajar (Admin Yapindo).`\n TwilioApi(data.phone, smsMessage)\n }\n */\n await data.merge(body)\n await data.save()\n const activity = `Update DownPayment '${data.transaction_no}'`\n await ActivityTraits.saveActivity(request, auth, activity)\n\n await RedisHelper.delete(\"DownPayment_*\")\n await data.load(\"target\")\n let parsed = ResponseParser.apiUpdated(data.toJSON())\n return response.status(200).send(parsed)\n } catch (e) {\n ErrorLog(request, e)\n return response.status(500).send(ResponseParser.unknownError())\n }\n }", "function updateAds(name, category, price, description, city, personName, phoneNumber, email, userId, postDate, url) {\n // ads entry.\n var postData = {\n adsName: name,\n category: category,\n price: price,\n description: description,\n city: city,\n personName: personName,\n phone: phoneNumber,\n email: email,\n userId: userId,\n postDate: postDate,\n photoUrl: url\n };\n //var updates = {};\n // updates['/ads/'+key_ads] = postData;\n return firebase.database().ref(\"ads/\").child(key_ads).update(postData);\n } // end of updateAds", "async function recordUpdate(req, res, next) {\n try {\n const thread = await Thread.findById(req.params.id)\n if (!thread) throw new Error(notFound)\n const newRecord = req.body\n const recordToUpdate = thread.records.id(req.params.recordId)\n Object.assign(recordToUpdate, newRecord)\n await thread.save()\n res.status(202).json(thread)\n console.log(`Thread titled '${thread.title}' has updated its record with '${req.body.message}'`)\n } catch (err) {\n next(err)\n }\n}", "static async updateContact(ContactId, obj, userId) {\n const contactFields = {};\n if (obj.name) contactFields.name = obj.name;\n if (obj.email) contactFields.email = obj.email;\n if (obj.phone) contactFields.phone = obj.phone;\n if (obj.type) contactFields.type = obj.type;\n console.log(contactFields);\n const contact = await Contact.findById({ _id: ContactId });\n\n if (!contact) {\n throw new Error(\"Contact not found\");\n }\n\n // Make sure user owns contact\n if (contact.user.toString() !== userId) {\n return new Error(\"Unauthorized access\");\n }\n\n const updatedContact = await Contact.findByIdAndUpdate(\n ContactId,\n { $set: contactFields },\n { new: true }\n );\n return updatedContact;\n }", "function editResponseDetail(rdid, rrid, ruleorder, target, chain, protocol, source, dest) {\n var dataObject = { 'rrid': rrid, 'ruleorder': ruleorder, 'target': target, 'chain': chain, 'protocol': protocol, 'source': source, 'destination': dest };\n $.ajax({\n url: _lcarsAPI + \"responsedetails/\" + rdid,\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify(dataObject),\n success: function() { populateRecipes(); getRecipeDetails(rrid); }\n });\n}", "function updateActivity() {\n if (!phone || phone.state != PhoneState.CallSummary) {\n return;\n }\n if (!phone.activityId) {\n phone.createCallActivity();\n return;\n }\n var data = {};\n data[\"description\"] = $('#callNotesField').text(); \n Microsoft.CIFramework.updateRecord(\"phonecall\", phone.activityId, JSON.stringify(data)).then(function (ret) {\n openActivity();\n });\n}", "async function updateTicketDetails(event) {\n event.preventDefault();\n\n const id = window.location.toString().split('/')[\n window.location.toString().split('/').length - 1\n ];\n const ticketStateId = document.getElementById('ticket-state').value;\n\n const updateObject = {\n ticket_state_id: ticketStateId\n }\n\n // Fetch /api/ticket/:id and update user details\n const response = await fetch(`/api/ticket/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updateObject),\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n\n if (response.ok) {\n document.location.replace('/admin/ticket');\n } else {\n alert('response.status');\n }\n\n\n}", "update (context, ideaPersistenceData) {\n return ideaAdapter.updateIdea(ideaPersistenceData)\n }", "updateThought({ params, body }, res) {\n Thought.findOneAndUpdate({ _id: params.id }, body, {\n new: true,\n runValidators: true,\n })\n .then((dbThoughtData) => {\n if (!dbThoughtData) {\n res.status(404).json({ message: \"No Thought found with this id!\" });\n return;\n }\n res.json(dbThoughtData);\n })\n .catch((err) => res.status(400).json(err));\n }", "updateUserDetails() {\n if (!activeUser()) return;\n $(conversations_area).find(`[data-user-id=\"${activeUser().id}\"] .sb-name,.sb-top > a`).html(activeUser().get('full_name'));\n $(conversations_area).find('.sb-user-details .sb-profile').setProfile();\n SBProfile.populate(activeUser(), $(conversations_area).find('.sb-profile-list'));\n }", "function editAdmit() {\n var testAdmit = {\n KEYID: $scope.currentAdmitKEYID,\n PATSTATUS: 'A',\n SOCDATE: $scope.M0030_START_CARE_DT\n };\n dataService.edit('admission', testAdmit).then(function(response){\n console.log(response);\n });\n //edit patient table to udpate PATSTATUS from 'P' to 'A'\n dataService.edit('patient', {'KEYID': $scope.patient.KEYID, 'PATSTATUS': 'A'}).then(function(response){\n console.log(response);\n //reset patient\n dataService.get('patient', {'KEYID': patientService.get().KEYID}).then(function(data) {\n var updatedPatient = data.data[0];\n patientService.set(updatedPatient);\n });\n });\n }", "function updateContact() {\n var contacts = getStoredContacts();\n var idEdited = JSON.parse(localStorage.idEdited);\n\n contacts.forEach(function (contact) {\n if(idEdited == contact.id) { // capitalize name initials (a little sanitation)\n contact.firstname = form.firstname.value[0].toUpperCase() + form.firstname.value.slice(1).toLowerCase(),\n contact.lastname = form.lastname.value[0].toUpperCase() + form.lastname.value.slice(1).toLowerCase(),\n contact.phone = form.phone.value,\n contact.address = form.address.value,\n contact.email = form.email.value\n }\n });\n\n // add contact to local storage\n localStorage.contacts = JSON.stringify(contacts);\n localStorage.idEdited = JSON.stringify('updated');\n}", "function _updateAirlineById(req, res, next) {\n\tvar airlineId = req.params.id;\n\n\tif(!COMMON_ROUTE.isValidId(airlineId)){\n\t\tjson.status = '0';\n\t\tjson.result = { 'message': 'Invalid Airline Id!' };\n\t\tres.send(json);\n\t} else {\n\t\tvar airlineObject = {\n 'name': req.body.name, \n 'IATA': req.body.IATA, \n 'ICAO': req.body.ICAO,\n 'callSign': req.body.callSign,\n 'alias': req.body.alias,\n 'country': req.body.airlineType\n }\n\n if(COMMON_ROUTE.isUndefinedOrNull(airlineObject.name)){\n\t\t\tjson.status = '0';\n\t\t\tjson.result = { 'message': 'Required fields are missing!' };\n\t\t\tres.send(json);\n\t\t} else {\n\t\t\tvar query = {\n\t\t\t\t$set: airlineObject\n\t\t\t};\n\n\t\t\tAIRLINES_COLLECTION.findOne({ _id: new ObjectID(airlineId)}, function (airlineerror, getAirline) {\n\t\t\t\tif (airlineerror || !getAirline) {\n\t\t\t\t\tjson.status = '0';\n\t\t\t\t\tjson.result = { 'message': 'Airline does not exist!' };\n\t\t\t\t\tres.send(json);\n\t\t\t\t} else {\n\t\t\t\t\tAIRLINES_COLLECTION.update({ _id: new ObjectID(airlineId) }, query, function (error, result) {\n\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\tjson.status = '0';\n\t\t\t\t\t\t\tjson.result = { 'error': 'Error in updating airline!' };\n\t\t\t\t\t\t\tres.send(json);\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tsupplierObject = {\n\t\t\t\t\t\t\t\t'name' : airlineObject.name,\n\t\t\t\t\t\t\t\t'foreignId' : airlineId\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar query = {\n\t\t\t\t\t\t\t\t$set : supplierObject\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tSUPPLIERS_COLLECTION.update({foreignId :airlineId },query, function(err,supplierUpd){\n\t\t\t\t\t\t\t\tif(err)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tjson.status = '0';\n\t\t\t\t\t\t\t\t\tjson.result = { 'error': 'Error in updating Airline!' };\n\t\t\t\t\t\t\t\t\tres.send(json);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tjson.status = '1';\n\t\t\t\t\t\t\t\t\tjson.result = { 'message': 'Airline updated successfully.', '_id': airlineId };\n\t\t\t\t\t\t\t\t\tres.send(json);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t});\n\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}", "async function updateDetails() {\n const profileObj = {};\n profileObj.id = util.currentProfile;\n profileObj.name = document.querySelector('#nameOption').value;\n profileObj.breed = document.querySelector('#breed').value;\n profileObj.location = document.querySelector('#location').value;\n profileObj.likes = document.querySelector('#likes').value;\n profileObj.dislikes = document.querySelector('#dislikes').value;\n profileObj.aboutme = document.querySelector('#aboutme').value;\n profileObj.birthday = document.querySelector('#birthday').value;\n profileObj.sex = document.querySelector('#sex').value;\n\n console.log(profileObj);\n const response = await util.updateProfileByUUID(profileObj);\n console.log('Response: ', response);\n showProfile();\n}", "updateVehicleDocument(id){\n\t\tlet list = this.state.previousCarBookings;\n\t\tlet pickupString = this.props.pickupDate.toLocaleString();\n\t\tlet returnString = this.props.returnDate.toLocaleString();\n\t\tlet dateString = `${pickupString} - ${returnString}`;\n\t\tlet obj = {\n\t\t\tpickupDate: this.props.pickupDate.valueOf(),\n\t\t\treturnDate: this.props.returnDate.valueOf(),\n\t\t\tdateString: dateString\n\t\t};\n\t\tlist.push(obj);\n\t\t\n\t\t// Put to DB\n\t\taxios({\n\t\t\tmethod: 'put',\n\t\t\turl: `http://localhost:3000/vehicles/${id}`,\n\t\t\tdata: {\n\t\t\t\tbookings: list\n\t\t\t}\n\t\t});\n\n\t\t// Render thanks-view\n\t\tthis.setState({\n\t\t\tview: 'Thanks'\n\t\t});\n\t}", "update() {\r\n this.sendDetail();\r\n }", "updateAboutDetails(id, about) {\n return axios.put(ABOUT_API_BASE_URL + id, about);\n }", "function updateProfessionalDetails(){\n\n return new Promise((resolve,reject)=>{\n proDetails.push(employeeId);\n let query = \"update employeeProfessionalDetails set joinDate= ?, endDate= ?, department= ?, skill= ? where employeeId= ?\";\n db.query(query, proDetails, (err, data) => {\n if (err) {\n console.log(err);\n db.rollback();\n reject(err);\n } else {\n console.log('updated pro details');\n resolve();\n }\n });\n });\n}", "async update ({ params, request, response }) {\n try {\n /**\n * Getting needed parameters.\n *\n * ref: http://adonisjs.com/docs/4.1/request#_only\n */\n const data = request.only([\n 'id',\n 'title',\n 'start_date',\n 'end_date',\n 'location',\n 'price'\n ])\n\n data.start_date = moment(data.start_date).format('YYYY-MM-DD hh:mm:ss')\n data.end_date = moment(data.end_date).format('YYYY-MM-DD hh:mm:ss')\n\n /**\n * Validating our data.\n *\n * ref: http://adonisjs.com/docs/4.1/validator\n */\n const validation = await validateAll(data, {\n id: 'required',\n title: 'required',\n location: 'required',\n price: 'required'\n })\n\n /**\n * If validation fails, early returns with validation message.\n */\n if (validation.fails()) {\n console.log('validation error')\n return response.status(500).json({ message: 'validation error' })\n }\n\n /**\n * Finding the mapping and updating fields on it\n * before saving it to the database.\n *\n * ref: http://adonisjs.com/docs/4.1/lucid#_inserts_updates\n */\n const page = await Page.findOrFail(data.id)\n page.merge(data)\n await page.save()\n\n return response.status(200).json({\n message: 'page was updated successfully'\n })\n } catch (e) {\n console.log(e.message)\n return response.status(500).json({ message: e.message })\n }\n }", "updateThought({ params, body }, res) {\n Thought.findOneAndUpdate({ _id: params.id }, body, { new: true, runValidators: true })\n .then(dbThoughtData => {\n if (!dbThoughtData) {\n res.status(404).json({ message: 'No thought found with this id!' });\n return;\n }\n res.json(dbThoughtData);\n })\n .catch(err => res.json(err));\n }", "update(data) {\n this.vendorDataService.updateVendor(this.id, data)\n .$promise\n .then((data) => {\n this.log(data);\n this.editing = '';\n this.addressRevertData = '';\n this.hoursRevertData = '';\n this.ammenitiesRevertData = '';\n this.menu = data.menu;\n this.vendor = data;\n this.hours = this.setUpHours()\n\n })\n .catch((error) => {\n this.error('XHR Failed for getContributors.\\n' + angular.toJson(error.data, true));\n });\n }", "updateAbout(state, payload) {\n state.bookingFormShow = false;\n state.restaurants.forEach(el => {\n if (el.id == payload.aboutID) {\n state.about = el\n }\n });\n }", "function updateRelativePerson(relativePersonReferenceKey) {\n // appLogger.log($scope.relativePerson)\n delete $scope.relativePerson.personReferenceKey;\n $scope.relativePerson.lastName = \"-- \";\n personRelativeLogic.updateRelativePerson($scope.relativePerson, relativePersonReferenceKey).then(function(response) {\n // appLogger.log(response);\n }, function(err) {\n appLogger.error('ERR' + err);\n });\n }", "static updateArticle(idToUpdatePassedIn, articleDataToUpdatePassedIn) {\n\n /* NEW 20180623-1031\n In Edit/Update, ADD NEW PHOTO(s)...\n */\n\n\n console.log('SUPER-DUPER-OOFFAA ******** articleDataToUpdatePassedIn ', articleDataToUpdatePassedIn)\n /* UPDATE: I see Title and URL ... Now time to add the Photos Filenames Array. :o)\n {articleTitle_name: \"Trump’s WAYZO Gots to go 3345 Twice BAZZARRO We L…CIENT Fuel Efficiency Rollbacks Will Hurt Drivers\", articleUrl_name: \"https://www.nytimes.com/2018/05/11/opinion/trump-fuel-efficiency-rollbacks.html\"}\n\n\n ?\n Why only Title field?\n articleDataToUpdatePassedIn {articleTitle_name: \"Mueller EDIT Plans to Wrap Up Obstruction Inquiry Into Trump by Sept. 1, Giuliani Says\"}\n */\n\n\n /* Notes:\n 1. I tried this two ways:\n - UPDATE()\n - FINDBYIDANDUPDATE() << Preferred, for this use case\n\n Mongoose Model.update - this did work\n But, this is for having NO Document Returned.\n http://mongoosejs.com/docs/documents.html\n \"If we don't need the document returned in our application and merely want to update a property in the database directly, Model#update is right for us...\"\n\n So, I need another choice:\n http://mongoosejs.com/docs/api.html#findbyidandupdate_findByIdAndUpdate\n */\n // NEW. Let's (what the hell) update the URL, too. hey.\n /*\n Huh. Did na work.\n boo-hoo.\n What (the h.) is URL here, anyhoo?\n */\n console.log('******** articleDataToUpdatePassedIn.articleUrl_name ', articleDataToUpdatePassedIn.articleUrl_name)\n console.log('******** articleDataToUpdatePassedIn.articleTitle_name ', articleDataToUpdatePassedIn.articleTitle_name)\n\n console.log('******** articleDataToUpdatePassedIn.articlePhotos_name ', articleDataToUpdatePassedIn.articlePhotos_name)\n\n /* 20180628-0740\n Boys and girls, we are going to try to NIP this bad boy,\n right here in the B-U-D. Whoa.\n\n O.M.G. It Worked.\n Goodness Griefiness.\n wswhooohhhhwwhh (sound, breath, exhalation, all that)\n\nIN SUM - YAH, WE DID NEED TO DO ANOTHER JSON.stringify()\nOF THAT CRAZY SIMPLE ARRAY OF STRINGS\nBEFORE SENDING IT TO MONGOOSE / MONGO\nFOR WHATEVER THE HELL IT IS THEy DO\nIN TERMS OF STORING THIS AWAY.\nYEESH.\nAnd as a further comment: when you JSON.stringify()\nthis sort of thing, and then you debug either using\nconsole.log(), OR using debugging in Chrome DevTools,\nyou do ***NOT*** get to \"see\" what it looks like.\nYou always see:\n[ \"asdf\", \"qwer\" ]\nYou do NOT get to see (what actually lands in the database):\n[ '[\"asdf\", \"qwer\"] ' ]\nNOR (same thing):\n[ \"[\\\"asdf\\\", \\\"qwer\\\"]\" ]\n\nJESUS H. CHRIST.\n\n Relevant console explorations:\n In sum: yeah, parsing then stringifying then parsing again ...\n ... it WORKS. Lessee if it'll do that Magic for ME\n ============\n var p5 = \" [ \\\"asdf\\\", \\\"qwer\\\" ] \"\n undefined\n var p6 = JSON.parse(p5)\n undefined\n p6\n Array [ \"asdf\", \"qwer\" ]\n ...\n p6\n Array [ \"asdf\", \"qwer\" ]\n p13 = JSON.parse(p6)\n SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data[Learn More] debugger eval code:1:7\n p14 = JSON.stringify(p6) <<<<< THE MAGIC PART\n \"[\\\"asdf\\\",\\\"qwer\\\"]\"\n p14\n \"[\\\"asdf\\\",\\\"qwer\\\"]\"\n var p15 = JSON.parse(p14)\n undefined\n p15\n Array [ \"asdf\", \"qwer\" ]\n ============\n */\n\n var theLateGreatWhatTheHell = JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name); // << YES !!!\n console.log('******** theLateGreatWhatTheHell (JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name) ', theLateGreatWhatTheHell);\n/*\nNote that the \"console.log()\" nonsense does ***NOT*** show us what this thing\n***TRULY*** is. :o(\n* ******** theLateGreatWhatTheHell (JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name) [\"sometimes__1530187445867_27vid-trump-kennedy-1-thumbLarge.jpg\",\"sometimes__1530187445870_28midterm_xp-superJumbo.jpg\",\"sometimes__1530188021581_00republicans1-jumbo-v3.jpg\"]\n*\n*\n* WHAT IS IN THE (G.D.) DATABASE (which is correct and right and good):\n* \"articlePhotos\" : [ \"[\\\"sometimes__1530187445867_27vid-trump-kennedy-1-thumbLarge.jpg\\\",\\\"sometimes__1530187445870_28midterm_xp-superJumbo.jpg\\\",\\\"sometimes__1530188021581_00republicans1-jumbo-v3.jpg\\\"]\" ],\n */\n\n\n return articleModelHereInService.findByIdAndUpdate(\n {_id: idToUpdatePassedIn},\n { $set:\n {\n articleTitle: articleDataToUpdatePassedIn.articleTitle_name,\n articleUrl: articleDataToUpdatePassedIn.articleUrl_name,\n // articlePhotos: articleDataToUpdatePassedIn.articlePhotos_name, // << NO !!\n articlePhotos: theLateGreatWhatTheHell, // << YES!!!\n }\n },\n { new: true } // Gets you the NEW, just-edited doc (not the orig one)\n )\n .then(\n (whatIGot) => {\n console.log('articleService. Update. then() whatIGot: ', whatIGot)\n /* .update()\n Not the document. Returns a Mongo transaction report.\n {n: 1, nModified: 1, opTime: {…}, electionId: ObjectID, ok: 1}\n */\n\n /* .findByIdAndUpdate()\n model {$__: InternalCache, isNew: false, errors: undefined, _doc: {…}, $init: true}\n */\n\n /* Note / Question\n Here on the returned Model, I find a property '._doc' which does contain my document. Returning this does work.\n But:\n 1)What does that underscore naming convention mean?\n 2) Am I doing this the correct way, to get the data I need?\n 3) Does the returned Model expose some other way to get the document it is holding, than grabbing it off this '._doc' property?\n Feel like I'm missing something.\n But, this is working.\n */\n /* 2018-05-02 Web \"Office Hours\" with Mike Hilborn\n Looks like all is O.K. re: the above questioning, wondering:\n\n \"@William: Underscore notation signifies an internal property of Mongoose model, similar to \"_id\".\"\n \"@William: The \"_doc\" is a pointer to the document object and its properties, so, yeah, feel free to use it to access properties.\"\n\n */\n console.log('articleService. Update. then() whatIGot._doc: ', whatIGot._doc)\n return whatIGot._doc\n }\n )\n .catch((err) => console.log('Service. Update. Catch. err: ', err))\n }", "update(e, guidedTourId) {\r\n\r\n const isValid = this.validate();\r\n if (isValid) {\r\n this.setState(initialStates);\r\n db.collection(\"GuidedTours\").doc(guidedTourId)\r\n .set({\r\n id: guidedTourId,\r\n tourName: this.state.tourName,\r\n startTime: this.state.startTime,\r\n endTime: this.state.endTime,\r\n date: this.state.date,\r\n venue: this.state.venue\r\n })\r\n .then(() => {\r\n this.setState({\r\n editModal: false,\r\n });\r\n this.display()\r\n });\r\n }\r\n }", "function editFetchCall(event) {\n let wizardId = parseInt(event.target.parentElement.id)\ndebugger\n let name = document.querySelector(`input#edit-name-${wizardId}`).value\n let image = document.querySelector(`input#edit-URL-${wizardId}`).value\n let pet = document.querySelector(`input#edit-pet-${wizardId}`).value\n let patronus = document.querySelector(`input#edit-patronus-${wizardId}`).value\n let house = document.querySelector(`input#edit-house-${wizardId}`).value\n let wand = document.querySelector(`input#edit-wand-${wizardId}`).value\n\n let data = {\n \"name\": name,\n \"image\": image,\n \"pet\": pet,\n \"patronus\": patronus,\n \"house\": house,\n \"wand\": wand\n }\n fetch(wizardUrl() + `/${wizardId}`, {\n method: \"PATCH\",\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n })\n .then(resp => resp.json())\n .then(data => {\n getWizards(data)\n\n })\n}", "function editContact(){\n var id = readLineSync.question('Lua chon id contact can sua: ');\n var name = readLineSync.question('name: ');\n var phone = readLineSync.question('phoneNum:');\n listContact[id].Name = name;\n listContact[id].Phone = phone;\n save();\n console.log(\"\\nsua thanh cong nhe!\");\n }", "function updateProfile(valid, advisorForm){\n $scope.successMsg = false;\n $scope.errorMsg = false;\n if(valid){\n advisor.update($scope.advisorData).then(function (response){\n if(response.data.success){\n $scope.successMsg = response.data.message;\n getById();\n }else{\n $scope.errorMsg = response.data.message;\n }\n })\n }else{\n $scope.errorMsg= \"Please ensure from is filled our properly\";\n }\n }", "async update(ctx){\n try{\n const results = await ctx.db.Company.update({\n name: ctx.request.body.name,\n city: ctx.request.body.city,\n address: ctx.request.body.address\n }, {\n where: {\n id: ctx.params.id\n }\n });\n results == 0 ? ctx.throw(500,'invalid id provide') : ctx.body = `company is updated with id ${ctx.params.id}`;\n }\n catch (err) {\n ctx.throw(500, err)\n }\n }", "static updateFarm(req, res, next) {\n const { farmName } = req.body;\n Farm.findOne({\n _id: req.params.id,\n })\n .then((farm) => {\n if (farm) {\n farm.farmName = farmName;\n return farm.save();\n } else {\n throw \"NOT_FOUND\";\n }\n })\n .then((farm) => {\n res.status(200).json({\n succes: true,\n data: farm,\n });\n })\n .catch(next);\n }", "function update_reports() {\n reports.find({person: null}).each(function(err, report) {\n if(report) {\n get_person(report.name, report.number, function(person) {\n if(person) {\n report.person = person;\n reports.save(report, function() {});\n console.log('updated report for ' + report.name + ' with ' + person)\n }\n })\n }\n });\n}", "editInjured(InjuredDetails) { \n var headers = InjuredDetails; \n return new Promise((resolve, reject) => {\n Injured.update({'id': headers.id}, \n {$set:{\"gender\": headers.gender,\n \"age\" : headers.age,\n \"name\":headers.name}}, (err) => {\n if (err) reject (err);\n else resolve(` ${headers.id}`);\n });\n })\n }", "async updateThoughtById({ params, body }, res){\n try{\n const updatedThought = await Thought.findOneAndUpdate(\n { _id: params.id},\n body,\n {new: true}\n );\n if(updatedThought) {\n res.status(200).json(updatedThought);\n }\n else {\n return res.status(404).json({ Msg: `No thought found with the Id ${params.id}` });\n }\n }\n catch (e) {\n res.status(400).json(e);\n }\n }", "function updateEmployee(stUser, stDelegatedApprover, stDateFrom, stDateTo)\n{\n\tvar stLoggerTitle = 'workflowAction_processDelagateOnSchedule - updateEmployee';\n\t\n\tnlapiSubmitField('employee', stUser, ['custentity_delegate_approver', 'custentity_date_from', 'custentity_to_date'], [stDelegatedApprover, stDateFrom, stDateTo]);\n\tnlapiLogExecution('DEBUG', stLoggerTitle, 'Successfully updated employee record.');\n}", "updateInvestmentDetails() {\n\t\tif (\"SecurityInvestment\" === this.transaction.transaction_type) {\n\t\t\t// Base amount is the quantity multiplied by the price\n\t\t\tthis.transaction.amount = (Number(this.transaction.quantity) || 0) * (Number(this.transaction.price) || 0);\n\n\t\t\t// For a purchase, commission is added to the cost; for a sale, commission is subtracted from the proceeds\n\t\t\tif (\"inflow\" === this.transaction.direction) {\n\t\t\t\tthis.transaction.amount += Number(this.transaction.commission) || 0;\n\t\t\t} else {\n\t\t\t\tthis.transaction.amount -= Number(this.transaction.commission) || 0;\n\t\t\t}\n\t\t}\n\n\t\t// If we're adding a new buy or sell transaction, update the memo with the details\n\t\tif (!this.transaction.id && \"SecurityInvestment\" === this.transaction.transaction_type) {\n\t\t\tconst\tquantity = Number(this.transaction.quantity) > 0 ? String(this.transaction.quantity) : \"\",\n\t\t\t\t\t\tprice = Number(this.transaction.price) > 0 ? ` @ ${this.currencyFilter(this.transaction.price)}` : \"\",\n\t\t\t\t\t\tcommission = Number(this.transaction.commission) > 0 ? ` (${\"inflow\" === this.transaction.direction ? \"plus\" : \"less\"} ${this.currencyFilter(this.transaction.commission)} commission)` : \"\";\n\n\t\t\tthis.transaction.memo = quantity + price + commission;\n\t\t}\n\t}", "updateAbout(activeAccountAccess, value, activeAccountId) {\n this.props.updateAbout(activeAccountAccess, value, activeAccountId);\n this.setState({ updateAccounts: true });\n }", "handleUpdate() {\n // Re-combining fields into one location field \n // for easy update, not currently in use\n var location = this.state.building + \".\" + this.state.floor + \".\" + this.state.room\n fetch(myPut + '/' + this.state.oneApp.id, {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: 'put',\n body: JSON.stringify({\n title: this.state.title,\n meetingdate: this.state.meetingdate,\n meeting_user: this.state.meeting_user,\n note: this.state.note,\n location: this.state.location\n })\n })\n .then(() => this.fetchAppointment())\n alert('The appointment has been successfully updated')\n }", "handleUpdate() { \n if (// Check if the needed fields are not empty\n this.state.email !== '' &&\n this.state.firstName !== '' &&\n this.state.lastName !== ''\n ) {// The Put method will be as follow\n fetch(myGet + '/' + this.state.user.id, {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: 'put',\n body: JSON.stringify({\n // Declare and stringify the fields that need updating\n email: this.state.email,\n firstName: this.state.firstName,\n lastName: this.state.lastName\n })\n })\n .then(() => this.props.fectchAccount()) // Fetch the exact account again to apply changes\n alert('The account has been successfully updated')\n } else {\n alert('Please enter correct information')\n }\n }", "editPerson(req, res, next){\n Person.findOneAndUpdate({\n firstname: req.params.firstname\n },\n { $set: { firstname: req.body.firstname }},\n { upsert: true },\n function(err, person){\n if(err){\n console.log(\"error occured\");\n console.log(err);\n } else {\n console.log(person);\n res.send(person);\n }\n });\n }", "function updateNewRecord(newRecord, resp, appConfig) {\r\n\r\n try {\r\n var avsResponseCode = resp.avsResponseCode;\r\n var avsResponseMessage = resp.avsResponseMessage;\r\n var cvnResponseCode = resp.cvnResponseCode;\r\n var cvnResponseMessage = resp.cvnResponseMessage;\r\n\r\n newRecord.setValue({\r\n fieldId: appConfig.transaction.body.ccAuthCode,\r\n value: resp.transactionReference.authCode\r\n });\r\n newRecord.setValue({\r\n fieldId: appConfig.transaction.body.transactionId,\r\n value: resp.transactionReference.transactionId\r\n });\r\n newRecord.setValue({\r\n fieldId: appConfig.transaction.body.referenceNumber,\r\n value: resp.referenceNumber\r\n });\r\n newRecord.setValue({\r\n fieldId: appConfig.transaction.body.gatewayResponse,\r\n value: JSON.stringify(resp)\r\n });\r\n newRecord.setValue({\r\n fieldId: appConfig.transaction.body.avsResultCode,\r\n value: avsResponseCode\r\n });\r\n newRecord.setValue({\r\n fieldId: appConfig.transaction.body.avsResultText,\r\n value: avsResponseMessage\r\n });\r\n newRecord.setValue({\r\n fieldId: appConfig.transaction.body.cvvResultCode,\r\n value: cvnResponseCode\r\n });\r\n newRecord.setValue({\r\n fieldId: appConfig.transaction.body.cvvResultText,\r\n value: cvnResponseMessage\r\n });\r\n } catch(e) {\r\n throw appConfig.language.badGatewayResponse;\r\n }\r\n }", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "updatePerson(data) {\n var name = read.question(\"enter Firstname of person :\")\n for (let i = 0; i < data.Person.length; i++) {\n if (data.Person[i].personfname == name) {\n var index = data.Person.indexOf(data.Person[i]);\n console.log(\" select which information to be update \")\n console.log(\"Enter 1 for firstname of person to be update\")\n console.log(\"Enter 2 for lastname of person to be update\")\n console.log(\"Enter 3 for phonenumber person to be update\")\n console.log(\"Enter 4 for city of person to be update\")\n console.log(\"Enter 5 for state of person to be update\")\n console.log(\"Enter 6 for zip code of person to be update\")\n var num1 = read.questionInt(\"select any number:\")\n switch (num1) {\n case 1: this.firstname(data, index)\n break;\n case 2: this.lastname(data, index)\n break;\n case 3: this.phonenumber(data, index)\n break;\n case 4: this.city(data, index)\n break;\n case 5: this.state(data, index)\n break;\n case 6: this.zipcode(data, index)\n break;\n }\n }\n }\n }", "updateThought({params,body}, res){\n // Mongoose .findOneAndUpdate() method. Finds thought by id, sends new thoughtText\n Thought.findOneAndUpdate({_id: params.id}, body, {new:true})\n .then(dbThoughtData => {\n if(!dbThoughtData){\n res.status(404).json({message: \"No thought was found with that id\"});\n return\n }\n res.json(dbThoughtData)\n })\n .catch(err => {\n console.log(err)\n res.status(400).json(err);\n })\n }", "completeEdit(updatedInfo, entryKey) {\n updatedInfo.searchString = updatedInfo.producer + updatedInfo.origin + updatedInfo.tastingNotes + updatedInfo.text + \"date:\" + updatedInfo.date + updatedInfo.barName;\n updatedInfo.tastingNotes = updatedInfo.tastingNotes ? updatedInfo.tastingNotes : \"(None)\";\n firebase.database().ref('userData/' + this.props.user.uid + '/userJournalEntries/' + entryKey).update(updatedInfo);\n }", "function updateOrder(next){\n updateObj.log = logs;\n if(!params.updateobj.length) updateObj.specialneedflag = false;\n // if old phlebo was not eligible for this special need\n if(changePhlebo) {\n updateObj.assignedto = undefined;\n statusLog();\n updateObj.statuslog = statuslog; //update object\n }\n\n //function to update the order\n update(params.id,updateObj,function(e,r){\n if(e) return next(e)\n\n return next(null);\n }); \n }//end of update order ", "function modifyBuildBetaDetail(api, id, body) {\n return api_1.PATCH(api, `/buildBetaDetails/${id}`, { body })\n}", "async update({request, response, params: {id}}) {\n\n const name = await nameService.findNameBy('id', id);\n\n if (name) {\n name.status = request.input('status')\n console.log(name)\n name.save()\n\n return response.status(200).send({\n status: 200,\n message: \"name updated\"\n })\n }\n else{\n return response.status(400).send({\n status: 400,\n message: \"invalid name id\"\n })\n }\n }", "function updateData(info) {\r\n try {\r\n nlapiSubmitField('workorder', info.id, info.field, info.value);\r\n } catch (e) {\r\n nlapiLogExecution('ERROR', 'Error during main updateDate', e.toString());\r\n }\r\n}", "updateThought({ params, body }, res) {\n Thought.findOneAndUpdate({ _id: params.id }, body, {\n new: true,\n runValidators: true,\n })\n .then((dbThoughtData) => {\n if (!dbThoughtData) {\n res.status(404).json({ message: \"No thought found with this id\" });\n return;\n }\n res.json(dbThoughtData);\n })\n .catch((err) => {\n res.status(400).json(err);\n });\n }", "update(req, res) {\n\n if (!req.params.id)\n return res.status(400).send({\n message: \"The 'id' attribute cannot be empty.\"\n });\n\n return Review\n .findById(req.params.id, {\n\n attributes: ['id', 'driver_id', 'passenger_id', 'crafter_id', 'comment', 'score', 'kindness_prize', 'cleanliness_prize', 'driving_skills_prize', 'createdAt', 'updatedAt']\n })\n .then(Review => {\n\n if (!Review) {\n\n return res.status(400).send({\n\n message: 'Review Not Found'\n });\n }\n\n return Review\n .update({\n\n driver_id: req.body.driver_id || Review.driver_id,\n passenger_id: req.body.passenger_id || Review.passenger_id,\n crafter_id: req.body.crafter_id || Review.crafter_id,\n comment: req.body.comment || Review.comment,\n score: req.body.score || Review.score,\n kindness_prize: req.body.kindness_prize || Review.kindness_prize,\n cleanliness_prize: req.body.cleanliness_prize || Review.cleanliness_prize,\n driving_skills_prize: req.body.driving_skills_prize || Review.driving_skills_prize\n })\n .then(() => res.status(200).send(Review)) // Send back the updated passenger\n .catch((error) => res.status(400).send(error));\n })\n .catch((error) => res.status(400).send(error));\n }", "update(req,res,next){\n console.log(\"Update...\")\n //we check the req for an id\n if(!req.query.hasOwnProperty(\"id\")){\n return res.status(400).send(\"Missing ID Parameter.\");\n }\n let id = req.query.id;\n\n Contact.findByIdAndUpdate(id,req.body).exec()\n .then(doc=>{\n res.status(200).json(doc);\n })\n .catch(err=>{\n res.status(500).send(\"There was an error.\")\n })\n }", "function updateEmployee(name, officeNum, phoneNum) {\n // if the employee exists\n var exists = verifyEmployee(name);\n if (exists !== false) {\n // controller updates model\n // update array with new values for employee object\n employeeList[exists].officeNum = officeNum;\n employeeList[exists].phoneNum = phoneNum;\n\n // controller update HTML view\n var list = document.querySelectorAll(\"div.employeeItem\");\n // console.log(list);\n var oldEmployee = list[exists];\n // console.log(oldEmployee);\n var newEmployee = addEmployee({name,officeNum,phoneNum});\n newEmployee.classList.add('hidden');\n // console.log(newEmployee);\n\n // add new employee then remove the old one while preserving placement\n employeeNode.insertBefore(newEmployee, oldEmployee);\n employeeNode.removeChild(oldEmployee);\n\n return true;\n }\n else {\n // employee does not exist\n return false;\n }\n}", "async function updateSeniorAddress(pAddress) {\r\n await seniorRef.update({address: pAddress});\r\n console.log(\"Address of \" + senior + \"updated to \" + pAddress + \".\");\r\n}", "function editFire() {\n try {\n firebase.bd.ref('/users/' + route.params.key).update({\n Nama: Nama,\n Telepon: Telepon,\n Alamat: Alamat,\n Email: Email,\n Event: Event,\n })\n\n } catch (error) {\n alert(error);\n }\n finally {\n setNama('');\n setTelepon('');\n setAlamat('');\n setEmail('');\n setEvent('');\n navigation.navigate(\"Details\")\n }\n }", "async update(req,res){\n try{\n let params = req.allParams();\n let attributes = {};\n\n if(params.name){\n attributes.name = params.name;\n }\n if(params.city){\n attributes.city = params.city;\n }\n if(params.phone){\n attributes.phone = params.phone;\n }\n\n const results = await Company.update({id: req.params.id}, attributes);\n return res.ok(results);\n }\n catch(err){\n return res.serverError(err);\n }\n }", "async function editMilestoneHandler(id, milestoneObj) {\n const response = await fetch(`/api/milestones/${id}`, {\n method: 'PUT',\n body: JSON.stringify(milestoneObj),\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n if (response.ok) {\n location.reload();\n } else {\n alert(response.statusText);\n }\n}", "update(companyId) {\n return Resource.get(this).resource('Admin:updateCompany', {\n company: {\n ...this.displayData.company,\n margin: this.displayData.company.settings.margin,\n useAlternateGCMGR: this.displayData.company.settings.useAlternateGCMGR,\n serviceFee: this.displayData.company.settings.serviceFee\n },\n companyId\n });\n }", "async function updateVolAddress(pAddress) {\r\n await volunteerRef.update({address: pAddress});\r\n console.log(\"Address of \" + volunteer + \"updated to \" + pAddress + \".\");\r\n}", "async function updateVolName(fName, lName) {\r\n await volunteerRef.update({first_name: fName});\r\n await volunteerRef.update({last_name: lName});\r\n console.log(\"First name and last name of \" + volunteer + \"updated to \" + fName + \" \" + lName + \".\");\r\n}", "function update_person(data) {\n\t\tvar container = $('#' + data['old_id']);\n\t\tcontainer.find('div.rsvp-row').each(function(index, elem) {\n\t\t\tvar $elem = $(elem);\n\t\t\tvar field = $elem.attr('class').split(' ')[1];\n\t\t\t$elem.find('p').text(data[field]);\n\t\t});\n\t\tcontainer.attr('id', data['id']);\n\t}", "updateAccount() {\n const allValid = [...this.template.querySelectorAll('lightning-input')]\n .reduce((validSoFar, inputFields) => {\n inputFields.reportValidity();\n return validSoFar && inputFields.checkValidity();\n }, true);\n\n if (allValid) {\n // Create the recordInput object\n const fields = {};\n fields[Id.fieldApiName] = this.message;\n fields[Name.fieldApiName] = this.template.querySelector(\"[data-field='name']\").value;\n fields[Type.fieldApiName] = this.template.querySelector(\"[data-field='type']\").value;\n fields[Industry.fieldApiName] = this.template.querySelector(\"[data-field='industry']\").value;\n fields[Website.fieldApiName] = this.template.querySelector(\"[data-field='website']\").value;\n fields[Phone.fieldApiName] = this.template.querySelector(\"[data-field='phone']\").value;\n console.log('check names-'+ JSON.stringify(Name));\n const recordInput = { fields };\n updateRecord(recordInput)\n .then(() => {\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Success',\n message: 'Account Updated Successfully',\n variant: 'success'\n })\n );\n fireEvent(this.pageRef, 'recordupdated', true);\n })\n .catch(error => {\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Error creating record',\n message: error.body.message,\n variant: 'error'\n })\n );\n });\n }\n else {\n // The form is not valid\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Something is wrong',\n message: 'Check your input and try again.',\n variant: 'error'\n })\n );\n }\n }", "function saveNewLead() {\n if ($('#newPotentialAmount').val() == \"\" || $('#newLead').val() == \"\") {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Organization Name or amount field is empty.\"));\n errArea.appendChild(divMessage);\n }\n else {\n var itemCreateInfo = new SP.ListItemCreationInformation();\n var listItem = list.addItem(itemCreateInfo);\n listItem.set_item(\"Title\", $('#newLead').val());\n listItem.set_item(\"ContactPerson\", $('#newContactPerson').val());\n listItem.set_item(\"ContactNumber\", $('#newContactNumber').val());\n listItem.set_item(\"Email\", $('#newEmail').val());\n listItem.set_item(\"_Status\", \"Lead\");\n\n listItem.set_item(\"DealAmount\", $('#newPotentialAmount').val());\n listItem.update();\n context.load(listItem);\n context.executeQueryAsync(function () {\n clearNewLeadForm();\n showLeads();\n },\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n }\n}", "updateComment(id, recordComment) {\n const { foundRecord, foundIndex } = this.findOneRecord(id);\n this.records[foundIndex].comment = recordComment;\n return { foundRecord };\n }", "function updateaddress()\n{\n var logopener=\"----entering updateaddress----\";\n console.log(logopener);\n\n //lets get the id. \n console.log(\"UniqueGuid is \" + event.target.id);\n\n //we have the id. now, we need to do a post call to update it. \n var tempbutton = event.target;\n\n apiworkaddressupdate(tempbutton);\n \n var logcloser=\"----leaving updateaddress----\";\n console.log(logcloser);\n}", "function updateAccount(req, res, next) {\n // console.log(req.body)\n var bodyParams = req.body;\n \n // console.log(currentAccount)\n\n Account\n .findOneAndUpdate(\n { _id: ObjectId(bodyParams._id) },\n { '$set': {\n 'platform': bodyParams.platform,\n 'accountType': bodyParams.accountType,\n 'accountId': bodyParams.accountId,\n 'active': bodyParams.active,\n 'inActiveReason': bodyParams.inActiveReason,\n \n }\n },\n { upsert: false, new: true, fields: { password: 0 }, runValidators: true, setDefaultsOnInsert: true })\n .exec((err, account) => {\n if (err) return next({ err: err, status: 400 });\n if (!account) return next({\n message: 'Account not found.',\n status: 404\n });\n\n utils.sendJSONresponse(res, 200, account);\n });\n }", "async update({ request, response, auth }) {\n try {\n let body = request.only(fillable)\n const id = request.params.id\n const data = await StudyProgram.find(id)\n if (!data || data.length === 0) {\n return response.status(400).send(ResponseParser.apiNotFound())\n }\n const isUniversityExists = await CheckExist(\n body.university_id,\n \"University\"\n )\n if (!isUniversityExists) {\n return response\n .status(422)\n .send(ResponseParser.apiValidationFailed(\"University not fund\"))\n }\n\n const isStudyNameExists = await CheckExist(\n body.study_name_id,\n \"StudyName\"\n )\n if (!isStudyNameExists) {\n return response\n .status(422)\n .send(ResponseParser.apiValidationFailed(\"StudyName not fund\"))\n }\n await data.merge(body)\n await data.save()\n await RedisHelper.delete(\"StudyProgram_*\")\n await RedisHelper.delete(\"StudyYear_*\")\n await RedisHelper.delete(\"MarketingTarget_*\")\n await data.loadMany([\"university\", \"studyName\", \"years\"])\n const jsonData = data.toJSON()\n const activity = `Update StudyProgram \"${jsonData.studyName.name}\" in \"${\n jsonData.university.name\n }\" university`\n await ActivityTraits.saveActivity(request, auth, activity)\n let parsed = ResponseParser.apiUpdated(data.toJSON())\n return response.status(200).send(parsed)\n } catch (e) {\n ErrorLog(request, e)\n return response.status(500).send(ResponseParser.unknownError())\n }\n }", "update(dbId, issueId, date, priority, summary, severity, description, reporter, assignedUser, status){\n\t\tClient.editBugs(dbId, issueId, date, priority, summary, severity, description, reporter, assignedUser, status);\n\t}", "function updateEmployee() {\n\n}", "function updateDetails(method, url, payload, objectString, formName){\n\n var httpRequest = createHttpRequest(method, url);\n\n httpRequest.onreadystatechange = function(){\n if (httpRequest.readyState == 4 && httpRequest.status == 200) {\n alert(objectString + \" updated successfully!\");\n resetForm(formName);\n }\n }\n httpRequest.onerror = onError;\n sendHttpRequest(httpRequest, method, url, \"application/x-www-form-urlencoded\", payload);\n}", "function updateHolding() {\n var recordId = $scope.record['@id'] || $scope.record.about['@id'];\n if(!$scope.record.new) {\n recordService.holding.find(recordId, userData, true).then(function success(holdings) {\n if (holdings.userHoldings) {\n $scope.hasHolding = true; \n } else {\n $scope.hasHolding = false;\n }\n }, function error(status) {\n $scope.hasHolding = false;\n });\n } else {\n $scope.hasHolding = false;\n }\n }" ]
[ "0.6759188", "0.59959406", "0.5849318", "0.58174187", "0.58011323", "0.5744198", "0.57401884", "0.5687227", "0.5678077", "0.5597881", "0.55947375", "0.5551576", "0.55313635", "0.55211365", "0.5510525", "0.55058676", "0.54958683", "0.5489356", "0.54399955", "0.54372627", "0.54311556", "0.5426431", "0.54200375", "0.5416951", "0.5348736", "0.53282505", "0.53262126", "0.5323496", "0.5313881", "0.53106475", "0.53020376", "0.52980566", "0.52943766", "0.52830595", "0.52792436", "0.5270963", "0.5262588", "0.5262488", "0.5259945", "0.52517503", "0.52482605", "0.5242604", "0.5220743", "0.5219176", "0.5215076", "0.5213025", "0.5192025", "0.5183395", "0.51815265", "0.5177325", "0.51758796", "0.51749027", "0.51742375", "0.51699156", "0.516927", "0.5157104", "0.5156852", "0.51425755", "0.51416177", "0.5140582", "0.5138083", "0.51345986", "0.51314616", "0.5122795", "0.511593", "0.5113067", "0.5112264", "0.51080847", "0.51042306", "0.5101337", "0.50975853", "0.50925624", "0.509046", "0.5090193", "0.50878835", "0.5087301", "0.508714", "0.5085989", "0.50800806", "0.5078762", "0.50777376", "0.50771755", "0.50745165", "0.5073781", "0.5071545", "0.50658834", "0.50646293", "0.5063292", "0.50564134", "0.5053863", "0.5046856", "0.5041221", "0.50378925", "0.5036153", "0.5032583", "0.5030154", "0.5028316", "0.5027399", "0.5025252", "0.50252396", "0.5018691" ]
0.0
-1
This function cancels the creation of a lead
function cancelNewLead() { clearNewLeadForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelEditLead() {\n clearEditLeadForm();\n}", "function Cancellation() { }", "function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }", "function onLeavingChallengesAdvertising() {\n $timeout.cancel(updaterHndl);\n }", "function cmdCallCancel() {\n formCreateCall()\n }", "cancel() {\n\n if (this.requestRunning === false) return;\n\n this.requestRunning = false;\n\n this._resetAdsLoader();\n\n // Hide the advertisement.\n this._hide(\"cancel\");\n\n // Send event to tell that the whole advertisement thing is finished.\n let eventName = \"AD_SDK_CANCELED\";\n let eventMessage = \"Advertisement has been canceled.\";\n this.eventBus.broadcast(eventName, {\n name: eventName,\n message: eventMessage,\n status: \"warning\",\n analytics: {\n category: this.eventCategory,\n action: eventName,\n label: this.gameId\n }\n });\n }", "function cancelBids () {\n}", "function cancel() {\n transition(DELETE, true);\n\n props.cancelInterview(props.id)\n .then(response => {\n transition(EMPTY);\n })\n .catch(error => {\n transition(ERROR, true);\n })\n }", "cancel() {\n delete activityById[id];\n }", "function cancel() {\n\t\tdelete state.people[id]\n\t\temit(\"person modal canceled\")\n\t}", "cancelTrialCreation() {\n this.setState({createTrialModal: false})\n }", "cancel() {\n if (this.isCancelDisabled)\n return;\n this.isCancelDisabled = true;\n this.closeEnrollment_('cancel');\n }", "cancel() {}", "abort() {\n const\n me = this,\n { view, creationData } = me;\n\n // Remove terminals from source and target events.\n if (creationData) {\n const { source, sourceResource, target, targetResource } = creationData;\n\n if (source) {\n const el = view.getElementFromEventRecord(source, sourceResource);\n if (el) {\n me.hideTerminals(el);\n }\n }\n if (target) {\n const el = view.getElementFromEventRecord(target, targetResource);\n if (el) {\n me.hideTerminals(el);\n }\n }\n }\n\n if (me.creationTooltip) {\n me.creationTooltip.disabled = true;\n }\n\n me.creationData = me.lastMouseMoveEvent = null;\n\n me.mouseDetacher && me.mouseDetacher();\n\n me.removeConnector();\n }", "cancel() {\n cancel();\n }", "cancelCreate() {\r\n this.props.history.goBack();\r\n }", "abort() {\n const me = this,\n { view, creationData } = me;\n\n // Remove terminals from source and target events.\n if (creationData) {\n const { source, sourceResource, target, targetResource } = creationData;\n\n if (source) {\n const el = view.getElementFromEventRecord(source, sourceResource);\n if (el) {\n me.hideTerminals(el);\n }\n }\n if (target) {\n const el = view.getElementFromEventRecord(target, targetResource);\n if (el) {\n me.hideTerminals(el);\n }\n }\n }\n\n me.creationData = null;\n\n me.mouseDetacher && me.mouseDetacher();\n\n me.removeConnector();\n }", "canceled() {}", "function cancel(){\n scope.permission.planMode = false;\n angular.element('.plan-overlay').css('visibility','hidden');\n scope.plan.current = [];\n scope.plan.selected = [];\n }", "cancel() {\n console.log('[cancel]');\n // now request that Journey Builder closes the inspector/drawer\n connection.trigger('requestInspectorClose');\n }", "cancelNewQualification() {\n\t\tthis.addNewQualificationState = false;\n\t\tthis.newQualification = {\n\t\t\tdescription: null,\n\t\t\tdoctor: null,\n\t\t};\n\t}", "cancelCreation() {\n this.state.albumModalFinished();\n }", "function cancel() {\r\n const wrapper = document.querySelector(\".afhalen-wrapper\");\r\n wrapper.style.display = \"none\";\r\n resetState();\r\n // just to clear the error box\r\n sendErrorMessage(\"\");\r\n\r\n }", "function cancelDesc(){ \n event.target.parentNode.parentNode.removeChild(event.target.parentNode);\n}", "abort() {\n const me = this,\n {\n view,\n creationData\n } = me; // Remove terminals from source and target events.\n\n if (creationData) {\n const {\n source,\n sourceResource,\n target,\n targetResource\n } = creationData;\n\n if (source) {\n const el = view.getElementFromEventRecord(source, sourceResource);\n\n if (el) {\n me.hideTerminals(el);\n }\n }\n\n if (target) {\n const el = view.getElementFromEventRecord(target, targetResource);\n\n if (el) {\n me.hideTerminals(el);\n }\n }\n }\n\n if (me.creationTooltip) {\n me.creationTooltip.disabled = true;\n }\n\n me.creationData = me.lastMouseMoveEvent = null;\n me.mouseDetacher && me.mouseDetacher();\n me.removeConnector();\n }", "cancelCreatePrimaryObject(skipAskToLeave = false){\n const { href, navigate, setIsSubmitting } = this.props;\n var leaveFunc = () =>{\n // Navigate out.\n var parts = url.parse(href, true),\n modifiedQuery = _.omit(parts.query, 'currentAction'),\n modifiedSearch = queryString.stringify(modifiedQuery),\n nextURI;\n\n parts.query = modifiedQuery;\n parts.search = (modifiedSearch.length > 0 ? '?' : '') + modifiedSearch;\n nextURI = url.format(parts);\n\n navigate(nextURI, { skipRequest : true });\n };\n\n if (skipAskToLeave === true){\n return setIsSubmitting(false, leaveFunc);\n } else {\n return leaveFunc();\n }\n }", "function handleCancel() {\n resetLocalDateRangeParams();\n setAnchorEl(null);\n }", "cancel() {\n\n }", "function handleEarlyInteraction() {\n clearTimeout(tId);\n cleanup();\n }", "cancel() {\n if (this._nextStepHandle !== undefined) {\n this.cancelAsync(this._nextStepHandle);\n this._nextStepHandle = undefined;\n }\n }", "cancel() {\n this.cancelled = true;\n }", "cancel(){\n this.game.activeNPC.action=null;\n this.game.activeNPC=null;\n }", "cancel() {\n // Destroy the adsManager so we can grab new ads after this.\n // If we don't then we're not allowed to call new ads based\n // on google policies, as they interpret this as an accidental\n // video requests. https://developers.google.com/interactive-\n // media-ads/docs/sdks/android/faq#8\n this.adsLoaderPromise = new Promise((resolve, reject) => {\n if (this.adsLoader) this.adsLoader.contentComplete();\n if (this.adsManager) this.adsManager.destroy();\n\n // Hide the advertisement.\n this._hide();\n\n // Reset styles.\n this.floatReset();\n\n // Send event to tell that the whole advertisement\n // thing is finished.\n let eventName = 'AD_CANCELED';\n let eventMessage = 'Advertisement has been canceled.';\n this.eventBus.broadcast(eventName, {\n name: eventName,\n message: eventMessage,\n status: 'warning',\n analytics: {\n category: this.eventCategory,\n action: eventName,\n label: this.options.domain,\n },\n });\n\n // Preload the advertisement.\n this._requestAd().\n then(vastUrl => resolve(vastUrl)).\n catch(error => reject(error));\n });\n }", "function cancelNewComment() {\n tinymce.activeEditor.remove();\n const newCommentForm = document.querySelector(\"#newCommentForm\");\n newCommentForm.parentNode.removeChild(newCommentForm);\n\n hiddenCommentBtn.style.display = \"block\";\n hiddenCommentBtn = null;\n }", "function goCancel() {\n datacontext.revertChanges(vm.learningItem);\n goBack();\n }", "function cancel() {\n history.goBack();\n }", "function creditsAbort() {\n \tmusic_rasero.stop();\t\t\t\t\t// Stop music\n \tdefDemo.next();\t\t\t\t\t\t\t// Go to next part (End \"crash\")\n }", "cancelMe() {\n if (this.editFlag) {\n this.viewMe();\n } else {\n this.removeFromParentWithTransition(\"remove\", 400);\n }\n }", "function cancel(event) {\n let dialog = document.getElementById(\"dialog\");\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"post\").value = \"\";\n document.getElementById(\"submit-btn\").innerHTML = \"Submit\";\n dialog.open = false;\n console.log(\"cancel\");\n}", "async kill() {\n this.killed = true;\n if (this.inviteInProgress) await this.inviteInProgress.cancel();\n else if (this.dlg && this.dlg.connected) {\n const duration = moment().diff(this.dlg.connectTime, 'seconds');\n this.logger.debug('SingleDialer:kill hanging up called party');\n this.emit('callStatusChange', {callStatus: CallStatus.Completed, duration});\n this.dlg.destroy();\n }\n if (this.ep) {\n this.logger.debug(`SingleDialer:kill - deleting endpoint ${this.ep.uuid}`);\n await this.ep.destroy();\n }\n }", "function cancel() {\n gotoReturnState();\n }", "cancel() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n if (this.intervalId) {\n clearInterval(this.intervalId);\n }\n this.timeoutId = undefined;\n this.intervalId = undefined;\n this.sequence = 0;\n this.isActive = false;\n this.times = [];\n if (this.rejectCallback) {\n this.rejectCallback(new Error('cancel'));\n }\n this.rejectCallback = undefined;\n }", "cancelGroupCreation() {\n this.setState({createGroupModal: false})\n }", "function cancel() {\n\twoas.log(\"Called deprecated function: cancel\");\n\twoas.ui.cancel();\n}", "function cancelWrite() {\n pendingRecord = null;\n writePending = false;\n overwritePendingText.classList.remove('active');\n overwriteCancelButton.classList.remove('active');\n}", "static cancel() {\n return new Flag(\"cancel\");\n }", "function addTramiteCancel(){\n vm.modalAddTramite.dismiss();\n vm.name = \"\";\n vm.surnames = \"\";\n vm.rfc = \"\";\n vm.tramite = \"\";\n }", "cancel()\n{\n console.log('cancel');\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: this.recordId,\n objectApiName: 'Opportunity', // objectApiName is optional\n actionName: 'view'\n }\n });\n}", "function cancel() {\r\n click(getCancel());\r\n waitForElementToDisappear(getCancel());\r\n }", "function cancelMyBid() {\n\n}", "function cancelAutoSlide() {\n\n clearTimeout(autoSlideTimeout);\n\n }", "function cancelOffers () {\n}", "function cancel() {\n $mdDialog.cancel();\n }", "function cancel() {\n $mdDialog.cancel();\n }", "cancel() {\n throw new Error(\"Not implemented.\")\n }", "cancel() {\n this.modal.jQueryModalFade.removeClass('modal_fade_trick');\n this.modal.jQueryModalWindow.css('display', 'none');\n this.clear();\n this.clearInvalid();\n this.hideNotes();\n if(!this.good){\n this.initPlaceholders();\n }\n }", "function cancel() {\n if (props.interview) {\n return transition(SHOW);\n }\n return transition(EMPTY);\n }", "function mainDemoAbort() {\n \tcurrentPos = 0; \t\t\t\t\t\t\t\t\t\t// Reset demo schedule (For when it restarts)\n \tcurrentPart.loop = false;\t\t\t\t\t\t\t\t// Switch off demo animation loop\n \tnextButton.style.opacity = \"0\"; \t\t\t\t\t\t// Hide \"any key\" button\n \tnextButton.style.cursor = \"default\"; \n nextButton.removeEventListener('mousedown', spaceBar);\t// Remove any events associated with \"Any key\" button.\n nextButton.removeEventListener('touchend', spaceBar);\n \tmusic_Sashy.stop();\t\t\t\t\t\t\t\t\t\t// Stop the main music\n \tdefDemo.next();\t\t\t\t\t\t\t\t\t\t\t// Go to the next part (Credits screen).\n }", "function deleteAppointment() {\n\n transition(\"DELETING\", true)\n \n // Async call to initiate cancel appointment\n props.cancelInterview(props.id).then((response) => {\n\n transition(\"EMPTY\")\n }).catch((err) => {\n\n transition(\"ERROR_DELETE\", true);\n });\n }", "stopMeeting() {\n if (this.jitsiObj) {\n this.jitsiObj.dispose();\n this.jitsiObj = undefined;\n this.currentMeeting = undefined;\n }\n }", "function cancelGoBack()\n{\n\tvar gobackUrl = nlapiResolveURL('RECORD', nlapiGetFieldValue('custpage_lpctype'), nlapiGetFieldValue('custpage_lpcid'), 'VIEW');\n\twindow.location.href = nsDomain+gobackUrl;\n}", "cancelHoldExit() {\n this.state = HoldsDirectorState.INBOUND;\n }", "cancelTermsAndConditions(){\n this.displayMode = 'none';\n this.isAgreed = false;\n }", "function cancel(){\n toggleView(\"ads\");\n}", "function LPcancelClicked(){\r\n if (LPCANCEL && LPflag==1){\r\n LPshowLayer();\r\n LPCLOSE=false;\r\n LPCANCEL=false;\r\n }\r\n else\r\n {\r\n setTimeout(\"LPcancelRedirect()\", 1000);\r\n }\r\n}", "cancel() {\n if (!this._flying) {\n return;\n }\n this._flying = false;\n this._time1 = null;\n this._time2 = null;\n if (this._callback) {\n this._callback = null;\n }\n this.fire(\"canceled\", true, true);\n }", "function CancelModalDialog() {\r\n tb_remove();\r\n }", "function cancel(){\n this.rotation = this.previousRotation;\n this.mouseSphere0 = null;\n}", "function cancel(e) {\n e.parentNode.parentNode.removeChild(e.parentNode)\n}", "function CloseAdam()\n{\n if (adam) {\n adam.destroy();\n adam = null;\n }\n adamState = kAdamBad;\n}", "function cancel() {\n props.dispatch({\n type: 'CLEAR_TRAVEL_FORM',\n });\n toggle();\n }", "function cancel() {\n window.history.back();\n}", "function clickedCancel()\r\n{\r\n recordsetDialog.onClickCancel(window);\r\n}", "function stopAfkWarningTimer() {\n afk.active = false;\n}", "function cancelInterview(id) {\n console.log(\"in cancel interview\")\n \n return axios.delete(`/api/appointments/${id}`)\n .then(() => {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n \n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n \n setState(updateSpots({\n ...state,\n appointments: appointments\n }))\n })\n \n }", "function cancelstehenbleiben(){\n clearTimeout(stehenbleibencancel);\n}", "cancel() {\n clearTimeout(this.timeoutID);\n delete this.timeoutID;\n }", "function dialogCancel(){\n\n // clear old inputs\n $content.find( localCfg.tabQueryItems ).remove();\n $content.find( localCfg.tabResultList ).empty();\n $content.find( localCfg.tabDistrList ).empty();\n $content.find( localCfg.tabDistrChart ).empty();\n $content.find( localCfg.tabAdjustList ).empty();\n\n // close the dialog\n dialog.close();\n\n }", "cancel() {\n\t\t\tif (!get(this, 'isDestroyed')) {\n\t\t\t\tset(this, 'timestamp', get(this, 'backupTimestamp'));\n\t\t\t}\n\t\t\tthis.sendAction('onClose');\n\t\t}", "onCancelCreateTeamDialog(e) {\n e.preventDefault();\n this.props.dispatch(Action.getAction(adminActionTypes.SET_TEAM_DIALOG_OPEN, { IsOpen: false }));\n }", "onCancelButtonClick() {\n this.representedHTMLElement.parentNode.removeChild(this.representedHTMLElement);\n }", "function cancel()\n {\n dirtyController.setDirty(false);\n hideWorkflowEditor();\n hideWorkflowUpdateEditor();\n selectWorflow(selectedWorkflow);\n }", "function cancel_delegation()\n {\n browser.browserAction.onClicked.removeListener(focus_menu_tab);\n browser.browserAction.setPopup({ popup: \"/popup_ui/page.html\" });\n menu_tab_id = null;\n }", "cancelForm() {\n const { id } = this.state;\n const body = { id, abort: true };\n this.submitForm(body);\n }", "function createAccountCancelButtonClicked() {\n accountCreationCancelButtonEl.addEventListener(\"click\", function () {\n createAccountModalTrigger();\n });\n }", "function cancelPomo() {\n let panel = document.getElementById(\"cancel-button-dialog\");\n timerEnd = time - 1;\n setPomoById(currentPomoID, previousState);\n cancelTimerFlag = 1;\n closeCancelDialog();\n if (getPomoById(currentPomoID).actualPomos == 0) {\n getPomoById(currentPomoID).sessionStatus = SESSION_STATUS.incomplete;\n setPomo(INVALID_POMOID);\n }\n let mainpage = document.getElementById(\"main-page\");\n let timerpage = document.getElementById(\"timer-page\");\n mainpage.style.display = \"\";\n timerpage.style.display = \"none\";\n updateTable();\n}", "function cancelInterview(id, interview) {\n return axios\n .delete(`/api/appointments/${id}`, { interview })\n .then((response) => {\n const appointment = {\n ...state.appointments[id],\n interview: null,\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment,\n };\n return setState({\n ...state,\n appointments,\n });\n });\n }", "function cancelInterview(id) {\n \n return axios.delete(`api/appointments/${id}`)\n .then(() => \n dispatch({ type : SET_INTERVIEW, value : {id, inverview : null }}))\n }", "cancel() {\n this.dispatchEvent(new PayloadEvent(ModifyEventType.CANCEL, this.clone_));\n this.setActive(false);\n }", "function cancel(e) {\n titleTask.value = null;\n descriptionTask.value = null;\n e.target.parentElement\n .parentElement\n .parentElement\n .classList.toggle('show');\n root.classList.toggle('opacity');\n document.body.classList.toggle('stop-scrolling');\n}", "cancel() {\n this.cancelSource();\n }", "modalCancel(){\n\t\t// save nothing\n this.setValues = null;\n\t\t// and exit \n this.modalEXit();\n }", "stop() {\n this.target = null;\n }", "cancel(){\r\n\t\tthis.undoButton.addEventListener(\"click\" , () =>{\r\n\t\tclearInterval(this.chronoInterval);\r\n\t\tthis.time = 1200000/1000; \r\n\t\talert (\"Votre annulation de réservation vélo a bien été prise en compte.\");\r\n\t\tthis.nobooking.style.display=\"block\";\r\n this.textReservation.classList.add(\"invisible\");\r\n\t\tthis.bookingResult.classList.add(\"invisible\"); \r\n\t\tthis.drawform.style.display = \"none\";\r\n\t\tthis.identification.style.display = \"none\";\r\n\t\tthis.undoButton.style.opacity = \"0\";\r\n\t\tthis.infoStation.style.opacity = \"1\";\r\n\t\tthis.infoStation.scrollIntoView({behavior: \"smooth\", block: \"center\", inline: \"nearest\"});\r\n\t\tdocument.getElementById(\"search\").style.height = \"initial\"; \r\n\t\tsessionStorage.clear();\r\n\t })\r\n\t}", "[actions.CLOSE_CREATE_MODE] () {\n this.commit(mutations.SET_CREATE_MODE, false)\n }", "function cancel() {\n offset = -1;\n phase = 0;\n }", "cancel() {\n this.loading = true;\n if (this.appointmentCmp === 'true') {\n console.log('in if')\n const custEvent = new CustomEvent(\n 'forclose', {\n detail: false\n });\n this.dispatchEvent(custEvent);\n } else {\n console.log('coming in else');\n this[NavigationMixin.Navigate]({\n type: \"standard__recordPage\",\n attributes: {\n recordId: this.recordid,\n objectApiName: \"Lead\", // objectApiName is optional\n actionName: \"view\"\n }\n });\n }\n this.loading = false;\n }", "async cancel() {\n throw new Error(this.cancelMessage);\n }", "cancelReply() {\n this.setState({\n creatingReply: false\n });\n }", "function cancelCreatePinModal() {\n \n $(\".modal\").hide();\n\n //Clear the textBoxes\n $(\"#creatPinModalName\").val('');\n $(\"#creatPinModalDescription\").val('');\n $(\"#creatPinModalTags\").val('');\n\n deletePin();\n createdPin = null;\n\n}" ]
[ "0.6329806", "0.62861603", "0.6128394", "0.60012776", "0.5954276", "0.59452295", "0.5927591", "0.5927563", "0.5926853", "0.5917221", "0.58609056", "0.58424795", "0.5825814", "0.5819498", "0.58065873", "0.57984406", "0.57947487", "0.5792172", "0.5782675", "0.576391", "0.57634395", "0.57524395", "0.5717016", "0.5707417", "0.56948376", "0.5625112", "0.5617153", "0.5583699", "0.5548576", "0.55341125", "0.5527552", "0.5518766", "0.55078965", "0.549888", "0.54829407", "0.5473767", "0.5467797", "0.54268277", "0.5423172", "0.5420042", "0.5418807", "0.54096013", "0.5404514", "0.5397161", "0.5384602", "0.5371493", "0.5369331", "0.5354999", "0.5353769", "0.5325369", "0.5319423", "0.531272", "0.5306111", "0.5306111", "0.5285656", "0.5285001", "0.5277175", "0.5259761", "0.52517897", "0.5248412", "0.5246034", "0.5235824", "0.5234938", "0.52285415", "0.5226396", "0.5225929", "0.52215385", "0.5218891", "0.52161545", "0.5214129", "0.5209838", "0.5196221", "0.51917154", "0.51856893", "0.51849324", "0.51803565", "0.5178176", "0.5177659", "0.51742566", "0.5172681", "0.5169557", "0.51688814", "0.51677865", "0.5167257", "0.5163364", "0.5163315", "0.51609075", "0.5159539", "0.51565653", "0.5156119", "0.51496816", "0.5142454", "0.51288116", "0.5128692", "0.5120992", "0.51161915", "0.51122904", "0.5107049", "0.5102323", "0.5101046" ]
0.70813686
0
This function clears the inputs on the new lead form
function clearNewLeadForm() { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#AddLead').fadeOut(500, function () { $('#AddLead').hide(); $('#newLead').val(""); $('#newContactPerson').val(""); $('#newContactNumber').val(""); $('#newEmail').val(""); $('#newPotentialAmount').val(""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearForm() {\n $(\"#name-input\").val(\"\");\n $(\"#destination-input\").val(\"\")\n $(\"#firstTime-input\").val(\"\");\n $(\"#frequency-input\").val(\"\");\n }", "function clearForm() {\n\t\tconst blankState = Object.fromEntries(\n\t\t\tObject.entries(inputs).map(([key, value]) => [key, \"\"])\n\t\t);\n\t\tsetInputs(blankState);\n\t}", "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 }", "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 clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n }", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "function clearFields() {\n $('#input_form')[0].reset()\n }", "clearInputs() {\n\t\t$(this.elementConfig.nameInput).val(\"\");\n\t\t$(this.elementConfig.courseInput).val(\"\");\n\t\t$(this.elementConfig.gradeInput).val(\"\");\n\n\t}", "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}", "clearFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#reference').value = '';\n document.querySelector('#price').value = '';\n }", "function clearInputs(){\n\t//array is filled with the HTML ids of the input value fields\n\t//array loops through each id,resets the value to empty string\n\t\tvar inputIds = [\n\t\t\t\ttitleInput,\n\t\t\t\turgency,\n\t\t\t\t ];\n\n\t\t\tinputIds.forEach(function(id){\n\t\t\t\t\tid.value = '';\n\t\t\t});\n}", "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function clearForm() {\n fullName.value = \"\";\n message.value = \"\";\n hiddenId.value = \"\";\n}", "function clearForm() {\n isNewObject = true;\n var $dialog = dialog.getElement();\n $('input:text', $dialog).val('');\n $('.input-id', $dialog).val(0);\n $('.input-password', $dialog).val('');\n $('.input-connection-id', $dialog).val(0);\n $('.input-engine', $dialog)[0].selectedIndex = 0;\n $('.input-port', $dialog).val(engines.mysql.port);\n $('.input-confirm-modifications', $dialog).prop('checked', true);\n $('.input-save-modifications', $dialog).prop('checked', false);\n $('.input-trusted-connection', $dialog).prop('checked', false);\n $('.input-instance-name', $dialog).val('');\n }", "clearFields() {\n document.getElementById('title').value='';\n document.getElementById('author').value='';\n document.getElementById('isbn').value='';\n }", "function clear_inputs() {\n\n\t\t\t\t$('.form-w').val(\"\");\n\t\t\t\t$('.form-b').val(\"\");\n\t\t\t\t$('.form-mf').val(\"\");\n\t\t\t\t$('.form-mt').val(\"\");\n\n\t\t\t\tlocalStorage.clear();\n\n\t\t\t}", "clearFields() {\r\n document.getElementById('title').value = '',\r\n document.getElementById('author').value = '',\r\n document.getElementById('isbn').value = '';\r\n }", "function clearFields() {\n movie_name.value = '';\n release_date.value = '';\n movie_banner.value = '';\n description.value = '';\n}", "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item_year\").val(\"\");\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_search\").prop(\"disabled\", true);\n $(\"#btn_add_item\").prop(\"disabled\", true);\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n // disable link to author page\n $(\"#link_current_author\").removeClass(\"text-primary\");\n $(\"#link_current_author\").addClass(\"text-muted\");\n // hide editions page\n $(\"#page_editions\").hide(\"slow\");\n }", "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "function clearInputs() {\r\n document.getElementById('addressBookForm').reset();\r\n }", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function clear_form_data() {\n $(\"#promo_name\").val(\"\");\n $(\"#promo_type\").val(\"\");\n $(\"#promo_value\").val(\"\");\n $(\"#promo_start_date\").val(\"\");\n $(\"#promo_end_date\").val(\"\");\n $(\"#promo_detail\").val(\"\");\n $(\"#promo_available_date\").val(\"\");\n }", "function resetAddForm(){\r\n TelephoneField.reset();\r\n FNameField.reset();\r\n LNameField.reset();\r\n TitleField.reset();\r\n MailField.reset();\r\n AddField.reset();\r\n MobileField.reset();\r\n }", "function clear_form_data() {\n $(\"#promotion_title\").val(\"\");\n $(\"#promotion_promotion_type\").val(\"\");\n $(\"#promotion_start_date\").val(\"\");\n $(\"#promotion_end_date\").val(\"\");\n $(\"#promotion_active\").val(\"\");\n }", "function resetPresidentForm(){\n fechaInicioField.setValue('');\n descripcionEventoField.setValue('');\n }", "function clearFields() {\n $('#p1-fn-input').val('');\n $('#p1-ln-input').val('');\n $('#p2-fn-input').val('');\n $('#p2-ln-input').val('');\n $('#PIN').val('');\n}", "static clearFields() {\n document.querySelector('#date').value = '';\n document.querySelector('#title').value = '';\n document.querySelector('#post').value = '';\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 clearForm(){\nnum.value=\"\";\nservice.value=\"\";\n}", "function clearRepairAgentInputs()\r\n {\r\n $('#claimdetails-repairagentid-input').val('');\r\n $('#claimdetails-repairagentname-input').val('');\r\n $('#claimdetails-repairagentphone-input').val('');\r\n $('#claimdetails-repairagentemail-input').val('');\r\n $('#claimdetails-repairagentunithouse-input').val('');\r\n $('#claimdetails-repairagentstreet-input').val('');\r\n $('#claimdetails-repairagentsuburbcity-input').val('');\r\n $('#claimdetails-repairagentstate-input').val('');\r\n $('#claimdetails-repairagentpostcode-input').val('');\r\n }", "function clearRepairAgentInputs()\r\n {\r\n $('#claimdetails-repairagentid-input').val('');\r\n $('#claimdetails-repairagentname-input').val('');\r\n $('#claimdetails-repairagentphone-input').val('');\r\n $('#claimdetails-repairagentemail-input').val('');\r\n $('#claimdetails-repairagentunithouse-input').val('');\r\n $('#claimdetails-repairagentstreet-input').val('');\r\n $('#claimdetails-repairagentsuburbcity-input').val('');\r\n $('#claimdetails-repairagentstate-input').val('');\r\n $('#claimdetails-repairagentpostcode-input').val('');\r\n }", "function clearFields() {\n name.value = \"\";\n title.value = \"\";\n hourlyRate.value = \"\";\n hours.value = \"\";\n salary.value = \"\";\n baseSalary.value = \"\";\n commissionRate.value = \"\";\n sales.value = \"\";\n commissionOption.checked = false;\n salaryOption.checked = false;\n hourlyOption.checked = false;\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\n }", "function resetPresidentForm(){\n consecuenciasField.setValue('');\n descripcionField.setValue('');\n }", "function clearDetailForm(){\n inputIdDetail.val(\"\");\n inputDetailItem.val(\"\");\n inputDetailQuantity.val(\"\");\n inputDetailPrice.val(\"\");\n inputDetailTotal.val(\"\");\n inputDetailItem.focus();\n}", "_clearInputs() {\n this.elements.peopleInput.value = \"\";\n this.elements.descriptionInput.value = \"\";\n this.elements.titleInput.value = \"\";\n return this;\n }", "function clearFields(){\n document.querySelector('#name').value = ''\n document.querySelector('#caption').value = ''\n document.querySelector('#url').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 clearInput() {\n inputFields[0].value = '';\n inputFields[1].value = '';\n inputFields[2].value = '';\n inputFields[3].value = ''\n}", "function clear_form_data() {\n $(\"#cust_id\").val(\"\");\n $(\"#order_id\").val(\"\");\n $(\"#item_order_status\").val(\"\");\n }", "function clear_cFlowForm() {\r\n document.forms['cFlowForm'].txt_startValue.value = \"\";\r\n document.forms['cFlowForm'].txt_endValue.value = \"\";\r\n console.log('Form reset');\r\n}", "function clear_cFlowForm() {\r\n document.forms['cFlowForm'].txt_startValue.value = \"\";\r\n document.forms['cFlowForm'].txt_endValue.value = \"\";\r\n console.log('Form reset');\r\n}", "function clearAddDetails(){\n\tdocument.getElementById(\"addName\").value = \"\";\n\tdocument.getElementById(\"addAC\").value = \"\";\n\tdocument.getElementById(\"addMaxHP\").value = \"\";\n\tdocument.getElementById(\"addInitiative\").value = \"\";\n\tresetAddFocus();\n}", "function clearForm() {\n\n $(\"#formOrgList\").empty();\n $(\"#txtName\").val(\"\");\n $(\"#txtDescription\").val(\"\");\n $(\"#activeFlag\").prop('checked', false);\n $(\"#orgRoleList\").empty();\n }", "function clearEditLeadForm() {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in future operations\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n $('#LeadDetails').fadeOut(500, function () {\n $('#LeadDetails').hide();\n $('#editLead').val(\"\");\n $('#editContactPerson').val(\"\");\n $('#editContactNumber').val(\"\");\n $('#editEmail').val(\"\");\n $('#editPotentialAmount').val(\"\");\n });\n}", "function clearFields() {\r\n\t\t\t\t\t\t$('#tf_Id').val(null);\r\n\t\t\t\t\t\t$('#tf_Descricao').val(null);\r\n\t\t\t\t\t\t$('#slc_Marca').val(0);\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').val(0);\r\n\t\t\t\t\t\t$('#slc_Status').val(0);\r\n\t\t\t\t\t\t$('#btn-operation').val(\"Criar Modelo\");\r\n\t\t\t\t\t}", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clearForm() {\n let assignment = document.getElementById('assignment');\n let description = document.getElementById('description');\n \n assignment.value = \"\";\n description.value = \"\";\n assignment.focus();\n}", "function clearInputfields() {\r\n\t$('#title').val('');\r\n\t$('#desc').val('');\r\n\t$('#email').val('');\r\n}", "function clearForm() {\n $(\"#train-input\").val(\"\");\n $(\"#dest\").val(\"\");\n $(\"#start-time\").val(\"\");\n $(\"#freq\").val(\"\");\n}", "function clearInputs(){\n signUpName.value = \"\" ;\n signUpEmail.value = \"\" ;\n signUpPass.value = \"\" ;\n}", "function clearInputFields() {\n $('input#date').val('');\n $(\"select\").each(function () {\n this.selectedIndex = 0;\n });\n }", "function clearForm() {\n\t\t\t$('#rolForm input[type=\"text\"]').val(\"\");\n\t\t}", "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 clearHeadForm(){\n inputHeadEntity.val(\"\");\n inputHeadIdEntity.val(\"\");\n inputHeadTotal.val(\"\");\n}", "function clearInput(){\n $(\"#train-name\").val(\"\");\n\n $(\"#train-destination\").val(\"\");\n\n $(\"#train-time\").val(\"\");\n\n $(\"#train-freq\").val(\"\");\n }", "function clearInputs() {\n setInputTitle(\"\");\n setInputAuthor(\"\");\n setInputPages(\"\");\n setInputStatus(\"read\");\n}", "function clear_form_data() {\n $(\"#inventory_name\").val(\"\");\n $(\"#inventory_category\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_count\").val(\"\");\n }", "function resetForms() {\n document.getElementById('location-search').value=\"\";\n document.getElementById('crawlname').value=\"\";\n}", "function ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'||this.type=='hidden') {\n this.value = '';\n }\n else if (this.type == 'radio' || this.type == 'checkbox') {\n this.checked = false;\n }\n else if (this.type == 'select-one' || this.type == 'select-multiple') {\n this.value = '-1';\n }\n });\n\n }", "function resetForm() {\n\t\t// Zero out all values for new recipe entry \n\t\t$(\"recipeTitle\").value = \"\"\n\t\t$(\"recipeSummary\").value = \"\"\n\t\t$(\"userDifficulty\").value = \"\"\n\t\t$(\"chooseDate\").value = \"\"\n\t\t$(\"flavorRange\").value = \"\"\n\t\t$(\"ingredients\").value = \"\"\n\t\t$(\"directions\").value = \"\"\n\t\tclearRadioValue('recipeCat');\n\t}", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \n \t\n \t$('#frmMain').find(':input').each(function(){\n \t\tvar id = $(this).prop('id');\n \t\tvar Value = $('#' + id).val(\" \");\n \t});\n \t \t\n \t$('#txtShape').val('Rod'); \n \t$(\"#drpInch\").val(0);\n $(\"#drpFraction\").val(0);\n \n UncheckAllCheckBox();\n clearSelect2Dropdown();\n \n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \n }", "function clearForm() {\n $(\"#city-input\").empty();\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 resetform() {\n clearField(nameField);\n clearField(emailField);\n clearField(messageField);\n}", "function clearFields() {\n document.getElementById('former').remove();\n}", "function clearInputFields() {\n zipcodeInput.val('');\n cityInput.val('');\n stateInput.val('');\n} //end clearInputFields", "function clearTheInput(){\n $(\"#inpTrainName\").val(\"\");\n $(\"#inpDest\").val(\"\");\n $(\"#inpFreq\").val(\"\");\n $(\"#inpTrainTime\").val(\"\");\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}", "clearInput() {\n if (this.getCurTab() === \"dbms\") {\n var curDocName = DOC.iSel(\"docNameID\").value; // Stores current value of docName\n DOC.iSel(\"dbmsFormID\").reset(); // Resets entire form\n DOC.iSel(\"docNameID\").value = curDocName; // Added so docname is not reset\n } else if (this.getCurTab() === \"fs\") {\n var curDocName = DOC.iSel(\"docNameID2\").value;\n DOC.iSel(\"fsFormID\").reset();\n DOC.iSel(\"docNameID2\").value = curDocName;\n }\n }", "function clearForm() {\r\n\t\t\t$('#areaForm input[type=\"text\"]').val(\"\");\r\n\t\t}", "function clearForm() {\n for (let i = 0; i < inputRefs.current.length; i++) {\n if (inputRefs.current[i].current === null) { break; }\n inputRefs.current[i].current.clearValue();\n }\n setData({});\n setAuthError(\"\");\n }", "function clearForm() {\n for (let i = 0; i < inputRefs.current.length; i++) {\n if (inputRefs.current[i].current === null) { break; }\n inputRefs.current[i].current.clearValue();\n }\n setData({});\n setAuthError(\"\");\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}", "function resetInputs () {\n document.querySelector('#nm').value = \"\"\n document.querySelector('#desc').value = \"\"\n }", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\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 clearForm() {\n document.getElementById('dest').value = '';\n document.getElementById('startDate').value = '';\n document.getElementById('endDate').value = '';\n}", "clear() {\n this.jQueryName.val('');\n this.jQueryEmail.val('');\n this.jQueryCount.val('');\n this.jQueryPrice.val('$');\n\n this.jQueryCities.selectAll.prop('checked', false);\n this.jQueryCities.cities.prop('checked', false);\n\n this.clearInvalid();\n this.hideNotes();\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 clearForm(){\n\t$('#hid_id_data').val('');\n\t$('#hid_data_saldo').val('');\n\t$('#hid_data_nm_awl').val('');\n $(\"#txttgl\").val('');\n $('#txtnominal').val('');\n $('#txtketerangan').val(''); \n}", "function clear_form_data() {\n $(\"#product_id\").val('');\n $(\"#rec_product_id\").val('');\n $(\"#rec_type_id\").val('1');\n $(\"#weight_id\").val('');\n }", "clearFields() {\n this._form.find('.form-group input').each((k, v) => {\n let $input = $(v);\n if ($input.attr('type') !== \"hidden\") {\n $input.val('');\n }\n });\n }", "clearFields(){\n this.titleInput.value = '';\n this.bodyInput.value = '';\n }", "function clearInputFields(){\n $( '#idInput').val( '' );\n $( '#firstNameInput').val( '' );\n $( '#lastNameInput').val( '' );\n $( '#roleInput').val( '' );\n $( '#salaryInput').val( '' );\n}", "function clearAddInput() {\n $(\".add-firstName\").val(\"\");\n $(\".add-lastName\").val(\"\");\n $(\".add-phone\").val(\"\");\n $(\".add-address\").val(\"\");\n}", "static clearInput() {\n inputs.forEach(input => {\n input.value = '';\n });\n }", "function resetAddMenuForm(){\r\n MenuNameField.reset();\r\n MenuDescField.reset();\r\n MStartDateField.reset();\r\n // MEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "function clear_form_data() {\n $(\"#recommendation_id\").val(\"\");\n $(\"#recommendation_productId\").val(\"\");\n $(\"#recommendation_suggestionId\").val(\"\");\n $(\"#recommendation_categoryId\").val(\"\");\n $(\"#recommendation_old_categoryId\").val(\"\");\n }", "clearField() {\n document.querySelector('#name').value = '';\n document.querySelector('#email').value = '';\n document.querySelector('#profession').value = '';\n }", "function clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function clearAppointmentInput() {\n\t$('#description').val(\"\");\n\t$('#addAppointmentDatepicker').val(\"\");\n\t$('#timepicker').val(\"\");\n\t$('#duration').val(\"\");\n\t$('#owner').val(\"\");\n}", "function clearInputs() {\n // Reset input values\n $('#firstNameInput').val('');\n $('#lastNameInput').val('');\n $('#employeeIDInput').val('');\n $('#employeeTitleInput').val('');\n $('#annualSalaryInput').val('');\n\n // Debugging and Testing script\n if (verbose) {\n console.log('in clearInputs()');\n }\n}", "function clearAddInputs(){\n $addUserNameInput.value = ''\n $addFullNameInput.value = ''\n $addEmailInput.value = ''\n $addPasswordInput.value = ''\n}", "function clear_form_data() {\n var item_area=$('#item_area');\n console.log(\"Clear all data\");\n item_area.val(\"\");\n $('#change_course_dis_text').val(\"\");\n $('#course_name_text').val(\"\");\n $('#course_dis_text').val(\"\");\n\n }" ]
[ "0.797564", "0.7899326", "0.78950864", "0.7831015", "0.78022206", "0.77535695", "0.77535695", "0.77535695", "0.77338415", "0.7683781", "0.76666725", "0.76577467", "0.7613719", "0.7609766", "0.76073486", "0.76067376", "0.7603794", "0.7599629", "0.7596057", "0.759066", "0.7589678", "0.7586938", "0.75808185", "0.7557898", "0.7545679", "0.75427943", "0.7534043", "0.75254124", "0.7520828", "0.75197524", "0.7505747", "0.75036144", "0.750229", "0.750229", "0.7497999", "0.7492057", "0.7482468", "0.74775183", "0.74656326", "0.7448166", "0.74454427", "0.7436499", "0.7433831", "0.7433831", "0.74319685", "0.74185085", "0.74049914", "0.74035156", "0.7400039", "0.73957944", "0.73957074", "0.7395412", "0.73924416", "0.73900056", "0.73896766", "0.7382393", "0.7380275", "0.7378365", "0.7377034", "0.73733854", "0.73721033", "0.7371551", "0.73713297", "0.73690134", "0.7366818", "0.7366439", "0.7364934", "0.7359878", "0.73565596", "0.73542595", "0.7349906", "0.7347877", "0.73468983", "0.7346158", "0.73448294", "0.73448294", "0.7343516", "0.7342847", "0.7342845", "0.73289883", "0.7321933", "0.73203593", "0.73136634", "0.73136634", "0.7312565", "0.73082066", "0.7308205", "0.7307219", "0.73052543", "0.73047453", "0.73011", "0.72941464", "0.72926843", "0.72921014", "0.7290114", "0.7283298", "0.7283298", "0.7279037", "0.7274375", "0.7272485", "0.72670764" ]
0.0
-1
This function cancels the editing of an existing lead's details
function cancelEditLead() { clearEditLeadForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelNewLead() {\n clearNewLeadForm();\n}", "function editCancelFunc(){\n setEdit(null);\n }", "function cancelEditCard() {\n // 8-1 Set isEditing flag to update the view.\n this.isEditing = false\n\n // 8-2 Reset the id we want to edit.\n this.idToEdit = false\n\n // 8-3 Clear our form.\n this.clearForm()\n}", "cancelEdit () {\n this.editCache = null\n this.editingTrip = null\n this.editType = null\n }", "function cancelEdit() {\n resetForm();\n formTitle.innerHTML = 'Add Link';\n cancelButton.parentElement.removeChild(cancelButton);\n updateButton.parentElement.removeChild(updateButton);\n saveButton.classList.remove('hidden');\n }", "function cancelEditOpp() {\n clearEditOppForm();\n}", "function cancel() {\n\t\tdelete state.people[id]\n\t\temit(\"person modal canceled\")\n\t}", "function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}", "function cancelEditSale() {\n clearEditSaleForm();\n}", "function handleCancelEdit() {\n updateIsEditMode(false);\n }", "cancelEdit() {\n this.set('isManage', false);\n this.folder.set('isEdit', false);\n this.folder.rollbackAttributes();\n }", "function cancelEdit(){\r\n\t//clears fields\r\n\t$(\"#edt-g-name\").val(\"\");\r\n\t$(\"#edt-g-time\").val(\"\");\r\n\t$(\"#auto-input-1\").val(\"\");\r\n\tvar selMin = $('#selEdtMin');\r\n\tselMin.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMin.selectmenu(\"refresh\", true);\r\n\tvar selMax = $('#selEdtmax');\r\n\tselMax.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMax.selectmenu(\"refresh\", true);\r\n\t//hides edit fields and shows games list\r\n\t$(\"#editList\").show();\r\n\t$(\"#editBlock\").hide();\r\n\t$(\"#frm1\").show();\r\n\t$(\"#para1\").show();\r\n\t//takes save function off button\r\n\tvar savBtn = $('#editSave');\r\n\tsavBtn.removeAttr('onClick');\r\n\t}", "function cancelEdit() {\n\n for (let i = 0; i < addCommentButtons.length; i++)\n addCommentButtons[i].style.display = \"initial\";\n\n const articleId = this.id.replace('delete-', '');\n tinymce.activeEditor.remove();\n const content = document.querySelector(`#content-${articleId}`);\n content.innerHTML = initialText;\n resetButtonsFromEditing(articleId);\n }", "cancel() {\n // Rollback edit profile changes\n this.changeset.rollback(); //this.model.reload();\n\n this.set('editProjectShow', false);\n }", "function cancel_score_edit()\n\t{\n\t\tdocument.getElementById('score_edit_form').reset();\n\t\t$('#score_edit').dialog('close');\n\t}", "function cancel()\n {\n dirtyController.setDirty(false);\n hideWorkflowEditor();\n hideWorkflowUpdateEditor();\n selectWorflow(selectedWorkflow);\n }", "cancelEdit() {\n const me = this,\n { inputField, oldValue } = me,\n { value } = inputField;\n\n if (!me.isFinishing && me.trigger('beforecancel', { value: value, oldValue }) !== false) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n me.trigger('cancel', { value, oldValue });\n me.isFinishing = false;\n }\n }", "function editzselex_cancel()\n{\n Element.update('zselex_modify', '&nbsp;');\n Element.show('zselex_articlecontent');\n editing = false;\n return;\n}", "function cancelEdit(){\n //close edit box\n closeEditBox();\n}", "function editingCanceled() {\n\tlocation.reload();\n}", "editCancel() {\n\t \t\t\tconst { travel } = this.state;\n\t \t\t\t\tthis.props.cancel(travel.key);\n\t }", "function cancelEdit() {\n var id = $(this).data(\"id\");\n var text = $(\"#span-\"+id).text();\n\n $(this)\n .children()\n .hide();\n $(this)\n .children(\"input.edit\")\n .val(text);\n $(this)\n .children(\"span\")\n .show();\n $(this)\n .children(\"button\")\n .show();\n }", "function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }", "cancelEdit() {\n const me = this,\n {\n inputField,\n oldValue,\n lastAlignSpec\n } = me,\n {\n target\n } = lastAlignSpec,\n {\n value\n } = inputField;\n\n if (!me.isFinishing && me.trigger('beforeCancel', {\n value,\n oldValue\n }) !== false) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n me.trigger('cancel', {\n value,\n oldValue\n });\n\n if (target.nodeType === 1) {\n target.classList.remove('b-editing');\n target.classList.remove('b-hide-visibility');\n }\n\n me.isFinishing = false;\n }\n }", "cancelEdit(todo) {\n this.editTodo = null;\n todo.isEdited = false;\n }", "cancelEditType() {\n this.type = this.editing;\n this.editing = '';\n }", "cancelEdit() {\n this.folderUser.set('isEdit', false);\n this.set('isManage', false);\n }", "function cancel () {\n closeDialog();\n if (isEditPage) {\n table.restoreBackup();\n }\n }", "function cancel () {\n closeDialog();\n if (isEditPage) {\n table.restoreBackup();\n }\n }", "cancelEditAddress() {\n this.vendor.address = this.addressRevertData.address;\n this.vendor.state = this.addressRevertData.state;\n this.vendor.city = this.addressRevertData.city;\n this.vendor.zip_code = this.addressRevertData.zip_code;\n\n this.addressRevertData = '';\n }", "cancel() {\n this.modal.jQueryModalFade.removeClass('modal_fade_trick');\n this.modal.jQueryModalWindow.css('display', 'none');\n this.clear();\n this.clearInvalid();\n this.hideNotes();\n if(!this.good){\n this.initPlaceholders();\n }\n }", "cancelEdit() {\n this.handsontableData = JSON.parse(JSON.stringify(this.handsontableDataBackup));\n this.hot.loadData(this.handsontableData);\n this.hot.render();\n\n // Change edit mode on redux\n this.props.setEdit();\n }", "cancel() {\n // Rollback edit badge changes\n this.changeset.rollback(); //this.model.reload();\n\n this.set('editBadgeShow', false);\n }", "function cancelEditOperador(){\n\t\t $(\"#form_edit_operdor\")[0].reset();\n\t}", "cancelMe() {\n if (this.editFlag) {\n this.viewMe();\n } else {\n this.removeFromParentWithTransition(\"remove\", 400);\n }\n }", "@action\n cancelEditRow() {\n set(this, 'isEditRow', false);\n }", "modalCancel(){\n\t\t// save nothing\n this.setValues = null;\n\t\t// and exit \n this.modalEXit();\n }", "function dialogCancel(){\n\n // clear old inputs\n $content.find( localCfg.tabQueryItems ).remove();\n $content.find( localCfg.tabResultList ).empty();\n $content.find( localCfg.tabDistrList ).empty();\n $content.find( localCfg.tabDistrChart ).empty();\n $content.find( localCfg.tabAdjustList ).empty();\n\n // close the dialog\n dialog.close();\n\n }", "cancelEditAmmenities() {\n this.vendor.eighteen_plus = this.ammenitiesRevertData.eighteen_plus;\n this.vendor.twenty_one_plus = this.ammenitiesRevertData.twenty_one_plus;\n this.vendor.has_handicap_access = this.ammenitiesRevertData.has_handicap_access;\n this.vendor.has_lounge = this.ammenitiesRevertData.has_lounge;\n this.vendor.has_security_guard = this.ammenitiesRevertData.has_security_guard;\n this.vendor.has_testing = this.ammenitiesRevertData.has_testing;\n this.vendor.accepts_credit_cards = this.ammenitiesRevertData.accepts_credit_cards;\n\n this.ammenitiesRevertData = '';\n }", "function addTramiteCancel(){\n vm.modalAddTramite.dismiss();\n vm.name = \"\";\n vm.surnames = \"\";\n vm.rfc = \"\";\n vm.tramite = \"\";\n }", "function cancelChange()\r\n\t{\r\n\r\n\t\tif ( editingRow !== -1 )\r\n\t\t{\r\n\r\n\t\t\tif ( wantClickOffEdit === true )\r\n\t\t\t{\r\n\t\t\t\t// get the updated value\r\n\t\t\t\tvar newValue = document.getElementById('editCell');\r\n\t\t\t\tif ( null !== newValue )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( class_myRows[editingRow].name !== newValue.value )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsaveChange(editingRow);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tresetRowContents();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresetRowContents();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// set the flag\r\n\t\trowEditing = false;\r\n\t}", "function goCancel() {\n datacontext.revertChanges(vm.learningItem);\n goBack();\n }", "function cancel() {\r\n const wrapper = document.querySelector(\".afhalen-wrapper\");\r\n wrapper.style.display = \"none\";\r\n resetState();\r\n // just to clear the error box\r\n sendErrorMessage(\"\");\r\n\r\n }", "function cancel()\n {\n $('#PriestEd').hide();\n $('#PriestShowDetails').show();\n }", "function revokeEditable($container) {\n var $fields = $container.find(\"[data-content-attr]\");\n $fields.removeClass(\"activated\").hallo({editable:false});\n }", "function coauthors_stop_editing( event ) {\n\n\t\tvar co = jQuery( this );\n\t\tvar tag = jQuery( co.next() );\n\n\t\tco.attr( 'value',tag.text() );\n\n\t\tco.hide();\n\t\ttag.show();\n\n\t//\tediting = false;\n\t}", "function cancel(){\n scope.permission.planMode = false;\n angular.element('.plan-overlay').css('visibility','hidden');\n scope.plan.current = [];\n scope.plan.selected = [];\n }", "function cancelCreatePinModal() {\n \n $(\".modal\").hide();\n\n //Clear the textBoxes\n $(\"#creatPinModalName\").val('');\n $(\"#creatPinModalDescription\").val('');\n $(\"#creatPinModalTags\").val('');\n\n deletePin();\n createdPin = null;\n\n}", "cancelRowEdit() {\n if (this._isSaving) {\n return;\n }\n\n const activeEditInfo = this._activeEditInfo;\n if (activeEditInfo) {\n const { onCancelRowEdit } = this.props;\n if (onCancelRowEdit) {\n onCancelRowEdit(activeEditInfo);\n }\n \n this.setActiveEditInfo();\n }\n }", "function cancelEdit() {\n var id = $(this).parent().attr(\"id\");\n var type = id.split(\"-\");\n var index = findVM(id.split(\"-\")[0].toUpperCase());\n var value;\n \n if (type.length > 2) {\n /* A product resource has been modified */\n var prod = findProduct(index, type[1]);\n type = type[2];\n } else {\n /* A VM resource has been modified */\n type = type[1];\n }\n \n switch (type) {\n case \"status\":\n case \"alarm\":\n value = svm[index][type].toStr();\n break;\n case \"loc\":\n value = svm[index][type].lat + \", \" + svm[index][type].lng;\n break;\n case \"qty\":\n case \"price\":\n value = svm[index].products[prod][type];\n break;\n default:\n value = svm[index][type];\n break;\n }\n $(\"#\" + id).empty();\n $(\"#\" + id).text(value);\n $(\"#\" + id).mouseenter(showEditIcon);\n $(\"#\" + id).mouseleave(hideEditIcon);\n}", "function cancel() {\n $mdDialog.cancel();\n }", "function cancel() {\n $mdDialog.cancel();\n }", "function cancelHRD(id) {\n (0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {\n m = (0, _enterprise.toggleHRD)(m, false);\n m = (0, _index2.hideInvalidFields)(m);\n return m;\n });\n}", "function cancelHRD(id) {\n (0, _index.swap)(_index.updateEntity, \"lock\", id, function (m) {\n m = (0, _enterprise.toggleHRD)(m, false);\n m = (0, _index2.hideInvalidFields)(m);\n return m;\n });\n}", "function cancel() {\n $log.log('CollegeFundPaymentDialogController::clear called');\n $uibModalInstance.dismiss('cancel');\n }", "function cancel(event) {\n let dialog = document.getElementById(\"dialog\");\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"post\").value = \"\";\n document.getElementById(\"submit-btn\").innerHTML = \"Submit\";\n dialog.open = false;\n console.log(\"cancel\");\n}", "cancel() {\n if (this.isCancelDisabled)\n return;\n this.isCancelDisabled = true;\n this.closeEnrollment_('cancel');\n }", "cancelEdit() {\r\n const that = this,\r\n editingInfo = that._editing;\r\n\r\n if (!editingInfo) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < editingInfo.cells.length; i++) {\r\n const cell = editingInfo.cells[i];\r\n\r\n if (cell.editor.contains((that.shadowRoot || that.getRootNode()).activeElement)) {\r\n that._focusCell(cell.element);\r\n }\r\n\r\n cell.editor.remove();\r\n that._setCellContent(cell.element, that._formatCellValue(editingInfo.row, that.columnByDataField[cell.dataField], cell.element));\r\n cell.element.classList.remove('editing');\r\n }\r\n\r\n delete that._editing;\r\n }", "function abortEditing() {\n\t\t$('.editing').removeClass('editing');\n\t\t$('.edit').val('').off('keyup');\n\t}", "cancelEditHours() {\n let day = this.hoursRevertData;\n this.hours[day.day_order] = day;\n this.hoursRevertData = null;\n }", "function cancelEdit(e){\n if (e.target.classList.contains('post-cancel')) {\n ui.changeFormState('add');\n }\n\n e.preventDefault();\n}", "cancel() {\n delete activityById[id];\n }", "function cancelEditTodoList() {\n $(\"editListDiv\").style.display='none';\n}", "function cancelEdit(curr){\r\n hideButton(curr);\r\n // resume refreshing\r\n livedata = setInterval(reload,2000);\r\n}", "cancelEdit() {\n if (this._editedLevel > 0) {\n this._editedLevel--;\n }\n\n // Cancel in sub-models\n if (this._editedLevel === 0) {\n _each(this._childCollections, childCollection => {\n childCollection.cancelEdit();\n });\n\n // Revert changes\n // TODO\n\n // Reset state\n this._editedEvents = [];\n }\n }", "function cancelHRD(id) {\n\t (0, _index.swap)(_index.updateEntity, \"lock\", id, function (m) {\n\t m = (0, _enterprise.toggleHRD)(m, false);\n\t m = (0, _index2.hideInvalidFields)(m);\n\t return m;\n\t });\n\t}", "function cancelHRD(id) {\n\t (0, _index.swap)(_index.updateEntity, \"lock\", id, function (m) {\n\t m = (0, _enterprise.toggleHRD)(m, false);\n\t m = (0, _index2.hideInvalidFields)(m);\n\t return m;\n\t });\n\t}", "function cancelHRD(id) {\n\t (0, _index.swap)(_index.updateEntity, \"lock\", id, function (m) {\n\t m = (0, _enterprise.toggleHRD)(m, false);\n\t m = (0, _index2.hideInvalidFields)(m);\n\t return m;\n\t });\n\t}", "cancelNewQualification() {\n\t\tthis.addNewQualificationState = false;\n\t\tthis.newQualification = {\n\t\t\tdescription: null,\n\t\t\tdoctor: null,\n\t\t};\n\t}", "onCancelEditTeamDialog(e) {\n if (e.persist())\n e.preventDefault();\n this.props.dispatch(Action.getAction(adminActionTypes.SET_EDIT_TEAM_DIALOG_OPEN, { IsOpen: false }));\n }", "function cancelNewComment() {\n tinymce.activeEditor.remove();\n const newCommentForm = document.querySelector(\"#newCommentForm\");\n newCommentForm.parentNode.removeChild(newCommentForm);\n\n hiddenCommentBtn.style.display = \"block\";\n hiddenCommentBtn = null;\n }", "function cancel() {\n props.dispatch({\n type: 'CLEAR_TRAVEL_FORM',\n });\n toggle();\n }", "function stopEditing() {\n editing = false;\n statusIndicator.remove();\n setStatus(\"\");\n sourceStatus = \"\";\n urlInput.removeEventListener(\"paste\", onURLChange);\n}", "function cancelEditPinModal() {\n \n $(\".modal\").hide();\n\n //Clear the textBoxes\n $(\"#editPinModalName\").val('');\n $(\"#editPinModalDescription\").val('');\n $(\"#editPinModalTags\").val('');\n\n}", "function cancel() {\n scope.showCancelModal = true;\n }", "@action\n handleCancelSaveField(id) {\n this.setValue(id, this.initialData[id]);\n this.setFieldState(id, 'showSave', false);\n }", "function cancelOption(){\n document.getElementById(\"newOption\").style.display = \"none\";\n document.getElementById(\"pollSelection\").value = \"\";\n document.getElementById(\"newOptionValue\").value = \"\";\n document.getElementById(\"optionWarning\").innerHTML = \"\";\n }", "function resetEdit() {\n\t$('.icons').removeClass('editable');\n\t$('#save-recipe, #cancel-recipe').hide();\n\t$('#detail-description, #detail-name').attr('contenteditable', false);\n\t$('#detail-new-ingredient-input').hide();\n}", "function handleCancel() {\n resetLocalDateRangeParams();\n setAnchorEl(null);\n }", "handleCancel(event){\n this.showMode=true;\n this.hideButton=false;\n this.setEdit = true;\n this.hideEdit=false; \n }", "function cancelAction(){\n $('#listcontent').css('display','block');\n $('#editorholder').html('');\n}", "function cancelAction(){\n $('#listcontent').css('display','block');\n $('#editorholder').html('');\n}", "function CancelModalDialog() {\r\n tb_remove();\r\n }", "function cancelInterview(id) {\n \n return axios.delete(`api/appointments/${id}`)\n .then(() => \n dispatch({ type : SET_INTERVIEW, value : {id, inverview : null }}))\n }", "function onCancelClick() {\n logger.info('cancel_button click event handler');\n clearAllErrors();\n closeKeyboards();\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n}", "cancelUpdate() {\n this.updatingType = false;\n this.type = {};\n this.form.$setUntouched();\n }", "function cancelCmnt(target){\n\tvar pin = $(target).closest(\".pin\");\n\tvar button = pin.find(\"#cmnts\");\n\tvar pcf = pin.find('form[name=\"pin-cmnt-form\"]');//pin comment form\n\tvar cmnts = pcf.closest('.pin-cmnts');\n\tvar cmnt1 = cmnts.find('.pin-cmnt');//first comment\n\tvar cmntE = pcf.closest('.pin-cmnt');//current edit comment\n\tvar opt = cmntE.find('.options');//options\n\tconsole.log(cmnts);\n\tconsole.log(cmnt1);\n\tconsole.log(cmntE);\n\tconsole.log(opt);\n\tpcf.remove();\n\tbutton.attr('data-state', 'true');\n\ticon = button.find('i');\n\ticon.toggleClass('icon-chat-empty');\n\t//if there are no existing comments hide the comment section\n\tif (!cmnt1[0]){cmnts.hide()}\n\t//if there is a comment being edited, show the original comment.\n\tif (cmntE[0]){cmnt.children().css('display', '')}//do not use .show()\n\tapplyLayout();\n}", "function cancelEditing(itemId){\n $('#'+itemId+'-desc').attr('disabled','disabled');\n $('#'+itemId+'-info').attr('disabled','disabled');\n $('#'+itemId+'-type').attr('disabled','disabled');\n $('#'+itemId+'-category').attr('disabled','disabled');\n $('#'+itemId+'-price').attr('disabled','disabled');\n $('#'+itemId+'-stock').attr('disabled','disabled');\n $('#'+itemId+'-save').attr('disabled','disabled');\n $('#'+itemId+'-edit').show();\n $('#'+itemId+'-cancel').hide();\n}", "function closeModalEdit(){\n modalEdit.style.display = \"none\"\n modalFormEdit.reset()\n }", "function cancelUpdates() {\n location.reload();\n location.href = \"teamdetails.html?teamid=\" + $(\"#teamId\").val();\n }", "cancelEdit(id) {\n this.setState((state) => ({\n ...state,\n todos: state.todos.map(todo => ({ ...todo, editing: todo.editing && todo._id !== id }))\n }));\n }", "function cancel() {\n transition(DELETE, true);\n\n props.cancelInterview(props.id)\n .then(response => {\n transition(EMPTY);\n })\n .catch(error => {\n transition(ERROR, true);\n })\n }", "function actionCancelEditCategory()\n{\n\t// Revert field input data be null\n\t$('#txt_category_id').val(0);\n\t$('#cbo_parent').val(0);\n\t$('#txt_name').val('');\n\t$('#txt_description').val('');\n\t\n\t// Change button update become save\n\t$('.category.btn-update').fadeOut(500);\n\t$('.category.btn-cancel-edit').fadeOut(500);\n\tsetTimeout(function(){$('.category.btn-save').fadeIn(600).removeClass('hide');}, 500);\n}", "cancel(){\r\n\t\tthis.undoButton.addEventListener(\"click\" , () =>{\r\n\t\tclearInterval(this.chronoInterval);\r\n\t\tthis.time = 1200000/1000; \r\n\t\talert (\"Votre annulation de réservation vélo a bien été prise en compte.\");\r\n\t\tthis.nobooking.style.display=\"block\";\r\n this.textReservation.classList.add(\"invisible\");\r\n\t\tthis.bookingResult.classList.add(\"invisible\"); \r\n\t\tthis.drawform.style.display = \"none\";\r\n\t\tthis.identification.style.display = \"none\";\r\n\t\tthis.undoButton.style.opacity = \"0\";\r\n\t\tthis.infoStation.style.opacity = \"1\";\r\n\t\tthis.infoStation.scrollIntoView({behavior: \"smooth\", block: \"center\", inline: \"nearest\"});\r\n\t\tdocument.getElementById(\"search\").style.height = \"initial\"; \r\n\t\tsessionStorage.clear();\r\n\t })\r\n\t}", "function cancel() {\n history.goBack();\n }", "cancelTransaction(event) {\n if (this.retroDateValuesFinal != []) {\n revertRetroDatesOnly({ selectedCareAppId: this.careApplicationId })\n this.isModalOpen = event.detail.showParentModal;\n this.bReasonCheck = false;\n this.bShowConfirmationModal = event.detail.showChildModal;\n this.bFormEdited = false;\n } else {\n this.bReasonCheck = false;\n this.isModalOpen = event.detail.showParentModal;\n this.reasonValueChange = '';\n this.bShowConfirmationModal = event.detail.showChildModal;\n this.bFormEdited = false;\n }\n }", "function cancelInterview(id, interview) {\n return axios\n .delete(`/api/appointments/${id}`, { interview })\n .then((response) => {\n const appointment = {\n ...state.appointments[id],\n interview: null,\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment,\n };\n return setState({\n ...state,\n appointments,\n });\n });\n }", "function cancelWrite() {\n pendingRecord = null;\n writePending = false;\n overwritePendingText.classList.remove('active');\n overwriteCancelButton.classList.remove('active');\n}", "function cancelForm() { switchToView('listing'); }", "function cancel(id) {\n var remove = document.getElementById('removeItem');\n if (remove) {\n remove.parentNode.removeChild(remove);\n }\n\n var edit = document.getElementById('editItem');\n if (edit) {\n edit.parentNode.removeChild(edit);\n }\n\n var input = document.getElementById('inputBox');\n if (input) {\n input.parentNode.removeChild(input);\n }\n\n var submit = document.getElementById('editSubmitBtn');\n if (submit) {\n submit.parentNode.removeChild(submit);\n }\n\n var cancel = document.getElementById('cancelItem');\n if (cancel) {\n cancel.parentNode.removeChild(cancel);\n }\n}" ]
[ "0.7663377", "0.7083451", "0.7054394", "0.70182973", "0.6912614", "0.68968034", "0.6835991", "0.6817441", "0.6726299", "0.67232335", "0.6703917", "0.6696722", "0.6666923", "0.65891993", "0.65277267", "0.65143514", "0.6509518", "0.6507401", "0.6486365", "0.64838725", "0.6483203", "0.646288", "0.64610654", "0.6456264", "0.64276516", "0.6426013", "0.6425004", "0.6383377", "0.6383377", "0.6351084", "0.6327686", "0.62778157", "0.6273182", "0.6266851", "0.6235438", "0.62335855", "0.61955947", "0.6180125", "0.6173575", "0.61347604", "0.61318177", "0.60973", "0.6094796", "0.60915995", "0.6089268", "0.6075886", "0.60744166", "0.60627186", "0.60423213", "0.60392576", "0.6034294", "0.6034294", "0.60341024", "0.6033021", "0.60283625", "0.6026859", "0.60253835", "0.60245866", "0.60211074", "0.60067755", "0.5997473", "0.5988321", "0.5964295", "0.5959148", "0.59570235", "0.5944243", "0.5944243", "0.5944243", "0.5940163", "0.59323967", "0.59275806", "0.5914244", "0.5908445", "0.5890368", "0.58871335", "0.5880503", "0.5879975", "0.5874728", "0.5869032", "0.5864402", "0.5863896", "0.5863896", "0.58562326", "0.5845934", "0.584175", "0.58366936", "0.58328503", "0.58318186", "0.58121425", "0.58045787", "0.58021355", "0.57995147", "0.57994807", "0.57887757", "0.5772882", "0.5767282", "0.57650054", "0.5761859", "0.5761237", "0.5752988" ]
0.8118909
0
This function clears the inputs on the edit form for a lead
function clearEditLeadForm() { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to in future operations while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#LeadDetails').fadeOut(500, function () { $('#LeadDetails').hide(); $('#editLead').val(""); $('#editContactPerson').val(""); $('#editContactNumber').val(""); $('#editEmail').val(""); $('#editPotentialAmount').val(""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item_year\").val(\"\");\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_search\").prop(\"disabled\", true);\n $(\"#btn_add_item\").prop(\"disabled\", true);\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n // disable link to author page\n $(\"#link_current_author\").removeClass(\"text-primary\");\n $(\"#link_current_author\").addClass(\"text-muted\");\n // hide editions page\n $(\"#page_editions\").hide(\"slow\");\n }", "clearInputs() {\n\t\t$(this.elementConfig.nameInput).val(\"\");\n\t\t$(this.elementConfig.courseInput).val(\"\");\n\t\t$(this.elementConfig.gradeInput).val(\"\");\n\n\t}", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\n}", "function clearFields() {\r\n\t\t\t\t\t\t$('#tf_Id').val(null);\r\n\t\t\t\t\t\t$('#tf_Descricao').val(null);\r\n\t\t\t\t\t\t$('#slc_Marca').val(0);\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').val(0);\r\n\t\t\t\t\t\t$('#slc_Status').val(0);\r\n\t\t\t\t\t\t$('#btn-operation').val(\"Criar Modelo\");\r\n\t\t\t\t\t}", "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 }", "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').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 }", "clearFields() {\r\n document.getElementById('title').value = '',\r\n document.getElementById('author').value = '',\r\n document.getElementById('isbn').value = '';\r\n }", "clearFields(){\n this.description.value = \"\"\n this.amount.value = \"\"\n this.date.value = \"\"\n }", "function clearFields(){\n $(\"#idInput\").val('');\n $(\"#titleInput\").val('');\n $(\"#contentInput\").val('');\n $(\"#authorInput\").val('');\n $(\"#dateInput\").val(''); \n $(\"#authorSearch\").val('');\n $(\"#idDelete\").val('');\n}", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\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 clearDetailForm(){\n inputIdDetail.val(\"\");\n inputDetailItem.val(\"\");\n inputDetailQuantity.val(\"\");\n inputDetailPrice.val(\"\");\n inputDetailTotal.val(\"\");\n inputDetailItem.focus();\n}", "function clearInputFields(el) {\r\n\tel.parent().siblings('.modal-body').find('input').val('');\r\n}", "function clearFields() {\n movie_name.value = '';\n release_date.value = '';\n movie_banner.value = '';\n description.value = '';\n}", "_clearInputs() {\n this.elements.peopleInput.value = \"\";\n this.elements.descriptionInput.value = \"\";\n this.elements.titleInput.value = \"\";\n return this;\n }", "function clearRepairAgentInputs()\r\n {\r\n $('#claimdetails-repairagentid-input').val('');\r\n $('#claimdetails-repairagentname-input').val('');\r\n $('#claimdetails-repairagentphone-input').val('');\r\n $('#claimdetails-repairagentemail-input').val('');\r\n $('#claimdetails-repairagentunithouse-input').val('');\r\n $('#claimdetails-repairagentstreet-input').val('');\r\n $('#claimdetails-repairagentsuburbcity-input').val('');\r\n $('#claimdetails-repairagentstate-input').val('');\r\n $('#claimdetails-repairagentpostcode-input').val('');\r\n }", "function clearRepairAgentInputs()\r\n {\r\n $('#claimdetails-repairagentid-input').val('');\r\n $('#claimdetails-repairagentname-input').val('');\r\n $('#claimdetails-repairagentphone-input').val('');\r\n $('#claimdetails-repairagentemail-input').val('');\r\n $('#claimdetails-repairagentunithouse-input').val('');\r\n $('#claimdetails-repairagentstreet-input').val('');\r\n $('#claimdetails-repairagentsuburbcity-input').val('');\r\n $('#claimdetails-repairagentstate-input').val('');\r\n $('#claimdetails-repairagentpostcode-input').val('');\r\n }", "function resetEditModal() {\n $('#userIdEdit').val('');\n $('#firstNameEdit').val('');\n $('#lastNameEdit').val('');\n $('#ageEdit').val('');\n}", "function clearFields() {\n name.value = \"\";\n title.value = \"\";\n hourlyRate.value = \"\";\n hours.value = \"\";\n salary.value = \"\";\n baseSalary.value = \"\";\n commissionRate.value = \"\";\n sales.value = \"\";\n commissionOption.checked = false;\n salaryOption.checked = false;\n hourlyOption.checked = false;\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\n }", "function clearAddDetails(){\n\tdocument.getElementById(\"addName\").value = \"\";\n\tdocument.getElementById(\"addAC\").value = \"\";\n\tdocument.getElementById(\"addMaxHP\").value = \"\";\n\tdocument.getElementById(\"addInitiative\").value = \"\";\n\tresetAddFocus();\n}", "function clear_form_data() {\n $(\"#cust_id\").val(\"\");\n $(\"#order_id\").val(\"\");\n $(\"#item_order_status\").val(\"\");\n }", "function cancelEditLead() {\n clearEditLeadForm();\n}", "function clearInputfields() {\r\n\t$('#title').val('');\r\n\t$('#desc').val('');\r\n\t$('#email').val('');\r\n}", "function clearInputs(){\n\t//array is filled with the HTML ids of the input value fields\n\t//array loops through each id,resets the value to empty string\n\t\tvar inputIds = [\n\t\t\t\ttitleInput,\n\t\t\t\turgency,\n\t\t\t\t ];\n\n\t\t\tinputIds.forEach(function(id){\n\t\t\t\t\tid.value = '';\n\t\t\t});\n}", "function clearInputs() {\r\n document.getElementById('addressBookForm').reset();\r\n }", "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 clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n }", "function clearHeadForm(){\n inputHeadEntity.val(\"\");\n inputHeadIdEntity.val(\"\");\n inputHeadTotal.val(\"\");\n}", "function clearInputFields(){\n $( '#idInput').val( '' );\n $( '#firstNameInput').val( '' );\n $( '#lastNameInput').val( '' );\n $( '#roleInput').val( '' );\n $( '#salaryInput').val( '' );\n}", "function clearForm() {\n\t\tconst blankState = Object.fromEntries(\n\t\t\tObject.entries(inputs).map(([key, value]) => [key, \"\"])\n\t\t);\n\t\tsetInputs(blankState);\n\t}", "static clearFields() {\n document.querySelector('#date').value = '';\n document.querySelector('#title').value = '';\n document.querySelector('#post').value = '';\n }", "function clear_form_data() {\n var item_area=$('#item_area');\n console.log(\"Clear all data\");\n item_area.val(\"\");\n $('#change_course_dis_text').val(\"\");\n $('#course_name_text').val(\"\");\n $('#course_dis_text').val(\"\");\n\n }", "function clear_inputs() {\n\n\t\t\t\t$('.form-w').val(\"\");\n\t\t\t\t$('.form-b').val(\"\");\n\t\t\t\t$('.form-mf').val(\"\");\n\t\t\t\t$('.form-mt').val(\"\");\n\n\t\t\t\tlocalStorage.clear();\n\n\t\t\t}", "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\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 clear_form_data() {\n $(\"#promo_name\").val(\"\");\n $(\"#promo_type\").val(\"\");\n $(\"#promo_value\").val(\"\");\n $(\"#promo_start_date\").val(\"\");\n $(\"#promo_end_date\").val(\"\");\n $(\"#promo_detail\").val(\"\");\n $(\"#promo_available_date\").val(\"\");\n }", "function ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'||this.type=='hidden') {\n this.value = '';\n }\n else if (this.type == 'radio' || this.type == 'checkbox') {\n this.checked = false;\n }\n else if (this.type == 'select-one' || this.type == 'select-multiple') {\n this.value = '-1';\n }\n });\n\n }", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \n \t\n \t$('#frmMain').find(':input').each(function(){\n \t\tvar id = $(this).prop('id');\n \t\tvar Value = $('#' + id).val(\" \");\n \t});\n \t \t\n \t$('#txtShape').val('Rod'); \n \t$(\"#drpInch\").val(0);\n $(\"#drpFraction\").val(0);\n \n UncheckAllCheckBox();\n clearSelect2Dropdown();\n \n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \n }", "clearFields() {\n this._form.find('.form-group input').each((k, v) => {\n let $input = $(v);\n if ($input.attr('type') !== \"hidden\") {\n $input.val('');\n }\n });\n }", "function clearAppointmentInput() {\n\t$('#description').val(\"\");\n\t$('#addAppointmentDatepicker').val(\"\");\n\t$('#timepicker').val(\"\");\n\t$('#duration').val(\"\");\n\t$('#owner').val(\"\");\n}", "function clear_form_data() {\n $(\"#promotion_title\").val(\"\");\n $(\"#promotion_promotion_type\").val(\"\");\n $(\"#promotion_start_date\").val(\"\");\n $(\"#promotion_end_date\").val(\"\");\n $(\"#promotion_active\").val(\"\");\n }", "function clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "clearFields(){\n this.titleInput.value = '';\n this.bodyInput.value = '';\n }", "function clearForm() {\n $(\"#name-input\").val(\"\");\n $(\"#destination-input\").val(\"\")\n $(\"#firstTime-input\").val(\"\");\n $(\"#frequency-input\").val(\"\");\n }", "function clearInputs() {\n $('#employeeFirstName').val('');\n $('#employeeLastName').val('');\n $('#employeeId').val('');\n $('#employeeTitle').val('');\n $('#employeeSalary').val('');\n}", "function clearHumanResource() {\n $('#drpName').val('');\n $('#txtOfferDays').val('');\n $('#txtOfferAmountperday').val('');\n $('#txtRealEstimatedDays').val('');\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 clearForm() {\n fullName.value = \"\";\n message.value = \"\";\n hiddenId.value = \"\";\n}", "function clearFields() {\n $('#input_form')[0].reset()\n }", "function clearFields() {\n $('#p1-fn-input').val('');\n $('#p1-ln-input').val('');\n $('#p2-fn-input').val('');\n $('#p2-ln-input').val('');\n $('#PIN').val('');\n}", "clear() {\n this.jQueryName.val('');\n this.jQueryEmail.val('');\n this.jQueryCount.val('');\n this.jQueryPrice.val('$');\n\n this.jQueryCities.selectAll.prop('checked', false);\n this.jQueryCities.cities.prop('checked', false);\n\n this.clearInvalid();\n this.hideNotes();\n }", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.name = \"\";\r\n self.model.address = \"\";\r\n }", "function resetPresidentForm(){\n fechaInicioField.setValue('');\n descripcionEventoField.setValue('');\n }", "function resetPresidentForm(){\n consecuenciasField.setValue('');\n descripcionField.setValue('');\n }", "function clearInputs() {\n setInputTitle(\"\");\n setInputAuthor(\"\");\n setInputPages(\"\");\n setInputStatus(\"read\");\n}", "function clearFields(){\n document.querySelector('#name').value = ''\n document.querySelector('#caption').value = ''\n document.querySelector('#url').value = ''\n}", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.component = \"\";\r\n }", "clearInput() {\n if (this.getCurTab() === \"dbms\") {\n var curDocName = DOC.iSel(\"docNameID\").value; // Stores current value of docName\n DOC.iSel(\"dbmsFormID\").reset(); // Resets entire form\n DOC.iSel(\"docNameID\").value = curDocName; // Added so docname is not reset\n } else if (this.getCurTab() === \"fs\") {\n var curDocName = DOC.iSel(\"docNameID2\").value;\n DOC.iSel(\"fsFormID\").reset();\n DOC.iSel(\"docNameID2\").value = curDocName;\n }\n }", "function clearAddInput() {\n $(\".add-firstName\").val(\"\");\n $(\".add-lastName\").val(\"\");\n $(\".add-phone\").val(\"\");\n $(\".add-address\").val(\"\");\n}", "function resetAddForm(){\r\n TelephoneField.reset();\r\n FNameField.reset();\r\n LNameField.reset();\r\n TitleField.reset();\r\n MailField.reset();\r\n AddField.reset();\r\n MobileField.reset();\r\n }", "static clearFields(){\n document.querySelector('#title').value ='';\n document.querySelector('#author').value ='';\n document.querySelector('#isbn').value ='';\n }", "function clearFields(event) {\n event.target.fullName.value = '';\n event.target.status.value = '';\n }", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clearForm() {\n isNewObject = true;\n var $dialog = dialog.getElement();\n $('input:text', $dialog).val('');\n $('.input-id', $dialog).val(0);\n $('.input-password', $dialog).val('');\n $('.input-connection-id', $dialog).val(0);\n $('.input-engine', $dialog)[0].selectedIndex = 0;\n $('.input-port', $dialog).val(engines.mysql.port);\n $('.input-confirm-modifications', $dialog).prop('checked', true);\n $('.input-save-modifications', $dialog).prop('checked', false);\n $('.input-trusted-connection', $dialog).prop('checked', false);\n $('.input-instance-name', $dialog).val('');\n }", "function clearInputFields() {\n $('#firstName').val('');\n $('#lastName').val('');\n $('#idNumber').val('');\n $('#jobTitle').val('');\n $('#annualSalary').val('');\n} // END: clearInputFields()", "function resetEditRoomForm(){\r\n \r\n ERoomNumberField.reset();\r\n ERoomValidFromField.reset();\r\n ERoomValidToField.reset();\r\n\t\t\t\t\t \r\n }", "function resetContactEditElements()\n{\n $(\"first_name_element\").value =\"\";\n $(\"last_name_element\").value =\"\";\n $(\"phone_number_element\").value =\"\";\n $(\"email_element\").value =\"\";\n $(\"age_element\").value =\"\";\n $(\"id_element\").value =\"\";\n $(\"gender_element\").selectedIndex = NO_GENDER;\n disableDeleteButton(true);\n disableSaveButton(true);\n disableClearButton(true);\n}", "function clearInputs() {\n $('#firstNameIn').val('');\n $('#lastNameIn').val('');\n $('#employeeIDIn').val('');\n $('#jobTitleIn').val('');\n $('#annualSalaryIn').val('');\n}", "function resetInputs () {\n document.querySelector('#nm').value = \"\"\n document.querySelector('#desc').value = \"\"\n }", "reset(){\n this._address.StreetAddress.value = \"\";\n this._address.City.value = \"\";\n this._address.State.value = \"\";\n this._address.Zip.value = \"\";\n\n this._user.Email.value = \"\";\n this._user.FirstName.value = \"\";\n this._user.LastName.value = \"\";\n this._primaryPhone.value = \"\";\n if(this._cellPhone) this._cellPhone.value = \"\";\n if(this._homePhone) this._homePhone.value = \"\";\n if(this._workPhone) this._workPhone.value = \"\";\n\n this._chosenContact = null;\n this._chosenContactID = -1;\n this._company.value = \"\";\n this._licenseNum.value = \"\";\n this._mcNum.value = \"\";\n this._resaleNum.value = \"\";\n\n if(document.getElementById(INVOICE_CHOSEN_CONTACT_ID)){\n document.getElementById(INVOICE_CHOSEN_CONTACT_ID).removeAttribute(\"id\");\n }\n\n this._updatePreviewField();\n }", "function clearInputFields() {\n $('input#date').val('');\n $(\"select\").each(function () {\n this.selectedIndex = 0;\n });\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 }", "static clearInput() {\n inputs.forEach(input => {\n input.value = '';\n });\n }", "function resetEditMenuForm(){\r\n EMenuNameField.reset();\r\n EMenuDescField.reset();\r\n EMStartDateField.reset();\r\n EMEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "function clearInputFields() {\n zipcodeInput.val('');\n cityInput.val('');\n stateInput.val('');\n} //end clearInputFields", "function ClearFields() { }", "function resetAddMenuForm(){\r\n MenuNameField.reset();\r\n MenuDescField.reset();\r\n MStartDateField.reset();\r\n // MEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "function resetInputFields() {\n document.getElementById(\"description\").value = '';\n document.getElementById(\"value\").value = '';\n}", "function reset_fields(){\n $('.input').val('');\n $('#add-course').toggle();\n }", "function clearForm() {\n\n $(\"#formOrgList\").empty();\n $(\"#txtName\").val(\"\");\n $(\"#txtDescription\").val(\"\");\n $(\"#activeFlag\").prop('checked', false);\n $(\"#orgRoleList\").empty();\n }", "function clearForm() {\n document.getElementById('dest').value = '';\n document.getElementById('startDate').value = '';\n document.getElementById('endDate').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 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}", "clearField() {\n document.querySelector('#name').value = '';\n document.querySelector('#email').value = '';\n document.querySelector('#profession').value = '';\n }", "function clear_form_data() {\n $(\"#inventory_name\").val(\"\");\n $(\"#inventory_category\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_count\").val(\"\");\n }", "function clearInput() {\n inputFields[0].value = '';\n inputFields[1].value = '';\n inputFields[2].value = '';\n inputFields[3].value = ''\n}", "function clearFields() {\n document.getElementById('former').remove();\n}", "function clearTheInput(){\n $(\"#inpTrainName\").val(\"\");\n $(\"#inpDest\").val(\"\");\n $(\"#inpFreq\").val(\"\");\n $(\"#inpTrainTime\").val(\"\");\n }", "static clearField(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clear_form_data() {\n $(\"#recommendation_id\").val(\"\");\n $(\"#recommendation_productId\").val(\"\");\n $(\"#recommendation_suggestionId\").val(\"\");\n $(\"#recommendation_categoryId\").val(\"\");\n $(\"#recommendation_old_categoryId\").val(\"\");\n }", "function clearContent() {\n\n $(\"#med_name\").val(\"\");\n $(\"#drug_class\").val(\"\");\n $(\"#med_desc\").val(\"\");\n $(\"#dosage\").val(\"\");\n $(\"#frequency\").val(\"\");\n $(\"#quantity\").val(\"\");\n $(\"#doctor\").val(\"\");\n $(\"#doctor_number\").val(\"\");\n\n}", "function clear() {\n $('#zoneName').val('');\n $('#location').val('');\n $('#radius').val('');\n $('#iconSelect').val(\"mdi:pin-outline\");\n $('#addBtn').attr(\"disabled\", \"\");\n}", "function clear_form_data() {\n $(\"#product_id\").val('');\n $(\"#rec_product_id\").val('');\n $(\"#rec_type_id\").val('1');\n $(\"#weight_id\").val('');\n }", "function clearForm(){\n\t$('#hid_id_data').val('');\n\t$('#hid_data_saldo').val('');\n\t$('#hid_data_nm_awl').val('');\n $(\"#txttgl\").val('');\n $('#txtnominal').val('');\n $('#txtketerangan').val(''); \n}" ]
[ "0.74399716", "0.7424539", "0.74009085", "0.7383851", "0.7381192", "0.73458815", "0.73298216", "0.7329398", "0.732509", "0.7303051", "0.73019385", "0.7297206", "0.72956127", "0.72940284", "0.7262547", "0.7261831", "0.72553796", "0.7248012", "0.7248012", "0.72376484", "0.7234331", "0.7228126", "0.7221444", "0.72212076", "0.7208852", "0.72039413", "0.719733", "0.7194638", "0.7184834", "0.7164267", "0.7164248", "0.71626353", "0.7141839", "0.7141767", "0.7140506", "0.71353537", "0.7135161", "0.7135161", "0.7135161", "0.7132155", "0.7113445", "0.7112269", "0.71105605", "0.7109486", "0.7109345", "0.71089154", "0.71070766", "0.71070766", "0.70980716", "0.7096195", "0.7092536", "0.70892894", "0.7087868", "0.70839936", "0.70743", "0.7070286", "0.70693326", "0.7065758", "0.7058805", "0.7054859", "0.7054373", "0.7051547", "0.70467645", "0.7044891", "0.70418465", "0.70399404", "0.70357215", "0.70267516", "0.7025429", "0.70146066", "0.70108265", "0.70105034", "0.6986863", "0.69807994", "0.69805276", "0.6975422", "0.696854", "0.696434", "0.6962066", "0.69618726", "0.69613236", "0.695879", "0.6955454", "0.6952956", "0.6945958", "0.6943399", "0.6942406", "0.69350886", "0.6930055", "0.6929927", "0.69273746", "0.6922308", "0.6922215", "0.69184315", "0.6918385", "0.69179964", "0.6908525", "0.69080436", "0.6906444", "0.6897416" ]
0.743387
1
This function converts a lead into opportunity and shows opportunity
function convertToOpp(itemID) { hideAllPanels(); clearEditLeadForm(); currentItem.set_item("_Status", "Opportunity"); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearNewLeadForm(); showOpps(); }, function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "function handleLeadCompanyIntent(intent, session, response) {\n var sqsParam;\n var names = session.attributes.name.split(' ');\n var query = \"Select Name, Id from Account where Name like '\" + intent.slots.Company.value + \"'\";\n\n console.log('query: ' + query);\n org.authenticate({ username: SF_USER, password: SF_PWD_TOKEN }).then(function() {\n return org.query({query: query})\n\n }).then(function(results){ // this result is from the query to salesforce\n var recs = results.records;\n //if company not found in salesforce, create the lead\n if (recs.length == 0) {\n console.log('company not found. try to create lead');\n speechOutput = 'created lead for ' + names[1] + ' at ' + intent.slots.Company.value;\n var obj = nforce.createSObject('Lead');\n obj.set('FirstName', names[0]);\n obj.set('LastName', names[1]);\n obj.set('Company', intent.slots.Company.value);\n return org.insert({ sobject: obj })\n }\n else{//if company is already an account, then create an opportunity not a lead\n console.log('account exists for company. try to create opportunity');\n console.log('recs: ' + JSON.stringify(recs));\n speechOutput = 'created opportunity for ' + intent.slots.Company.value;\n\n var opp = nforce.createSObject('Opportunity');\n opp.set('Name', intent.slots.Company.value + '-' +names[1] );\n opp.set('StageName', 'Prospecting');\n opp.set('CloseDate', '2017-01-01T18:25:43.511Z');//2017-01-01T18:25:43.511Z\n opp.set('AccountId', '00137000009eTf1AAE')\n\n return org.insert({ sobject: opp })\n }\n }).then(function(results) { // this result is from the insert operation to salesforce\n if (results.success) {\n console.log('insert results: ' + JSON.stringify(results));\n response.tellWithCard(speechOutput, \"Salesforce\", speechOutput);\n } else {\n speechOutput = 'a salesforce problem with inserting object';\n response.tellWithCard(speechOutput, \"Salesforce\", speechOutput);\n }\n }).then(function () {\n sqsParam = {\n \"FunctionName\": \"bk-sqs\",\n \"Payload\": JSON.stringify({\n \"arn\": \"'arn':'arn:aws:lambda:us-east-1:724245399934:bk-sqs'\",\n \"industry\": \"technology\",\n \"opportunityName\": intent.slots.Company.value + '-' +names[1]\n })\n };\n lambda.invoke(sqsParam, function(err, data) { // send data to lambda for sns topic\n // Did an error occur?\n if (err)\n console.log('error calling lambda with params: ' + JSON.stringify(sqsParam), JSON.stringify(err));\n else\n console.log('success calling lambda with params: ' + JSON.stringify(sqsParam), JSON.stringify(data));\n })}).error(function(err) {\n var errorOutput = 'Darn, there was a Salesforce problem, sorry';\n response.tell(errorOutput + ' : ' + err, \"Salesforce\", errorOutput);\n });\n}", "function convertLeads() {\n\tif (!validationForm()) {\n\t\treturn;\n\t}\n\tname = document.getElementById('form-nome').value;\n email = document.getElementById('form-email').value;\n company = document.getElementById('form-empresa').value;\n\n\tleads.unshift({\"name\":name , \"email\":email , \"company\":company});\n\n\tconsole.log(name);\n\tconsole.log(email);\n\tconsole.log(company);\n\tsaveListStorage(leads);\n\t\n\tresetForm();\n}", "function makeAwardElement(obj) {\n var cloneClone = awardEventClone.clone(true);\n var text = cloneClone.find(awardEventTextElement);\n var price = cloneClone.find(awardEventPriceElement);\n var date = cloneClone.find(awardEventDateElement);\n\n // if current person is interpreter\n if (currentRole === 1) {\n // we again insert proper text to it\n text.html(window.__(\"You have been awarded the assignment at the price of:\"));\n price.html(obj.price);\n date.html(obj.formated_date);\n // if current person is business\n } else {\n // we create text block with link in it for interpreter's name\n if (Number(obj.initiator_id) === Number(currentPersonId)) {\n text.html(window.__(\"You have awarded <a class='skiwo-link skiwo-link--green-bg' href=''></a> the assignment at the price of:\"));\n } else {\n text.html(window.__(obj.initiator_name + \" has awarded <a class='skiwo-link skiwo-link--green-bg' href=''></a> the assignment at the price of:\"));\n }\n text.find(\"a\").html(obj.name);\n text.find(\"a\").attr(\"href\", obj.link);\n price.html(obj.business_price);\n date.html(obj.formated_date);\n }\n\n\n // TODO: remove this line!!!\n if (obj.past) {\n // cloneClone.addClass(\"is-past-event\");\n }\n\n return cloneClone;\n } // end of creating award event function", "getLead() {\n if (this.state.lead !== null) {\n return Promise.resolve(this.state.lead)\n }\n return LeadService.createLead().then(lead => {\n this.setState({lead})\n return lead\n })\n }", "async actStep(stepContext) {\n const bookingDetails = {};\n //let submitted = stepContext.context.activity.text;\n // let ticketValues = stepContext.context.activity.value;\n // let comments = JSON.parse(ticketValues.comments);\n //console.log(comments);\n if (stepContext.context.activity.value!=null) {\n // Retrieve the data from the id_number field\n let ticketValues = stepContext.context.activity.value;\n let comments = JSON.parse(ticketValues.comments);\n console.log(comments);\n }\n if (!this.luisRecognizer.isConfigured) {\n // LUIS is not configured, we just run the BookingDialog path.\n return await stepContext.beginDialog('bookingDialog', bookingDetails);\n }\n\n // Call LUIS and gather any potential booking details. (Note the TurnContext has the response to the prompt)\n const luisResult = await this.luisRecognizer.executeLuisQuery(stepContext.context);\n switch (LuisRecognizer.topIntent(luisResult)) {\n case 'BookFlight': {\n // Extract the values for the composite entities from the LUIS result.\n const fromEntities = this.luisRecognizer.getFromEntities(luisResult);\n const toEntities = this.luisRecognizer.getToEntities(luisResult);\n\n // Show a warning for Origin and Destination if we can't resolve them.\n await this.showWarningForUnsupportedCities(stepContext.context, fromEntities, toEntities);\n\n // Initialize BookingDetails with any entities we may have found in the response.\n bookingDetails.destination = toEntities.airport;\n bookingDetails.origin = fromEntities.airport;\n bookingDetails.travelDate = this.luisRecognizer.getTravelDate(luisResult);\n console.log('LUIS extracted these booking details:', JSON.stringify(bookingDetails));\n\n // Run the BookingDialog passing in whatever details we have from the LUIS call, it will fill out the remainder.\n return await stepContext.beginDialog('bookingDialog', bookingDetails);\n }\n\n case 'GetWeather': {\n // We haven't implemented the GetWeatherDialog so we just display a TODO message.\n //await generateCards();\n const getWeatherMessageText = 'TODO: get weather flow here';\n await stepContext.context.sendActivity(getWeatherMessageText, getWeatherMessageText, InputHints.IgnoringInput);\n break;\n }\n\n case 'go_cognitive': {\n console.log('in go cognitive');\n const documents_keyword = this.luisRecognizer.getBehaviorEntities(luisResult);\n console.log(documents_keyword.keyword);\n const searchClient = new SearchClient(search_endpoint, \"azureblob-index\", new AzureKeyCredential(search_apiKey));\n let searchOptions = {\n includeTotalCount: true,\n select: []\n //queryType: \"full\", \n };\n let searchResults = await searchClient.search(documents_keyword.keyword, searchOptions);\n let count = searchResults.count;\n let a = [];\n for await (const result of searchResults.results) {\n a.push(result);\n } \n if(searchResults.count===0){\n const noResultMessage = 'Sorry, we cannot find related articles from our search service.';\n await stepContext.context.sendActivity(noResultMessage,noResultMessage,InputHints.IgnoringInput);\n }\n\n else{\n const ResultMessage = 'We have found you these results:';\n await stepContext.context.sendActivity(ResultMessage,ResultMessage,InputHints.IgnoringInput);\n for(let i=0;i<searchResults.count;i++){\n let str = `${JSON.stringify(a[i].document.content)}`; \n str = JSON.parse(str);\n console.log(str);\n let url = `${ Buffer.from( a[i].document[\"metadata_storage_path\"], 'base64' ) }`;\n let card = this.generateCards(str,url);\n const welcomeCard = CardFactory.adaptiveCard(card);\n await stepContext.context.sendActivity({ attachments: [welcomeCard] });\n\n }\n const ticket = CardFactory.adaptiveCard(ticketcard);\n await stepContext.context.sendActivity({ attachments: [ticket] });\n // let submitted = stepContext.context.activity.text;\n // let ticketValues = stepContext.context.activity.value;\n // let comments = JSON.parse(ticketValues.comments);\n // console.log(comments);\n // if (!submitted && ticketValues) {\n // // Retrieve the data from the id_number field\n // let comments = JSON.parse(ticketValues.comments);\n // console.log(comments);\n // }\n }\n //}\n break;\n \n }\n\n default: {\n\n const didntUnderstandMessageText = `Sorry, I didn't get that. Please try asking in a different way (intent was ${ LuisRecognizer.topIntent(luisResult) })`;\n await stepContext.context.sendActivity(didntUnderstandMessageText, didntUnderstandMessageText, InputHints.IgnoringInput);\n }\n }\n\n return await stepContext.next();\n }", "function getEntities(obj, parent) {\n // decision\n if (obj[\"p:FlowDecision\"] !== undefined) {\n var root_decisions = obj[\"p:FlowDecision\"];\n if (typeof root_decisions === \"object\" && root_decisions.length !== undefined) { // is array objects\n for (var i = 0; i < root_decisions.length; i++) {\n var root_decision = root_decisions[i];\n var isAlias = root_decision[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_decision[\"@sap2010:WorkflowViewState.IdRef\"] : root_decision[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_decision[\"p:FlowDecision.True\"] !== undefined) { // have obj in true connection\n getEntities(root_decision[\"p:FlowDecision.True\"], isAlias);\n }\n if (root_decision[\"p:FlowDecision.False\"] !== undefined) { // have obj in false connection\n getEntities(root_decision[\"p:FlowDecision.False\"], isAlias);\n }\n // get info\n var _decision = new Entity();\n _decision.label = root_decision[\"@DisplayName\"] !== undefined ? root_decision[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Decision\";\n _decision.condition = root_decision[\"@Condition\"] !== undefined ? root_decision[\"@Condition\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_decision[\"@Condition\"].length - 2) : (root_decision[\"p:FlowDecision.Condition\"] !== undefined ? root_decision[\"p:FlowDecision.Condition\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\") : \"\");\n _decision.annotation = root_decision[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_decision[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _decision.type = typeEntity.t_decision;\n _decision.alias = isAlias;\n _decision.parent = parent !== undefined ? parent : '';\n\n mRoot.infoEntities.add(_decision);\n }\n } else { // is object\n var isAlias = root_decisions[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_decisions[\"@sap2010:WorkflowViewState.IdRef\"] : root_decisions[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_decisions[\"p:FlowDecision.True\"] !== undefined) { // have obj in true connection\n getEntities(root_decisions[\"p:FlowDecision.True\"], isAlias);\n }\n if (root_decisions[\"p:FlowDecision.False\"] !== undefined) { // have obj in false connection\n getEntities(root_decisions[\"p:FlowDecision.False\"], isAlias);\n }\n // get info\n var _decision = new Entity();\n _decision.label = root_decisions[\"@DisplayName\"] !== undefined ? root_decisions[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Decision\";\n _decision.condition = root_decisions[\"@Condition\"] !== undefined ? root_decisions[\"@Condition\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_decisions[\"@Condition\"].length - 2) : (root_decisions[\"p:FlowDecision.Condition\"] !== undefined ? root_decisions[\"p:FlowDecision.Condition\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\") : \"\");\n _decision.annotation = root_decisions[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_decisions[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _decision.type = typeEntity.t_decision;\n _decision.alias = isAlias;\n _decision.parent = parent !== undefined ? parent : '';\n mRoot.infoEntities.add(_decision);\n }\n }\n\n // switch\n if (obj[\"p:FlowSwitch\"] !== undefined) {\n var root_switchs = obj[\"p:FlowSwitch\"];\n // have \n if (typeof (root_switchs) === \"object\" && root_switchs.length !== undefined) { // is array object\n for (var i = 0; i < root_switchs.length; i++) {\n var root_switch = root_switchs[i];\n var isAlias = root_switch[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_switch[\"@sap2010:WorkflowViewState.IdRef\"] : root_switch[\"sap2010:WorkflowViewState.IdRef\"];\n // switch connection multi other decision/switch/step\n if (root_switch[\"p:FlowDecision\"] !== undefined || root_switch[\"p:FlowSwitch\"] !== undefined || root_switch[\"p:FlowStep\"]) {\n getEntities(root_switch, isAlias);\n }\n // only exitings a connect default by switch\n if (root_switch[\"p:FlowSwitch.Default\"] !== undefined) { // connect default\n getEntities(root_switch[\"p:FlowSwitch.Default\"], isAlias);\n }\n // get info\n var _switch = new Entity();\n _switch.label = root_switch[\"@DisplayName\"] !== undefined ? root_switch[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Switch\"; // label if existing different default\n _switch.expression = root_switch[\"@Expression\"] !== undefined ? root_switch[\"@Expression\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_switch[\"@Expressionf\"].length - 2) : (root_switch[\"p:FlowSwitch.Expression\"] !== undefined ? root_switch[\"p:FlowSwitch.Expression\"][\"mca:CSharpValue\"][\"#text\"] : \"\");\n _switch.annotation = root_switch[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_switch[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _switch.typeSwitch = root_switch[\"@x:TypeArguments\"].split(\"x:\")[1];\n _switch.type = typeEntity.t_switch;\n _switch.alias = isAlias;\n _switch.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_switch);\n }\n } else { // if object\n var isAlias = root_switchs[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_switchs[\"@sap2010:WorkflowViewState.IdRef\"] : root_switchs[\"sap2010:WorkflowViewState.IdRef\"];\n // only exitings a connect default by switch\n if (root_switchs[\"p:FlowSwitch.Default\"] !== undefined) { // connect default\n getEntities(root_switchs[\"p:FlowSwitch.Default\"], isAlias);\n }\n // switch connection multi other decision/switch/step\n if (root_switchs[\"p:FlowDecision\"] !== undefined || root_switchs[\"p:FlowSwitch\"] !== undefined || root_switchs[\"p:FlowStep\"] !== undefined) {\n getEntities(root_switchs, isAlias);\n }\n\n // get info\n var _switch = new Entity();\n _switch.label = root_switchs[\"@DisplayName\"] !== undefined ? root_switchs[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Switch\"; // label if existing different default\n _switch.expression = root_switchs[\"@Expression\"] !== undefined ? root_switchs[\"@Expression\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_switchs[\"@Expression\"].length - 2) : (root_switchs[\"p:FlowSwitch.Expression\"] !== undefined ? root_switchs[\"p:FlowSwitch.Expression\"][\"mca:CSharpValue\"][\"#text\"] : \"\");\n _switch.annotation = root_switchs[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_switchs[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _switch.typeSwitch = root_switchs[\"@x:TypeArguments\"].split(\"x:\")[1];\n _switch.type = typeEntity.t_switch;\n _switch.alias = isAlias;\n _switch.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_switch);\n }\n }\n\n // step - unknown\n if (obj[\"p:FlowStep\"] !== undefined) {\n var root_steps = obj[\"p:FlowStep\"];\n if (typeof (root_steps) === \"object\" && root_steps.length !== undefined) {\n for (var i = 0; i < root_steps.length; i++) {\n var root_step = root_steps[i];\n // approve\n if (root_step[\"ftwa:ApproveTask\"] !== undefined) {\n var root_approve = root_step[\"ftwa:ApproveTask\"];\n // alias is step's name\n var isAlias = root_step[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_step[\"@sap2010:WorkflowViewState.IdRef\"] : root_step[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_step[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_step[\"p:FlowStep.Next\"], isAlias);\n }\n var _approve = new Entity();\n _approve.label = root_approve[\"@DisplayName\"] != undefined ? root_approve[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"ApproveTask\";\n _approve.annotation = root_approve[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_approve[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_approve[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_approve[\"@AssignResultTo\"] != undefined && root_approve[\"@AssignResultTo\"] === \"{x:Null}\") {\n _approve.AssignResultTo = \"\";\n } else {\n if (root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"] !== undefined) {\n _approve.AssignResultTo = root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _approve.AssignResultTo = \"\";\n }\n }\n _approve.AssignedToUsers = root_approve[\"@AssignedToUsers\"] != undefined ? (root_approve[\"@AssignedToUsers\"] !== \"{x:Null}\" ? root_approve[\"@AssignedToUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.CorrelationId = root_approve[\"@CorrelationId\"] != undefined ? (root_approve[\"@CorrelationId\"] !== \"{x:Null}\" ? root_approve[\"@CorrelationId\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.DefaultResult = root_approve[\"@DefaultResult\"] != undefined ? (root_approve[\"@DefaultResult\"] !== \"{x:Null}\" ? root_approve[\"@DefaultResult\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Description = root_approve[\"@Description\"] != undefined ? (root_approve[\"@Description\"] !== \"{x:Null}\" ? root_approve[\"@Description\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresIn = root_approve[\"@ExpiresIn\"] != undefined ? (root_approve[\"@ExpiresIn\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresIn\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresWhen = root_approve[\"@ExpiresWhen\"] != undefined ? (root_approve[\"@ExpiresWhen\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresWhen\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.HandOverUsers = root_approve[\"@HandOverUsers\"] != undefined ? (root_approve[\"@HandOverUsers\"] !== \"{x:Null}\" ? root_approve[\"@HandOverUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnComplete = root_approve[\"@OnComplete\"] != undefined ? (root_approve[\"@OnComplete\"] !== \"{x:Null}\" ? root_approve[\"@OnComplete\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnInit = root_approve[\"@OnInit\"] != undefined ? (root_approve[\"@OnInit\"] !== \"{x:Null}\" ? root_approve[\"@OnInit\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.TaskCode = root_approve[\"@TaskCode\"] != undefined ? (root_approve[\"@TaskCode\"] !== \"{x:Null}\" ? root_approve[\"@TaskCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Title = root_approve[\"@Title\"] != undefined ? (root_approve[\"@Title\"] !== \"{x:Null}\" ? root_approve[\"@Title\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.UiCode = root_approve[\"@UiCode\"] != undefined ? (root_approve[\"@UiCode\"] !== \"{x:Null}\" ? root_approve[\"@UiCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.type = typeEntity.t_approve;\n _approve.alias = isAlias;\n _approve.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_approve);\n }\n // generic\n if (root_step[\"ftwa:GenericTask\"] !== undefined) {\n // alias is step's name\n var root_generic = root_step[\"ftwa:GenericTask\"];\n var isAlias = root_step[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_step[\"@sap2010:WorkflowViewState.IdRef\"] : root_step[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_step[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_step[\"p:FlowStep.Next\"], isAlias);\n }\n var _generic = new Entity();\n _generic.label = root_generic[\"@DisplayName\"] != undefined ? root_generic[\"@DisplayName\"] : \"GenericTask\";\n _generic.annotation = root_generic[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_generic[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_generic[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _generic.OnRun = root_generic[\"@OnRun\"] != undefined ? (root_generic[\"@OnRun\"] !== \"{x:Null}\" ? root_generic[\"@OnRun\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_generic[\"@TaskCode\"] !== undefined && root_generic[\"@TaskCode\"] === \"{x:Null}\") {\n _generic.TaskCode = \"\";\n } else {\n if (root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"] !== undefined) {\n _generic.TaskCode = root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _generic.TaskCode = \"\";\n }\n }\n _generic.type = typeEntity.t_generic;\n _generic.alias = isAlias;\n _generic.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_generic);\n }\n }\n } else {\n // approve\n if (root_steps[\"ftwa:ApproveTask\"] !== undefined) {\n var root_approve = root_steps[\"ftwa:ApproveTask\"];\n // alias is step's name\n var isAlias = root_steps[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_steps[\"@sap2010:WorkflowViewState.IdRef\"] : root_steps[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_steps[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_steps[\"p:FlowStep.Next\"], isAlias);\n }\n var _approve = new Entity();\n _approve.label = root_approve[\"@DisplayName\"] != undefined ? root_approve[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"ApproveTask\";\n _approve.annotation = root_approve[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_approve[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_approve[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_approve[\"@AssignResultTo\"] !== undefined && root_approve[\"@AssignResultTo\"] === \"{x:Null}\") {\n _approve.AssignResultTo = \"\";\n } else {\n if (root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"] !== undefined) {\n _approve.AssignResultTo = root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _approve.AssignResultTo = \"\";\n }\n }\n _approve.AssignedToUsers = root_approve[\"@AssignedToUsers\"] != undefined ? (root_approve[\"@AssignedToUsers\"] !== \"{x:Null}\" ? root_approve[\"@AssignedToUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.CorrelationId = root_approve[\"@CorrelationId\"] != undefined ? (root_approve[\"@CorrelationId\"] !== \"{x:Null}\" ? root_approve[\"@CorrelationId\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.DefaultResult = root_approve[\"@DefaultResult\"] != undefined ? (root_approve[\"@DefaultResult\"] !== \"{x:Null}\" ? root_approve[\"@DefaultResult\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Description = root_approve[\"@Description\"] != undefined ? (root_approve[\"@Description\"] !== \"{x:Null}\" ? root_approve[\"@Description\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresIn = root_approve[\"@ExpiresIn\"] != undefined ? (root_approve[\"@ExpiresIn\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresIn\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresWhen = root_approve[\"@ExpiresWhen\"] != undefined ? (root_approve[\"@ExpiresWhen\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresWhen\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.HandOverUsers = root_approve[\"@HandOverUsers\"] != undefined ? (root_approve[\"@HandOverUsers\"] !== \"{x:Null}\" ? root_approve[\"@HandOverUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnComplete = root_approve[\"@OnComplete\"] != undefined ? (root_approve[\"@OnComplete\"] !== \"{x:Null}\" ? root_approve[\"@OnComplete\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnInit = root_approve[\"@OnInit\"] != undefined ? (root_approve[\"@OnInit\"] !== \"{x:Null}\" ? root_approve[\"@OnInit\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.TaskCode = root_approve[\"@TaskCode\"] != undefined ? (root_approve[\"@TaskCode\"] !== \"{x:Null}\" ? root_approve[\"@TaskCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Title = root_approve[\"@Title\"] != undefined ? (root_approve[\"@Title\"] !== \"{x:Null}\" ? root_approve[\"@Title\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.UiCode = root_approve[\"@UiCode\"] != undefined ? (root_approve[\"@UiCode\"] !== \"{x:Null}\" ? root_approve[\"@UiCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.type = typeEntity.t_approve;\n _approve.alias = isAlias;\n _approve.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_approve);\n }\n // generic\n if (root_steps[\"ftwa:GenericTask\"] !== undefined) {\n var root_generic = root_steps[\"ftwa:GenericTask\"];\n // alias is step's name\n var isAlias = root_steps[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_steps[\"@sap2010:WorkflowViewState.IdRef\"] : root_steps[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_steps[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_steps[\"p:FlowStep.Next\"], isAlias);\n }\n var _generic = new Entity();\n _generic.label = root_generic[\"@DisplayName\"] != undefined ? root_generic[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"GenericTask\";\n _generic.annotation = root_generic[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_generic[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_generic[\"@sap2010:Annotation.AnnotationText\"] : \"\") : \"\";\n _generic.OnRun = root_generic[\"@OnRun\"] != undefined ? (root_generic[\"@OnRun\"] !== \"{x:Null}\" ? root_generic[\"@OnRun\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_generic[\"@TaskCode\"] !== undefined && root_generic[\"@TaskCode\"] === \"{x:Null}\") {\n _generic.TaskCode = \"\";\n } else {\n if (root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"] !== undefined) {\n _generic.TaskCode = root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _generic.TaskCode = \"\";\n }\n }\n _generic.type = typeEntity.t_generic;\n _generic.alias = isAlias;\n _generic.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_generic);\n }\n }\n }\n}", "function interchange2algoliaEntityRecord(interchangeRecord) {\n let algoliaRecord = {};\n\n let tmpResult;\n\n //fist copy the whole interchangeRecord\n algoliaRecord = JSON.parse(JSON.stringify(interchangeRecord));\n\n algoliaRecord.objectID = interchangeRecord.idName; //algolia must have the unique id in the field objectID\n\n delete algoliaRecord.id; // where did the id come from - well its gone now\n\n /*Algolia needs the location to be formatted in a certan way - do that if the gps position is there\n \"_geoloc\": {\n \"lat\": 40.639751,\n \"lng\": -73.778925\n }\n */\n tmpResult = getNested(interchangeRecord, \"location\", \"latLng\");\n if ((tmpResult != undefined) && (tmpResult != null)) { // there is a gps\n algoliaRecord._geoloc = {\n \"lat\": Number(getNested(interchangeRecord, \"location\", \"latLng\", \"lat\")),\n \"lng\": Number(getNested(interchangeRecord, \"location\", \"latLng\", \"lng\"))\n }\n delete algoliaRecord.location.latLng; // elete the gps object since it is now redundant\n }\n\n /* categoryAnswers to do filtering we need to format the categories we need to format categories \n according to https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#hierarchical-facets\n*/\n\n algoliaRecord.categories = [];\n // for all categories\n for (let i = 0; i < interchangeRecord.categoryAnswers.length; i++) {\n\n let categoryRecord = {};\n categoryRecord[interchangeRecord.categoryAnswers[i].displayName] = [];\n for (let j = 0; j < interchangeRecord.categoryAnswers[i].answers.length; j++) { // loop the answers\n let theAnswer = interchangeRecord.categoryAnswers[i].answers[j].displayName;\n categoryRecord[interchangeRecord.categoryAnswers[i].displayName].push(theAnswer);\n }\n algoliaRecord.categories.push(categoryRecord);\n }\n delete algoliaRecord.categoryAnswers;\n\n\n\n // entitytype \n algoliaRecord.entitytype = getNested(interchangeRecord, \"entitytype\", \"displayName\");\n\n // image\n algoliaRecord.image = getNested(interchangeRecord, \"image\", \"profile\");\n\n // organizationNumber\n algoliaRecord.organizationNumber = getNested(interchangeRecord, \"brreg\", \"organizationNumber\");\n // empolyees\n algoliaRecord.employees = Number(getNested(interchangeRecord, \"brreg\", \"employees\"));\n delete algoliaRecord.brreg;\n\n\n\n // city municipalityName countyName country\n algoliaRecord.city = getNested(interchangeRecord, \"location\", \"visitingAddress\", \"city\");\n algoliaRecord.municipalityName = getNested(interchangeRecord, \"location\", \"adminLocation\", \"municipalityName\");\n algoliaRecord.countyName = getNested(interchangeRecord, \"location\", \"adminLocation\", \"countyName\");\n algoliaRecord.country = getNested(interchangeRecord, \"location\", \"visitingAddress\", \"country\");\n delete algoliaRecord.location;\n\n return algoliaRecord;\n\n}", "function returnText(data) {\n let text = data.text[0];\n if (text === \"|\") {\n document.getElementById(\"idTranslated\").appendChild(document.createElement(\"br\"));\n } else {\n let paragraph = document.createElement(\"p\");\n paragraph.innerHTML = text;\n document.getElementById(\"idTranslated\").appendChild(paragraph);\n }\n}", "function _formatResults(entity, SEP) {\n var e = entity.e;\n if (typeof(e['getHeadline']) != \"undefined\") {\n //this is an ad entity\n return [\"Ad\",\n e.getCampaign().getName(),\n e.getAdGroup().getName(),\n e.getId(),\n e.getHeadline(),\n entity.code,\n e.getDestinationUrl()\n ].join(SEP) + \"\\n\";\n } else {\n // and this is a keyword\n return [\"Keyword\",\n e.getCampaign().getName(),\n e.getAdGroup().getName(),\n e.getId(),\n e.getText(),\n entity.code,\n e.getDestinationUrl()\n ].join(SEP) + \"\\n\";\n }\n}", "function handleLeadStartIntent(session, response) {\n var speechOutput = \"OK, let's create a new lead., What is the person's first and last name?\";\n response.ask(speechOutput);\n}", "function showOpps() {\n //Highlight the selected tile\n $('#LeadsTile').css(\"background-color\", \"#0072C6\");\n $('#OppsTile').css(\"background-color\", \"orange\");\n $('#SalesTile').css(\"background-color\", \"#0072C6\");\n $('#LostSalesTile').css(\"background-color\", \"#0072C6\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n var errArea = document.getElementById(\"errAllOpps\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var hasOpps = false;\n\n hideAllPanels();\n var oppList = document.getElementById(\"AllOpps\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n var oppTable = document.getElementById(\"OppList\");\n // Remove all nodes from the Opportunity <DIV> so we have a clean space to write to\n while (oppTable.hasChildNodes()) {\n oppTable.removeChild(oppTable.lastChild);\n }\n\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n // Create a DIV to display the organization name\n var opp = document.createElement(\"div\");\n var oppLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n opp.appendChild(oppLabel);\n\n // Add an ID to the opportunity DIV\n opp.id = listItem.get_id();\n\n // Add an class to the opportunity DIV\n opp.className = \"item\";\n\n // Add an onclick event to show the opportunity details\n $(opp).click(function (sender) {\n showOppDetails(sender.target.id);\n });\n\n //Add the opportunity div to the UI\n oppTable.appendChild(opp);\n hasOpps = true;\n }\n }\n if (!hasOpps) {\n var noOpps = document.createElement(\"div\");\n noOpps.appendChild(document.createTextNode(\"There are no opportunity. You can add a new Opportunity to an existing Lead.\"));\n oppTable.appendChild(noOpps);\n }\n $('#AllOpps').fadeIn(500, null);\n },\n\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get opportunity. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#OppList').fadeIn(500, null);\n });\n\n}", "async function getOpportunity (req, res) {\n res.send(await service.getOpportunity(req.authUser, req.params.opportunityId))\n}", "function lead(id) \n\t\t{\n\t\t\tpreviewPath = \"../leads_information.php?id=\"+id;\n\t\t\twindow.open(previewPath,'_blank','width=700,height=800,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,scrollbars=yes,status=no');\n\t\t}", "function activate() {\n teamMember.member.lead = (teamMember.member.name === 'Jett');\n }", "function handleViz( result, idCounter, item ) {\n\n // respective activity\n const actId = '_:viz' + idCounter['activity']++,\n actStartTime = (new Date( item.getData( 'startTime' ) )).toISOString(),\n actEndTime = (new Date( item.getData( 'endTime' ) )).toISOString();\n result['activity'][ actId ] = {\n 'prov:startTime': actStartTime,\n 'prov:endTime': actEndTime,\n 'prov:type': convertType( item.getData( 'type' ) ),\n 'yavaa:params': JSON.stringify( item.getData('params') ),\n 'yavaa:action': item.getData( 'action' ),\n 'yavaa:columns': JSON.stringify( item.getData( 'columns' ) ),\n 'yavaa:prevActivity': []\n };\n\n // add links\n linkToProv( item, actId, null );\n\n return actId;\n\n }", "function showLeads() {\n //Highlight the selected tile\n $('#LeadsTile').css(\"background-color\", \"orange\");\n $('#OppsTile').css(\"background-color\", \"#0072C6\");\n $('#SalesTile').css(\"background-color\", \"#0072C6\");\n $('#LostSalesTile').css(\"background-color\", \"#0072C6\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n \n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n var hasLeads = false;\n hideAllPanels();\n var LeadList = document.getElementById(\"AllLeads\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n\n // Success returned from executeQueryAsync\n var leadTable = document.getElementById(\"LeadList\");\n\n // Remove all nodes from the lead <DIV> so we have a clean space to write to\n while (leadTable.hasChildNodes()) {\n leadTable.removeChild(leadTable.lastChild);\n }\n\n // Iterate through the Prospects list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n\n\n // Create a DIV to display the organization name \n var lead = document.createElement(\"div\");\n var leadLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n lead.appendChild(leadLabel);\n\n // Add an ID to the lead DIV\n lead.id = listItem.get_id();\n\n // Add an class to the lead DIV\n lead.className = \"item\";\n\n // Add an onclick event to show the lead details\n $(lead).click(function (sender) {\n showLeadDetails(sender.target.id);\n });\n\n // Add the lead div to the UI\n leadTable.appendChild(lead);\n hasLeads = true;\n }\n }\n if (!hasLeads) {\n var noLeads = document.createElement(\"div\");\n noLeads.appendChild(document.createTextNode(\"There are no leads. You can add a new lead from here.\"));\n leadTable.appendChild(noLeads);\n }\n $('#AllLeads').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get Leads. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#LeadList').fadeIn(500, null);\n });\n\n}", "function displayCRMInfo(id = \"-\", trackingId = \"-\", location = \"-\", pickup = \"-\", delivery = \"-\", status = \"-\") {\n const idElement = document.getElementById(\"id\");\n const trackingIdElement = document.getElementById(\"tracking-id\");\n const locationElement = document.getElementById(\"location\");\n const pickupElement = document.getElementById(\"pickup\");\n const deliveryElement = document.getElementById(\"delivery\");\n const statusElement = document.getElementById(\"status\");\n\n idElement.textContent = id;\n trackingIdElement.textContent = trackingId;\n locationElement.textContent = location;\n pickupElement.textContent = pickup;\n deliveryElement.textContent = delivery;\n statusElement.textContent = status;\n}", "function vacationMarketing ({destination, activity}){ //access the properties by adding {}\n return `Come to ${destination} and do some ${activity}.`\n}", "function addDirections(json) {\r\n\t\tlet p = document.createElement(\"p\");\r\n\t\tp.innerHTML = \"<span>Instructions: </span></br>\";\r\n\t\tp.innerHTML += json.meals[0].strInstructions;\r\n\t\tdocument.getElementById(\"instructions\").appendChild(p);\r\n\t}", "function populateScreenTeam (teamObj){\n let team = \"<p>\" + teamObj.name + \"</p>\";\n let wins = \"<p style='color: #2b9642'>\";\n wins += teamObj.wins;\n wins += \" wins</p>\";\n let losses = \"<p style='color: #7a212c'>\";\n losses += teamObj.losses;\n losses += \" losses</p>\";\n $('#about-team').append(team);\n $('#about-team').append(wins);\n $('#about-team').append(losses);\n }", "function makeInviteElement(obj) {\n var inviteCloneClone = inviteEventClone.clone(true);\n\n // if current person is interpreter we fill in block with appropriate text\n if (currentRole === 1) {\n inviteCloneClone.find(\".js-first-invite-line\").html(window.__(\"You were invited to this job by \") + obj.business_name);\n inviteCloneClone.find(\".js-second-invite-line\").text(window.__(\"Please apply for it.\"));\n // if current person is business we fill in block with appropriate text\n } else {\n inviteCloneClone.find(\".js-first-invite-line\").html(window.__(\"You have invited <a class='skiwo-link'></a> to this job.\"));\n inviteCloneClone.find(\".js-first-invite-line\").find(\"a\").text(obj.interpreter_name);\n inviteCloneClone.find(\".js-first-invite-line\").find(\"a\").attr(\"href\", obj.interpreter_link);\n inviteCloneClone.find(\".js-second-invite-line\").text(window.__(\"Please send them a message, and explain why you think this assignment is right for them.\"));\n }\n\n inviteCloneClone.find(\".chat-invite-event-date\").text(obj.formated_date);\n\n // then we return invite block for inserting into events container\n return inviteCloneClone;\n } // end of creating invite event function", "async cmd_ad_journey(params) {\n return this.query({\n url: \"/user/watchadviewed/\",\n body: {\n shorten_journey_id: 1,\n },\n })\n }", "async getShortlistOpportunity(href) {\n if (href in this.state.shortlistOpportunities) {\n return this.state.shortlistOpportunities[href];\n } else {\n let item = await this.itemService.getItem(href);\n this.state.shortlistOpportunities[href] = item;\n return item;\n }\n }", "function createInfoWindowContent(trailObject) {\n\n // contentString is the string that will be passed to the infowindow\n var contentString;\n\n // description is the description received from openTrailsAPI\n var description;\n\n // if name is present from openTrailsAPI add it to contentString\n if (trailObject.name) {\n var name = trailObject.name;\n name = \"<h5><em>\" + name + \"</em></h5>\";\n contentString = name;\n }\n\n // first search to see if the activities array is present in the return from the openTrailsAPI. This avoids undefined errors\n if (trailObject.activities[0]) {\n\n // if thumbnail image is present from openTrailsAPI add it to contentString\n if (trailObject.activities[0].thumbnail) {\n var picture = trailObject.activities[0].thumbnail;\n picture = \"<img src='\" + picture + \"' alt='thumbnail' class='trailImage'><br>\";\n contentString += picture;\n }\n\n // if activity_type is present from openTrailsAPI add it to contentString\n if (trailObject.activities[0].activity_type_name) {\n var activity_type = trailObject.activities[0].activity_type_name;\n activity_type = \"<br><p class='activityType'><b>Type: </b>\" + activity_type + \"</p><br>\";\n contentString += activity_type;\n }\n }\n\n // if activity_type is present from openTrailsAPI add it to contentString.\n if (trailObject.description) {\n description = trailObject.description;\n description = \"<p><b>Description:</b></p><p class='trailDescription'>\" + description + \"</p><br>\";\n contentString += description;\n } else if (trailObject.activities[0]) {\n if (trailObject.activities[0].description) {\n description = trailObject.activities[0].description;\n description = \"<p><b>Description:</b></p><p class='trailDescription'>\" + description + \"</p><br>\";\n contentString += description;\n }\n }\n\n // if directiosn is present from openTrailsAPI add it to the contentString\n if (trailObject.directions) {\n var directions = trailObject.directions;\n directions = \"<p><b>Directions:</b></p><p class='trailDirections'>\" + directions + \"</p><br>\";\n contentString += directions;\n }\n\n // add rating if present in the openTrailsAPI\n if (trailObject.activities[0]) {\n if (trailObject.activities[0].rating) {\n var rating = trailObject.activities[0].rating;\n rating = \"<p class='trailRating'><b>Rating: </b>\" + rating + \" out of 5.</p><br>\";\n contentString += rating;\n }\n }\n\n return contentString;\n }", "function storeOpportunityDetails(opportunityObj){\n\tlocalStorage.konyOpportunityDetails = opportunityObj; //storing the corresponding opportunity details in localstorage\n\tchangePage('opportunitydetailspage','');\n}", "async function getOpportunityDetails (req, res) {\n res.send(await service.getOpportunityDetails(req.authUser, req.params.opportunityId))\n}", "updateLead(contactInfo) {\n this.setState({\n contactInfo: {...this.state.contactInfo, ...contactInfo},\n loading: true\n })\n\n return this.getLead()\n .then(lead => {\n let contactState = States[contactInfo.stateCode].abbreviation\n let updatedLead = {\n id: lead.id,\n firstName: contactInfo.firstName,\n lastName: contactInfo.lastName,\n phoneNmbr: contactInfo.phoneNmbr,\n address: `${contactInfo.address} ${contactInfo.city}, ${contactState}`,\n stateCode: contactInfo.stateCode,\n zipCode: contactInfo.zipCode,\n currentCustomer: contactInfo.currentCustomer === 'Yes'\n }\n if (contactInfo.emailAddr) updatedLead.emailAddr = contactInfo.emailAddr\n if (contactInfo.question) updatedLead.question = contactInfo.question\n return LeadService.updateLead(updatedLead)\n })\n .then(lead => {\n this.setState({loading: false})\n return lead\n })\n .catch(err => this.showErrorModal(err.message))\n }", "viewAllignmentGroup() {\r\n//to start we are going to ask the user what AllignmentGroup they wish to view,we do that by prompt them by entering the index with the text to let\r\n //them know they have to enter the AllignmentGroup they wish to view \r\n let index = prompt(\"Enter the index of the allignment group you wish to view:\");\r\n//w/the AllignmentGroup returned this validates the users input cause the index(AllignmentGroup)cannot be less than 0,or more than the npcs length \r\n//cuz it will create an error. Users are crazy and can crash things by putting in anything they want. So we validate the input to not crash. \r\n if (index > -1 && index < this.allignmentGroups.length) {\r\n //this is where we set the selected AllignmentGroup = the users inputed AllignmentGroup. \r\n this.selectedAllignmentGroup = this.allignmentGroups[index];\r\n //Where we start w/ the description of the npcs. \r\n \r\n let description = \"Allignment Group: \" + this.selectedAllignmentGroup.allignment + \"\\n\";\r\n//Now what we want to do is add the description of all the NPCs to the AllignmentGroup so below we accomplish that by creating a for loop\r\n//Remember each AllignmentGroup has a NPCs array so we are looking at that NPCs array, we have to iterate thru it so we use the length from\r\n//that array. \r\n for (let i = 0; i < this.selectedAllignmentGroup.npcs.length; i++) {\r\n//adding on to the description to print out the selectedAllignmentGroup array, i is the specific NPC that we're looking at for this\r\n//iteration and the name of the NPC is what we get w/ posistion w/new line. that will build a list of the AllignmentGroup NPCs.\r\n description += i + \") \" + this.selectedAllignmentGroup.npcs[i].name\r\n + \" - \" + this.selectedAllignmentGroup.npcs[i].occupation + \"\\n\";\r\n }\r\n \r\n//this is using top down development again since we have not created this yet. we are going to display the AllignmentGroup and the show all the \r\n//options for the AllignmentGroup then we add a switch \r\n let selection = this.showAllignmentMenuOptions(description);\r\n//This selection option is different from our overall selection our over all menu option, this is a SUB MENU of the full menu thats \r\n//why we are creating another selection variable within the scope of view AllignmentGroup and creating another switch for the sub selection.\r\n switch (selection) {\r\n case \"1\": \r\n this.createNPC();\r\n break;\r\n case \"2\":\r\n this.deleteNPC();\r\n }\r\n }\r\n \r\n }", "function openCase() {\n var ef = {};\n ef[\"entityName\"] = \"incident\";\n Microsoft.CIFramework.getFocusedSession().then((sessionId) => {\n\n var sessionI = phone.listOfSessions.get(sessionId);\n\n if (sessionI.currentCase) {\n ef[\"entityId\"] = sessionI.currentCase;\n }\n else {\n return;\n }\n var input = {\n templateName: \"entityrecord\",\n templateParameters: {\n entityName: \"incident\",\n entityId: ef[\"entityId\"]\n },\n isFocused: true\n }\n Microsoft.CIFramework.createTab(input);\n });\n}", "addWordBreakOpportunity() {\n if (\n this._stackItem instanceof BlockStackItem ||\n this._stackItem instanceof TableCellStackItem\n ) {\n this._stackItem.inlineTextBuilder.wordBreakOpportunity = true;\n }\n }", "function show(dialog) {\n\t\n\t//ADD LEAD BUTTON\n\t$('#add_lead').click(function (e) {\n\t\te.preventDefault();\n\t\t\n\t\t//Get fields off modal\n\t\tvar leadcat = $(\"#lead_category :selected\").val();\n\t\tvar first = $(\"#first_name\").val();\n\t\tvar last = $(\"#last_name\").val();\n\t\tvar phone = $(\"#phone\").val();\n\t\tvar email = $(\"#email\").val();\n\t\tvar priority = $(\"#lead_priority :selected\").val();\n\t\tvar leadnotes = $(\"#lead_notes\").val();\n\t\t\n\t\t$.ajax({\n\t\t\turl:\"ajax_add_new_lead.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdata: { category: leadcat,\n\t\t\t\t\tfirst_name: first,\n\t\t\t\t\tlast_name: last,\n\t\t\t\t\tphone: phone,\n\t\t\t\t\temail: email,\n\t\t\t\t\tlead_priority: priority,\n\t\t\t\t\tlead_notes: leadnotes},\n\t\t\tdataType: \"html\",\t\t\n\t\t\tsuccess:function(result){\n\t\t\t\t//alert(result);\n\t\t\t\t$(\".leadcontentright\").html(result);\n\t\t\t},\t//end success:function\n\t\t\terror:function(jqXHR, textStatus, errorThrown){\n\t\t\t\t$(\".leadcontentright\").html(errorThrown);\n\t\t\t}\n\t\t}); //end $.ajax\n\t\t\n\t});\t\t//END ADD_LEAD BUTTON\n\t//*********************************************************\n\t\n\t\n\t//EDIT Lead BUTTON\n\t$('#edit_lead').click(function (e) {\n\t\te.preventDefault();\n\t\t\n\t\tvar dataChanged = false;\n\t\t\n\t\t//Get fields off modal\n\t\tvar lid = $(\"#lid\").val();\n\t\tvar leadcat = $(\"#lead_category :selected\").val();\n\t\tvar first = $(\"#first_name\").val();\n\t\tvar last = $(\"#last_name\").val();\n\t\tvar phone = $(\"#phone\").val();\n\t\tvar email = $(\"#email\").val();\n\t\tvar priority = $(\"#lead_priority :selected\").val();\n\t\tvar leadnotes = $(\"#lead_notes\").val();\n\t\t\t\t\n\t\t//Original Values\n\t\tvar ogleadcat = $(\"#og_category\").val();\n\t\tvar ogfirst = $(\"#og_firstname\").val();\n\t\tvar oglast = $(\"#og_lastname\").val();\n\t\tvar ogphone = $(\"#og_phone\").val();\n\t\tvar ogemail = $(\"#og_email\").val();\n\t\tvar ogpriority = $(\"#og_priority\").val();\n\t\tvar ogleadnotes = $(\"#og_notes\").val();\n\t\t\n\t\t\t\t\t \n\t\t//Check for data changes\n\t\tif (leadcat != ogleadcat) {dataChanged = true;}\n\t\tif (first.toLowerCase() != ogfirst.toLowerCase()) {dataChanged = true;}\n\t\tif (last.toLowerCase() != oglast.toLowerCase()) {dataChanged = true;}\n\t\tif (email != ogemail) {dataChanged = true;}\n\t\tif (phone != ogphone) {dataChanged = true;}\n\t\tif (priority != ogpriority) {dataChanged = true;}\n\t\tif (leadnotes != ogleadnotes) {dataChanged = true;}\n\t\t\n\t\tif (dataChanged) {\n\t\t\t//set hidden form var data_changed to true\n\t\t\t$(\"#data_changed\").val('true');\n\t\t}\t\n\t\t\n\t\tvar datachange = $(\"#data_changed\").val();\n\t\t\n\t\t$.ajax({\n\t\t\turl:\"ajax_update_lead.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdata: { lid: lid,\n\t\t\t\t\tcategory: leadcat,\n\t\t\t\t\tfirst_name: first,\n\t\t\t\t\tlast_name: last,\n\t\t\t\t\tphone: phone,\n\t\t\t\t\temail: email,\n\t\t\t\t\tlead_priority: priority,\n\t\t\t\t\tlead_notes: leadnotes,\n\t\t\t\t\togleadcat: ogleadcat,\n\t\t\t\t\togfirst: ogfirst,\n\t\t\t\t\toglast: oglast,\n\t\t\t\t\togphone: ogphone,\n\t\t\t\t\togemail: ogemail,\n\t\t\t\t\togpriority: ogpriority,\n\t\t\t\t\togleadnotes: ogleadnotes,\n\t\t\t\t\tdata_changed: datachange},\n\t\t\tdataType: \"html\",\t\t\n\t\t\tsuccess:function(result){\n\t\t\t\t//alert(result);\n\t\t\t\t$(\".leadcontentright\").html(result);\n\t\t\t},\t//end success:function\n\t\t\terror:function(jqXHR, textStatus, errorThrown){\n\t\t\t\t$(\".leadcontentright\").html(errorThrown);\n\t\t\t}\n\t\t}); //end $.ajax\n\t\t\n\t\t//Have to reset the original values equal to what\n\t\t//was just submitted to start fresh for any\n\t\t//subsequent update!\n\t\t//\n\t\t//SET og hiddens to the extracted js variables from form fields\n\t\t//after ajax runs\n\t\t$(\"#og_category\").val(leadcat);\n\t\t$(\"#og_firstname\").val(first);\n\t\t$(\"#og_lastname\").val(last);\n\t\t$(\"#og_phone\").val(phone);\n\t\t$(\"#og_email\").val(email);\n\t\t$(\"#og_priority\").val(priority);\n\t\t$(\"#og_notes\").val(leadnotes);\n\t\t\n\t\t//reset the data_changed hidden flag\n\t\t$(\"#data_changed\").val('false');\n\t\t\n\t});\t\t//END EDIT_LEAD BUTTON\n\t\n\t//**************************************\n\t//\t\t'MOVE TO PROSPECTS' BUTTON\n\t//**************************************\n\t$('#make_prospect').click(function (e) {\n\t\te.preventDefault();\n\t\t\n\t\t$(\".leadcontentright\").html(\"\");\n\t\t\n\t\t//Get the OG values to send over to contacts\n\t\t//table\n\t\t//Original Values\n\t\tvar lid = $(\"#lid\").val();\n\t\tvar ogleadcat = $(\"#og_category\").val();\n\t\tvar ogfirst = $(\"#og_firstname\").val();\n\t\tvar oglast = $(\"#og_lastname\").val();\n\t\tvar ogphone = $(\"#og_phone\").val();\n\t\tvar ogemail = $(\"#og_email\").val();\n\t\tvar ogpriority = $(\"#og_priority\").val();\n\t\tvar ogleadnotes = $(\"#og_notes\").val();\n\t\t\n\t\t$.ajax({\n\t\t\turl:\"ajax_convert_lead_to_prospect.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdata: { lid: lid,\n\t\t\t\t\tcategory: ogleadcat,\n\t\t\t\t\tfirst_name: ogfirst,\n\t\t\t\t\tlast_name: oglast,\n\t\t\t\t\tphone: ogphone,\n\t\t\t\t\temail: ogemail,\n\t\t\t\t\tlead_notes: ogleadnotes},\n\t\t\tdataType: \"html\",\t\t\n\t\t\tsuccess:function(result){\n\t\t\t\t//alert(result);\n\t\t\t\t$(\".leadcontentright\").html(result);\n\t\t\t},\t//end success:function\n\t\t\terror:function(jqXHR, textStatus, errorThrown){\n\t\t\t\t$(\".leadcontentright\").html(errorThrown);\n\t\t\t}\n\t\t}); //end $.ajax\n\t\t\n\t\t\n\t});\t\t//END MAKE PROSPECT BUTTON\n}", "function formatAirlineFlightDetails (flight) {\n var airlineName = flight.airline.name;\n var flightNum = flight.flightNum;\n var start = flight.start.airportCode;\n var finish = flight.finish.airportCode;\n return '<p><strong>' + airlineName + '</strong></p>' +\n '<p>&emsp;' + start + ' &#x2708; ' + finish + '</p>' +\n '<p>&emsp;flight ' + flightNum + '</p>';\n }", "function getStory(passedIdea){\n getAnIdea(passedIdea._id)\n setTravel(true)\n }", "function journey(input = []) {\n let budget = Number(input[0]);\n let season = input[1];\n let place = season === 'summer' ? 'Camp' : 'Hotel';\n\n let moneySpend = 0;\n let percent = 0;\n let destination = '';\n if (budget <= 100) {\n let obj = {\n summer: 0.3,\n winter: 0.7\n };\n destination = 'Bulgaria';\n percent = obj[season];\n } else if (budget <= 1000) {\n let obj = {\n summer: 0.4,\n winter: 0.8\n };\n percent = obj[season];\n destination = 'Balkans';\n } else if (budget > 1000) {\n place = 'Hotel';\n percent = 0.9;\n destination = 'Europe';\n }\n moneySpend = budget * percent;\n return `Somewhere in ${destination}\\n${place} - ${moneySpend.toFixed(2)}`;\n}", "function vacationMarketing({destination, activity}) {\n return `Come to ${destination} and do some ${activity}`\n}", "function show_traj() {\n var traj_obj = editor.getValue();\n var traj = JSON.stringify(traj_obj, null, \" \");\n var scriptwin = window.open(\"\", \"_blank\");\n scriptwin.traj_obj = traj_obj;\n scriptwin.document.title = \"Trajectory: \";\n var code = scriptwin.document.createElement('pre');\n scriptwin.document.body.appendChild(code);\n code.innerHTML = traj;\n return scriptwin\n }", "function firstJourney(startLine,startStop){\n\n\n\n // I used if statement to decide which way the customer is heading\n\n if(startLine.indexOf(startStop) > startLine.indexOf('Union Square')){\n\n startLine.reverse(); \n\n }\n\n for (let i = startLine.indexOf(startStop)+1; i < startLine.indexOf('Union Square'); i++) {\n\n firstTripString += startLine[i] + ', ';\n\n numberOfStops++;\n\n }\n\n firstTripString += 'and Union Square.'\n\n numberOfStops++;\n\n\n\n // logging the first string and changing at Union Square message\n\n console.log(firstTripString);\n\n console.log('Change at Union Square.');\n\n }", "function addOpp() {\n\n // Get Data from the input fields\n var newOpp = {\n title: $('#title').val(),\n category: $('#category').val(),\n desc: $('#desc').val(),\n fields: $('#fields').val(),\n period: $('#period').val(),\n }\n\n if ($('#reward-c').val() || $('#reward-h').val()) {\n let rewards = \"\";\n let first = true;\n if ($('#reward-c').val()) {\n rewards = rewards + $('#reward-c').val();\n }\n if ($('#reward-h').val()) {\n if (first) {\n first = false;\n rewards = rewards + $('#reward-h').val();\n } else {\n rewards = rewards + ', ' + $('#reward-h').val();\n }\n }\n newOpp.rewards = rewards;\n }\n\n if ($('#wage').val()) {\n newOpp.wage = $('#wage').val();\n }\n\n // Push new opportunity to the array of opportunities\n opps.push(newOpp);\n\n // display the new array of opportunities\n var oppScript = \"\";\n opps.forEach(function(opp) {\n oppScript = oppScript + '<div class=\"col-md-4 opp-col pb-4\"> <div class=\"opp-container\"> <h3>' + opp.title + '</h3> <p class=\"opp-category\">' + opp.category;\n oppScript = oppScript + '</p> <p class=\"opp-desc\">' + (opp.desc).substring(0, 50) + '...' + '</p> <p class=\"opp-field\">' + opp.fields;\n oppScript = oppScript + '</p> <p class=\"opp-period\">' + 'لمدة ' + opp.period + '</p>';\n if (typeof opp.wage != 'undefined') {\n oppScript = oppScript + '<p class=\"opp-wage\">' + opp.wage + ' ريال ' + '</p>'\n }\n oppScript = oppScript + '<div class=\"text-center\"> <a type=\"button\" class=\"btn\" href=\"opp.html\">التفاصيل</a> </div> </div> </div>'\n });\n $(\".opps-row\").html(oppScript);\n\n $('.message-container').slideDown();\n\n setTimeout(\n function() {\n $('.message-container').slideUp();\n }, 3000);\n\n // $('.message').append('<div class=\"message-container fixed-top\">تم إضافة الفرصة بنجاح!</div>');\n //\n // setTimeout(\n // function() {\n // $('.message').empty();\n // }, 5000);\n\n}", "function Ladder_Function() {\r\n document.getElementById(\"Ladder_Type\").innerHTML = // Display ladder type\r\n \"My ladder is a \" + myLadder.type + \" ladder.\";\r\n }", "function description (place, places) {\n let toReturn = \"you're standing in the \" + place.name + '.'\n if (place.left !== undefined) {\n toReturn += '</br>on your left is the ' + places[place.left].name + '.'\n }\n if (place.right !== undefined) {\n toReturn += '</br>on your right is the ' + places[place.right].name + '.'\n }\n if (place.ahead !== undefined) {\n toReturn += '</br>ahead of you is the ' + places[place.ahead].name + '.'\n }\n if (place.behind !== undefined) {\n toReturn += '</br>behind you is the ' + places[place.behind].name + '.'\n }\n if (!place.settings.beenHere && place.messages.newText !== '') {\n toReturn += '</br></br>' + place.messages.newText + '.'\n }\n return toReturn\n}", "function handleCrmLinkModal(event){\n \n setCurrentCrmOppType(event.currentTarget.id);\n crmModalToggle();\n setCurrentCrmSelectedOpp(null);\n setCurrentCrmSelectedOppText(\"Type-in and Select the CRM Opportunity to link !\");\n }", "function singleLineJourney() {\n \n if (startLine === endLine) {\n if (startJourney < endJourney) {\n for (var i = startJourney; i <= endJourney; i++) {\n journey.push(startLine[i])\n }\n } else if (startJourney > endJourney) {\n for (var i = startJourney; i >= endJourney; i--) {\n journey.push(startLine[i])\n }\n }\n }\n \n}", "static buildActivityFromLGStructuredResult(lgValue) {\n let activity = {};\n const type = this.getStructureType(lgValue);\n if (this.genericCardTypeMapping.has(type) || type === 'attachment') {\n activity = messageFactory_1.MessageFactory.attachment(this.getAttachment(lgValue));\n }\n else if (type === 'activity') {\n activity = this.buildActivity(lgValue);\n }\n else if (lgValue) {\n activity = this.buildActivityFromText(JSON.stringify(lgValue).trim());\n }\n return activity;\n }", "function handleLeadsTodayIntent(response) {\n var speechOutput = 'saywhat'; \n var query = 'Select Name, Company from Lead where CreatedDate = TODAY';\n\n // auth and run query\n org.authenticate({ username: SF_USER, password: SF_PWD_TOKEN }).then(function(){\n return org.query({ query: query })\n }).then(function(results) {\n speechOutput = 'Sorry, you do not have any new leads for today.';\n var recs = results.records;\n\n if (recs.length > 0) {\n speechOutput = 'You have ' + recs.length + ' new ' + pluralize('lead', recs.length) + ', ';\n for (i=0; i < recs.length; i++){\n speechOutput += i+1 + ', ' + recs[i].get('Name') + ' from ' + recs[i].get('Company') + ', ';\n if (i === recs.length-2) speechOutput += ' and ';\n }\n speechOutput += ', have a great day!';\n }\n\n // Create speech output\n response.tellWithCard(speechOutput, \"Salesforce\", speechOutput);\n }).error(function(err) {\n var errorOutput = 'Darn, there was a Salesforce problem, sorry';\n response.tell(errorOutput, \"Salesforce\", errorOutput);\n });\n}", "function presentAlternatives(bookings) {\n for (let i = 0; i < bookings.length; i += 1) {\n console.log(\"Alternative #\" + (i + 1))\n console.log(\"Day: \" + bookings[i].day)\n console.log(\"Movie: \" + bookings[i].movie.title)\n console.log(\"Restaurant booking: \" + bookings[i].table.from + \" to \" +\n bookings[i].table.to + \"\\n\")\n }\n}", "function transformBookingItemForDisplay(data) {\n var booking = angular.fromJson(data);\n booking = bookingAdminService.bookingDic(booking);\n return booking;\n }", "function renderMatchInfo(item) {\n \n if(item.home_team.penalties !== 0 && item.away_team.penalties !== 0) {\n return `<div class=\"centered-text\">\n <h2>${item.home_team_country} vs ${item.away_team_country}</h2>\n <h3>${item.home_team.goals}(${item.home_team.penalties}) : ${item.away_team.goals}(${item.away_team.penalties})</h3>\n </div> `}\n else\n {\n return `<div class=\"centered-text\">\n <h2>${item.home_team_country} vs ${item.away_team_country}</h2>\n <h3>${item.home_team.goals} : ${item.away_team.goals}</h3>\n </div> ` \n }\n}", "analizeTeam(filtered, teamName, options = { mode: 'winlose', sub: 'ow', limit: 0, arg: 0 }) {\n console.log('analizeOptions', options)\n const games = [...filtered.matchesInfo].reverse()\n\n const wlHelpDict = { 'w': 'НП', 'l': 'НВ', 'd': 'ВП', 'wl': 'Н', 'wd': 'П', 'ld': 'В' }\n\n let wlSeq, goalsReps, hitgateReps\n\n if (options.mode == 'winlose') {\n wlSeq = games.map(x => x.result).join('')\n\n if (options.sub[0] == 'o') {\n const removeChars = wlHelpDict[options.sub[1]]\n wlSeq = wlSeq.replace(new RegExp(removeChars.split('').join('|'), 'g'), '.').split('.').map(x => x.length)\n\n } else {\n wlSeq = wlSeq.split(wlHelpDict[options.sub]).map(x => x.length)\n }\n } else if (options.mode == 'goals') {\n const nameCompare = (matchObj) => matchObj.name.split('(')[0].trim().toLowerCase() === teamName.toLowerCase()\n const operationCompare = (a, b, op = '=') => ({ '=': a === b, '<': a < b, '>': a > b, '<=': a <= b, '>=': a >= b }[op])\n\n if (options.sub == 'sumtotal') {\n goalsReps = games.map(x => +x.first.filteredGoals + +x.second.filteredGoals).map(x => operationCompare(x, options.arg, options.operation) ? 1 : '-').join('').split('-').map(x => x.length)\n } else if (options.sub == 'total') {\n goalsReps = games.map(x => nameCompare(x.first) ? x.first.filteredGoals : x.second.filteredGoals).map(x => operationCompare(+x, options.arg, options.operation) ? 1 : '-').join('').split('-').map(x => x.length)\n } else if (options.sub == 'missed') {\n goalsReps = games.map(x => nameCompare(x.first) ? x.second.filteredGoals : x.first.filteredGoals).map(x => operationCompare(+x, options.arg, options.operation) ? 1 : '-').join('').split('-').map(x => x.length)\n } else {\n goalsReps = games.map(x => nameCompare(x.first) ? x.first.filteredGoals - x.second.filteredGoals : x.second.filteredGoals - x.first.filteredGoals).map(x => +x > -options.arg ? 1 : '-').join('').split('-').map(x => x.length)\n }\n } else if (options.mode == 'hitgate') {\n if (options.sub == 'both') {\n hitgateReps = games.map(x => +(x.first.goals > 0 && x.second.goals > 0)).join('').replace(/0/g, '.').split('.').map(x => x.length)\n } else if (options.sub == 'onenot') {\n hitgateReps = games.map(x => +(x.first.goals == 0 || x.second.goals == 0)).join('').replace(/0/g, '.').split('.').map(x => x.length)\n } else { // onezero\n hitgateReps = games.map(x => +!!(x.first.goals > 0 ^ x.second.goals > 0)).join('').replace(/0/g, '.').split('.').map(x => x.length)\n }\n }\n\n const reps = wlSeq || goalsReps || hitgateReps\n const saveIndexes = []\n const fullIndexes = []\n const series = []\n\n const red = reps.reduce((a, b) => {\n if (b >= options.limit) {\n saveIndexes.push(a + Math.min(b, options.limit))\n fullIndexes.push(a + b)\n series.push(b)\n }\n return a + b + 1\n }, 0)\n\n return { saveIndexes, fullIndexes, gamesAfterLimit: saveIndexes.map(x => games[x]), reps, series }\n }", "AI_ScoreTradeOffer( deal ) { \n\t\t// what they are offering us\n\t\tlet our_score = 0;\n\t\tfor ( let i of deal.offer ) {\n\t\t\ti.score = this.AI_ScoreTradeItem(i,deal.from);\n\t\t\tour_score += i.score;\n\t\t\t// console.log(`OFFERING: ${i.score} for ${i.label}`);\n\t\t\t}\n\t\t// what they are asking for\n\t\tlet their_score = 0;\n\t\tfor ( let i of deal.ask ) {\n\t\t\ti.score = this.AI_ScoreTradeItem(i,deal.from);\n\t\t\ttheir_score += i.score;\n\t\t\t// console.log(`ASKING: ${i.score} for ${i.label}`);\n\t\t\t}\n\t\t// better deals for better relationships\n\t\ttheir_score *= 0.75 + this.LoveNub(deal.from) * 0.5;\n\t\t// more likely to say yes if attention span is high\n\t\ttheir_score *= utils.Clamp( 0.25 + deal.from.diplo.contacts.get(deal.to).attspan, deal.to.diplo.focus, 1 );\n\t\t// what would it take to make us say yes?\n\t\tdeal.raw_diff = our_score - their_score;\n\t\t// the score is positive or negative depending on how it is viewed. \n\t\t// we cannot use a simple ratio which is always positive.\n\t\tlet our_score_norm = our_score / (our_score + their_score);\n\t\tlet their_score_norm = their_score / (our_score + their_score);\n\t\tlet score = our_score_norm - their_score_norm;\n\t\t// console.log(`TRADE SCORE: ${our_score_norm} - ${their_score_norm} = ${score} `);\n\t\tdeal.offer_score = our_score;\n\t\tdeal.ask_score = their_score;\n\t\tdeal.total_score = Math.abs( their_score ) + Math.abs( our_score );\n\t\tdeal.importance = Math.sqrt( deal.total_score );\n\t\tdeal.score = score;\n\t\treturn score;\n\t\t}", "function linkToProv( wfEntry, actId, resultId ) {\n\n // the respective activity\n wfEntry[ symbols.linkedActivity ] = actId;\n\n wfEntry[ symbols.linkedResult ] = resultId;\n }", "open(OpportunityId, OpportunityTitle, forceReload) {\n $state.go('opportunities.view', {\n OpportunityId: OpportunityId,\n PrettyURL: Util.convertToSlug(OpportunityTitle),\n forceReload: forceReload || false\n });\n }", "function linkCompany(opp, company, updateGrid){\n return RelationshipManager.linkEntity(opp, company, \"Content\", \"Company\", \n {\n \"from\": { \"name\": opp.name, \"description\": \"Primary Org\", \"isPrimary\": true}, \n \"to\" : { \"name\": company.name, \"description\": \"Primary Org\", \"isPrimary\": true}\n })\n .then(function(results){\n // console.log(results);\n $scope.data.thisContent.primaryCompany = results; \n $scope.data.prevPrimaryCompany = results; //set new current since link was changed \n //add this to entityLinks array of this opp\n $scope.data.thisContent.entityLinks.push(results); \n // console.log($scope.data.thisContent);\n \n if(updateGrid){ \n // //refresh grid\n gridManager.refreshView()\n // $rootScope.$broadcast('OPP_UPDATED', {\"id\": opp.id}); //reload opp with changes \n Logger.info('Content Updated');\n }; \n }); \n}", "function showAbsenceDetails_old() {\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == activeElement);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende']);\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: \" + formatDateDot(activeDataSet['adminMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\nanzeige += \"Meldung Lehrer am: \" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: \" + formatDateDot(activeDataSet['elternMeldungDatum']);\t\n}\nif (activeDataSet['kommentar'] != \"0\") {\nanzeige += \"Kommentar: \" + formatDateDot(activeDataSet['kommentar']);\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function showTournamentID(){\n console.log('Tournament name: ', tournamentID);\n }", "function laneToLanes(lane){return lane;}", "function laneToLanes(lane){return lane;}", "function openCase() {\n var ef = {};\n ef[\"entityName\"] = \"incident\";\n if (phone.currentCase) {\n ef[\"entityId\"] = phone.currentCase;\n }\n Microsoft.CIFramework.openForm(JSON.stringify(ef));\n}", "function showPerson(){\n const item = story[currentItem];\n text.textContent = item.text;\n heading.textContent = item.heading;\n}", "function showAirOpSources() {\n var op = editingOpIdx == -1 ? newOp : airOps[editingOpIdx],\n dlgHtml = getAirOpMissionRowHtml() +\n \"<tr><td colspan=\\\"2\\\" class=\\\"right\\\" style=\\\"font-weight: bold\\\">Available aircraft:</td><td colspan=\\\"6\\\"></td></tr>\";\n \n for (var i = 0; i < op.AirOpSources.length; i++) {\n dlgHtml += getAirOpSourceRowHtml(op.AirOpSources[i]);\n }\n $(\"#airopplanes\").html(dlgHtml);\n}", "function searchResultDisplayHtmlString(venue){\n\n \n let venue_name = venue.name?venue.name:\"\"\n let address = venue.location.formattedAddress?venue.location.formattedAddress:\"\"\n let descriptions = venue.categories?venue.categories:\"\"\n let location_description=[]\n for(let description of descriptions){\n\n location_description.push(description.name)\n\n }\n\n return `\n <style>\n .search-result p{\n\n font-family: var(--font-family-main);\n margin:10px;\n \n \n }\n \n .search-result p a{\n \n text-decoration:none;\n color:black;\n \n }\n\n .location-name-link{\n\n font-size:17px;\n\n }\n\n .address-link{\n\n font-size:15px;\n\n }\n\n .description-link{\n\n font-size:12px;\n\n }\n\n \n .line{\n \n background-image:linear-gradient(90deg,transparent, var(--primary-color),transparent);\n width:auto;\n height:2px;\n \n }\n \n </style>\n <div class=\"search-result\" onClick=\"stopCallingApi()\">\n <p>\n <a class=\"location-name-link\" href=\"#\">${venue_name}</a> \n </p>\n <p>\n <a class=\"address-link\" href=\"#\">${address.join(\" \")}</a> \n </p>\n <p>\n <a class=\"description-link\" href=\"#\">${location_description.join(\" \")}</a> \n </p>\n\n <div class=\"line\"></div>\n </div>`\n}", "async function getLeagueDetails() {\n const league = await axios.get(\n `https://soccer.sportmonks.com/api/v2.0/leagues/${LEAGUE_ID}`,\n {\n params: {\n include: \"season\",\n api_token: process.env.api_token,\n },\n }\n );\n if (league.data.data.current_stage_id == null) {\n return {\n leagueName: league.data.data.name,\n seasonName: league.data.data.season.data.name,\n stageName: \"currently there is no stage available\",\n current_season_id: league.data.data.current_season_id,\n };\n }\n const stage = await axios.get(\n `https://soccer.sportmonks.com/api/v2.0/stages/${league.data.data.current_stage_id}`,\n {\n params: {\n api_token: process.env.api_token,\n },\n }\n );\n return {\n leagueName: league.data.data.name,\n seasonName: league.data.data.season.data.name,\n stageName: stage.data.data.name,\n current_season_id: league.data.data.current_season_id,\n };\n}", "function openingHoursToString(available_destination_id, date){\t\t\n var available_event = available_destinations[available_destination_id];\n var available_opening_hours = available_event.opening_hours;\n var returnString = \"\";\n\n for (var i in available_opening_hours){\n var available_start = available_opening_hours[i].start;\n var available_end = available_opening_hours[i].end;\n\n if (calendar_helper_dateEquals(available_start, date)){\n if (returnString != \"\") returnString += \" & \"; \t\t\n returnString += available_start.formatDate('g:i a') + \" to \";\n returnString += available_end.formatDate('g:i a');\n }\n }\n\n if (returnString == \"\")\n returnString = available_event.title + \" is not available on this day\"\n else\n returnString = available_event.title + \" is available from \" + returnString;\n return returnString;\n}", "function whereToGO() {\n\n\t\t\t\tif (activity == 0 && budget == 0) {\n\t\t\t\t\tadventure = \"bowling_alley\";\n\t\t\t\t} else if (activity == 0 && budget >= 1) {\n\t\t\t\t\tadventure = \"restaurant\";\n\t\t\t\t}\n\t\t\t\telse if (activity == 1 && budget == 0) {\n\t\t\t\t\tadventure = \"shopping_mall\";\n\t\t\t\t} else if (activity == 1 && budget >= 1) {\n\t\t\t\t\tadventure = \"amusement_park\";\n\t\t\t\t} else if (activity == 2 && budget == 0) {\n\t\t\t\t\tadventure = \"bar\";\n\t\t\t\t} else if (activity == 2 && budget >= 1) {\n\t\t\t\t\tadventure = \"spa\";\n\t\t\t\t}\n\t\t\t}", "@action\n onMentorShow(pod, person) {\n this.isLead = person.is_lead;\n this.podIndex = pod.id;\n this.podOptions = this.pods.map((pod) => [`Pod ${pod.sort_index}`, pod.id]);\n }", "function convertFinalExperience() {\n var _data = data.experience._data,\n exp = copy(data.experience);\n\n switch (self.brandingSource) {\n case 'none':\n delete exp.data.branding;\n break;\n case 'publisher':\n exp.data.branding = _data.branding.publisher;\n break;\n case 'custom':\n exp.data.branding = _data.branding.custom;\n break;\n }\n\n exp.data.title = data.experience.title;\n exp.data.mode = _data.config.minireelinator.minireelDefaults.mode;\n exp.data.autoplay = _data.config.minireelinator.minireelDefaults.autoplay;\n exp.data.splash.ratio = _data.config.minireelinator.minireelDefaults.splash.ratio;\n exp.data.splash.theme = _data.config.minireelinator.minireelDefaults.splash.theme;\n exp.data.collateral.splash = null;\n exp.user = _data.user.id;\n exp.org = _data.org;\n\n delete exp.id;\n delete exp.created;\n delete exp.title;\n delete exp.lastUpdated;\n delete exp.versionId;\n delete exp.data.adConfig;\n delete exp._data;\n\n return exp;\n }", "function CreateOtherData(ppl_object)\n{\n//name and title\n\tvar string=\"\";\n\tfor ( key in ppl_object)\n\t{\n\t\tstring+=\"<br> <b>\"+ ppl_object[key][\"title\"] + \": </b>\" +ppl_object[ key][\"name\"];\n\t}\n\treturn string;\n}", "async forward(stage,poName){\n if(stage==='FM'){\n await this.forwardMove();\n await t \n .click(this.stageDD)\n .click(this.stageFM);\n await this.selectAllMove(true);\n }\n else if(stage==='Ordering'){\n await this.forwardMove();\n await this.selectAllMove(true);\n }\n else if(stage === 'PO'){\n await this.forwardMove();\n await t \n .click(this.PoName)\n .typeText(this.PoName, poName)\n await this.selectAllMove(true);\n }\n else if(stage === 'Detailing'){\n await this.forwardMove();\n await t \n .click(this.poToDetailingDateSelect)\n .click(this.poToDetailingDate)\n .click(this.poToDetailingLocSelect)\n .click(this.poToDetailingLoc)\n await this.selectAllMove(false);\n }\n else if(stage === 'Manufacturing'){\n await this.forwardMove();\n await t \n .click(this.DetailingToManufDateSelect)\n .click(this.DetailingToManufDate)\n await this.selectAllMove(true);\n }\n else if(stage ==='QA'){\n await this.forwardMove(); \n await t\n .click(this.DetailingToManufDateSelect)\n .click(this.manufToQaDate)\n await this.selectAllMove(true);\n \n }\n }", "function formatVolunteers(log){\n\tlet keys = Object.keys(log);\n\tlet final = [];\n\tfor(let k of keys){\n\t\tlet ogKey = k;\n\t\tif(k.match(/volunteer/)){\n\t\t\tlet index = parseInt(k[k.length-1]);\n\t\t\tif(Number.isNaN(index))\n\t\t\t\tcontinue;\n\t\t\tk = k.split(index\n\t\t\t\t+'');\n\t\t\tconsole.log(index);\n\t\t\tif(!final[index])\n\t\t\t\tfinal[index] = {};\n\t\t\tfinal[index][k] = log[ogKey];\n\t\t}\n\t}\n\tconsole.log(final);\n\tfinal.forEach((value,index)=>{\n\n\n\n\t\tvalue.name=\t\t value[\"volunteerName,\"];\n\t\tvalue.hours=\t value[\"volunteerHours,\"];\n\t\tvalue.activity = value[\"volunteerActivity,\"];\n\n\t});\n\tlog.volunteers = final;\n\treturn log;\n}", "function getLeagueAndOutput(id){\n clearData(); \n const leagueObject =findLeagueInfo(jsonObj); \n document.getElementById(\"leagueDetails\").innerHTML =` \n <tr>\n <td>${leagueObject.id}</td>\n <td>${leagueObject.player}</td>\n <td>${leagueObject.teamName}</td>\n </tr>\n `; \n\n document.getElementById(\"leagueIDInput\").placeholder = \"Enter the League Id\";\n}", "function Investigate() {\n\tsecretDC = 10;\n\tswitch(gridArr[OPC.currentPos].sDoor) {\n\t\tcase 1:\n\t\t\tgridArr[OPC.currentPos].sDoor = 2;\n\t\t\troll = Dice(20);\n\t\t\trollBonus = Math.floor(OPC.abilityScores[4]/2)-5; // add Wisdom modifier\n\t\t\tfor(i = 0; i < OPC.skills.length; i++) { // look at all skills\n\t\t\t\tif(OPC.skills[i] == \"perception\") { //check to see if perception is a skill\n\t\t\t\t\trollBonus += OPC.proficiencyBonus; // add proficiency bonus\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfeedback = \"Wisdom (Perception): \" + roll + \" + \" + rollBonus + \" = \" + (roll + rollBonus) + \"<br>\";\n\t\t\tif(roll + rollBonus >= secretDC) { // make an wisdom perception check to see if you notice the secret door\n\t\t\t\tfeedback += \"This looks like it could be something...\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfeedback += \"*shrug*\";\n\t\t\t\tOPC.encounter = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById(\"opc-feedback\").innerHTML=feedback;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\troll = Dice(20);\n\t\t\trollBonus = Math.floor(OPC.abilityScores[3]/2)-5; // add Intelligence modifier\n\t\t\tfor(i = 0; i < OPC.skills.length; i++) { // look at all skills\n\t\t\t\tif(OPC.skills[i] == \"Investigation\") { //check to see if investigation is a skill\n\t\t\t\t\trollBonus += OPC.proficiencyBonus; // add proficiency bonus\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfeedback = \"Intelligence (investigation): \" + roll + \" + \" + rollBonus + \" = \" + (roll + rollBonus) + \"<br>\";\n\t\t\tif(roll + rollBonus >= secretDC) { // make an intelligence investigation check to see if you open the secret door\n\t\t\t\tfeedback += \"This should do it...\";\n\t\t\t\tgridArr[OPC.currentPos].sDoor = 3;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfeedback += \"... I have no idea.\";\n\t\t\t}\n\t\t\tOPC.encounter = \"\";\n\t\t\tdocument.getElementById(\"opc-feedback\").innerHTML=feedback;\n\t\t\tbreak;\n\t}\n}", "function activitiesToSimpleWorks(activitiesObject){\n\t\tvar order = 0;\n\t\tvar worksList = activitiesObject.obj.works.group.map(function(obj){ \n\t\t var rObj = {originalOrder:\"\"+order};\n\t\t order++;\n\t\t rObj.title = obj[\"work-summary\"][0].title.title.value;\n\t\t if (obj.identifiers){\n\t\t\t rObj.ID = obj.identifiers.identifier[0][\"external-identifier-id\"];\n\t\t\t rObj.identifierType = obj.identifiers.identifier[0][\"external-identifier-type\"];\n\t\t }\n\t\t var prefix = \"\";\n\t\t if (rObj.identifierType == \"doi\" && rObj.ID && rObj.ID.indexOf('http') != 0){\n\t\t\t\tprefix = \"http://doi.org/\";\n\t\t\t} else if (rObj.identifierType == \"isbn\"){\n\t\t\t\tprefix = \"http://www.worldcat.org/isbn/\";\n\t\t\t} else if (rObj.identifierType == \"arxiv\"){\n\t\t\t\tprefix = \"http://arxiv.org/abs/\";\n\t\t\t} else if (rObj.identifierType == \"asin\"){\n\t\t\t\tprefix = \"http://www.amazon.com/dp/\";\n\t\t\t} else if (rObj.identifierType == \"ethos\"){\n\t\t\t\tprefix = \"http://ethos.bl.uk/OrderDetails.do?uin=\";\n\t\t\t} else if (rObj.identifierType == \"jstor\"){\n\t\t\t\tprefix = \"http://www.jstor.org/stable/\";\n\t\t\t} else if (rObj.identifierType == \"lccn\"){\n\t\t\t\tprefix = \"http://lccn.loc.gov/\";\n\t\t\t} else if (rObj.identifierType == \"mr\"){\n\t\t\t\tprefix = \"http://www.ams.org/mathscinet-getitem?mr=\";\n\t\t\t} else if (rObj.identifierType == \"oclc\"){\n\t\t\t\tprefix = \"http://www.worldcat.org/oclc/\";\n\t\t\t} else if (rObj.identifierType == \"ol\"){\n\t\t\t\tprefix = \"http://openlibrary.org/b/\";\n\t\t\t} else if (rObj.identifierType == \"ol\"){\n\t\t\t\tprefix = \"http://www.osti.gov/energycitations/product.biblio.jsp?osti_id=\";\n\t\t\t} else if (rObj.identifierType == \"pmc\"){\n\t\t\t\tprefix = \"http://www.ncbi.nlm.nih.gov/pubmed/\";\n\t\t\t} else if (rObj.identifierType == \"pmid\"){\n\t\t\t\tprefix = \"http://europepmc.org/abstract/med/\";\n\t\t\t} else if (rObj.identifierType == \"ssrn\"){\n\t\t\t\tprefix = \"http://papers.ssrn.com/abstract_id=\";\n\t\t\t}\n\t\t\tif ( prefix != \"\" || rObj.identifierType == \"handle\" || rObj.identifierType == \"uri\" || rObj.identifierType == \"doi\"){\n\t\t\t\trObj.URL = prefix + rObj.ID;\n\t\t\t}\n\t\t\tif (rObj.identifierType == \"doi\"){\n\t\t\t\trObj.citeprocURL = rObj.URL;\t\t\t\t\n\t\t\t}else{\n\t\t\t\trObj.citeprocURL = pubAPI+obj[\"work-summary\"][0].path;\t\t\t\t\n\t\t\t}\n\t\t return rObj;\n\t\t});\n\t\treturn worksList;\n\t}", "function formatAdjustments() {\n const { deductions, credits } = $scope.data;\n\n deductions.state.income = deductions.federal.ordinaryIncome;\n credits.state.income = credits.federal.ordinaryIncome;\n }", "render() {\n const { isOpen, intl: { formatMessage }, pendings } = this.props\n const {\n rejectPopover: {\n clientRect, campaignLeadId\n },\n influencerInfoPopover: {\n clientRect: influencerClientRect, lead\n }\n } = this.state\n\n const newData = [[\n 'Campaign Lead ID', 'Date', 'Campaign Name', 'Influencer Name',\n 'Influencer Email', 'Lead', 'Mail', 'Phone', 'Pending', 'Status'\n ]]\n\n if (this.props.pendings.leads) {\n this.props.pendings.leads.forEach((item) => {\n const {\n campaign_lead_id, date, campaign_name, influencer_name,\n influencer_email, lead_name, lead_email, lead_contact_number,\n verification_status\n } = item\n newData.push([\n campaign_lead_id, date, campaign_name, influencer_name,\n influencer_email, lead_name, lead_email, lead_contact_number,\n formatMessage(\n { id: 'pendings.hours', defaultMessage: '!{hours} H' },\n { hours: moment().diff(moment(date), 'hours') }\n ),\n verification_status\n ])\n })\n }\n\n return (\n <Modal\n className=\"modal-trans pending-modal\"\n isOpen={isOpen}\n onRequestClose={this.onClose}\n closeTimeoutMS={100}\n shouldCloseOnOverlayClick={false}\n >\n <div ref={this.refContainer} className=\"modal-container large\">\n <div className=\"modal-content\">\n <div className=\"modal-header\">\n <div className=\"d-lg-none\"><IconButton icon=\"close\" onClick={this.onClose} /></div>\n <div className=\"title\">\n <FormattedMessage id=\"pendings.new_pending_leads\" defaultMessage=\"!New Pending Leads\" />\n </div>\n <div className=\"d-none d-lg-block\"><IconButton icon=\"close\" onClick={this.onClose} /></div>\n </div>\n <div className=\"modal-body\">\n <div className=\"clearfix\">\n <div className=\"label float-lg-left d-none d-lg-block\">\n <FormattedMessage id=\"pendings.pending_conversions\" defaultMessage=\"!Pending Conversions\" />\n </div>\n <div className=\"label float-left float-lg-right\">\n <FormattedMessage\n id=\"pendings.dates\"\n defaultMessage=\"!Dates {dates}\"\n values={{ dates: 'Aug 11 - Aug 16, 2017' }}\n />\n </div>\n <div className=\"float-right d-block d-lg-none\">\n <Button bsSize=\"middle\" onClick={this.approveAll} style={{ textTransform: 'uppercase' }}>\n <FormattedMessage id=\"pendings.approve_all\" defaultMessage=\"!Approve all\" />\n </Button>\n </div>\n </div>\n <div className=\"d-none d-lg-block\">\n <Grid\n striped\n columns={this.pendingDataColumns()}\n data={this.props.pendings.leads}\n />\n </div>\n <div className=\"d-lg-none\" style={{ maxHeight: 'calc(100vh - 170px)', overflow: 'auto' }}>\n <ListView\n striped\n data={this.props.pendings.leads || []}\n itemEl={this.renderMobileItem}\n />\n </div>\n </div>\n <div className=\"modal-footer\">\n <div className=\"d-none d-lg-block\">\n <div className=\"d-flex\">\n <Button onClick={() => exportToCSV('qw.csv', newData)} type=\"select\">\n <i className=\"fa fa-download\" />&nbsp;\n <FormattedMessage id=\"pendings.export\" defaultMessage=\"!Export\" />\n </Button>&nbsp;\n <Button\n onClick={this.saveData}\n disabled={!this.state.changedData}\n style={{ textTransform: 'uppercase' }}\n >\n <FormattedMessage id=\"pendings.done\" defaultMessage=\"!done\" />\n </Button>&nbsp;\n <Button onClick={this.approveAll} style={{ textTransform: 'uppercase' }}>\n <FormattedMessage id=\"pendings.approve_all\" defaultMessage=\"!Approve all\" />\n </Button>\n </div>\n </div>\n <div className=\"d-lg-none\">\n <Button\n bsSize=\"middle\"\n onClick={this.saveData}\n disabled={!this.state.changedData}\n style={{ textTransform: 'uppercase' }}\n >\n <FormattedMessage id=\"pendings.done\" defaultMessage=\"!done\" />\n </Button>\n </div>\n </div>\n <RejectPopover\n clientRect={clientRect}\n campaignLeadId={campaignLeadId}\n doneReject={this.doneReject}\n closeRejectPopover={this.closeRejectPopover}\n />\n <InfluencerInfoPopover\n clientRect={influencerClientRect}\n lead={lead}\n pendings={pendings}\n closeInfluencerInfoPopover={this.closeInfluencerInfoPopover}\n />\n {this.state.submitting && <Spinner />}\n </div>\n </div>\n </Modal>\n )\n }", "async detectSpreadOpportunity(pair) {\n \n let ticker;\n\n try {\n ticker = await this.bittrexExchangeService.getTicker(pair);\n } catch (ex) {\n return null;\n }\n \n const spread = ticker.Ask - ticker.Bid;\n const spreadPercentage = (spread / ticker.Ask) * 100;\n const midSpread = spread / 2;\n \n const grossProfitPercentage = spreadPercentage;\n const minProfitPercentage = ( (midSpread - midSpread) / midSpread ) * 100;\n const netProfitPercentage = grossProfitPercentage - CONFIG.BITTREX_SPREAD_EATER_PERCENTAGE_FEE;\n\n const qtyToBuy = CONFIG.MIN_QTY_TO_TRADE[pair];\n\n if (netProfitPercentage >= CONFIG.MIN_NET_PROFIT_PERCENTAGE) {\n \n const opportunity = {\n timestamp: Date.now(), \n pair: pair,\n spread: spread,\n midSpread: midSpread,\n spreadPercentage: spreadPercentage, \n bid: ticker.Bid,\n ask: ticker.Ask,\n qtyToBuy: qtyToBuy,\n grossProfitPercentage: grossProfitPercentage,\n netProfitPercentage: netProfitPercentage,\n }\n\n if (CONFIG.IS_DETECTOR_LOG_ACTIVE)\n console.log(\n `---------- [${opportunity.pair}] Spread=${opportunity.spreadPercentage.toFixed(4)}% (WORKER#${WORKER_ID}) --------- \\n`+\n `Bid=${ticker.Bid.toFixed(10)}, MidSpread=${opportunity.midSpread.toFixed(10)} Ask=${ticker.Ask.toFixed(10)} \\n`+\n ` Profit=${opportunity.netProfitPercentage.toFixed(4)}% \\n`); \n\n return opportunity;\n }\n\n return null;\n }", "function showOneOffer(app, offer, sentence, fromList = false) {\n var body = offer.Description.slice(0, 250).replace(\"\\n\", \" \") + \"...\"\n\n let parameters = {};\n parameters[CONTEXT_PARAMETER_OfferPresented] = offer;\n app.setContext(CONTEXT_OfferDetail, 2, parameters)\n\n if (fromList) {\n let parameters = {};\n parameters[CONTEXT_PARAMETER_OffersPresented] = app.getContextArgument(CONTEXT_ListOffers, CONTEXT_PARAMETER_OffersPresented).value;\n app.setContext(CONTEXT_ListOffers, 5, parameters)\n }\n\n app.ask(app.buildRichResponse()\n .addSuggestions(fromList ? [REQUEST_PREVIOUS_OFFER[lang], REQUEST_NEXT_OFFER[lang]] : [])\n .addSimpleResponse(sentence)\n .addBasicCard(\n app.buildBasicCard(body)\n .setTitle(offer.Poste)\n .setSubtitle(offer.Contrat + \", \" + offer.Ville)\n .addButton(REQUEST_SEE_ONLINE[lang], offer.url)\n .setImage(\"https://raw.githubusercontent.com/so-technology-watch/assistant-rh-sogeti/master/images/banner.jpg\", \"Sogeti_Logo\")\n )\n );\n}", "function renderOppName(params) {\n // console.log(params)\n // console.log(params.data); \n if (!params.value) {\n return '<a style=\"font-weight:600\" href=\"/opportunities/'+params.data.id+'\">[No Name]</a>';\n } \n else if (params.value == null) {\n return '<a style=\"font-weight:600\" href=\"/opportunities/'+params.data.id+'\">[No Name]</a>';\n }\n else { \n return '<a style=\"font-weight:600\" href=\"/opportunities/'+params.data.id+'\">' +params.data.name+'</a>';\n }\n }", "function diplayWholeDescription() {\n console.log(\"change description\")\n $(\".js-truncate\").on(\"click\", function(e) {\n e.preventDefault();\n let positionId = this.dataset.id;\n let companyId = this.dataset.companyid;\n fetch(\"/companies/\" + companyId + \"/positions/\" + positionId + \".json\")\n .then(resp => resp.json())\n .then(jsonData => {\n let link = document.getElementsByClassName(`link-${positionId}`)[0];\n link.innerText = new Position(jsonData).description;\n })\n })\n}", "function teaObjtoHTML(obj) {\n var availability = availFunction(obj.available);\n\n var teaInfo = '<li class=\"list-group-item ' + obj.category + '\">';\n teaInfo += '<div class=\"col-md-6\">name: ' + obj.name + '; id#: ' + obj.id + '<br> ';\n teaInfo += 'Category: ' + obj.category + ' <br> ';\n teaInfo += 'price per cup: ' + obj.priceCup + ' <br> ';\n teaInfo += 'price per pot: ' + obj.pricePot + ' <br> ';\n teaInfo += 'price per oz: ' + obj.priceOz + ' <br> ';\n teaInfo += 'description: ' + obj.description + ' <br> ';\n teaInfo += 'tea types: ' + obj.teaTypes + '<br>';\n teaInfo += 'availability: ' + availability + ' <br> ';\n teaInfo += '<img class=\"col-md-12 \" src=\"https://static1.squarespace.com/static/5254245de4b0d49865bf2ad0/551db655e4b0c1bae096e600/551db6e9e4b0a007421e8164/1428010733370/golden+assam.jpg?format=500w\">';\n teaInfo = appendDeleteButton(teaInfo, obj); // see below\n teaInfo += '</li>';\n\n return teaInfo;\n\n }", "function renderPlayerGoal(item) {\n if(item.type_of_event === 'goal'){\n return `<p>${item.player} at \"${item.time}\"</p>\n <img src='http://clipart-library.com/images/pT58x9r7c.png' class='soccer-ball' alt='image of a soccer ball'>`\n }\n if(item.type_of_event === 'goal-penalty'){\n return `<p>${item.player} at \"${item.time}\"</p> \n <img src='https://thumbs.dreamstime.com/b/den-blonda-tecknad-filmm%C3%A5lvakten-med-flailing-bev%C3%A4pnar-v%C3%A4ntande-p%C3%A5-straff-95129888.jpg' class='penalty-kick' alt='image of a penalty kick'>`\n }\n if(item.type_of_event === 'goal-own')\n {\n return `<p>${item.player} at \"${item.time}\"</p>\n <img src='https://www.toonpool.com/user/6485/files/worst_soccer_player_ever_1071775.jpg' class='soccer-ball-bad' alt='image of a person kicking himself in the head'>`\n }\n}", "function convertLinkOut(obj) {\n try {\n while (theobj = obj.find(x => x.type === \"link out\").type = \"helper\") {\n theobj.type = \"helper\";\n }\n } catch (e) {\n }\n return obj;\n}", "function printTicket(source,destination){\n console.log(travellingMode);\n console.log(source);\n console.log(destination);\n }", "function handleJoin( result, idCounter, item, parentId ) {\n\n // activity data\n var actId = '_:join' + idCounter['activity']++,\n actStartTime = (new Date( item.getData( 'startTime' ) )).toISOString(),\n actEndTime = (new Date( item.getData( 'endTime' ) )).toISOString();\n\n // activity entry\n result['activity'][ actId ] = {\n 'prov:startTime': actStartTime,\n 'prov:endTime': actEndTime,\n 'prov:type': convertType( item.getData( 'type' ) ),\n 'yavaa:params': JSON.stringify( item.getData('params') ),\n 'yavaa:action': item.getData( 'action' ),\n 'yavaa:columns': JSON.stringify( item.getData( 'columns' ) ),\n 'yavaa:prevActivity': []\n };\n\n // resulting (intermediate?) entity\n var newEntId = '_:result' + idCounter['entity']++;\n result['entity'][ newEntId ] = {\n 'prov:type': { '$': 'prov:Collection', 'type': 'xsd:QName' },\n };\n\n // link to resulting entity\n result['wasGeneratedBy'][ '_:wasGeneratedBy' + idCounter['relation']++ ] = {\n 'prov:entity': newEntId,\n 'prov:activity': actId\n };\n\n // add links\n linkToParent( result, idCounter, newEntId, actId, parentId );\n linkToProv( item, actId, newEntId );\n\n return actId;\n }", "function populateCWBEditPlacementModal(placement) {\n \n if (placement.AssistanceType !== undefined && placement.AssistanceType !== null) {\n document.getElementById(\"btnAssistanceType\").innerHTML = placement.AssistanceType.Name;\n document.getElementById(\"btnAssistanceType\").value = placement.AssistanceTypeID;\n }\n\n if (placement.CareerPathway !== undefined && placement.CareerPathway !== null) {\n document.getElementById(\"btnCareerPathwayPosition\").innerHTML = placement.CareerPathway.Name;\n document.getElementById(\"btnCareerPathwayPosition\").value = placement.CareerPathwayID;\n }\n\n let convertedEnrollmentDate = placement.CourtOrderDate !== null ? moment(new Date(placement.CourtOrderDate)).format('YYYY-MM-DD') : \"\";\n $(\"#txtEnrollmentDate\").val(convertedEnrollmentDate);\n $(\"#txtEnrollmentComments\").val(placement.CourtOrderNarrative);\n \n if (placement.EmployerBenefits !== null) {\n document.getElementById(\"btnEnrollmentBenefits\").innerHTML = placement.EmployerBenefits;\n document.getElementById(\"btnEnrollmentBenefits\").value = placement.EmployerBenefits;\n }\n\n if (placement.EmployerFullPartTime !== null) {\n document.getElementById(\"btnFullTimePartTime\").innerText = placement.EmployerFullPartTime;\n document.getElementById(\"btnFullTimePartTime\").value = placement.EmployerFullPartTime;\n }\n\n $(\"#txtEnrollmentEmployerName\").val(placement.EmployerName);\n $(\"#txtEnrollmentPosition\").val(placement.EmployerPosition);\n\n let convertedEmployerStartDate = placement.EmployerStartDate !== null ? moment(new Date(placement.EmployerStartDate)).format('YYYY-MM-DD') : \"\";\n $(\"#txtEnrollmentStartDate\").val(convertedEmployerStartDate);\n\n $(\"#txtEnrollmentWagesPerHour\").val(placement.EmployerWages);\n\n //View/TANF\n if (placement.Judge !== undefined && placement.Judge !== null) {\n document.getElementById(\"btnViewTanf\").innerText = placement.Judge.Name;\n document.getElementById(\"btnViewTanf\").value = placement.JudgeID;\n }\n\n let convertedNextCourtDate = placement.NextCourtDate !== null ? moment(new Date(placement.NextCourtDate)).format('YYYY-MM-DD') : \"\";\n $(\"#txtApptDate\").val(convertedNextCourtDate);\n\n if (placement.PlacementLevel !== undefined && placement.PlacementLevel !== null) {\n document.getElementById(\"btnSnapEt\").innerText = placement.PlacementLevel.Name;\n document.getElementById(\"btnSnapEt\").value = placement.PlacementLevelID;\n }\n\n $(\"#hdnPlacementID\").val(placement.ID);\n $(\"#hdnPlacementCreatedDate\").val(placement.CreatedDate);\n $(\"#hdnPlacementCreatedBy\").val(placement.CreatedBy);\n $(\"#hdnPlacementUpdatedDate\").val(placement.UpdatedDate);\n $(\"#hdnPlacementUpdatedBy\").val(placement.UpdatedBy);\n\n\n toggleEnrollmentModal();\n}", "function Journey(str_begin_line, begin_stp, str_desti_line, desti_stp) {\n //str_begin_line ----> begin_line &&\n //str_desti_line ----> desti_line_\n this.stp_nochangeline = stp_nochangeline(interatelines(str_begin_line), begin_stp, desti_stp)\n this.stp_before_inter = stp_before_inter(interatelines(str_begin_line), begin_stp, interatelines(str_desti_line));\n this.doesinter = doesinter(str_begin_line, str_desti_line);\n this.stp_after_inter = stp_after_inter(interatelines(str_begin_line), desti_stp, interatelines(str_desti_line));\n this.total = function( ) { return this.stp_before_inter.length+this.stp_after_inter.length };\n}", "function displayStory(arr) {\r\n\tget(\"continue-box\").style.display = \"none\";\r\n\tget(\"content-options\").style.display = \"none\";\r\n\tget(\"choice1Btn\").style.display = \"none\";\r\n\tget(\"choice2Btn\").style.display = \"none\";\r\n\tget(\"choice3Btn\").style.display = \"none\";\r\n\tget(\"loc-content\").style.display = \"none\";\r\n\tget(\"content-one\").innerHTML = arr.text;\r\n\tif(arr.contFlag == 1) { //if cont flag is true on object, display continue box on page.\r\n\t\tpopContBtn();\r\n\t}\r\n\telse if(arr.optFlag == 1) {\r\n\t\tpopChoiceBtn(arr.optNum); //number of choices is passed\r\n\t}\r\n}", "function displayTrainer(trainer) {\n // *** DELETE\n console.log(trainer);\n\n // div card\n const card = document.createElement(\"div\");\n card.classList.add(\"card\")\n card.setAttribute(\"data-id\", trainer.id)\n\n // p trainer name\n const cardHeader = document.createElement(\"p\")\n const trainerName = document.createTextNode(trainer.name)\n cardHeader.appendChild(trainerName)\n card.appendChild(cardHeader)\n\n // btn add pokemon\n const addBtn = document.createElement(\"button\")\n const addBtnText = document.createTextNode(\"Add Pokemon\")\n addBtn.setAttribute(\"data-trainer-id\", trainer.id)\n addBtn.appendChild(addBtnText)\n card.appendChild(addBtn)\n\n // list pokemon\n const pokemonList = document.createElement(\"ul\")\n trainer.pokemons.forEach(pokemon => addPokemonToList(pokemon, pokemonList));\n card.appendChild(pokemonList)\n\n // append card to page\n const main = document.querySelector(\"main\")\n main.appendChild(card)\n\n // add listener to add button\n addBtn.addEventListener(\"click\", (e) => {\n const trainerId = e.target.getAttribute(\"data-trainer-id\")\n addPokemonToTeam(trainerId)\n })\n}", "function myAgency(agen) {\n switch (agen) {\n case 0:\n return 'BLM';\n break;\n case 1:\n return 'NPS';\n break;\n case 2:\n return 'FS';\n break;\n case 3:\n return 'FWS';\n break;\n default:\n return 'null';\n break;\n }\n}", "function MakeEditFromCase(caseObject) {\n\tuseAltColor1 = false;\n\n\tappendHTML(caseObject.caseData, 'Case Overview', caseObject.caseID);\n\tappendHTML(caseObject.clientData, 'Client', caseObject.caseID);\n\tappendHTML(caseObject.loData, 'Loved Ones', caseObject.caseID);\n\tappendHTML(caseObject.recordData, 'Recordings', caseObject.caseID);\n\tappendHTML(caseObject.volunteerData, 'Volunteers', caseObject.caseID);\n\tappendHTML(caseObject.noteData, 'Notes', caseObject.caseID);\n}", "function createLine({ ticket, destination, patientName, complement }) {\n\n const line = document.createElement('li')\n line.id = ticket\n line.classList.add('ticket')\n\n const ticketLabel = document.createElement('span')\n ticketLabel.className = 'boxed-text label'\n ticketLabel.innerHTML = 'Senha'\n\n const ticketData = document.createElement('span')\n ticketData.className = 'ticket-data'\n ticketData.innerHTML = ticket\n\n const destinationLabel = document.createElement('span')\n destinationLabel.className = 'boxed-text label'\n destinationLabel.innerHTML = 'Local'\n\n const destinationWrapper = document.createElement('span')\n destinationWrapper.className = 'ticket-data'\n destinationWrapper.id = `destination-wrapper-${ticket}`\n\n const destinationData = document.createElement('span')\n destinationData.innerHTML = destination\n destinationData.id = `destination-data-${ticket}`\n\n destinationWrapper.appendChild(destinationData)\n\n const patientNameLabel = document.createElement('span')\n patientNameLabel.className = 'boxed-text label'\n patientNameLabel.innerHTML = 'Nome'\n\n const patientWrapper = document.createElement('span')\n patientWrapper.className = 'ticket-data'\n patientWrapper.id = `patient-name-wrapper-${ticket}`\n\n const patientNameData = document.createElement('span')\n patientNameData.innerHTML = patientName\n patientNameData.id = `patient-name-data-${ticket}`\n\n patientWrapper.appendChild(patientNameData)\n\n // line.appendChild(ticketLabel)\n line.appendChild(ticketData)\n // line.appendChild(destinationLabel)\n line.appendChild(destinationWrapper)\n // line.appendChild(patientNameLabel)\n line.appendChild(patientWrapper)\n\n setTimeout(() => {\n line.classList.add('show')\n const wrapperWidth = destinationWrapper.offsetWidth\n const destinationWidth = destinationData.offsetWidth\n if (wrapperWidth < destinationWidth) {\n destinationData.classList.add('scrolling-text')\n destinationData.style.animationDuration = `${destination.length*360}ms`\n }\n const patientWrapperWidth = patientWrapper.offsetWidth\n const patientNameWidth = patientNameData.offsetWidth\n if (patientWrapperWidth < patientNameWidth) {\n patientNameData.classList.add('scrolling-text')\n patientNameData.style.animationDuration = `${patientName.length*360}ms`\n }\n }, 10)\n\n return line\n}", "function displayItemDetails() {\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\n var meetingSuggestions = item.getEntitiesByType(Office.MailboxEnums.EntityType.MeetingSuggestion);\n var meetingSuggestion = meetingSuggestions[0];\n\n $('#start-time').text(meetingSuggestion.start);\n }", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function entityPartnerShowClick(event) {\n var entityDOM = event.currentTarget;\n var index = entityDOM.querySelector('.name input').dataset.index;\n var gender = entityDOM.parentNode == maleDOM ? 'male' : 'female';\n var entity = stableMarriageAlgorithm[gender][index]; // If the entity has a partner,\n\n if (entity.partner) {\n groundDOM.innerHTML = '';\n var partner = entity.partner;\n var groundEntityDOM = entityDOM.cloneNode(true);\n var groundPartnerDOM = partner.element.cloneNode(true);\n\n var entityIndex = partner._preferences.indexOf(entity.name);\n\n var partnerIndex = entity._preferences.indexOf(partner.name);\n\n groundEntityDOM.querySelector('.preference').children[partnerIndex].classList.add('marry-highlight');\n groundPartnerDOM.querySelector('.preference').children[entityIndex].classList.add('marry-highlight'); // show them both add ground container\n // with each other highlighted on one another's\n // preference list.\n\n groundDOM.appendChild(groundEntityDOM);\n groundDOM.appendChild(groundPartnerDOM);\n openAndSelectGroundDOM(groundEntityDOM);\n openAndSelectGroundDOM(groundPartnerDOM);\n } else {\n // Otherwise send a notifier message,\n notifier.queueMessage('warning', \"\".concat(entity.name, \" has no partner.\"));\n }\n}", "function process_rugby_experts(result, obj){\r\n /* initialise the base url */\r\n var el = $('<div></div>');\r\n el.html(result);\r\n var stories = [];\r\n /* Determine the workflow */\r\n switch (obj.flow) {\r\n case 1:\r\n /* process round_experts */\r\n process_round_experts(el, obj, stories);\r\n break;\r\n case 2:\r\n /* process round_experts */\r\n process_round_experts(el, obj, stories);\r\n break;\r\n }\r\n return (stories.length > 0) ? stories : null ;\r\n}", "function parse_incident(incident) {\n\tvar statusTime = moment(incident.last_status_change_on).format('dddd, MMMM Do YYYY, h:mm:ss a');\n\n\tvar description;\n\tif(incident.trigger_summary_data.description == null) {\n\t\tdescription = 'NONE';\n\t} else {\n\t\tdescription = incident.trigger_summary_data.description;\n\t}\n\n\tvar engineer;\n\tif(incident.assigned_to_user == null) {\n\t\tengineer = 'NONE ASSIGNED';\n\t} else {\n\t\tengineer = incident.assigned_to_user.name;\n\t}\n\n\tvar status;\n\tif(incident.status == 'triggered') {\n\t\tstatus = 'Unacknowledged';\n\t} else if(incident.status == 'acknowledged') {\n\t\tstatus = 'Acknowledged';\n\t} else if(incident.status == 'resolved') {\n\t\tstatus = 'Resolved';\n\t}\n\n\tvar display = {\n\t\tincident_number : incident.incident_number,\n\t\tcreated_on : moment(incident.created_on).format('dddd, MMMM Do YYYY, h:mm:ss a'),\n\t\tdescription : description,\n\t\tassigned_to : engineer,\n\t\tstatus : status\n\t};\n\n\treturn display;\n}", "function seperateData(data){\n data.forEach(monsterObj => displayMonster(monsterObj))\n}", "async function linkEmailOpportunity(email, opportunity, objective){\n var relations = await searchExistsEmailOpportunity(email, opportunity);\n if(relations.length == 0){\n pool.query(`INSERT INTO ebdb.EmailFollowOpportunity(email, \n opportunity, objective) VALUES (?, ?, ?)\n `, [email, opportunity, objective], \n function(error, results, fields){\n if (error){\n throw error;\n }\n });\n }\n}", "function happyHolidayTo (holiday, name) {\n return \"Happy \" + holiday + \", \" + name + \"!\"\n}", "function getDataInODATAFormat(result, schemaCollection) {\n var functName = \"getDataInODATAFormat\";\n var field;\n try {\n var entityCollection = [];\n var viewInfo = Tribridge.ViewEditor.CustomViews[index];\n //Check if result is null\n if (result != null && result != 'undefined') {\n for (var i = 0; i < result.length; i++) {\n entityCollection[i] = {};\n //Check for attributes\n if (result[i].attributes != null && result[i].attributes != 'undefined') {\n\n // Add the value of statecode to the dummy IsActiveRecord column\n if (result[i].attributes[\"statecode\"] != null && result[i].attributes[\"statecode\"] != undefined && result[i].attributes[\"statecode\"] != 'undefined') {\n entityCollection[i][\"_IsActiveRecord\"] = result[i].attributes[\"statecode\"].value;\n }\n\n //Check if schemaCollection have atrribute\n for (var j = 0; j < schemaCollection.length; j++) {\n\n var attri = \"\";\n\n attri = schemaCollection[j].field;\n\n if (attri != null && attri != undefined && attri != \"undefined\") {\n if (result[i].attributes[attri.toLowerCase()] != undefined && attri != \"undefined\") {\n field = result[i].attributes[attri.toLowerCase()];\n }\n else {\n field = schemaCollection[j];\n }\n }\n\n if (field != 'undefined' && field != undefined) {\n //Check for type and then add it according to format\n if (field.type != 'undefined' && field.type != undefined) {\n switch (field.type.toLowerCase()) {\n\n case \"OptionSetValue\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Value: field.value, FormattedValue: field.formattedValue };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Value: null, FormattedValue: null };\n }\n break;\n case \"EntityReference\".toLowerCase():\n if (field.id != undefined && field.id != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Id: field.id, Name: field.name, LogicalName: field.logicalName };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Id: null, Name: null, LogicalName: null };\n }\n break;\n case \"EntityCollection\".toLowerCase():\n //Do nothing\n break;\n\n case \"Money\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Value: (field.value) };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Value: (0) };\n }\n break;\n case \"decimal\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = parseFloat(field.value).toFixed(2).toString();\n // entityCollection[i][schemaCollection[j].field] = parseFloat(field.value).toFixed(2);\n }\n else {\n entityCollection[i][schemaCollection[j].field] = parseFloat(0).toFixed(2).toString();\n }\n break;\n case \"int\".toLowerCase():\n case \"integer\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value.toString();\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n case \"double\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value.toString();\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n case \"datetime\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n var isFilterApplied = false;\n for (p = 0; p < viewInfo[\"Columns\"].length; p++) {\n if (viewInfo[\"Columns\"][p][\"Name\"] == schemaCollection[j].field) {\n isFilterApplied = viewInfo[\"Columns\"][p][\"Filterable\"];\n break;\n }\n }\n\n if (isFilterApplied) { // 0810\n // then bind HH:MM:SS = 0 else filtering wont work\n var arr = field.formattedValue.split(' ');\n var dd = new Date(arr[0]);\n\n entityCollection[i][schemaCollection[j].field] = new Date(dd.getFullYear(), dd.getMonth(), dd.getDate(), 0, 0, 0);\n }\n else {\n // then bind the actual time part of datetime\n var arr = field.formattedValue.split('T');\n if (arr.length > 1) {\n var time = arr[1].split(':');\n entityCollection[i][schemaCollection[j].field] = new Date(arr[0] + \", \" + time[0] + \":\" + time[1] + \":\" + \"00\");\n }\n else {\n entityCollection[i][schemaCollection[j].field] = new Date(arr[0]);\n }\n }\n }\n break;\n case \"image\".toLowerCase():\n entityCollection[i][schemaCollection[j].field] = { isValid: true, errorMsg: \"\", isNewRecord: false };\n break;\n default:\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value;\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n\n }\n }\n }\n }\n }\n }\n }\n\n // check if any unsaved new records are present\n if (Tribridge.ViewEditor.ErrorRecords != null && Tribridge.ViewEditor.ErrorRecords.length > 0) {\n // Add the unsaved new records to the entity collection\n for (var i = 0; i < Tribridge.ViewEditor.ErrorRecords.length; i++) {\n //Check for new records\n if (Tribridge.ViewEditor.ErrorRecords[i].isNewRecord) {\n //Check if schemaCollection have atrribute\n var obj = {};\n for (var j = 0; j < schemaCollection.length; j++) {\n var attri = \"\";\n attri = schemaCollection[j].field;\n if (Tribridge.ViewEditor.ErrorRecords[i].record[attri] != null && Tribridge.ViewEditor.ErrorRecords[i].record[attri] != undefined) {\n obj[attri] = Tribridge.ViewEditor.ErrorRecords[i].record[attri];\n }\n }\n // Also add the colSaveVal field to bind the err\n obj[\"colSaveVal\"] = { isValid: false, errorMsg: Tribridge.ViewEditor.ErrorRecords[i].error, isNewRecord: true };\n entityCollection.splice(0, 0, obj);\n }\n }\n }\n return entityCollection;\n } catch (e) {\n throwError(functName, e);\n }\n}", "function parseApproach(owner, name, displayName, type, tokens, robotoText) {\n\n var strategies = [];\n var descriptions = [];\n var index = 0;\n\n // If it's a comment, read a comment.\n while (tokens.peek().charAt(0) === \"#\") {\n descriptions.push(tokens.eat());\n tokens.eat(\"\\n\");\n }\n\n // Parse one or more strategies.\n while (tokens.nextIs(\"strategy\")) {\n strategies.push(parseStrategy(index, tokens));\n index++;\n }\n // Parse one or more strategies.\n\n if (tokens.hasNext()) console.error(\"I'm not smart enough to handle anything other than strategies, so I got stuck on '\" + tokens.tokens.slice(0, 5).join(\" \") + \"'\");\n\n return {\n owner: owner,\n name: name,\n description: descriptions,\n displayName: displayName,\n robotoText: robotoText,\n strategies: strategies\n };\n}" ]
[ "0.58595735", "0.50108016", "0.48255992", "0.4747155", "0.47273692", "0.47123143", "0.471151", "0.46539143", "0.46386236", "0.46251595", "0.45892575", "0.45809624", "0.45274416", "0.45132077", "0.4502267", "0.44973874", "0.44965854", "0.44862333", "0.4479352", "0.4475481", "0.4460737", "0.44576383", "0.44526488", "0.44427416", "0.44400507", "0.44324592", "0.44302848", "0.44187894", "0.44175446", "0.44173396", "0.44137612", "0.44067806", "0.4395818", "0.43947408", "0.43779245", "0.43683296", "0.43559074", "0.43344706", "0.43281126", "0.43219373", "0.43134743", "0.4310032", "0.43062094", "0.43053263", "0.43042868", "0.43015137", "0.4300394", "0.42901886", "0.42877746", "0.42863712", "0.4285865", "0.4277004", "0.42769986", "0.426742", "0.42663684", "0.42544994", "0.42544994", "0.4251352", "0.42407262", "0.42211813", "0.42183477", "0.42153996", "0.42149544", "0.42142373", "0.4212205", "0.42103043", "0.42102653", "0.42037585", "0.41962752", "0.4192211", "0.41902176", "0.41876397", "0.4185509", "0.41842282", "0.4182774", "0.41804132", "0.4179687", "0.4176734", "0.41746923", "0.41681066", "0.41588473", "0.41581208", "0.41565865", "0.41557962", "0.41553012", "0.41511828", "0.41478232", "0.41423634", "0.41414797", "0.4139671", "0.41358578", "0.41338098", "0.4130537", "0.4127244", "0.41249222", "0.4123834", "0.41169423", "0.4111899", "0.41113088", "0.41013873" ]
0.50619364
1
This retrieves all opportunities
function showOpps() { //Highlight the selected tile $('#LeadsTile').css("background-color", "#0072C6"); $('#OppsTile').css("background-color", "orange"); $('#SalesTile').css("background-color", "#0072C6"); $('#LostSalesTile').css("background-color", "#0072C6"); $('#ReportsTile').css("background-color", "#0072C6"); var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var hasOpps = false; hideAllPanels(); var oppList = document.getElementById("AllOpps"); list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { var oppTable = document.getElementById("OppList"); // Remove all nodes from the Opportunity <DIV> so we have a clean space to write to while (oppTable.hasChildNodes()) { oppTable.removeChild(oppTable.lastChild); } var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Opportunity") { // Create a DIV to display the organization name var opp = document.createElement("div"); var oppLabel = document.createTextNode(listItem.get_fieldValues()["Title"]); opp.appendChild(oppLabel); // Add an ID to the opportunity DIV opp.id = listItem.get_id(); // Add an class to the opportunity DIV opp.className = "item"; // Add an onclick event to show the opportunity details $(opp).click(function (sender) { showOppDetails(sender.target.id); }); //Add the opportunity div to the UI oppTable.appendChild(opp); hasOpps = true; } } if (!hasOpps) { var noOpps = document.createElement("div"); noOpps.appendChild(document.createTextNode("There are no opportunity. You can add a new Opportunity to an existing Lead.")); oppTable.appendChild(noOpps); } $('#AllOpps').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get opportunity. Error: " + args.get_message())); errArea.appendChild(divMessage); $('#OppList').fadeIn(500, null); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getOpportunity (req, res) {\n res.send(await service.getOpportunity(req.authUser, req.params.opportunityId))\n}", "async function getOpportunityPhases (req, res) {\n res.send(await service.getOpportunityPhases(req.authUser, req.params.opportunityId))\n}", "async function getOpportunityDetails (req, res) {\n res.send(await service.getOpportunityDetails(req.authUser, req.params.opportunityId))\n}", "async function getOpportunityMembers (req, res) {\n res.send(await service.getOpportunityMembers(req.authUser, req.params.opportunityId))\n}", "function loadOpportunitiesByDate(fromDate, toDate) {\r\n return ServeOpportunities.ServeDays.query({\r\n id: Session.exists('userId'),\r\n from: fromDate / 1000,\r\n to: toDate / 1000\r\n }).$promise;\r\n }", "function getOpportunitySource(req, res) {\n if (!validator.isValid(req.body.companyId)) {\n res.json({code: Constant.ERROR_CODE, message: Constant.REQUIRED_FILED_MISSING});\n } else {\n source.find({companyId: req.body.companyId, moduleType: req.body.moduleType, deleted: false})\n .collation({locale: \"en\"})\n .sort({sourceName: 1})\n .exec(function(err, laborRatelist) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: laborRatelist});\n }\n\n });\n }\n}", "function viewAllDepts() {\n connection.query(\"SELECT d.name AS Department FROM department d ORDER BY d.name;\", function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var deptObj = [res[i].Department];\n tableResults.push(deptObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS AT THIS TIME \\n ------------------------------------\"\n );\n console.table([\"Department\"], tableResults);\n actions();\n });\n}", "async actionGetAll() {\n const self = this;\n\n let payments;\n let error = null;\n try {\n let where = { householdId: self.param('hid') };\n\n if (self.param('start') && self.param('end')) {\n where['createdAt'] = {\n [Op.gte]: new Date(self.param('start')),\n [Op.lte]: new Date(self.param('end')),\n };\n } else if (self.param('start')) {\n where['createdAt'] = {\n [Op.gte]: new Date(self.param('start')),\n };\n } else if (self.param('end')) {\n where['createdAt'] = {\n [Op.lte]: new Date(self.param('end')),\n };\n }\n\n if (self.param('moneypoolId')) {\n if (self.param('moneypoolId') == 'null') {\n where['moneypoolId'] = { [Op.is]: null };\n } else {\n where['moneypoolId'] = self.param('moneypoolId');\n }\n }\n\n if (self.param('id')) {\n where['id'] = self.param('id');\n }\n\n let limit;\n if (self.param('limit')) {\n limit = Number(self.param('limit'));\n }\n\n payments = await self.db.Payment.findAll({\n include: self.db.Payment.extendInclude,\n where: where,\n order: [['createdAt', 'DESC']],\n limit: limit,\n });\n\n if (!payments) {\n // throw a standard 404 nothing found\n throw new ApiError('No payments found', 404);\n }\n } catch (err) {\n error = err;\n }\n\n if (error) {\n self.handleError(error);\n } else {\n self.render(\n {\n payments: payments,\n },\n {\n statusCode: 200,\n }\n );\n }\n }", "getEfforts () {\n return this.db.many(sql.getEfforts)\n }", "getOpportunities() {\n firestore.onceGetNonValidatedOpportunities().then(snapshot => {\n let res = {};\n snapshot.forEach(doc => {\n res[doc.id] = doc.data();\n });\n this.setState(() => ({ opportunities: res }));\n })\n .catch(err => {\n console.log('Error getting documents', err);\n });\n }", "function getProjectTechs (req, res) {\n // var techss = []\n PROJECTTECHS.findAll({\n where: {\n ProjectId: req.params.id\n }\n }).then(techs => {\n resolveTechs(techs, res)\n // res.send(techs)\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n}", "getAll () {\n View.out('----------- Teams -----------' + View.NEWLINE())\n View.out(this.getTeams())\n View.out(View.NEWLINE() + '----------- Games -----------' + View.NEWLINE())\n View.out(this.getGames())\n View.out(View.NEWLINE() + '----------- Canterbury Geams -----------' + View.NEWLINE())\n View.out(this.getCanterburyGames('Canterbury') + View.NEWLINE())\n View.out('----------- Crossover Games -----------' + View.NEWLINE())\n View.out(this.getCrossOverGames())\n }", "function getAllTechs (req, res) {\n TECH.findAll({\n where: {\n ProfileId: 1\n }\n }).then(techs => {\n res.send({\n techs: techs\n })\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n}", "list(req, res) {\n return Student\n .findAll({\n // include: [{\n // model: CommunityService,\n // as: 'community_service',\n // }],\n })\n .then(student => res.status(200).send(student))\n .catch(error => res.status(400).send(error));\n }", "function getAppts () {\n return allAppts.getList();\n }", "function getNodeExperiences() {\r\n _doGet('/node/experiences');\r\n }", "getInvestments() {\n var investmentsList = [];\n\n for(var projectId in this.investments)\n investmentsList.push(this.investments[projectId]);\n\n return investmentsList;\n }", "index( {params, query} , res) {\n\n let queryDbParams = {};\n if (query._sort && query._order) {\n queryDbParams.order = query._sort+' '+ query._order;\n }\n if (query._start && query._end) {\n queryDbParams.offset = query._start;\n queryDbParams.limit = query._end - query._start;\n }\n\n Promise.all([\n Sponsor.count(),\n Sponsor.findAll({\n attributes: [\n 'id',\n 'name',\n 'logo'\n ],\n ...queryDbParams\n })])\n .then( ( [count, sponsors] ) => {\n res.setHeader(\"X-Total-Count\", count);\n res.json(sponsors);\n })\n }", "getAll(req, res){\n Workout.find({})\n .then(workout => {\n res.json(workout);\n })\n .catch(err => {\n res.json(err);\n });\n }", "async index(req, res){\n // para paginação e informando valor padrão 1 caso nao tenha passo a pagina\n const { page = 1 } = req.query;\n\n const appointments = await Appointment.findAll({\n where: { user_id: req.userId, canceled_at: null, },\n order: ['date'],\n limit: 20,\n offset: (page - 1) * 20,\n attributes: ['id', 'date', 'past', 'cancelable'],\n include: [{\n model: User, \n as: 'provider', \n attributes: ['id', 'name'],\n include: [{\n model: File,\n as: 'avatar',\n attributes: ['id', 'path', 'url'],\n }],\n }],\n });\n return res.json(appointments);\n }", "async indexAll(){\n return Appointment.findAll();\n }", "getAll(req, res) {\n // Blank .find param gets all\n Player.find({})\n .then(Players => res.json(Players))\n .catch(err => res.status(400).json(err))\n }", "getAll(query, isDenials = true, customer = null) {\n const dateRange = this.getDateParams();\n return Resource.get(this).resource(`SupplierCompany:getAllActivityRevised`, {\n dateRange,\n query,\n companyId: auth.get(this).user.company._id,\n isDenials,\n customer\n })\n .then(res => {\n let inventories = res.inventories;\n const payments = Array.isArray(res.payments) ? res.payments : null;\n // Combine payment and denials, include running total\n if (customer && isDenials) {\n inventories = this.handleDenialView(inventories, payments);\n }\n const meta = res.meta;\n this.activity = inventories;\n this.displayData.activity = inventories;\n this.displayData.totals.grandTotal = meta.totals;\n this.displayData.totals.pageTotal = meta.pageTotals;\n this.displayData.totalPages = meta.pages;\n this.displayData.totalItems = meta.total;\n })\n .then(() => {\n if (!this.safeData.retailers.length) {\n // Get list of retailers\n this.getRetailerList();\n }\n })\n .then(() => {\n if (this.displayData.activity.length) {\n this.getParamsInRange();\n } else {\n this.displayData.batches = [];\n }\n });\n }", "experiences(parent, args, { prisma }, info) {\n const opArgs = {\n skip: args.skip,\n first: args.first,\n orderBy: args.orderBy,\n after: args.after, \n };\n \n if(args.query){\n opArgs.where = {\n OR: [\n {\n location: args.query.location\n },\n {\n state: args.query.state\n }\n ]\n }\n }\n \n return prisma.query.experiences(opArgs, info);\n }", "get (OpportunityId, forceReload) {\n var d = $q.defer();\n if(!this.loadedOpportunities[OpportunityId] || forceReload === true) {\n $http.get(`/api/opportunities/${OpportunityId}`)\n .then(response => {\n var opportunity = response.data;\n this.loadedOpportunities[OpportunityId] = opportunity;\n d.resolve(opportunity);\n })\n .catch(err => {\n d.reject(err);\n });\n } else {\n d.resolve(this.loadedOpportunities[OpportunityId]);\n }\n return d.promise;\n }", "static async getOpenOrders() {\n try {\n return await shopdb.po.findAll({ where: {status: { [Op.ne]: \"CLOSED\"} } });\n } catch (error) {\n throw error;\n }\n }", "function getGoals() {\n miliuService.preloaderShow();\n return miliuService.getGoals()\n .then((data) => {\n isDataLoaded = true;\n vm.goals = data.myGoals;\n miliuService.preloaderHide();\n return data;\n }, () => {\n miliuService.preloaderHide();\n });\n }", "async function getActivities(req, res) {\n try {\n const activities = await Activity.findAll({ include: [Destination] });\n successMsg(res, 200, 'correcto', activities)\n } catch (error) {\n errorMsg(res, 500, 'Ha ocurrido un error', error);\n }\n}", "getExpenses() {\n return fetch(this.baseUrl).then(res => res.json())\n }", "function getProfessionals(req, res) {\n if (DEBUG_TRACE_LEVEL >= 1) {\n console.log('**** FUNCTION professionals.getProfessionals ****');\n }\n\n if (DEBUG_TRACE_LEVEL >= 2) {\n console.log('req.query.id: ', req.query.id);\n }\n\n if (typeof req.query.id !== 'undefined') {\n if (DEBUG_TRACE_LEVEL >= 1) {\n console.log(\"1.getProfessionals.professionalId is defined: \", req.query.id)\n }\n getProfessionalById(req, res);\n } else {\n if (DEBUG_TRACE_LEVEL >= 1) {\n console.log(\"2.getProfessionals.professionalId is undefined: \", req.query.id)\n }\n getProfessionalsByQuery(req, res);\n }\n}", "function get_organisations() {\n\t\n\tconsole.log(\"Getting organisations...\");\n\t\n\tvar headers = new Headers();\n headers.append(\"Authorization\", \"Bearer \" + userAccountData.jwt);\n headers.append(\"Content-Type\", \"application/json\");\n\t//console.log(accountObj.deviceTemplates);\n\tfetch(xi_bp_url+'organizations?accountId=' + userAccountData.accountId, {\n\t\tmethod: \"GET\",\n headers: headers,\n cache: \"no-store\"\n\t})\n\t.then(function(response) { return response.json(); })\n .then(function(data) {\n \tconsole.log(\"Getting the organisations: done\");\n\n \tuserAccountData.organizations = data.organizations.results;\n console.log(userAccountData.organizations);\n }.bind(this)).catch(() => {\n alert(\"Couldn't fetch the organisations\");\n });\n}", "function getEquipos(req, res){\n Equipo.find({},function(err,equipos){\n if(err){return res.status(500).send({message:`Error al realizar la petición`})}\n if(!equipos)return res.status(404).send({message:`No existen equipos`});\n\n res.status(200).send({equipos})\n })\n}", "viewAllDept() {\n\t\tconst query = `SELECT *\n\t FROM department;`;\n\t\treturn this.connection.query(query);\n\t}", "getAllCommunes(): Promise<Place[]> {\n\t\treturn axios.get(url + \"/getCommunes\");\n\t}", "function getTournamentData() {\n\t\tCallModel.fetch('TournamentGet', {\n\t\t\tid: $routeParams.tournamentId\n\t\t},\n\t\t{\n\t\t\tsuccess: function (response) {\n\t\t\t\t$scope.tournamentName = response.name;\n\t\t\t}\n\t\t});\n\t}", "function getActivities() {\n return $http.get('getRuns').then((response) => {\n addPacetoActivities(response.data);\n vm.activities = response.data;\n vm.nTotalItems = vm.activities.length;\n });\n }", "getAll(req, res, next) {\n let userId = req.query.user_id ? req.query.user_id : null;\n let query = {};\n\n if (userId) {\n query = {\n [Op.or]: [{ fromId: userId }, { toId: userId }]\n };\n }\n\n ActivitiesService.getAll(query)\n .then(function (activities) {\n res.status(200).json(activities);\n }).catch(function (error) {\n });\n }", "function getAll() {\n return new Promise(function(resolve, reject) {\n dbPromised\n .then(function(db) {\n let tx = db.transaction(\"teams\", \"readonly\");\n let store = tx.objectStore(\"teams\");\n return store.getAll();\n })\n .then(function(teams) {\n resolve(teams);\n });\n });\n}", "function findAll() {\n\t\t\treturn $http({\n\t\t\t\turl: 'api/comercios',\n\t\t\t\tmethod: \"GET\"\n\t\t\t}).then(\n\t\t\t\tfunction success(response) {\n\t\t\t\t\treturn response.data;\n\t\t\t\t},\n\t\t\t\tfunction error(error) {\n\t\t\t\t\treturn error.data;\n\t\t\t\t});\n\t\t}", "async getAthletesBySportId(req, res) {\n const sport = await this.sportService.getSportById(req.params.sportId)\n const athletes = await this.athleteService.getAthletesById(sport.athletes)\n res.send(athletes)\n }", "async allPeoples(req, res) {\n const people = await Pessoa.findAll();\n\n //Retorna todos os registros encontrados\n return res.json(people);\n }", "getTerritories(req, res) {\n Territory.find((error, data) => {\n if (error) {\n res.status(500).json({ error });\n } else {\n res.status(200).json(data);\n }\n });\n }", "function getAll(){\n return pokemonList\n }", "function getAll() {\n return pokemonList;\n }", "async index(req, res) {\n try {\n var planos = await this.Plan.findAll();\n if (planos !== undefined || planos !== null) return planos;\n else return null;\n } catch (err) {\n return undefined;\n }\n }", "getAll(options) {\n options = this.setQueryEntityActionOptions(options);\n const action = this.createEntityAction(EntityOp.QUERY_ALL, null, options);\n this.dispatch(action);\n return this.getResponseData$(options.correlationId).pipe(\n // Use the returned entity ids to get the entities from the collection\n // as they might be different from the entities returned from the server\n // because of unsaved changes (deletes or updates).\n withLatestFrom(this.entityCollection$), map(([entities, collection]) => entities.reduce((acc, e) => {\n const entity = collection.entities[this.selectId(e)];\n if (entity) {\n acc.push(entity); // only return an entity found in the collection\n }\n return acc;\n }, [])), shareReplay(1));\n }", "function loadAll() {\n return AirportService.fetch();\n }", "function GetAllHouseLessonsForSponsor() {\n return $resource(_URLS.BASE_API + 'get_all_house_quizzes_for_sponsor' + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "function findAllTheaters() \n {\n var deferred = $q.defer();\n // GET the theaters\n $http.get(\"/api/project/theater/\")\n .success(function(response) \n {\n deferred.resolve(response);\n });\n\n return deferred.promise;\n }", "list(req, res) {\n PokemonType.findAll()\n .then((pokemonTypes) => {\n res.status(200).json(pokemonTypes);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "function viewAllDepts() {\n connection.query(\n 'SELECT * FROM Department', (err, res) => {\n if (err) {\n console.log(err);\n }\n console.table(res)\n startProgram();\n })\n}", "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "viewAllEmployees() {\n\t\treturn this.connection.query(\n\t\t\t`\n SELECT\n e1.id AS ID,\n e1.first_name AS First_Name,\n e1.last_name AS Last_Name,\n role.title AS Role,\n department.name AS Department,\n CONCAT(e2.first_name, ' ', e2.last_name) AS Manager,\n role.salary AS Salary\n FROM\n employee e1\n LEFT JOIN\n role ON e1.role_id = role.id\n LEFT JOIN\n employee e2 ON e1.manager_id = e2.id\n\t\t LEFT JOIN department ON role.department_id = department.id\n\t\t ORDER BY\n e1.id;\n `\n\t\t);\n }", "function viewAllDepts() {\n console.log(\"Showing all departments...\\n\");\n connection.query(\"SELECT * FROM department \", function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n });\n}", "function getAllAchivementsUser(req, res, next) {\n if (validate(req, res)) {\n db.any('select * from achievements_x_user')\n .then(function(data) {\n res.status(200)\n .json({\n status: 'success',\n data: data\n });\n })\n .catch(function(err) {\n res.status(500)\n .json({\n status: 'error',\n err: err\n });\n });\n }\n}", "function getCourses() {\n return breeze.EntityQuery\n .from(courseType.defaultResourceName)\n .using(manager)\n .execute()\n .then(function(data){\n return data.results;\n })\n }", "async getShortlistOpportunity(href) {\n if (href in this.state.shortlistOpportunities) {\n return this.state.shortlistOpportunities[href];\n } else {\n let item = await this.itemService.getItem(href);\n this.state.shortlistOpportunities[href] = item;\n return item;\n }\n }", "async index(req, res){\n const {postId} = req.params;\n const postagem = await Postagem.findByPk(postId);\n if(!postagem){\n return res.status(404).send({erro: \"Solicitação não encontrada\"});\n }\n const comentarios = await postagem.getComentarios({\n include: {\n association: \"Cliente\",\n as: \"cliente\",\n attributes: [\"id\", \"nome\", \"email\", \"celular\"],\n },\n attributes: [\"id\", \"descricao\", \"created_at\"],\n order: [[\"created_at\", \"ASC\"]]\n });\n res.send(comentarios);\n }", "function getAll() {\n return pokemonList;\n }", "function getAll() {\n return pokemonList;\n }", "function getAll() {\n return pokemonList;\n }", "function getAll() {\n return pokemonList;\n }", "function getAll() {\n return pokemonList;\n }", "async index(req, res) {\n //criando filtro para separa a lista por cada tecnologia desejada pelo usuário\n const { tech } = req.query;\n\n const spots = await Spot.find({ techs: tech });\n\n return res.json(spots);\n }", "getObjectives(){\n var allObjectives = [];\n for(var i = 0; i<this.teams.length;i++){\n allObjectives.push(this.teams[i].getObjective());\n }\n return allObjectives;\n }", "getAll() {\n return Resource.get(this).resource('SupplierCompany:getAll')\n .then((res) => {\n this.companies = res;\n });\n }", "static async getPlants() {\n const response = await TrefleApi._request(\"GET\", \"\");\n return response;\n }", "function getAllCandidates() {\n var obj = {\n p: 1,\n ps: $scope.candidateListSumary.Pagination.TotalCount,\n };\n\n CandidatePoolService.getCandidatesByNetwork(obj).then(function(res) {\n $scope.AllCandidates = res;\n });\n }", "async get() {\r\n let params = {\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n group: this.getGroup()\r\n };\r\n\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findAll(params);\r\n\r\n return result;\r\n }", "getAll() {\n return this.tenants;\n }", "function fetchAllToys(){\n fetch('http://localhost:3000/toys')\n .then(response => response.json())\n .then(allToys => {\n allToys.forEach((toy) => render(toy))\n };\n }", "getContributedStories() {\n\n return this._getCollection()\n .then(collection => collection.find().toArray());\n }", "function retrieveOrganizations (data) {\n var organizations_count = 0;\n\n return new Promise ( (resolve, reject) => _organization_list\n .forEach( we_vote_id => request\n .get(`${config.url}organizationRetrieve/`)\n .withCredentials()\n .query({ organization_we_vote_id: we_vote_id })\n .end( function (err, res) {\n if (res.body.success) {\n _organization_store[res.body.organization_we_vote_id] = shallowClone(res.body);\n }\n else if (err) throw err || res.body;\n\n organizations_count ++;\n\n if (organizations_count === _organization_list.length) {\n console.log('retrieveOrganizations FOUND ALL');\n resolve(data);\n }\n })\n )\n );\n}", "list(req, res) {\n Game.findAll()\n .then((games) => {\n res.status(200).json(games);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "function getAll () {\n return pokemonList;\n }", "myEnterpriseOrders (options) {\n return api('GET', helpers.appendQuery(`/order/self/enterprise`, options.queryParams), options)\n }", "findAll(req, res) {\n OrderModel.find()\n .populate(\"usuarios\")\n .populate({\n path: \"productos\",\n populate: { path: \"productos\" },\n })\n .then((orders) => res.status(200).send(orders))\n .catch((err) => res.status(500).send(err));\n }", "function getExercises() {\n\t\t\t\tworkout.getExercises().then(function(result) {\n\t\t\t\t\t//$resource object returned to controller \n\t\t\t\t\tvm.exercises = result;\n\t\t\t\t\tconsole.log(vm.exercises);\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "async getAllGiveaways() {\n // Get all giveaways from the database\n return giveawayDB.fetchEverything().array();\n }", "static get_one_conulta_p(req, res) {\n const { id_cita } = req.params\n return Consultas\n .findAll({\n where:{id_cita : id_cita },\n include:[{\n model : Recetas\n }]\n })\n .then(Consultas => res.status(200).send(Consultas));\n }", "function getPresidents() {\n return new Promise(function(resolve, reject) {\n var query = new azure.TableQuery();\n tableService.queryEntities(\n `presidents${config.get(\"tableEnd\")}`,\n query,\n null,\n function(error, result, response) {\n if (!error) {\n resolve(response.body.value);\n } else {\n reject(error);\n }\n }\n );\n });\n}", "async function getDestinations(req, res) {\n try {\n const destinations = await Destination.findAll({ include: [Activity] });\n successMsg(res, 200, 'correcto', destinations)\n } catch (error) {\n errorMsg(res, 500, 'Ha ocurrido un error', error);\n }\n}", "async function getAllTeachers() {\n try {\n const teachers = await Profesor.find().populate('cursos')\n return teachers\n } catch (error) {\n throw new Error(error)\n }\n}", "load() {\n\t\treturn models.Enviroment.findAll({\n\t\t\twhere: {\n\t\t\t\tis_active: true\n\t\t\t},\n\t\t\tinclude: [models.Unit, models.User, models.EnviromentType]\n\t\t})\n\t}", "function getAll(req, res) {\n tipocliente.findAll().then(tipo_cliente => {\n return res.status(200).json({\n ok: true,\n tipo_cliente\n });\n }).catch(err => {\n return res.status(500).json({\n message: 'Ocurrió un error al buscar los departamentos'\n });\n });\n}", "async index(req, res) {\n // checando se o usuario logado é um provider\n const checkUserProvider = await User.findOne({\n where: { id: req.Id, provider: true },\n });\n // caso nao seja cai aqui\n if (!checkUserProvider) {\n return res.status(401).json({ error: 'User is not a provider' });\n }\n\n // pega a data passada\n const { date } = req.query;\n // variavel que retorna a data\n const parsedDate = parseISO(date);\n // checa todos os Appointments do dia atraves do usuario logado\n const Appointments = await Appointment.findAll({\n where: {\n provider_id: req.Id,\n canceled_at: null,\n date: {\n [Op.between]: [startOfDay(parsedDate), endOfDay(parsedDate)], // operador between, com o inicio do dia e o fim do dia\n },\n },\n order: ['date'], // ordenado pela data\n });\n\n return res.json(Appointments);\n }", "getAll() {\n const fighters = FighterRepository.getAll();\n return fighters.length ? fighters : null;\n }", "function requestTournaments() {\n return {\n type: FETCH_TOURNAMENTS,\n status: STATUS_REQUEST\n }\n}", "function getTrails(){\n vm.loading = true;\n TrailClient\n .getTrails(vm.search)\n .then(function(response){\n vm.searchResults = response.data.places;\n vm.loading = false;\n })\n }", "getBattlePlaces(req, res) {\n model.battle.findPlaces((err, data) => {\n if(err) {\n res.status(500).send({error: constant.ERROR_OCCURED})\n }\n res.status(200).json({places: data});\n })\n }", "async getAllTrains(req, res) {\n const trains = await TrainModel.find();\n res.send(trains);\n }", "async getAll(obj) {\n const query = obj ? obj.query : {};\n const skip = parseInt(obj.pageSize, 10) * (parseInt(obj.pageNo, 10) - 1);\n const resultObject = this.Model.find(query).populate([\n {\n path: 'vendorId',\n model: 'vendors',\n populate: {\n path: 'venueId',\n model: 'venues',\n },\n },\n {\n path: 'menuItem.menuItemId',\n model: 'menuItems',\n populate: [\n {\n path: 'mediaId.square',\n model: 'medias',\n },\n {\n path: 'mediaId.rectangle',\n model: 'medias',\n },\n {\n path: 'vendorId',\n model: 'vendors',\n populate: {\n path: 'venueId',\n model: 'venues',\n },\n },\n {\n path: 'vendorTagId',\n model: 'vendorTags',\n },\n ],\n },\n {\n path: 'deliveryLocationId',\n model: 'deliverylocations',\n },\n {\n path: 'assignee',\n model: 'users',\n },\n {\n path: 'discountCodeId',\n model: 'discountCodes',\n },\n ]).skip(skip)\n .limit(parseInt(obj.pageSize, 10))\n .sort({ [obj.sortColumn]: parseInt(obj.sortValue, 10) });\n return resultObject;\n }", "function getAll (){\n return Mentor.find({});\n}", "async index(req, res) {\n // Usando a filtragem por tecnologias usando req.query\n const { tech } = req.query;\n\n // Listando os spots que possuem a tech indicada acima.\n const spots = await Spot.find({ techs: tech });\n\n return res.json(spots);\n }", "async index(req, res) {\n const { page = 1 } = req.query;\n const delivery_id = req.params.deliveryid;\n\n const response = await DeliveryProblem.findAndCountAll({\n // Config search\n where: {\n delivery_id\n },\n order: [['id', 'DESC']],\n limit: 7,\n offset: (page - 1) * 7,\n attributes: ['id', 'description', 'created_at'],\n // Include Delivery data in the search result\n include: [\n {\n model: Delivery,\n as: 'delivery',\n attributes: ['product', 'start_date'],\n // Include Courier data in the search result\n include: [\n {\n model: Courier,\n as: 'courier',\n attributes: ['name', 'email']\n },\n // Include Recipient data in the search result\n {\n model: Recipient,\n as: 'recipient',\n attributes: [\n 'name',\n 'street',\n 'number',\n 'city',\n 'state',\n 'zipcode'\n ]\n }\n ]\n }\n ]\n });\n return res.json({\n deliveryProblemsList: response.rows,\n deliveryProblemsCount: response.count\n });\n }", "getSpecimens(options) {\n if (!this.shipment) {\n return this.$q.when({});\n }\n\n return this.ShipmentSpecimen.list(this.shipment.id, options)\n .then(paginatedResult => ({\n items: paginatedResult.items,\n maxPages: paginatedResult.maxPages\n }));\n }", "function getTickets(req, res) {\n\n ticketDBHelper.getTickets('Lotto',req.user.id).lean().exec(function (err, tickets) {\n return res.end(JSON.stringify(tickets));\n })\n}", "get organisations() {\n return this.mutateData.organisations;\n }", "fetchAndLoadExpenses() {\n this.expensesAdapter\n .getExpenses()\n .then(expenses => {\n expenses.forEach(expense => this.expenses.push(new Expense(expense)))\n })\n .then(() => {\n this.renderExpense()\n })\n }", "function displayAllEmployees() {\n return connection.query(viewCommand);\n}" ]
[ "0.6058134", "0.5598122", "0.5592937", "0.53780794", "0.53768057", "0.50000894", "0.49766225", "0.49700993", "0.49307495", "0.48573822", "0.48112598", "0.4808224", "0.4767078", "0.472867", "0.47020328", "0.46967432", "0.469502", "0.46920297", "0.46859482", "0.4679138", "0.46764815", "0.46622482", "0.4649619", "0.46490353", "0.46363136", "0.46327397", "0.4621419", "0.4620225", "0.46202192", "0.46129966", "0.4612545", "0.45970744", "0.45699492", "0.4548743", "0.4544261", "0.45403615", "0.45292264", "0.4507544", "0.45041823", "0.44974136", "0.44821578", "0.44784516", "0.44772738", "0.4476929", "0.44687727", "0.44653186", "0.44644946", "0.44581234", "0.44579872", "0.44521567", "0.4446614", "0.44462773", "0.44410414", "0.44396892", "0.44384795", "0.4434947", "0.44316941", "0.4428632", "0.44283107", "0.44283107", "0.44283107", "0.44283107", "0.44283107", "0.4427287", "0.4423878", "0.44201803", "0.44197455", "0.44174865", "0.44148433", "0.44114348", "0.44067022", "0.44034472", "0.43997684", "0.43924665", "0.4391613", "0.438848", "0.4384115", "0.43825105", "0.438194", "0.4376795", "0.43722832", "0.4368592", "0.4366661", "0.43622214", "0.43584976", "0.43577632", "0.43499058", "0.4347737", "0.4344425", "0.4334485", "0.43334445", "0.43285465", "0.4321483", "0.43149862", "0.43124226", "0.4309994", "0.43092656", "0.42962387", "0.42939815", "0.42881823" ]
0.4390956
75
This function shows the details for a specific opportunity
function showOppDetails(itemID) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#AddOpp').hide(); $('#OppDetails').hide(); $('#AddSale').hide(); $('#SaleDetails').hide(); currentItem = list.getItemById(itemID); context.load(currentItem); context.executeQueryAsync( function () { $('#editOpp').val(currentItem.get_fieldValues()["Title"]); $('#editOppPerson').val(currentItem.get_fieldValues()["ContactPerson"]); $('#editOppNumber').val(currentItem.get_fieldValues()["ContactNumber"]); $('#editOppEmail').val(currentItem.get_fieldValues()["Email"]); $('#editOppAmount').val("$" + currentItem.get_fieldValues()["DealAmount"]); //Add an onclick event to the convertToSale div $('#convertToSale').click(function (sender) { convertToSale(itemID); }); //Add an onclick event to the convertToLostSale div $('#convertToLostSale').click(function (sender) { convertToLostSale(itemID); }); var oppList = document.getElementById("OppAttachments"); while (oppList.hasChildNodes()) { oppList.removeChild(oppList.lastChild); } if (currentItem.get_fieldValues()["Attachments"] == true) { var attachmentFolder = web.getFolderByServerRelativeUrl("Lists/Prospects/Attachments/" + itemID); var attachments = attachmentFolder.get_files(); context.load(attachments); context.executeQueryAsync(function () { // Enumerate and list the Opp Attachments if they exist var attachementEnumerator = attachments.getEnumerator(); while (attachementEnumerator.moveNext()) { var attachment = attachementEnumerator.get_current(); var oppDelete = document.createElement("span"); oppDelete.appendChild(document.createTextNode("Delete")); oppDelete.className = "deleteButton"; oppDelete.id = attachment.get_serverRelativeUrl(); $(oppDelete).click(function (sender) { deleteOppAttachment(sender.target.id, itemID); }); oppList.appendChild(oppDelete); var oppLink = document.createElement("a"); oppLink.setAttribute("target", "_blank"); oppLink.setAttribute("href", attachment.get_serverRelativeUrl()); oppLink.appendChild(document.createTextNode(attachment.get_name())); oppList.appendChild(oppLink); oppList.appendChild(document.createElement("br")); oppList.appendChild(document.createElement("br")); } }, function () { }); } $('#OppDetails').fadeIn(500, null); }, function (sender, args) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getOpportunityDetails (req, res) {\n res.send(await service.getOpportunityDetails(req.authUser, req.params.opportunityId))\n}", "async function getOpportunity (req, res) {\n res.send(await service.getOpportunity(req.authUser, req.params.opportunityId))\n}", "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "details(context) {\r\n let {\r\n id\r\n } = context.params\r\n\r\n models.Ideas.getSingle(id)\r\n .then((res) => {\r\n let currentIdea = docModifier(res)\r\n context.idea = currentIdea\r\n console.log(context.idea)\r\n //Check for author of cause! \r\n if (currentIdea.uid !== localStorage.getItem('userId')) {\r\n context.isAuthor = false;\r\n } else {\r\n context.isAuthor = true;\r\n }\r\n\r\n extend(context).then(function () {\r\n this.partial('../templates/cause/details.hbs')\r\n })\r\n })\r\n .catch((err) => console.error(err))\r\n }", "function showDetails(){\n\tView.controllers.get('visitorController')['editTag']=true;\n var grid = View.panels.get('visitorsGrid');\n var selectedRow = grid.rows[grid.selectedRowIndex];\n var visitorId = selectedRow[\"visitors.visitor_id\"];\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"visitors.visitor_id\", visitorId, \"=\");\n View.panels.get('visitorsForm').refresh(restriction,false);\n}", "function showOpps() {\n //Highlight the selected tile\n $('#LeadsTile').css(\"background-color\", \"#0072C6\");\n $('#OppsTile').css(\"background-color\", \"orange\");\n $('#SalesTile').css(\"background-color\", \"#0072C6\");\n $('#LostSalesTile').css(\"background-color\", \"#0072C6\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n var errArea = document.getElementById(\"errAllOpps\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var hasOpps = false;\n\n hideAllPanels();\n var oppList = document.getElementById(\"AllOpps\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n var oppTable = document.getElementById(\"OppList\");\n // Remove all nodes from the Opportunity <DIV> so we have a clean space to write to\n while (oppTable.hasChildNodes()) {\n oppTable.removeChild(oppTable.lastChild);\n }\n\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n // Create a DIV to display the organization name\n var opp = document.createElement(\"div\");\n var oppLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n opp.appendChild(oppLabel);\n\n // Add an ID to the opportunity DIV\n opp.id = listItem.get_id();\n\n // Add an class to the opportunity DIV\n opp.className = \"item\";\n\n // Add an onclick event to show the opportunity details\n $(opp).click(function (sender) {\n showOppDetails(sender.target.id);\n });\n\n //Add the opportunity div to the UI\n oppTable.appendChild(opp);\n hasOpps = true;\n }\n }\n if (!hasOpps) {\n var noOpps = document.createElement(\"div\");\n noOpps.appendChild(document.createTextNode(\"There are no opportunity. You can add a new Opportunity to an existing Lead.\"));\n oppTable.appendChild(noOpps);\n }\n $('#AllOpps').fadeIn(500, null);\n },\n\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get opportunity. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#OppList').fadeIn(500, null);\n });\n\n}", "function showBuildingDetails(title,attributes){\n \tvar controller = View.controllers.get(\"abRplmPfadminGpdGisCtrl\");\n\tvar blId = title;\n\tcontroller.openDetailsPopUp(blId);\n}", "function Details(place){\n var details = document.createElement('div');\n writtendetails.appendChild(details);\n\n let name = document.createElement('h1');\n name.textContent = place.name;\n details.appendChild(name);\n if (place.rating != null) {\n let rating = document.createElement('p');\n rating.innerHTML = `Rating: ${place.rating}`+\" \"+`<i class=\"fas fa-star\"></i>`;\n details.appendChild(rating);\n }\n if(place.vicinity){\n let address = document.createElement('p');\n address.textContent = place.vicinity;\n details.appendChild(address);}\n if(place.business_status===\"OPERATIONAL\"){\n let openinghours=document.createElement(\"p\");\n openinghours.textContent = \"We are open and ready to take your order\";\n details.appendChild(openinghours);\n }else if(\n place.business_status===\"CLOSED_TEMPORARILY\"){\n let notopen=document.createElement(\"p\");\n notopen.textContent=\"Sorry, we are closed temporarily.\";\n details.appendChild(notopen);\n }\n \n }", "function displayItemDetails() {\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\n var meetingSuggestions = item.getEntitiesByType(Office.MailboxEnums.EntityType.MeetingSuggestion);\n var meetingSuggestion = meetingSuggestions[0];\n\n $('#start-time').text(meetingSuggestion.start);\n }", "function viewDetails(appointment_id) {\n console.log('view details clicked ', appointment_id);\n $http.get('/appointments/' + appointment_id).then(function(response) {\n appointment.selected = response.data;\n console.log('Apt & Client details back from db: ', appointment.selected);\n });\n }", "function collegeInfo(college) {\n Modal.info({\n title: 'College Detail',\n content: (\n <div>\n <p>College ID : {college._id}</p>\n <p>Name : {college.name}</p>\n <p>Since : {college.year_founded}</p>\n <p>City : {college.city}</p>\n <p>State : {college.state}</p>\n <p>Country : {college.country}</p>\n <p>No. of Students : {college.no_of_students}</p>\n <p>Courses Offered:</p>\n <ul>\n {college.courses.map(course=>{\n return <li key={course}>{course}</li>\n })}\n </ul>\n <a href={\"/similar/?id=\"+college._id}>Show Similar Colleges</a>\n <br/>\n <a href={\"/students/?id=\"+college._id}>Show Students List</a>\n \n </div>\n ),\n onOk() {},\n });\n }", "function viewDetails(object) {\n if (target.value == 'person') {\n $('#person-edit-model').modal('show');\n setEditValuesPerson(object.target.id);\n } else if (target.value == 'company') {\n $('#company-edit-model').modal('show');\n setEditValuesCompany(object.target.id);\n } else {\n return;\n }\n}", "function getDetails(placeId, el) {\n let placeService = new google.maps.places.PlacesService(place);\n placeService.getDetails({placeId: placeId}, function(place, status) {\n //console.log(status);\n //console.log(place);\n\n let phoneNumber = place.formatted_phone_number;\n let hours = place.opening_hours.weekday_text;\n let website = place.website;\n let moreInfo = place.url;\n\n el.append('<br><label class=\"first\">phone number:</label> ' + phoneNumber);\n el.append('<br><label>website:</label> ' + website);\n el.append('<br><label>google page:</label> ' + moreInfo);\n\n for(let i = 0; i < hours.length; i++) {\n el.append('<span class=\"list-item\">' + hours[i] + '</span>');\n }\n });\n}", "function showTournamentID(){\n console.log('Tournament name: ', tournamentID);\n }", "function getDetails() {\n\n}", "function viewInformation() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n Message: \"WHAT INFORMATION WOULD YOU LIKE TO DISPLAY?\",\n choices: [\"VIEW department\", \"VIEW role\", \"VIEW employee\"],\n })\n //==================IF YOU WANT TO VIEW THE DEPARTMENT===========\n .then(function (answer) {\n switch (answer.action) {\n case \"VIEW department\":\n viewDepartment();\n break;\n //========IF YOU WANT TO VIEW THE ROLE=============\n case \"VIEW role\":\n viewRole();\n break;\n //========IF YOU WANT TO VIEW THE EMPLOYEE===========\n case \"VIEW employee\":\n viewEmployee();\n break;\n }\n });\n}", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function () {\n showModal(pokemon);\n });\n }", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function () {\n showModal(pokemon);\n });\n }", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function () {\n showModal(pokemon);\n });\n }", "function showDetails(item) {\n pokemonRepository.loadDetails(item).then(function () {\n console.log(item);\n showModal(item);\n });\n }", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function () {\n var bodyContent =\n 'Height: ' +\n '\\n' +\n pokemon.height +\n '\\n' +\n 'Types: ' +\n pokemon.types +\n '\\n';\n showModal(pokemon.name, bodyContent, pokemon.imageUrl);\n hideLoadingMessage();\n });\n }", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function(x) {\n const {name,height,sprites, types} = x; \n showModal(name, height, sprites, types);\n });\n}", "function displayDetail(indice)\n{\n RMPApplication.debug(\"displayDetail : indice = \" + indice);\n v_ol = var_order_list[indice];\n c_debug(dbug.detail, \"=> displayDetail: v_ol (mini) = \", v_ol);\n\n // we want all details for the following work order before showing on the screen\n var wo_query = \"^wo_number=\" + $.trim(v_ol.wo_number);\n var input = {};\n var options = {};\n input.query = wo_query;\n // var input = {\"query\": wo_query};\n c_debug(dbug.detail, \"=> displayDetail: input = \", input);\n id_get_work_order_full_details_api.trigger(input, options, wo_details_ok, wo_details_ko);\n\n RMPApplication.debug(\"end displayDetail\");\n}", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function () {\n showModal(pokemon);\n });\n }", "function showCostIndexTransDetails(context){\n\tvar costIndexTransId = context.row.getFieldValue(\"cost_tran_recur.cost_index_trans_id\");\n\tif (valueExistsNotEmpty(costIndexTransId)) {\n\t\tvar restriction = new Ab.view.Restriction();\n\t\trestriction.addClause(\"cost_index_trans.cost_index_trans_id\", costIndexTransId, \"=\");\n\t\tView.panels.get(\"abRepmCostLsProfileCostIndexTrans\").refresh(restriction);\n\t\tView.panels.get(\"abRepmCostLsProfileCostIndexTrans\").showInWindow({closeButton: true});\n\t}\n}", "function displayCRMInfo(id = \"-\", trackingId = \"-\", location = \"-\", pickup = \"-\", delivery = \"-\", status = \"-\") {\n const idElement = document.getElementById(\"id\");\n const trackingIdElement = document.getElementById(\"tracking-id\");\n const locationElement = document.getElementById(\"location\");\n const pickupElement = document.getElementById(\"pickup\");\n const deliveryElement = document.getElementById(\"delivery\");\n const statusElement = document.getElementById(\"status\");\n\n idElement.textContent = id;\n trackingIdElement.textContent = trackingId;\n locationElement.textContent = location;\n pickupElement.textContent = pickup;\n deliveryElement.textContent = delivery;\n statusElement.textContent = status;\n}", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function () {\n showModal(pokemon);\n });\n}", "function viewAgency(agency_id) {\n console.log('view details clicked ', agency_id);\n $http.get('/agencies/' + agency_id).then(function(response) {\n agency.selected = response.data;\n console.log('Agency record back from db: ', agency.selected);\n });\n }", "function storeOpportunityDetails(opportunityObj){\n\tlocalStorage.konyOpportunityDetails = opportunityObj; //storing the corresponding opportunity details in localstorage\n\tchangePage('opportunitydetailspage','');\n}", "async function getOpportunityPhases (req, res) {\n res.send(await service.getOpportunityPhases(req.authUser, req.params.opportunityId))\n}", "function openModal(e) {\r\n // console.log(\"e.target.id: \", e.target.id)\r\n fetch(`${url}/${e.target.id}`)\r\n .then(res => res.json())\r\n .then(res => {\r\n let info = res.results[0]\r\n console.log(info)\r\n let name = info.name\r\n let fullName = info.biography['full-name'] \r\n let alterEgos = info.biography['alter-egos'] \r\n let occupations = info.work.occupation\r\n let intelligence = info.powerstats.intelligence\r\n let strength = info.powerstats.strength\r\n let speed = info.powerstats.speed \r\n let affiliations = info.connections[\"group-affiliation\"]\r\n\r\n infoName.innerText = name;\r\n infoFullName.innerText = `Full Name: ${fullName}`;\r\n\r\n let infoOccupations = document.createElement(\"p\")\r\n infoOccupations.innerHTML = `<strong>Occupations:</strong> ${occupations}` \r\n infoStats.appendChild(infoOccupations)\r\n\r\n let infoIntelligence = document.createElement(\"p\")\r\n infoIntelligence.innerHTML = `<strong>Intelligence: </strong> ${intelligence} / 100`\r\n infoStats.appendChild(infoIntelligence)\r\n\r\n let infoStrength = document.createElement(\"p\")\r\n infoStrength.innerHTML = `<strong>Strength: </strong> ${strength} / 100`\r\n infoStats.appendChild(infoStrength)\r\n\r\n let infoSpeed = document.createElement(\"p\")\r\n infoSpeed.innerHTML = `<strong>Speed: </strong> ${speed} / 100`\r\n infoStats.appendChild(infoSpeed)\r\n\r\n infoAffiliations.innerText = affiliations\r\n\r\n modal.style.display = 'block';\r\n })\r\n .catch(err => {\r\n console.log(\"Error: \", err)\r\n })\r\n\r\n \r\n}", "open(OpportunityId, OpportunityTitle, forceReload) {\n $state.go('opportunities.view', {\n OpportunityId: OpportunityId,\n PrettyURL: Util.convertToSlug(OpportunityTitle),\n forceReload: forceReload || false\n });\n }", "function showDetails(pokemon){\n pokemonRepository.loadDetails(pokemon).then(function() {\n // creates Modal\n var modal = $('.modal-body');\n /*eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"name\" }]*/\n var name = $('.modal-title').text(pokemon.name);\n\t\t\tvar height = $('<p class=\"pokemon-height\"></p>').text('Height: ' + pokemon.height + ' Decimetres.');\n\t\t\tvar weight = $('<p class=\"pokemon-weight\"></p>').text('Weight: ' + pokemon.weight + ' Hectograms.');\n var type = $('<p class=\"pokemon-type\"></p>').text('Type: ' + pokemon.types + '.');\n var image = $('<img class=\"pokemon-picture\">');\n image.attr('src', pokemon.imageUrl);\n\n if(modal.children().length) {\n modal.children().remove();\n }\n\n modal.append(image)\n\t\t\t\t.append(height)\n\t\t\t\t.append(weight)\n .append(type);\n });\n }", "function MakeInfo(org) {\n var items = org.items_neededs;\n\n var contentString = '';\n contentString += '<div class=\"\">';\n contentString += '<h4><b>' + org.org_name + '</b></h4>';\n contentString += '<p>' + org.description + '</p>';\n\n contentString += '<b>Want:</b>';\n contentString += '<ul>'\n items.forEach((item) => {\n contentString += '<li>' + item.item + ' x' + item.quantity_needed + '</li>';\n });\n contentString += '</ul>'\n\n contentString += '</div>'\n\n var infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 200\n });\n return infowindow;\n }", "function showDetailedInfo(place) {\n var contentString;\n\n // Construct different strings for different heights\n // Future fix: use icons instead of text for Products\n if (window.innerHeight > 720) {\n contentString =\n '<h4>' + place.marketName + '</h4><br>' +\n '<h4>' + place.address + '</h4><br>' +\n 'Schedule: ' + place.schedule.replace(/\\<br\\>/g, '') + '<br>' +\n 'Products: ' + place.products + '<br><br>';\n } \n else {\n contentString =\n '<h4>' + place.marketName + '</h4><br>' +\n '<h4>' + place.address + '</h4><br>' +\n 'Schedule: ' + place.schedule.replace(/\\<br\\>/g, '') + '<br><br>';\n }\n mapManager.resetInfoWindowContent(contentString);\n addFlickrPhotos(place.marketName);\n mapManager.openInfoWindow(place.mapMarker);\n }", "function onShowContracts(){\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClause(\"eq.eq_id\",$(\"wr.eq_id\").value,'=');\n\tView.openDialog(\"ab-helpdesk-request-equipment.axvw\", restriction, false); \n}", "function showDetails(pokemon) {\n\t\t\tloadDetails(pokemon).then(function () {\n\t\t\tshowModal(pokemon);\n\t\t\t});\n\t\t}", "function show(req, res) {\n PlanSection.findOne({ _plan_id: req.params.plan_id, _id: req.params.id }).then(handleEntityNotFound(res)).then(responseWithResult(res))['catch'](handleError(res));\n}", "function showDetails(itemName) {\n var item = pokemonRepository.search(itemName); // get object for this name\n pokemonRepository.loadDetails(item).then(function() {\n showModal(item);\n });\n }", "function showDetails(pokemon) {\n\t \tloadDetails(pokemon).then(function () {\n\t \tshowModal(pokemon.imageUrl, pokemon.name, pokemon.height)\n\t\t });\n\t\t}", "function getPlaceDetails() {\n marker = this;\n placesSrv.getDetails(\n {reference: marker.place.reference},\n function(place, status) {\n if (status != google.maps.places.PlacesServiceStatus.OK) {\n console.log(\"blääh\");\n return;\n }\n buildPlaceInfo(place);\n infocard.setHeader(place.name);\n infocard.replaceContents(searchResults);\n infocard.resize(300, 350)\n infocard.open();\n });\n}", "function showDetails() {\n // 'this' is the row data object\n var s1 = ('Total room area: ' + this['rm.total_area'] + ' sq.ft.');\n \n // 'this.grid' is the parent grid/mini-console control instance\n var s2 = ('Parent control ID: ' + this.grid.parentElementId);\n \n // you can call mini-console methods\n var s3 = ('Row primary keys: ' + toJSON(this.grid.getPrimaryKeysForRow(this)));\n \n alert(s1 + '\\n' + s2 + '\\n' + s3);\n}", "function openContactDetails() {\n\t\tconst contactId = Number(this.id);\n\t\tupdateContactDetails(contactId);\n\t\tmodal.style.display = \"block\";\n\t}", "function showFullDetails(clicked,pgDetails){\n console.log(pgDetails);\n var div = '<div style=\"width:96%;margin-left:2%;margin-right:1%;margin-top:2%;background-color:#333;color:white;font-size:18px;\"><legend align=\"center\" style=\"color:white;\">'+pgDetails[clicked].name+'</legend>';\n div += '<div style=\"margin-left:2%;\"><label>Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].address+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>city&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].city+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Mobile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+pgDetails[clicked].mobile+'</span></div>';\n if(pgDetails[clicked].Sharing == \"accomodationOnly\"){\n var type = \"Accomodation Only\";\n }else{\n var type = \"Food and Accomodation\";\n }\n div += '<div style=\"margin-left:2%;\"><label>Accomodation Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>'+type+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Sharings Available&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>';\n var share =\"\";\n for(var i=0;i<pgDetails[clicked].pgFor.length;i++){\n if(pgDetails[clicked].pgFor[i] == \"more5\"){\n share += \"More than 5\";\n }else{\n share += pgDetails[clicked].pgFor[i]; \n share += \",\";\n }\n\n }\n div += share+'</span></div>';\n div += '<div style=\"margin-left:2%;\"><label>Facility Available&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><span>';\n \n var facility = \"\";\n for(var j=0;j<pgDetails[clicked].facility.length;j++){\n facility += pgDetails[clicked].facility[j];\n if(j != pgDetails[clicked].facility.length-1){\n facility += \", \";\n }\n \n }\n div += facility+'</span></div>';\n div += '</div>';\n var ratings = '<div style=\"width:96%;margin-left:2%;margin-right:1%;margin-top:2%;background-color:#333;color:white;font-size:18px;\">';\n ratings += '<legend style=\"color:white;\"><span style=\"margin-left:2%;\">User Ratings</span></legend>';\n //ratings += '<div style=\"margin-left:2%;\"><span>Food&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class=\"rating\" id=\"food\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"3.6\"></span></div>';\n ratings += '<div style=\"margin-left:2%;\"><label style=\"float:left;\">Food &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"food\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"3.6\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Parking Facility &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"parking\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4.2\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Hygiene &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"hygiene\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br><div style=\"margin-left:2%;\"><label style=\"float:left;\">Overall Rating of PG &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><div style=\"width:30%;float:left;margin-top:-2%;\"><input class=\"rating\" id=\"pgRating\" data-min=\"0\" data-max=\"5\" data-step=\"0.1\" data-size=\"xs\" data-readonly=\"true\" value=\"4.3\" style=\"width:50%;\"></div></div><br>';\n ratings += '<br></div>';\n //ratings += '</div>';\n \n $(\"#thumbnails\").append(div);\n $(\"#thumbnails\").append(ratings); \n \n $(\"#food\").rating();\n $(\"#parking\").rating();\n $(\"#hygiene\").rating();\n $(\"#pgRating\").rating();\n \n }", "async getShortlistOpportunity(href) {\n if (href in this.state.shortlistOpportunities) {\n return this.state.shortlistOpportunities[href];\n } else {\n let item = await this.itemService.getItem(href);\n this.state.shortlistOpportunities[href] = item;\n return item;\n }\n }", "function getEventDetails () { \n\tif (eventIndex == undefined) { // displayed when there is no event at current day\n\t\tdocument.getElementById(\"description\").style.visibility = \"hidden\"; // hide the HTML details\n\t\tdocument.getElementById(\"currentPhoto\").setAttribute(\"src\", \"NoEvent.jpg\"); // display \"no event\" picture\n\t} else { // finding details about event and displaying it\n\t\tdocument.getElementById(\"description\").style.visibility = \"visible\"; // show HTML details\n\t\t// set displayed details based on the information in the pseudo data base\n\t\tdocument.getElementById(\"startingTime\").innerHTML = eventsToDisplay[eventIndex].startingTime;\n\t\tdocument.getElementById(\"endingTime\").innerHTML = eventsToDisplay[eventIndex].endingTime;\n\t\tdocument.getElementById(\"title\").innerHTML = eventsToDisplay[eventIndex].title;\n\t\tdocument.getElementById(\"eventDescription\").innerHTML = eventsToDisplay[eventIndex].eventDescription;\n\t\tdocument.getElementById(\"place\").innerHTML = eventsToDisplay[eventIndex].place;\n\t\tdocument.getElementById(\"currentPhoto\").setAttribute(\"src\", eventsToDisplay[eventIndex].imgSource);\n\t}\n}", "async function viewObjectDetails(id){\n\t//retrieve object data\n\tconst p = new Parameters();\n\tp.addParams(\"q\", `objectid:${id}`);\n\tconst data = await getSearchData(OBJECT, p.getParams());\n\tconst obj = data[0];\n\tlet html = \"\";\n\t//retrieve images through IIIF\n\tfor (let i in obj.images){\n\t\tconst base_uri = obj.images[i].iiifbaseuri;\n\t\tconst json = await getData(base_uri + \"/info.json\"); //can be slower than loading the rest of the info\n\t\tconst info = json.profile[1];\n\t\tconst ext = (info.formats.includes(\"png\") ? \"png\" : \"jpg\");\n\t\tconst full_uri = base_uri + `/full/full/0/native.${ext}`;\n\t\thtml += `<img src='${full_uri}' width='300' onclick=\"viewFullImg('${full_uri}')\">`;\n\t}\n\t//display object properties\n\thtml += \"<table><tr><th colspan='2'>Object Details</th></tr>\";\n\tfor (let prop in obj){\n\t\tif (!obj.hasOwnProperty(prop)){ continue; }\n\t\tlet val = obj[prop];\n\t\thtml += `<tr><td>${prop}</td><td>${val}</td></tr>`;\n\t}\n\thtml += \"</table>\";\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "function showDetails() {\n const item = this.options.foodTruck;\n\n document.body.insertAdjacentHTML(\n 'afterbegin',\n `<section id=\"modal\" class=\"modal\">\n <h2>${item.name}</h2>\n <p>Sells ${item.product} for ${item.avgPrice} ${ checkPlural(item.avgPrice, 'coin') }.</p>\n <section class=\"queue\">\n <span>${item.queue}</span>\n <p>${ checkPlural(item.queue, 'person') } waiting</p>\n </section>\n <span class=\"close\" onclick=\"hideDetails()\">✕</span>\n </section>`\n );\n}", "function showDetails(row){\n\tabRepmAddEditLeaseInABuilding_ctrl.abRepmAddEditLeaseInABuildingAddLease_form.show(false);\n\t\n\tvar ls_id = row.restriction.clauses[0].value;\n\t\n\trefreshPanels(ls_id);\n}", "async function updateOpportunityDetails (req, res) {\n res.send(await service.updateOpportunityDetails(req.authUser, req.params.opportunityId, req.body))\n}", "function showDetails() {\n $(this).closest('.panel-body').find('.projInfo').slideDown();\n }", "function showOfficialTravelItenerary(id){\n\tajax_getOfficialTravelItenerary(id,function(official_travel_itenerary){\n\t\titenerary_count=0;\n\t\tfor(var x=0; x<official_travel_itenerary.length;x++){\n\t\t\titenerary_count++;\n\t\t\tshowTotalIteneraryCount();\n\t\t\t\n\t\t\tlet isEmptyDepTime = official_travel_itenerary[x].departure_time === '00:00:00' ? true : false\n\t\t\tlet timeString = ''\n\t\t\tlet hourEnd = official_travel_itenerary[x].departure_time.indexOf(\":\");\n\t\t\tlet H = +official_travel_itenerary[x].departure_time.substr(0, hourEnd);\n\t\t\tlet h = H % 12 || 12;\n\t\t\tlet ampm = (H < 12 || H === 24) ? \" AM\" : \" PM\";\n\t\t\ttimeString = h + official_travel_itenerary[x].departure_time.substr(hourEnd, 3) + ampm;\n\n\t\t\t//printables\n\t\t\tif(official_travel_itenerary[x].request_type==\"official\") ttURL='travel/official/print/trip_ticket'\n\t\t\tif(official_travel_itenerary[x].request_type==\"personal\") ttURL='travel/personal/print/statement_of_account'\n\t\t\tif(official_travel_itenerary[x].request_type==\"campus\") ttURL='travel/campus/print/notice_of_charges'\n\n\t\t\tvar htm=`<details id=\"official_travel_itenerary`+official_travel_itenerary[x].id+`\" data-menu=\"iteneraryMenu\" data-selection=\"`+official_travel_itenerary[x].id+ `\" class=\"contextMenuSelector official_travel_itenerary`+official_travel_itenerary[x].id+` col col-md-12\">\n\t\t\t\t\t<summary>`+official_travel_itenerary[x].location+` - `+official_travel_itenerary[x].destination+`</summary>\n\t\t\t\t\t<table class=\"table table-fluid\" style=\"background:rgba(250,250,250,0.7);color:rgb(40,40,40);\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<th>Origin</th> <th>Destination</th> <th>Date</th> <th>Time</th>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onclick=\"event.preventDefault();window.open('${ttURL}/${official_travel_itenerary[x].id}');\">`+official_travel_itenerary[x].location+`</a><br/>\n\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('travel/campus/print/notice_of_charges/${official_travel_itenerary[x].id}');\">NOC</button>`\n\n\t\t\t\t\t\t\t\t\tif(official_travel_itenerary[x].request_type=='official'){\n\t\t\n\t\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('${ttURL}/${official_travel_itenerary[x].id}');\">TT</button>`\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif(official_travel_itenerary[x].request_type=='personal'){\n\t\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('travel/official/print/trip_ticket/${official_travel_itenerary[x].id}');\">TT</button>`\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif(official_travel_itenerary[x].request_type=='campus'){\n\t\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('${ttURL}/${official_travel_itenerary[x].id}');\">TT</button>`\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\thtm+=`<button class=\"btn btn-xs btn-danger\" onclick=\"event.preventDefault();window.open('https://form.jotform.me/81214740186453');\">Feedback form</button>`\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\thtm+=\t\t\t\t`</td>\n\t\t\t\t\t\t\t\t<td>`+official_travel_itenerary[x].destination+`</td>\n\t\t\t\t\t\t\t\t<td>`+official_travel_itenerary[x].departure_date+`</td>\n\t\t\t\t\t\t\t\t<td>`+(isEmptyDepTime ? '<em>To Be Determined</em>' : timeString)+`</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</details>\n\t\t\t`\n\n\t\t\t$('.preview-itenerary').append(htm)\n\t\t}\n\n\n\t\tif(itenerary_count<=0){\n\t\t\t$('.preview-itenerary').html('<center><i class=\"material-icons md-36\">directions_car</i><h3>Empty Itinerary</h3><p class=\"text-muted\">Add new destination to your request.</p></center>')\n\t\t}\n\n\t\tsetTimeout(function(){ context() },1000);\n\t});\n\t\n}", "function showPokeInfo(pokemon) {\n loadDetails(pokemon).then(function() {\n showModal(pokemon);\n });\n}", "function showDetails(item) {\n loadDetails(item).then(function () {\n // call function to display items in modal\n populateModal(item);\n });\n }", "function showDetails(row){\n\tvar controller = View.controllers.get('abGbRptFpSrcCatCtrl');\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClauses(controller.consoleRestriction);\n\tif(typeof(row) == \"object\" && typeof(row) != \"string\" && row != \"total_row\" ){\n\t\tif(valueExistsNotEmpty(row[\"bl.site_id\"])){\n\t\t\trestriction.addClause(\"bl.site_id\", row[\"bl.site_id\"], \"=\", \"AND\", true);\n\t\t}\n\t\tif(valueExistsNotEmpty(row[\"gb_fp_totals.calc_year\"])){\n\t\t\trestriction.addClause(\"gb_fp_totals.calc_year\", row[\"gb_fp_totals.calc_year\"], \"=\", \"AND\", true);\n\t\t}\n\t}\n\tcontroller.abGbRptFpSrcCat_bl.addParameter(\"isGroupPerArea\", controller.isGroupPerArea);\n\tcontroller.abGbRptFpSrcCat_bl.refresh(restriction);\n\tshowReportColumns(controller.abGbRptFpSrcCat_bl);\n\tcontroller.abGbRptFpSrcCat_tabs.selectTab(\"abGbRptFpSrcCat_bl_tab\");\n}", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function () {\n showModal(pokemon); //another function is called to run the modal in the browser\n });\n }", "function viewInfoPrompt () {\n return inquirer.prompt ([\n {\n type: \"list\",\n name: \"itemToView\",\n message: \"What would you like to view?\",\n choices: [\n \"Departments\", \n \"Roles\",\n \"Employees\",\n \"All Information\"\n ]\n }\n ])\n\n }", "function showExtendedDetails(jsonResort) {\n const extendedDesc = document.querySelector(\".extendedDesc\");\n\n extendedDesc.querySelector(\"h1\").textContent = jsonResort.gsx$resort.$t;\n extendedDesc.querySelector(\"h2\").textContent = jsonResort.gsx$country.$t;\n extendedDesc.querySelector(\".modal-green span\").textContent = jsonResort.gsx$greenslopes.$t;\n extendedDesc.querySelector(\".modal-blue span\").textContent = jsonResort.gsx$blueslopes.$t;\n extendedDesc.querySelector(\".modal-red span\").textContent = jsonResort.gsx$redslopes.$t;\n extendedDesc.querySelector(\".modal-black span\").textContent = jsonResort.gsx$blackslopes.$t;\n extendedDesc.querySelector(\".resortMap\").src = jsonResort.gsx$mapimage.$t;\n extendedDesc.querySelector(\".extendedPrice span\").textContent = jsonResort.gsx$skipass.$t;\n extendedDesc.querySelector(\".resortDescription\").textContent = jsonResort.gsx$about.$t;\n extendedDesc.querySelector(\".resortWebpageA\").href = jsonResort.gsx$homepage.$t;\n extendedDesc.querySelector(\".resortWebcamA\").href = jsonResort.gsx$webcamera.$t;\n extendedDesc.querySelector(\".resortIcons figure .tooltiptext .tooltipheight\").textContent = jsonResort.gsx$maxheight.$t;\n extendedDesc.querySelector(\".resortIcons figure .tooltiptext .tooltiplength\").textContent = jsonResort.gsx$slopelength.$t;\n\n extendedDesc.querySelector(\".close\").addEventListener(\"click\", (e) => {\n extendedDesc.style.animation = \".3s open ease-in forwards;\";\n extendedDesc.style.display = \"none\";\n });\n}", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "function getDetails(e, $row, id, record) {\n $('#feature-title').text(record.title);\n $('#feature-priority').text(record.client_priority);\n $('#feature-target-date').text(record.target_date);\n $('#feature-client').text(record.client);\n $('#feature-product-area').text(record.product_area_name);\n\t$('#feature-description').text(record.description);\n }", "function renderOppName(params) {\n // console.log(params)\n // console.log(params.data); \n if (!params.value) {\n return '<a style=\"font-weight:600\" href=\"/opportunities/'+params.data.id+'\">[No Name]</a>';\n } \n else if (params.value == null) {\n return '<a style=\"font-weight:600\" href=\"/opportunities/'+params.data.id+'\">[No Name]</a>';\n }\n else { \n return '<a style=\"font-weight:600\" href=\"/opportunities/'+params.data.id+'\">' +params.data.name+'</a>';\n }\n }", "function showInformation(marker){\n document.getElementById(\"property-name\").innerHTML = \"<b>Properity Name</b>: \" + marker.data.property_name;\n document.getElementById(\"property-type\").innerHTML = \"<b>Properity Type</b>: \" + marker.data.property_type;\n document.getElementById(\"community-area-name\").innerHTML = \"<b>Community Area Name</b>: \" + marker.data.community_area;\n document.getElementById(\"address\").innerHTML = \"<b>Address</b>: \" + marker.data.address;\n document.getElementById(\"management_company\").innerHTML = \"<b>Management Company</b>: \" + marker.data.management_company;\n document.getElementById(\"phone-number\").innerHTML = \"<b>Phone Number</b>: \" + marker.data.phone_number;\n}", "function showPool(index, pool)\r\n{\r\n\t//TODO : rewrite this\r\n\tconsole.log('Id : ' + pool.index);\r\n\tconsole.log('State : ' + (pool.ended ? (pool.terminated ? (pool.moneySent ? \"money sent\" : \"winner picked\") : \"ended, waiting to pick winner\") : \"open\"));\r\n\tconsole.log('TicketPrice : ' + pool.ticketPrice.toString(10));\r\n\tconsole.log('CurrAmount : ' + pool.currAmount.toString(10));\t\r\n\tconsole.log('StartDate : ' + pool.startDate);\r\n\tconsole.log('Duration : ' + (pool.duration * 15) + ' s');\r\n\tconsole.log('EndDate : ' + pool.endDate);\r\n\tconsole.log('Winner : ' + pool.winner);\r\n}", "function viewEmp() {\n db.displayEmployeeData()\n .then(([data]) => {\n console.log(`${separator}${separator}\\n EMPLOYEES\\n${separator}${separator}`);\n console.table(data);\n console.log(`${separator}\\n`);\n })\n .then(() => {\n promptAction();\n })\n}", "function showEventDetails(event) {\n //Clear the details div\n this.clearDetailsDiv();\n\n //Show the details div\n document.getElementById(\"ONEUPGRID_details\").style.top = \"75px\";\n\n //Set the details div state\n this.detailsDivState = 1;\n\n //Populate the Title div details - title, location, and map div\n document.getElementById(\"ONEUPGRID_details_title_h1\").innerText = event.title;\n document.getElementById(\"ONEUPGRID_details_title_h2\").innerText = event.location1 + \", \" + event.location2;\n\n //Populate the Info Div\n document.getElementById(\"ONEUPGRID_details_category_div\").innerHTML = \"<b>Category: </b>\" + Utilities.getCategoryStringFromId(event.category);\n document.getElementById(\"ONEUPGRID_details_cost_div\").innerHTML = \"<b>Cost: </b>\" + event.cost;\n document.getElementById(\"ONEUPGRID_details_transportation_div\").innerHTML = \"<b>Getting There: </b>\" + event.transportation;\n document.getElementById(\"ONEUPGRID_details_description_div\").innerHTML = event.description;\n\n //Populate the Tips Div\n var tipsListElement = document.getElementById(\"ONEUPGRID_details_tips_ul\");\n\n //For each tip\n for (var i = 0; i < this.getEventById(this.selectedEventId).tips.length; i++) {\n var tempLi = document.createElement(\"li\");\n tempLi.innerText = this.getEventById(this.selectedEventId).tips[i];\n tipsListElement.appendChild(tempLi);\n }\n\n //Populate the Third Party Tip Providers\n this.populateTipsActions();\n\n //If necessary, populate the website link\n if (this.getEventById(this.selectedEventId).website != null) {\n var websiteButton = document.createElement(\"div\");\n websiteButton.id = \"ONEUPGRID_details_website\";\n websiteButton.classList.add(\"ONEUPGRID_details_title_action_div\");\n websiteButton.innerText = \"View Website\";\n document.getElementById(\"ONEUPGRID_details_title_div\").appendChild(websiteButton);\n this.AttachOnClick(websiteButton, \"ONEUPGRID_details_actions_link_click\");\n }\n }", "populateDetails() {\n const { restaurantHoursContainer } = this.pageElements;\n const { operating_hours: operatingHours } = this.restaurant;\n\n restaurantHoursContainer.appendChild(generateHoursHtml(operatingHours));\n }", "function showTeamDetails(context) {\n context.loggedIn = sessionStorage.getItem('authtoken') !== null;\n context.username = sessionStorage.getItem('username');\n context.teamId = context.params._id.substring(1);\n context.isOnTeam = sessionStorage.getItem('teamId') !== \"undefined\"\n && sessionStorage.getItem('teamId') === context.teamId;\n\n auth.getUsers()\n .then(resp => {\n context.members = resp.filter((key) => key.teamId === context.teamId);\n\n this.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs',\n teamMember: './templates/catalog/teamMember.hbs',\n teamControls: './templates/catalog/teamControls.hbs'\n }).then(function () {\n teamsService.loadTeamDetails(context.teamId)\n .then(res => {\n context.isAuthor = sessionStorage.getItem('userId') === res._acl.creator;\n context.name = res.name;\n context.comment = res.comment;\n\n this.partial('./templates/catalog/details.hbs');\n }).catch(auth.handleError);\n });\n\n }).catch(auth.handleError);\n }", "function showDetails(placeResult, marker, status) {\n let info;\n if (currentInfoWindow != null) {\n info = \"\";\n }\n if (status === google.maps.places.PlacesServiceStatus.OK){\n let placeInfoWindow = new google.maps.InfoWindow();\n let rating = \"None\";\n if(placeResult.rating) rating = placeResult.rating\n if(placeResult.formatted_address) placeAddress = placeResult.formatted_address;\n if(placeResult.vicinity) placeAddress = placeResult.vicinity;\n info = info + '<div class=\\\"infowindow\\\"><p class=\\\"details\\\"><strong>' + placeResult.name + '<br>' + 'Rating:' + rating + '<span class=\\\"star\\\">\\u272e</span></strong></p>';\n updateContent(placeInfoWindow, info, marker)\n }\n }", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-li-1\").text(\"Generation: \" + data.generation.name)\n $(\".modal-li-2\").text(\"Effect: \" + data.effect_changes[0].effect_entries[1].effect)\n $(\".modal-li-3\").text(\"Chance: \" + data.effect_entries[1].effect)\n $(\".modal-li-4\").text(\"Bonus Effect: \" + data.flavor_text_entries[0].flavor_text)\n }", "function getShortDoctorDetails(data) {\n console.log(data);\n var detailsDiv = $(\"<div>\").addClass(\"detail-content\");\n var html = '<p><b>Name: </b>' + data.name + '</p>' +\n '<p><b>Speciality: </b>' + data.speciality + '</p>' +\n '<p><b>Address: </b>' + data.address + '</p>' +\n '<p><b>Phone: </b>' + data.phone + '</p>' +\n '<p><b>Full details: </b>' + '<a target=\"_blank\" href=\"./doctor-details.html?id='+data.id+'\">Link</a></p>';\n return detailsDiv.html(html);\n\n}", "function showDetails(pokemon) {\n //Hide modal while fetching details from PokeAPI\n const modal = document.querySelector('.modal');\n modal.classList.add('invisible');\n\n loadDetails(pokemon).then(function () {\n const modalTitle = document.querySelector('.modal-title');\n const modalBody = document.querySelector('.modal-body');\n modalBody.classList.add('pb-2');\n const modalFooter = document.querySelector('.modal-footer');\n\n //Clear existing modal\n modalTitle.innerHTML = '';\n modalBody.innerHTML = '';\n modalFooter.innerHTML = '';\n\n //Build modal by section\n const pokePortrait = document.createElement('img');\n pokePortrait.classList.add('modal__image', 'col-4', 'p-0', 'mx-auto');\n pokePortrait.src = pokemon.imageUrl;\n pokePortrait.setAttribute(\n 'alt',\n 'A \"high resolution\" sprite of ' + pokemon.name\n );\n\n const modalDetails = document.createElement('div');\n modalDetails.classList.add(\n 'modal__details',\n 'col-sm-8',\n 'p-sm-0',\n 'text-center'\n );\n\n const pokemonName = document.createElement('h1');\n pokemonName.classList.add('modal__details--item');\n pokemonName.innerHTML = pokemon.name;\n\n const pokemonSpeciesType = document.createElement('p');\n pokemonSpeciesType.classList.add(\n 'modal__details--item',\n 'mb-2',\n 'mb-sm-3'\n );\n pokemonSpeciesType.innerHTML = pokemon.speciesType;\n\n const pokemonWeight = document.createElement('p');\n pokemonWeight.classList.add('modal__details--item', 'mb-2', 'mb-sm-3');\n pokemonWeight.innerHTML = 'Height: ' + pokemon.height + 'm';\n\n const pokemonHeight = document.createElement('p');\n pokemonHeight.classList.add('modal__details--item', 'mb-2', 'mb-sm-3');\n pokemonHeight.innerHTML = 'Weight: ' + pokemon.weight + 'kg';\n\n const pokemonType = document.createElement('p');\n pokemonType.classList.add(\n 'pokemon-type',\n 'modal__details--item',\n 'mb-2',\n 'mb-sm-3'\n );\n pokemonType.innerHTML = pokemon.types;\n\n const pokemonDescription = document.createElement('p');\n pokemonDescription.classList.add('modal__description');\n pokemonDescription.innerHTML = pokemon.flavorText;\n\n //Build modal structure\n modalTitle.innerHTML = pokemon.name;\n modalDetails.append(\n pokemonSpeciesType,\n pokemonHeight,\n pokemonWeight,\n pokemonType\n );\n modalBody.append(pokePortrait, modalDetails);\n modalFooter.append(pokemonDescription);\n modal.classList.remove('invisible');\n });\n }", "function showDetails(placeResult, marker, status) {\n console.log(placeResult);\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n let placeInfowindow = new google.maps.InfoWindow();\n let rating = \"None\";\n if (placeResult.rating) rating = placeResult.rating;\n placeInfowindow.setContent('<div><strong>' + placeResult.name +\n '</strong><br>' + 'Rating: ' + rating + '</div>');\n placeInfowindow.open(marker.map, marker);\n currentInfoWindow.close();\n currentInfoWindow = placeInfowindow;\n showPanel(placeResult);\n } else {\n console.log('showDetails failed: ' + status);\n }\n }", "function Details() {\r\n}", "function showVehiclePopup(v) {\n if (v.poi) {\n html = '<h4>' + v.name + '</h4><p>' + v.position.time_of_day + '</p><p>' + v.position.occurred_at.substring(0, 10) + '</p>';\n \n MapPane.popup(v.poi, html);\n }\n }", "function viewDepts() {\n let query = `SELECT id as ID, name as \"DEPARTMENT NAME\" FROM department;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function showOne(req, res) {\n\tvar placeId = req.params.placeId;\n\t db.Place.findById(placeId, function(err, foundPlace) {\n\t\t\t res.json(foundPlace);\n\t });\n}", "function showInfo(pillName) {\n fetch(`http://ec2-3-96-185-233.ca-central-1.compute.amazonaws.com:3000/pills/single?userId=${firebase.auth().currentUser.uid}&name=${pillName}`, {\n method: 'GET',\n })\n .then((response) => response.json())\n .then((responseJson) => {\n console.log(\"Response from server is (and going to pillinfo)\", responseJson['pill']);\n navigation.navigate(\"PillInfo\", {pillInfo: responseJson['pill']});\n })\n .catch((error) => {\n console.error(error);\n });\n }", "function loadDetailedView(prop) {\n current_prop = prop;\n enablePropertyOptions();\n $(\"#mortgagebtn\").unbind();\n var property = prop.card;\n $(\"#propDetails\").html(\" \");\n var detailedView = $(\"<div>\").addClass(\"propertyCard\");\n var titleDeed = $(\"<div>\").addClass(\"titleDeed\");\n var mortgaged = $(\"<div>\").addClass(\"mortgaged\").html(\"MORTGAGED\");\n if (prop.mortgaged) mortgaged.show();\n titleDeed.append(mortgaged);\n var titleTextColor = \"black\";\n if (property.color === \"blue\" || property.color === \"purple\") {\n titleTextColor = \"white\";\n }\n var details;\n var costTable;\n if (property.color === \"rr\") { // handle railroad\n titleDeed.append($(\"<div>\").addClass(\"railroadImg\"));\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(\"railroad\")\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\")\n .addClass(\"railroad\");\n details.append($(\"<div>\").addClass(\"rentDisplay\")\n .html(property.rent + \".\"));\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n costTable = $(\"<table>\").addClass(\"railroad\");\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 2 R.R.'s are owned\"),\n $(\"<td>\").html(\"$ \" + property.tworr + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 3 &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\"\"),\n $(\"<td>\").html(property.threerr + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 4 &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\"\"),\n $(\"<td>\").html(property.fourrr + \".\")));\n houseCosts.append(costTable);\n\n details.append(houseCosts);\n details.addClass(\"railroad\");\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n\n } else if (property.color === \"utility\") { // duquesne light or PWSA\n if (property.title.indexOf(\"Light\") != -1) {\n titleDeed.append($(\"<div>\").addClass(\"electricImg\"));\n } else {\n titleDeed.append($(\"<div>\").addClass(\"waterImg\"));\n }\n\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(\"utility\")\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\")\n .addClass(\"utility\");\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n costTable = $(\"<div>\").addClass(\"utilityCostTable\");\n costTable.append($(\"<span>\").addClass(\"utilityText\")\n .html(\"If one \\\"Utility\\\" is owned rent is 4 times amount shown on dice.\"));\n costTable.append($(\"<span>\").addClass(\"utilityText\")\n .html(\"If both \\\"Utilities\\\" are owned rent is 10 times amount shown on dice.\"));\n houseCosts.append(costTable);\n\n details.append(houseCosts);\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n\n } else { // handle regular property\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(property.color)\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\");\n details.append($(\"<div>\").addClass(\"rentDisplay\")\n .html(property.rent + \".\"));\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n var costTable = $(\"<table>\");\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 1 House\"),\n $(\"<td>\").html(\"$ \" + property.onehouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 2 Houses\"),\n $(\"<td>\").html(property.twohouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 3 Houses\"),\n $(\"<td>\").html(property.threehouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 4 Houses\"),\n $(\"<td>\").html(property.fourhouse + \".\")));\n houseCosts.append(costTable);\n details.append(houseCosts);\n\n details.append($(\"<div>\").addClass(\"hotel\")\n .html(property.hotel + \".\"));\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"houses\")\n .html(property.housecost + \".\"));\n details.append($(\"<div>\").addClass(\"hotelCost\")\n .html(property.hotelcost + \".\"));\n details.append($(\"<div>\").addClass(\"monopoly\")\n .html(\"If a player owns ALL the Lots of any Color-Group, the rent is Doubled on Unimproved Lots in that group.\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n }\n\n\n titleDeed.append(details);\n detailedView.append(titleDeed);\n detailedView.hide();\n $(\"#propDetails\").append(detailedView);\n var widthPercent = (document.documentElement.clientWidth * 0.40) / 440;\n var heightPercent = (document.documentElement.clientHeight) / 520;\n var percentScale = (widthPercent > heightPercent) ? heightPercent : widthPercent;\n $(\"#propDetails .propertyCard\").css(\"-webkit-transform\", \"scale(\" + percentScale + \")\");\n $(\"#propDetails .propertyCard\").css(\"transform\", \"scale(\" + percentScale + \")\");\n $(\"#propDetails .propertyCard\").css(\"-ms-transform\", \"scale(\" + percentScale + \")\");\n\n detailedView.show();\n setupMortgageBtn(prop);\n setupHouseButtons();\n\n // Send currently viewed property to the server so the board can update\n socket.emit('inspectProperty', {\n fbid: window.fbid,\n property: propertyDatabase[property.title].id\n });\n}", "function showDetail() {\n showModal('detail.html');\n}", "function showDetails({bookTitle, price}){\n console.log(`Name: ${bookTitle}, price: ${price} `)\n }", "function getInfo() {\n alert(\n \"Start adding new places by clicking on the map. Please don't give the same title for multiple places.\" +\n \" You can update information on existing place or remove the place from the map.\" +\n \" You can also search from added places by the title. Please use the whole title when searching.\"\n );\n}", "function showMyTeamDetails(context) {\n const myTeamId = sessionStorage.getItem('teamId');\n context.redirect(`#/catalog/:${myTeamId}`);\n }", "function showDetails(event, pokemon) {\n const url = pokemon.detailsUrl;\n $.ajax(url, {\n method: 'GET',\n dataType: 'json'\n }).then(function(details) {\n //console.log(details); //would print particular pokemon (object)'s detail\n pokemon.imageUrl = details.sprites.front_default;\n pokemon.height = details.height;\n pokemon.weight = details.weight;\n\n // $('.modal-title').text(`Hi! I'm ${pokemon.name}`);\n $('.modal-title').text('Hi! I\\'m ' + pokemon.name);\n\n const modalDiv = $('<div></div>'),\n // let modalElementImg = $(`<img src=\"${pokemon.imageUrl}\" alt=\"${pokemon.name}'s Image\">`);\n modalElementImg = $('<img src=\"' + pokemon.imageUrl + '\" alt=\"' + pokemon.name + '\\'s Image\">'),\n modalElementHeight = $('<p></p>').text('Height : ' + pokemon.height / 10 + ' m.'),\n modalElementWeight = $('<p></p>').text('Weight : ' + pokemon.weight / 10 + ' kg.');\n\n modalDiv.append(modalElementImg)\n .append(modalElementHeight)\n .append(modalElementWeight);\n\n $('.modal-body').html(modalDiv);\n\n }).catch(function(e) {\n console.error(e);\n });\n }", "function getById(){\n var id = $scope.profile._id\n advisor.getById(id).then(function (response){\n if(response.data.success){\n $scope.advisorData = response.data.data\n $scope.advisorData.address = response.data.data.address[0]\n //$scope.advisorData.use_logo = $scope.advisorData.use_logo.toString();\n console.log($scope.advisorData)\n }\n })\n }", "function viewProject(elmnt){\n var title = projects[elmnt.id].title;\n var desc = projects[elmnt.id].desc;\n var date = projects[elmnt.id].date;\n var products = projects[elmnt.id].products;\n displayModal(title, desc, date, products, elmnt.id);\n}", "function showDetails(placeResult, marker) {\n let placeInfowindow = new google.maps.InfoWindow();\n let rating = \"None\";\n let placePhoto = placeResult.photos[0].getUrl();\n if (placeResult.rating) rating = placeResult.rating;\n placeInfowindow.setContent(\n `<div>\n <div style=\"text-transform: uppercase; color: #8e2be2\"><b>${placeResult.name}</b></div>\n <br>\n <img src=\"${placePhoto}\" alt=\"${placeResult.name}\" id=\"info-window-img\">\n <br>\n Rating: ${rating}\n <br>\n <a href=\"${placeResult.website}\" target=\"_blank\" style=\"color: #05e680\">Website</a>\n <br>\n </div>`);\n placeInfowindow.open(marker.map, marker);\n}", "function viewDept() {\n db.selectAllDepartments()\n .then(([data]) => {\n console.log(`${separator}\\n DEPARTMENTS\\n${separator}`);\n console.table(data);\n console.log(`${separator}\\n`);\n })\n .then(() => {\n promptAction();\n })\n}", "function showRights(individual) {\n\t\t// Ignore individuals without id\n\t\tif (individual.id === undefined || individual.id === '' || individual.id === '_') return;\n\t\tvar container = $($(\"#show-rights-modal-template\").html());\n\t\tcontainer.modal();\n\n\t\t$(\"body\").append(container);\n\t\t\n\t\tvar rights = individual['rights'];\n\t\tvar holder = $(\"<div>\");\n\t\trights.present(holder);\n\t\tholder.appendTo($(\".modal-body\", container));\n\n\t\tvar origin = individual['rightsOrigin'];\t\t\t\t\t\t\n\t\torigin.forEach(function (rightRecord) {\n\t\t\tvar holder = $(\"<div>\");\n\t\t\trightRecord.present(holder);\n\t\t\tholder.appendTo($(\".modal-body\", container));\n\t\t});\t\t\t\n\t}", "function getDetails(obj) {\n alert(obj.getInfo());\n}", "function showAirOpSources() {\n var op = editingOpIdx == -1 ? newOp : airOps[editingOpIdx],\n dlgHtml = getAirOpMissionRowHtml() +\n \"<tr><td colspan=\\\"2\\\" class=\\\"right\\\" style=\\\"font-weight: bold\\\">Available aircraft:</td><td colspan=\\\"6\\\"></td></tr>\";\n \n for (var i = 0; i < op.AirOpSources.length; i++) {\n dlgHtml += getAirOpSourceRowHtml(op.AirOpSources[i]);\n }\n $(\"#airopplanes\").html(dlgHtml);\n}", "function findDetail(place) {\n // return promise\n return new Promise(function (resolve, reject) {\n // use getDetails method to retrieve Place data via the Place's place_id property\n service.getDetails({\n placeId: place.place_id\n }, function (place, status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n //console.log(place.opening_hours.weekday_text);\n for (var j = 0; j < place.opening_hours.weekday_text.length; j++) {\n console.log(place.opening_hours.weekday_text[j]);\n\n }\n resolve(place);\n } else {\n // else reject with status\n reject(status);\n }\n });\n });\n}", "function showdetails(x){\n setShow(true);\n setModalData(dataArr[x]);\n console.log(dataArr[x].origin.name);\n }", "function showDetails(placeResult, marker, status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) { //Show info window when user clicks on a marker\n let placeInfowindow = new google.maps.InfoWindow();\n const newLocal = \"<div>\";\n placeInfowindow.setContent(\n '<h4>' +\n placeResult.name +\n '</h4>' +\n \"<b>Address:</b> \" +\n \"<div>\" +\n placeResult.formatted_address +\n \"</div>\" +\n \"<div>\" +\n \"<b>Phone no:</b> \" +\n placeResult.formatted_phone_number +\n \"</div>\" +\n \"<div>\" +\n \"<b>Website:</b> \" +\n placeResult.website +\n \"</div>\" +\n \"<div>\" +\n \"<b>Rating:</b> \" +\n placeResult.rating +\n \"</div>\" +\n \"<div>\" +\n \"<b>Price level:</b> \" +\n placeResult.price_level +\n \"</div>\"\n );\n placeInfowindow.open(marker.map, marker);\n currentInfoWindow.close();\n currentInfoWindow = placeInfowindow;\n\n showDetails(placeResult);\n } else {\n console.log(\"showDetails failed: \" + status);\n }\n}", "function getPlaceDetails(map, restaurantChoice){\n const request = {\n placeId: restaurantChoice.place_id,\n fields: [\"name\", \"formatted_address\", \"formatted_phone_number\", \"place_id\", \"geometry\", \"opening_hours\", \"website\", \"icon\", \"rating\"]\n };\n const infowindow = new google.maps.InfoWindow();\n const service = new google.maps.places.PlacesService(map);\n\n document.getElementById(\"result-restaurant\").style.visibility = 'hidden';\n document.getElementById(\"address\").innerHTML = \"\";\n document.getElementById(\"phone\").innerHTML = \"\";\n document.getElementById(\"website\").innerHTML = \"\";\n document.getElementById(\"rating\").innerHTML = \"\";\n\n service.getDetails(request, (place, status) => {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n const marker = new google.maps.Marker({\n map,\n position: place.geometry.location\n });\n choiceMarkers.push(marker);\n\n console.log(\"place \" + place.name);\n if (place.name) {\n document.getElementById(\"result-restaurant\").style.visibility = 'visible';\n \n document.getElementById(\"places\").innerHTML = place.name;\n if(place.formatted_phone_number) {\n document.getElementById(\"address\").innerHTML = '<i class=\"lni lni-restaurant\"></i> Address : ' + place.formatted_address;\n } else {\n document.getElementById(\"address\").innerHTML = \"\";\n }\n if(place.formatted_phone_number) {\n document.getElementById(\"phone\").innerHTML = '<i class=\"lni lni-phone\"></i> Phone : ' + place.formatted_phone_number;\n } else {\n document.getElementById(\"phone\").innerHTML = \"\";\n }\n if (place.website) {\n if (place.website.length > 80) {\n document.getElementById(\"website\").innerHTML = 'Website : <a href=\"' + place.website.substring(0, 80) + '\">Click here!</a>';\n } else {\n document.getElementById(\"website\").innerHTML = 'Website : <a href=\"' + place.website + '\">Click here!</a>';\n }\n } else {\n document.getElementById(\"website\").innerHTML = \"\";\n }\n if (place.rating) {\n // <i class=\"lni lni-star\"></i>\n document.getElementById(\"rating\").innerHTML = '<i class=\"lni lni-star\"></i> Rating : ' + place.rating;\n } else {\n document.getElementById(\"rating\").innerHTML = \"\";\n }\n } else {\n console.log(\"No Restaurant found\")\n document.getElementById(\"places\").innerHTML = \"Oops! You're too picky, please try another search (choose another location, widen the radius, or change your filters)!\";\n document.getElementById(\"address\").innerHTML = \"\";\n document.getElementById(\"phone\").innerHTML = \"\";\n document.getElementById(\"website\").innerHTML = \"\";\n document.getElementById(\"rating\").innerHTML = \"\";\n }\n google.maps.event.addListener(marker, \"click\", function() {\n infowindow.setContent(\n \"<div><strong>\" +\n place.name +\n \"</strong><br>\" +\n place.formatted_address +\n \"</div>\"\n );\n infowindow.open(map, this);\n });//eventListener\n\n }//if OK\n });\n}//getPlaceDetails", "renderDetails() {\r\n console.log(`${this.name}: ${this.role}`);\r\n }", "function storeOpportunityDetails(opportunityObj){\n\tlocalStorage.konyOpportunityDetails = JSON.stringify(opportunityObj); //storing the corresponding opportunity details in localstorage\n\twindow.location.href = \"opportunityDetails.html\"; //redirecting to details page\n}", "function showDetails(item) {\n dogRepository.loadDetails(item).then(function() {\n return item;\n }).then(function(item) {\n showModal(item);\n });\n}", "function show(req, res) {\n\tvar cityName = req.params.cityId;\n db.Place.find({cityName: cityName})\n\t.exec(function(error, places) {\n\t\tif (error) { res.send(error) };\n\t\tres.json(places);\n });\n}", "* detailsPrint (request, response) {\n const categories = yield Category.all(),\n result = yield Result.get(request.param('id')),\n user = yield request.auth.getUser(),\n type = request.input('type'),\n date = moment().format('YYYY-mm-DD hh:mm:ss')\n\n result.sortCandidates((a, b) => {\n return result.getJudgesAverage(b.id) - result.getJudgesAverage(a.id)\n })\n\n if (type == 'winner') {\n result.sliceTop(1)\n }\n\n if (type == 'top-5') {\n result.sliceTop(5)\n }\n\n yield response.sendView('dashboard/score/details_print', {\n categories, result, user, date\n })\n }", "showInfoProduct(product) {\n if (product.status) {\n return <h3>\n ID: {product.id} <br />\n Name: {product.name} <br />\n Price: {product.price} VNĐ <br />\n Status: {product.status ? 'Active' : 'Pending'}\n </h3>\n }\n }", "getDetails(marker) {\n var call = this;\n //foursqquare api is used for fetching informations\n var clientId = \"F1CKEDRNW20PL2AUGX5UGQJXUGQ3IFYP3W3NV4U1TGNADZ1H\";\n var clientSecret = \"S0QVTQU0ZL3OEXUBQAS14HHDLA44NRHISAXWO0BG4SLNQALA\";\n var url = \"https://api.foursquare.com/v2/venues/search?client_id=\" + clientId + \"&client_secret=\" + clientSecret + \"&v=20130815&ll=\" + marker.getPosition().lat() + \",\" + marker.getPosition().lng() + \"&limit=1\";\n fetch(url)\n .then(\n function (response) {\n if (response.status !== 200) {\n call.state.infowindow.setContent(\"Data not loading... \");\n document.write(\"data doesn't load correctly...\");\n return;\n }\n //using response from foursquare we are placing informations in infowindow\n response.json().then(function (data) {\n var obtained_data = data.response.venues[0];\n var loc_name = '<b>Name : </b>' + (obtained_data.name) + '<br>';\n var loc_cat = '<b>category : </b>' + (obtained_data.categories[0].name) + '<br>';\n\n var readMore = '<a href=\"https://foursquare.com/v/' + obtained_data.id + '\" target=\"_blank\">View for Details</a>'\n call.state.infowindow.setContent(loc_name + loc_cat + readMore); \n });\n }\n )\n .catch(function (err) {\n document.write(\"Error happened in Data loading\");\n });\n }" ]
[ "0.6864376", "0.6244238", "0.6145558", "0.58991754", "0.58604413", "0.58328044", "0.578931", "0.573019", "0.5721313", "0.56971484", "0.5692121", "0.5654901", "0.5588213", "0.5584418", "0.5581117", "0.55611485", "0.55573285", "0.55573285", "0.55573285", "0.5531864", "0.55214214", "0.5516404", "0.54974216", "0.54884726", "0.54831403", "0.54821664", "0.5479125", "0.5468783", "0.54666907", "0.5456203", "0.54473174", "0.54337555", "0.54260945", "0.5413081", "0.5410972", "0.540078", "0.54003793", "0.5369812", "0.5365989", "0.5352519", "0.5347758", "0.5335479", "0.5333011", "0.53289104", "0.5323054", "0.5313959", "0.5310643", "0.5301484", "0.5298108", "0.529211", "0.52893585", "0.5283514", "0.527803", "0.52743775", "0.52661014", "0.52537745", "0.5249448", "0.52445024", "0.5238608", "0.523159", "0.52213293", "0.51900315", "0.5185656", "0.5164447", "0.51643515", "0.5158011", "0.5149216", "0.51454085", "0.51443946", "0.5143127", "0.5138418", "0.51327664", "0.5125513", "0.5122943", "0.5121194", "0.5111906", "0.510928", "0.5107716", "0.51075363", "0.5106838", "0.5105062", "0.50850093", "0.5083686", "0.5083422", "0.5082502", "0.5078801", "0.50709903", "0.50644773", "0.5061876", "0.50531113", "0.5044501", "0.50397396", "0.5036947", "0.50358033", "0.50356144", "0.50340515", "0.5029053", "0.50202245", "0.501956", "0.5011907", "0.50093395" ]
0.0
-1
This function converts an opportunity into sale and shows sales
function convertToSale(itemID) { $('#AllOpps').hide(); $('#OppDetails').hide(); clearEditOppForm(); currentItem.set_item("_Status", "Sale"); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearEditOppForm(); showSales(); } , function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "populateSale(sale) {\n $.each(sale, (key, sala) => {\n $(\".saleTbody\").append('<tr class= \"saleTr\"><td class=\"nomeSala\">' + sala.Nome + '</td><td class=\"nomeEdificio\">' + sala.NomeEdificio + '</td><td class=\"stato\">' + sala.Stato + '</td></tr>');\n $(\".saleTbody\").append('<tr><td class=\"numeroPostiDisponibili\" colspan=\"3\"><h6> Numero posti disponibili: </h6>' + sala.NumeroPostiDisponibili + '</td></tr>');\n });\n $('.saleTr').click(function () {\n $(this).nextUntil('.saleTr').toggleClass('hide');\n }).click();\n }", "function viewDeptSales() {\n salesByDept();\n}", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function salesByProduct(products, lineItems){\n //TODO\n}", "function totalSale(){\n\n console.log(sale.name);\n}", "executeSale(amt, hierarchyName, planName){\n const hierarchy = this.hierarchies[hierarchyName];\n const plan = this.plans[planName].percents;\n let commissions = {\n total: 0,\n agentsWithSaleCommission: {},\n saleStrings: [], //this is an easy way to print out information about the commissions\n }\n ;\n if(hierarchy && plan){\n let i = 0; //for tracking percent in the plan\n hierarchy.agentsInOrder.forEach((agentName) => {\n let percent;\n if(i >= plan.length){\n //If the plan has less percents than agents, assume those agents receive nothing.\n percent = 0;\n } else {\n percent = plan[i];\n }\n\n const agent = this.agents[agentName];\n let commission = agent.commissionPercent * percent * amt;\n commission = parseFloat(commission.toFixed(2)); //needed due to float imprecision\n commissions.total += commission;\n commissions.agentsWithSaleCommission[agentName] = commission;\n\n //Generate string\n commissions.saleStrings.push(\n `${i === 0 ? 'Selling Agent':`Super Agent ${i}`} (${agent.name}) gets `+\n `${percent * 100}% of the agent commission % of policy amount = `+\n `${parseFloat((percent * 100).toFixed(2))}% * ${parseFloat((agent.commissionPercent * 100).toFixed(2))}% * ${amt} = ${commission}`\n );\n\n i++;\n })\n } else {\n throw new Error('Unknown Hierarchy or Plan');\n }\n\n return commissions;\n }", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function totalSales(products, lineItems){\n //TODO\n\n}", "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function updateSales(sales) {\n\tvar salesDiv = document.getElementById(\"sales\");\n\n\tfor (var i = 0; i < sales.length; i++) {\n\t\tvar sale = sales[i];\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.setAttribute(\"class\", \"saleItem\");\n\t\tdiv.innerHTML = sale.name + \" sold \" + sale.sales + \" gumbaslls\";\n\t\tsalesDiv.appendChild(div);\n\t}\n\t\n\tif (sales.length > 0) {\n\t\tlastReportTime = sales[sales.length-1].time;\n\t}\n}", "function viewProductSales() {\n connection.query(\n 'SELECT department_id, departments.department_name, over_head_costs, sum(product_sales) as product_sales, sum(product_sales) - over_head_costs as total_profit FROM products right join departments on products.department_name=departments.department_name group by department_id, products.department_name, over_head_costs',\n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "function saleToggle(event) {\n // console.log(event);\n if (event.target.name === 'sale') {\n currentInventory.beers[event.target.id].toggleSale();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "function viewSales() {\n // This was the hardest part of the whole assignment (I know if I say that this query slightly intimidates me with its complexity that whoever is grading this will just laugh to themselves)\n connection.query(\"SELECT id AS ID, name AS Department_Name, over_head_costs AS Overhead_Costs, Product_Sales, (newTable.Product_Sales - departments.over_head_costs) AS Total_Sales FROM departments LEFT JOIN (SELECT sum(product_sales) AS Product_Sales, department_name FROM products GROUP BY department_name) AS newTable ON departments.name = newTable.department_name;\", function (error, results) {\n // Format the table a bit better\n // This is mostly to get better column names and to format dollar amounts\n let formatted = [];\n for (let i = 0; i < results.length; i++) {\n let obj = {\n ID: results[i].ID,\n \"Department Name\": results[i].Department_Name,\n \"Overhead Costs\": parseFloat(results[i].Overhead_Costs).toLocaleString('en-US', { style: 'currency', currency: 'USD' }),\n \"Product Sales\": parseFloat(results[i].Product_Sales).toLocaleString('en-US', { style: 'currency', currency: 'USD' }),\n \"Total Sales\": parseFloat(results[i].Total_Sales).toLocaleString('en-US', { style: 'currency', currency: 'USD' })\n };\n formatted.push(obj);\n }\n\n // Display the table\n console.log(\"\\n********************************************\");\n console.table(formatted);\n console.log(\"********************************************\\n\");\n\n // Ask the user again what they would like to do\n start();\n });\n}", "function showSales() {\n //Highlight selected tile\n $('#LeadsTile').css(\"background-color\", \"#0072C6\");\n $('#OppsTile').css(\"background-color\", \"#0072C6\");\n $('#SalesTile').css(\"background-color\", \"orange\");\n $('#LostSalesTile').css(\"background-color\", \"#0072C6\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n var hasSales = false;\n hideAllPanels();\n var saleList = document.getElementById(\"AllSales\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Success returned from executeQueryAsync\n var saleTable = document.getElementById(\"SaleList\");\n\n // Remove all nodes from the sale <DIV> so we have a clean space to write to\n while (saleTable.hasChildNodes()) {\n saleTable.removeChild(saleTable.lastChild);\n }\n // Iterate through the Propsects list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n // Create a DIV to display the organization name\n var sale = document.createElement(\"div\");\n var saleLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n sale.appendChild(saleLabel);\n\n // Add an ID to the sale DIV\n sale.id = listItem.get_id();\n\n // Add an class to the sale DIV\n sale.className = \"item\";\n\n // Add an onclick event to show the sale details\n $(sale).click(function (sender) {\n showSaleDetails(sender.target.id);\n });\n\n saleTable.appendChild(sale);\n hasSales = true;\n }\n }\n if (!hasSales) {\n var noSales = document.createElement(\"div\");\n noSales.appendChild(document.createTextNode(\"There are no sales. You can add a new sale from here.\"));\n saleTable.appendChild(noSales);\n }\n $('#AllSales').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get sales. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#SaleList').fadeIn(500, null);\n });\n}", "function calculateSales(salesData){\n var totalSales = 0;\n for (var sale in salesData){\n totalSales = totalSales + salesData[sale];\n }\n return totalSales;\n}", "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "function viewProductsSaleDepartment() {\n console.log(\"======================\")\n console.log(chalk.green(\"View Product Sales by Department\"));\n\n connection.query(\"DROP TABLE bamazon.departments\", function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"CREATE TABLE departments (department_id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(100) NULL, over_head_costs INT(10) NULL,product_sales INT(10) NULL, PRIMARY KEY(department_id));\",\n function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"SELECT * FROM products\", function (err, results) {\n\n for (var i = 0; i < results.length; i++) {\n\n var sale_quantity = results[i].product_sales / results[i].price;\n // console.log(`[${i}] || ${sale_quantity}`);\n var profit = results[i].product_sales * 0.20;\n var overheadcosts = results[i].product_sales - profit;\n // console.log(`[${i}] || ${profit}`);\n\n connection.query(\"INSERT INTO departments SET ?\",\n {\n department_name: results[i].department_name,\n over_head_costs: overheadcosts,\n product_sales: results[i].product_sales\n },\n function (err, res) {\n if (err) throw err;\n // console.log(res.affectedRows + \" product inserted!\\n\");\n\n }\n );\n }\n connection.query(\"SELECT department_name, sum(over_head_costs) as over_head_costs, sum(product_sales) as product_sales FROM Bamazon.departments GROUP BY department_name;\",\n function (err, results) {\n if (err) throw err;\n\n var values = [];\n for (var i = 0; i < results.length; i++) {\n var totalprofit = results[i].product_sales - results[i].over_head_costs;\n // console.log(totalprofit);\n values.push([i + 1, results[i].department_name, results[i].over_head_costs, results[i].product_sales, totalprofit]);\n // console.log([i+1]+\"\\t\"+results[i].department_name + \"\\t\" + results[i].over_head_costs + \"\\t\" + results[i].product_sales + \"\\t\" + totalprofit);\n }\n // console.log(values);\n console.log(\"\\n-------------------------------------------------------------------------\");\n console.table(['ID', 'Department Name', 'Over Head Costs', 'Product Sales', 'Profit'], values);\n\n Start();\n });\n\n console.log(\"===================\");\n // Start();\n });\n\n}", "function showSale(){ \n // clear the console\n console.log('\\033c');\n // displaying the product list\n console.log(`\\x1b[7m Product Sales By Department \\x1b[0m`);\n // creating the query string\n var query = 'SELECT D.department_id AS \"DeptID\", D.department_name AS \"Department\", D.over_head_costs AS \"OverHeadCosts\", SUM(P.product_sales) AS \"ProductSales\", '; \n query += 'SUM(P.product_sales) - D.over_head_costs AS \"TotalProfit\" FROM departments D INNER JOIN products P ON D.department_name = P.department_name ';\n query += 'GROUP BY D.department_id';\n\n connection.query(\n query,\n function(err, res){\n if (err) throw err;\n\n console.table(\n res.map(rowData => {\n return{ \n \"Dept ID\": rowData.DeptID,\n \"Department Name\": rowData.Department,\n \"Over Head Costs\": rowData.OverHeadCosts,\n \"Product Sales\": rowData.ProductSales,\n \"Total Profit\": rowData.TotalProfit\n }\n })\n );\n endRepeat();\n }\n );\n}", "function getSalesByEmployee(data) {\n var employeeSales = {};\n\n for (var i = 0; i < data.length; i++) {\n var d = data[i];\n if (!employeeSales[d.salesman]) {\n employeeSales[d.salesman] = 0;\n }\n employeeSales[d.salesman] += Number(d.amount);\n }\n return employeeSales;\n}", "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "function convertToLostSale(itemID) {\n $('#AllOpps').hide();\n $('#OppDetails').hide();\n clearEditOppForm();\n\n currentItem.set_item(\"_Status\", \"Lost Sale\");\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditOppForm();\n showLostSales();\n }\n ,\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n}", "async paySale(sale){\n\t\t\ttry{\n\t\t\t\tlet response = await axios.put(\"/api/sales/\" + sale._id);\n\t\t\t\tawait this.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "function getSOFieldsAndItemLinesAndProcess(type)\r\n{\r\n\t//declaring local variables\r\n\tvar noOfSOLineItems = 0;\r\n\tvar returnedValue = '';\r\n\tvar pandpRecog = 'F';\r\n\tvar existingJournalIntID = 0;\r\n\tvar journalDesc = '';\r\n\tvar itemAmt = 0;\r\n\tvar newJournalIntID = 0;\r\n\r\n\ttry\r\n\t{\r\n\t\t//loading sales order related to fulfilment\r\n\t\tsalesOrderRecord = nlapiLoadRecord('salesorder', createdFromrecordIntID);\r\n\t\tdepartmentIntID = salesOrderRecord.getFieldValue('department');\t\t\t\t\t//getting department int ID\r\n\t\tnoOfSOLineItems = salesOrderRecord.getLineItemCount('item');\t\t\t\t\t//get no of line items in SO\r\n\t\tpandpRecog = salesOrderRecord.getFieldValue('custbody_pandprecognized');\t\t//getting the 'P&P recognized' field value\r\n\t\t\r\n\t\tgetJournalListBeforeChanges();\t\t\t\t\t\t\t\t\t\t\t\t\t//calling getJournalListBeforeChanges function\r\n\t\t\r\n\t\t//journal description to use in the journal creation\r\n\t\tjournalDesc = 'Item revenue account to deferred revenue account transfer for Fulfilment: ' + fulfilmentID;\r\n\t\t\r\n\t\t//looping through each line item in SO\r\n\t\tfor(var i = 1; i <= noOfSOLineItems; i++)\r\n\t\t{\r\n\t\t\tSOItemIntId = salesOrderRecord.getLineItemValue('item', 'item', i);\t\t\t//getting line item internal id\r\n\t\t\titemType = nlapiLookupField('item', SOItemIntId, 'type');\t\t\t\t\t//getting the type of the SO item's line item\r\n\t\t\titemQuantity = salesOrderRecord.getLineItemValue('item', 'quantity', i);\t//getting the amount of the line item\t\t\r\n\r\n\t\t\t//calling the compareFulfilItems function\r\n\t\t\treturnedValue = getAndCompareFulfilItems();\r\n\r\n\t\t\t//if the SO item is in the fulfilment record\r\n\t\t\tif(ItemFound == 'T')\r\n\t\t\t{\r\n\t\t\t\t//getting the related journal int id\r\n\t\t\t\texistingJournalIntID = nlapiGetLineItemValue('item','custcol_revjournalref',returnedValue);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//version 1.0.2\r\n\t\t\t//if the item type is 'service' and the p&p is not recognized or item found in the fulfilment record\r\n\t\t\t//(reason : the P&P items will not be shown in the item fulfilment records)\r\n\t\t\tif(((itemType == 'Service') && (pandpRecog == 'F')) || ItemFound == 'T')\r\n\t\t\t{\r\n\t\t\t\titemRate = salesOrderRecord.getLineItemValue('item', 'rate', i);\t\t//getting item rate for price calculation\r\n\t\t\t\titemRate = parseFloat(itemRate);\r\n\r\n\t\t\t\titemAmt = calculatePrice();\t\t\t\t\t\t\t\t\t\t\t\t//calling calculatePrice function\r\n\t\t\t\tgetItemAccountInternalID();\t\t\t\t\t\t\t\t\t\t\t\t//Calling getItemAccountsInternalIDs function\r\n\r\n\t\t\t\t/******\r\n\t\t\t\t * when the invoice is created, a new journal will be created as well\r\n\t\t\t\t *****/ \r\n\t\t\t\tif(type == 'create')\r\n\t\t\t\t{\r\n\t\t\t\t\t//calling postAndSetJrnlRefFulfil function\r\n\t\t\t\t\tnewJournalIntID = postAndSetJrnlRefFulfil(journalDesc,fulfillRecord,itemAmt,returnedValue,'item', 'custcol_revjournalref', ItemRevenueAccountIntID,deferredRevenueAccountIntID,fulfilmentDate);\r\n\t\t\t\t\tsetJournalArrayValues(newJournalIntID, i);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*****\r\n\t\t\t\t * when the invoice is edited, if no journal found for each line item, \r\n\t\t\t\t * then create new journal, otherwise edit the existing journal\r\n\t\t\t\t *****/\r\n\t\t\t\telse if(type == 'edit')\r\n\t\t\t\t{\r\n\t\t\t\t\t//if no journal for the line item\t\r\n\t\t\t\t\t//(reason : the creating of fulfilment can be go through picked, packed and shiped statuses. creating of journals is done in the 'shiped' status)\r\n\t\t\t\t\tif(existingJournalIntID == null || existingJournalIntID == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnewJournalIntID = postAndSetJrnlRefFulfil(journalDesc,fulfillRecord,itemAmt,returnedValue,'item', 'custcol_revjournalref', ItemRevenueAccountIntID,deferredRevenueAccountIntID,fulfilmentDate);\r\n\t\t\t\t\t\tsetJournalArrayValues(newJournalIntID, i);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//if there is an existing journal already (if the fulfilment record is created directly with 'shiped' status)\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\trecordType = 'editing';\r\n\t\t\t\t\t\teditJournal(existingJournalIntID, itemAmt);\t\t\t\t\t\t//calling the editJournal function\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tItemFound = 'F'; \t\t\t//setting ItemFound back to false\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tpandpArrayIndex = 0;\r\n\r\n\t\t//if the invoice is not deleted\r\n\t\tif(type != 'delete')\r\n\t\t{\r\n\t\t\tnlapiSubmitRecord(fulfillRecord);\t\t\t//submit the filfilment to save the changes\r\n\t\r\n\t\t}\r\n\t\t\r\n\t\t//checkAndDeleteJournals(newJournalList);\t\t\t//calling checkAndDeleteJournals function \r\n\r\n\t\t//if the invoice is edited/ deleted\r\n\t\tif(type != 'create')\r\n\t\t{\r\n\t\t\t//assign the newJournalList to journalList array\r\n\t\t\tjournalList = newJournalList;\r\n\t\t}\r\n\r\n\t\tif(type == 'delete')\r\n\t\t{\r\n\t\t\tjournalList = new Array();\r\n\t\t\tpandpJournalIDs = new Array();\r\n\t\t}\r\n\r\n\t\t//setting the journal list to a parameter to comparison purposes \r\n\t\tnlapiGetContext().setSessionObject('custscript_oldjournallistfulfilment', journalList);\r\n\t\t\r\n\t\tif(pandpJournalIDs != '')\r\n\t\t{\r\n\t\tnlapiGetContext().setSessionObject('custscript_pandpjournallist', pandpJournalIDs);\r\n\t\t}\r\n\t\t\t\t\r\n\t\t//calling deleteAllJournalsInFulfilment function\r\n\t\tdeleteAllJournalsInFulfilment(pandpRecog);\r\n\t\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler('getSOFieldsAndItemLinesAndProcess', e);\r\n\t}\r\n\r\n}", "function productOppoContent(customerFreeformTextValueObject) {\r\n try {\r\n\r\n var customerFreeformTextValueObject_k3 = customerFreeformTextValueObject.k3;\r\n var customerFreeformTextValueObjectLength = customerFreeformTextValueObject.k3.length;\r\n if (customerFreeformTextValueObjectLength != 0) {\r\n var freeformtextContent = '<tr class=\\\"heading\\\"><td class=\\\"heading\\\">Product opportunities</td></tr>'\r\n\r\n for (var i = 0; i < 5; i++) {\r\n if (customerFreeformTextValueObject.k3[i] != null) {\r\n freeformtextContent += '<tr class=\\\"data\\\"><td class=\\\"data\\\">' + customerFreeformTextValueObject.k3[i] + '</td></tr>'\r\n }\r\n }\r\n }\r\n\r\n return freeformtextContent;\r\n\r\n } catch (e) {\r\n\r\n log.error(\"Err@ FN freeformContent\", e);\r\n\r\n }\r\n\r\n }", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "function totalSales(totalShirtSale,totalPantSale,totalShoesSale){ \n let perShirtMRP = 100;\n let perPantMRP = 200;\n let perShoesMRP = 500;\n\n let totalShirtSalePrice = totalShirtSale * perShirtMRP;\n let totalPantSalePrice = totalPantSale * perPantMRP;\n let totalShoesSalePrice = totalShoesSale * perShoesMRP;\n let totalSalesPrice = totalShirtSale + totalPantSale + totalShoesSale;\n\n return totalSalesPrice;\n }", "function handleLeadCompanyIntent(intent, session, response) {\n var sqsParam;\n var names = session.attributes.name.split(' ');\n var query = \"Select Name, Id from Account where Name like '\" + intent.slots.Company.value + \"'\";\n\n console.log('query: ' + query);\n org.authenticate({ username: SF_USER, password: SF_PWD_TOKEN }).then(function() {\n return org.query({query: query})\n\n }).then(function(results){ // this result is from the query to salesforce\n var recs = results.records;\n //if company not found in salesforce, create the lead\n if (recs.length == 0) {\n console.log('company not found. try to create lead');\n speechOutput = 'created lead for ' + names[1] + ' at ' + intent.slots.Company.value;\n var obj = nforce.createSObject('Lead');\n obj.set('FirstName', names[0]);\n obj.set('LastName', names[1]);\n obj.set('Company', intent.slots.Company.value);\n return org.insert({ sobject: obj })\n }\n else{//if company is already an account, then create an opportunity not a lead\n console.log('account exists for company. try to create opportunity');\n console.log('recs: ' + JSON.stringify(recs));\n speechOutput = 'created opportunity for ' + intent.slots.Company.value;\n\n var opp = nforce.createSObject('Opportunity');\n opp.set('Name', intent.slots.Company.value + '-' +names[1] );\n opp.set('StageName', 'Prospecting');\n opp.set('CloseDate', '2017-01-01T18:25:43.511Z');//2017-01-01T18:25:43.511Z\n opp.set('AccountId', '00137000009eTf1AAE')\n\n return org.insert({ sobject: opp })\n }\n }).then(function(results) { // this result is from the insert operation to salesforce\n if (results.success) {\n console.log('insert results: ' + JSON.stringify(results));\n response.tellWithCard(speechOutput, \"Salesforce\", speechOutput);\n } else {\n speechOutput = 'a salesforce problem with inserting object';\n response.tellWithCard(speechOutput, \"Salesforce\", speechOutput);\n }\n }).then(function () {\n sqsParam = {\n \"FunctionName\": \"bk-sqs\",\n \"Payload\": JSON.stringify({\n \"arn\": \"'arn':'arn:aws:lambda:us-east-1:724245399934:bk-sqs'\",\n \"industry\": \"technology\",\n \"opportunityName\": intent.slots.Company.value + '-' +names[1]\n })\n };\n lambda.invoke(sqsParam, function(err, data) { // send data to lambda for sns topic\n // Did an error occur?\n if (err)\n console.log('error calling lambda with params: ' + JSON.stringify(sqsParam), JSON.stringify(err));\n else\n console.log('success calling lambda with params: ' + JSON.stringify(sqsParam), JSON.stringify(data));\n })}).error(function(err) {\n var errorOutput = 'Darn, there was a Salesforce problem, sorry';\n response.tell(errorOutput + ' : ' + err, \"Salesforce\", errorOutput);\n });\n}", "function renderSalesOrderShipment(name, data, parameters={}, options={}) {\n\n var html = `\n <span>${data.order_detail.reference} - {% trans \"Shipment\" %} ${data.reference}</span>\n <span class='float-right'>\n <small>{% trans \"Shipment ID\" %}: ${data.pk}</small>\n </span>\n `;\n\n html += renderId('{% trans \"Shipment ID\" %}', data.pk, parameters);\n\n return html;\n}", "function viewDepartmentSales() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n 2: {\n alignment: 'right'\n },\n 3: {\n alignment: 'right'\n },\n 4: {\n alignment: 'right'\n }\n }\n };\n data[0] = [\"Department ID\".cyan, \"Department Name\".cyan, \"Over Head Cost ($)\".cyan, \"Products Sales ($)\".cyan, \"Total Profit ($)\".cyan];\n let queryStr = \"departments AS d INNER JOIN products AS p ON d.department_id=p.department_id GROUP BY department_id\";\n let columns = \"d.department_id, department_name, over_head_costs, SUM(product_sales) AS sales\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n DEPARTMENTS\".magenta);\n for (let i = 0; i < res.length; i++) {\n let profit = res[i].sales - res[i].over_head_costs;\n data[i + 1] = [res[i].department_id.toString().yellow, res[i].department_name, res[i].over_head_costs.toFixed(2), res[i].sales.toFixed(2), profit.toFixed(2)];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function displayForSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n\n if (err) throw err;\n var price;\n items = res.length;\n var sales;\n console.log(\"=====================================================================\");\n var tableArr = [];\n for (var i = 0; i < res.length; i++) {\n sales = parseFloat(res[i].product_sales).toFixed(2);\n price = parseFloat(res[i].price).toFixed(2);\n tableArr.push(\n {\n ID: res[i].item_id,\n PRODUCT: res[i].product_name,\n DEPARTMENT: res[i].department_name,\n PRICE: price,\n ONHAND: res[i].stock_quantity,\n SALES: sales\n }\n )\n }\n console.table(tableArr);\n console.log(\"=====================================================================\");\n promptChoice();\n })\n}", "render() {\r\n const campaignSale = this.props.campaignSale;\r\n\r\n return (\r\n <div className={this.state.collapse ? \"sell_point_raw open\" : \"sell_point_raw\"}>\r\n <div className=\"sell_left\" onClick={this.toggle}>\r\n {\r\n campaignSale.sellPostionImg ?\r\n (<span className=\"sell_no\"><img src={campaignSale.sellPostionImg} className=\"img-responsive\" alt=\"#\" /></span>) : (<span className=\"sell_no bg\">{campaignSale.sellPostionNo}</span>)\r\n }\r\n <div className=\"sell_des\">\r\n <h6>{campaignSale.agencyName}</h6>\r\n <p>{campaignSale.campaignName}</p>\r\n <span className=\"mclick\">{campaignSale.clicks}</span>\r\n </div>\r\n </div>\r\n <Collapse in={this.state.collapse}>\r\n <div className=\"sell_right\">\r\n <div className=\"sell_type\">\r\n <ul>\r\n <li>\r\n <h6>Impressions</h6>\r\n <p>{campaignSale.impressions}</p>\r\n </li>\r\n <li>\r\n <h6>Clics</h6>\r\n <p>{campaignSale.clicks}</p>\r\n </li>\r\n <li>\r\n <h6>Conversions</h6>\r\n <p>{campaignSale.conversions}</p>\r\n </li>\r\n <li>\r\n <h6>Budget</h6>\r\n <p>{campaignSale.budgetSpent}</p>\r\n </li>\r\n <li>\r\n <h6>Coût du lead</h6>\r\n <p className=\"green\">{campaignSale.costPerClick}</p>\r\n </li>\r\n </ul>\r\n </div>\r\n <a href=\"#\">détails du point de vente</a>\r\n </div>\r\n </Collapse>\r\n </div>\r\n );\r\n }", "function summarizedSalesByProduct() {\n // var dataSummarized = [];\n var data = get.mappedSalesData();\n\n return data.reduce(function(allSummary, week){\n var keeptrack = {};\n allSummary.push(week.reduce(function(weekSum, sale) {\n if (!keeptrack[sale.product]) {\n keeptrack[sale.product] = 1;\n weekSum.push({week: sale.week, category: sale.category, product: sale.product, quantity: sale.quantity, unitprice: sale.unitprice, revenue: sale.revenue, totalcost: sale.totalcost, profit: sale.profit });\n } else {\n var product = weekSum.find(function(item) {return item.product === sale.product;});\n product.quantity += sale.quantity;\n product.revenue += sale.revenue;\n product.totalcost += sale.totalcost;\n product.profit += sale.profit;\n\n if (typeof product.unitprice!== 'object' && product.unitprice!==sale.unitprice) {\n product.unitprice = [product.unitprice, sale.unitprice];\n } else if (typeof product.unitprice === 'object' && product.unitprice.indexOf(sale.unitprice)===-1) {\n product.unitprice.push(sale.unitprice);\n }\n }\n\n return weekSum;\n },[])\n );\n return allSummary;\n },[]);\n // return dataSummarized;\n }", "function _formatResults(entity, SEP) {\n var e = entity.e;\n if (typeof(e['getHeadline']) != \"undefined\") {\n //this is an ad entity\n return [\"Ad\",\n e.getCampaign().getName(),\n e.getAdGroup().getName(),\n e.getId(),\n e.getHeadline(),\n entity.code,\n e.getDestinationUrl()\n ].join(SEP) + \"\\n\";\n } else {\n // and this is a keyword\n return [\"Keyword\",\n e.getCampaign().getName(),\n e.getAdGroup().getName(),\n e.getId(),\n e.getText(),\n entity.code,\n e.getDestinationUrl()\n ].join(SEP) + \"\\n\";\n }\n}", "function getOutskirtShop()\r\n {\r\n \r\n var outskirtShop = \"Type(?WarehouseShop, Shop), PropertyValue(?WarehouseShop, hasRoad, MotorwayRoad)\";\r\n \r\n new jOWL.SPARQL_DL(outskirtShop).execute({ onComplete : displayOutskirtShops});\r\n \r\n }", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "function bulkByOppoContent(customerFreeformTextValueObject) {\r\n try {\r\n\r\n var customerFreeformTextValueObject_k2 = customerFreeformTextValueObject.k2;\r\n var customerFreeformTextValueObjectLength = customerFreeformTextValueObject.k2.length;\r\n if (customerFreeformTextValueObjectLength != 0) {\r\n var freeformtextContent = '<tr class=\\\"heading\\\"><td class=\\\"heading\\\">Bulk buy opportunities</td></tr>'\r\n\r\n for (var i = 0; i < 5; i++) {\r\n if (customerFreeformTextValueObject.k2[i] != null) {\r\n freeformtextContent += '<tr class=\\\"data\\\"><td class=\\\"data\\\">' + customerFreeformTextValueObject.k2[i] + '</td></tr>'\r\n }\r\n }\r\n }\r\n\r\n return freeformtextContent;\r\n\r\n } catch (e) {\r\n\r\n log.error(\"Err@ FN freeformContent\", e);\r\n\r\n }\r\n\r\n }", "function sumWithSale() {\n \n let sum = prompt(\"Введите сумму покупки:\");\n sum = Number(sum);\n let sale;\n if (sum > 500 && sum < 800) {\n sale = 0.03;\n } else if (sum > 800) {\n sale = 0.05;\n } else {\n sale = 0;\n };\n sum = sum - (sum * sale);\n let viewSale = sale * 100;\n alert(`Сумма покупки с учетом скидки - ${viewSale}% составляет: ${sum} грн.`);\n console.log(`3) Purchase sum with sale ${viewSale}%: ${sum} uah.`);\n }", "function bestSales(sales) {\n let output = {};\n let tempId = 0;\n let tempAmount = 0;\n sales.forEach(element => {\n let currentId = element.productId;\n let currentAmount = element.amount;\n if(tempId === 0){\n tempId = currentId;\n tempAmount += currentAmount;\n }else{\n if(currentAmount > tempAmount && currentId !== tempId){\n tempAmount = currentAmount;\n tempId = currentId;\n }else if(currentId === tempId){\n tempAmount += currentAmount;\n }\n }\n\n });\n\n if(tempId){\n output.id = tempId;\n output.total = tempAmount;\n }\n\n return output;\n}", "function forSale() {\n\t//Select item_id, product_name and price from products table.\n\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(error, results) {\n\t\tif (error) throw error;\n\t\tconsole.log(\"\\n\");\n\t\t//the below code displays the item_id, product_name and the price for all of items that available for sale. \n\t\tfor ( var index = 0; index < results.length; index++) {\n\t\t\tconsole.log(\"Product Id: \" + results[index].item_id + \"\\n\" +\n\t\t\t \"Product Name: \" + results[index].product_name + \"\\n\" +\n\t\t\t \"Price: $\" + results[index].price + \"\\n\" + \"Quantity: \" + results[index].stock_quantity + \"\\n\" + \n\t\t\t \"--------------------------------------------------------------------------\\n\");\n\t\t}// end for loop\n\t\trunSearch();\n\t});// end of query.\n\t\n} // end of forSale function", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "getProductLineItems(shipment) {\n\n }", "function cityMarkets(sales) {\n let townsWithProducts = new Map();\n for (let sale of sales) {\n let [town, product, quantityPrice] = sale.split(/\\s*->\\s*/);\n let [quantity, price] = quantityPrice.split(/\\s*:\\s*/);\n if (!townsWithProducts.has(town))\n townsWithProducts.set(town, new Map());\n let income = quantity * price;\n let oldIncome = townsWithProducts.get(town).get(product);\n if (oldIncome) income += oldIncome;\n townsWithProducts.get(town).set(product, income);\n }\n for (let town of townsWithProducts.keys()) {\n console.log(`Town - ${town}`);\n for (let product of townsWithProducts.get(town).keys()) {\n console.log(`$$$${product} : ${townsWithProducts.get(town).get(product).valueOf()}`)\n }\n }\n}", "__validateSales() {\n let salescorrect = [];\n let salesIncorrect = [];\n\n this.sales.forEach((sale) => {\n if (\n sale.saleDate.isSameOrAfter(this.since) &&\n sale.saleDate.isSameOrBefore(this.until)\n ) {\n salescorrect.push(sale);\n } else {\n salesIncorrect.push(sale);\n }\n });\n\n this.sales = salescorrect.reverse();\n //TODO: Metodo que grantice un ordenamineto de fechas correcto siempre\n this.salesWithError = salesIncorrect;\n }", "function GetSummary() {\n var YearQuery = '';\n if (FilterList.DashboardFilterYear === '') {\n YearQuery =\n ' business_year = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('YYYY') +\n \"'\";\n } else {\n YearQuery =\n ' business_year = ' + \"'\" + FilterList.DashboardFilterYear + \"'\";\n }\n\n var MonthQuery = '';\n if (FilterList.DashboardFilterMonth === '') {\n MonthQuery =\n ' and business_month = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('MMMM') +\n \"'\";\n } else {\n MonthQuery =\n ' and business_month = ' + \"'\" + FilterList.DashboardFilterMonth + \"'\";\n }\n\n var TeamQuery = '';\n if (\n FilterList.DashboardFilterTeam === '' ||\n FilterList.DashboardFilterTeam === 'ALL'\n ) {\n TeamQuery = ' and team IN ' + global.TeamAccessList;\n } else {\n TeamQuery = ' and team = ' + \"'\" + FilterList.DashboardFilterTeam + \"'\";\n }\n\n var VendorQuery = '';\n if (\n FilterList.DashboardFilterVendor === '' ||\n FilterList.DashboardFilterVendor === 'ALL'\n ) {\n VendorQuery = ' and principal_name like ' + \"'%%' \";\n } else {\n VendorQuery =\n ' and principal_name = ' + \"'\" + FilterList.DashboardFilterVendor + \"'\";\n }\n\n dbperymtsat.transaction((tx) => {\n tx.executeSql(\n 'SELECT SUM(amount) as amount , SUM(target) as target FROM perymtsat_tbl where ' +\n YearQuery +\n MonthQuery +\n TeamQuery +\n VendorQuery +\n ' order by invoice_date asc ',\n [],\n (tx, results) => {\n var len = results.rows.length;\n if (len > 0) {\n // console.log(results.rows.item(0).target);\n //console.log(results.rows.item(0).amount);\n //setTotalSales();\n setTotalTarget(parseInt(results.rows.item(0).target));\n setTotalSales(parseInt(results.rows.item(0).amount));\n settotalSalesAnimation(true);\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n\n // console.log(\n // 'Successfully got summary of ' +\n // FilterList.DashboardFilterMonth +\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n // );\n }\n },\n SQLerror,\n );\n });\n }", "function getSaleLinesData(shopObj, endPoint, clear){\n var objSheet = shopObj.saleLineSheetName;\n var ssID = shopObj.ID;\nlogSales(\"Shop Object\",shopObj.saleLineSheetName)\nvar ss = SpreadsheetApp.openById(ssID);\n var sheet = ss.getSheetByName(objSheet);\n sheet.activate();\n var saleOffset = getCurrentSaleLineID(sheet,ssID); \n if(UIONOFF){ ss.toast(\"Sale Line Off set ID =\"+saleOffset);}\n var headerRows = 1;\n var offset = 0;\n // == -- Specify the type of call needed -- == \\\\ \n var type = \"GET\";\n // == -- Build the URL with any offsets -- == \\\\\n var url = shopObj.saleLine;\n // == -- adjust process for updating info or replacing info -- == \\\\ \n if(!clear && saleOffset){ \n // logSales(\"sales object\",shopObj);\n url = url+\"&saleLineID=%3E,\"+saleOffset;\n// logSales(\"log Url\",url);\n updateSaleID(shopObj.name,saleOffset)\n } else {\n clearSheet(headerRows, sheet);\n saleOffset = 0;\n }\n \n// logSales(\"url\",url);\n // == -- Initiate the OAuth / Api Call with the given variables -- == \\\\ \n var data = getData(offset,url,endPoint,type);\n if(data.length>=0 ){\n for(var i = 0; i<data.length; i++){\n var row = data[i];\n// logSales(\"Data Row\",row);\n getNames(row);\n// fixItems(row);\n fixDates(row);\n }}\n // == -- Make the call to insert the rows needed for the new data and insert the data -- == \\\\ \n insertData(sheet,data);\n}", "function salesReport() {\n var totalSales = 0;\n \n // [ [ 102, 103, 104 ], [ 106, 107 ], [], [], [] ]\n for(var i = 0; i < bookedRooms.length; i++) {\n totalSales += bookedRooms[i].length * roomPrices[i]\n \n }\n \n return totalSales;\n}", "function viewSalesByDept(){\n\n connection.query('SELECT * FROM Departments', function(err, res){\n if(err) throw err;\n\n // Table header\n console.log('\\n' + ' ID | Department Name | OverHead Costs | Product Sales | Total Profit');\n console.log('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -')\n \n // Loop through database and show all items\n for(var i = 0; i < res.length; i++){\n\n //=============================== Add table padding ====================================\n var departmentID = res[i].DepartmentID + ''; // convert to string\n departmentID = padText(\" ID \", departmentID);\n\n var departmentName = res[i].DepartmentName + ''; // convert to string\n departmentName = padText(\" Department Name \", departmentName);\n\n // Profit calculation\n var overHeadCost = res[i].OverHeadCosts.toFixed(2);\n var totalSales = res[i].TotalSales.toFixed(2);\n var totalProfit = (parseFloat(totalSales) - parseFloat(overHeadCost)).toFixed(2);\n\n\n // Add $ signs to values\n overHeadCost = '$' + overHeadCost;\n totalSales = '$' + totalSales;\n totalProfit = '$' + totalProfit;\n\n // Padding for table\n overHeadCost = padText(\" OverHead Costs \", overHeadCost);\n totalSales = padText(\" Product Sales \", totalSales);\n \n // =================================================================================================\n\n console.log(departmentID + '|' + departmentName + '|' + overHeadCost + '|' + totalSales + '| ' + totalProfit);\n }\n connection.end();\n });\n}", "function getSalePrice(originalPrice) {\n var discount = originalPrice * saleAmount;\n var salePrice = originalPrice - discount;\n return salePrice;}", "function salesByDep() {\n // console.log(\"loading product sales...\");\n\n // join department and products \n // table needs to have depid, depName, overhead, productSales and totalProfits \n\n\nconnection.query(`SELECT departments.department_id AS 'Department ID', \ndepartments.department_name AS 'Department Name', \ndepartments.over_head_costs as 'Overhead Costs', \nSUM(products.product_sales) AS 'Product Sales', \n(SUM(products.product_sales) - departments.over_head_costs) AS 'Total Profit' \nFROM departments\nLEFT JOIN products on products.department_name=departments.department_name\nGROUP BY departments.department_name, departments.department_id, departments.over_head_costs\nORDER BY departments.department_id ASC`, (err, res) => {\n if (err) throw err;\n console.log('\\n ----------------------------------------------------- \\n');\n console.table(res);\n\n startSuper();\n\n });\n\n\n}", "async showItemsForSale() {\n const character = this.character;\n\n let description = character.location.getDescription(character)\n + character.location.getShopDescription(character, this.info.type);\n\n let attachments = new Attachments().add({\n title: \"What do you want to buy?\",\n fields: character.getFields(),\n color: COLORS.INFO\n });\n\n [description, attachments] = this.getEquipmentForSale(character, description, attachments);\n [description, attachments] = this.getSpellsForSale(character, description, attachments);\n [description, attachments] = this.getItemsForSale(character, description, attachments);\n\n attachments.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({ description, attachments });\n }", "function viewProductSales() {\n // Assign variable to select from the relevant columns and combin product_sales by department\n var query = \"SELECT departments.id, departments.department_name, departments.over_head_costs, SUM(products.product_sales)\";\n // Add to query variable to join 'products' and 'departments' tables by department_name\n query += \"FROM products RIGHT JOIN departments ON products.department_name = departments.department_name \";\n // Add to query variable to group by the 'departments' id and the 'products' department_name\n query += \"GROUP BY departments.id, products.department_name\";\n // Connect to the database using the variable 'query'\n connection.query(query, function (err, res) {\n // Assign a variable to create a new CLI-Table\n var table = new Table({\n head: ['Department ID', 'Department Name', 'Overhead Costs', 'Product Sales', 'Total Profit'],\n colWidths: [20, 30, 20, 20, 20]\n });\n // Check for errors\n if (err) throw err;\n // If no errors...\n // Iterate through the items in the joined tables\n res.forEach(function (row) {\n // Default value of product_sales when column is created in MySQL Workbench is 'null'\n // So if there haven't been any sales yet, change null to 0 to display correctly in CLI-Table\n if (row['SUM(products.product_sales)'] === null) {\n row['SUM(products.product_sales)'] = 0;\n }\n // Assign variable to calculate the total profit - sum of product_sales in each row of 'products' table minus the overhead costs in each row\n var totalProfit = (row['SUM(products.product_sales)'] - row.over_head_costs);\n // Assign variable to display total to 2 decimal places even if the values at those decimal places are 0\n var totalDisplay = totalProfit.toFixed(2);\n // Push the item and department information, as well as the totalProfit calculation, to the new CLI-Table\n table.push([row.id, row.department_name, row.over_head_costs, row['SUM(products.product_sales)'], totalDisplay]);\n\n });\n // Log the table of product sales by department to the 'supervisor'\n console.log(table.toString());\n // Invoke the displaySupervisorOptions function to present user with management action options\n displaySupervisorOptions();\n });\n}", "function somarInventarioDepartamento(departamento) {\n let somaInventario = 0;\n for (p in listaProdutos) {\n if (listaProdutos[p].departamento.nomeDepto == departamento) {\n somaInventario += listaProdutos[p].qtdEstoque * listaProdutos[p].preco\n }\n }\n somaInventario = somaInventario.toLocaleString('pt-BR', {style: 'currency', currency: 'BRL'});\n return {departamento, somaInventario};\n}", "function totalSales(companysSales) {\n var sum = 0;\n for (var i = 0; i < companysSales.length; i++) {\n sum += companysSales[i];\n }\n return sum;\n}", "function showCustomerSale(customerId,product_id){\n $(\".shopInfo\").css(\"display\", \"block\");\n custModule.queryCustomerRecord(customerId,product_id,function(responseData) {\n var httpResponse = JSON.parse(responseData.response);\n if (responseData.ack == 1 && httpResponse.retcode ==200) {\n var retData = httpResponse.retbody;\n $(\"#sale_dt\").html(common.isNotnull(retData.sale_dt) ? retData.sale_dt : '-');\n $(\"#last_sale_price\").html(common.isNotnull(retData.sale_price) ?'¥'+ retData.sale_price : '-');\n $(\"#last_sale_num\").html(common.isNotnull(retData.sale_num) ? retData.sale_num + retData.unit: '-');\n if(retData.sale_price){\n $(\".product_price\").val(retData.sale_price);\n }\n } else {\n $.toast(\"本地网络连接有误\", 2000, 'error');\n }\n });\n }", "function totalSales(shirt, pant, shoe) {\n if ((shirt < 0) || (pant < 0) || (shoe < 0)) {\n return 'Negative value not permitted';\n }\n else {\n let shirtPrice = 100;\n let pantPrice = 200;\n let shoePrice = 500;\n\n let shirtPriceMultiply = shirtPrice * shirt;\n let pantPriceMultiply = pantPrice * pant;\n let shoePriceMultiply = shoePrice * shoe;\n\n let totalPrice = shirtPriceMultiply + pantPriceMultiply + shoePriceMultiply;\n\n return totalPrice;\n }\n}", "function transformBookingItemForDisplay(data) {\n var booking = angular.fromJson(data);\n booking = bookingAdminService.bookingDic(booking);\n return booking;\n }", "function supplementsOutputObject(o){\n\tvar ops, c1, c2;\n\t//log(\"supplementsOutputObject: o:\\n\" + JSON.stringify(o) + \"\\nssl: \" + ssl + \" sdl: \" + sdl);\t\t\n\t//if it's not a time stamp\n\tif(typeof o == \"object\"){\n\t\t//make sure that the count for repeat is always > 1\n\t\tc1 = \tssl - o.sl + 1;\n\t\tc1 = \tc1 > 1 ? c1 : 1;\n\t\tc2 = \tsdl - o.dose.length + 1;\n\t\tc2 = \tc2 > 1 ? c2 : 1;\n\t\tos = \to.brand\t+ \" \".repeat(c1) + \n\t\t\t\to.supp \t+ \" \".repeat(c2) + \n\t\t\t\to.dose;\n\t\tops = \tos \t\t+ \" \" + \n\t\t\t\to.qty \t+ \"\\n\";\n\n\t\t//log(\"supplementsOutputObject: return supplement: \\n\" + ops);\n\t\treturn ops;\n\t} else {\n\t\tops = \"\\n\" + \" \".repeat(ssl + sdl - 1) + o + \"\\n\";\n\t\t//log(\"supplementsOutputObject: return date: \\n\" + ops);\n\t\treturn ops;\n\t}\n}", "function viewSales() {\n connection.query(\"SELECT departments.Department_ID,departments.Department_Name,SUM(departments.Over_Head_Costs) AS Total_Costs,SUM(products.Product_Sales) AS Total_Sales,(SUM(products.Product_Sales)-SUM(departments.Over_Head_Costs)) AS Total_Profit FROM departments LEFT JOIN products ON departments.Department_Name = products.Department_Name GROUP BY Department_ID\",\n\n // CREATES TABLE FOR DEPARTMENT SALES //\n function (err, res) {\n if (err) throw err;\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗'\n , 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝'\n , 'left': '║', 'left-mid': '╟', 'mid': '─', 'mid-mid': '┼'\n , 'right': '║', 'right-mid': '╢', 'middle': '│'\n }\n }); \n\n // SPECIFIES WHERE DATA FROM DATABASE IS PLACED IN TABLE //\n table.push(\n [colors.cyan('Department ID#'), colors.cyan('Department Name'), colors.cyan('Overhead Costs'), colors.cyan('Product Sales'), colors.cyan(\"Total Profit\")]\n );\n\n // ITERATES THROUGH ALL ITEMS AND FILLS TABLE WITH ALL RELEVANT INFORMATION FROM DATABASE //\n for (var i = 0; i < res.length; i++) {\n\n // SETTING UP FUNCTIONS TO PREVENTS DATA BEING DISPLAYED AS NULL //\n let tSales = res[i].Total_Sales;\n let pSales = res[i].Total_Profit;\n \n // VALIDATES TOTAL SALES //\n function validateT (amt){\n if (amt === null){\n return 0.00;\n } else return amt;\n }; \n\n // VALIDATES PRODUCT SALES //\n function validateP (amt){\n if (amt === null){\n return 0.00;\n } else return amt;\n }; \n\n table.push(\n [colors.cyan(res[i].Department_ID), res[i].Department_Name, \"$\" + res[i].Total_Costs, '$' + validateT(tSales), \"$\" + validateP(pSales)]\n );\n }\n console.log(table.toString());\n console.log(colors.grey(\"----------------------------------------------------------------------\"));\n \n // PROMPTS WITH SUPERVISOR SELECTION //\n runInquirer();\n })\n}", "function find_hotel_sale (cb, results) {\n const criteriaObj = {\n checkInDate: sessionObj.checkindate,\n checkOutDate: sessionObj.checkoutdate,\n numberOfGuests: sessionObj.guests,\n numberOfRooms: sessionObj.rooms,\n hotel: results.create_hotel.id,\n or: [\n { saleType: 'fixed' },\n { saleType: 'auction' }\n ]\n }\n HotelSale.find(criteriaObj)\n .then(function (hotelSale) {\n sails.log.debug('Found hotel sales: ')\n sails.log.debug(hotelSale)\n\n if (hotelSale && Array.isArray(hotelSale)) {\n sails.log.debug('checking hotel sails')\n const sales = hotelSale.filter(function (sale) {\n const dateDif = new Date(sale.checkindate) - new Date()\n const hours = require('../utils/TimeUtils').createTimeUnit(dateDif).Milliseconds.toHours()\n if ((sale.saleType == 'auction' && hours <= 24) || (sale.saleType == 'fixed' && hours <= 0)) {\n _this.process_hotel_sale(sale)\n return false\n }else if (sale.status == 'closed') {\n return false\n }else {\n return true\n }\n })\n if (sales.length)\n sails.log.debug('Found hotel sales ')\n return cb(null, sales)\n } else {\n sails.log.debug('Did not find any sales, creating new sale')\n return cb(null, null)\n }\n }).catch(function (err) {\n sails.log.error(err)\n return cb({\n wlError: err,\n error: new Error('Error finding hotel sale')\n })\n })\n }", "async function manageSales(account) {\n try {\n let Ids = await EventsModule.GetSoldRefs(account);\n\n let IdsFinished = await EventsModule.WithdrawFundsEventGeneral() // Ids for which funds have been withdrawn\n\n let IdsToShow_id = await EventsModule.ComputeLeft(EventsModule.EventsToIds(Ids), EventsModule.EventsToIds(IdsFinished))\n\n let IdsToShowEventForm = await EventsModule.GetRefs(IdsToShow_id);\n\n return IdsToShowEventForm;\n } catch (e) {\n throw e;\n }\n}", "function showLostSales() {\n $('#LeadsTile').css(\"background-color\", \"#0072C6\");\n $('#OppsTile').css(\"background-color\", \"#0072C6\");\n $('#SalesTile').css(\"background-color\", \"#0072C6\");\n $('#LostSalesTile').css(\"background-color\", \"orange\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n\n var errArea = document.getElementById(\"errAllLostSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n var haslostSales = false;\n hideAllPanels();\n var saleList = document.getElementById(\"AllLostSales\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Success returned from executeQueryAsync\n var saleTable = document.getElementById(\"LostSaleList\");\n\n // Remove all nodes from the lostSale <DIV> so we have a clean space to write to\n while (saleTable.hasChildNodes()) {\n saleTable.removeChild(saleTable.lastChild);\n }\n // Iterate through the Propsects list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n // Create a DIV to display the organization name\n var lostSale = document.createElement(\"div\");\n var saleLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n lostSale.appendChild(saleLabel);\n\n // Add an ID to the lostSale DIV\n lostSale.id = listItem.get_id();\n\n // Add an class to the lostSale DIV\n lostSale.className = \"item\";\n\n // Add an onclick event to show the lostSale details\n $(lostSale).click(function (sender) {\n showLostSaleDetails(sender.target.id);\n });\n\n saleTable.appendChild(lostSale);\n haslostSales = true;\n }\n }\n if (!haslostSales) {\n var noLostSales = document.createElement(\"div\");\n noLostSales.appendChild(document.createTextNode(\"There are no lost sales.\"));\n saleTable.appendChild(noLostSales);\n }\n $('#AllLostSales').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get lost sales. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#LostSaleList').fadeIn(500, null);\n });\n}", "function salesReport(req, res) {\n let db = req.app.get('db');\n let limit = req.body.limit || 50;\n let offset = req.body.offset || 0;\n let baseQuery = `SELECT * from items where sold = true`;\n\n // if sortAttr is provided, add sort command to the query\n let sortAttr = req.body.sortAttr;\n let sortOrder = req.body.sortOrder || 'asc';\n if (sortAttr) baseQuery += ` order by ${sortAttr} ${sortOrder}`\n\n // add limit and offset to the query\n baseQuery += ` limit $1 offset $2`\n\n return db.query(baseQuery, [limit, offset])\n .then(items => {\n let numResults = items.length;\n let offsetForNextPage = offset + numResults;\n let offsetForPrevPage = offset - limit;\n if (offsetForPrevPage < 0) offsetForPrevPage = 0;\n // If we dont get a full set of results back, we're at the end of the data\n if (numResults < limit) offsetForNextPage = null;\n let data = {\n items,\n offsetForPrevPage: offsetForPrevPage,\n offsetForNextPage, offsetForNextPage\n }\n return sendSuccess(res, data);\n })\n .catch(e => sendError(res, e, 'salesReport'))\n}", "function topSellerByRevenue(products, lineItems){\n //TODO\n}", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "function pushToSales(store){\n var tableRowEl = document.createElement('tr');\n tableEl.appendChild(tableRowEl);\n\n var tableDataEl = document.createElement('td');\n tableRowEl.appendChild(tableDataEl);\n tableDataEl.textContent = store.location;\n\n for(var i = 0; i < store.hoursOpen.length; i++){\n var cookieDataEl = document.createElement('td');\n tableRowEl.appendChild(cookieDataEl);\n cookieDataEl.textContent = store.cookiePerHour[i];\n };\n var totalPerDay = document.createElement('td');\n tableRowEl.appendChild(totalPerDay);\n var sumStore = store.cookiePerHour.reduce(function(total, amount){\n return total + amount;\n });\n totalPerDay.textContent = sumStore;\n}", "function salesman(name1, age2){\n\tthis.name = name1;\n\tthis.age = age2;\n\tthis.showDetails=function(){\n\t\treturn this.name + \":\" + this.age;\n\t};\n}", "function calculateSales(store) {\n store.sales = cookiesPerLocation(storeHours, store.avgCookies, store.minCust, store.maxCust);\n}", "function profit(obj){\n return Math.round((obj.sellPrice - obj.costPrice) * obj.inventory)\n}", "function totalSales(shirtQuantity, pantQuantity, shoeQuantity){\n // Error handling\n if(typeof shirtQuantity === 'string' || typeof pantQuantity === 'string' || typeof shoeQuantity === 'string'){\n return 'Please input number arguements!';\n }\n if(shirtQuantity < 0 || pantQuantity < 0 || shoeQuantity < 0){\n return 'Please input Positive Numbers!';\n }\n // Price of product\n let shirtPrice = 100;\n let pantPrice = 200;\n let shoePrice = 500;\n // Total Price of each category of products\n let totalShirtPrice = shirtQuantity * shirtPrice;\n let totalPantPrice = pantQuantity * pantPrice;\n let totalShoePrice = shoeQuantity * shoePrice;\n\n // Sum of total sale\n const totalSaleOfShop = totalShirtPrice + totalPantPrice + totalShoePrice;\n // Function return\n return totalSaleOfShop;\n}", "function Sales(shopName,min,max,avg){\n this.shopName = shopName;\n this.minCust = min;\n this.maxCust = max ;\n this.avgCookies= avg;\n this.nOfCusts = [];\n this.avgCookiesH = [];\n this.total = 0;\n\n}", "function renderSalesOrder(name, data, parameters={}, options={}) {\n\n var html = `<span>${data.reference}</span>`;\n\n var thumbnail = null;\n\n if (data.customer_detail) {\n thumbnail = data.customer_detail.thumbnail || data.customer_detail.image;\n\n html += ' - ' + select2Thumbnail(thumbnail);\n html += `<span>${data.customer_detail.name}</span>`;\n }\n\n if (data.description) {\n html += ` - <em>${trim(data.description)}</em>`;\n }\n\n html += renderId('{% trans \"Order ID\" %}', data.pk, parameters);\n\n return html;\n}", "function getSalesDiscount(price, tax, discount) {\n if (isNaN(price) || isNaN(tax) || isNaN(discount)) {\n return \"Price, Tax, Discount harus dalam angka\";\n }\n\n const totalDiscount = price * (discount / 100);\n const priceAfterDiscount = price - totalDiscount;\n const pajak = priceAfterDiscount * (tax / 100);\n const totalPayment = priceAfterDiscount + pajak;\n\n return `\n Total Sales : Rp.${price}\n Discount (${discount}%) : Rp.${totalDiscount}\n PriceAfterDiscount : Rp.${priceAfterDiscount}\n Pajak (${tax}%) : Rp.${pajak}\n ----------------------------------------------------\n totalPayment : Rp.${totalPayment}\n `;\n}", "function salesByDept() {\n var query =\n 'SELECT departments.department_id, departments.department_name, over_head_costs, SUM(product_sales) AS total_sales, (SUM(product_sales) - over_head_costs) AS total_profit ';\n query +=\n 'FROM departments INNER JOIN products ON (departments.department_name = products.department_name) ';\n query += 'GROUP BY departments.department_name';\n connection.query(query, function(err, res) {\n if (err) {\n throw err;\n } else {\n console.table(res);\n reset();\n }\n });\n}", "function viewSalesByDept(){\n console.log(\"******************************\");\n console.log(\"* Product Sales By Department*\");\n console.log(\"******************************\");\n\n connection.query('SELECT * FROM departments', function(err, res){\n if(err) throw err;\n \n // empty array to store table contents\n var values = [] ;\n for(var i = 0; i<res.length;i++){\n var resArr = [res[i].department_id, res[i].department_name, (res[i].over_head_costs).toFixed(2), (res[i].product_sales).toFixed(2), (res[i].product_sales - res[i].over_head_costs).toFixed(2)];\n \n // looping through the data and push the values into the array\n values = values.concat([resArr]);\n }\n \n // console.table performs as we need, first parameter being headers for the table, second parameter being the rows underneath \n console.table(['department_id', 'department_name', 'over_head_costs', 'product_sales', 'total_profit'], values);\n\n // confirm whether or not the user wants to see the options again\n rerun();\n })\n}", "function renderSalesTable(sales) {\n let salesTableBody = $('#salesTableBody')\n salesTableBody.empty()\n for (let i = 0; i < sales.length; i++) {\n let row = `<tr id=tr-${sales[i].id}>\n <th scope=\"row\">${sales[i].orderNumber}</th>\n <td>${sales[i].userEmail}</td>\n <td>${sales[i].customerInitials}</td>\n <td>${sales[i].purchaseDate}</td>\n <td>${sales[i].quantity}</td>\n <td>${sales[i].listOfProducts}</td>\n <td>${sales[i].orderSummaryPrice}</td>\n </tr>`\n salesTableBody.append(row)\n }\n}", "function total_sales_by_location_morrisons(request){\n\n \t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\n\t\t\tvar customer = isnull(request.parameters.customer,0);\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\";\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\t\t\tvar fleet_logic=\"noneof\";\n\t\t\tvar fleet=0;\n\t\t\t\n\t\t\tif(customer==parent){\n\t\t\t\tlogic1=\"anyof\";\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\t\t\t\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\t\t\t\n\t\t\tvar searchObj = search.create({\n\t\t\t\t type: \"transaction\",\n\t\t\t\t filters: [\n\t\t\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"customer.parent\",logic1,parent1],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"entity\",logic2,parent2],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t\t\t ],\n\t\t\t\t columns:\n\t\t\t\t [\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"companyname\",\n\t\t\t\t join: \"customer\",\n\t\t\t\t summary: \"GROUP\",\n\t\t\t\t label: \"Location\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"formulacurrency\",\n\t\t\t\t summary: \"SUM\",\n\t\t\t\t formula: \"CASE WHEN {customer.category} != 'Krone' THEN {netamountnotax} ELSE 0 END\",\n\t\t\t\t label: \"Formula (Currency)\"\n\t\t\t\t })\n\t\t\t\t ]\n\t\t\t\t});\n\n\t\t\t/*\told filter\n\t\t\t[\n\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t \"AND\", \n\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t \"AND\", \n\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t \"AND\", \n\t\t [\"location\",\"anyof\",\"8\",\"9\",\"10\",\"51\",\"52\",\"5\",\"228\",\"225\",\"223\",\"224\",\"222\"], \n\t\t \"AND\", \n\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t ];\n*/\n\t\t\t\n\t \t//var searchObj = search.load({id: 'customsearch_sal_sales_by_branch_3_2_3'});\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t \tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t \tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\t\t\t\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t \treturn result_array;\n\t\t}", "function _0001485874440504_Reservations_Convert_to_Purchase_Ticket_Payment()\n{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n placeReservationOrderForMinimumPayment();\n convertReservationsToPurchase(defaultGroupName,\"Ticket\");\n AppLoginLogout.logout(); \n}", "function productsForSale (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "function returnFormatedProducts(obj) {\n if (obj === null) return obj\n const reformatted = obj.products.map(product => {\n return {\n ...product,\n quantity: product.ProductOrder.quantity,\n price: product.ProductOrder.price\n }\n })\n return reformatted\n}", "function chatSaleService(salesServiceRecord){\r\n var serviceFlagCounter =0;\r\n var salesFlagCounter=0;\r\n var onlyServiceData = [];\r\n var onlySaleData = [];\r\n\r\n for(var i=0; i<salesServiceRecord.length; i++){\r\n if(salesServiceRecord[i].SALE_SERVICE_FLAG == \"SERVICE\"){\r\n serviceFlagCounter++;\r\n onlyServiceData.push(salesServiceRecord[i]);\r\n }\r\n else if(salesServiceRecord[i].SALE_SERVICE_FLAG == \"SALES\"){\r\n salesFlagCounter++;\r\n onlySaleData.push(salesServiceRecord[i]);\r\n }\r\n else{ \r\n } \r\n }\r\n salesServiceDoughnut(serviceFlagCounter, salesFlagCounter);\r\n getOnlyChatServiceData(onlyServiceData, serviceFlagCounter);\r\n getOnlyChatSaleData(onlySaleData, salesFlagCounter);\r\n }", "function viewSalesbyDept () {\n connection.query(\"SELECT department_name FROM departments\", function(err, res) {\n if (err) throw err;\n\n var departments = [];\n for(i in res) {\n join = `SELECT departments.department_name, departments.over_head_costs, SUM(product_sales) as 'total_sales'\n FROM departments INNER JOIN products \n ON departments.department_name = products.department_name\n WHERE departments.department_name = '${res[i].department_name}'; \n `\n\n connection.query(join, function(err, res2) {\n total_profit = res2[0].total_sales - res2[0].over_head_costs;\n salesInfo = new DepartmentSales(res2[0].department_name, res2[0].over_head_costs, res2[0].total_sales, total_profit);\n departments.push(salesInfo);\n console.table(salesInfo);\n });\n }\n });\n}", "function productsForSale() {\n connection.query('SELECT * FROM products', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity', 'product_sales'],\n colWidths: [10, 25, 20, 10, 18, 15]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].department_name, allProducts[i].price, allProducts[i].stock_quantity, allProducts[i].product_sales]);\n }\n\n console.log(table.toString());\n console.log('\\n');\n managerView();\n });\n}", "function shop(shoppers,item){\n var person = [];\n var profit = 0;\n var stok = item[2];\n for (var i = 0; i < shoppers.length; i++){\n if(shoppers[i].product === item[0] && shoppers[i].amount <= stok){\n stok -= shoppers[i].amount;\n profit += item[1]*shoppers[i].amount;\n person.push(shoppers[i].name);\n }\n }\n return [person,profit,stok];\n }", "function profit(info){\n let profit = (info.sellPrice - info.costPrice) * info.inventory;\n console.log(Math.round(profit));\n}", "function getDataInODATAFormat(result, schemaCollection) {\n var functName = \"getDataInODATAFormat\";\n var field;\n try {\n var entityCollection = [];\n var viewInfo = Tribridge.ViewEditor.CustomViews[index];\n //Check if result is null\n if (result != null && result != 'undefined') {\n for (var i = 0; i < result.length; i++) {\n entityCollection[i] = {};\n //Check for attributes\n if (result[i].attributes != null && result[i].attributes != 'undefined') {\n\n // Add the value of statecode to the dummy IsActiveRecord column\n if (result[i].attributes[\"statecode\"] != null && result[i].attributes[\"statecode\"] != undefined && result[i].attributes[\"statecode\"] != 'undefined') {\n entityCollection[i][\"_IsActiveRecord\"] = result[i].attributes[\"statecode\"].value;\n }\n\n //Check if schemaCollection have atrribute\n for (var j = 0; j < schemaCollection.length; j++) {\n\n var attri = \"\";\n\n attri = schemaCollection[j].field;\n\n if (attri != null && attri != undefined && attri != \"undefined\") {\n if (result[i].attributes[attri.toLowerCase()] != undefined && attri != \"undefined\") {\n field = result[i].attributes[attri.toLowerCase()];\n }\n else {\n field = schemaCollection[j];\n }\n }\n\n if (field != 'undefined' && field != undefined) {\n //Check for type and then add it according to format\n if (field.type != 'undefined' && field.type != undefined) {\n switch (field.type.toLowerCase()) {\n\n case \"OptionSetValue\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Value: field.value, FormattedValue: field.formattedValue };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Value: null, FormattedValue: null };\n }\n break;\n case \"EntityReference\".toLowerCase():\n if (field.id != undefined && field.id != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Id: field.id, Name: field.name, LogicalName: field.logicalName };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Id: null, Name: null, LogicalName: null };\n }\n break;\n case \"EntityCollection\".toLowerCase():\n //Do nothing\n break;\n\n case \"Money\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = { Value: (field.value) };\n }\n else {\n entityCollection[i][schemaCollection[j].field] = { Value: (0) };\n }\n break;\n case \"decimal\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = parseFloat(field.value).toFixed(2).toString();\n // entityCollection[i][schemaCollection[j].field] = parseFloat(field.value).toFixed(2);\n }\n else {\n entityCollection[i][schemaCollection[j].field] = parseFloat(0).toFixed(2).toString();\n }\n break;\n case \"int\".toLowerCase():\n case \"integer\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value.toString();\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n case \"double\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value.toString();\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n case \"datetime\".toLowerCase():\n if (field.value != undefined && field.value != \"undefined\") {\n var isFilterApplied = false;\n for (p = 0; p < viewInfo[\"Columns\"].length; p++) {\n if (viewInfo[\"Columns\"][p][\"Name\"] == schemaCollection[j].field) {\n isFilterApplied = viewInfo[\"Columns\"][p][\"Filterable\"];\n break;\n }\n }\n\n if (isFilterApplied) { // 0810\n // then bind HH:MM:SS = 0 else filtering wont work\n var arr = field.formattedValue.split(' ');\n var dd = new Date(arr[0]);\n\n entityCollection[i][schemaCollection[j].field] = new Date(dd.getFullYear(), dd.getMonth(), dd.getDate(), 0, 0, 0);\n }\n else {\n // then bind the actual time part of datetime\n var arr = field.formattedValue.split('T');\n if (arr.length > 1) {\n var time = arr[1].split(':');\n entityCollection[i][schemaCollection[j].field] = new Date(arr[0] + \", \" + time[0] + \":\" + time[1] + \":\" + \"00\");\n }\n else {\n entityCollection[i][schemaCollection[j].field] = new Date(arr[0]);\n }\n }\n }\n break;\n case \"image\".toLowerCase():\n entityCollection[i][schemaCollection[j].field] = { isValid: true, errorMsg: \"\", isNewRecord: false };\n break;\n default:\n if (field.value != undefined && field.value != \"undefined\") {\n entityCollection[i][schemaCollection[j].field] = field.value;\n }\n else {\n entityCollection[i][schemaCollection[j].field] = null;\n }\n break;\n\n }\n }\n }\n }\n }\n }\n }\n\n // check if any unsaved new records are present\n if (Tribridge.ViewEditor.ErrorRecords != null && Tribridge.ViewEditor.ErrorRecords.length > 0) {\n // Add the unsaved new records to the entity collection\n for (var i = 0; i < Tribridge.ViewEditor.ErrorRecords.length; i++) {\n //Check for new records\n if (Tribridge.ViewEditor.ErrorRecords[i].isNewRecord) {\n //Check if schemaCollection have atrribute\n var obj = {};\n for (var j = 0; j < schemaCollection.length; j++) {\n var attri = \"\";\n attri = schemaCollection[j].field;\n if (Tribridge.ViewEditor.ErrorRecords[i].record[attri] != null && Tribridge.ViewEditor.ErrorRecords[i].record[attri] != undefined) {\n obj[attri] = Tribridge.ViewEditor.ErrorRecords[i].record[attri];\n }\n }\n // Also add the colSaveVal field to bind the err\n obj[\"colSaveVal\"] = { isValid: false, errorMsg: Tribridge.ViewEditor.ErrorRecords[i].error, isNewRecord: true };\n entityCollection.splice(0, 0, obj);\n }\n }\n }\n return entityCollection;\n } catch (e) {\n throwError(functName, e);\n }\n}", "function totalSales(shirtQuantity,pantQuantity,shoeQuantity)\n{\n //condition for any case of not a number\n if(typeof (shirtQuantity||pantQuantity||shoeQuantity)!='number'){\n return 'énter a number'\n }\n //condition for any case of not a positive number\n if((shirtQuantity<=-1||pantQuantity<=-1||shoeQuantity<=-1)){\n return 'énter a positive number'\n }\n\n var shirtTotalCost=shirtPrice*shirtQuantity;\n var pantTotalCost=pantPrice*pantQuantity;\n var shoeTotalCost=shoePrice*shoeQuantity;\n var totalCost=shirtTotalCost+pantTotalCost+shoeTotalCost;\n //return from function\n return totalCost;\n}", "function total_sales_by_location(request){\n\n \t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar customer = request.parameters.customer;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\n//fleet\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\";\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\n\t\t\tif(customer==parent){\n\t\t\t\tlogic1=\"anyof\";\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\n//fleet variables for fleet number filter\n\t\t\tvar fleet_logic=\"noneof\";\n\t\t\t\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\t\t\t\n/*\t\t\t\t\t\t\n\t\t\tvar filter1=[\n\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t \"AND\", \n\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t \"AND\", \n\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t \"AND\", \n\t\t\t [\"location\",\"anyof\",\"8\",\"9\",\"10\",\"51\",\"52\",\"5\",\"228\",\"225\",\"223\",\"224\",\"222\"], \n\t\t\t \"AND\", \n\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t ];\n\t\t\tvar filter2=[\n\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t \"AND\", \n\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t \"AND\", \n\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t \"AND\", \n\t\t\t [\"entity\",\"is\",customer], \n\t\t\t \"AND\", \n\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t ];\n\t\t\t\n\t\t\tif(customer==848) filter=filter2\n\t\t\telse filter=filter1;\n\t*/\n\t\t\tvar filter=[\n\t\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"customer.parent\",logic1,parent1],\n\t\t\t\t \"AND\",\n\t\t\t\t [\"entity\",logic2,parent2],\n//fleet\t\t\t\t \n\t\t\t\t \"AND\",\n\t\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet],\n\t\t\t\t \"AND\",\n\t\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t\t ];\n\t\t\t\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\n\t\t\tvar searchObj = search.create({\n\t\t\t\t type: \"transaction\",\n\t\t\t\t filters:filter,\n\t\t\t\t columns:\n\t\t\t\t [\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"companyname\",\n\t\t\t\t join: \"customer\",\n\t\t\t\t summary: \"GROUP\",\n\t\t\t\t label: \"Location\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"formulacurrency\",\n\t\t\t\t summary: \"SUM\",\n\t\t\t\t formula: \"CASE WHEN {customer.category} != 'Krone' THEN {netamountnotax} ELSE 0 END\",\n\t\t\t\t label: \"Formula (Currency)\"\n\t\t\t\t })\n\t\t\t\t ]\n\t\t\t\t});\n\t\t\t\t\n\t \t//var searchObj = search.load({id: 'customsearch_sal_sales_by_branch_3_2_3'});\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t \tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t \tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\t\t\t\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t \treturn result_array;\n\t\t}", "function productsForSale() {\n console.log(\"products for sale fxn\");\n connection.query(\"SELECT * FROM products\",function(err, res){\n if (err) throw err;\n for (var i=0; i<res.length;i++) {\n console.log(`Product Name: ${res[i].product_name}`);\n console.log(`Department Name: ${res[i].department_name}`);\n console.log(`Selling Price: $${res[i].price}`);\n console.log(`Quantity in Stock: ${res[i].stock_quantity}`);\n console.log(\"---------------------\");\n }\n });\n connection.end();\n }", "async updateSale(saleID, storeID) {\n\n}", "function viewSale() {\n // console.log(\"view product....\")\n\n connection.query(\"SELECT * FROM products\", (err, data) => {\n if (err) throw err;\n console.table(data);\n connection.end();\n })\n}", "function totalSales(shirtQuantity, pantQuantity, shoeQuantity) {\n if (shirtQuantity < 0 || pantQuantity < 0 || shoeQuantity < 0) {\n return 'Product quantity could not be negative, please provide positive quantity.';\n } else if (typeof(shirtQuantity) === 'string') {\n return 'Please provide number quantity for shirts instead of text value.';\n } else if (typeof(pantQuantity) === 'string') {\n return 'Please provide number quantity for pants instead of text value.';\n } else if (typeof(shoeQuantity) === 'string') {\n return 'Please provide number quantity for shoes instead of text value.';\n } else {\n let shirtTotalPrice = shirtQuantity * 100; // total shirts price\n let pantTotalPrice = pantQuantity * 200; // total pants price\n let shoeTotalPrice = shoeQuantity * 500; // total shoes price\n\n return (shirtTotalPrice + pantTotalPrice + shoeTotalPrice); // return complete total price for all shirts, pants and shoes\n }\n}", "function totalSales(shirtQuantity, pantQuantity, shoeQuantity){\n // single product price\n var pershirtprice = 100;\n var perpantprice = 200;\n var pershoeprice = 500;\n // product price with quantity\n var shirtpricequantity= pershirtprice * shirtQuantity;\n var pantpricequantity= perpantprice * pantQuantity;\n var shoepricequantity= pershoeprice * shoeQuantity;\n // total sales of all products\n var total = shirtpricequantity + pantpricequantity + shoepricequantity;\n return total;\n // error message\n if( typeof total == 'string'){\n return 'Input cannot be negative number or a string';\n }\n }", "async function sf(){\n\n\t\t\tlet salesPromise = salesforceModel.getOpportunity(account);\n\t\t\tlet sfResult = await salesPromise;\n\t\t\treturn sfResult;\n \n \t\t}", "function imprimirDental(arregloDeObjetos) {\n console.log(arregloDeObjetos);\n $(\"div\").html(\"\").append(\"<h1>Consultas Dental</h1>\");\n arregloDeObjetos.forEach((objetoDelArray) => {\n $(\"div\").append(`\n <p>${Object.values(objetoDelArray).join(\"-\")}</p>\n `);\n });\n}", "function storeOpportunityDetails(opportunityObj){\n\tlocalStorage.konyOpportunityDetails = opportunityObj; //storing the corresponding opportunity details in localstorage\n\tchangePage('opportunitydetailspage','');\n}", "function salCalc() {\n //loop through employees \n for (var i = 0; i < empArray.length; i++) {\n totalSal += Number(empArray[i].annualSalary);\n } //END for loop\n var monthlySal = totalSal / 12;\n // append monthly salary to DOM\n $('#cost').replaceWith('<p id=\"cost\"> Cost: $' + monthlySal + '</p>');\n} //END salCalc function", "function FurnitureShop() {}" ]
[ "0.54950756", "0.5442647", "0.5410122", "0.5312123", "0.53018874", "0.5220079", "0.5210371", "0.5195265", "0.5180969", "0.5145649", "0.5078532", "0.50449085", "0.50380903", "0.5019473", "0.49916834", "0.49908888", "0.49891898", "0.49330318", "0.49132553", "0.49101803", "0.48600075", "0.4838095", "0.48333985", "0.48225403", "0.48125505", "0.48075178", "0.4798902", "0.47908524", "0.47805062", "0.47785026", "0.477813", "0.47774196", "0.47712874", "0.4764467", "0.47549558", "0.47518125", "0.47487593", "0.47364175", "0.47257596", "0.4724566", "0.4721479", "0.47102502", "0.47033513", "0.46836194", "0.4680343", "0.4672566", "0.4669905", "0.46602306", "0.46326256", "0.4620742", "0.4617027", "0.45986262", "0.4592076", "0.4588144", "0.45789853", "0.4576483", "0.45736808", "0.45718458", "0.45630366", "0.4558963", "0.45563027", "0.4550135", "0.45480758", "0.45465043", "0.4543061", "0.45374122", "0.45300466", "0.45268577", "0.45186493", "0.451649", "0.4514488", "0.45141083", "0.4508661", "0.45083934", "0.45061892", "0.44955108", "0.44827586", "0.44780287", "0.44741765", "0.4471129", "0.44668087", "0.4466135", "0.44624504", "0.445769", "0.44264016", "0.4422328", "0.44218916", "0.44162753", "0.4411405", "0.44100377", "0.4404564", "0.4400389", "0.43929774", "0.43915755", "0.4385527", "0.43849736", "0.43790975", "0.43775317", "0.43732604", "0.43718997" ]
0.5755146
0
This function converts an opportunity into lost opportunity
function convertToLostSale(itemID) { $('#AllOpps').hide(); $('#OppDetails').hide(); clearEditOppForm(); currentItem.set_item("_Status", "Lost Sale"); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearEditOppForm(); showLostSales(); } , function (sender, args) { var errArea = document.getElementById("errAllLeads"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOpposite() {\n\n return (BUY == orderType) ? SELL: BUY;\n\n }", "function assignOppositeFlow(flow) {\n\t\tvar candidates, i, j;\n\t\t\n\t\t// Make sure this flow doesn't already have an opposingFlow.\n\t\tif(!flow.hasOwnProperty(\"oppositeFlow\")) {\n\t\t\t// Look at the outgoing flows of the endpoint.\n\t\t\tcandidates = flow.getEndPt().outgoingFlows;\n\t\t\t\n\t\t\tfor(i = 0, j = candidates.length; i < j; i += 1) {\n\t\t\t\t// Make sure candidate doesn't already have an opposing flow\n\t\t\t\tif(!candidates[i].hasOwnProperty(\"opposingFlow\")) {\n\t\t\t\t\t// If the end point of candidate is same as start point\n\t\t\t\t\t// of flow\n\t\t\t\t\tif((candidates[i].getEndPt()) === (flow.getStartPt())) {\n\t\t\t\t\t\t// this candidate is an opposing flow.\n\t\t\t\t\t\tflow.oppositeFlow = candidates[i];\n\t\t\t\t\t\tcandidates[i].oppositeFlow = flow;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "function cleanUpOvData(row) {\n const checkinTime = row['Check-in'];\n const checkoutTime = row['Check-uit'];\n return {\n type: row.Transactie,\n time: checkinTime || checkoutTime, // return checkin if it exists\n date: row.Datum.split('-').reverse().join('-'),\n origin: row.Vertrek,\n destination: row.Bestemming, // return checkout if it exists\n };\n}", "badEvolve() {\n if (this.totalPoints >= 130){\n this.evoType = \"neutral\"\n } else {\n this.evoType = \"bad\"\n }\n }", "lose(opponent) {}", "async lose(game, data) {\n\t\tthis._lost = true;\n\t\tthis._lost_time = data.time;\n\t}", "async lose(game, data) {\n\t\tthis._lost = true;\n\t\tthis._lost_time = data.time;\n\t}", "_clearOutcomes() {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') ;\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }", "function convertToOpp(itemID) {\n hideAllPanels();\n clearEditLeadForm();\n currentItem.set_item(\"_Status\", \"Opportunity\");\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearNewLeadForm();\n showOpps();\n }, function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n\n}", "async lose(game, data) {\n\t\tthis._jump_time = data.time;\n\t\tthis._lost = true;\n\t}", "function convertFinalExperience() {\n var _data = data.experience._data,\n exp = copy(data.experience);\n\n switch (self.brandingSource) {\n case 'none':\n delete exp.data.branding;\n break;\n case 'publisher':\n exp.data.branding = _data.branding.publisher;\n break;\n case 'custom':\n exp.data.branding = _data.branding.custom;\n break;\n }\n\n exp.data.title = data.experience.title;\n exp.data.mode = _data.config.minireelinator.minireelDefaults.mode;\n exp.data.autoplay = _data.config.minireelinator.minireelDefaults.autoplay;\n exp.data.splash.ratio = _data.config.minireelinator.minireelDefaults.splash.ratio;\n exp.data.splash.theme = _data.config.minireelinator.minireelDefaults.splash.theme;\n exp.data.collateral.splash = null;\n exp.user = _data.user.id;\n exp.org = _data.org;\n\n delete exp.id;\n delete exp.created;\n delete exp.title;\n delete exp.lastUpdated;\n delete exp.versionId;\n delete exp.data.adConfig;\n delete exp._data;\n\n return exp;\n }", "loseTurn(){\n this.playerTurn = (this.playerTurn % 2) + 1;\n this.scene.rotateCamera();\n this.previousBishops = ['LostTurn'];\n this.activeBishop = null;\n }", "_clearOutcomes() {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') ;\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }", "onBoardEndTurn(event) {\n if (event.currentTeam !== this.team)\n return;\n\n if (\n this.disposition === 'enraged' ||\n this.disposition === 'exhausted' && this.mRecovery === 1\n )\n event.addResults([{\n unit: this,\n changes: { name:'Furgon', disposition:null },\n }]);\n }", "function lostReason(entityItem, value, oldValue, reasons) {\n modalManager.openModal('lostReason');\n }", "static function sendLossPaymentChanges(messageContext : MessageContext, payment : Payment) {\n if (payment.Exposure.ex_InSuit && payment.Exposure.State != \"draft\" && payment.CostType == \"claimcost\"\n && (payment.Status == \"pendingrecode\" || (messageContext.EventName == \"PaymentAdded\"\n && payment.Status != \"pendingtransfer\"\n && !(payment.PaymentBeingOffset != null && (payment.PaymentBeingOffset.Status == \"pendingrecode\"\n || payment.PaymentBeingOffset.Status == \"pendingtransfer\" ))))) {\n send(messageContext, payment.Exposure);\n }\n }", "function oppositeDoor(door) {\n const opposites = {\n L: \"R\",\n R: \"L\",\n U: \"D\",\n D: \"U\",\n };\n\n return opposites[door];\n }", "function replaceOE() {\n cy.edges().forEach(function(item, index, array) {\n let oE = item.data().originalEnds;\n if ( oE ) {\n let src = oE.source.id();\n let dst = oE.target.id();\n cy.$id(item.id()).data().originalEnds = {\n\t source: src,\n\t target: dst\n }\n };\n });\n}", "_clearOutcomes() {\n\t const outcomes = this._outcomes;\n\t this._outcomes = {};\n\t return Object.keys(outcomes).map(key => {\n\t const [reason, category] = key.split(':') ;\n\t return {\n\t reason,\n\t category,\n\t quantity: outcomes[key],\n\t };\n\t });\n\t }", "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "function pomodoroInterupted(breakPomoStreak) {\n\n stopAmbientSound();\n\n var failedBreakExtension = Vars.UserData.BreakExtentionFails && Vars.onBreakExtension;\n var breakExtensionZero = !Vars.UserData.BreakExtentionFails && (Vars.UserData.BreakExtention == 0);\n if (breakPomoStreak) {\n pomoReset();\n } else {\n pauseTimer();\n Vars.Timer = \"GO!\";\n }\n\n if (breakExtensionZero) {\n return;\n }\n\n if (Vars.UserData.PomoHabitMinus || failedBreakExtension) {\n FetchHabiticaData(true);\n var result = ScoreHabit(Vars.PomodoroTaskId, 'down');\n var msg = \"\";\n if (!result.error) {\n var deltaHp = (result.hp - Vars.Hp).toFixed(2);\n msg = \"You Lost Health: \" + deltaHp;\n FetchHabiticaData(true);\n } else {\n msg = \"ERROR: \" + result.error;\n }\n notify(\"Pomodoro Failed!\", msg);\n }\n}", "addInComingProp(prop_) {\n if (prop_.location instanceof Toss) {\n let insertIndex = prop_.location.magnitude - 2; // subtract one to convert to 0 base and one because it is caught a before thrown\n if (this.inComingProps[insertIndex] != null) {\n throw new TossException(prop_.location, \"Toss from \" + prop_.location.toString() + \" and \" + this.inComingProps[insertIndex] + \" will arrive at the same time\");\n }\n this.inComingProps[insertIndex] = prop_;\n } else {\n prop_.location = null; // pro has landed on the floor\n throw new TossException(prop_.location, \"Dropped prop \" + prop_.id + \" on the floor because it has no valid destination\");\n }\n }", "cancelEditAmmenities() {\n this.vendor.eighteen_plus = this.ammenitiesRevertData.eighteen_plus;\n this.vendor.twenty_one_plus = this.ammenitiesRevertData.twenty_one_plus;\n this.vendor.has_handicap_access = this.ammenitiesRevertData.has_handicap_access;\n this.vendor.has_lounge = this.ammenitiesRevertData.has_lounge;\n this.vendor.has_security_guard = this.ammenitiesRevertData.has_security_guard;\n this.vendor.has_testing = this.ammenitiesRevertData.has_testing;\n this.vendor.accepts_credit_cards = this.ammenitiesRevertData.accepts_credit_cards;\n\n this.ammenitiesRevertData = '';\n }", "function restoreOE() {\n\tcy.edges().forEach(function(item, index, array) {\n\t\tvar oE = item.data().originalEnds;\n\t\tif ( oE && typeof oE.source == 'string'\n\t \t&& cy.$id(oE.target).length > 0\n\t\t&& cy.$id(oE.source).length > 0) {\n\t \t\titem.data().originalEnds = {\n\t\t\t\tsource: cy.$id(oE.source),\n\t\t\t\ttarget: cy.$id(oE.target)\n\t\t\t}\n\t\t};\n\t});\n}", "declineMatch(){\n MATCH_DATA_SERVICE.get(this).declineOptionalMatch({'optionalMatchId': this.optionalMatch.id, 'matchReqId':this.matchReqId});\n STATE.get(this).go('matchRequest');\n }", "neutralEvolve() {\n if (this.totalPoints >= 130){\n this.evoType = \"good\"\n } else if (this.totalPoints >= 50 ){\n this.evoType = \"neutral\"\n } else {\n this.evoType = \"bad\"\n }\n }", "get adjustmentReason () {\n\t\treturn this._adjustmentReason;\n\t}", "end(lost) {\n this.finished = true;\n\n let return_obj = {\n incorrect_flags: [],\n unrevealed_mines: [],\n game_time: 0,\n };\n\n if (lost) {\n let cells = Object.values(this.virtual_grid);\n\n //reveal all incorrectly flagged mines\n return_obj.incorrect_flags = cells.filter(cell => cell.flagged && cell.state !== Config.CELL_MINE);\n return_obj.unrevealed_mines = cells.filter(cell => cell.state === Config.CELL_MINE && !cell.flagged);\n }\n\n //record the time. vs hiscore\n if (Config.HISCORE) {\n let end = new Date();\n return_obj.game_time = (end - this.game_start_time) / 1000;\n }\n\n return return_obj;\n }", "function cleanImprovementPropertyInventory(impPropInv){\n\t\tconsole.log(\"cleaning impPropInv\");\n\t\tvar intermedPI = impPropInv;\n\t\t//console.log(\"propertyInventory improvement length: \" + intermedPI.improvementNumber.length);\n\t\tvar propertyInventory = {};\n\t\tvar splitArray = (intermedPI.inventoryPropertyType ? intermedPI.inventoryPropertyType.split(\"\\n\") : [[],[],[]]);\n\t\tpropertyInventory.propertyType = splitArray[2];\n\t\tpropertyInventory.yearBuilt = {};\n\t\tpropertyInventory.yearBuilt.new = (intermedPI.yearBuiltAndAdjusted[0] ? intermedPI.yearBuiltAndAdjusted[0].split(\"\\n\")[2] : null);\n\t\tpropertyInventory.yearBuilt.adjusted = (intermedPI.yearBuiltAndAdjusted[1] ? intermedPI.yearBuiltAndAdjusted[1].split(\"\\n\")[2] : null);\n\t\tpropertyInventory.design = (intermedPI.design[0] ? intermedPI.design[0].split(\"\\n\")[2] : null);\n\t\tconsole.log(\"finished cleaning impPropInv\");\n\t\treturn propertyInventory;\n\t}", "playerLoses() {\n this.roundEnds('LOSER');\n }", "function teamOneRevive(data, pointsMap) {\n team.oneRevive(data.character_id, data.other_id, data.loadout_id, pointsMap);\n let loserName = teamOneObject.members.hasOwnProperty(data.other_id) ? teamOneObject.members[data.other_id].name : 'Random Pubbie';\n killfeedPlayer({\n winner: teamOneObject.members[data.character_id].name,\n winner_faction: teamOneObject.faction,\n winner_class_id: data.loadout_id,\n winner_net_score: teamOneObject.members[data.character_id].eventNetScore,\n loser: loserName,\n loser_faction: teamOneObject.faction,\n loser_net_score: teamOneObject.members[data.other_id].eventNetScore,\n weapon: 'Revive',\n is_revive: true\n });\n}", "cancel(){\n this.game.activeNPC.action=null;\n this.game.activeNPC=null;\n }", "function returnObjectLeave()\n{\n\treturn {\n\t\tname: \"Arreter le programme\",\n\t\tvalue: -2\n\t}\n}", "excavate(startPosition, direction, stepLength, tunnelWidth) {\n\n this.direction = direction\n this.tunnelWidth = tunnelWidth\n const radius = (this.tunnelWidth - 1) / 2\n if (this.direction === 'EAST') {\n Object.assign(this, { x: startPosition.x+1, y: startPosition.y-radius, width: 0, height: this.tunnelWidth })\n } else if (this.direction === 'WEST') {\n Object.assign(this, { x: startPosition.x, y: startPosition.y-radius, width: 0, height: this.tunnelWidth })\n } else if (this.direction === 'NORTH') {\n Object.assign(this, { x: startPosition.x-radius, y: startPosition.y, width: this.tunnelWidth, height: 0 })\n } else {\n Object.assign(this, { x: startPosition.x-radius, y: startPosition.y+1, width: this.tunnelWidth, height: 0 })\n }\n\n const minRoomSpacing = 1\n const minAnteroomSpacing = 0\n const minTunnelSpacing = 0\n let step = 0\n\n const ignore = this.parentTunnel\n while (step < stepLength) {\n const survey = expandAABB(this, this.direction, 1)\n if (!this.level.contains(survey)) {\n return 'DUNGEON-OVERLAP'\n }\n\n const entity = this.level.overlaps(survey, minRoomSpacing, minAnteroomSpacing, minTunnelSpacing, ignore)\n\n if (entity) {\n if (entity.prefab) {\n return 'PREFAB-OVERLAP'\n }\n if (entity.type === 'room') {\n // tunnels can't overlap with room corners\n if (this._atRoomCorner(entity)) {\n return 'ROOM-CORNER-OVERLAP'\n }\n\n // only create a door if the tunnel was excavated at all\n if ((this.width > 0) && (this.height > 0)) {\n var doorPosition = this._getDoorPosition(entity, this.direction)\n if (doorPosition) {\n // prohibit door placement when adjacent to any existing door\n const overlappingDoors = this.level.objects.filter(o => (o.type === 'door') && overlaps(doorPosition, o))\n if (overlappingDoors.length === 0) {\n const d = new Door(doorPosition)\n\n d.direction = this.direction\n this.level.addEntity(d)\n }\n }\n }\n }\n\n return entity.type.toUpperCase()\n }\n\n Object.assign(this, survey)\n step++\n }\n return 'CLOSED'\n }", "function fixCurrentInvestmentStyle(table) {\n let result = [];\n for (let i = 0, len = table.length; i < len; i++) {\n switch(i) {\n case 0: {\n // \"as at\"\n let value = Object.keys(table[i])[0].trim();\n value = value.slice(5,value.length).trim();\n result.push({'As at': value});\n break;\n }\n case 1: {\n // Ignore the second row\n break;\n }\n case 2: {\n // Strip the market cap and investment style information\n let value = Object.keys(table[i])[0].replace(/\\u00a0/g, \" \");\n let arr = value.split(\" \");\n result.push({'Market Cap': arr[0].slice(7, arr[0].length)});\n result.push({'Investment Style': arr[1].slice(7, arr[1].length)});\n break;\n }\n };\n }\n return result;\n}", "function setOpposed(opposed){\n this.opposed = opposed;\n}", "function C012_AfterClass_Jennifer_BreakUp() {\n\tGameLogAdd(\"LoverBreakUp\");\n\tCommon_PlayerLover = \"\";\n\tCommon_ActorIsLover = false;\n\tActorSetPose(\"\");\n\tLeaveIcon = \"\";\n}", "function cleanCase(side_obj) {\n side_obj['dissent'] = getJustices(side_obj['1']);\n side_obj['majority'] = getJustices(side_obj['2']);\n delete side_obj['1']; // renamed\n delete side_obj['2']; // renamed\n delete side_obj['']; // remove recusers\n return side_obj;\n }", "goodEvolve() {\n if (this.totalPoints >= 130){\n this.evoType = \"good\"\n } else {\n this.evoType = \"neutral\"\n }\n }", "function oppositeParty(party) {\n if (party === 'democrat') {\n return 'republican';\n } else if (party === 'republican') {\n return 'democrat';\n } else {\n console.log('WARNING: opposite party of ' + party + ' is requested. ' +\n 'Returning independent.');\n return 'independent';\n }\n}", "gameOver(winning) {\n document.getElementById(\"main-game\").removeEventListener('click', MODIFIER.turn, false);\n let winner = winning.player === DATA.human ? \"YOU WIN!\" : winning.player === DATA.ai ? \"YOU LOSE!\" : \"IT'S A TIE!\";\n VIEW.displayEndGame(winner);\n }", "alterRenteninfo (person) {\n const geburtsjahr = person.geburtstag.getFullYear()\n return person.jahrRenteninfo - 1 - geburtsjahr\n }", "function C101_KinbakuClub_RopeGroup_NaughtyRight() {\n\tif (!C101_KinbakuClub_RopeGroup_RightTwinToldNaughty) ActorSpecificChangeAttitude(C101_KinbakuClub_RopeGroup_RightTwin, -1, 1)\n\tC101_KinbakuClub_RopeGroup_RightTwinToldNaughty = true;\n}", "function rightTurn(rover) {\n switch (rover.direction) {\n case 'N':\n rover.direction = 'E'\n break;\n case 'E':\n rover.direction = 'S'\n break;\n case 'S':\n rover.direction = 'W'\n break;\n case 'W':\n rover.direction = 'N'\n break;\n };\n\t\tconsole.log(\"New Rover Direction: \" + rover.direction)\n}", "function lost(messageSeparator, message) {\n\tlet messagePattern = new RegExp(messageSeparator + '(.+)' + messageSeparator, 'gi');\n\tlet match = messagePattern.exec(message);\n\tlet msg = match[1];\n\tlet msgParts = message.split(match[0]);\n\tlet north = '';\n\tlet east = '';\n\tlet northPattern = /(north)([^,]+),([^,(north)|(east)]+)/gi;\n\tlet eastPattern = /([^,]+),([^,(north)|(east)]+)/gi;\n\tlet pattern = /(north|east)\\D*(\\d{2})[^\\,]*\\D*(,{1})\\D*(\\d{6})/gi;\n\tfor (let e of msgParts) {\n\t\twhile (match = pattern.exec(e)) {\n\t\t\tif (match[1].toLowerCase() == 'north') {\n\t\t\t\tnorth = match[2] + '.' + match[4] + ' N';\n\t\t\t} else if (match[1].toLowerCase() == 'east') {\n\t\t\t\teast = match[2] + '.' + match[4] + ' E';\n\t\t\t}\n\t\t} }\n\tconsole.log(north);\n\tconsole.log(east);\n\tconsole.log('Message: ' + msg);\n}", "function convertNewToReturnOriginal(options) {\n if ('new' in options) {\n options.returnOriginal = !options['new'];\n delete options['new'];\n }\n}", "function lose() {\n\ttime.Stop();\n\talive = false;\n\t\n\tstatistics.addGame(difficulty, statistics.state.lose);\n\tstatistics.addSeconds(difficulty, statistics.state.lose, seconds);\n\tstatistics.addDiscovered(difficulty, statistics.state.lose, calculateDiscoveredPercent());\n\t\n\t// Die statistics speichern\n\tPersistanceManager.saveStatistics(statistics);\n\t\n\tmessage(\"Sie haben verloren!<br> <br>\" + \n\t\t\t\"Schwierigkeit: \" + $('#difficulty :selected').text() + \" <br>\" +\n\t\t\t\"Benötigte Zeit: \" + timeCalculator(seconds) + \" <br>\" +\n\t\t\t\"Aufgedeckte Felder: \" + percCalculator(calculateDiscoveredPercent()) + \"%\");\n}", "function become(newState) {\n if (acceptableStates.indexOf(newState) === -1) {\n console.log(newState + ' is not an acceptable state');\n return;\n }\n state = newState;\n}", "function goBackward(rover) {\n switch (rover.direction) {\n case 'N':\n rover.position[0]--\n break;\n case 'E':\n rover.position[1]--\n break;\n case 'S':\n rover.position[0]++\n break;\n case 'W':\n rover.position[1]++\n break;\n };\n\t\tconsole.log(\"New Rover Position: [\" + rover.position[0] + \", \" + rover.position[1] + \"]\")\n}", "function restoreEllipsesInfo(obj, index) {\n if (index == SECOND_INDEX ) {\n if ($(obj).text() == ELLIPSES) {\n $(obj).html(($( WB_BC_ID ).data(ELLIPSES_DATA_STRING)).html());\n }\n }\n }", "function wonReason(entityItem, value, oldValue, reasons) {\n modalManager.openModal('wonReason');\n }", "get unmodifiedPointsToApply() {\n let injury = this.injury\n let pointsToApply =\n injury === 0\n ? this._parent.isFlexibleArmor && this._parent.useBluntTrauma\n ? this.effectiveBluntTrauma\n : 0\n : injury\n return pointsToApply\n }", "invertEnPassant(enPassent){\r\n if(enPassent === \"-\") return enPassent;\r\n else{\r\n var tmp = enPassent.split(\"\")\r\n var output = \"\";\r\n output += this.mapValue(tmp[0]);\r\n output += this.mapValue(tmp[1]);\r\n }\r\n return output;\r\n }", "function retractEndorsement(identifier) {\n // A user is retracting their endorsement for a skill! Do stuff about it..\n var skill_guid = $(identifier).data('guid');\n\n elgg.action('b_extended_profile/retract_endorsement', {\n 'guid': elgg.get_logged_in_user_guid(),\n 'skill': skill_guid\n });\n\n\n var targetSkill = $(identifier).data('skill');\n var targetSkillDashed = targetSkill.replace(/\\s+/g, '-').toLowerCase(); // replace spaces with '-' for css classes\n\n\n var endorse_count = $('.gcconnex-skill-entry[data-guid=\"' + skill_guid + '\"]').find('.gcconnex-endorsements-count').text();\n endorse_count--;\n $('.gcconnex-skill-entry[data-guid=\"' + skill_guid + '\"]').find('.gcconnex-endorsements-count').text(endorse_count);\n\n $('.gcconnex-skill-entry[data-guid=\"' + skill_guid + '\"]').append('<span class=\"gcconnex-endorsement-add elgg-button btn\" onclick=\"addEndorsement(this)\" data-guid=\"' + skill_guid + '\" data-skill=\"' + targetSkill + '\">Endorse</span>')\n\n //$(identifier).after('<span class=\"gcconnex-endorsement-add add-endorsement-' + targetSkillDashed + '\" onclick=\"addEndorsement(this)\" data-guid=\"' + skill_guid + '\" data-skill=\"' + targetSkill + '\">+</span>');\n $('.gcconnex-skill-entry[data-guid=\"' + skill_guid + '\"]').find('.gcconnex-endorsement-retract').remove();\n}", "leavesPlay() {\n // If this is an attachment and is attached to another card, we need to remove all links between them\n if(this.parent && this.parent.attachments) {\n this.parent.removeAttachment(this);\n this.parent = null;\n }\n\n if(this.isParticipating()) {\n this.game.currentConflict.removeFromConflict(this);\n }\n\n if(this.isDishonored && !this.anyEffect(EffectNames.HonorStatusDoesNotAffectLeavePlay)) {\n this.game.addMessage('{0} loses 1 honor due to {1}\\'s personal honor', this.controller, this);\n this.game.openThenEventWindow(this.game.actions.loseHonor().getEvent(this.controller, this.game.getFrameworkContext()));\n } else if(this.isHonored && !this.anyEffect(EffectNames.HonorStatusDoesNotAffectLeavePlay)) {\n this.game.addMessage('{0} gains 1 honor due to {1}\\'s personal honor', this.controller, this);\n this.game.openThenEventWindow(this.game.actions.gainHonor().getEvent(this.controller, this.game.getFrameworkContext()));\n }\n\n this.makeOrdinary();\n this.bowed = false;\n this.covert = false;\n this.new = false;\n this.fate = 0;\n super.leavesPlay();\n }", "function navAway()\r\n\t{\r\n\t\tif (!CloudSave.isIdle())\r\n\t\t\treturn \"Your changes haven't been saved yet.\";\r\n\r\n\t\treturn undefined;\r\n\t}", "handleFight(player, enemy, oldPosn, newPosn) {\n enemy.takeDamage(player.performAttack());\n player.takeDamage(enemy.performAttack());\n if (enemy.health <= 0) {\n this.level.updateMarker(player, oldPosn, newPosn);\n player.addXP(enemy.XPValue);\n return {\n type: enemy.type,\n defeated: true,\n name: enemy.name,\n // check if players health is below 0 or if defeated enemy\n // was final boss\n playerDead: this.isPlayerDead(),\n gameOver: this.isPlayerDead() || enemy.type === \"boss\"\n };\n }\n return {\n type: enemy.type,\n defeated: false,\n name: enemy.name,\n health: enemy.health,\n maxHealth: enemy.maxHealth,\n playerDead: this.isPlayerDead(),\n gameOver: this.isPlayerDead()\n };\n }", "function determineOutcome(newGuessedWord, correctWord, numGuesses) {\n if (newGuessedWord === correctWord) {\n _model.setOutcome(\"YOU WIN\");\n } else if (numGuesses === MAX_GUESSES) {\n _model.setOutcome(\"YOU LOSE\");\n } else {\n _model.setOutcome(\"\");\n }\n }", "function TEMPORARY_convertToUserDefinedResponse(event) {\n if (event.data.output.entities && event.data.output.entities[0]) {\n switch (event.data.output.entities[0].entity) {\n case \"Sedes\":\n datoEnviar.Sede = event.data.output.entities[0].value;\n break\n case \"Aulas\":\n datoEnviar.Aulas = event.data.output.entities[0].value;\n break\n case \"Carreras\":\n datoEnviar.Carreras = event.data.output.entities[0].value;\n break\n case \"Constancias\":\n datoEnviar.Constancias = event.data.output.entities[0].value;\n break\n case \"Materias\":\n datoEnviar.Materias = event.data.output.entities[0].value;\n break\n }\n\n //Map over all items in the output array.+\n event.data.output.generic = event.data.output.generic.map((item) => {\n // If we find one that matches our convention to transform to user_defined response type, make the transformation.\n if (item.response_type === 'text' ){\n switch (item.text) {\n case 'metodo-pago':\n item.response_type = 'Metodo de Pago';\n item.user_defined = event.data.output.user_defined;\n delete item.text;\n break\n case 'direccion-sede':\n item.response_type = 'Direccion';\n item.user_defined = event.data.output.user_defined;\n delete item.text;\n break\n case 'Horarios':\n item.response_type = 'Horarios';\n item.user_defined = event.data.output.user_defined;\n delete item.text;\n break\n case 'Examenes':\n item.response_type = 'Examenes';\n item.user_defined = event.data.output.user_defined;\n delete item.text;\n break; \n case 'certificado-generado':\n case 'Posgrado':\n case 'Laboratorio':\n item.response_type = 'aula';\n item.user_defined = event.data.output.user_defined;\n delete item.text;\n break\n case 'plan-estudio':\n item.response_type = 'Plan de Estudio';\n item.user_defined = event.data.output.user_defined;\n delete item.text;\n }\n }\n return item;\n });\n }\n}", "getPartyUnchangingData() {\n\n let data = {\n unbreakableWalls: GameElements.unbreakableWalls,\n grounds: GameElements.grounds,\n };\n return data;\n\n }", "function emitElimination(state, roomName, playerUsername, message) {\n const playerId = state[roomName].players[playerUsername].id;\n const score = state[roomName].players[playerUsername].score;\n delete state[roomName].players[playerUsername];\n\n io.to(playerId).emit(\"gameOver\", {\n message,\n score,\n winner: false,\n });\n}", "function C012_AfterClass_Amanda_BreakUp() {\n\tGameLogAdd(\"LoverBreakUp\");\n\tCommon_PlayerLover = \"\";\n\tCommon_ActorIsLover = false;\n\tActorSetPose(\"\");\n\tLeaveIcon = \"\";\n}", "getBreakAction(action) {\n const breakAction = { type:'break', unit:this, results:[] };\n\n // Any action will break focus.\n if (this.focusing)\n breakAction.results.push(this.getBreakFocusResult());\n\n // Any action except turning will break barrier.\n if (this.barriered && action.type !== 'turn') {\n const results = [];\n for (const fUnit of this.barriered) {\n // Skip if the unit barriered itself\n if (fUnit === this)\n continue;\n\n results.push({\n unit: fUnit,\n changes: {\n focusing: fUnit.focusing.length === 1\n ? false\n : fUnit.focusing.filter(u => u !== this),\n },\n });\n }\n\n // If none, it means we broke our own barrier\n if (results.length) {\n const result = breakAction.results.find(r => r.unit === this);\n const changes = { barriered:false };\n if (result) {\n result.changes.merge(changes);\n if (result.results)\n result.results.push(...results);\n else\n result.results = results;\n } else\n breakAction.results.push({ unit:this, changes, results });\n }\n }\n\n // Only moving breaks poison\n if (this.poisoned && action.type === 'move') {\n const results = [];\n for (const fUnit of this.poisoned) {\n results.push({\n unit: fUnit,\n changes: {\n focusing: fUnit.focusing.length === 1\n ? false\n : fUnit.focusing.filter(u => u !== this),\n },\n });\n }\n\n if (results.length) {\n const result = breakAction.results.find(r => r.unit === this);\n const changes = { poisoned:false };\n if (result) {\n result.changes.merge(changes);\n if (result.results)\n result.results.push(...results);\n else\n result.results = results;\n } else\n breakAction.results.push({ unit:this, changes, results });\n }\n }\n\n if (breakAction.results.length === 0)\n return null;\n\n return breakAction;\n }", "onGameEnd(){\n if (this.store.board.winner === null)\n this.emote(\"tie\");\n else if (this.store.board.winner)\n this.emote(\"defeat\");\n else\n this.emote(\"victory\");\n }", "function badDefense(data) {\n let teamsMap = new Map();\n const finals = data.filter((x) => x[\"Stage\"] === \"Final\");\n finals.forEach((x) => {\n const homeName = x[\"Home Team Name\"];\n const homeGoals = x[\"Home Team Goals\"];\n const awayName = x[\"Away Team Name\"];\n const awayGoals = x[\"Away Team Goals\"];\n if (!teamsMap.has(homeName)) {\n teamsMap.set(homeName, { goals: awayGoals, appearances: 1 });\n } else {\n let newGoals = teamsMap.get(homeName).goals + awayGoals;\n let newAppearances = teamsMap.get(homeName).appearances + 1;\n teamsMap.set(homeName, { goals: newGoals, appearances: newAppearances });\n }\n if (!teamsMap.has(awayName)) {\n teamsMap.set(awayName, { goals: homeGoals, appearances: 1 });\n } else {\n let newGoals = teamsMap.get(awayName).goals + homeGoals;\n let newAppearances = teamsMap.get(awayName).appearances + 1;\n teamsMap.set(awayName, { goals: newGoals, appearances: newAppearances });\n }\n });\n let worstAvg = 0;\n let worstTeam = \"\";\n let worstEntry;\n teamsMap.forEach((val, key, map) => {\n let currentAvg = val.goals / val.appearances;\n if (currentAvg > worstAvg) {\n worstAvg = currentAvg;\n worstTeam = key;\n worstEntry = `${key} —— Goals Against: ${val.goals}, App: ${val.appearances}`;\n } else if (currentAvg === worstAvg) {\n worstTeam.concat(\", \" + key);\n }\n });\n return `${worstTeam} has the most goals scored against per appearance: ${worstAvg}. \\n\\t${worstEntry}`;\n}", "function dealDamage(room, obj, attacker, dmg, selfInflicted = false) {\n obj.health -= dmg;\n\n // if the damage was NOT self inflicted (like bumping into an island or dock/city)\n if(!selfInflicted) {\n // if the attacker was a player ship, they receive a (feedback) message about the attack\n if(attacker.myUnitType == 0) {\n attacker.attackInfo.hits++;\n }\n\n // if the victim was a player ship, they receive an (error) message about the attack\n if(obj.myUnitType == 0) {\n obj.errorMessages.push([4,0]);\n }\n }\n\n // TO DO: Differentiate messages more, using the second parameter (now it's just a vague \"You were attacked!\")\n // TO DO: If a similar message already exists, nothing new is added. \n // => (If you have three cannonballs hitting the same ship, you don't want three messages saying \"Succesful attack! You hit ship X!\")\n\n // TO DO: This could be more efficient. We're repeating the code used when first CREATING monsters/aiShips/etc. \n // => On the other hand, it's not so bad as it's slightly different and short code :p\n\n // if we're dead ...\n if(obj.health <= 0) {\n // respawn (based on unit type)\n let uType = obj.myUnitType;\n\n // if the PLAYER killed something\n // they should get a message (\"You destroyed a <unit type>\"! Check your resources for loot\")\n if(attacker.myUnitType == 0) {\n attacker.errorMessages.push([7, uType]);\n }\n\n switch(uType) {\n // Player ship: no respawning, inform of game over\n case 0:\n // TO DO ... what do we do?\n\n // TO DO ... give REWARD to the attacker?\n\n break;\n\n // Monster: respawn to respawn location for this type\n // placeUnit() on the new location, change the monster's attributes\n case 1:\n // give reward to attacker\n if(attacker.myUnitType == 0) {\n // save it; monsters always give gold\n attacker.resources[0] = (+attacker.resources[0]) + (+obj.loot); \n }\n\n // get a spawn point\n let spawnPoint = room.spawnPoints[ Math.floor(Math.random() * room.spawnPoints.length) ];\n\n // move monster to new location\n placeUnit(room, {x: obj.x, y: obj.y, index: obj.index}, spawnPoint.x, spawnPoint.y, 'monsters');\n\n // give it new attributes (just replace the old object with a new one)\n let randomMonsterType = Math.floor( Math.random() * room.monsterTypes.length );\n room.monsters[obj.index] = createMonster(randomMonsterType, obj.index, room.averagePlayerLevel);\n\n break;\n\n // AI ship: respawn to random dock (with a route, which you pick immediately)\n case 2:\n // give reward to attacker\n if(attacker.myUnitType == 0) {\n // calculate reward\n // AI ships have different resources, based on their type\n // Those resources are scaled by the ship level (and attack strength)\n for(let res = 0; res < 4; res++) {\n // save it; get it directly from the object\n attacker.resources[res] = (+attacker.resources[res]) + (+obj.loot[res] );\n }\n\n }\n\n // Find a dock (WITH routes)\n let dockIndex, numDockRoutes;\n do {\n dockIndex = Math.floor(Math.random() * room.docks.length);\n numDockRoutes = room.docks[dockIndex].routes.length;\n } while(numDockRoutes < 1);\n\n // Pick a random route => get first position\n let routeIndex = Math.floor(Math.random() * numDockRoutes);\n let randRouteStart = room.docks[dockIndex].routes[routeIndex].route[0];\n\n // Change to a new ship\n room.aiShips[obj.index] = createAIShip(randRouteStart, routeIndex, room.averagePlayerLevel);\n\n // Start at one of the routes (placeUnit)\n placeUnit(room, {x: obj.x, y: obj.y, index: obj.index}, randRouteStart[0], randRouteStart[1], 'aiShips');\n break;\n\n // Docks (3) can't respawn => should change owner\n // Cities (3) can't respawn => should change owner\n }\n }\n}", "function crear_puntaje_equipo(nombre_equipo) {\n return {nombre:nombre_equipo,\n puntos:0,\n goles_a_favor:0,\n goles_en_contra:0,\n dif_gol:0\n };\n}", "deathOfEither(){\n if (playerPosition === this.position && !cells[playerPosition].classList.contains('powerUp')){\n endTheGame()\n winOrLoseScreen()\n win = false\n } else if (playerPosition === this.position && cells[playerPosition].classList.contains('powerUp')){\n this.position = 337\n playerScore += 5000\n cells[this.position].classList.remove(this.classname)\n gameoverAudio()\n this.eggTimer()\n }\n\n }", "function lose(element) {\n element.luck--;\n if (element.isVillain) {\n heroWins--;\n } else {\n capitolWins--;\n }\n}", "processCollision(game) {\r\n\t\t\treturn \"NODESTROY\";\r\n\t\t}", "function tf$introduceDoubleNegations(aloe) {\r\n\t\tvar rv = [];\r\n\t\tfor (var i = 0; i < aloe.length; ++i) {\r\n\t\t\tif (aloe[i].type == Expressions.TYPE_NEGATION) {\r\n\t\t\t\trv.push(aloe[i]);\r\n\t\t\t} else {\r\n\t\t\t\trv.push(aloe[i]);\r\n\t\t\t\trv.push(Expressions.Negation(Expressions.Negation(aloe[i])));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn rv;\r\n\t}", "function tourBattleEnd(winner, loser, result) {\r\n var winname = sys.name(winner).toLowerCase();\r\n var losename = sys.name(loser).toLowerCase();\r\n var key = null;\r\n for (var x in tours.tour) {\r\n if (isInSpecificTour(winname, x)) {\r\n key = x;\r\n break;\r\n }\r\n if (isInSpecificTour(losename, x)) {\r\n key = x;\r\n break;\r\n }\r\n }\r\n if (key === null) return;\r\n /* For tournament matches */\r\n if (tours.tour[key].players.indexOf(winname) > -1 && tours.tour[key].players.indexOf(losename) > -1) {\r\n var winindex = tours.tour[key].battlers.hasOwnProperty(winname);\r\n if (winindex) {\r\n var battletime = parseInt(sys.time(), 10)-tours.tour[key].battlers[winname].time;\r\n if (result == \"forfeit\" && ((battletime < 30 && !is1v1Tour(key)) || battletime < 5)) {\r\n sendBotAll(sys.name(loser)+\" forfeited against \"+sys.name(winner)+\" in a \"+getFullTourName(key)+\" match after \"+battletime+\" seconds.\",sys.channelId(\"Victory Road\"), false);\r\n }\r\n delete tours.tour[key].battlers[winname];\r\n }\r\n var loseindex = tours.tour[key].battlers.hasOwnProperty(losename);\r\n if (loseindex) delete tours.tour[key].battlers[losename];\r\n if (!winindex || !loseindex) {\r\n return;\r\n }\r\n if (result == \"tie\") {\r\n sendBotAll(\"The match between \"+winname+\" and \"+losename+\" ended in a tie, please rematch!\", tourschan, false);\r\n markActive(winner, \"tie\");\r\n markActive(loser, \"tie\");\r\n if (tours.tour[key].draws.indexOf(winname) == -1) {\r\n tours.tour[key].draws.push(winname, losename);\r\n }\r\n else {\r\n sendBotAll(winname+\" and \"+losename+\" drew more than once! Please check their match!\", sys.channelId(\"Victory Road\"), false);\r\n }\r\n return;\r\n }\r\n battleend(winner, loser, key);\r\n save_cache();\r\n }\r\n}", "handleOpponentLeaving()\n {\n console.log(\"opponent left\")\n playSound(\"oppLeft\");\n if(game.state.current===\"ticTac\")\n {\n Client.disconnectedFromChat({\"opponent\": game.opponent});\n game.state.start(\"waitingRoom\");\n }\n else\n {\n game.challengingFriend = false\n game.firstPlay = true\n }\n game.opponentLeft = true;\n $('#opponentCard').css({ 'right': '0px', 'right': '-20%' }).animate({\n 'right' : '-20%'\n });\n }", "function getVerbForm(newVerb) {\n var pppEnd;\n\n if (newVerb.mood == 0 || newVerb.mood == 1) {\n if (newVerb.aspect == 0)\t\t//incomplete\n {\n return (newVerb.lexis.PresStem + Conjugations[newVerb.lexis.Conjugation].Mood[newVerb.mood].Voice[newVerb.voice].Tense[newVerb.tense].Ending[newVerb.person]);\n\n }\n else {\n if (newVerb.voice == 0)\t\t//active\n {\n return (newVerb.lexis.PerfStem + PerfectEndings.Mood[newVerb.mood].Tense[newVerb.tense].Ending[newVerb.person]);\n }\n else {\n pppEnd = (newVerb.person < 3) ? \"us\" : \"i\";\n return (newVerb.lexis.PerfPassPart + pppEnd + \" \" + Esse.Mood[newVerb.mood].Tense[newVerb.tense].Ending[newVerb.person]);\n }\n }\n }\n\n else if (newVerb.mood == 2) { //infinitive\n if (newVerb.voice == 0) {\n switch (newVerb.tense) {\n case 0:\n return (newVerb.lexis.PresStem + InfinitiveEndings.Voice[0].Conjugation[newVerb.lexis.Conjugation]);\n break;\n case 1:\n return (newVerb.lexis.PerfStem + \"isse\");\n break;\n default:\t\t\t\t//only present and past active infins for now\n console.log(\"Currently invalid tense!\");\n return null;\n }\n }\n else if (newVerb.voice == 1) {\n switch (newVerb.tense) {\n case 0:\n return (newVerb.lexis.PresStem + InfinitiveEndings.Voice[1].Conjugation[newVerb.lexis.Conjugation]);\n break;\n default:\t\t\t\t//only present passive infins for now\n console.log(\"Currently invalid tense!\");\n return null;\n }\n }\n else {\n console.log(\"Invalid voice (\" + newVerb.voice + \") in getVerbForm()\");\n return null;\n }\n }\n\n else {\n console.log(\"Currently invalid mood (\" + newVerb.mood + \") in getVerbForm()\");\n return null;\n }\n\n}", "function lose() {\n gameEnd.css('display', 'block');\n endParagraph.html(`Being eaten alive by the bugs probably hurt. You gathered ${points} ${points == 1 ? 'point' : 'points'} before that happened.`);\n}", "fear() {\n\t\tthis.mentalScore--;\n\t\tif (this.mentalScore < 0) {\n\t\t\tthis.mentalScore = 0;\n\t\t}\n\t}", "function fail(item) {\n\tif (typeof item.name !== 'string' || typeof item.durability !== 'number' || typeof item.enhancement !== 'number') {\n\t\tthrow new Error('Information is not correct');\n\t}\n\n\tlet newItem = item;\n\n\tif (newItem.enhancement < 15) {\n\t\tnewItem.durability -= 5;\n\t} else {\n\t\tnewItem.durability -= 10;\n\t\tif (newItem.durability < 0) newItem.durability = 0;\n\t\tif (newItem.enhancement > 16) {\n\t\t\tnewItem.enhancement--;\n\t\t}\n\t}\n\treturn newItem;\n}", "swapPerso() {\n \n if (this.grille.personnages[0].nbtour === 0) {\n\n this.grille.personnages[0].nbtour = 3;\n \n let temp = this.grille.personnages[0];\n \n this.grille.personnages[0] = this.grille.personnages[1];\n this.grille.personnages[1] = temp;\n if (!this.attack){\n $(\"#actions\").prepend('<div id = \"changeP\" >Au tour du ' + this.grille.personnages[0].name + \"</br></div>\");\n }\n\n }\n \n }", "function leftTurn(rover) {\n switch (rover.direction) {\n case 'N':\n rover.direction = 'W'\n break;\n case 'E':\n rover.direction = 'N'\n break;\n case 'S':\n rover.direction = 'E'\n break;\n case 'W':\n rover.direction = 'S'\n break;\n };\n\t\tconsole.log(\"New Rover Direction: \" + rover.direction)\n}", "function decrire(personnage) {\n return `${personnage.nom} a ${personnage.sante} points de vie et ${personnage.force} en force`;\n }", "finishedCombat (tSource, tDest, attackerLoss, defenderLoss) {\n /* show combat results ? */\n console.log(\n 'Combat results: attacking territory ' +\n tSource +\n 'lost ' +\n attackerLoss +\n ' units, defending territory ' +\n tDest +\n 'lost ' +\n defenderLoss +\n ' units.'\n )\n\n var tmpSource = tSource\n var tmpDest = tDest\n\n /* were are getting IDs from server, getting name strings of countries */\n tSource = THIS.getCountryNameById(tSource)\n tDest = THIS.getCountryNameById(tDest)\n\n var cSource = getContinentOf(tSource)\n var cDest = getContinentOf(tDest)\n\n /* Unhighlight the belligerents */\n GameWindow.unhighlightTerritory()\n\n /* apply losses */\n THIS.map[cSource][tSource].soldiers -= attackerLoss\n THIS.map[cDest][tDest].soldiers -= defenderLoss\n /* displaying loss(es) on map (using country IDs) */\n GameWindow.updateCountrySoldiersNumber(tmpSource)\n GameWindow.updateCountrySoldiersNumber(tmpDest)\n // Rest\n console.log('attackUnits = ' + THIS.attackUnits)\n var restAttack = THIS.attackUnits - attackerLoss\n console.log('restattack = ' + restAttack)\n\n var attackingPlayer = THIS.getPlayerById(THIS.map[cSource][tSource].player)\n var defendingPlayer = THIS.getPlayerById(THIS.map[cDest][tDest].player)\n\n var myPlayer = THIS.getMyPlayer()\n\n console.log(attackingPlayer)\n console.log(defendingPlayer)\n console.log(myPlayer)\n\n GameWindow.addServerMessage(\n 'LOSSES',\n attackingPlayer.displayName +\n ' lost ' +\n attackerLoss +\n ' units <br>' +\n defendingPlayer.displayName +\n ' lost ' +\n defenderLoss +\n ' units'\n )\n\n var dead = false\n /* if there are no more units on the territory */\n if (THIS.map[cDest][tDest].soldiers <= 0) {\n // is dead : replace dest soldiers by attackers soldiers\n dead = true\n\n if (attackingPlayer.id == myPlayer.id) {\n // We attacked\n GameWindow.addServerMessage('COMBAT', 'You conquered ' + tDest + ' !')\n } else if (defendingPlayer.id == myPlayer.id) {\n GameWindow.addServerMessage('COMBAT', 'You lost ' + tDest + \" :'(\")\n } else {\n GameWindow.addServerMessage(\n 'COMBAT',\n defendingPlayer.displayName + ' lost ' + tDest\n )\n }\n\n THIS.view.players[THIS.map[cDest][tDest].player].nbTerritories--\n\n /* updating local player territories number (NW UI) */\n if (localStorage.getItem('myId') == THIS.map[cDest][tDest].player) {\n THIS.view.localTerritories--\n }\n\n THIS.map[cDest][tDest].player = THIS.map[cSource][tSource].player\n THIS.map[cDest][tDest].soldiers = restAttack\n THIS.map[cSource][tSource].soldiers -= THIS.attackUnits\n\n console.log('Attacker territory after conquer : ')\n console.log(tSource)\n console.log(THIS.map[cSource][tSource].soldiers)\n console.log('Territory ' + tDest + ' is conquered by the attacker')\n\n /* change the color of a territory during the pre-phase */\n GameWindow.setCountryColor(\n SupportedColors[THIS.map[cSource][tSource].player],\n tmpDest\n )\n /* puts the soldier icon with the number area */\n GameWindow.updateSoldierColor(\n SupportedColors[THIS.map[cSource][tSource].player],\n tDest\n )\n THIS.view.players[THIS.map[cSource][tSource].player].nbTerritories++\n\n /* updating local player territories number (NW UI) */\n if (localStorage.getItem('myId') == THIS.map[cSource][tSource].player) {\n THIS.view.localTerritories++\n }\n\n GameWindow.updateCountrySoldiersNumber(tmpDest)\n GameWindow.updateCountrySoldiersNumber(tmpSource)\n } else {\n GameWindow.updateCountrySoldiersNumber(tmpDest)\n }\n\n // updating the ratio bar\n for (var i = 0; i < THIS.totalPlayers; i++) {\n GameWindow.updateRatioBar(i, THIS.playerList[i].nbTerritories)\n }\n\n if (!dead) {\n this.beginAttackPhase()\n } else {\n // Player can move soldiers\n if (attackingPlayer.id == myPlayer.id) {\n THIS.lastFortify.tSource = tSource\n THIS.lastFortify.tDest = tDest\n GameWindow.fortifyAfterConquering(tSource, tDest)\n }\n }\n }", "loseLive(player, enemy) {\n if (!this.invulnerable) {\n this.lives--;\n this.invulnerable = true;\n this.zelda.alpha = 0.5;\n }\n }", "endTurn(){\n this.currentPlayer = (Object.is(this.currentPlayer, this.player1)) ? this.player2 : this.player1;\n this.currentPlayer[\"deck\"].draw();\n this.toggle = {\n \"HD\":false,\n \"HR\":false,\n \"DT\":false,\n \"EZ\":false,\n \"FL\":false,\n \"SD\":false\n };\n\n this.wincon = \"v2\";\n\n for(let effect of this.effectManager.globalEffects){\n console.log(JSON.stringify(effect));\n if(effect[\"duration\"] == 0){\n let index = this.effectManager.globalEffects.indexOf(effect);\n this.effectManager.globalEffects.splice(index, 1);\n }else{\n effect[\"duration\"] = effect[\"duration\"]-1;\n }\n }\n\n }", "loss(desired) {\n\t\tif (desired === undefined)\n\t\t\treturn \n\n\t\treturn this.__l_out.loss(this.contexts[this.__l_out.index], desired)\n\t}", "cancelEditHours() {\n let day = this.hoursRevertData;\n this.hours[day.day_order] = day;\n this.hoursRevertData = null;\n }", "function party_left(reason){\n\n\t//log.error('party_left for '+this.tsid);\n\n\tdelete this.party;\n\n\tswitch (reason){\n\t\tcase 'disband':\n\t\t\tthis.apiSendMsg({ type :'party_leave' });\n\t\t\tthis.party_activity(\"Your party has been disbanded\");\n\t\t\tbreak;\n\t\tcase 'invites-done':\n\t\t\t// the party was only emphemeral, being used for invites\n\t\t\tbreak;\n\t\tcase 'left':\n\t\t\tthis.apiSendMsg({ type :'party_leave' });\n\t\t\tthis.party_activity(\"You have left the party\");\n\t\t\tbreak;\n\t\tcase 'offline':\n\t\t\t// everyone went offline\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthis.apiSendMsg({ type :'party_leave' });\n\t\t\tthis.party_activity(\"Left party for unknown reason: \"+reason);\n\t}\n\n\t//this.sendActivity('MSG:party_leave');\n}", "function goCancel() {\n datacontext.revertChanges(vm.learningItem);\n goBack();\n }", "undo(move = this.lastMove()) {\n // decouple from previous\n if (move.previous) {\n move.previous.next = undefined\n }\n // splice all next moves\n const index = move.variation.findIndex(element => {\n return element.ply === move.ply\n })\n move.variation = move.variation.splice(index)\n }", "function disqualify(player, key, silent, hard) {\r\n try {\r\n if (tours.tour[key].players.indexOf(player) == -1) {\r\n return;\r\n }\r\n var index = tours.tour[key].players.indexOf(player);\r\n var winnerindex = tours.tour[key].winners.indexOf(player);\r\n var opponent;\r\n if (index%2 == 1) {\r\n opponent = tours.tour[key].players[index-1];\r\n }\r\n else {\r\n opponent = tours.tour[key].players[index+1];\r\n }\r\n /* If the opponent is disqualified/is a sub we want to replace with ~Bye~ instead of ~DQ~ so brackets don't stuff up */\r\n if (opponent == \"~DQ~\") {\r\n tours.tour[key].players.splice(index,1,\"~Bye~\");\r\n }\r\n else {\r\n tours.tour[key].players.splice(index,1,\"~DQ~\");\r\n }\r\n // splice from brackets as well in double elim\r\n if (hard && tours.tour[key].parameters.type == \"double\" && tours.tour[key].round >= 2) {\r\n var winindex = tours.tour[key].winbracket.indexOf(player);\r\n var opponent1;\r\n if (winindex != -1) {\r\n if (winindex%2 == 1) {\r\n opponent1 = tours.tour[key].winbracket[winindex-1];\r\n }\r\n else {\r\n opponent1 = tours.tour[key].winbracket[winindex+1];\r\n }\r\n /* If the opponent is disqualified/is a sub we want to replace with ~Bye~ instead of ~DQ~ so brackets don't stuff up */\r\n if (opponent1 == \"~DQ~\") {\r\n tours.tour[key].winbracket.splice(winindex,1,\"~Bye~\");\r\n }\r\n else {\r\n tours.tour[key].winbracket.splice(winindex,1,\"~DQ~\");\r\n }\r\n }\r\n var loseindex = tours.tour[key].losebracket.indexOf(player);\r\n if (loseindex != -1) {\r\n var opponent2;\r\n if (loseindex%2 == 1) {\r\n opponent2 = tours.tour[key].losebracket[loseindex-1];\r\n }\r\n else {\r\n opponent2 = tours.tour[key].losebracket[loseindex+1];\r\n }\r\n /* If the opponent is disqualified/is a sub we want to replace with ~Bye~ instead of ~DQ~ so brackets don't stuff up */\r\n if (opponent2 == \"~DQ~\") {\r\n tours.tour[key].losebracket.splice(loseindex,1,\"~Bye~\");\r\n }\r\n else {\r\n tours.tour[key].losebracket.splice(loseindex,1,\"~DQ~\");\r\n }\r\n }\r\n }\r\n /* We then check if opponent hasn't advanced, and advance them if they're not disqualified. We also remove player from winners if DQ'ed */\r\n if (opponent != \"~DQ~\" && winnerindex == -1 && tours.tour[key].winners.indexOf(opponent) == -1) {\r\n if (!isSub(opponent) && opponent != \"~Bye~\") {\r\n tours.tour[key].winners.push(opponent);\r\n tours.tour[key].losers.push(player);\r\n if (!silent) {\r\n sendAuthPlayers(flashtag+html_escape(toCorrectCase(opponent))+flashtag+\" advances to the next round of the \"+html_escape(getFullTourName(key))+\" by default!\", key);\r\n }\r\n }\r\n else {\r\n tours.tour[key].winners.push(\"~Bye~\");\r\n tours.tour[key].losers.push(player);\r\n }\r\n }\r\n else if (winnerindex != -1 && opponent != \"~Bye~\" && opponent != \"~DQ~\" && (isInTour(opponent) === false || isInTour(opponent) === key)) { /* This is just so the winners list stays the same length */\r\n tours.tour[key].winners.splice(winnerindex,1,opponent);\r\n tours.tour[key].losers.splice(tours.tour[key].losers.indexOf(opponent),1,player);\r\n if (!silent) {\r\n sendAuthPlayers(flashtag+html_escape(toCorrectCase(opponent))+flashtag+\" advances to the next round of the \"+html_escape(getFullTourName(key))+\" because \"+html_escape(toCorrectCase(player))+\" was disqualified!\", key);\r\n }\r\n }\r\n var battlesleft = parseInt(tours.tour[key].players.length/2, 10)-tours.tour[key].winners.length;\r\n save_cache();\r\n if (battlesleft <= 0) {\r\n if (tours.tour[key].state == \"subround\") removesubs(key);\r\n advanceround(key);\r\n }\r\n }\r\n catch (err) {\r\n sendChanAll(\"Error in process 'disqualify': \"+err, tourserrchan);\r\n }\r\n}", "if (\n this.props.entity &&\n this.props.entity !== prevProps.entity\n ) {\n this.setState({ forceSource: false });\n this.analyzeFluentMessage();\n }", "function C101_KinbakuClub_RopeGroup_NaughtyLeft() {\n\tif (!C101_KinbakuClub_RopeGroup_LeftTwinToldNaughty) ActorSpecificChangeAttitude(C101_KinbakuClub_RopeGroup_LeftTwin, -1, 1)\n\tC101_KinbakuClub_RopeGroup_LeftTwinToldNaughty = true;\n}", "function cancel() {\n if (props.interview) {\n return transition(SHOW);\n }\n return transition(EMPTY);\n }", "function plainNegativeComplete(hiraganaVerb, type) {\n return type == \"u\" ? hiraganaVerb.substring(0, hiraganaVerb.length - 1) + changeUtoA(hiraganaVerb.charAt(hiraganaVerb.length - 1)) + \"ない\" :\n hiraganaVerb.substring(0, hiraganaVerb.length - 1) + \"ない\";\n}", "async function replaceStopLossOrder(task) {\n\n try {\n const {order, stopLossPrice} = task.data;\n await binanceHelpers.cancelOrder(order.clientId, order.symbol, order.binanceOrderId);\n \n const o = await Order.findByPk(order.id);\n o.status = 'CANCELED';\n await o.save();\n\n debug(`REPLACE STOP_LOSS_LIMIT (DEAL#${order.dealId}/ORDER#${order.id}/${order.symbol}/PREV-PRICE:${order.price}/NEW-PRICE:${stopLossPrice})`);\n\n const deal = await Deal.findByPk(order.dealId);\n await addStopLossOrderQueue.add({\n stopLossPrice,\n deal: deal.toJSON()\n });\n\n\n } catch (err) {\n errorHandler(err, task.data);\n debug(`ERROR: ${err.message}`);\n }\n\n}", "createGameObject(opponent, date, location, homeOrAway, stats) {\n let newID = this.getGameID(opponent,date);\n return {\n id: newID,\n removed: false,\n opponent: opponent,\n date: date,\n location: location,\n homeOrAway: homeOrAway,\n gameStats: stats\n }\n }", "function party_declined(pc, expired){\n\n\tif (expired){\n\t\tthis.party_activity(utils.escape(pc.label)+' has declined your invitation (expired)');\n\t}else{\n\t\tthis.party_activity(utils.escape(pc.label)+' has declined your invitation');\n\t}\n}", "judgeWinner(houseChoice, playerChoice) {\n\t\tconst values = {\n\t\t\tpaper: 0,\n\t\t\tscissors: 1,\n\t\t\trock: 2\n\t\t};\n\n\t\tconst difference = values[playerChoice] - values[houseChoice];\n\n\t\tlet outcome = \"\";\n\n\t\tif ((difference > 0 && difference !== 2) || difference === -2) {\n\t\t\tthis.props.increaseScore();\n\t\t\toutcome = \"YOU WIN\";\n\t\t} else if (difference === 0) {\n\t\t\toutcome = \"DRAW\";\n\t\t} else {\n\t\t\toutcome = \"YOU LOSE\";\n\t\t}\n\n\t\tthis.setState({\n\t\t\tgameResult: outcome\n\t\t});\n\t}", "function emitGameOver(state, roomName, message, winner) {\n console.log(\"gameover\");\n for (const [username, value] of Object.entries(state[roomName].players)) {\n delete state[roomName].players[username];\n\n io.to(value.id).emit(\"gameOver\", {\n message: message,\n score: value.score,\n isWinner: winner === username,\n });\n }\n\n delete state[roomName];\n}", "function losingLife() {\n switch (lives) {\n case 2:\n\t\t\ttwoLives();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\toneLife();\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\tnoLives();\n\t\t\tbreak;\n }\n}", "revert() { }" ]
[ "0.5084763", "0.50229406", "0.49570805", "0.4934618", "0.49278998", "0.49138314", "0.49138314", "0.48153996", "0.48037946", "0.47967684", "0.47928435", "0.4789087", "0.47878963", "0.47853902", "0.4744723", "0.47378787", "0.47327945", "0.4720696", "0.47020024", "0.46769297", "0.46657875", "0.4654316", "0.46464565", "0.4618834", "0.4617734", "0.4596196", "0.45872808", "0.45819753", "0.45691016", "0.45617366", "0.4556445", "0.45288447", "0.45118922", "0.45109555", "0.4504685", "0.44871202", "0.4465039", "0.44570053", "0.44345972", "0.44323373", "0.44192728", "0.44186798", "0.4412349", "0.44078887", "0.44027707", "0.4402306", "0.44019726", "0.44015878", "0.4390158", "0.4390082", "0.4383379", "0.4371702", "0.4369399", "0.43667448", "0.4357601", "0.43522224", "0.43507472", "0.4350614", "0.43407527", "0.43403557", "0.43286762", "0.4328157", "0.4324819", "0.4321195", "0.43181226", "0.43098342", "0.430823", "0.4306512", "0.43027338", "0.43025005", "0.43017194", "0.42992228", "0.42967367", "0.42943498", "0.4287142", "0.42848957", "0.42781594", "0.42735016", "0.42709926", "0.42702544", "0.42692384", "0.4265331", "0.42634502", "0.42616653", "0.42583492", "0.42521688", "0.42484432", "0.42473847", "0.42440605", "0.4243753", "0.42385447", "0.42369366", "0.42364356", "0.42330164", "0.42315078", "0.4230484", "0.42284358", "0.42272875", "0.42257535", "0.42252338" ]
0.4630659
23
This function updates an existing opportunity's details
function saveEditOpp() { if ($('#editOppAmount').val() == "" || $('#editOpp').val() == "") { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Organization Name or amount field is empty.")); errArea.appendChild(divMessage); } else { currentItem.set_item("Title", $('#editOpp').val()); currentItem.set_item("ContactPerson", $('#editOppPerson').val()); currentItem.set_item("ContactNumber", $('#editOppNumber').val()); currentItem.set_item("Email", $('#editOppEmail').val()); currentItem.set_item("DealAmount", $('#editOppAmount').val()); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { clearEditOppForm(); showOpps(); }, function (sender, args) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function updateOpportunityDetails (req, res) {\n res.send(await service.updateOpportunityDetails(req.authUser, req.params.opportunityId, req.body))\n}", "function update() {\n updateGym(id, name, address1, address2, town, county, openingHours)\n .then(() => {\n alert(\"Gym Information updated!\");\n })\n .catch((error) => {\n alert(error.message);\n });\n }", "async function updateOpportunityPhases (req, res) {\n res.send(await service.updateOpportunityPhases(req.authUser, req.params.opportunityId, req.body))\n}", "update(data) {\n this.vendorDataService.updateVendor(this.id, data)\n .$promise\n .then((data) => {\n this.log(data);\n this.editing = '';\n this.addressRevertData = '';\n this.hoursRevertData = '';\n this.ammenitiesRevertData = '';\n this.menu = data.menu;\n this.vendor = data;\n this.hours = this.setUpHours()\n\n })\n .catch((error) => {\n this.error('XHR Failed for getContributors.\\n' + angular.toJson(error.data, true));\n });\n }", "function updateOpportunitySource(req, res) {\n if (!validator.isValid(req.body.sourceName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n source.findOne({sourceName: {$regex: new RegExp('^' + req.body.sourceName + '$', \"i\")}, moduleType: req.body.moduleType, deleted: false, companyId: req.body.companyId}, function(err, statusData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (statusData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_STATUS_EXIST\n });\n }\n else {\n var sourceDataField = {\n sourceName: req.body.sourceName,\n companyId: req.body.companyId,\n userId: req.body.userId\n\n };\n source.findByIdAndUpdate(req.body.sourceId, sourceDataField, function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n\n}", "update (context, ideaPersistenceData) {\n return ideaAdapter.updateIdea(ideaPersistenceData)\n }", "updateInvestmentDetails() {\n\t\tif (\"SecurityInvestment\" === this.transaction.transaction_type) {\n\t\t\t// Base amount is the quantity multiplied by the price\n\t\t\tthis.transaction.amount = (Number(this.transaction.quantity) || 0) * (Number(this.transaction.price) || 0);\n\n\t\t\t// For a purchase, commission is added to the cost; for a sale, commission is subtracted from the proceeds\n\t\t\tif (\"inflow\" === this.transaction.direction) {\n\t\t\t\tthis.transaction.amount += Number(this.transaction.commission) || 0;\n\t\t\t} else {\n\t\t\t\tthis.transaction.amount -= Number(this.transaction.commission) || 0;\n\t\t\t}\n\t\t}\n\n\t\t// If we're adding a new buy or sell transaction, update the memo with the details\n\t\tif (!this.transaction.id && \"SecurityInvestment\" === this.transaction.transaction_type) {\n\t\t\tconst\tquantity = Number(this.transaction.quantity) > 0 ? String(this.transaction.quantity) : \"\",\n\t\t\t\t\t\tprice = Number(this.transaction.price) > 0 ? ` @ ${this.currencyFilter(this.transaction.price)}` : \"\",\n\t\t\t\t\t\tcommission = Number(this.transaction.commission) > 0 ? ` (${\"inflow\" === this.transaction.direction ? \"plus\" : \"less\"} ${this.currencyFilter(this.transaction.commission)} commission)` : \"\";\n\n\t\t\tthis.transaction.memo = quantity + price + commission;\n\t\t}\n\t}", "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "function storeOpportunityDetails(opportunityObj){\n\tlocalStorage.konyOpportunityDetails = opportunityObj; //storing the corresponding opportunity details in localstorage\n\tchangePage('opportunitydetailspage','');\n}", "handleUpdate() {\n // Re-combining fields into one location field \n // for easy update, not currently in use\n var location = this.state.building + \".\" + this.state.floor + \".\" + this.state.room\n fetch(myPut + '/' + this.state.oneApp.id, {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: 'put',\n body: JSON.stringify({\n title: this.state.title,\n meetingdate: this.state.meetingdate,\n meeting_user: this.state.meeting_user,\n note: this.state.note,\n location: this.state.location\n })\n })\n .then(() => this.fetchAppointment())\n alert('The appointment has been successfully updated')\n }", "editMedicalDetails(InjuredDetails) { \n var headers = JSON.parse(InjuredDetails); \n return new Promise((resolve, reject) => {\n Injured.update({'id': headers.id}, \n {$set:{ \"airWay\" : headers.airWay,\n \"breathing\" : headers.breathing,\n \"blood_pressure\" : headers.blood_pressure,\n \"disability\" : headers.disability,\n \"exposure\" : headers.exposure,\n \"heartbeat\" : headers.heartbeat,\n \"toHospital\" : headers.toHospital}}, (err) => {\n if (err) reject (err);\n else resolve(`edit ${headers.id}`);\n });\n })\n }", "update() {\n const {name, address1, address2, city, state: stateVal, zip, phone, creditValuePercentage, maxSpending, payoutAmountPercentage} = this.displayData.details;\n const {companyId, storeId} = state.get(this).params;\n const params = {\n name,\n address1,\n address2,\n city,\n state: stateVal,\n zip,\n phone,\n companyId,\n storeId\n };\n // Alternate usage\n if (this.alternativeGcmgr) {\n params.creditValuePercentage = creditValuePercentage;\n params.maxSpending = maxSpending;\n params.payoutAmountPercentage = payoutAmountPercentage;\n }\n // Update the store\n Service.get(this).update(params)\n .then(() => {\n // Redirect\n state.get(this).go('main.corporate.store.details', {companyId: params.companyId, storeId: params.storeId});\n });\n }", "async function updateOpportunityMembers (req, res) {\n await service.updateOpportunityMembers(req.authUser, req.params.opportunityId, req.body)\n res.status(204).end()\n}", "updateCoffeeLot(coffeeLotId, coffeeLot) {\r\n \r\n }", "function update(req, res) {\n if (req.body._id) {\n delete req.body._id;\n }\n PlanSection.findByIdAsync({ _plan_id: req.params.plan_id, _id: req.params.id }).then(handleEntityNotFound(res)).then(saveUpdates(req.body)).then(responseWithResult(res))['catch'](handleError(res));\n}", "async update(req,res){\n try{\n let params = req.allParams();\n let attributes = {};\n\n if(params.name){\n attributes.name = params.name;\n }\n if(params.city){\n attributes.city = params.city;\n }\n if(params.phone){\n attributes.phone = params.phone;\n }\n\n const results = await Company.update({id: req.params.id}, attributes);\n return res.ok(results);\n }\n catch(err){\n return res.serverError(err);\n }\n }", "function editarenainfo(req, res) {\n var arenaid = req.params.arenaid;\n Arena.findOne({ _id: arenaid }, function (err, arena) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n if (!arena) {\n return res.status(400).json({ error: 'the arena is not found' });\n }\n if (req.user && arena.service_provider == req.user._id) {\n\n \n req.checkBody('address', 'Address is required.').notEmpty();\n req.checkBody('location', 'Location is required.').notEmpty();\n req.checkBody('size', 'The arena size is required.').notEmpty();\n req.checkBody('type', 'The arena type is required.').notEmpty();\n req.checkBody('price', 'The price are required.').notEmpty();\n\n var errors = req.validationErrors();\n\n if (errors) {\n return res.status(400).json(errors);\n }\n\n arena.rules_and_regulations = req.body.rules_and_regulations;\n arena.address = req.body.address;\n arena.location = req.body.location;\n arena.size = req.body.size;\n arena.type = req.body.type;\n arena.price = req.body.price;\n arena.save(function (err) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n return res.json(arena);\n });\n } else {\n return res.status(400).json({ error: 'you are not autherized to view this page' });\n }\n });\n}", "function editAdmit() {\n dataService.get('admission', {'PATKEYID':$scope.patient.KEYID}).then(function(data){\n var admitArr = data.data;\n var currentAdmit = admitArr.slice(-1).pop();\n $scope.currentAdmitKEYID = currentAdmit.KEYID;\n\n //update admit object\n var updateAdmit = {\n KEYID: $scope.currentAdmitKEYID,\n PATSTATUS: 'D',\n DCDATE: $filter(\"date\")($scope.M0906_DC_TRAN_DTH_DT, 'yyyy/MM/dd'),\n DCREASON: $scope.DCREASON\n };\n console.log(updateAdmit);\n dataService.edit('admission', updateAdmit).then(function(response) {\n console.log(response);\n });\n });\n }", "function _Update(objRequest, objResponse) {\n nlapiLogExecution('AUDIT','UPDATE Courses', '=====START=====');\n var stCustId = objRequest['CustomerId'];\n var httpBody = objRequest;\n nlapiLogExecution('AUDIT', 'Update Course', 'Update function in Departments executed.');\n\n var objDataResponse = {\n Response: 'F',\n Message: 'Default Value',\n ReturnId: ''\n };\n\n var loadedICourseRecord = nlapiLoadRecord('customrecord_rc_course', httpBody.Id);\n\n try {\n loadedICourseRecord.setFieldValue('custrecord_rc_course_title', httpBody.Title),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_number', httpBody.Number),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_level', httpBody.CreditLevel.Id),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_hours', httpBody.CreditHours),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_syllabi_name', httpBody.SyllabiName),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_institution', httpBody.ModeOfInstruction),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_reg_course', httpBody.RegisteredCourseId)\n objDataResponse.ReturnId = nlapiSubmitRecord(loadedICourseRecord, true)\n }\n catch (ex) {\n nlapiLogExecution('ERROR', 'Something broke trying to set fields' + ex.message)\n }\n\n if(objDataResponse.ReturnId){\n objDataResponse.Response = 'T';\n objDataResponse.Message = 'Yo it seems as though we have been successful with dis otha endevour' + JSON.stringify(loadedICourseRecord)\n }\n\n // Ask john.\n //1.)How to deal with \"missing\" values. What values must be supplied at any given stage\n // Mode up is required(looking at ns)\n\n // its either a list OR a record A list has id and value when writing i only provide an ID, don't pass anything but the id\n // think of it as an Enumerator, a number that means something else.\n //2.)How to deal with list objects\n\n nlapiLogExecution('AUDIT','UPDATE Courses', '======END======');\n return JSON.stringify(objDataResponse)\n}", "updateJob(req, res) {\n const jobtitle = req.body.jobtitle;\n const jobtype = req.body.jobtype;\n const jobdescription = req.body.jobdescription;\n const requiredexperience = req.body.requiredexperience;\n const jobprice = req.body.jobprice;\n const id = req.body.id;\n\n job\n .updateOne(\n { _id: id },\n {\n jobtitle: jobtitle,\n jobtype: jobtype,\n jobdescription: jobdescription,\n requiredexperience: requiredexperience,\n jobprice: jobprice,\n }\n )\n .then(function (result) {\n res.status(200).json({ message: \"Job has been updated\" });\n })\n .catch(function (err) {\n res.status(500).json({ message: err });\n });\n }", "_editItem() {\n // Edit Item from Order's Items array:\n let items = this.order.items;\n items[this.item.key] = this.item;\n this.order.items = items;\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeEditItem(); // Close edit Product modal view:\n }", "async update ({ params, request, response }) {\n const product = await Product.find(params.id)\n const data = request.only([\n \"name\", \n \"description\", \n \"price\"\n ])\n product.merge(data)\n if (product) {\n response.status(200).json({\n success: 'Product Updated',\n data: data\n })\n await product.save()\n } else {\n response.status(304).send({ error: 'Product Not Updated' })\n }\n }", "function update(req, res) {\n\tdb.Place.findById(req.params.placeId, function (err, updatePlace) {\n \t\tif (err) {\n\t\t\tres.send(err)\n\t\t};\n\t\tupdatePlace.placeName = req.body.placeName;\n\t\tupdatePlace.description = req.body.description;\n\t\tupdatePlace.rating = req.body.rating;\n\t\tupdatePlace.priority = req.body.priority;\n\t\tupdatePlace.placeIMG = req.body.placeIMG;\n\t\tupdatePlace.visitDate = req.body.visitDate;\n\t\tupdatePlace.save(function(err, updatedPlace) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log('place save error: ', err);\n\t\t\t} else {\n\t\t\t\tconsole.log('saved place: ', updatedPlace);\n\t\t\t\tres.json(updatedPlace);\n\t\t\t}\n\t\t});\n\t});\n}", "function updateEditForm(data){\n $('#editRoomTheaterSelect').val(data.theater_id);\n $('#editRoomCapacity').val(data.capacity);\n }", "function editCompany(companyId, company) {\n var path = \"/api/company/\" + companyId;\n return fetch(path, {\n method: \"put\",\n headers: new Headers({\n \"Content-Type\": \"application/json\",\n }),\n body: JSON.stringify(company),\n credentials: \"include\",\n })\n .then((response) => {\n return response.json();\n })\n .catch((err) => {\n console.log(err);\n });\n}", "updateSupplier(params) {\r\n return Api().post('/updatesupplier', params)\r\n }", "function editInterview(id, interview){\n const appointment = {\n ...state.appointments[id],\n interview: { ...interview }\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n return axios.put(`http://localhost:8001/api/appointments/${id}`, {interview})\n .then(response => \n setState({\n ...state,\n appointments\n })\n )\n \n }", "function editActualCost(event) {\n event.preventDefault();\n\n $.getJSON( '/events/activities/id/' + $(this).attr('rel'), function( data ) {\n console.log(data);\n console.log(data.day);\n $('#txtEditActivityDay').val(data.day);\n $('#txtEditActivityTime').val(data.time);\n $('#txtEditActivityPlace').val(data.place);\n $('#txtEditActivity').val(data.activity);\n $('#txtEditActivityEstCost').val(data.estBudget);\n if(data.actualCost != null)\n $('#txtEditActivityActualCost').val(data.actualCost);\n });\n\n $('#txtEditActivityId').val($(this).attr('rel'));\n \n $('#edit-actual-cost-form').dialog('open'); \n}", "update(req, res) {\n return OrderDetails.find({\n where: {\n OrderId: req.params.orderid,\n ItemId: req.body.itemid\n }\n })\n .then(item => {\n if (!item) {\n return res.status(404).send({\n message: \"Item Not Found\"\n });\n }\n\n return (\n item\n .update(req.body, { fields: Object.keys(req.body) })\n // .update({ quantity: 11 })\n .then(updatedOrderDetail =>\n res.status(200).send(updatedOrderDetail)\n )\n .catch(error => res.status(400).send(error))\n );\n })\n .catch(error => res.status(400).send(error));\n }", "update(companyId) {\n return Resource.get(this).resource('Admin:updateCompany', {\n company: {\n ...this.displayData.company,\n margin: this.displayData.company.settings.margin,\n useAlternateGCMGR: this.displayData.company.settings.useAlternateGCMGR,\n serviceFee: this.displayData.company.settings.serviceFee\n },\n companyId\n });\n }", "function updateDetails() {\n $.getJSON(window.location + 'details', {\n dag: _store.dag,\n id: _store.id\n }, function (data) {\n if (data.length > 0) {\n _store.owner = data[0].owner;\n }\n DetailViewStore.emit(DETAILS_UPDATE_EVENT);\n });\n}", "updateItin() {\n const { id, editItinerary } = this.props;\n\n editItinerary(id);\n }", "function update(req, res, next) {\n\n TicketModel.findById(req.params.id, function (err, ticket) {\n\n if (err) { return next(err); }\n if (ticket) {\n\n // TODO create mongoose plugin to handle multiple fields\n ticket.state = req.body.state;\n ticket.status = req.body.status;\n ticket.urgency = req.body.urgency;\n ticket.type = req.body.type;\n ticket.title = req.body.title;\n ticket.description = req.body.description;\n\n ticket.save(function (err) {\n\n if (err) { return next(err); }\n res.send(ticket);\n });\n\n } else {\n\n return next({type: 'retrieval', status: 404, message: 'not found'});\n }\n });\n }", "async update(ctx){\n try{\n const results = await ctx.db.Company.update({\n name: ctx.request.body.name,\n city: ctx.request.body.city,\n address: ctx.request.body.address\n }, {\n where: {\n id: ctx.params.id\n }\n });\n results == 0 ? ctx.throw(500,'invalid id provide') : ctx.body = `company is updated with id ${ctx.params.id}`;\n }\n catch (err) {\n ctx.throw(500, err)\n }\n }", "updateThought({ params, body }, res) {\n Thoughts.findOneAndUpdate({ _id: params.id }, body, { new: true })\n .then(dbThoughtsData => {\n if (!dbThoughtsData) {\n res.status(404).json({ message: 'No Thoughts found with this id!' });\n return;\n }\n res.json(dbThoughtsData);\n })\n .catch(err => res.json(err));\n }", "function confirmEditActualCost() {\n var activity = {\n 'actualCost': $('#txtEditActivityActualCost').val()\n };\n\n $.ajax({\n type: 'PUT',\n data: activity,\n url: '/events/updateactivity/' + $('#txtEditActivityId').val()\n }).done(function( response ) {\n // Check for a successful (blank) response\n if (response.msg === '') {\n populateTables();\n $('#txtEditActivityDay').val(\"\");\n $('#txtEditActivityTime').val(\"\");\n $('#txtEditActivityPlace').val(\"\");\n $('#txtEditActivity').val(\"\");\n $('#txtEditActivityEstCost').val(\"\");\n $('#txtEditActivityId').val(\"\");\n $('#txtEditActivityActualCost').val(\"\");\n $('#edit-actual-cost-form').dialog('close');\n }\n else {\n alert('Error: ' + response.msg);\n }\n }); \n}", "static async updatePut(req, res, next) {\n try {\n const { title, description, status, due_date } = req.body\n const [count, data] = await ToDo.update(\n { title, description, status, due_date },\n {\n where: {\n id: +req.params.id,\n UserId: +req.decoded.id,\n },\n returning: true,\n }\n )\n if (count === 0) {\n throw { status: 404 }\n } else {\n res.status(200).json(data[0])\n }\n } catch (err) {\n next(err)\n }\n }", "update(puppy) {\n return http.put('/editPuppy', puppy); // pass the id??? Embedded in the puppy object\n }", "update({ review, body }, res) {\n\t\tObject.assign(review, body);\n\t\treview.save()\n\t\tres.sendStatus(204);\n\t}", "function updateRelease() {\n const relId = document.getElementById(\"modal-id\").value.substring(3);\n const nom = document.getElementById(\"modal-name\").value;\n const date = document.getElementById(\"modal-date\").value;\n const description = document.getElementById(\"modal-description\").value;\n const link = document.getElementById(\"modal-src_link\").value;\n const sprint = document.getElementById(\"modal-sprint\").value;\n\n let jsonData = {\n \"name\": nom,\n \"release_date\": formatDate(date, false),\n \"description\": description,\n \"src_link\": link,\n \"sprint\": sprint\n };\n\n sendAjax(\"/api/release/\" + relId, 'PUT', JSON.stringify(jsonData)).then(res => {\n $(\"#rel\" + res.id + \"-name\").empty().append(res.name);\n $(\"#rel\" + res.id + \"-description\").empty().append(res.description);\n $(\"#rel\" + res.id + \"-releaseDate\").empty().append(formatDate(res.releaseDate));\n $(\"#rel\" + res.id + \"-src_link\").empty().append(res.srcLink);\n $(\"#rel\" + res.id + \"-sprint\").empty().append(\"<span id='sprint-id-rel-\" + res.id + \"' class='hidden'>\" + res.sprint.id + \"</span>\" +\n \"Du \" + formatDate(res.sprint.startDate) + \" au \" + formatDate(res.sprint.endDate));\n $(\"#modal-release\").modal(\"hide\");\n })\n}", "async updateToEditExercise() {\n if (this.editID === null)\n this.toEditExercise = null;\n this.toEditExercise = await this.getExercise(this.editID);\n }", "function updateShop (name, address, wHours, coords, index){\r\n shopStorage[index].name = name;\r\n shopStorage[index].address = address;\r\n shopStorage[index].wHours = wHours;\r\n shopStorage[index].coords = coordsFromStr(coords);\r\n\r\n dialogNameField.value = '';\r\n dialogAddressField.value = ''; \r\n dialogHoursField.value = ''; \r\n\r\n addShopBtn.value = '';\r\n updateShopList(); \r\n dialog.close();\r\n }", "function editAdmit() {\n var testAdmit = {\n KEYID: $scope.currentAdmitKEYID,\n PATSTATUS: 'A',\n SOCDATE: $scope.M0030_START_CARE_DT\n };\n dataService.edit('admission', testAdmit).then(function(response){\n console.log(response);\n });\n //edit patient table to udpate PATSTATUS from 'P' to 'A'\n dataService.edit('patient', {'KEYID': $scope.patient.KEYID, 'PATSTATUS': 'A'}).then(function(response){\n console.log(response);\n //reset patient\n dataService.get('patient', {'KEYID': patientService.get().KEYID}).then(function(data) {\n var updatedPatient = data.data[0];\n patientService.set(updatedPatient);\n });\n });\n }", "function updateTransaction()\n{\n nlapiLogExecution('DEBUG', 'updateTransaction', 'Begin');\n \n var newRecord = nlapiGetNewRecord();\n var transactionId = newRecord.getFieldValue('custrecord_jobopt_transaction');\n var transactionType = newRecord.getFieldValue('custrecord_jobopt_transtype');\n var lineId = newRecord.getFieldValue('custrecord_jobopt_translineid');\n var updateItemOptions = (newRecord.getFieldValue('custrecord_jobopt_updateitemoptions') == 'T');\n \n if (updateItemOptions && transactionId && transactionType && lineId) {\n var transaction = nlapiLoadRecord(transactionType, transactionId);\n \n // Update the correct line item based on line ID\n var update = false;\n var i = 1, n = transaction.getLineItemCount('item') + 1;\n for (;i < n; i++) {\n if (transaction.getLineItemValue('item', 'custcol_lineid', i) == lineId) {\n transaction.setLineItemValue('item', 'custcol_bo_course', i, newRecord.getFieldValue('custrecord_jobopt_course'));\n transaction.setLineItemValue('item', 'custcol_bo_date', i, newRecord.getFieldValue('custrecord_jobopt_date'));\n transaction.setLineItemValue('item', 'custcol_bo_time', i, newRecord.getFieldValue('custrecord_jobopt_time')); \n update = true;\n }\n }\n if (update) {\n nlapiLogExecution('DEBUG', 'Info', 'Update item options on transaction/lineid: ' + transactionId + '/' + lineId);\n nlapiSubmitRecord(transaction);\n }\n }\n \n nlapiLogExecution('DEBUG', 'updateTransaction', 'Exit Successfully');\n}", "saveModalDetails(restId, item) {\n\n const requestOptions = {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', 'authorization': this.props.token },\n body: JSON.stringify({\n name: item.name,\n longitude: item.longitude,\n latitude: item.latitude,\n description: item.description\n })\n };\n\n fetch(this.props.URL + '/restaurant/' + restId, requestOptions)\n .then(response => response.json())\n .then(data => {\n if (data.response == 'success') {\n toastada.success('You have successfully updated the restaurant details.');\n\n window.location.reload();\n }\n else {\n toastada.error('Failed: ' + data.message)\n }\n });\n }", "function update() {\n vm.error = null;\n vm.form.submitted = true;\n\n // Show validation messages if needed.\n if (!vm.form.$valid) {\n return;\n }\n\n // Save and show feedback to the user.\n playbookDataService.updateCommitment(vm.playbookId, vm.form.data)\n .then(function (data) {\n vm.info = \"Commitment saved successfully\";\n $timeout(function () {\n vm.info = null;\n }, 2000);\n\n // Update view with saved data.\n var c = vm.commitments.find(function (c) { return c.id === data.id });\n c.id = data.id;\n c.categoryId = data.categoryId;\n c.categoryName = vm.form.data.category.name;\n c.created = data.created;\n c.description = data.description;\n c.dueDate = data.dueDate;\n c.name = data.name;\n c.questionId = data.questionId;\n c.status = data.status;\n })\n .catch(function () {\n vm.error = \"Failed to save commitment.\";\n })\n .finally(function () {\n vm.form.submitted = false;\n vm.form.data = {};\n vm.form.show = false;\n });\n }", "update(e, guidedTourId) {\r\n\r\n const isValid = this.validate();\r\n if (isValid) {\r\n this.setState(initialStates);\r\n db.collection(\"GuidedTours\").doc(guidedTourId)\r\n .set({\r\n id: guidedTourId,\r\n tourName: this.state.tourName,\r\n startTime: this.state.startTime,\r\n endTime: this.state.endTime,\r\n date: this.state.date,\r\n venue: this.state.venue\r\n })\r\n .then(() => {\r\n this.setState({\r\n editModal: false,\r\n });\r\n this.display()\r\n });\r\n }\r\n }", "function updateOne(req, res) {\n const id = req.params.organizerId;\n const updates = {};\n updates.firstName = req.body.firstName ? req.body.firstName : undefined;\n updates.lastName = req.body.lastName ? req.body.lastName : undefined;\n updates.admin = req.body.admin !== undefined ? req.body.admin : undefined;\n updates.admission = req.body.admission !== undefined ? req.body.admission : undefined;\n updates.checkIn = req.body.checkIn !== undefined ? req.body.checkIn : undefined;\n OrganizerModel.findByIdAndUpdate(\n id,\n updates,\n { new: true, omitUndefined: true },\n (err, organizer) => {\n if (err) throw err;\n if (organizer) {\n res.send({ success: true, organizer });\n } else {\n res.send({ success: false, message: 'organizer does not exist' });\n }\n }\n );\n}", "function updateTask(doc, res, updateParams) {\n if (updateParams.name) {\n doc.name = updateParams.name\n }\n if (updateParams.description) {\n doc.description = updateParams.description;\n }\n if (updateParams.deadline) {\n doc.deadline = updateParams.deadline;\n }\n if (typeof updateParams.completed !== 'undefined') {\n doc.completed = updateParams.completed;\n }\n if (updateParams.assignedUser || typeof updateParams.assignedUser !== 'undefined') {\n doc.assignedUser = updateParams.assignedUser;\n }\n if (updateParams.assignedUserName) {\n doc.assignedUserName = updateParams.assignedUserName;\n }\n \n saveAndRespond(doc, 'Task was updated.', res);\n}", "editHouse() {\n const { nameInput, addressInput, cityInput, stateInput, zipcodeInput } = this.props;\n return axios.put(`/api/houses/${this.props.id}`, { nameInput, addressInput, cityInput, stateInput, zipcodeInput })\n .then(res => {\n console.log(res.data.house);\n //It refreshes the page after the house has been successfully updated. \n window.location.reload();\n }).catch(err => console.log('Edit House Error----------', err));\n }", "function update_inspection(params,succFunc){\n /*\n var params ={\n display_address:model.display_address,\n owner:promoteUId,\n isupdate:model.person_info,\n last_name:model.last_name,\n mobile: model.mobile,\n promote:promoteAId,\n contact:model.contactPerson,\n property: promoteId\n \n } \n */\n if(inspectionHasChange()){\n $.ajax({\n type:\"PUT\",\n url:window.location.protocol+'//'+window.location.host + \"/api/inspection\",\n data:JSON.stringify($.extend({},pobj,params)),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n cache:false,\n success:function (data) {\n succFunc(data);\n },\n error:function (jqXHR, status) {\n alert(status+\":(\"+jqXHR.status +\") \\n\"+jqXHR.statusText)\n }\n });\n }else{\n data={result:\"success\"};\n succFunc(data);\n }\n}", "EditTime(e,obj) {\n this.setState({titleText:'Update'});\n $('#event_detail_id').val(obj.event_detail_id);\n $('#theatre_id').val(obj.theatre_id);\n $('#event_start_time').val(obj.event_start_time);\n $('#event_end_time').val(obj.event_end_time);\n this.setState({itinerary:obj.itinerary});\n this.setState({includes:obj.includes});\n this.setState({dincludes:obj.dincludes});\n this.setState({other:obj.other});\n $('#status').val(obj.status);\n $('#id').val(obj.id);\n //Update the Price Object\n var price = obj.price;\n this.state.priceRow =[];\n price.map((val,i)=>\n this.state.priceRow.push({\n sitting_type_id : val.sitting_type_id,\n price : val.price,\n })\n )\n }", "function edit_existing_itinerary() {\n var token = $('input[name=authenticity_token]').val();\n var name = $('#name').val();\n var start = $('#start').val();\n var end = $('#end').val();\n var array = $('.individual_location_field');\n var id = $('#itinerary_id').val();\n _.each(array, pull_location_field_values);\n // _.filter($('h3').find('a'), function(x){ return $(x).attr('href') == ('/itineraries/' + id) }).first().remove();\n\n $.ajax({\n dataType: 'json',\n type: \"PUT\",\n url: \"/itineraries/\" + id,\n data: {_method:'put', authenticity_token:token, 'itinerary[name]':name, 'itinerary[start]':start, 'itinerary[end]':end, destinations:destination_array}\n }).done(render_all_itineraries);\n\n destination_array = [];\n destination_li = [];\n $('.new_priority_form').hide();\n\n return false;\n}", "update(dbId, issueId, date, priority, summary, severity, description, reporter, assignedUser, status){\n\t\tClient.editBugs(dbId, issueId, date, priority, summary, severity, description, reporter, assignedUser, status);\n\t}", "editInjured(InjuredDetails) { \n var headers = InjuredDetails; \n return new Promise((resolve, reject) => {\n Injured.update({'id': headers.id}, \n {$set:{\"gender\": headers.gender,\n \"age\" : headers.age,\n \"name\":headers.name}}, (err) => {\n if (err) reject (err);\n else resolve(` ${headers.id}`);\n });\n })\n }", "function storeDetailsInDb(obj) {\n db.customers.update({phoneNumber:obj.phoneNumber}, {$set: { name : obj.firstName+\" \"+obj.lastName,email:obj.email,phoneNumber:obj.phoneNumber,currentCity:obj.currentCity,prefferdJobLocation:obj.jobLocation }}, {upsert: true}, function (err) {\n // the update is complete\n if(err) throw err\n console.log(\"inside update\")\n })\n}", "async function update(id, ticketBody) {\n const ticket = await Ticket.findByIdAndUpdate(id, ticketBody)\n // check status \"Open or Closed\"\n if(ticketBody.assigned.status === 'Closed'){\n ticket.resolution.closed = Date.now()\n }\n ticket.save()\n}", "updateProperty(req,res){\n const property = propertys.find(ad => ad.id === parseInt(req.params.id))\n if(!property) return res.status(404).send({error:404, message:'property not found'})\n property.price = req.body.price,\n property.type = req.body.type,\n res.status(201).send({message: 'success', property})\n \n}", "function update_form_data(res) {\n $(\"#promo_id\").val(res.id);\n $(\"#promo_name\").val(res.name);\n $(\"#promo_type\").val(res.promo_type);\n $(\"#promo_value\").val(res.value);\n $(\"#promo_start_date\").val(res.start_date);\n $(\"#promo_end_date\").val(res.end_date);\n $(\"#promo_detail\").val(res.detail);\n }", "function edit(context) {\n const teamId = sessionStorage.getItem('teamId');\n const name = context.params.name;\n const description = context.params.comment;\n\n if (name.trim() === ''){\n auth.showError(`Team name cannot be empty`);\n return;\n }\n\n teamsService.edit(teamId, name, description)\n .then(function (res) {\n auth.showInfo(`Successfully edited!`);\n context.redirect(`#/catalog/:${teamId}`);\n\n }).catch(auth.handleError);\n }", "async editEmployeeData(name, joining_date, phone, address, id) {\r\n await this.checkLogin();\r\n var response = await axios.put(\r\n Config.employeeApiUrl + \"\" + id + \"/\",\r\n {\r\n name: name,\r\n joining_date: joining_date,\r\n phone: phone,\r\n address: address,\r\n },\r\n {\r\n headers: { Authorization: \"Bearer \" + AuthHandler.getLoginToken() },\r\n }\r\n );\r\n return response;\r\n }", "function updateEmployee() {\n // Call chooseEmployee with action to update\n chooseEmployee(\"update\");\n}", "async update(req, res) {\n const { id } = req.params;\n const { name, address, opening_hours } = req.body;\n\n const restaurant = await Restaurant.update({\n name,\n address,\n opening_hours,\n }, {\n where: {\n id,\n }\n });\n\n return res.json(restaurant);\n }", "async edit({ params, request, response, view }) {}", "function saveEdit(id) {\n\n //check empty fields\n if ($('#company-new-name').val() === \"\" || $('#reg-new-number').val() === \"\" || $('#reg-new-date').val() === \"\" ||\n $('#new-phone-number').val() === \"\" || $('#new-city').val() === \"\" || $('#new-province').val() === \"\") {\n alert(\"please fill all fields\")\n } else {\n // Making new company object\n let newInfo = {\n companyName: $('#company-new-name').val(),\n registrationNumber: $('#reg-new-number').val(),\n registrationDate: $('#reg-new-date').val(),\n phoneNumber: $('#new-phone-number').val(),\n cityName: $('#new-city').val(),\n provinceName: $('#new-province').val(),\n }\n $.ajax({\n type: \"PUT\",\n url: `/companies/updateCompany/${id}`,\n data: newInfo,\n dataType: \"text\",\n success: function (res) {\n if (res === 'exist') {\n alert('نام شرکت یا شماره ثبت تکراری است')\n } else {\n document.location = '/companies/allCompanies';\n }\n },\n error: function (err) {\n document.location = '/error'\n }\n });\n }\n}", "function Editar(){\n const inputIdSalon = document.getElementById(\"idsalon\").value;\n const inputUbicacion = document.getElementById(\"ubicacion\").value;\n const inputCapacidad = document.getElementById(\"capacidad\").value;\n const inputNombreSalon = document.getElementById(\"nombresalon\").value;\n objClaveMateria = {\n \"IdSalon\": inputIdSalon,\n \"Ubicacion\": inputUbicacion,\n \"NombreClave\": inputNombreSalon,\n \"Capacidad\": inputCapacidad\n }\n fetch(uri,{\n method: 'PUT',\n headers:{\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(objClaveMateria)\n })\n .then(response => response.text())\n .then(data => Mensaje(data))\n .catch(error => console.error('Unable to Editar Item.',error ,objClaveMateria));\n}", "function updateProfessionalDetails(){\n\n return new Promise((resolve,reject)=>{\n proDetails.push(employeeId);\n let query = \"update employeeProfessionalDetails set joinDate= ?, endDate= ?, department= ?, skill= ? where employeeId= ?\";\n db.query(query, proDetails, (err, data) => {\n if (err) {\n console.log(err);\n db.rollback();\n reject(err);\n } else {\n console.log('updated pro details');\n resolve();\n }\n });\n });\n}", "update(){}", "update(){}", "update(){}", "async put (req, res) {\n try {\n console.log('details here ',req.body)\n console.log('details and now',req.body.accnumber)\n const account = await Account.update(req.body , {\n where: {\n id: req.params.accountId\n }\n })\n console.log(account)\n res.send(req.body)\n } catch (err) {\n res.status(500).send({\n error: 'an error has occured trying to update account'\n })\n }\n }", "update(id, data, params) {}", "updateLead(contactInfo) {\n this.setState({\n contactInfo: {...this.state.contactInfo, ...contactInfo},\n loading: true\n })\n\n return this.getLead()\n .then(lead => {\n let contactState = States[contactInfo.stateCode].abbreviation\n let updatedLead = {\n id: lead.id,\n firstName: contactInfo.firstName,\n lastName: contactInfo.lastName,\n phoneNmbr: contactInfo.phoneNmbr,\n address: `${contactInfo.address} ${contactInfo.city}, ${contactState}`,\n stateCode: contactInfo.stateCode,\n zipCode: contactInfo.zipCode,\n currentCustomer: contactInfo.currentCustomer === 'Yes'\n }\n if (contactInfo.emailAddr) updatedLead.emailAddr = contactInfo.emailAddr\n if (contactInfo.question) updatedLead.question = contactInfo.question\n return LeadService.updateLead(updatedLead)\n })\n .then(lead => {\n this.setState({loading: false})\n return lead\n })\n .catch(err => this.showErrorModal(err.message))\n }", "editHouse(houseId, houseObj) {\n axios({\n method: 'put',\n url: 'http://localhost:3005/household?houseId=' + houseId,\n data: houseObj,\n headers: { 'x-access-token': localStorage.getItem('jwt_token') },\n\n })\n .then((response) => {this.getHouse(this.state.currentHouseId);})\n .catch((response) => {console.log('editHouse() failed.');});\n }", "onSubmit(e) {\n e.preventDefault();\n\n let updProductOffer = {\n \"offerPrice\": this.state.offerAmount,\n \"offerDiscount\": this.state.offerDiscount,\n \"offerDescription\": this.state.offerDescription,\n \"offerEndDate\": this.state.offerEndDate,\n \"offerStatus\": this.state.offerInfo.offerStatus\n }\n Axios.put(`http://localhost:3001/productOffer/updateProductOffer/${this.props.match.params.id}`, updProductOffer)\n .then(response => {\n alert('Offer details Updated Successfully!!');\n window.location = \"/viewProductOffers\";\n }).catch(error => {\n alert(error.message);\n })\n\n }", "updateThought({ params, body }, res) {\n Thought.findOneAndUpdate({ _id: params.id }, body, {\n new: true,\n runValidators: true,\n })\n .then((dbThoughtData) => {\n if (!dbThoughtData) {\n res.status(404).json({ message: \"No Thought found with this id!\" });\n return;\n }\n res.json(dbThoughtData);\n })\n .catch((err) => res.status(400).json(err));\n }", "async put(req, res) {\n try {\n await Order.update(req.body, {\n where: {\n id: req.params.orderId\n }\n })\n res.send(req.body)\n } catch (err) {\n res.status(500).send({\n error: 'Update order incorrect'\n })\n }\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "function approve(title, approved) {\n\tideas.doc(title)\n\t\t.update({\n\t\t\tapproved: approved\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error('APPROVE', err)\n\t\t});\n}", "changeDuringcourse(req, res) {\n const _id = req.params._id;\n const during = req.body.during;\n CourseModel.findOne({ _id: _id, isCheck: 0 })\n .then((data) => {\n data.during = during;\n data.save();\n res.status(200).json({\n status: 200,\n success: true,\n message: \"Successfully changed during time\",\n });\n })\n .catch((err) =>\n res.status(402).json({\n status: 402,\n success: true,\n message: \"No valid courses found\",\n })\n );\n }", "function updatePizza(req,res,customerId)\n{\n var updateObj = { \n \n \"devoured\": true, \n \"CustomerId\": customerId\n }; \n\n db.Pizza.update(updateObj, {\n where: {\n id: req.params.id\n }\n }).then(function(dbTodo) {\n res.redirect(\"/\");\n }); \n}", "async function editMilestoneHandler(id, milestoneObj) {\n const response = await fetch(`/api/milestones/${id}`, {\n method: 'PUT',\n body: JSON.stringify(milestoneObj),\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n if (response.ok) {\n location.reload();\n } else {\n alert(response.statusText);\n }\n}", "async function updateTicketDetails(event) {\n event.preventDefault();\n\n const id = window.location.toString().split('/')[\n window.location.toString().split('/').length - 1\n ];\n const ticketStateId = document.getElementById('ticket-state').value;\n\n const updateObject = {\n ticket_state_id: ticketStateId\n }\n\n // Fetch /api/ticket/:id and update user details\n const response = await fetch(`/api/ticket/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updateObject),\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n\n if (response.ok) {\n document.location.replace('/admin/ticket');\n } else {\n alert('response.status');\n }\n\n\n}", "async function updateEmployeeInfo(client, session) {\n session.startTransaction({\n readConcern: { level: 'snapshot' },\n writeConcern: { w: 'majority' },\n readPreference: 'primary'\n });\n\n const employeesCollection = client.db('hr').collection('employees');\n const eventsCollection = client.db('reporting').collection('events');\n\n await employeesCollection.updateOne(\n { employee: 3 },\n { $set: { status: 'Inactive' } },\n { session }\n );\n await eventsCollection.insertOne(\n {\n employee: 3,\n status: { new: 'Inactive', old: 'Active' }\n },\n { session }\n );\n\n try {\n await session.commitTransaction();\n } catch (error) {\n await session.abortTransaction();\n throw error;\n }\n }", "updateData(per) {\r\n console.log(\"Updating \");\r\n console.log (\"PER\"+per);\r\n let id = per.PersonalUniqueID;\r\n let promise = fetch (`http://localhost:4070/api/person/${id}`, {\r\n method: \"PUT\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "postEditedGoals (editedGoalId) {\n $.ajax({\n url: `${BASE_URL}/api/v1/goals/${editedGoalId}`,\n headers: { 'Authorization': apiKeys.GoalsApp },\n data: { goal: this.state.goalBeingEdited },\n method: 'PATCH',\n success: function (goal) {\n this.getGoals();\n this.closeModal();\n }.bind(this),\n error: function () {\n }\n });\n }", "update() {\n let id = $(\"#rid\").val();\n let des = $(\"#rdescription\").val();\n let price = $(\"#rprice\").val();\n let rooms = $(\"#rrooms\").val();\n let mail = $(\"#rmail\").val();\n let name = $(\"#rname\").val();\n let pho = $(\"#rphoneNr\").val();\n let re = new Rent(id, des,price, rooms, mail, name, pho);\n reReg.update(re);\n $(\"#editDeleteModal\").modal('hide');\n }", "function updateHotel(req, res) {\n const hotel = new Hotel.newHotel(req.body);\n Hotel.update(req.query.id, hotel, (err, hotel) => {\n if (err) {\n res.status(500).send({ status: false, message: \"Fallo al actualizar el Hotel\" });\n } else {\n res.status(200).send({ status: true, message: \"Hotel actualizado exitosamente\" });\n }\n });\n}", "function updateEmployee() {\n\n}", "function _editProjectDetail() {\n var uploadObj = {};\n if ($scope.projectForm.$valid) {\n $scope.project.startdate = $scope.project.startdateCn;\n $scope.project.enddate = $scope.project.enddateCn;\n serverRequestService.serverRequest(ADD_EDIT_PROJECT_CTRL_API_OBJECT.editProjectDetail + items, 'PUT', $scope.project).then(function(res) {\n serverRequestService.showNotification('success', 'Porject Update successfully', 'Update', 2000);\n $mdDialog.cancel();\n }, function(res) {\n if (res && res.result && res.result.errors) {\n angular.forEach(res.result.errors, function(value) {\n serverRequestService.showNotification('error', value.message, value.path, 4000);\n });\n }\n });\n } else {\n $scope.projectForm.$setSubmitted();\n }\n }", "editTravel(id) {\n const index = this.travels.findIndex(\n (travel) => travel.id === id\n )\n this.travels[index].country = prompt(\"New country?\")\n }", "openUpdate(id) {\n this.setState({\n type_modal: 'update',\n id_current: id\n });\n let name_pk = this.props.pk_key;\n let detail = _.clone(_.find(this.state.data, { [name_pk]: id }));\n Object.keys(detail).forEach(function (item) {\n detail[item] = (detail[item] === null) ? '' : detail[item];\n });\n this.setState({\n row_current: detail\n });\n this.toggleModal();\n }", "handleOLICreated(event){\n event.preventDefault(); // stop the form from submitting\n const fields = event.detail.fields;\n fields.OpportunityId = this.recordId; // Make reference to the current Opportunity Record\n\n this.template.querySelector('lightning-record-form').submit(fields);\n\n }", "editTravel() {\n\t\t\tconst { departureCity, destinationCity, dateArray,\n\t\t\t\t price, content, travel } = this.state;\n\n\t\t\t\tif (departureCity !== \"\") {\n\t\t\t\t\t\tfirebase.database().ref('travels/' + travel.key + '/fromCity').set(departureCity);\n\t\t\t\t}\n\t\t\t\tif (destinationCity !== \"\") {\n\t\t\t\t\t\tfirebase.database().ref('travels/' + travel.key + '/toCity').set(destinationCity);\n\t\t\t\t}\n\t\t\t\tif (dateArray.length > 1) {\n\t\t\t\t\t\tfirebase.database().ref('travels/' + travel.key + '/dateArray').set(dateArray);\n\t\t\t\t}\n\t\t\t\tif (price !== \"\") {\n\t\t\t\t\t\tfirebase.database().ref('travels/' + travel.key + '/price').set(price);\n\t\t\t\t}\n\t\t\t\tif (content !== \"\") {\n\t\t\t\t\t\tfirebase.database().ref('travels/' + travel.key + '/content').set(content);\n\t\t\t\t}\n\n\t\t\t\tthis.props.cancel(travel.key);\n }", "async updateOrder(id, invoice_no, po_no, order_items, ordered_by, status, updated_by) {\n const order = await OrderModel.findByIdAndUpdate(id, {\n invoice_no: invoice_no,\n po_no: po_no,\n order_items: this.consolidate(order_items),\n ordered_by: ordered_by,\n status: status,\n updated_by: updated_by,\n updated: Date.now()\n },\n {new: true});\n\n return order;\n }" ]
[ "0.7364753", "0.65099853", "0.6487726", "0.60082096", "0.5966967", "0.5918077", "0.59168464", "0.5816638", "0.5808199", "0.5795895", "0.5736338", "0.57270527", "0.56655884", "0.5663554", "0.56552815", "0.5650041", "0.5641827", "0.56417966", "0.56198794", "0.5614056", "0.55973047", "0.5581534", "0.558122", "0.55585057", "0.5554745", "0.55514073", "0.5539337", "0.5533534", "0.5527563", "0.55261266", "0.552406", "0.55235064", "0.5514402", "0.54968935", "0.54828024", "0.5482464", "0.5480895", "0.54798716", "0.54733133", "0.5464448", "0.5458903", "0.5449702", "0.54439056", "0.54349947", "0.54292494", "0.54260707", "0.5421662", "0.54192656", "0.5418624", "0.5415864", "0.54146063", "0.5414516", "0.5414107", "0.54118234", "0.541044", "0.5410194", "0.54092485", "0.5404315", "0.54041666", "0.5397588", "0.5396786", "0.53931785", "0.5391338", "0.5384097", "0.53811556", "0.5378821", "0.53656924", "0.53598136", "0.53598136", "0.53598136", "0.5354143", "0.5351699", "0.53328407", "0.53313404", "0.5326929", "0.53252655", "0.53245026", "0.5320092", "0.5320092", "0.5320092", "0.5320092", "0.5320092", "0.5320092", "0.5320092", "0.53075576", "0.5305304", "0.5303109", "0.53030336", "0.5293397", "0.52893984", "0.52869195", "0.52861786", "0.52798146", "0.52788544", "0.5276741", "0.5275482", "0.52739084", "0.52720827", "0.5268911", "0.52669084", "0.5264239" ]
0.0
-1
This function cancels the editing of an existing opportunity's details
function cancelEditOpp() { clearEditOppForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelEditLead() {\n clearEditLeadForm();\n}", "cancelEdit () {\n this.editCache = null\n this.editingTrip = null\n this.editType = null\n }", "function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}", "function editCancelFunc(){\n setEdit(null);\n }", "function cancelEditCard() {\n // 8-1 Set isEditing flag to update the view.\n this.isEditing = false\n\n // 8-2 Reset the id we want to edit.\n this.idToEdit = false\n\n // 8-3 Clear our form.\n this.clearForm()\n}", "function cancelEdit(){\r\n\t//clears fields\r\n\t$(\"#edt-g-name\").val(\"\");\r\n\t$(\"#edt-g-time\").val(\"\");\r\n\t$(\"#auto-input-1\").val(\"\");\r\n\tvar selMin = $('#selEdtMin');\r\n\tselMin.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMin.selectmenu(\"refresh\", true);\r\n\tvar selMax = $('#selEdtmax');\r\n\tselMax.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMax.selectmenu(\"refresh\", true);\r\n\t//hides edit fields and shows games list\r\n\t$(\"#editList\").show();\r\n\t$(\"#editBlock\").hide();\r\n\t$(\"#frm1\").show();\r\n\t$(\"#para1\").show();\r\n\t//takes save function off button\r\n\tvar savBtn = $('#editSave');\r\n\tsavBtn.removeAttr('onClick');\r\n\t}", "function handleCancelEdit() {\n updateIsEditMode(false);\n }", "cancel() {\n // Rollback edit profile changes\n this.changeset.rollback(); //this.model.reload();\n\n this.set('editProjectShow', false);\n }", "function cancelEditSale() {\n clearEditSaleForm();\n}", "function cancelEdit() {\n var id = $(this).parent().attr(\"id\");\n var type = id.split(\"-\");\n var index = findVM(id.split(\"-\")[0].toUpperCase());\n var value;\n \n if (type.length > 2) {\n /* A product resource has been modified */\n var prod = findProduct(index, type[1]);\n type = type[2];\n } else {\n /* A VM resource has been modified */\n type = type[1];\n }\n \n switch (type) {\n case \"status\":\n case \"alarm\":\n value = svm[index][type].toStr();\n break;\n case \"loc\":\n value = svm[index][type].lat + \", \" + svm[index][type].lng;\n break;\n case \"qty\":\n case \"price\":\n value = svm[index].products[prod][type];\n break;\n default:\n value = svm[index][type];\n break;\n }\n $(\"#\" + id).empty();\n $(\"#\" + id).text(value);\n $(\"#\" + id).mouseenter(showEditIcon);\n $(\"#\" + id).mouseleave(hideEditIcon);\n}", "function cancel() {\n\t\tdelete state.people[id]\n\t\temit(\"person modal canceled\")\n\t}", "editCancel() {\n\t \t\t\tconst { travel } = this.state;\n\t \t\t\t\tthis.props.cancel(travel.key);\n\t }", "cancelEdit() {\n this.set('isManage', false);\n this.folder.set('isEdit', false);\n this.folder.rollbackAttributes();\n }", "cancel() {\n // Rollback edit badge changes\n this.changeset.rollback(); //this.model.reload();\n\n this.set('editBadgeShow', false);\n }", "function cancelNewLead() {\n clearNewLeadForm();\n}", "function cancel()\n {\n dirtyController.setDirty(false);\n hideWorkflowEditor();\n hideWorkflowUpdateEditor();\n selectWorflow(selectedWorkflow);\n }", "function cancelEdit(){\n //close edit box\n closeEditBox();\n}", "cancelEdit() {\n const me = this,\n { inputField, oldValue } = me,\n { value } = inputField;\n\n if (!me.isFinishing && me.trigger('beforecancel', { value: value, oldValue }) !== false) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n me.trigger('cancel', { value, oldValue });\n me.isFinishing = false;\n }\n }", "cancelEditType() {\n this.type = this.editing;\n this.editing = '';\n }", "function cancelEdit() {\n resetForm();\n formTitle.innerHTML = 'Add Link';\n cancelButton.parentElement.removeChild(cancelButton);\n updateButton.parentElement.removeChild(updateButton);\n saveButton.classList.remove('hidden');\n }", "cancelEditAmmenities() {\n this.vendor.eighteen_plus = this.ammenitiesRevertData.eighteen_plus;\n this.vendor.twenty_one_plus = this.ammenitiesRevertData.twenty_one_plus;\n this.vendor.has_handicap_access = this.ammenitiesRevertData.has_handicap_access;\n this.vendor.has_lounge = this.ammenitiesRevertData.has_lounge;\n this.vendor.has_security_guard = this.ammenitiesRevertData.has_security_guard;\n this.vendor.has_testing = this.ammenitiesRevertData.has_testing;\n this.vendor.accepts_credit_cards = this.ammenitiesRevertData.accepts_credit_cards;\n\n this.ammenitiesRevertData = '';\n }", "function cancel_score_edit()\n\t{\n\t\tdocument.getElementById('score_edit_form').reset();\n\t\t$('#score_edit').dialog('close');\n\t}", "cancelEditAddress() {\n this.vendor.address = this.addressRevertData.address;\n this.vendor.state = this.addressRevertData.state;\n this.vendor.city = this.addressRevertData.city;\n this.vendor.zip_code = this.addressRevertData.zip_code;\n\n this.addressRevertData = '';\n }", "cancelEdit(todo) {\n this.editTodo = null;\n todo.isEdited = false;\n }", "@action\n cancelEditRow() {\n set(this, 'isEditRow', false);\n }", "cancelEdit() {\n const me = this,\n {\n inputField,\n oldValue,\n lastAlignSpec\n } = me,\n {\n target\n } = lastAlignSpec,\n {\n value\n } = inputField;\n\n if (!me.isFinishing && me.trigger('beforeCancel', {\n value,\n oldValue\n }) !== false) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n me.trigger('cancel', {\n value,\n oldValue\n });\n\n if (target.nodeType === 1) {\n target.classList.remove('b-editing');\n target.classList.remove('b-hide-visibility');\n }\n\n me.isFinishing = false;\n }\n }", "function cancelEdit() {\n\n for (let i = 0; i < addCommentButtons.length; i++)\n addCommentButtons[i].style.display = \"initial\";\n\n const articleId = this.id.replace('delete-', '');\n tinymce.activeEditor.remove();\n const content = document.querySelector(`#content-${articleId}`);\n content.innerHTML = initialText;\n resetButtonsFromEditing(articleId);\n }", "function cancel() {\n scope.showCancelModal = true;\n }", "function cancel () {\n closeDialog();\n if (isEditPage) {\n table.restoreBackup();\n }\n }", "function cancel () {\n closeDialog();\n if (isEditPage) {\n table.restoreBackup();\n }\n }", "modalCancel(){\n\t\t// save nothing\n this.setValues = null;\n\t\t// and exit \n this.modalEXit();\n }", "cancelRowEdit() {\n if (this._isSaving) {\n return;\n }\n\n const activeEditInfo = this._activeEditInfo;\n if (activeEditInfo) {\n const { onCancelRowEdit } = this.props;\n if (onCancelRowEdit) {\n onCancelRowEdit(activeEditInfo);\n }\n \n this.setActiveEditInfo();\n }\n }", "cancel() {\n this.modal.jQueryModalFade.removeClass('modal_fade_trick');\n this.modal.jQueryModalWindow.css('display', 'none');\n this.clear();\n this.clearInvalid();\n this.hideNotes();\n if(!this.good){\n this.initPlaceholders();\n }\n }", "cancelEdit() {\n if (this._editedLevel > 0) {\n this._editedLevel--;\n }\n\n // Cancel in sub-models\n if (this._editedLevel === 0) {\n _each(this._childCollections, childCollection => {\n childCollection.cancelEdit();\n });\n\n // Revert changes\n // TODO\n\n // Reset state\n this._editedEvents = [];\n }\n }", "function cancelChange()\r\n\t{\r\n\r\n\t\tif ( editingRow !== -1 )\r\n\t\t{\r\n\r\n\t\t\tif ( wantClickOffEdit === true )\r\n\t\t\t{\r\n\t\t\t\t// get the updated value\r\n\t\t\t\tvar newValue = document.getElementById('editCell');\r\n\t\t\t\tif ( null !== newValue )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( class_myRows[editingRow].name !== newValue.value )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsaveChange(editingRow);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tresetRowContents();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresetRowContents();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// set the flag\r\n\t\trowEditing = false;\r\n\t}", "function cancelEdit() {\n var id = $(this).data(\"id\");\n var text = $(\"#span-\"+id).text();\n\n $(this)\n .children()\n .hide();\n $(this)\n .children(\"input.edit\")\n .val(text);\n $(this)\n .children(\"span\")\n .show();\n $(this)\n .children(\"button\")\n .show();\n }", "cancelEdit() {\n this.folderUser.set('isEdit', false);\n this.set('isManage', false);\n }", "function editingCanceled() {\n\tlocation.reload();\n}", "cancelEdit() {\n this.handsontableData = JSON.parse(JSON.stringify(this.handsontableDataBackup));\n this.hot.loadData(this.handsontableData);\n this.hot.render();\n\n // Change edit mode on redux\n this.props.setEdit();\n }", "cancel() {\n if (this.isCancelDisabled)\n return;\n this.isCancelDisabled = true;\n this.closeEnrollment_('cancel');\n }", "cancelMe() {\n if (this.editFlag) {\n this.viewMe();\n } else {\n this.removeFromParentWithTransition(\"remove\", 400);\n }\n }", "cancelEdit() {\r\n const that = this,\r\n editingInfo = that._editing;\r\n\r\n if (!editingInfo) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < editingInfo.cells.length; i++) {\r\n const cell = editingInfo.cells[i];\r\n\r\n if (cell.editor.contains((that.shadowRoot || that.getRootNode()).activeElement)) {\r\n that._focusCell(cell.element);\r\n }\r\n\r\n cell.editor.remove();\r\n that._setCellContent(cell.element, that._formatCellValue(editingInfo.row, that.columnByDataField[cell.dataField], cell.element));\r\n cell.element.classList.remove('editing');\r\n }\r\n\r\n delete that._editing;\r\n }", "function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }", "function editzselex_cancel()\n{\n Element.update('zselex_modify', '&nbsp;');\n Element.show('zselex_articlecontent');\n editing = false;\n return;\n}", "onCancelEditTeamDialog(e) {\n if (e.persist())\n e.preventDefault();\n this.props.dispatch(Action.getAction(adminActionTypes.SET_EDIT_TEAM_DIALOG_OPEN, { IsOpen: false }));\n }", "function cancel(){\n scope.permission.planMode = false;\n angular.element('.plan-overlay').css('visibility','hidden');\n scope.plan.current = [];\n scope.plan.selected = [];\n }", "function goCancel() {\n datacontext.revertChanges(vm.learningItem);\n goBack();\n }", "function cancel()\n {\n $('#PriestEd').hide();\n $('#PriestShowDetails').show();\n }", "function cancel() {\n transition(DELETE, true);\n\n props.cancelInterview(props.id)\n .then(response => {\n transition(EMPTY);\n })\n .catch(error => {\n transition(ERROR, true);\n })\n }", "cancel() {\n this.disableEditMode();\n (this.props.onCancel || Function)();\n }", "function cancel ()\n {\n $uibModalInstance.dismiss('cancel');\n }", "function cancelEditOperador(){\n\t\t $(\"#form_edit_operdor\")[0].reset();\n\t}", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancelar()\r\n {\r\n vm.modalidade = undefined;\r\n vm.resultadoAnalisePedido = {};\r\n }", "function cancel() {\n $log.log('CollegeFundPaymentDialogController::clear called');\n $uibModalInstance.dismiss('cancel');\n }", "cancel() {\n\t\tthis.$uibModalInstance.dismiss();\n\t}", "function cancelEditing(itemId){\n $('#'+itemId+'-desc').attr('disabled','disabled');\n $('#'+itemId+'-info').attr('disabled','disabled');\n $('#'+itemId+'-type').attr('disabled','disabled');\n $('#'+itemId+'-category').attr('disabled','disabled');\n $('#'+itemId+'-price').attr('disabled','disabled');\n $('#'+itemId+'-stock').attr('disabled','disabled');\n $('#'+itemId+'-save').attr('disabled','disabled');\n $('#'+itemId+'-edit').show();\n $('#'+itemId+'-cancel').hide();\n}", "function actionCancelEditCategory()\n{\n\t// Revert field input data be null\n\t$('#txt_category_id').val(0);\n\t$('#cbo_parent').val(0);\n\t$('#txt_name').val('');\n\t$('#txt_description').val('');\n\t\n\t// Change button update become save\n\t$('.category.btn-update').fadeOut(500);\n\t$('.category.btn-cancel-edit').fadeOut(500);\n\tsetTimeout(function(){$('.category.btn-save').fadeIn(600).removeClass('hide');}, 500);\n}", "function cancel(){\n $uibModalInstance.dismiss('delete');\n }", "cancelTransaction(event) {\n if (this.retroDateValuesFinal != []) {\n revertRetroDatesOnly({ selectedCareAppId: this.careApplicationId })\n this.isModalOpen = event.detail.showParentModal;\n this.bReasonCheck = false;\n this.bShowConfirmationModal = event.detail.showChildModal;\n this.bFormEdited = false;\n } else {\n this.bReasonCheck = false;\n this.isModalOpen = event.detail.showParentModal;\n this.reasonValueChange = '';\n this.bShowConfirmationModal = event.detail.showChildModal;\n this.bFormEdited = false;\n }\n }", "function cancelEdit(e){\n if (e.target.classList.contains('post-cancel')) {\n ui.changeFormState('add');\n }\n\n e.preventDefault();\n}", "function cancelInterview(id) {\n \n return axios.delete(`api/appointments/${id}`)\n .then(() => \n dispatch({ type : SET_INTERVIEW, value : {id, inverview : null }}))\n }", "cancelEditHours() {\n let day = this.hoursRevertData;\n this.hours[day.day_order] = day;\n this.hoursRevertData = null;\n }", "function cancel(event) {\n let dialog = document.getElementById(\"dialog\");\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"post\").value = \"\";\n document.getElementById(\"submit-btn\").innerHTML = \"Submit\";\n dialog.open = false;\n console.log(\"cancel\");\n}", "handleCancel(event){\n this.showMode=true;\n this.hideButton=false;\n this.setEdit = true;\n this.hideEdit=false; \n }", "function cancelInterview(id) {\n console.log(\"in cancel interview\")\n \n return axios.delete(`/api/appointments/${id}`)\n .then(() => {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n \n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n \n setState(updateSpots({\n ...state,\n appointments: appointments\n }))\n })\n \n }", "function onCancelClick() {\n logger.info('cancel_button click event handler');\n clearAllErrors();\n closeKeyboards();\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n}", "cancel(){\n this.game.activeNPC.action=null;\n this.game.activeNPC=null;\n }", "cancel() {\n this.dispatchEvent(new PayloadEvent(ModifyEventType.CANCEL, this.clone_));\n this.setActive(false);\n }", "function cancelOption(){\n document.getElementById(\"newOption\").style.display = \"none\";\n document.getElementById(\"pollSelection\").value = \"\";\n document.getElementById(\"newOptionValue\").value = \"\";\n document.getElementById(\"optionWarning\").innerHTML = \"\";\n }", "function cancel(e) {\n titleTask.value = null;\n descriptionTask.value = null;\n e.target.parentElement\n .parentElement\n .parentElement\n .classList.toggle('show');\n root.classList.toggle('opacity');\n document.body.classList.toggle('stop-scrolling');\n}", "cancel()\n{\n console.log('cancel');\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: this.recordId,\n objectApiName: 'Opportunity', // objectApiName is optional\n actionName: 'view'\n }\n });\n}", "handleCancel() {\n this.handleModalToggle();\n this.resetData();\n }", "function cancelInterview(id, interview) {\n return axios\n .delete(`/api/appointments/${id}`, { interview })\n .then((response) => {\n const appointment = {\n ...state.appointments[id],\n interview: null,\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment,\n };\n return setState({\n ...state,\n appointments,\n });\n });\n }", "function dialogCancel(){\n\n // clear old inputs\n $content.find( localCfg.tabQueryItems ).remove();\n $content.find( localCfg.tabResultList ).empty();\n $content.find( localCfg.tabDistrList ).empty();\n $content.find( localCfg.tabDistrChart ).empty();\n $content.find( localCfg.tabAdjustList ).empty();\n\n // close the dialog\n dialog.close();\n\n }", "cancel() {\n cancel();\n }", "function handleClose() {\n setOpen(false)\n setEditItem(null)\n }", "cancelNewQualification() {\n\t\tthis.addNewQualificationState = false;\n\t\tthis.newQualification = {\n\t\t\tdescription: null,\n\t\t\tdoctor: null,\n\t\t};\n\t}", "cancel(){\r\n\t\tthis.undoButton.addEventListener(\"click\" , () =>{\r\n\t\tclearInterval(this.chronoInterval);\r\n\t\tthis.time = 1200000/1000; \r\n\t\talert (\"Votre annulation de réservation vélo a bien été prise en compte.\");\r\n\t\tthis.nobooking.style.display=\"block\";\r\n this.textReservation.classList.add(\"invisible\");\r\n\t\tthis.bookingResult.classList.add(\"invisible\"); \r\n\t\tthis.drawform.style.display = \"none\";\r\n\t\tthis.identification.style.display = \"none\";\r\n\t\tthis.undoButton.style.opacity = \"0\";\r\n\t\tthis.infoStation.style.opacity = \"1\";\r\n\t\tthis.infoStation.scrollIntoView({behavior: \"smooth\", block: \"center\", inline: \"nearest\"});\r\n\t\tdocument.getElementById(\"search\").style.height = \"initial\"; \r\n\t\tsessionStorage.clear();\r\n\t })\r\n\t}", "cancel() {\n delete activityById[id];\n }", "function cancelPopupAction () {\n setPopupInfo({})\n }", "function cancelPomo() {\n let panel = document.getElementById(\"cancel-button-dialog\");\n timerEnd = time - 1;\n setPomoById(currentPomoID, previousState);\n cancelTimerFlag = 1;\n closeCancelDialog();\n if (getPomoById(currentPomoID).actualPomos == 0) {\n getPomoById(currentPomoID).sessionStatus = SESSION_STATUS.incomplete;\n setPomo(INVALID_POMOID);\n }\n let mainpage = document.getElementById(\"main-page\");\n let timerpage = document.getElementById(\"timer-page\");\n mainpage.style.display = \"\";\n timerpage.style.display = \"none\";\n updateTable();\n}", "function cancel() {\n $('#confirmExportModal').css('display', 'none');\n $('#confirmImportModal').css('display', 'none');\n $('#confirmDownloadLogModal').css('display', 'none');\n $('#confirmCustomSchedExportModal').css('display', 'none');\n }", "function cancel(id) {\n var remove = document.getElementById('removeItem');\n if (remove) {\n remove.parentNode.removeChild(remove);\n }\n\n var edit = document.getElementById('editItem');\n if (edit) {\n edit.parentNode.removeChild(edit);\n }\n\n var input = document.getElementById('inputBox');\n if (input) {\n input.parentNode.removeChild(input);\n }\n\n var submit = document.getElementById('editSubmitBtn');\n if (submit) {\n submit.parentNode.removeChild(submit);\n }\n\n var cancel = document.getElementById('cancelItem');\n if (cancel) {\n cancel.parentNode.removeChild(cancel);\n }\n}", "function cancelInterview(id, interview) {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n // store the appointment within appointments\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n // Update the data in the persistent database\n return axios.delete(`http://localhost:8001/api/appointments/${id}`, appointment)\n .then((res) => {\n const days = updateSpots(state.day, state.days, appointments);\n // Changing the state refreshes with new values\n setState({ ...state, appointments, days });\n // once api call is completed we return true\n return res;\n })\n }", "_onCancel () {\n this._toggleModal(false);\n this.setState({refreshed: false});\n this.restartModal();\n }", "function cancelInterview(id) {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n const days = state.days.map(day => {\n return day.id === checkDay(id)\n ? { ...day, spots: day.spots + 1 }\n : { ...day };\n });\n //deletes the interview from database\n return axios.delete(`/api/appointments/${id}`).then(() => {\n //setState({ ...state, appointments })\n dispatch({ type: SET_INTERVIEW, value: { appointments, days } });\n });\n }", "function cancel() {\n props.dispatch({\n type: 'CLEAR_TRAVEL_FORM',\n });\n toggle();\n }", "function CancelModalDialog() {\r\n tb_remove();\r\n }", "function cancelReplacement() {\n listReplacements();\n $scope.openReplacementDetails = false;\n $scope.resolvedReplacementDetails = false;\n $scope.cancelReplacementDetails = true;\n }", "cancelTransaction(event) {\n //this.bShowModal = false;\n //this.bShowConfirmationModal = false;\n this.bFormEdited = false;\n\n this.bShowModal = event.detail.showParentModal; //read from child lwc and assign here\n this.bShowConfirmationModal = event.detail.showChildModal; //read from child lwc and assign here\n this.closeModal();\n }", "function addTramiteCancel(){\n vm.modalAddTramite.dismiss();\n vm.name = \"\";\n vm.surnames = \"\";\n vm.rfc = \"\";\n vm.tramite = \"\";\n }", "function cancelEditTodoList() {\n $(\"editListDiv\").style.display='none';\n}", "function closeModalEdit(){\n modalEdit.style.display = \"none\"\n modalFormEdit.reset()\n }" ]
[ "0.75310826", "0.7472145", "0.72921914", "0.72144395", "0.71878", "0.7137927", "0.7091826", "0.703644", "0.70224464", "0.70043117", "0.6931523", "0.6899447", "0.6882118", "0.6872421", "0.6871263", "0.6869518", "0.6857791", "0.68068117", "0.67740315", "0.676982", "0.6731836", "0.6712991", "0.6696666", "0.66875297", "0.66776544", "0.6663056", "0.66354406", "0.6607597", "0.6596168", "0.6596168", "0.6583665", "0.655231", "0.655029", "0.6549274", "0.6547723", "0.65112984", "0.65100515", "0.6467705", "0.64672637", "0.64559793", "0.64524513", "0.6431825", "0.6400836", "0.6397195", "0.63940614", "0.6377475", "0.6373304", "0.6370247", "0.63665676", "0.6355433", "0.63446265", "0.6337622", "0.6322995", "0.6322995", "0.6322995", "0.6322995", "0.6322995", "0.6322995", "0.6322995", "0.6277565", "0.62682915", "0.6251508", "0.624947", "0.62416404", "0.6239559", "0.6214066", "0.62025017", "0.6192713", "0.6180827", "0.61759585", "0.61669606", "0.615492", "0.61546105", "0.61528224", "0.61458355", "0.6138027", "0.61319315", "0.6130159", "0.6129151", "0.610917", "0.610315", "0.6099065", "0.609823", "0.6067847", "0.6048377", "0.6047205", "0.6041725", "0.60386944", "0.6037588", "0.60296327", "0.60081464", "0.6001019", "0.6000609", "0.59991056", "0.59973353", "0.5993427", "0.59926444", "0.59914136", "0.59910965", "0.5987965" ]
0.7528529
1
This function clears the inputs on the edit form for a opportunity
function clearEditOppForm() { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#OppDetails').fadeOut(500, function () { $('#OppDetails').hide(); $('#editOpp').val(""); $('#editOppPerson').val(""); $('#editOppNumber').val(""); $('#editOppEmail').val(""); $('#editOppAmount').val(""); $('#editOppDate').val(""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item_year\").val(\"\");\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_search\").prop(\"disabled\", true);\n $(\"#btn_add_item\").prop(\"disabled\", true);\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n // disable link to author page\n $(\"#link_current_author\").removeClass(\"text-primary\");\n $(\"#link_current_author\").addClass(\"text-muted\");\n // hide editions page\n $(\"#page_editions\").hide(\"slow\");\n }", "function clear_form_data() {\n var item_area=$('#item_area');\n console.log(\"Clear all data\");\n item_area.val(\"\");\n $('#change_course_dis_text').val(\"\");\n $('#course_name_text').val(\"\");\n $('#course_dis_text').val(\"\");\n\n }", "clearInputs() {\n\t\t$(this.elementConfig.nameInput).val(\"\");\n\t\t$(this.elementConfig.courseInput).val(\"\");\n\t\t$(this.elementConfig.gradeInput).val(\"\");\n\n\t}", "function resetEditModal() {\n $('#userIdEdit').val('');\n $('#firstNameEdit').val('');\n $('#lastNameEdit').val('');\n $('#ageEdit').val('');\n}", "function clear_form_data() {\n $(\"#promotion_title\").val(\"\");\n $(\"#promotion_promotion_type\").val(\"\");\n $(\"#promotion_start_date\").val(\"\");\n $(\"#promotion_end_date\").val(\"\");\n $(\"#promotion_active\").val(\"\");\n }", "function clearFields() {\r\n\t\t\t\t\t\t$('#tf_Id').val(null);\r\n\t\t\t\t\t\t$('#tf_Descricao').val(null);\r\n\t\t\t\t\t\t$('#slc_Marca').val(0);\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').val(0);\r\n\t\t\t\t\t\t$('#slc_Status').val(0);\r\n\t\t\t\t\t\t$('#btn-operation').val(\"Criar Modelo\");\r\n\t\t\t\t\t}", "function clear_form_data() {\n $(\"#promo_name\").val(\"\");\n $(\"#promo_type\").val(\"\");\n $(\"#promo_value\").val(\"\");\n $(\"#promo_start_date\").val(\"\");\n $(\"#promo_end_date\").val(\"\");\n $(\"#promo_detail\").val(\"\");\n $(\"#promo_available_date\").val(\"\");\n }", "function clear_form_data() {\n $(\"#inventory_name\").val(\"\");\n $(\"#inventory_category\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_count\").val(\"\");\n }", "function clear_form_data() {\n $(\"#cust_id\").val(\"\");\n $(\"#order_id\").val(\"\");\n $(\"#item_order_status\").val(\"\");\n }", "clearFields() {\n document.getElementById('title').value='';\n document.getElementById('author').value='';\n document.getElementById('isbn').value='';\n }", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\n}", "function clearDetailForm(){\n inputIdDetail.val(\"\");\n inputDetailItem.val(\"\");\n inputDetailQuantity.val(\"\");\n inputDetailPrice.val(\"\");\n inputDetailTotal.val(\"\");\n inputDetailItem.focus();\n}", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "clearFields() {\r\n document.getElementById('title').value = '',\r\n document.getElementById('author').value = '',\r\n document.getElementById('isbn').value = '';\r\n }", "function clear_form_data() {\n $(\"#recommendation_id\").val(\"\");\n $(\"#recommendation_productId\").val(\"\");\n $(\"#recommendation_suggestionId\").val(\"\");\n $(\"#recommendation_categoryId\").val(\"\");\n $(\"#recommendation_old_categoryId\").val(\"\");\n }", "function clearInputs() {\r\n document.getElementById('addressBookForm').reset();\r\n }", "function clearRepairAgentInputs()\r\n {\r\n $('#claimdetails-repairagentid-input').val('');\r\n $('#claimdetails-repairagentname-input').val('');\r\n $('#claimdetails-repairagentphone-input').val('');\r\n $('#claimdetails-repairagentemail-input').val('');\r\n $('#claimdetails-repairagentunithouse-input').val('');\r\n $('#claimdetails-repairagentstreet-input').val('');\r\n $('#claimdetails-repairagentsuburbcity-input').val('');\r\n $('#claimdetails-repairagentstate-input').val('');\r\n $('#claimdetails-repairagentpostcode-input').val('');\r\n }", "function clearRepairAgentInputs()\r\n {\r\n $('#claimdetails-repairagentid-input').val('');\r\n $('#claimdetails-repairagentname-input').val('');\r\n $('#claimdetails-repairagentphone-input').val('');\r\n $('#claimdetails-repairagentemail-input').val('');\r\n $('#claimdetails-repairagentunithouse-input').val('');\r\n $('#claimdetails-repairagentstreet-input').val('');\r\n $('#claimdetails-repairagentsuburbcity-input').val('');\r\n $('#claimdetails-repairagentstate-input').val('');\r\n $('#claimdetails-repairagentpostcode-input').val('');\r\n }", "_clearInputs() {\n this.elements.peopleInput.value = \"\";\n this.elements.descriptionInput.value = \"\";\n this.elements.titleInput.value = \"\";\n return this;\n }", "function clearFields() {\n name.value = \"\";\n title.value = \"\";\n hourlyRate.value = \"\";\n hours.value = \"\";\n salary.value = \"\";\n baseSalary.value = \"\";\n commissionRate.value = \"\";\n sales.value = \"\";\n commissionOption.checked = false;\n salaryOption.checked = false;\n hourlyOption.checked = false;\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\n }", "clearFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#reference').value = '';\n document.querySelector('#price').value = '';\n }", "function clearAppointmentInput() {\n\t$('#description').val(\"\");\n\t$('#addAppointmentDatepicker').val(\"\");\n\t$('#timepicker').val(\"\");\n\t$('#duration').val(\"\");\n\t$('#owner').val(\"\");\n}", "function clearForm() {\n\t\tconst blankState = Object.fromEntries(\n\t\t\tObject.entries(inputs).map(([key, value]) => [key, \"\"])\n\t\t);\n\t\tsetInputs(blankState);\n\t}", "function resetEdit() {\n\t$('.icons').removeClass('editable');\n\t$('#save-recipe, #cancel-recipe').hide();\n\t$('#detail-description, #detail-name').attr('contenteditable', false);\n\t$('#detail-new-ingredient-input').hide();\n}", "clearFields(){\n this.description.value = \"\"\n this.amount.value = \"\"\n this.date.value = \"\"\n }", "function clear_form_data() {\n $(\"#inventory_product_id\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_quantity\").val(\"\");\n $(\"#inventory_restock_level\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n }", "function resetEditMenuForm(){\r\n EMenuNameField.reset();\r\n EMenuDescField.reset();\r\n EMStartDateField.reset();\r\n EMEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "function clear_item_form_data() {\n $(\"#item_product_id\").val(\"\");\n $(\"#item_order_id\").val(\"\");\n $(\"#item_name\").val(\"\");\n $(\"#item_quantity\").val(\"\");\n $(\"#item_price\").val(\"\");\n $(\"#item_status\").val(\"\");\n }", "function clearInputfields() {\r\n\t$('#title').val('');\r\n\t$('#desc').val('');\r\n\t$('#email').val('');\r\n}", "function resetPresidentForm(){\n fechaInicioField.setValue('');\n descripcionEventoField.setValue('');\n }", "function resetPresidentForm(){\n consecuenciasField.setValue('');\n descripcionField.setValue('');\n }", "function clear_form_data() {\n $(\"#product_id\").val(\"\");\n $(\"#recommended_product_id\").val(\"\");\n $(\"#recommendation_type\").val(\"\");\n $(\"#likes\").val(\"\");\n }", "function clearInputFields(el) {\r\n\tel.parent().siblings('.modal-body').find('input').val('');\r\n}", "function clearFields() {\n movie_name.value = '';\n release_date.value = '';\n movie_banner.value = '';\n description.value = '';\n}", "function clearInputs(){\n\t//array is filled with the HTML ids of the input value fields\n\t//array loops through each id,resets the value to empty string\n\t\tvar inputIds = [\n\t\t\t\ttitleInput,\n\t\t\t\turgency,\n\t\t\t\t ];\n\n\t\t\tinputIds.forEach(function(id){\n\t\t\t\t\tid.value = '';\n\t\t\t});\n}", "function resetEditRoomForm(){\r\n \r\n ERoomNumberField.reset();\r\n ERoomValidFromField.reset();\r\n ERoomValidToField.reset();\r\n\t\t\t\t\t \r\n }", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n }", "clear() {\n this.jQueryName.val('');\n this.jQueryEmail.val('');\n this.jQueryCount.val('');\n this.jQueryPrice.val('$');\n\n this.jQueryCities.selectAll.prop('checked', false);\n this.jQueryCities.cities.prop('checked', false);\n\n this.clearInvalid();\n this.hideNotes();\n }", "function clearRecipeInputs() {\n $('#title').val('');\n $('#ingredient-list').empty();\n $('#instruction').val('');\n}", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \n \t\n \t$('#frmMain').find(':input').each(function(){\n \t\tvar id = $(this).prop('id');\n \t\tvar Value = $('#' + id).val(\" \");\n \t});\n \t \t\n \t$('#txtShape').val('Rod'); \n \t$(\"#drpInch\").val(0);\n $(\"#drpFraction\").val(0);\n \n UncheckAllCheckBox();\n clearSelect2Dropdown();\n \n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \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 }", "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 ClearPopupFormValues() {\n\t$('#eventSummary').val(\"\");\n\t$('#eventDescription').val(\"\");\n\t$('#eventLocation').val(\"\");\n\t$('#eventStartTime').val(\"00\");\n\t$('#eventStartMinute').val(\"00\");\n}", "function clearForm() {\n $scope.description = '';\n $scope.title = '';\n $scope.lat = '';\n $scope.lng = '';\n }", "clearFields(){\n this.titleInput.value = '';\n this.bodyInput.value = '';\n }", "function clearFields(){\n $(\"#idInput\").val('');\n $(\"#titleInput\").val('');\n $(\"#contentInput\").val('');\n $(\"#authorInput\").val('');\n $(\"#dateInput\").val(''); \n $(\"#authorSearch\").val('');\n $(\"#idDelete\").val('');\n}", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "function clearTable(){\n form.locationName.value = '';\n form.locationMinCustomers.value = '';\n form.locationMaxCustomers.value = '';\n form.locationAvgCookiesSold.value = '';\n}", "function clearNewEvent() {\n $(\"#new-event-name-input\").val(\"\");\n $(\"#new-event-date-input\").val(\"\");\n $(\"#new-event-time-input\").val(\"\");\n $(\"#address\").val(\"\");\n $(\"#new-event-description-input\").val(\"\");\n $(\"#item_needed1\").val(\"\");\n $(\"#item_needed2\").val(\"\");\n $(\"#item_needed3\").val(\"\");\n $(\"#item_needed4\").val(\"\");\n}", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.name = \"\";\r\n self.model.address = \"\";\r\n }", "function clearInputs() {\n $('#employeeFirstName').val('');\n $('#employeeLastName').val('');\n $('#employeeId').val('');\n $('#employeeTitle').val('');\n $('#employeeSalary').val('');\n}", "function clearInputs() {\n setInputTitle(\"\");\n setInputAuthor(\"\");\n setInputPages(\"\");\n setInputStatus(\"read\");\n}", "function resetEditMenuItemForm(){\r\n EMenuItemNameField.reset();\r\n \tEMenuItemDescField.reset();\r\n \tEMenuItemValidFromField.reset();\r\n EMenuItemValidToField.reset();\r\n \tEMenuItemPriceField.reset();\r\n \tEMenuItemTypePerField.reset();\r\n\t\t\t\t\t \r\n }", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clearForm() {\n isNewObject = true;\n var $dialog = dialog.getElement();\n $('input:text', $dialog).val('');\n $('.input-id', $dialog).val(0);\n $('.input-password', $dialog).val('');\n $('.input-connection-id', $dialog).val(0);\n $('.input-engine', $dialog)[0].selectedIndex = 0;\n $('.input-port', $dialog).val(engines.mysql.port);\n $('.input-confirm-modifications', $dialog).prop('checked', true);\n $('.input-save-modifications', $dialog).prop('checked', false);\n $('.input-trusted-connection', $dialog).prop('checked', false);\n $('.input-instance-name', $dialog).val('');\n }", "static clearFields(){\n document.querySelector('#title').value ='';\n document.querySelector('#author').value ='';\n document.querySelector('#isbn').value ='';\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 clear_form_data() {\n $(\"#product_id\").val('');\n $(\"#rec_product_id\").val('');\n $(\"#rec_type_id\").val('1');\n $(\"#weight_id\").val('');\n }", "function clearEdits(){\n\n}", "function clearForm() {\n\n $(\"#formOrgList\").empty();\n $(\"#txtName\").val(\"\");\n $(\"#txtDescription\").val(\"\");\n $(\"#activeFlag\").prop('checked', false);\n $(\"#orgRoleList\").empty();\n }", "function clearInputFields(){\n $( '#idInput').val( '' );\n $( '#firstNameInput').val( '' );\n $( '#lastNameInput').val( '' );\n $( '#roleInput').val( '' );\n $( '#salaryInput').val( '' );\n}", "clearFields() {\n this._form.find('.form-group input').each((k, v) => {\n let $input = $(v);\n if ($input.attr('type') !== \"hidden\") {\n $input.val('');\n }\n });\n }", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.component = \"\";\r\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 clearInputFields() {\n zipcodeInput.val('');\n cityInput.val('');\n stateInput.val('');\n} //end clearInputFields", "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 clear_form_data() {\n $(\"#customer_id\").val(\"\");\n $(\"#product_id\").val(\"\");\n $(\"#text\").val(\"\");\n $(\"#quantity\").val(\"\");\n $(\"#price\").val(\"\");\n }", "_resetUpdateITOInfoForm()\r\n\t{\r\n\t\tvar self=this;\r\n\t\tvar form=document.getElementById(\"updateITOInfoForm\");\r\n\t\tform.reset();\r\n\t\tform.itoId.value=\"\";\r\n\t\t \r\n\t\tform.joinDate.value=\"\";\r\n\t\t$(form.joinDate).datepicker(\"destroy\");\r\n\t\t$(form.joinDate).datepicker({changeMonth: true,\r\n\t\t\t changeYear: true,\r\n\t\t\t dateFormat: 'yy-mm-dd',\r\n\t\t\t \"defaultDate\":new Date()});\r\n\t\t$(form.joinDate).datepicker(\"refresh\");\r\n\t\tform.leaveDate.value=\"2099-12-31\";\r\n\t\t\r\n\t\tvar blackListShiftListDiv=$(\"div.blackListShiftListDiv\")[0];\r\n\t\r\n\t\t$(blackListShiftListDiv).empty();\r\n\t\tself._addBlackListShiftPatternEntry(\"\",blackListShiftListDiv);\r\n\t\tform.submitButton.value=\"Add\";\r\n\t}", "function clearForm() {\n $(\"#name-input\").val(\"\");\n $(\"#destination-input\").val(\"\")\n $(\"#firstTime-input\").val(\"\");\n $(\"#frequency-input\").val(\"\");\n }", "function clearHeadForm(){\n inputHeadEntity.val(\"\");\n inputHeadIdEntity.val(\"\");\n inputHeadTotal.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('#date').value = '';\n document.querySelector('#title').value = '';\n document.querySelector('#post').value = '';\n }", "function clearForm() {\n $scope.Address = '';\n $scope.CityTown = '';\n $scope.WName = '';\n\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 ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'||this.type=='hidden') {\n this.value = '';\n }\n else if (this.type == 'radio' || this.type == 'checkbox') {\n this.checked = false;\n }\n else if (this.type == 'select-one' || this.type == 'select-multiple') {\n this.value = '-1';\n }\n });\n\n }", "function clearIngredientForm() {\n dishMakerIngredientsTable.clear().draw();\n $(\"#newDishName\").val('');\n $(\"#profitMarginInput\").val('');\n $(\"#addIngredientNameInput\").val('');\n $(\"#addIngredientAmountInput\").val('');\n $(\"#totalCostCalculated\").text('');\n $(\"#sellingPrice\").text('');\n}", "function clear_inputs() {\n\n\t\t\t\t$('.form-w').val(\"\");\n\t\t\t\t$('.form-b').val(\"\");\n\t\t\t\t$('.form-mf').val(\"\");\n\t\t\t\t$('.form-mt').val(\"\");\n\n\t\t\t\tlocalStorage.clear();\n\n\t\t\t}", "function clearAddDetails(){\n\tdocument.getElementById(\"addName\").value = \"\";\n\tdocument.getElementById(\"addAC\").value = \"\";\n\tdocument.getElementById(\"addMaxHP\").value = \"\";\n\tdocument.getElementById(\"addInitiative\").value = \"\";\n\tresetAddFocus();\n}", "function clearFields(event) {\n event.target.fullName.value = '';\n event.target.status.value = '';\n }", "static clearField(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clearPendInvForm() {\n $('#pendingInvoiceCreationZone').find('#invoiceNumberPend').val('');\n $('#pendingInvoiceCreationZone').find('#invoiceAmtPend').val('');\n $('#pendingInvoiceCreationZone').find('#subNamesPend').val('');\n $('#pendingInvoiceCreationZone').find('#submittedDatePend').val('');\n $('#pendingInvoiceCreationZone').find('#briefDescriptionPend').val('');\n $('#pendingInvoiceCreationZone').find('#statusPend').val('Open');\n $('#pendingInvoiceCreationZone').find('#dbCoNumPend').val('');\n $('#pendingInvoiceCreationZone').find('#poNumPend').val('');\n $('#pendingInvoiceCreationZone').find('#notesPend').val('');\n}", "function clearHumanResource() {\n $('#drpName').val('');\n $('#txtOfferDays').val('');\n $('#txtOfferAmountperday').val('');\n $('#txtRealEstimatedDays').val('');\n}", "function clearFormContent() {\n $(\"#formOrgList\").empty();\n Organizations.length = 0;\n // Reset the name field\n clearDetailContent();\n currentOrg = undefined;\n }", "function clearFormContent() {\n $(\"#formOrgList\").empty();\n Organizations.length = 0;\n // Reset the name field\n clearDetailContent();\n currentOrg = undefined;\n }", "function clearInputs() {\n $('#firstNameIn').val('');\n $('#lastNameIn').val('');\n $('#employeeIDIn').val('');\n $('#jobTitleIn').val('');\n $('#annualSalaryIn').val('');\n}", "function clearForm(event) {\n event.target.elements['title'].value = null;\n event.target.elements['author'].value = null;\n event.target.elements['pages'].value = null;\n event.target.elements['read'].value = false ;\n}", "function clearProjectInputs() {\n $('#p_Id').val(\"\");\n $('#p_Title').val(\"\");\n $('#p_CreatedBy').val(\"\");\n $('#p_FY').val(\"\");\n $('#p_Owner').val(\"\");\n $('#txtpDescr').text(\"\");\n $('#pckComplete').prop('checked', false);\n $('#pStartDate').val('');\n $('#pEndDate').val('');\n $('#selBL').val(0);\n $('#selPS').val(0);\n}", "function clearForm() {\r\n\t\t\t$('#areaForm input[type=\"text\"]').val(\"\");\r\n\t\t}", "static clearInput() {\n inputs.forEach(input => {\n input.value = '';\n });\n }", "function clearInputFields() {\n $('#firstName').val('');\n $('#lastName').val('');\n $('#idNumber').val('');\n $('#jobTitle').val('');\n $('#annualSalary').val('');\n} // END: clearInputFields()", "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 ClearFields() { }", "function clearInputFields() {\n $('input#date').val('');\n $(\"select\").each(function () {\n this.selectedIndex = 0;\n });\n }", "function resetInputFields() {\n document.getElementById(\"description\").value = '';\n document.getElementById(\"value\").value = '';\n}", "function employee_Clear_FromData()\r\n\t{\r\n\t\t$(\"#employee_title\").val(\"\");\r\n\t\t$(\"#employee_fullName\").val(\"\");\r\n\t\t$(\"#employee_surname\").val(\"\");\r\n\t\t$(\"#employee_fatherName\").val(\"\");\r\n\t\t$(\"#employee_gender\").val(\"\");\r\n\t\t$(\"#employee_email\").val(\"\");\r\n\t\t$(\"#employee_maritalStatus\").val(\"\");\r\n\t\t$(\"#employee_postalAddress\").val(\"\");\r\n\t\t$(\"#employee_nic\").val(\"\");\r\n\t\t$(\"#employee_mobile\").val(\"\");\r\n\t\t$(\"#employee_phone\").val(\"\");\r\n\t\t$(\"#employee_religion\").val(\"\");\r\n\t\t$(\"#employee_department\").val(\"\");\r\n\t\t$(\"#employee_employeeId\").val(\"\");\r\n\t\t$(\"#employee_date\").val(\"\");\r\n\t\t\r\n\t\t///\r\n\t\t$(\"form#formID :input\").each(function(){\r\n\t\t\t var input = $(this); // This is the jquery object of the input, do what you will\r\n\t\t\t});\r\n\t\t//remove Delete Button\r\n\t\tremove_child_Elements('employee-delete-btn');\r\n\t}", "function clearFields() {\n $('#input_form')[0].reset()\n }" ]
[ "0.75559187", "0.7507091", "0.7383113", "0.7323118", "0.7318477", "0.7314623", "0.728837", "0.72187555", "0.7209933", "0.7204842", "0.71905166", "0.7185397", "0.7183318", "0.7175612", "0.7173881", "0.71593165", "0.7152816", "0.7135449", "0.7126685", "0.7126685", "0.7119893", "0.71146464", "0.71031517", "0.70983094", "0.7091391", "0.7088122", "0.70724714", "0.7064081", "0.70596486", "0.70579916", "0.7053933", "0.7052306", "0.70460474", "0.70385194", "0.7032553", "0.702638", "0.7024391", "0.70232826", "0.70213944", "0.70148206", "0.6998986", "0.69921", "0.69866145", "0.6975945", "0.69713634", "0.69703513", "0.69692534", "0.6967391", "0.69669294", "0.69669294", "0.69669294", "0.69655484", "0.69653714", "0.6964711", "0.6960808", "0.6959645", "0.6950674", "0.6948522", "0.69455594", "0.6941246", "0.6941068", "0.6939151", "0.6936986", "0.6927611", "0.6926421", "0.69217277", "0.69056994", "0.6903776", "0.6901171", "0.6900337", "0.6900088", "0.6882752", "0.68714523", "0.6870131", "0.68696046", "0.68696046", "0.6846723", "0.6841875", "0.6830469", "0.6830029", "0.6827206", "0.68254006", "0.6821565", "0.68200487", "0.6817649", "0.6812751", "0.6802036", "0.67983925", "0.67983925", "0.6795948", "0.6793052", "0.6793033", "0.6788735", "0.67874044", "0.6787028", "0.6781143", "0.6777231", "0.67687654", "0.67672575", "0.6766459", "0.67660785" ]
0.0
-1
This function deletes an attachment from a Prospects list opportunity item and then refreshed the Prospects form
function deleteOppAttachment(url, itemID) { var attachment = web.getFileByServerRelativeUrl(url); attachment.deleteObject(); showOppDetails(itemID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOppDetails(itemID) {\n var errArea = document.getElementById(\"errAllOpps\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n $('#AddOpp').hide();\n $('#OppDetails').hide();\n $('#AddSale').hide();\n $('#SaleDetails').hide();\n\n currentItem = list.getItemById(itemID);\n context.load(currentItem);\n context.executeQueryAsync(\n function () {\n $('#editOpp').val(currentItem.get_fieldValues()[\"Title\"]);\n $('#editOppPerson').val(currentItem.get_fieldValues()[\"ContactPerson\"]);\n $('#editOppNumber').val(currentItem.get_fieldValues()[\"ContactNumber\"]);\n $('#editOppEmail').val(currentItem.get_fieldValues()[\"Email\"]);\n $('#editOppAmount').val(\"$\" + currentItem.get_fieldValues()[\"DealAmount\"]);\n\n //Add an onclick event to the convertToSale div\n $('#convertToSale').click(function (sender) {\n convertToSale(itemID);\n });\n\n //Add an onclick event to the convertToLostSale div\n $('#convertToLostSale').click(function (sender) {\n convertToLostSale(itemID);\n });\n\n var oppList = document.getElementById(\"OppAttachments\");\n while (oppList.hasChildNodes()) {\n oppList.removeChild(oppList.lastChild);\n }\n if (currentItem.get_fieldValues()[\"Attachments\"] == true) {\n var attachmentFolder = web.getFolderByServerRelativeUrl(\"Lists/Prospects/Attachments/\" + itemID);\n var attachments = attachmentFolder.get_files();\n context.load(attachments);\n context.executeQueryAsync(function () {\n // Enumerate and list the Opp Attachments if they exist\n var attachementEnumerator = attachments.getEnumerator();\n while (attachementEnumerator.moveNext()) {\n var attachment = attachementEnumerator.get_current();\n\n var oppDelete = document.createElement(\"span\");\n oppDelete.appendChild(document.createTextNode(\"Delete\"));\n oppDelete.className = \"deleteButton\";\n oppDelete.id = attachment.get_serverRelativeUrl();\n\n\n $(oppDelete).click(function (sender) {\n deleteOppAttachment(sender.target.id, itemID);\n });\n oppList.appendChild(oppDelete);\n var oppLink = document.createElement(\"a\");\n oppLink.setAttribute(\"target\", \"_blank\");\n oppLink.setAttribute(\"href\", attachment.get_serverRelativeUrl());\n oppLink.appendChild(document.createTextNode(attachment.get_name()));\n oppList.appendChild(oppLink);\n oppList.appendChild(document.createElement(\"br\"));\n oppList.appendChild(document.createElement(\"br\"));\n }\n },\n function () {\n\n });\n }\n $('#OppDetails').fadeIn(500, null);\n\n },\n function (sender, args) {\n var errArea = document.getElementById(\"errAllOpps\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n\n}", "function storeOppAsAttachment() {\n var fileContents = fixBuffer(contents);\n var createitem = new SP.RequestExecutor(web.get_url());\n createitem.executeAsync({\n url: web.get_url() + \"/_api/web/lists/GetByTitle('Prospects')/items(\" + currentItem.get_id() + \")/AttachmentFiles/add(FileName='\" + file.name + \"')\",\n method: \"POST\",\n binaryStringRequestBody: true,\n body: fileContents,\n success: storeOppSuccess,\n error: storeOppFailure,\n state: \"Update\"\n });\n function storeOppSuccess(data) {\n\n // Success callback\n var errArea = document.getElementById(\"errAllOpps\");\n\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n // Workaround to clear the value in the file input.\n // What we really want to do is clear the text of the input=file element. \n // However, we are not allowed to do that because it could allow malicious script to interact with the file system. \n // So we’re not allowed to read/write that value in JavaScript (or jQuery)\n // So what we have to do is replace the entire input=file element with a new one (which will have an empty text box). \n // However, if we just replaced it with HTML, then it wouldn’t be wired up with the same events as the original.\n // So we replace it with a clone of the original instead. \n // And that’s what we need to do just to clear the text box but still have it work for uploading a second, third, fourth file.\n $('#oppUpload').replaceWith($('#oppUpload').val('').clone(true));\n var oppUpload = document.getElementById(\"oppUpload\");\n oppUpload.addEventListener(\"change\", oppAttach, false);\n showOppDetails(currentItem.get_id());\n }\n function storeOppFailure(data) {\n\n // Failure callback\n var errArea = document.getElementById(\"errAllOpps\");\n\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"File upload failed.\"));\n errArea.appendChild(divMessage);\n }\n}", "function deleteAttachment() {\r\n\tsimpleDialog(langOD27, langOD28,null,null,null,langCancel,\r\n\t\t\"$('#div_attach_upload_link').show();$('#div_attach_download_link').hide();$('#edoc_id').val('');enableAttachImgOption(0);\",langDelete);\r\n}", "function removeAttachmentBox(e) {\n\t\tvar idArray, id;\n\n\t\tidArray = e.currentTarget.id.split('_');\n\t\tif (!idArray.length) {\n\t\t\treturn;\n\t\t}\n\t\tid = idArray[idArray.length - 1];\n\t\te.preventDefault();\n\n\t\tif (confirm(delete_confirm_lang_string) == true) {\n\t\t\t$(\"#attached_form_\" + id).remove();\n\t\t}\n\t}", "function closeAttachmentDetail() {\r\n $(\"#invoiceId\", \"form#ajaxUploadForm\").val('');\r\n $(\"#transactionId\", \"form#ajaxUploadForm\").val('');\r\n $(\"#transactionType\", \"form#ajaxUploadForm\").val('');\r\n $('#divAttachment').dialog('close');\r\n}", "function wpabstracts_remove_attachment(id){\n var attachment_id = id;\n jQuery(\"#manage_attachments\").append('<input type=\"hidden\" name=\\\"abs_remove_attachments[]\\\" value =\"'+ attachment_id +'\">');\n jQuery(\"#attachment_\"+attachment_id).remove();\n}", "function wpabstracts_remove_attachment(id){\n var attachment_id = id;\n jQuery(\"#manage_attachments\").append('<input type=\"hidden\" name=\\\"abs_remove_attachments[]\\\" value =\"'+ attachment_id +'\">');\n jQuery(\"#attachment_\"+attachment_id).remove();\n}", "function removeAttachment(docid){\n\t$('#attachmentAlert').hide();\n\t$('.' + docid).hide();\n\t$('#' + docid + \"Title\").html(\"<br>'\" + $('#' + docid + \"Filename\").text() + \"' has been removed.\");\t$('#' + docid + \"Title\").show();\n\tif($('#delDocumentIds').val() == \"\"){\n\t\t$('#delDocumentIds').val(docid);\n\t}\n\telse{\n\t\t$('#delDocumentIds').val($('#delDocumentIds').val() + \",\" + docid);\n\t}\n\tif($('#wrForm').length) {\n\t\t$('#wrForm').validator('validate');\n\t}\n\telse if($('#woForm').length){\n\t\t$('#woForm').validator('validate');\n\t}\t\t\t\t\t\t \n\t $(\"html, body\").animate({ scrollTop: $(document).height() }, \"slow\");\n}", "function deleteReciprocalAssociation(field, recip_obj_id) {\n var type = jQuery('#entry_form input[name=_type]').val();\n jQuery.get(\n CMSScriptURI + '?__mode=unlink_reciprocal',\n {\n 'recip_field_basename': field,\n 'recip_entry_id': recip_obj_id,\n 'cur_entry_id': jQuery('input[name=id]').val(),\n 'recip_obj_type': type\n },\n function(data) {\n jQuery('#'+field+'_status').html(data.message).show(500);\n\n // The association was successfully deleted from the database,\n // so delete the visible data.\n if (data.status == 1) {\n jQuery('input#'+field).val('');\n jQuery('ul#custom-field-reciprocal-'+field).children().remove();\n setTimeout(function() {\n jQuery('#'+field+'_status').hide(1000)\n }, 7000);\n }\n },\n 'json'\n );\n}", "function attachDelete(){\n $('.delete-properties').off();\n $('.delete-properties').click(function(){\n $(this).closest('.form-group').remove();\n propertyNum--;\n });\n}", "function deletePhoto() {\n $scope.work.email = $rootScope.email;\n $scope.menuOpened = 'closed';\n if(confirm('Delete this photo?')){\n $scope.work.src = ''; \n }\n //$state.reload();\n }", "function removeCollectionItem()\r\n {\r\n if (confirm('Are you sure you want to remove this item and any data you may have entered for it?')) {\r\n var $this = $(this);\r\n $this.closest('.form-group').remove();\r\n\r\n // Trigger a form changed event\r\n $(document).trigger('formChangedEvent');\r\n }\r\n }", "onRemove(e) {\n e.stopImmediatePropagation();\n const model = this.model;\n\n if (confirm(config.deleteAssetConfirmText)) {\n model.collection.remove(model);\n }\n }", "function deleteMe(item){\n fetch(\"/remove/\" + item.innerText,{\n method: \"delete\"\n }).then(res=>res.json())\n .then(res2 => {\n // console.log(res2)\n location.reload()\n });\n }", "function delete_workexp(work_id, certificate) {\n\n\n $('.biderror .mes').html('<div class=\"message\"><h2>Are you sure you want to delete this experience certificate?</h2><a id=\"delete\" class=\"mesg_link btn\" >OK</a><button data-fancybox-close=\"\" class=\"btn\">Cancel</button></div>');\n $('#bidmodal').modal('show');\n\n //$.fancybox.open('<div class=\"message\"><h2>Are you sure you want to delete this experience certificate?</h2><a id=\"delete\" class=\"mesg_link btn\" >OK</a><button data-fancybox-close=\"\" class=\"btn\">Cancel</button></div>');\n\n $('.message #delete').on('click', function () {\n $.ajax({\n type: 'POST',\n url: base_url + 'job/delete_workexp',\n data: 'work_id=' + work_id + '&certificate=' + certificate,\n success: function (data) {\n\n if (data == 1)\n {\n //$.fancybox.close(); \n $('#bidmodal').modal('hide');\n $('.job_work_edit_' + work_id + ' .img_work_exp a').remove();\n $('.job_work_edit_' + work_id + ' .img_work_exp img').remove();\n $('.job_work_edit_' + work_id + ' #work_certi').remove();\n }\n\n }\n });\n\n });\n}", "function mmResetDetail($attachment) {\n $attachment.closest(\".mediaModal\").find(\".mmcb-detail\").html('');\n}", "function attachDeleteEdit(){\n $('.delete-properties').off();\n $('.delete-properties').click(function(){\n $(this).closest('.form-group').remove();\n propertyNumEdit--;\n });\n}", "function deleteListItem() {\n item.remove();\n }", "function dispatchpartydetails_Delete() \r\n\t{\r\n\t\tcommon_delete(\"dispatchpartydetails\");\r\n\t}", "'click .js-media-delete-button'( e, t ) {\n e.preventDefault();\n\n let cur = $( '#cb-current' ).val()\n , idx = P.indexOf( `${cur}` );\n\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-media-toolbar' ).hide();\n $('#frameBorder').remove();\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\n\n //console.log( pp.find({}).fetch() );\n }", "function deletePhoto() {\n // If an operation is in progress, usually involving the server, don't do it.\n if (processing) { return false; }\n if (currentPhoto == null) {\n alert(\"Please select a photo first.\");\n return false;\n }\n // If photo happens to be growing, cut it short.\n snapImageToLandingPad();\n // Get the name of the selected collection, the filename of the current\n // photo, and verify deletion.\n var collectionName = parent.fraControl.document.getElementById(\n \"collectionsList\").value;\n var photoFilename = currentPhoto.getFilename();\n if (confirm(\"Are you sure you want to delete the current photo?\")) {\n // Show the please wait floatover.\n showPleaseWait();\n // Make AJAX call.\n dojo.io.bind({\n url: \"deletePhoto.action\",\n content: {collection: collectionName, filename: photoFilename},\n error: function(type, errObj) { alert(\"AJAX error!\"); },\n load: function(type, data, evt) {\n alert(data);\n hidePleaseWait();\n loadCollection();\n },\n mimetype: \"text/plain\",\n transport: \"XMLHTTPTransport\"\n });\n }\n}", "function deleteElement(e) {\n var caption = getItemCaptionFromURL();\n var index = -1;\n for (var i = 0; i < ingredient_arr.length; i++) {\n if (ingredient_arr[i] == e.parent().text().replace('\\u00D7', '')) {\n index = i;\n }\n }\n if(index != -1)\n ingredient_arr.splice(index, 1);\n\n var postRequest = new XMLHttpRequest();\n var requestURL = '/updateIng';\n postRequest.open('POST', requestURL);\n\n var requestBody = JSON.stringify({\n INGREDIENTS: ingredient_arr,\n CAPTION: caption\n });\n\n console.log(\"== Request Body:\", requestBody);\n postRequest.setRequestHeader('Content-Type', 'application/json');\n\n postRequest.addEventListener('load', function (event) {\n console.log(\"== status:\", event.target.status);\n if (event.target.status !== 200) {\n var responseBody = event.target.response;\n alert(\"Error saving item on server side: \", +responseBody);\n } else {\n $(e).parent().remove();\n }\n });\n\n postRequest.send(requestBody);\n\n}", "function postDelete() {\n console.log('item deleted');\n swal({\n title: \"Dare Approved!\",\n icon: \"success\",\n button: \"Done\"\n })\n .then( () => {\n location.reload();\n })\n }", "function deleteAttachment(idval)\n\t{\n\t\t\n\t\t//$(\"#LoadingImage\").show();\n\t\t \n\t\t $.ajax({\n\t\t\t type: 'GET',\n\t\t\t url: \"../../ws/ws_tinvoicereport.php\",\n\t\t\t data: ({action:2,id :idval}),\n\t\t\t \n\t\t\t dataType: 'json',\n\t\t\t timeout: 5000,\n\t\t\t success: function(data, textStatus, xhr) \n\t\t\t {\n\t\t\t\t // $(\"#LoadingImage\").hide();\n\t\t\t\t\n\t\t\t\t if(data==0)\n\t\t\t\t \talert(\"Row not deleted!\");\n\t\t\tlocation.reload();\n\t\t\t },\n\t\t\t error: function(xhr, status, errorThrown) \n\t\t\t {\n\t\t\t\t \n\t\t\tlocation.reload();\n\t\t\t\t// //alert(status + errorThrown);\n\t\t\t }\n\t\t }); //\t\n\n\t}", "function delete_job_work(work_id, certificate) {\n\n $('.biderror .mes').html('<div class=\"message\"><h2>Are you sure you want to delete this work experience?</h2><a id=\"delete\" class=\"mesg_link btn\" >OK</a><button data-fancybox-close=\"\" class=\"btn\">Cancel</button></div>');\n $('#bidmodal').modal('show');\n //$.fancybox.open('<div class=\"message\"><h2>Are you sure you want to delete this work experience?</h2><a id=\"delete\" class=\"mesg_link btn\" >OK</a><button data-fancybox-close=\"\" class=\"btn\">Cancel</button></div>');\n\n $('.message #delete').on('click', function () {\n\n $.ajax({\n type: 'POST',\n url: base_url + 'job/job_work_delete',\n data: 'work_id=' + work_id + '&certificate=' + certificate,\n success: function (data) {\n if (data == 1)\n {\n //$.fancybox.close();\n $('#bidmodal').modal('hide');\n $('.job_work_edit_' + work_id).remove();\n\n }\n\n }\n });//$.ajax end\n });\n}", "function deleteItem() {\n $('.activityMainContainer').on('click', '.delete', function(e) {\n\t \n e.preventDefault();\n edit();\n let id = $(this).closest('.row').find('.id').val();\n \n alert('Are you sure you want to delete the item? Deleting is PERMANENT. You will not be able to recover the data.');\n\n let settings = {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\" : \"Bearer \" + token\n }\n };\n \n fetch(`/sports/${id}`, settings)\n .then(response => {\n if (response.ok){\n\t\t// return response.json();\n }\n\t else{\n throw new Error(\"You need to be authenticated\");\n }\n })\n .then(responseJson => { \n $($(this).closest(\".row\")).remove();\n location.reload(false); \n \n })\n .catch(err => {\n\t\t//$(location).attr(\"href\", \"./index.html\");\n console.log(err);\n }); \n \n })\n }", "function SPDocumentonRemove(e) {\n // var files = e.files;\n //e.data = { 'POId': $('#UploadedDocumentId').val() };\n}", "function deleteSingleItem() {\n var msg;\n if (files[currentFileIndex].metadata.video) {\n msg = navigator.mozL10n.get('delete-video?');\n }\n else {\n msg = navigator.mozL10n.get('delete-photo?');\n }\n if (confirm(msg)) {\n deleteFile(currentFileIndex);\n }\n}", "delete() {\r\n return this.clone(WebPartDefinition, \"DeleteWebPart\").postCore();\r\n }", "async function admin_del_attachment(hash) {\n if (!confirm(\"Are you sure you wish remove this attachment from the archives?\")) {\n return\n }\n // rewrite attachments for email\n let new_attach = [];\n for (let el of admin_email_meta.attachments) {\n if (el.hash != hash) {\n new_attach.push(el);\n }\n }\n admin_email_meta.attachments = new_attach;\n let formdata = JSON.stringify({\n action: \"delatt\",\n document: hash\n });\n // remove attachment\n let rv = await POST('%sapi/mgmt.json'.format(G_apiURL), formdata, {});\n let response = await rv.text();\n\n // Edit email in place\n admin_save_email(true);\n\n if (rv.status == 200) {\n modal(\"Attachment removed\", \"Server responded with: \" + response, \"help\");\n } else {\n modal(\"Something went wrong!\", \"Server responded with: \" + response, \"error\");\n }\n}", "static onClickRemoveMedia() {\n let $element = $('.context-menu-target'); \n let id = $element.data('id');\n let name = $element.data('name');\n \n UI.confirmModal(\n 'delete',\n 'Delete media',\n 'Are you sure you want to delete the media object \"' + name + '\"?',\n () => {\n $element.parent().toggleClass('loading', true);\n\n HashBrown.Helpers.RequestHelper.request('delete', 'media/' + id)\n .then(() => {\n return HashBrown.Helpers.RequestHelper.reloadResource('media');\n })\n .then(() => {\n HashBrown.Views.Navigation.NavbarMain.reload();\n\n // Cancel the MediaViever view if it was displaying the deleted object\n if(location.hash == '#/media/' + id) {\n location.hash = '/media/';\n }\n })\n .catch(UI.errorModal);\n }\n );\n }", "deletePhoto() {\n\n // Get user\n let user = this.get('model');\n let url = this.get('photoDataUrl');\n\n // Delete the photo\n const deleteRequest = this.get('ajax').delete(url);\n\n // Handle success\n deleteRequest.then(()=> {\n user.set('photo', null);\n this.get('notify').success(this.get('i18n').t('notify.photoDeleted'));\n });\n }", "function deleteImage() {\n \n var array = document.querySelectorAll('.mySlides')\n for (i=0;i<array.length;i++) {\n if (array[i].style.display === 'block') {\n document.getElementById('imageId').value = array[i].id\n }\n }\n \n const input = {\n id : document.getElementById('imageId').value\n \n }\n \n fetch('https://lisathomasapi.herokuapp.com/routes/images/deleteImage', {\n method: 'POST',\n body: JSON.stringify(input),\n headers: { \"Content-Type\": \"application/json\"}\n }).then(function(response) {\n return response.json();\n }).then(function(data) {\n \n })\nwindow.location.href = 'adminmessage.html'\n \n}", "function deleteItem(entityType, entityItem) {\n\n var entityModel = $injector.get(entityType);\n entityModel.deleteById({ id: entityItem.id }).$promise\n .then(function() { \n Logger.info(entityType + ' Archived', 'Contact admin to retrieve')\n //remove deleted row from the grid without refreshViewing\n gridManager.refreshView()\n //shows deleted\n entityItem._isDeleted = true;\n // // go back - or close sidebar (Close is handled by sidebar router)\n SidebarRouter.goBack();\n\n //creates activity deleted\n var activityDetails = {\n title: 'Deleted ' + entityType,\n data: {\n deleted: true\n }\n }\n activityCreator.createActivity('changelog', activityDetails, true, entityItem, entityType)\n })\n .catch(function(err){\n Logger.error('Error Deleting ' + entityType)\n Logger.log(\"failed to delete - \", err); \n })\n }", "function deletePresentation (e) {\n\tlet id = e.target.parentNode.id;\n\tlet data = JSON.stringify({\n\t\tpresentation_id: id,\n\t\tuser_id: userid\n\t});\n\n\t// sending delete request to server\n\tfetch(PRESENTATIONS_URL + `/${id}`, {\n\t\tmethod: 'DELETE',\n\t\tbody: data,\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json; charset=utf-8\",\n\t \"Authorization\": token\n\t\t}\n\t}).then(response => {\n\t\tif (response.status < 400) { // presentation is removed\n\t\t\tpresentations.removeChild(document.getElementById(id));\n\t\t\tshowConfirmPopup('Presentation is removed!');\n\t\t} else if (response.status === 403) { \t// user not authorized\n\t\t\tshowErrorPopup('You are not authorized for deleting this presentation.');\n\t\t} else {\n\t\t\tshowErrorPopup('This presentation could not be deleted, please try again later.');\n\t\t}\n\t}).catch(error => console.error(error));\n}", "function deleteModalPropertyImgUsingPath(path){\n//alert(path);\nvar http = new XMLHttpRequest();\nvar url = \"deleteModalPropertyImgUsingPath.php\";\nvar propId = document.getElementById(\"propID\").innerHTML;\nvar params = \"path=\"+path+\"&propId=\"+propId;\n//\"imgId=Henry&lname=Ford\"\nhttp.open(\"POST\", url, true);\n\n//Send the proper header information along with the request\nhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\nhttp.onreadystatechange = function() {//Call a function when the state changes.\n if(http.readyState == 4 && http.status == 200) {\n //alert(http.responseText);\n\t\tvar parentElement = document.getElementById(\"propImg\"+path).parentNode;\n\t\tvar child = document.getElementById(\"propImg\"+path);\n\t\tparentElement.removeChild(child);\n\t\t\n }\n}\nhttp.send(params);\n}", "function delete_file (file_name, reload_flag, media_id)\n{\n var params = {};\n params ['file'] = file_name;\n if (media_id !== undefined)\n params ['media_id'] = media_id; \n $.ajax ({url: '/admin/index/remove',type: 'POST', data: params,\n complete : function (response, status) {if (reload_flag === true) {$.fancybox.close ();reload_list ();}} \n }); \n}", "function initDelete() {\n\t\t\t$list.find('[aria-click=\"delete\"]').on('click', function () {\n\t\t\t\tvar $item = $(this).closest('.item');\n\n\t\t\t\tpopupPrompt({\n\t\t\t\t\ttitle: _t.form.confirm_title,\n\t\t\t\t\tcontent: _t.investor.view.manager.delete_confirm,\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tbuttons: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: _t.form.yes,\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\thandle: function () {\n\t\t\t\t\t\t\t\ttoggleLoadStatus(true);\n\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\turl: '/investors/delete/' + $item.data('value'),\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\tcontentType: 'JSON'\n\t\t\t\t\t\t\t\t}).always(function () {\n\t\t\t\t\t\t\t\t\ttoggleLoadStatus(false);\n\t\t\t\t\t\t\t\t}).done(function (data) {\n\t\t\t\t\t\t\t\t\tif (data.status == 0) {\n\t\t\t\t\t\t\t\t\t\t$item.parent().remove();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tpopupPrompt({\n\t\t\t\t\t\t\t\t\t\t\ttitle: _t.form.error_title,\n\t\t\t\t\t\t\t\t\t\t\tcontent: _t.form.error_content,\n\t\t\t\t\t\t\t\t\t\t\ttype: 'danger'\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}).fail(function () {\n\t\t\t\t\t\t\t\t\tpopupPrompt({\n\t\t\t\t\t\t\t\t\t\ttitle: _t.form.error_title,\n\t\t\t\t\t\t\t\t\t\tcontent: _t.form.error_content,\n\t\t\t\t\t\t\t\t\t\ttype: 'danger'\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\t{\n\t\t\t\t\t\t\ttext: _t.form.no\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t});\n\t\t}", "function updateRemoveAttachemnt(req) {\n return NotesModel.findOneAndUpdate({ _id: req.params.id },\n { $pull: { attachment_ref: req.body.removeAttachment } }).exec();\n}", "function deleteItem(contentFileData, encapsulationData){\n // Determining the itemName and parentItem name, based on the last\n // two values of the encapsulationData data (parameters of the request URL).\n // Parent name may not always have a value, as the item may be at the top\n // level of the content object, so defaulting this to null if no value exits\n var itemName = encapsulationData[encapsulationData.length-1];\n var parentName = encapsulationData[encapsulationData.length-2] || null;\n\n // Creating an removedItemFrom property on the request object, to track if and\n // when an item is deleted within this function (so as to determine if the \n // content file needs to be updated)\n req.removedItemFrom = null;\n\n // Looping through the encapsulationData array (i.e. parameters passed to the\n // request URL) to drill down into the fileData object, to find the property that\n // needs to have an item removed from it. \n for(var i=0; i<encapsulationData.length; i++){\n // Not including the last two indexes of the\n // array, as these will be the parentName and itemName (as referenced above). By\n // the end of this loop, I should have the item from which the item should\n // be removed.\n if(i < encapsulationData.length - 2){\n if(contentFileData[encapsulationData[i]] != null){\n // Setting the contentFileData equal to the next level of the encapsulationData array\n // i.e. to keep drilling down into the contentFileData object\n contentFileData = contentFileData[encapsulationData[i]];\n } else {\n req.feedsErrors.push(\"'\" + encapsulationData.slice(0, encapsulationData.length-1)[0].join(\"/\") + \"' does not exist. Please create the container objects first\");\n return;\n }\n \n }\n }\n\n // Checking whether the fileData object contains the property referred to in the parent\n // name variable i.e. does the request new item have a parent, or is it at the top-most\n // level of the project_structure object\n if(contentFileData[parentName] != null){\n // Determing what type of item we are trying to remove the item from i.e.\n // an Array, Object or other.\n switch(contentFileData[parentName].constructor.name.toLowerCase()){\n case \"array\": {\n // Checking if the array we are trying to remove this item from contains an index\n // with the same value as the itemName\n if(contentFileData[parentName][itemName] != undefined){\n contentFileData[parentName].splice(itemName, 1);\n req.gitCommitMessage = \"Content removed from \" + parentName + \": \" + itemName;\n } else {\n // Since this index does not exist within this array, adding this to the feedsErrors\n // array, and then returning this function so that no further attempt to create this\n // item will be made. Since req.newItem will remain null, this error will be returned\n // to the caller, further down along this route\n req.feedsErrors.push(itemName + \" does not exist within \" + parentName + \" and so cannot be removed\");\n return;\n } \n break; \n }\n case \"object\": {\n // Checking if the object we are trying to remove this item from contains a property\n // with the same value as the itemName\n if(contentFileData[parentName][itemName] != undefined){\n delete contentFileData[parentName][itemName];\n req.gitCommitMessage = \"Content removed from \" + parentName + \": \" + itemName;\n } else {\n // Since this property does not exist within this object, adding this to the feedsErrors\n // array, and then returning this function so that no further attempt to create this\n // item will be made. Since req.newItem will remain null, this error will be returned\n // to the caller, further down along this route\n req.feedsErrors.push(itemName + \" does not exist within \" + parentName + \" and so cannot be removed\");\n return;\n }\n break;\n }\n default: {\n res.send(\"uh oh\");\n }\n }\n\n // If the function has reached this point, then an item must have been deleted (as\n // if this proved not to be possible, then the function would have returned by now).\n // Setting this removedItemFrom property of the request object to be an empty object. Then\n // creating a new property on this object, using the name of the parent (as this \n // will be the item from which the item was removed). Setting the value of this\n // new property to be equal to the parent item we just removed the item from i.e. so\n // that it now contains all of it's existing properties/indexes, minus the item\n // we removed. Doing this in two seperate steps, as the parentName is being generated\n // dynamically, so req.newItem.parentName would not be sufficient.\n req.removedItemFrom = {};\n req.removedItemFrom[parentName] = contentFileData[parentName];\n } else {\n // Since this item does not appear to have a parent, checking whether it exists\n // at the top level of the file data project_structure i.e. is there a property by this \n // name already defined\n if(contentFileData[itemName] != undefined){\n delete contentFileData[itemName];\n req.gitCommitMessage = \"Content removed: \" + itemName;\n } else {\n // Since this property does not exist on the global object, adding this to the feedsErrors\n // array, and then returning this function so that no further attempt to create this\n // item will be made. Since req.newItem will remain null, this error will be returned\n // to the caller, further down along this route\n req.feedsErrors.push(itemName + \" does not exist and so cannot be removed\");\n return;\n }\n\n // If the function has reached this point, then an item must have been deleted (as\n // if this proved not to be possible, then the function would have returned by now).\n // Setting this removedItemFrom property of the request object to be equal to the content\n // file data that we just removed the item from.\n req.removedItemFrom = contentFileData;\n }\n }", "function deleteListItem(e) {\n\t\te.remove();\n\t}", "deleteItem() {\n const index = this.items.findIndex((e) => e.id === this.editItemID);\n this.items.splice(index, 1);\n this.editItemID = null;\n }", "handleItemDelete(event, item) {\n // eslint-disable-next-line no-alert\n if (confirm(i18n._t('AssetGalleryField.CONFIRMDELETE'))) {\n this.props.actions.gallery.deleteItems(this.props.deleteApi, [item.id]);\n }\n }", "function deleteChosenDocument() {\n\tvar aid = getURLParameter(\"AID\");\n\ttogglePopup('document_del', false);\n\tdocument.getElementById(\"dokumentloeschenbutton\").disabled = \"disabled\";\n\tconnect(\"/hiwi/Clerk/js/deleteOfferDocument\", \"uid=\" + selectedDocument\n\t\t\t+ \"&aid=\" + aid, handleDocumentChangeResponse);\n\tselectedDocument = null;\n\ttogglePopup(\"document_delete\", false);\n}", "function deleteUploaded(selectedUpDoc, selectedData) {\n\t\t\tif (utils.isNotEmptyVal(self.display.uploaded.filterText) && allUploadedSelected()) {\n\t\t\t\tselectedUpDoc = selectedData;\n\t\t\t}\n\n\n\t\t\tvar modalOptions = {\n\t\t\t\tcloseButtonText: 'Cancel',\n\t\t\t\tactionButtonText: 'Delete',\n\t\t\t\theaderText: 'Delete ?',\n\t\t\t\tbodyText: 'Are you sure you want to delete ?'\n\t\t\t};\n\n\t\t\t// confirm before delete\n\t\t\tmodalService.showModal({}, modalOptions).then(function () {\n\t\t\t\tvar docdata = {};\n\t\t\t\tif (self.activeTab == 'uploadeddailymail') {\n\n\t\t\t\t\tdocdata['docID'] = _.pluck(selectedUpDoc, 'id');\n\n\t\t\t\t\tvar promesa = dailyMailScanDataService.deleteUploadedDocument(docdata);\n\t\t\t\t\tpromesa.then(function (data) {\n\t\t\t\t\t\tnotificationService.success('Documents deleted successfully');\n\t\t\t\t\t\tangular.forEach(docdata['docID'], function (datavalue, datakey) {\n\t\t\t\t\t\t\tvar index = _.findIndex(self.uploadedList.data, { id: datavalue });\n\t\t\t\t\t\t\tself.uploadedList.data.splice(index, 1);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.uploadedGridOptions.selectAll = false;\n\t\t\t\t\t\tself.uploadedGridOptions.uploadedSelectedItems = [];\n\t\t\t\t\t}, function (error) {\n\t\t\t\t\t\tnotificationService.error('Unable to delete documents');\n\t\t\t\t\t});\n\n\t\t\t\t} else if (self.activeTab == 'unindexeddailymail') {\n\n\t\t\t\t\tdocdata['docID'] = _.pluck(self.unindexedGridOptions.unindexedSelectedItems, 'id');\n\n\t\t\t\t\tvar promesa = dailyMailScanDataService.deleteUnindexedDocument(docdata);\n\t\t\t\t\tpromesa.then(function (data) {\n\t\t\t\t\t\tnotificationService.success('Documents deleted successfully');\n\t\t\t\t\t\tangular.forEach(docdata['docID'], function (datavalue, datakey) {\n\t\t\t\t\t\t\tvar index = _.findIndex(self.unindexedList.data, { id: datavalue });\n\t\t\t\t\t\t\tself.unindexedList.data.splice(index, 1);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.unindexedGridOptions.selectAll = false;\n\t\t\t\t\t\tself.unindexedGridOptions.unindexedSelectedItems = [];\n\n\t\t\t\t\t}, function (error) {\n\t\t\t\t\t\tnotificationService.error('Unable to delete documents');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function deletePicklist(picklist_index) {\n // deletes picklist from object\n delete picklists[picklist_index];\n // deletes the div, modals, and <br>\n $(\".from-picklist-\" + picklist_index).remove();\n // closes the modal\n $(\".modal\").css(\"display\", \"none\");\n}", "function handleDelete(item){\n //console.log(item);\n const extra = [...deletedAdvertisements, item];\n setdeletedAdvertisements(extra);\n const temp = {...advertisements};\n delete temp[item];\n setAdvertisements(temp);\n // firebase.firestore()\n // .collection(KEYS.DATABASE.COLLECTIONS.ADVERTISEMENT)\n // .doc(\"list\")\n // .set(advertisements)\n }", "async function deleteProduct() {\r\n if (confirm(\"are you sure you want to delete \" + this.name + \" from products?\")) { \r\n let data = new FormData()\r\n data.append(\"action\", \"removeProduct\")\r\n data.append(\"product\", JSON.stringify(this))\r\n \r\n const response = await makeReq(\"./api/recievers/productReciever.php\", \"POST\", data)\r\n adminUpdateProductPanel()\r\n } \r\n \r\n}", "function deleteItem(oldData, e) {\n firestore\n .collection(\"Users\")\n .doc(user.uid)\n .collection(\"Items\")\n .doc(oldData.id)\n .delete()\n .then(function () {\n console.log(\"Document Deleted\");\n })\n .catch(function (error) {\n console.error(\"Error removing document: \", error);\n });\n }", "function deleteFileAttachment(req, res) {\n var toDelete;\n if (req.body.isTemp) {\n toDelete = {temp_deleted: true};\n }\n else {\n toDelete = {deleted: true};\n }\n\n attachmentFile.findOneAndUpdate({_id: req.body.attachmentId}, toDelete).exec(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, message: Constant.FILE_DELETE, data: data});\n }\n });\n}", "function deleteElement() {\n myPresentation.getCurrentSlide().deleteElement()\n}", "function deleteModalPropertyImg(imgId) {\nvar http = new XMLHttpRequest();\nvar url = \"deleteModalPropertyImg.php\";\nvar params = \"imgId=\"+imgId;\n//\"imgId=Henry&lname=Ford\"\nhttp.open(\"POST\", url, true);\n\n//Send the proper header information along with the request\nhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\nhttp.onreadystatechange = function() {//Call a function when the state changes.\n if(http.readyState == 4 && http.status == 200) {\n //alert(http.responseText);\n\t\tvar parentElement = document.getElementById(\"propImg\"+imgId).parentNode;\n\t\tvar child = document.getElementById(\"propImg\"+imgId);\n\t\tparentElement.removeChild(child);\n }\n}\nhttp.send(params);\n}", "function deleteMultipleChoiceField(el, data_id) {\n updateQuestions();\n\n var questionEl = findAncestor(el, 'question-outer-container');\n var question_data_id = questionEl.getAttribute('data-id');\n\n var question = getQuestionById(parseInt(question_data_id));\n question.options.splice(parseInt(data_id), 1);\n displayQuestions();\n}", "deleteListItem(listItemIndex) {\n return this.listItems[listItemIndex].$(\"=Delete\").click();\n }", "remove(data) {\n return new Promise((resolve, reject) => {\n joi.validate(data, lib.Schemas.product.image, (err, value) => {\n if (err) {\n return reject(new Errors.ValidationError(err))\n }\n return resolve(value)\n })\n })\n }", "function deletionRequestSucceeded() {\n location.reload(true);\n alert('Product(-s) deleted successfully');\n}", "function del_choice(cid) {\n var b = document.getElementById('formChoices' + cid).remove();\n}", "function Delete() {\n var currentHttpParameterMap = request.httpParameterMap;\n\n\n var GetProductListResult = new Pipelet('GetProductList', {\n Create: false\n }).execute({\n ProductListID: currentHttpParameterMap.ProductListID.value\n });\n if (GetProductListResult.result === PIPELET_NEXT) {\n var ProductList = GetProductListResult.ProductList;\n\n if (customer.ID === ProductList.owner.ID) {\n new Pipelet('RemoveProductList').execute({\n ProductList: ProductList\n });\n }\n }\n\n\n start();\n}", "function deleteItem() {\n deleteImage(localStorage.getItem(currentImageId), currentImageId)\n}", "function deleteListItem(){\n \t\t$(this).parent().remove();\n \t}", "function deleteAltImgById(e, id) {\n $(e.currentTarget).parent('.pip').remove();\n $.ajax({\n method: 'POST',\n url: window.delete_alt_img_by_id,\n data: {\n _token: $('meta[name=\"csrf-token\"]').attr('content'),\n id: id,\n },\n success: function (result) {\n One.helpers('notify', {type: 'success', icon: 'fa fa-check mr-1', message: result})\n },\n });\n}", "function deleteTechspecEvent()\r\n{\r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n\tvar objAjax = htmlAreaObj.getHTMLAjax();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\t \r\n\tif(!isValidRecord(true))\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tif(objAjax && objHTMLData)\r\n { \t\r\n \tif(objHTMLData!=null && objHTMLData.hasUserModifiedData() && objHTMLData.isDataModified())\r\n {\r\n var htmlErrors = objAjax.error();\r\n htmlErrors.addError(\"confirmInfo\", szMsg_Changes, false);\r\n messagingDiv(htmlErrors, \"saveWorkArea()\", \"continueDeletion()\");\r\n }\r\n else\r\n {\r\n continueDeletion();\r\n }\r\n }\t\r\n}", "function deleteItem(i) {\n var xhr = new XMLHttpRequest();\n var itemId = itemDatas[i][5]\n var url = 'http://fa19server.appspot.com/api/wishlists/' + itemId+ '/' + '?access_token=' + sessionId\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n refreshItemsPara();\n }\n }\n xhr.open(\"DELETE\", url, true);\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.send(null)\n\n document.getElementById(\"deleteBox\").style.display = \"none\";\n document.getElementById(\"editBox\").style.display = \"none\";\n document.getElementById(\"editBox\").style.zIndex = '1001';\n document.getElementById(\"over\").style.display = \"none\";\n\n}", "'click .js-video-delete-button'( e, t ){\n e.preventDefault();\n let cur = $( '#cb-current' ).val()\n , page_no = t.page.get()\n , idx = P.indexOf( cur );\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\nconsole.log( pp.find({}).fetch() );\n P.print();\n $('#fb-template').css( 'border', '' );\n $( '#fb-template iframe' ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-video-toolbar' ).hide();\n//---------------------------------------------------------\n }", "_close() {\n this.attachmentViewer.close();\n }", "function deleteProduct() {\n // deletes product\n var productID = $(\"#edit-product-select\").val();\n if(productID != \"\") {\n\n util.makeRequest(\n \"action=deleteProduct&selectedProductID=\" + productID,\n function(data){\n console.log(data);\n\n //update view\n util.getProducts();\n $('#confirmation-modal').modal('hide');\n $('#login-modal').modal('hide');\n }\n ); // end makeRequest\n\n }\n }", "function continueDeletion()\r\n{\r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n\tvar objAjax = htmlAreaObj.getHTMLAjax();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\t\r\n\tif(objAjax && objHTMLData)\r\n\t{\r\n\t \r\n\t var htmlErrors = objAjax.error();\t \r\n\t //delete Event detail\r\n\t if(objHTMLData!=null && objHTMLData._mHasUserModifiedData == true)\t \r\n\t\t{\r\n\t\t\thtmlErrors.addError(\"confirmInfo\", szMsg_EventDetails_Delete_Confirm, false);\r\n \t\t\tmessagingDiv(htmlErrors, 'dltTechspecEventDetail()', 'cancelProcess()');\r\n\t\t}\t\t\r\n\t\telse //delete Header\r\n\t\t{\t\t\t\t\r\n\t\t htmlErrors.addError(\"confirmInfo\", szMsg_Events_Delete_Confirm, false);\r\n \t\t\tmessagingDiv(htmlErrors, 'dltTechspecEvent()', 'cancelProcess()');\t\t \r\n \t\t}\r\n \t}\r\n}", "deleteItem() {\n this.view.removeFromParentWithTransition(\"remove\", 400);\n if (this.item != null) {\n this.itemDao.deleteById(this.item.getId());\n }\n }", "function handleOccurrenceDeletion(){\n let api = collector.getModule('ModalDialogAPI');\n let md = new api.modalDialog(\n function(dialog){\n acceptSendingNotificationMail();\n dialog.waitThenClick(new elementslib.ID(dialog.window.document, \"accept-occurrence-button\"));\n }\n );\n md.start();\n}", "function doDeleteItemLine(element){\n\t //start\n\t\t//avd_${model.avd}@opd_${model.opd}@date_${record.date}@time_${record.time}\n\t\tvar record = element.id.split('@');\n\t\tvar avd = record[0].replace(\"avd_\",\"\");\n\t\tvar opd = record[1].replace(\"opd_\",\"\");\n\t\tvar date = record[2].replace(\"date_\",\"\");\n\t\tvar time = record[3].replace(\"time_\",\"\");\n\t\t\n\t //Start dialog\n\t jq('<div></div>').dialog({\n modal: true,\n title: \"Dialog - Slett date: \" + date + \" \" + time,\n buttons: {\n\t Fortsett: function() {\n \t\tjq( this ).dialog( \"close\" );\n\t //do delete\n\t jq.blockUI({ message: BLOCKUI_OVERLAY_MESSAGE_DEFAULT});\n\t window.location = \"tror_mainorderfly_ttrace_general_edit.do?action=doDelete\" + \"&ttavd=\" + avd + \"&ttopd=\" + opd + \"&ttdate=\" + date + \"&tttime=\" + time;\n\t },\n\t Avbryt: function() {\n\t jq( this ).dialog( \"close\" );\n\t }\n },\n open: function() {\n\t \t\t var markup = \"Er du sikker på at du vil slette denne?\";\n\t jq(this).html(markup);\n\t //make Cancel the default button\n\t jq(this).siblings('.ui-dialog-buttonpane').find('button:eq(1)').focus();\n\t }\n\t }); //end dialog\n\t}", "deleteItem() {\n if (window.confirm('Etes-vous sur de vouloir effacer cet outil ?')) {\n sendEzApiRequest(this.DELETE_ITEM_URI + this.props.id, \"DELETE\")\n .then((response) => {\n this.props.deleteButtonCB(this.props.tool)\n }, error => {\n alert(\"Impossible de suprimer l'outil\")\n\n console.log(error)\n })\n }\n }", "fileDeleted(){\n let form = this\n let file = ''\n $('#fileupload').bind('fileuploaddestroy', function (e, data) {\n // remove inputs named 'selected_files[]' that will interfere with the back end\n $(\"input[name='selected_files[]']\").remove();\n $(\"input[name='sf_ids']\").each(function(){\n $('div.fields-div').find(`input[name^='${$(this).val()}']`).remove();\n });\n //then remove yourself?\n // $(\"input[name='sf_ids']\").remove();\n });\n $('#fileupload').bind('fileuploaddestroyed', function (e, data) {\n // if student deletes uploaded primary file, we need to remove this param because the backend uses it to know when a browse-everything file is primary\n $('#be_primary_pcdm').remove();\n form.validatePDF()\n });\n\n $('#supplemental_fileupload').bind('fileuploaddestroy', function (e, data) {\n file = $(data.context).find('p.name span').text();\n });\n\n $('#supplemental_fileupload').bind('fileuploaddestroyed', function (e, data) {\n $('#supplemental_files_metadata tr').each(function(){\n if ($(this).find('td').first().text() === file) {\n $(this).remove();\n }\n });\n form.validateSupplementalFiles()\n })\n }", "_deleteItemConfirm(e) {\n // @todo delete the thing\n const evt = new CustomEvent(\"simple-modal-hide\", {\n bubbles: true,\n cancelable: true,\n detail: {}\n });\n this.dispatchEvent(evt);\n }", "async function deleteDetail(item) {\r\n try {\r\n const detail = details;\r\n detail.splice(detail.indexOf(item), 1);\r\n\r\n let newDetails = {};\r\n\r\n const { _id, titulo, descricao, projeto_id } = step;\r\n\r\n if (details.length === 0) {\r\n newDetails = {\r\n _id,\r\n titulo,\r\n descricao,\r\n projeto_id\r\n };\r\n } else {\r\n newDetails = {\r\n _id,\r\n titulo,\r\n descricao,\r\n projeto_id,\r\n detalhes: detail\r\n };\r\n }\r\n\r\n setShow(true);\r\n\r\n await api.put(`/etapas/${step._id}`, newDetails, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n // const data = response.data;\r\n const res = await api.get(`/etapas/${projeto_id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n const { data } = res;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err', err);\r\n setErr(true);\r\n }\r\n }", "function deleteUpload(recordid){\n $('#succMsgContainer').hide();\n $('#id').val(recordid);\n $('#aws-delete-file-modal').modal('show');\n}", "function deleteModalCollectionRow(id) {\n $(`#${id}`).remove(); // Remove from view\n if (id.indexOf(\"new-external-\") >= 0) {\n delete externalsDictionary[id]; // If it's a new external, remove it\n } else {\n // Otherwise, remove everything else besides the external id\n delete externalsDictionary[id].url;\n delete externalsDictionary[id].penId;\n delete externalsDictionary[id].externalType;\n }\n}", "deleteFlick(item, flick, ev){\n //remove fom DOM\n item.remove();\n\n //remove form array\n const i = this.flicks.indexOf(flick);\n this.flicks.splice(i,1);\n }", "function actionDelete(p){\n\tsrc = collection[p].name;\n\t\n\tif($('#'+src).hasClass('isLocked')){\n\t\talert(\"Ce dossier est protégé contre la suppression\");\n\t\treturn false;\n\t}\n\n\tmessage = $('#'+src).hasClass('isDir')\n\t\t? \"Voulez vous supprimer ce dosssier et TOUT son contenu ?\"\n\t\t: \"Voulez vous supprimer ce fichier ?\";\n\n\tif(!confirm(message)){\n\t\t//log_(\"REMOVE CANCELED BY USER\");\n\t\treturn false;\n\t}\n\t\n\tvar get = $.ajax({\n\t\turl: 'helper/action',\n\t\tdataType: 'json',\n\t\tdata: {'action':'remove', 'src':collection[p].url}\n\t});\n\t\n\tget.done(function(r) {\n//\t\tif(r.callBack != null) eval(r.callBack);\n\t\tif(r.success == 'true'){\n\t\t\t$('div[id=\"'+src+'\"]').fadeTo(218,0, function() {\n\t\t\t\t$(this).remove();\n\t\t\t});\n\t\t\tmakeDragAndDrop();\n\t\t}\n\t});\n}", "function deleteItem(itemId) {\n $.ajax({\n url: '/products/delete/' + itemId,\n type: 'DELETE',\n\n }).then(data => {\n console.log(data);\n window.location.reload();\n })\n }", "function editItem(e) {\n const element = e.currentTarget.parentElement.parentElement; // Mismo Target que DELETE\n editElement = e.currentTarget.parentElement.previousElementSibling;\n grocery.value = editElement.innerHTML;\n editFlag = true;\n editID = element.dataset.id;\n submitBtn.textContent = 'Edit';\n}", "function removeLaboratoriesItem(laboratoryItem) {\n laboratoryItem.find(\"a.laboratories-remove-item\").click(function (e) {\n e.preventDefault();\n var item = this;\n var title = $(this).data('confirm-title');\n var text = $(this).data('confirm-text');\n var line = $(item).closest('tr.laboratories-item');\n $(line).remove();\n\n });\n}", "function deletePhoto(){\n let photoElems = document.querySelectorAll(\".photogrid-photo\")\n photoElems[photoElems.length-1].remove()\n}", "function deleteItem() {\n\t\t\tvar item = itensGrid.selection.getSelected()[0];\n\t\t\t\n\t\t\tif (item) {\n\t\t\t\titensStore.deleteItem(item);\n\t\t\t} else {\n\t\t\t\tokDialog.set(\"title\", \"Atenção\");\n\t\t\t\tokDialogMsg.innerHTML = \"Selecione o item antes de excluir.\";\n\t\t\t\tokDialog.show();\n\t\t\t}\n\t\t}", "delete(item) {\n this.sendAction('delete', item);\n }", "function deleteItem() {\n inventory[clickedEventId] = {};\n player[clickedEventId] = {};\n document.getElementById(clickedEventId).style.backgroundImage = \"none\";\n updateUI();\n updateInventory();\n updateEquipment();\n}", "function DeleleClientDocument(obj) {\n var ans = confirm(\"Are you sure you want to delete this Record?\");\n if (ans) {\n var ID = $(obj).attr(\"data-DocId\")\n \n $.ajax({\n url: \"/Coordinator/DealTrackerV2/DeleteClientDealDocument?DealTrackDocID=\" + ID,\n type: \"POST\",\n contentType: \"application/json;charset=UTF-8\",\n dataType: \"json\",\n success: function (result) {\n\n loadData();\n },\n error: function (errormessage) {\n alert('Sorry, Something went wrong. Please try again.');\n }\n });\n }\n}", "function deleteImage(url, id) {\n if (window.confirm(Dictionary.areYouSure)) {\n (document.getElementById(\"renderPreview\" + id)).remove();\n storage.refFromURL(url).delete().then(function () { }).catch(function (error) { console.log(error); alert(\"delete faild\"); });\n }\n}", "function delete_person(data) {\n\t\t$('#' + data['old_id']).remove();\n\t}", "function openDeleteModal() {\n ModalDeleteService.deleteItem(vm.activeDepartment, vm.deleteDepartment);\n }", "deleteThisInvoice() { if(confirm('Sure?')) Invoices.remove(this.props.invoice._id); }", "function deleteFile() {\n\n if (window.confirm(\"Delete this item from wardrobe?\") == true) {\n console.log('delete files');\n let updates = {};\n clothesList_TOP.forEach((element) => {\n if (element.selected) {\n updates['/Posts/' + googleUser.uid + '/' + element.type + '/' + element.id] = null;\n }\n });\n clothesList_OUTERWEAR.forEach((element) => {\n if (element.selected) {\n updates['/Posts/' + googleUser.uid + '/' + element.type + '/' + element.id] = null;\n }\n });\n clothesList_BOTTOM.forEach((element) => {\n if (element.selected) {\n updates['/Posts/' + googleUser.uid + '/' + element.type + '/' + element.id] = null;\n }\n });\n clothesList_Other.forEach((element) => {\n if (element.selected) {\n updates['/Posts/' + googleUser.uid + '/' + element.type + '/' + element.id] = null;\n }\n });\n database.ref().update(updates);\n } else {\n }\n}", "DeleteGuidedTour(e, guidedTourId) {\r\n db.collection(\"GuidedTours\").doc(guidedTourId).delete()\r\n .then(() => {\r\n this.setState({\r\n deleteModal: false\r\n });\r\n this.display();\r\n });\r\n }", "function deleteCoverPhoto(element)\n{\n\t$('div#cover_photo').append('<img class=\"cover_photo_loading\" style=\"position: absolute;top:100px; left:400px; z-index:4;\" src=\"'+IMAGE_PATH+'/loading_medium_purple.gif\"/>');\n\t$('ul.cover_photo_menu').hide();\n\t\n\tvar cover_img_name = $('div#cover_photo').children('img').attr('rel1');\n\t$(element).attr('rel','');\n\tjQuery.ajax\n\t({\n url: \"/\" + PROJECT_NAME + \"profile/delete-cover-photo\",\n type: \"POST\",\n dataType: \"json\",\n data : { 'cover_img_name':cover_img_name },\n success: function(jsonData) \n {\n \t$('img.cover_photo_loading').hide();\n \t\t$('div#cover_photo img.cvr_img#cvr_photo_img').attr('src',IMAGE_PATH+'/cover-female-default.png');\t\n \t\t$('div#cover_photo img.cvr_img#cvr_photo_img').attr('rel1','');\t\n \t\t$('div#cover_photo img.cvr_img').removeClass('my_cover_photo');\t\t\n \t\t$('div#cover_photo img.cvr_img').addClass('my_default_cover_photo');\n \t\t//Dragging disabled.\n \t\t$('div#cover_photo img#cvr_photo_img').draggable( 'disable' );\n \t\t\n \t\t//default cover photo css.\n \t\t$('div#cover_photo img.cvr_img').css('top','0');\t\n \t\t$('div#cover_photo img.cvr_img').css('left','0');\t\n \t\t$('div#cover_photo img.cvr_img').css('opacity','1');\t\n \t\t$('div#cover_photo img.cvr_img').css('min-height','202px');\t\n }\n \n\t});\n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "function deleteEvent(row) {\n var obj = timeline_data[row];\n if (obj.id != 'new') {\n obj['action'] = 'delete';\n timeline_data_changed.push(obj);\n }\n var data={'action':'delete','id':obj.id};\n preAjax();\n $.ajax({\n type:\"POST\",\n url:\"/timeline/save\",\n data:JSON.stringify(data),\n success: function() {\n timeline.deleteItem(row);\n var info = document.getElementById('info');\n info.innerHTML =\n \"<span>Detail : </span> <span onclick='openTimelineDialog()' style='color:green' class='glyphicon glyphicon-plus'></span>\";\n }\n });\n}", "function deleteItem() {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var text = this.responseText;\n $(\"#confirmDel\").text(text);\n }\n }\n\n xmlhttp.open(\"POST\", \"../stock/AdminDeleteFromStock.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(collectData());\n }", "async function deleteOpportunity (req, res) {\n await service.deleteOpportunity(req.authUser, req.params.opportunityId)\n res.status(204).end()\n}", "function confirmDeleteEmail() {\n Merchant.delete('delete_admin_email',delete_admin_email.id).then(function(response) {\n vm.admin_emails.splice(delete_admin_email_indx, 1);\n $(\"#delete-adm-email-modal\").modal('toggle');\n });\n }", "function deleteImage(){\n var id = $('#gallery_delete_id').val();\n $.ajax({\n url:\"scripts/delete_gallery.php\",\n method:\"POST\", \n data : {\"id\": id},\n dataType: 'json',\n success:function(data)\n {\n $('#modal_gallery_delete_confirm').modal('hide');\n toastr[data['status']](data['message']);\n setTimeout( function () {\n window.location.reload();\n }, 3000 );\n }\n });\n }" ]
[ "0.6036632", "0.5950442", "0.59453875", "0.58625627", "0.5824961", "0.5787567", "0.5787567", "0.57353246", "0.56986034", "0.56957966", "0.56613743", "0.5640394", "0.56151897", "0.55989826", "0.5576555", "0.55622935", "0.55592227", "0.55398905", "0.5533175", "0.5530458", "0.5515253", "0.55151385", "0.5513802", "0.5512624", "0.54915524", "0.5490422", "0.5482123", "0.5460572", "0.5440854", "0.5440429", "0.5425449", "0.5407694", "0.54075646", "0.5355391", "0.5353251", "0.53107005", "0.53014517", "0.52989024", "0.529455", "0.5291525", "0.5288187", "0.5281599", "0.5280053", "0.5271156", "0.52703243", "0.5265099", "0.5255322", "0.5244382", "0.52383524", "0.5231175", "0.52032465", "0.5192168", "0.51859486", "0.51857364", "0.5185713", "0.5168358", "0.51672065", "0.5162562", "0.5160461", "0.51538205", "0.5152572", "0.5150936", "0.51495653", "0.5136632", "0.51347613", "0.5134686", "0.5133766", "0.513099", "0.5125157", "0.51190776", "0.51188034", "0.51145065", "0.5114005", "0.5113162", "0.5111956", "0.5111221", "0.51092476", "0.5108465", "0.5104983", "0.5103954", "0.5100899", "0.50972545", "0.50962526", "0.50954413", "0.5092845", "0.5087137", "0.5082288", "0.50814545", "0.5081449", "0.50724095", "0.507208", "0.5070303", "0.5049234", "0.50487244", "0.50487244", "0.504866", "0.50470114", "0.5046049", "0.5043364", "0.50366664" ]
0.6974799
0
This function runs when a file is successfully loaded and read by the PO file input. It references SP.RequestExecutor.js which will upload the file as an attachment by using the REST API. NOTE: This is safer and more capabale (in terms of file size) than using JSOM file creation for uploading files as attachments.
function oppFileOnload(event) { contents = event.target.result; // The storePOAsAttachment function is called to do the actual work after we have a reference to SP.RequestExecutor.js $.getScript(web.get_url() + "/_layouts/15/SP.RequestExecutor.js", storeOppAsAttachment); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadAttachment()\n {\n if (Office.context.mailbox.item.attachments == undefined)\n {\n app.showNotification(\"Sorry attachments are not supported by your Exchange server.\");\n }\n else if (Office.context.mailbox.item.attachments.length == 0)\n {\n app.showNotification(\"Oops there are no attachments on this email.\");\n }\n else\n {\n var apicall = \"https://api.workflowmax.com/job.api/document?apiKey=\"+ apiKey + \"&accountKey=\" + accountKey;\n\n var documentXML = \"<Document><Job>\" + cJobID + \"</Job><Title>Document Title</Title><Text>Note for document</Text><FileName>test.txt</FileName><Content>\" + string64 + \"</Content></Document>\";\n\n var xhr = new XMLHttpRequest();\n\n xhr.open('POST', apicall);\n\n xhr.send(documentXML);\n }\n }", "function uploadFile() {\n\n // Define the folder path for this example.\n //var serverRelativeUrlToFolder = '/sites/flows/shared documents';\n //var serverRelativeUrlToFolder = '/sites/engineering/Spec and Revision Library/';\n //var dashboardPageUrl = 'https://bjsmarts001.sharepoint.com/sites/engineering/SitePages/Dashboard.aspx';\n\n var serverRelativeUrlToFolder = '/sites/wyman/eswa/data/Spec and Revision Library/';\n var dashboardPageUrl = '/sites/wyman/eswa/';\n\n\n // Get test values from the file input and text input page controls.\n var fileInput = jQuery('#getFile');\n newName = jQuery('#displayName').val();\n\n // Get the server URL.\n var serverUrl = _spPageContextInfo.webAbsoluteUrl;\n\n // Initiate method calls using jQuery promises.\n // Get the local file as an array buffer.\n var getFile = getFileBuffer();\n getFile.done(function (arrayBuffer) {\n\n // Add the file to the SharePoint folder.\n var addFile = addFileToFolder(arrayBuffer);\n addFile.done(function (file, status, xhr) {\n\n // Get the list item that corresponds to the uploaded file. \n _fileListItemUri = file.d.ListItemAllFields.__deferred.uri; \n var getItem = getListItem(_fileListItemUri);\n getItem.done(function (listItem, status, xhr) {\n \n // Change the display name and title of the list item.\n var changeItem = updateListItem(listItem.d.__metadata);\n changeItem.done(function (data, status, xhr) {\n alert('Your spec has been submitted to internal/external reviewers'); \n window.location = dashboardPageUrl;\n });\n changeItem.fail(onChangeItemError); \n });\n getItem.fail(onError); \n });\n addFile.fail(onError); \n });\n getFile.fail(onError);\n \n\n // Get the local file as an array buffer.\n function getFileBuffer() {\n var deferred = jQuery.Deferred();\n var reader = new FileReader();\n reader.onloadend = function (e) {\n deferred.resolve(e.target.result);\n }\n reader.onerror = function (e) {\n deferred.reject(e.target.error);\n }\n reader.readAsArrayBuffer(fileInput[0].files[0]);\n return deferred.promise();\n }\n\n // Add the file to the file collection in the Shared Documents folder.\n function addFileToFolder(arrayBuffer) {\n\n // Get the file name from the file input control on the page.\n var parts = fileInput[0].value.split('\\\\');\n var fileName = parts[parts.length - 1];\n\n // Construct the endpoint.\n var fileCollectionEndpoint = String.format(\n \"{0}/data/_api/web/getfolderbyserverrelativeurl('{1}')/files\" +\n \"/add(overwrite=true, url='{2}')\",\n serverUrl, serverRelativeUrlToFolder, fileName);\n\n // Send the request and return the response.\n // This call returns the SharePoint file.\n return jQuery.ajax({\n url: fileCollectionEndpoint,\n type: \"POST\", \n data: arrayBuffer,\n processData: false,\n beforeSend : function() {\n $.blockUI({ \n message: '<h4>Uploading Document ...</h4>',\n css: { \n border: 'none', \n padding: '15px', \n backgroundColor: '#000', \n '-webkit-border-radius': '10px', \n '-moz-border-radius': '10px', \n opacity: .5, \n color: '#fff' \n } }); \n }, \n complete: function () {\n $.unblockUI(); \n },\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-length\": arrayBuffer.byteLength\n }\n });\n }\n\n // Get the list item that corresponds to the file by calling the file's ListItemAllFields property.\n function getListItem(fileListItemUri) {\n\n // Send the request and return the response.\n return jQuery.ajax({\n url: fileListItemUri,\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" }\n });\n }\n\n // Change the display name and title of the list item.\n function updateListItem(itemMetadata) {\n\n // Define the list item changes. Use the FileLeafRef property to change the display name. \n // For simplicity, also use the name as the title. \n // The example gets the list item type from the item's metadata, but you can also get it from the\n // ListItemEntityTypeFullName property of the list.\n\n //var user = \"8\";\n //var users = \"{ 'results': ['8', '13'] }\";\n var users = getApprovals();\n \n //var extUsers = \"[email protected]\";\n var extUsers = getExternalApprovals();\n\n var body = String.format(\"{{'__metadata':{{'type':'{0}'}},'FileLeafRef':'{1}','Title':'{2}','ApproversId':{3},'Specification':'{4}','Issue':'{5}','ExtApprovers':'{6}'}}\",\n itemMetadata.type, SpecName, SpecName, users, newName, issueName, extUsers );\n \n // var body = String.format(\"{{'__metadata':{{'type':'{0}'}},'FileLeafRef':'{1}','Title':'{2}','ApproversId':{3},'Specification':'{4}','Issue':'{5}'}}\",\n // itemMetadata.type, SpecName, SpecName, users, newName, issueName );\n\n //var body = String.format(\"{{'__metadata':{{'type':'{0}'}},'Title':'{1}','ApproversId':{2}}}\",\n //itemMetadata.type, newName, users );\n \n // Send the request and return the promise.\n // This call does not return response content from the server.\n return jQuery.ajax({\n url: itemMetadata.uri,\n type: \"POST\",\n data: body,\n beforeSend : function() {\n $.blockUI({ \n message: '<h4>Updating Document Properties ...</h4>',\n css: { \n border: 'none', \n padding: '15px', \n backgroundColor: '#000', \n '-webkit-border-radius': '10px', \n '-moz-border-radius': '10px', \n opacity: .5, \n color: '#fff' \n } }); \n }, \n complete: function () {\n $.unblockUI(); \n }, \n headers: {\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-type\": \"application/json;odata=verbose\",\n \"content-length\": body.length,\n \"IF-MATCH\": itemMetadata.etag,\n //\"IF-MATCH\": \"*\",\n \"X-HTTP-Method\": \"MERGE\"\n }\n });\n }\n}", "function fileSuccess(file, message) {\n // Iterate through the file list, find the one we\n // are added as a temp and replace its data\n // Normally you would parse the message and extract\n // the uploaded file data from it\n angular.forEach(vm.files, function (item, index)\n {\n if ( item.id && item.id === file.uniqueIdentifier )\n {\n // Normally you would update the file from\n // database but we are cheating here!\n\n // Update the file info\n item.name = file.file.name;\n item.type = 'document';\n\n // Figure out & upddate the size\n if ( file.file.size < 1024 )\n {\n item.size = parseFloat(file.file.size).toFixed(2) + ' B';\n }\n else if ( file.file.size >= 1024 && file.file.size < 1048576 )\n {\n item.size = parseFloat(file.file.size / 1024).toFixed(2) + ' Kb';\n }\n else if ( file.file.size >= 1048576 && file.file.size < 1073741824 )\n {\n item.size = parseFloat(file.file.size / (1024 * 1024)).toFixed(2) + ' Mb';\n }\n else\n {\n item.size = parseFloat(file.file.size / (1024 * 1024 * 1024)).toFixed(2) + ' Gb';\n }\n }\n });\n }", "function processFile(event, file) {\n // Composing the form data with uploaded file to send to the server\n var formData = new FormData();\n formData.append('file', file);\n formData.append('skipHeader', $scope.checkbox.skipHeader);\n formData.append('xlsSheet', file.sheet);\n formData.append('scenarioId', appInfo.pid);\n formData.append('dataTableName', $scope.widgetInfo.table.tablename);\n formData.append('tableType', appInfo.type);\n formData.append('appendData', $scope.checkbox.appendData);\n\n // Showing modal window for single file upload\n $mdDialog.show({\n template: $templateCache.get('app/single-download-upload.ejs'),\n targetEvent: event,\n controller: singleLoadController,\n locals: {\n scenarioID: appInfo.pid,\n table: $scope.widgetInfo.table,\n uploadDetails: {\n formData: formData,\n fileName: file.name\n },\n downloadDetails: null\n }\n }).then(function (result) {\n if (!result) {\n closeWidget();\n return;\n }\n\n $scope.widgetInfo.table.updatedBy = result.updated_by;\n $scope.widgetInfo.table.updatedAt = result.updated_at;\n closeWidget($scope.widgetInfo.table, 'upload');\n refreshWidget({ action: 'upload' });\n triggerUploadAction();\n }).catch(function () {\n closeWidget();\n });\n }", "function onFileReadFromDisk( file64evt ) {\n\n Y.log( 'Read file successfully, POSTing to mediamojit', 'info', NAME );\n\n var\n newId = ('upload' + (new Date().getTime()) + (Math.random() * 999999)).replace( '.', '' ),\n settings = {\n 'ownerCollection': ownerCollection,\n 'ownerId': ownerId,\n // deprecated - TODO: rename\n 'source': file64evt.target.result,\n 'id': newId,\n 'name': file.name,\n 'fileName': file.name,\n 'label': label\n };\n\n if (!patientRegId || '' === patientRegId) {\n // not passing through PUC proxy\n Y.doccirrus.comctl.privatePost('/1/media/:upload64', settings, onFilePost);\n } else {\n // must be routed to originating (V)PRC\n Y.doccirrus.blindproxy.postSingle(patientRegId, '/1/media/:upload64', settings, onFilePost);\n }\n }", "function handleFileAttach(issueKey, jiraProxyRootUrl) {\n var form = document.forms.namedItem(\"feedbackfrm\");\n var oData = new FormData(form);\n\n var url = jiraProxyRootUrl + \"jiraproxyattchmnt\";\n\n var oReq = new XMLHttpRequest();\n oReq.open(\"POST\", url, true);\n oReq.onload = function (oEvent) {\n if (oReq.status == 200) {\n if (oJIRA_FDBCK.DEBUG) {\n console.log(oJIRA_FDBCK.LOGGINGPREFIX + \"File(s) successfully uploaded.\");\n }\n } else {\n console.error(oJIRA_FDBCK.LOGGINGPREFIX + \"Error: \" + oReq.status + \" occurred when trying to upload file(s).\");\n }\n };\n oData.append(\"issue\", issueKey);\n oReq.send(oData);\n }", "function onSuccessFileOpenForm() {\n // get selected file from the input\n var filesInput = fileOpenFormFileInput.next().find('.textbox-value');\n var selectedFile = filesInput[0].files[0];\n \n // read the file contents\n var reader = new FileReader();\n reader.onload = onLoadFileReader;\n reader.readAsText(selectedFile);\n \n workbench.ui.status.jtg.notifySuccess('File opened!', selectedFile.name);\n }", "function postFileObj(reqPkg) { // console.log('postFileObj called. reqPkg%O', reqPkg);\n asyncErr() || reqPkg.fSysEntry.file(function (fileObj) {\n postMsg('fileObj', pkgFSysResponse(reqPkg, fileObj));\n }); \n }", "function storeOppAsAttachment() {\n var fileContents = fixBuffer(contents);\n var createitem = new SP.RequestExecutor(web.get_url());\n createitem.executeAsync({\n url: web.get_url() + \"/_api/web/lists/GetByTitle('Prospects')/items(\" + currentItem.get_id() + \")/AttachmentFiles/add(FileName='\" + file.name + \"')\",\n method: \"POST\",\n binaryStringRequestBody: true,\n body: fileContents,\n success: storeOppSuccess,\n error: storeOppFailure,\n state: \"Update\"\n });\n function storeOppSuccess(data) {\n\n // Success callback\n var errArea = document.getElementById(\"errAllOpps\");\n\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n // Workaround to clear the value in the file input.\n // What we really want to do is clear the text of the input=file element. \n // However, we are not allowed to do that because it could allow malicious script to interact with the file system. \n // So we’re not allowed to read/write that value in JavaScript (or jQuery)\n // So what we have to do is replace the entire input=file element with a new one (which will have an empty text box). \n // However, if we just replaced it with HTML, then it wouldn’t be wired up with the same events as the original.\n // So we replace it with a clone of the original instead. \n // And that’s what we need to do just to clear the text box but still have it work for uploading a second, third, fourth file.\n $('#oppUpload').replaceWith($('#oppUpload').val('').clone(true));\n var oppUpload = document.getElementById(\"oppUpload\");\n oppUpload.addEventListener(\"change\", oppAttach, false);\n showOppDetails(currentItem.get_id());\n }\n function storeOppFailure(data) {\n\n // Failure callback\n var errArea = document.getElementById(\"errAllOpps\");\n\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"File upload failed.\"));\n errArea.appendChild(divMessage);\n }\n}", "function upload_image()\n{\n\n const file = document.querySelector('input[type=file]').files[0];\n //const reader = new FileReader();\n send_request_and_receive_payload(file)\n\n\n/*\n reader.addEventListener(\"load\", () => {\n\tsend_request_and_receive_payload(reader.result);\n });\n\n if (file) {\n\treader.readAsDataURL(file);\n }\n*/\n\n}", "upload() {\n return this.loader.file\n .then(file => new Promise((resolve, reject) => {\n this._sendRequest(file, resolve, reject);\n }));\n }", "async handleAttachments () {\n\t\t// not yet supported\n\t}", "handleSuccessfulUpload(file) {\n const json = JSON.parse(file.xhr.response);\n\n // SilverStripe send back a success code with an error message sometimes...\n if (typeof json[0].error !== 'undefined') {\n this.handleFailedUpload(file);\n return;\n }\n\n this.props.actions.queuedFiles.removeQueuedFile(file._queuedAtTime);\n this.props.actions.gallery.addFiles(json, this.props.count + 1);\n }", "function upload_file(data){\n\t\tvar file_obj = upload_info[data.file_name].file;\n\t\tconsole.log('UploadFile: ', data.signed_request,' URL: ',data.url,'F_name: ', data.file_name,'OrgFileName: ',file_obj.name);\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"PUT\", data.signed_request);\n\t\txhr.setRequestHeader('x-amz-acl', 'public-read');\n\t\txhr.upload.addEventListener(\"progress\", update_progress);\n\t\txhr.onload = function() {\n\t\t\tupload_success(xhr.status,data.url,file_obj.name,data.file_name);\n\t\t};\n\t\txhr.onerror = function() {\n\t\t\talert(\"Could not upload file.\");\n\t\t};\n\t\txhr.send(file);\n\t}", "function uploadFile(file) {\n renderProgressItems(file, target);\n var url = 'http://localhost:8989/upload';\n var xhr = new XMLHttpRequest();\n var formData = new FormData();\n xhr.open('POST', url, true);\n\n xhr.onprogress = function (event) {\n if (event.lengthComputable) {\n console.log(e.loaded + \" / \" + event.total);\n }\n };\n\n xhr.onloadstart = function (event) {\n console.log(\"start\");\n };\n\n xhr.addEventListener('readystatechange', function (event) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n // Done. Inform the user\n\n } else if (xhr.readyState == 4 && xhr.status != 200) {\n // Error. Inform the user\n }\n });\n\n formData.append('file', file);\n xhr.send(formData);\n }", "_uploadSuccess(event){// parse the raw response cause it won't be natively\n// since event wants to tell you about the file generally\nlet response=JSON.parse(event.detail.xhr.response);this.uploadTitle=response.data.node.title;this.shadowRoot.querySelector(\"#content\").innerHTML=response.data.node.nid;this.shadowRoot.querySelector(\"#dialog\").open()}", "function upload_success(status_code, doc_url,file_org_name,file_name){\n\t\tswitch(status_code){\n\t\t\tcase 200:\n\t\t\t\tvar d = new Date();\n\t\t\t\tend_time = d.getTime();\n\t\t\t\tvar total_time = (end_time - start_time)/1000;\n\t\t\t\tconsole.log('uploaded document url:<-> ', doc_url, 'Total upload time: ',total_time,'F_NAME: ', file_name);\n\t\t\t\tvar info = {\n\t\t\t\t\tvc_id \t\t: f_handle.identity.vc_id,\n\t\t\t\t\tu_name \t\t: f_handle.identity.id,\n\t\t\t\t\tcontent_url \t: doc_url,\n\t\t\t\t\tfile_name \t: file_name,\n\t\t\t\t\tfile_org_name\t: file_org_name\n\t\t\t\t};\n\t\t\t\tf_handle.send_info (null, 'content_conversion',info);\n\t\t\t\tbreak;\n\t\t\tcase 401:\n\t\t\tcase 403:\n\t\t\t\talert('Permission issue ', status_code);\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "function uploadAttachment() {\n $scope.inProgress = true;\n\n var formData = new FormData();\n formData.append('EntityTypeId', $scope.entityTypeId || '');\n formData.append('EntityRecordId', $scope.entityRecordId || '');\n formData.append('AttachmentId', null);\n formData.append('AttachmentTypeId', $scope.selectedAttachmentTypeId || '');\n formData.append('FileDescription', $scope.fileDescription || '');\n formData.append('UserId', $scope.userid || '');\n angular.forEach($scope.files, function(obj) {\n if (!obj.isRemote) {\n fileName = obj.lfFileName;\n formData.append('attachments', obj.lfFile);\n }\n });\n\n var deferred = $q.defer();\n var url = svApiURLs.Attachment;\n var request = {\n 'url': url,\n 'method': 'POST',\n 'data': formData,\n 'headers': {\n 'Content-Type' : undefined // important\n }\n };\n\n $http(request).then(function successCallback(response) {\n $scope.curAttachments = getAttachmentsByEntityTypeId($scope.entityTypeId);\n $scope.fileDescription = '';\n $scope.inProgress = false;\n deferred.resolve(response);\n svToast.showSimpleToast('Attachment \"' + fileName + '\" has been saved successfully.');\n }, function errorCallback(error) {\n $scope.inProgress = false;\n svDialog.showSimpleDialog($filter('json')(error.data), 'Error');\n $mdDialog.hide();\n });\n\n return deferred.promise;\n }", "documentUpload(e) {\n let file = e.target.files[0];\n let fileSize = file.size / 1024 / 1024;\n let fileType = file.type;\n let fileName = file.name;\n let validDocFormat = false;\n let docFormat = fileName.split('.')[1];\n if(docFormat === 'doc'|| docFormat === 'docx' || docFormat === 'xls' || docFormat === 'xlsx'|| docFormat === 'pdf')validDocFormat= true;\n this.setState({ fileType: file.type, fileName: file.name, fileSize: fileSize });\n this.getCentralLibrary();\n if (this.state.totalLibrarySize < 50) {\n let fileExists = this.checkIfFileAlreadyExists(file.name, \"document\");\n let typeShouldBe = _.compact(fileType.split('/'));\n if (file && typeShouldBe && typeShouldBe[0] !== \"image\" && typeShouldBe[0] !== \"video\" && validDocFormat) {\n if (!fileExists) {\n let data = { moduleName: \"PROFILE\", actionName: \"UPDATE\" }\n let response = multipartASyncFormHandler(data, file, 'registration', this.onFileUploadCallBack.bind(this, \"document\"));\n } else {\n toastr.error(\"Document with the same file name already exists in your library\")\n }\n } else {\n toastr.error(\"Please select a Document Format\")\n }\n } else {\n toastr.error(\"Allotted library limit exceeded\");\n }\n }", "function send_file_to_conversion(info){\n\tconversion.start(info)\n\t.then(\n\t\trequest_resolved_handler,\n\t\trequest_failure_handler\n\t);\n}", "function fetchFile(messageType, fileName, fileSize, fileId, loadProgressDiv, elementToInsertFile){\n // Use a promise to allow requests to fetch files to be done one at a time (as the server does not allow the same client to fetch multiple at once)\n fetchFilePromise = fetchFilePromise.then(() => {return new Promise((resolve, reject) => {\n requestedFileDetails = {\"type\": messageType, \"fileName\": fileName, \"fileSize\": fileSize, \"fileId\": fileId,\"loadProgressDiv\": loadProgressDiv, \"elementForFile\": elementToInsertFile, \"promiseRejector\": reject, \"promiseResolver\": resolve};\n // Change the link for fetching the file into a progress message\n loadProgressDiv.onclick = () => {}; // Remove listener to prevent this being called again\n loadProgressDiv.className = \"\";\n loadProgressDiv.innerText = \"Requesting file from server\";\n // Fetch the file from the server via a stream\n socket.emit('request-read-stream', fileId);\n })});\n \n}", "function loadfile() {\n // pop up a file upload dialog\n // when file is received, send to server and populate db with it\n}", "function uploadNext() {\n var xhr = new XMLHttpRequest();\n var fd = new FormData();\n var file = document.getElementById('files').files[filesUploaded];\n fd.append(\"multipartFile\", file);\n xhr.upload.addEventListener(\"progress\", onUploadProgress, false);\n xhr.addEventListener(\"load\", onUploadComplete, false);\n xhr.addEventListener(\"error\", onUploadFailed, false);\n xhr.open(\"POST\", \"save-product\");\n debug('uploading ' + file.name);\n xhr.send(fd);\n }", "async uploadFile(importFilePath) {\n }", "async uploadFile(importFilePath) {\n }", "function onFile() {\n\n var file = document.getElementById('upload').files[0];\t\n\n var formData = new FormData();\n formData.append('fileToUpload', file);\t\t\t\t\n \n var ajax = new XMLHttpRequest();\t\t\t\t\n ajax.addEventListener('load', completeHandlerUpdate, false);\n ajax.open('POST', 'php/upload.php');\n ajax.send(formData);\n}", "openFile() {\n if (this.loadView.loadFileInput.files.length > 0) {\n var file = this.loadView.loadFileInput.files.item(0);\n var event = new CustomEvent(\"fileload\", { 'detail': file });\n document.dispatchEvent(event);\n }\n }", "function uploadFile(uploadObject) {\r\n//\tconsole.log(uploadObject);\r\n showProgressAnimation();\r\n\t/* Create a FormData instance */\r\n var formData = new FormData();\r\n\t/* Add the file */\r\n formData.append(\"file\", uploadObject.file.files[0]);\r\n formData.append(\"fkId\", uploadObject.fkId);\r\n formData.append(\"uploadType\", uploadObject.type);\r\n formData.append(\"folderType\", uploadObject.folderType);\r\n $.ajax({\r\n url: 'uploadFile', // point to server-side\r\n dataType: 'text', // what to expect back from server, if anything\r\n cache: false,\r\n contentType: false,\r\n processData: false,\r\n data: formData,\r\n type: 'post',\r\n success: function(response){\r\n uploadObject.hideProgressAnimation();\r\n if(uploadObject.message && uploadObject.message != '') {\r\n showMessageContent('Success', uploadObject.message);\r\n }\r\n if(uploadObject.url && uploadObject.url != '') {\r\n window.location.href = uploadObject.url;\r\n }\r\n\r\n },\r\n error:function(){\r\n uploadObject.hideProgressAnimation();\r\n if(uploadObject.message && uploadObject.message != '') {\r\n showMessageContent('Success', uploadObject.message);\r\n }\r\n }\r\n });\r\n}", "uploadFile(file, cb) {\n\n function transferComplete(e) {\n if(e.currentTarget.status === 200) {\n var data = JSON.parse(e.currentTarget.response)\n var path = '/media/' + data.name\n cb(null, path)\n } else {\n cb(new Error(e.currentTarget.response))\n }\n }\n\n function updateProgress(e) {\n if (e.lengthComputable) {\n //var percentage = (e.loaded / e.total) * 100;\n //self.documentSession.hubClient.emit('upload', percentage);\n }\n }\n\n var formData = new window.FormData()\n formData.append(\"files\", file)\n var xhr = new window.XMLHttpRequest()\n xhr.addEventListener(\"load\", transferComplete)\n xhr.upload.addEventListener(\"progress\", updateProgress)\n xhr.open('post', this.config.httpUrl, true)\n xhr.send(formData)\n }", "function upload() {\n if (resumable == null)\n resumable = resumableInit(fileInfo, uploadCompleteHandler);\n}", "function fileUploadDone() {\n signale.complete('File upload done');\n}", "sending(file, xhr, formData) {}", "handleUploadFinished(event) {\n\n try {\n const uploadedFiles = event.detail.files;\n //show success toast message \n const evt = new ShowToastEvent({\n title: 'File Upload Status...',\n message: uploadedFiles.length + 'file(s) uploaded successfully.',\n variant: 'success',\n });\n this.dispatchEvent(evt);\n showSuccessMessage(this, `${uploadedFiles.length} file(s) uploaded successfully.`);\n\n let childCmp = this.template.querySelector('c-attachments-viewer');\n if (childCmp) {\n childCmp.refresh(this.recordId);\n }\n } catch (e) {\n showAsyncErrorMessage(this, e);\n }\n }", "async uploadDocumentToIPFS() {\n const formData = new FormData();\n const files = Array.from(document.querySelector(\"#document\").files);\n if (files.length > 0) {\n if (this.approveFileType(files[0])) {\n formData.set(\"document\", files[0]);\n const { IpfsHash } = await fetch(\"http://localhost:3000/upload\", {\n method: \"POST\",\n body: formData,\n }).then((response) => response.json());\n return IpfsHash;\n } else {\n new Alert(\n \"#alert-container\",\n \"alert\",\n \"danger\",\n \"File type is not approved\"\n );\n }\n } else {\n return \"\";\n }\n }", "function upload(evt) {\n\t file = evt.target.files[0];\n\t console.log(\"yikes!!!\", file);\n\t var reader = new FileReader();\n\t reader.readAsText(file);\n\t \treader.onload = loaded;\n\t}", "function onPhotoDataSuccess(imageData) {\n // Uncomment to view the base64-encoded image data\n console.log(\"imageData:%s\",imageData);\n // Get image handle\n var smallImage = document.getElementById('smallImage');\n // Unhide image elements\n smallImage.style.display = 'block';\n if ( $('#woNumber')[0].selectedIndex != 0 ) {\n $('.btnupload').prop('disabled',false);\n }\n // Show the captured photo\n // The in-line CSS rules are used to resize the image\n smallImage.src = \"data:image/jpeg;base64,\" + imageData;\n /****************************************************/\n // create blob object from the base64-encoded image data\n blob = dataURItoBlob(smallImage.src);\n //var fd = new FormData(document.forms[0]);\n console.log('blob in capture.js:',blob);\n\n \n //formData.append('file', blob);\n /* This code is for testing\n var attachUrl = 'http://10.0.2.2:9090/rest/api/2/issue/' + $('#woNumber option:selected').val() + '/attachments'\n $.ajax({\n\n beforeSend: function(xhr){xhr.setRequestHeader(\"X-Atlassian-Token\", \"no-check\");},\n url: attachUrl , // Url to which the request is send\n type: \"POST\", // Type of request to be send, called as method\n data: formData, // Data sent to server, a set of key/value pairs (i.e. form fields and values)\n contentType: false, // The content type used when sending data to the server.\n cache: false, // To unable request pages to be cached\n processData:false, // To send DOMDocument or non processed data file it is set to false\n success: function(data) // A function to be called if request succeeds\n {\n console.log('uploaded to jira'); \n alert('Success - Uploaded'); \n $('#loading').hide();\n $(\"#message\").html(data);\n },\n error: function(data){\n console.log('fail to upload');\n }\n }); \n */ \n/****************************************************/\n\n }", "function tryToUploadFile() {\n // !! Assumes variable fileURL contains a valid URL to a text file on the device,\n var fileURL = getDataFileEntry().toURL();\n\n var success = function (r) {\n console.log(\"Response = \" + r.response);\n display(\"Uploaded. Response: \" + r.response);\n }\n\n var fail = function (error) {\n console.log(\"An error has occurred: Code = \" + error.code);\n offlineWrite(\"Failed to upload: some offline data\");\n }\n\n var options = new FileUploadOptions();\n options.fileKey = \"file\";\n options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);\n options.mimeType = \"text/plain\";\n\n var ft = new FileTransfer();\n // Make sure you add the domain of your server URL to the \n // Content-Security-Policy <meta> element in index.html.\n ft.upload(fileURL, encodeURI(SERVER), success, fail, options);\n }", "function handleFile(file)\n\t{\n\t\tvar fileReader \t\t\t= new FileReader();\n\t\tfileReader.onloadend\t= fileUploaded;\n\t\tfileReader.readAsDataURL(file);\n\t}", "function uploadFile(i, taskID) {\n var file = files[i];\n var req = new XMLHttpRequest();\n var url = \"Handler/FileHandler.ashx?action=uploadFile&fileType=\" + file.type + \"&taskID=\" + taskID + \"&projectID=\" + projectID;\n var form = new FormData();\n form.append(file.name, file);\n\n req.upload.addEventListener(\"progress\", function (e) {\n //Tracking progress here\n var done = e.position || e.loaded;\n var tempProgress = Math.round(((tempSize + done) / totalSize) * 100);\n if (progress < tempProgress) {\n progress = tempProgress;\n document.getElementById(\"uploadProgress\").style.width = progress + \"%\";\n }\n });\n\n req.onreadystatechange = function () {\n if (req.readyState == 4 && req.status == 200) {\n // Upload completed\n document.getElementById(\"fileList\").innerHTML += req.responseText;\n\n // Send the visual to other clients\n proxyTC.invoke(\"sendUploadedFile\", taskID, req.responseText);\n\n // If the queue still has files left then upload them\n if (i < files.length - 1) {\n tempSize += file.size;\n uploadFile(i + 1, taskID);\n }\n // Otherwise reset back to original state\n else {\n document.getElementById(\"uploadProgressContainer\").style.opacity = 0;\n document.getElementById(\"uploadProgress\").style.width = 0;\n document.getElementById(\"inputFileName\").innerHTML = \"\";\n document.getElementById(\"inputUploadFile\").value = \"\";\n }\n }\n }\n req.open('post', url, true);\n req.send(form);\n}", "function fileUpload() {\n\tvar files = this.files;\n\tvar sendData = new FormData();\n\tsendData.append('tree', properties.toLink());\n\tsendData.append('types', properties.typesAllowed);\n\tsendData.append('action', 'upload');\n\tif (files.length > 1) {\n\t\tfor (var f = 0; f < files.length; f++) {\n\t\t\tsendData.append('upload[]', files[f]);\n\t\t}\n\t} else\n\t\tsendData.append('upload', files[0]);\n\tsendFilehandlingRequest(sendData);\n}", "function initUpload(){\n var files = document.getElementById('file-input').files;\n var file = files[0];\n if(file == null){\n return alert('No file selected.');\n }\n uploadRequest(file);\n}", "function onReaderLoad(event){\n try {\n fileObj = JSON.parse(event.target.result);\n validBuildingFile = true;\n } catch (e) {\n alert(\"Invalid JSON, cannot upload!\");\n }\n}", "async function handleUpload(){\n let uService = service;\n if (uService instanceof UploadService) {\n uService = new UploadService();\n }\n await uService.handleUpload(document.getElementById(\"fileArea\"));\n if (uService.success) {\n NotificationManager.success(t(\"upload.successMessage\"), t(\"upload.successTitle\"), 2000);\n document.getElementById(\"fileArea\").value = \"\"; // Clear input file\n } else if (uService.error) {\n NotificationManager.error(t(\"upload.errorMessage\"), t(\"upload.errorTitle\"), 3000);\n } else if (document.getElementById(\"fileArea\").value === \"\") {\n NotificationManager.error(t(\"upload.errorEmptyMessage\"), t(\"upload.errorTitle\"), 3000);\n } else if (uService.errorPermissions) {\n NotificationManager.error(t(\"upload.errorPermissionsMessage\"), t(\"upload.errorTitle\"), 3000);\n }\n }", "function UploadFile(file) {\n // alert(file.type.toString());\n var xhr = new XMLHttpRequest();\n //ensure browser supports xhr2, and file is a csv file less than 400KB\n if (xhr.upload && (file.type == \"text/csv\" || file.type == \"application/vnd.ms-excel\") && file.size <= 400000) {\n\n var formdata = new FormData();\n formdata.append(file.name, file);\n //upload the file\n xhr.open(\"POST\", \"../../Product/CreateFromFile\", true);\n xhr.setRequestHeader(\"X_FILENAME\", file.name); \n xhr.send(formdata);\n\n //display success message\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == 200) {\n $msg.html(\"Successfully Created Products From File!\")\n }\n }\n }\n else {\n //display fail message\n $msg.html(\"Invalid File Format/File Too Large\"\n + \"<br />(File must be in CSV format, and less than 400KB in size.)\");\n }\n }", "function upload_file(file, id) {\n var xhr = createXHR(),\n formData = new FormData,\n eleProgress = document.getElementById(\"J_p_\" + id);\n formData.append(\"file\", file);\n\n xhr.open(\"post\", formAction, true);\n xhr.addEventListener(\"load\", function () {\n\n });\n xhr.upload.addEventListener(\"progress\", function (event) {\n var percent;\n if (event.lengthComputable) {\n percent = (event.loaded / event.total * 100) + \"%\";\n eleProgress.style.width = percent;\n eleProgress.innerHTML = percent;\n }\n });\n xhr.send(formData);\n }", "processFile (connection) {\n this.api.staticFile.get(connection, (connection, error, fileStream, mime, length, lastModified) => {\n this.sendFile(connection, error, fileStream, mime, length, lastModified)\n })\n }", "function file_upload(file_name) {\n\n\t//Display the loading picture\n\ttoggle_loading();\n\n\t//Generate XML with file name\n\tvar xml = \n '<xml version=\"1.0\">' +\n\t\t\t'<file_name>' + file_name + '</file_name>' +\n\t\t\t'<user>' + user + '</user>' +\n\t\t'</xml>';\n\t\n\t//AJAX call to start verifications (4 steps : outter_verifications, CSV_reading, inner_verifications, upload)\n\tvar request = $.ajax({\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\turl: \"model/bulk_entry/file_outer_verifications.php\",\n\t\t\t\t\t\tdata: xml,\n\t\t\t\t\t\tcontentType: \"text/xml; charset=utf-8\",\n\t\t\t\t\t\tdataType: \"xml\",\n\t\t\t\t\t\tsuccess: OnSuccess,\n\t\t\t\t\t\terror: OnError\n\t});\n\t\n\n\tfunction OnSuccess(data,status,request) {\n\t\tvar error = $(request.responseText).find(\"error\").text();\n\t\tvar success = $(request.responseText).find(\"success\").text();\n\t\tvar log_name = $(request.responseText).find(\"log_name\").text();\n\t\t\n\t\t//Hide the loading picture\n\t\ttoggle_loading();\n\t\t\n\t\t//If success, print the message\n\t\tif ((error == \"\") && (success !== \"\")) {\n\t\t\tDeleteMessage();\n\t\t\tCreateMessage(\"green\", success, 0.5, 3, 0.5);\n\t\t}\n\t\t//If error, print the message\n\t\telse if ((success == \"\") && (error !== \"\")) {\n\t\t\tDeleteMessage();\n\t\t\tCreateMessage(\"red\", error, 0.5, 3, 0.5);\n\t\t\t\n\t\t\t//If a log was generated, add a download button\n\t\t\tif (log_name !== \"\") {\n\t\t\t\tget_button(log_name);\n\t\t\t}\n\t\t}\t\t\t\n\t}\n\t\n\t//Else : error\n\tfunction OnError(request, data, status) {\t\n\t\t//Hide the loading picture\n\t\ttoggle_loading();\n\t\n\t\tmessage = \"Network problem: XHR didn't work. Perhaps, incorrect URL is called or file format isn't good.<br/>Verify that column seperators are commas, line separators are line breaks and there is no empty line at the end.\";\n\t\tDeleteMessage();\n\t\tCreateMessage(\"red\", message, 0.5, 3, 0.5);\n\t}\n\t\n}", "function initUpload(){\n const files = document.getElementById('file_upload').files;\n const file = files[0];\n if(file == null){\n return alert('No file selected.');\n }\n getSignedRequest(file);\n}", "function handleUpload(event) {\n setFile(event.target.files[0]);\n \n // Add code here to upload file to server\n // ...\n }", "function handleUpload(event) {\n setFile(event.target.files[0]);\n \n // Add code here to upload file to server\n // ...\n }", "function triggerSaveRequest(this_file){\n\tconsole.log(\"your file info is \");\n\tconsole.log(this_file);\n\tvar fd = new FormData();\n\tfd.append('blob', this_file, this_video_name);\n\tconsole.log(fd);\n\tfetch('/save',\n\t{\n\t method: 'post',\n\t body: fd\n\t});\n}", "function mcFileUploading($rootScope){\n \"use strict\";\n\n var uploader = null;\n var errorCallback = null;\n var successCallback = null;\n var uploaderOptions = {};\n var inputFileName = \"__fileSender__\";\n var abortUploadingID = null;\n var abortPreparingUploading = null;\n var abortUploadingCB = null;\n var abortNow = false;\n var whereWeWork = \"\";\n\n function parseFile(file, callback) {\n var fileSize = file.size;\n var chunkSize = 512 * 1024; // bytes\n var offset = 0;\n var chunkReaderBlock = null;\n var onePercent = file.size / 100;\n var currentPercent = 0;\n\n var readEventHandler = function (evt) {\n if (!abortNow){\n if (evt.target.error == null) {\n offset += evt.target.result.byteLength;\n currentPercent = (offset / onePercent).toFixed();\n\n callback(null, evt.target.result, currentPercent); // callback for handling read chunk\n } else {\n callback(evt.target.error);\n\n return;\n }\n\n if (offset >= fileSize) {\n callback(null, null, 100);\n\n return;\n }\n\n chunkReaderBlock(fileReader, offset, chunkSize, file);\n }\n };\n\n chunkReaderBlock = function (_reader, _offset, length, _file) {\n var reader = _reader || new FileReader();\n var blob = _file.slice(_offset, length + _offset);\n\n if (!_reader) {\n if (uploaderOptions.onBeforeFileAdd) {\n uploaderOptions.onBeforeFileAdd(file);\n }\n\n if (!abortPreparingUploading){\n abortPreparingUploading = function () {\n reader.abort();\n reader.onload = null;\n\n abortPreparingUploading = null;\n }\n }\n\n reader.onload = readEventHandler;\n }\n\n reader.readAsArrayBuffer(blob);\n\n return reader;\n };\n\n var fileReader = chunkReaderBlock(null, offset, chunkSize, file);\n }\n\n function startUploadAfterCheck(info, file) {\n uploaderOptions.Hash = info.Hash; // SHA1 хэш файла\n uploaderOptions.Width = $rootScope.thumbsSize.x; // произвольная ширина уменьшеной копии изображения\n uploaderOptions.Height = $rootScope.thumbsSize.y; // произвольная высота уменьшенной копии изображения\n uploaderOptions.FileName = info.FileName; // локальное название файла\n\n if (!info.Present) { // file not exist - uploading\n uploader.define(\"upload\", mcService.getLocalHostPath($rootScope.isWebClient) + \"/uploading/?sid=\" + mcConst.SessionID + \"&hash=\" + info.Hash + whereWeWork);\n uploader.addFile(file);\n } else {\n if (successCallback) {\n successCallback.apply(uploaderOptions, arguments);\n } else {\n console.trace('No set success callback on file uploading');\n }\n }\n }\n\n function electronUploader() {\n $rootScope.$broadcast(window._messages_.clientData.sendCMDToElectron, [\n mcConst._CMD_.ce_file_upload_start,\n uploaderOptions.filePath,\n {\n Where : uploaderOptions.Where,\n ID : uploaderOptions.ID,\n Type : uploaderOptions.Type,\n chatType : uploaderOptions.chatType\n }\n ]);\n\n abortUploadingCB = function () {\n abortUploadingCB = null;\n\n $rootScope.$broadcast(window._messages_.clientData.sendCMDToElectron, [\n mcConst._CMD_.ce_file_upload_abort\n ]);\n };\n \n abortPreparingUploading = function () {\n abortPreparingUploading = null;\n\n $rootScope.$broadcast(window._messages_.clientData.sendCMDToElectron, [\n mcConst._CMD_.ce_file_upload_prepare_abort\n ]);\n };\n }\n\n function checkFileExist(params, cb) {\n $rootScope.SendCMDToServer(\n [ mcConst._CMD_.cs_is_file_exists, mcConst.SessionID ]\n .concat(params || [])\n .concat(cb)\n );\n }\n\n function _goUploadClipboardImage() {\n var calcSha1 = mcService.SHA1();\n var Hash = \"\";\n var fileReader = new FileReader();\n\n fileReader.onloadend = function() {\n var screenImg = this.result;\n var imageInfo = uploaderOptions.clipboardImage;\n\n calcSha1.append(screenImg);\n\n if (!imageInfo.name || (imageInfo.name && imageInfo.name.indexOf(\"image.\") === 0 && !imageInfo.path) ){\n try{\n imageInfo[\"name\"] = \"Screenshot (\" + mcConst.UserInfo.Nick + \") \" + mcService.formatDate(new Date(), \"dd-mm-yyyy hh-nn-ss\") + \".png\";\n } catch (e) {}\n }\n\n Hash = calcSha1.end();\n\n checkFileExist([\n Hash , // SHA1 хэш файла\n mcConst._CMD_.msgType.IMAGE, // тип файла. 2 - изображение, 4 - обычный файл\n imageInfo.name, // локальное название файла\n uploaderOptions.Where,\n uploaderOptions.ID ,\n mcService.fileTimeStamp()\n ], function (data) {\n startUploadAfterCheck(data, imageInfo);\n });\n };\n\n fileReader.readAsArrayBuffer(uploaderOptions.clipboardImage);\n }\n\n function _goUploadFile() {\n var fileInput= this;\n var calcSha1 = mcService.SHA1();\n var file = fileInput.files[0];\n var MsgType = uploaderOptions.Type;\n\n if (file){\n uploaderOptions.fileSize = file.size;\n uploaderOptions.lastModifiedDate = file.lastModified || file.lastModifiedDate;\n\n setTimeout(function () {\n parseFile(file, function (err, data, percent) {\n if (err) {\n console.error(\"Read error: \" + err);\n } else {\n if (data) {\n if (uploaderOptions.onPrepareProgress){\n uploaderOptions.onPrepareProgress(percent);\n }\n\n calcSha1.append(data);\n } else {\n var Hash = calcSha1.end();\n\n if (fileInput.value) {\n fileInput.value = \"\";\n }\n\n checkFileExist([\n Hash , // SHA1 хэш файла\n MsgType , // тип файла. 2 - изображение, 4 - обычный файл\n uploaderOptions.Type === mcConst._CMD_.msgType.IMAGE\n ? file.name // локальное название файла\n : file.path || file.name,\n uploaderOptions.Where , // куда вставлять файл (priv, conf, bbs, broadcast, forum, kanban)\n uploaderOptions.ID , // число-идентификатор, для кого отправлять файл:\n // 1, private - UIN\n // 2, conference - UID\n // 3, forum - ID топика\n // 4, kanban - ID таска\n // 5, bbs - -1\n // 6, broadcast - -1\n mcService.fileTimeStamp(file.lastModified || file.lastModifiedDate)\n ], function (data) {\n startUploadAfterCheck(data, file);\n });\n }\n }\n });\n }, 100);\n }/* else {\n if (errorCallback){\n errorCallback();\n }\n }*/\n }\n\n function fileFromDialog() {\n var element = document.getElementById(inputFileName);\n\n if (!element){\n element = document.createElement('div');\n\n element.id = inputFileName;\n element.className = 'hideFileInput';\n\n document.body.appendChild(element);\n }\n\n element.innerHTML = '<input type=\"file\">';\n\n var fileInput = element.firstChild;\n\n if (fileInput.value && mcService.isIE()) {\n fileInput.parentNode.replaceChild(\n fileInput.cloneNode(true),\n fileInput\n );\n\n fileInput = document.getElementById(inputFileName).firstChild;\n }\n\n switch (uploaderOptions.Type) {\n case mcConst._CMD_.msgType.IMAGE:\n fileInput.accept = \"image/png, image/gif, image/jpeg, image/jpg\";\n break;\n\n case mcConst._CMD_.msgType.VIDEO:\n fileInput.accept = \"video/mp4, video/x-m4v, .mkv, video/mpeg, video/webm, video/*\";\n break;\n\n default:\n fileInput.accept = \"\";\n }\n\n if (fileInput.fileEvent){\n fileInput.removeEventListener('change', fileInput.fileEvent);\n }\n\n fileInput.fileEvent = _goUploadFile;\n\n fileInput.addEventListener('change', fileInput.fileEvent);\n\n fileInput.click();\n }\n\n function uploadFile(_errorCallback, _successCallback, _uploaderOptions){\n errorCallback = _errorCallback;\n successCallback = _successCallback;\n uploaderOptions = _uploaderOptions || {};\n\n // -- clipboard image --\n if (uploaderOptions.clipboardImage) {\n _goUploadClipboardImage();\n } else\n\n // -- drop file into chat text --\n if (uploaderOptions.filePath && uploaderOptions.dropFile){\n _goUploadFile.apply(uploaderOptions.dropFile);\n } else\n\n // -- clipboard file, only for electron app --\n if (uploaderOptions.filePath){\n electronUploader();\n } else\n \n // -- file from dialog window --\n {\n fileFromDialog();\n }\n }\n\n // ========================================================\n\n var _msg = window._messages_.mcFileUploader = {\n abortUploading : 'abortUploading',\n abortPreparingUploading : 'abortPreparingUploading',\n uploadFile : 'uploadFile'\n };\n\n $rootScope.$on(_msg.abortUploading, function () {\n abortNow = true;\n\n if (abortPreparingUploading) {\n abortPreparingUploading();\n }\n\n if (uploader && abortUploadingID) {\n uploader.stopUpload(abortUploadingID);\n uploader.destructor();\n }\n\n if (abortUploadingCB){\n abortUploadingCB();\n }\n\n uploaderOptions = {};\n });\n\n $rootScope.$on(_msg.abortPreparingUploading, function () {\n if (abortPreparingUploading) {\n abortPreparingUploading();\n }\n\n if (uploader){\n uploader.destructor();\n }\n });\n\n $rootScope.$on(_msg.uploadFile, function(e,args){\n uploader = $$(\"uploadAPI\");\n\n if (uploader){\n uploader.destructor();\n }\n\n abortUploadingID = null;\n abortPreparingUploading = null;\n abortUploadingCB = null;\n abortNow = false;\n\n whereWeWork = $rootScope.hasOwnProperty(\"GetChatType\") ? \"&where=\" + $rootScope.GetChatType().toLowerCase() : \"\";\n\n var opt = args[2] || {};\n\n if (!opt.uploadProgress && !$$(\"uploadProgress\")){\n webix.ui({ id: \"uploadProgress\", view: \"list\", scroll: false, padding: 0, borderless: true, hidden: true, select: false});\n }\n\n uploader = webix.ui({\n id : \"uploadAPI\",\n view : \"uploader\",\n multiple: false,\n link : opt.uploadProgress || \"uploadProgress\",\n apiOnly: true,\n on : {\n onAfterFileAdd: function (file) {\n abortUploadingID = file.id;\n\n if (uploaderOptions.onAfterFileAdd){\n uploaderOptions.onAfterFileAdd(file);\n }\n },\n onUploadComplete:function(){\n if (successCallback) {\n successCallback.apply(uploaderOptions, []);\n } else {\n console.trace('No set success callback on file uploading');\n }\n\n errorCallback = null;\n successCallback = null;\n },\n onFileUploadError:function(){\n console.warn(\"Error during file uploading\");\n\n if (errorCallback) {\n errorCallback.apply(null, arguments);\n }\n\n errorCallback = null;\n successCallback = null;\n }\n }\n });\n\n uploadFile.apply(null, args);\n });\n}", "runUserUpload() {\n\t\tconst input = document.createElement(\"input\");\n\t\tinput.type = \"file\";\n\t\tinput.onchange = (evt) => {\n\t\t\tconst reader = new FileReader();\n\t\t\treader.onloadend = (evt) => {\n\t\t\t\tthis.loadStoredCircuit(JSON.parse(evt.target.result));\n\t\t\t};\n\t\t\treader.readAsText(evt.target.files[0]);\n\t\t};\n\t\tinput.click();\n\t}", "function handleFile(e) {\n var files = e.target.files;\n var f = files[0];\n {\n var reader = new FileReader();\n var name = f.name;\n reader.onload = function (e) {\n var data = e.target.result;\n var wb;\n var arr = fixdata(data);\n wb = X.read(btoa(arr), { type: 'base64' });\n process_wb(wb);\n };\n reader.readAsArrayBuffer(f);\n }\n }", "async function upload_and_process(output_file_loc, key, io, id, timestamp, file_name, start_date_string, size, file_completed) {\n\treturn await new Promise((resolve, reject) => {\n\t\t// upload the current file \n\t\tconst upload_file_promise = upload_file(output_file_loc, key);\n\n\t\t// once the file is uploaded\n\t\tupload_file_promise.then((file_loc) => {\n\n\t\t\t// once the file is uploaded now you can remove it \n\t\t\tfs.unlinkSync(file_loc);\n\n\t\t\t// get the file number so that we can tell the lambda function which file to process \n\t\t\tconst split_file_name = file_loc.split(\"/\");\n\t\t\tconst file_number = split_file_name[split_file_name.length-1];\n\n\t\t\t// create a payload for the lambda function \n\t\t\tconst payload = {\n\t\t\t \"key\": `${id}/${file_name}_${timestamp}/parts/${file_number}`,\n\t\t\t \"id\": id,\n\t\t\t \"file\": file_name,\n\t\t\t \"part\": `${file_number}`,\n\t\t\t \"start_date\": start_date_string,\n\t\t\t \"date\": start_date_string, // THIS IS REDUNDANT NEED TO CHECK WHY THIS IS HERE \n\t\t\t \"timestamp\": timestamp\n\t\t\t};\n\n\t\t\t// call the lambda function with the above payload \n\t\t\tconst lambda_promise = call_lambda(payload, \"arn:aws:lambda:us-east-2:722606526443:function:GPFS_IBM_process\");\n\n\t\t\t// once the lambda is completed \n\t\t\tlambda_promise.then((flag) => {\n\n\n\t\t\t\tresolve(1);\n\n\t\t\t});\n\n\t\t}).catch((err) => {\n\t\t\tconsole.log(\"Error from function upload_file\");\n\t\t\tconsole.log(err);\n\t\t\treject(err);\n\t\t});\n\n\t});\n}", "function postToAPI() {\n console.log(\"Sending file to analyze\");\n\n nest.analyzeFile(file, nest.guessType(file), {\n onload: function (result) {\n\n var response = result.response;\n\n var data = result;\n\n console.log(\"Got response\");\n console.log(response);\n\n if (response.track && response.track.audio_summary) {\n console.log(\"Loading analysis URL:\" + response.track.audio_summary.analysis_url);\n\n if(!response.track.audio_summary.analysis_url) {\n console.error(\"Echonest does not like us and didn't produce track analysis URL\");\n if(failed) {\n failed();\n return;\n }\n }\n\n nest.loadAnalysis(response.track.audio_summary.analysis_url, {\n onload: function (result) {\n data.analysis = result;\n storeCachedResult(hash, JSON.stringify(data));\n ready(data);\n }\n });\n }\n }\n });\n }", "function readAndUploadDroppedFile(file) {\n Y.log('Uploading dropped file: ' + file.name, 'info', NAME);\n\n var divId = 'divUp' + Y.doccirrus.media.tempId();\n\n // add a line to the test console for this upload\n jqCache.divAttachmentsNote.append('' +\n '<div id=\"' + divId + '\" style=\"background-color: rgba(255, 255, 100, 0.3);\">' +\n Y.doccirrus.i18n('MediaMojit.list_attachments.view.LBL_UPLOADING') + ': ' + file.name +\n '</div>'\n );\n\n function onFileUploaded(err, newMediaId) {\n\n var jqNoticeDiv = $('#' + divId), cleanText;\n\n if (err) {\n Y.log( 'Error uploading file: ' + JSON.stringify( err ), 'warn', NAME );\n if ( err && !err.statusText ) { err = { 'statusText': 'Die Datei konnte nicht erkannt werden.' }; }\n cleanText = err.statusText.replace('500', '').replace( new RegExp( '\"', 'g'), '');\n\n jqNoticeDiv.html( 'Fehler: ' + cleanText + '<br/>Datei: ' + file.name );\n jqNoticeDiv.css( 'background-color', 'rgba(255, 100, 100, 0.3)' );\n\n // pop a notice to the user\n Y.doccirrus.DCWindow.notice( {\n type: 'notice',\n title: 'Hinweis',\n message: cleanText + '<br/>Datei: ' + file.name,\n window: { id: 'list_attachments_upload_fail', width: 'medium' }\n } );\n\n window.setTimeout(function() { jqNoticeDiv.hide(); }, 2800);\n return;\n }\n\n Y.log('Attached file as: ' + newMediaId, 'debug', NAME);\n\n // update the upload line in the UI\n jqNoticeDiv.html( Y.doccirrus.i18n('MediaMojit.list_attachments.view.LBL_COMPLETE') + ': ' + file.name);\n window.setTimeout(function() { jqNoticeDiv.hide(); }, 800);\n\n\n // reload the list of attachments (will update display)\n Y.doccirrus.media.clearCache(ownerCollection, ownerId);\n requestAttachmentsList(newMediaId);\n }\n\n Y.log( 'Checking upload of type: ' + file.type, 'debug', NAME );\n\n var category = Y.doccirrus.media.types.getCategory( file.type );\n if ( -1 === allowCategories.indexOf( category ) && 'unknown' !== category ) {\n Y.log( 'Blocked: file is of category: ' + category + ', allowed categories: ' + JSON.stringify( allowCategories ), 'warn', NAME );\n $( '#' + divId ).html( 'Bitte eine Datei vom Typ wählen:<br/> ' + listAllowedExt().join( ', ' ) );\n\n // fade this out after a few seconds\n window.setTimeout( function() { $( '#' + divId ).fadeOut(); }, 5000 );\n return;\n }\n\n Y.log( 'Recognized file as belonging to category: ' );\n Y.doccirrus.media.uploadFile(ownerCollection, ownerId, label, file, onFileUploaded);\n }", "onSuccess(file, filePath) {\n const {\n filename,\n mimetype,\n size,\n key,\n container,\n source,\n originalPath,\n } = file;\n const {\n setFileName,\n setFilestackData,\n challengeId,\n isChallengeBelongToTopgearGroup,\n } = this.props;\n // container doesn't seem to get echoed from Drag and Drop\n const cont = container || config.FILESTACK.SUBMISSION_CONTAINER;\n // In case of url we need to submit the original url not the S3\n const fileUrl = source === 'url' ? originalPath : `https://s3.amazonaws.com/${cont}/${filePath}`;\n\n setFileName(filename);\n\n const fileStackData = {\n filename,\n challengeId,\n fileUrl,\n mimetype,\n size,\n key,\n container: cont,\n };\n\n if (isChallengeBelongToTopgearGroup) {\n fileStackData.fileType = 'url';\n }\n\n setFilestackData(fileStackData);\n }", "function triggerFileUpload() {\n fileInputElement.current.click();\n }", "onUploadAttachment(claimsIdentity, conversationId, attachmentUpload) {\n return __awaiter(this, void 0, void 0, function* () {\n throw new statusCodeError_1.StatusCodeError(botbuilder_core_1.StatusCodes.NOT_IMPLEMENTED, `ChannelServiceHandler.onUploadAttachment(): ${botbuilder_core_1.StatusCodes.NOT_IMPLEMENTED}: ${http_1.STATUS_CODES[botbuilder_core_1.StatusCodes.NOT_IMPLEMENTED]}`);\n });\n }", "function uploadAndAttachNewResource(event) {\n var formData = new FormData();\n var resourceData = {}\n var title = \"\"\n if ($('#resourceImportModal .fileInput').attr('type') === 'button') { //using icab\n formData = new FormData($('#resourceImportModal #fileUploadIcabFix')[0])\n title = $('#resourceImportModal .fileInput').val()\n if (title == \"Select File\" && $('#resourceImportModal #fileUploadIcabFix input[type=\"hidden\"]').length == 0) {\n $('#resourceImportModal #upload .validation-box').addClass('error required')\n return\n }\n resourceData['type'] = 'file'\n formData.append('title', title)\n //formData.append('file', file, file.name)\n } else {\n var files = $('#resourceImportModal .fileInput')[0].files\n if (files.length == 0) {\n $('#resourceImportModal #upload .validation-box').addClass('error required')\n return\n }\n var file = files[0]\n title = file.name\n resourceData['content-type'] = file.type\n if (file.type.split('/')[0] == 'image') {\n resourceData['type'] = 'image'\n } else if (file.type.indexOf('pdf') != -1) {\n resourceData['type'] = 'pdf'\n } else {\n resourceData['type'] = 'file'\n }\n formData.append('file', file, file.name)\n formData.append('title', file.name)\n }\n formData.append('owner', 'schoolbag')\n formData.append('creator', 'noticeboard')\n formData.append('clientId', $('.hidden input[name=\"client-id\"]').val())\n formData.append('key', $('.hidden input[name=\"key\"]').val())\n\n resourceFunctions.uploadResource(resourceData, formData, function(response) {\n var row = $('<div>')\n row.append('<input type=\"hidden\" name=\"file-id\" value=\"' + response.id + '\">')\n row.append('<span class=\"col-sm-9\">' + title + '</span>')\n $('#openAddResourceModal').before(row)\n\n var remove = $('<span class=\"col-sm-3\"><span class=\"btn-remove btn-icon fa fa-times\" title=\"Remove\"></span></span>')\n row.append(remove)\n remove.on('click', function(event) {\n $(event.currentTarget).closest('div').remove()\n })\n $('#resourceImportModal').modal('hide')\n }, function(request, status, error){\n $('#resourceImportModal #upload .error').removeClass('hidden')\n $('#resourceImportModal #upload .loading').addClass('hidden')\n })\n $('#resourceImportModal #upload .contents').addClass('hidden')\n $('#resourceImportModal #upload .loading').removeClass('hidden')\n $('#resourceImportModal button.close').addClass('hidden')\n }", "function handleUploadFile(req, res) {\n var domain = checkUserIpAddress(req, res);\n if (domain == null) return;\n if ((domain.id !== '') || (!req.session) || (req.session == null) || (!req.session.userid) || (domain.userQuota == -1)) { res.sendStatus(401); return; }\n var user = obj.users[req.session.userid];\n if ((user.siteadmin & 8) == 0) { res.sendStatus(401); return; } // Check if we have file rights\n\n var multiparty = require('multiparty');\n var form = new multiparty.Form();\n form.parse(req, function (err, fields, files) {\n if ((fields == null) || (fields.link == null) || (fields.link.length != 1)) { res.sendStatus(404); return; }\n var xfile = getServerFilePath(user, domain, decodeURIComponent(fields.link[0]));\n if (xfile == null) { res.sendStatus(404); return; }\n // Get total bytes in the path\n var totalsize = readTotalFileSize(xfile.fullpath);\n if (totalsize < xfile.quota) { // Check if the quota is not already broken\n if (fields.name != null) {\n // Upload method where all the file data is within the fields.\n var names = fields.name[0].split('*'), sizes = fields.size[0].split('*'), types = fields.type[0].split('*'), datas = fields.data[0].split('*');\n if ((names.length == sizes.length) && (types.length == datas.length) && (names.length == types.length)) {\n for (var i = 0; i < names.length; i++) {\n if (obj.common.IsFilenameValid(names[i]) == false) { res.sendStatus(404); return; }\n var filedata = new Buffer(datas[i].split(',')[1], 'base64');\n if ((totalsize + filedata.length) < xfile.quota) { // Check if quota would not be broken if we add this file\n obj.fs.writeFileSync(xfile.fullpath + '/' + names[i], filedata);\n }\n }\n }\n } else {\n // More typical upload method, the file data is in a multipart mime post.\n for (var i in files.files) {\n var file = files.files[i], fpath = xfile.fullpath + '/' + file.originalFilename;\n if (obj.common.IsFilenameValid(file.originalFilename) && ((totalsize + file.size) < xfile.quota)) { // Check if quota would not be broken if we add this file\n obj.fs.rename(file.path, fpath);\n } else {\n try { obj.fs.unlinkSync(file.path); } catch (e) { }\n }\n }\n }\n }\n res.send('');\n obj.parent.DispatchEvent([user._id], obj, 'updatefiles') // Fire an event causing this user to update this files\n });\n }", "function handleFile(e) {\n setLoadingState(\"Loading\")\n var file = e.target.files[0];\n let fileName = file.name.split(\" \").join(\"-\");\n console.log(fileName);\n var reader = new FileReader();\n reader.onload = function (event) { //on loading file.\n console.log(event.target.result);\n var unconverteFile = event.target.result;\n var convertedFile;\n switch (format) {\n case \"JSON\":\n convertedFile = jsonJSON(unconverteFile);\n fileName = fileName.substring(0, fileName.indexOf(\".json\"));\n break;\n case \"CSV\":\n convertedFile = csvJSON(unconverteFile);\n fileName = fileName.substring(0, fileName.indexOf(\".csv\"));\n break;\n case \"SSV\":\n convertedFile = ssvJSON(unconverteFile);\n fileName = fileName.substring(0, fileName.indexOf(\".csv\"));\n break\n default:\n convertedFile = jsonJSON(unconverteFile);\n }\n dispatchDeleteSel();\n dispatchLoad(convertedFile);\n setLoadingState(\"Loaded\");\n dispatchKeys(createKeys(convertedFile));\n dispatchLoadName(fileName);\n dispatchExtended(false);\n }\n reader.readAsText(file);\n }", "fileLoaded(event)\n {\n // event.result is the final object that was created after loading \n //console.log(event.result); \n }", "function fileReady() {\n var nau = new AjaxUpload('upload_file_link', {\n //action: $(\"form.edit_item\").attr(\"action\"),\n //action: \"<%= documents_path %>\",\n action: \"/documents\",\n name: 'document[data]',\n data: {\n '_method' : \"post\",\n //document: {\n // 'documentable_id' : \"\",\n // 'description' : \"ABC\"\n //},\n 'document[documentable_id]' : \"\",\n 'document[description]' : \"\",\n //'ajax_upload' : \"ajax_upload\",\n 'authenticity_token' : $(\"input[name=authenticity_token]\").attr(\"value\")\n },\n // Submit file after selection\n autoSubmit: false,\n // Useful when you are using JSON data as a response, set to \"json\" in that case.\n responseType: \"json\",\n // Fired after the file is selected\n onload: function (file, extension) {\n $.fn.colorbox.resize();\n },\n // Fired after the file is selected\n onChange: function (file, extension) {\n //alert(\"onChange\");\n //this.disable();\n $(\"#selected_file_label\").html(file+\"&nbsp;&nbsp;&nbsp;\");\n $(\"#upload_file_link\").html(\"(replace)\");\n $.fn.colorbox.resize();\n },\n // Fired before the file is uploaded\n onSubmit: function (file, extension) {\n //alert(\"onSubmit\");\n //alert(this._settings.data._method);\n //this._settings.data.document_documentable_id = $(\"#document_documentable_id\").val();\n //this._settings.data.document_description = $(\"#document_description\").val();\n this._settings.data[\"document[documentable_id]\"] = $(\"#document_documentable_id\").val();\n this._settings.data[\"document[description]\"] = $(\"#document_description\").val();\n },\n // Fired when file upload is completed\n // WARNING! DO NOT USE \"FALSE\" STRING AS A RESPONSE!\n onComplete: function (file, response) {\n //globalObject = response;\n //alert(\"onComplete\");\n //alert(response.success);\n //var response_json = jQuery.parseJSON(response);\n //alert(response_json.status);\n //if(response_json.status == \"not-saved\"){\n if(response.success){\n //$.fn.colorbox.close();\n if(window.location == response.redirect_url)\n window.location.reload(true);\n else\n window.location(response.redirect_url);\n } else {\n $(\"#errorExplanation ul\").empty();\n $(\"#errorExplanation\").show();\n $(\"#selected_file_label\").html(\"\");\n $(\"#upload_file_link\").html(\"Select File\");\n //response_json.errors.forEach(function (value){\n //for(var i=0 ; i<response_json.errors.length ; i++){\n // var value = response_json.errors[i];\n for(var i=0 ; i<response.errors.length ; i++){\n var value = response.errors[i];\n if(value[0] == \"documentable_id\")\n value[0] = \"Document Category\";\n if(value[0] == \"data_content_type\") {\n value[0] = \"Document\";\n value[1] = \"must be of office type\";\n }\n $('<li></li>').appendTo('#errorExplanation ul').html(value[0]+\" \"+value[1]);\n }//);\n $.fn.colorbox.resize();\n }\n //$('<li></li>').appendTo('#errorExplanation ul').html(response_json.errors[0][0]+\" \"+response_json.errors[0][1]);\n //$(\".upldDocDv\").parent().html(response);\n this.enable();\n }\n });\n $(\"#new_document\").submit(function (event){\n event.preventDefault();\n //alert(\"new_document_submit\");\n return fileSafeUpload(nau);\n });\n}", "async function handleAddFile() {\n try {\n setLoading(false);\n props.setAddFileName(fileInputRef.current.files[0].name);\n props.setShowUploader(true);\n await addFile(\n props.courseId,\n props.folder,\n fileInputRef.current.files[0],\n props.setUploaderProgress\n );\n } catch (error) {\n console.log(error);\n }\n setLoading(false);\n }", "sendFile_() {\n var content = this.file;\n var end = this.file.size;\n\n if (this.offset || this.chunkSize) {\n // Only bother to slice the file if we're either resuming or uploading in chunks\n if (this.chunkSize) {\n end = Math.min(this.offset + this.chunkSize, this.file.size);\n }\n content = content.slice(this.offset, end);\n }\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", this.url, true);\n xhr.setRequestHeader(\"Content-Type\", this.contentType);\n xhr.setRequestHeader(\n \"Content-Range\",\n \"bytes \" + this.offset + \"-\" + (end - 1) + \"/\" + this.file.size\n );\n xhr.setRequestHeader(\"X-Upload-Content-Type\", this.file.type);\n if (xhr.upload) {\n xhr.upload.addEventListener(\"progress\", this.onProgress);\n }\n xhr.onload = this.onContentUploadSuccess_.bind(this);\n xhr.onerror = this.onContentUploadError_.bind(this);\n xhr.send(content);\n }", "function uploadCompleteHandler() {\n console.log(\"Upload finished.\");\n getAllFiles();\n /*\n Do what you like here.\n */\n}", "function uploadFile(){\n localUpload();\n publicUpload();\n alert(\"File uploaded.\\nWaiting to get analyze result.\");\n window.location.href = \"index.php?upload&filename=\" + fileName;\n }", "function appxsendfilehandler(x) {\r\n if (appxIsLocalReady()) {\r\n switch (x.messagepart) {\r\n case -1:\r\n var msgfilenamedata = [];\r\n var filepath = appx_session.currsendfile.filename;\r\n appxClearStatusMsgText();\r\n appxSetStatusText(\"Saving File...\");\r\n appx_session.currsendfile.filedata = [];\r\n setTimeout(function setTimeout1() {\r\n //send client file path length\r\n var ms = {\r\n cmd: 'appxmessage',\r\n args: hton32(filepath.length),\r\n handler: 'appxsendfilehandler',\r\n data: null\r\n };\r\n appx_session.ws.send(JSON.stringify(ms));\r\n //send client file path\r\n for (var vi = 0; vi < filepath.length; vi++) {\r\n msgfilenamedata.push(filepath.charCodeAt(vi));\r\n }\r\n var ms = {\r\n cmd: 'appxmessage',\r\n args: msgfilenamedata,\r\n handler: 'appxsendfilehandler',\r\n data: null\r\n };\r\n appx_session.ws.send(JSON.stringify(ms));\r\n //send client status EOF\r\n var ms = {\r\n cmd: 'appxmessage',\r\n args: [3, 1],\r\n handler: 'appxsendfilehandler',\r\n data: null\r\n };\r\n appx_session.ws.send(JSON.stringify(ms));\r\n appxClearStatusMsgText();\r\n appxSetStatusText(\"File Download Complete...\");\r\n setTimeout(function setTimeout2() {\r\n if ($(\"#appx-status-msg\").html() === \"File Download Complete...\") {\r\n appxClearStatusMsgText();\r\n }\r\n }, 1000);\r\n }, appx_session.currsendfile.blocksreceived * 1); //end setTimeout\r\n\r\n break;\r\n case 3:\r\n appx_session.currsendfile.filename = x.data.filename;\r\n appx_session.currsendfile.guid = Math.floor((Math.random() * 1000000) + 1);\r\n appx_session.currsendfile.filedatareceived = 0;\r\n appx_session.currsendfile.blocksreceived = 0;\r\n appx_session.currsendfile.datalengthneeded = x.data.datalength;\r\n if (appx_session.currsendfile.filename.indexOf(\"$(\") > -1) {\r\n appx_session.currsendfile.filename = appx_session.parseOption(appx_session.currsendfile.filename);\r\n }\r\n else {\r\n appx_session.currsendfile.filename = appx_session.currsendfile.filename;\r\n }\r\n if (appx_session.currsendfile.filename.indexOf(\"/\") == -1 && appx_session.currsendfile.filename.indexOf(\"\\\\\") == -1) {\r\n appx_session.currsendfile.filename = appx_session.parseOption(\"$(userHome)\" + appx_session.fileseparatorchar + appx_session.currsendfile.filename);\r\n }\r\n appxClearStatusMsgText();\r\n appxSetStatusText(\"Creating File: \" + appx_session.currsendfile.filename);\r\n appx_session.currsendfile.filecreated = false;\r\n CreateFile(appx_session.currsendfile);\r\n break;\r\n case 5:\r\n appx_session.currsendfile.blocksreceived += 1;\r\n appx_session.currsendfile.filedatareceived += x.data.length;\r\n appxClearStatusMsgText();\r\n appxSetStatusText(\"File Downloading... Received: \" + appx_session.currsendfile.filedatareceived + \" Bytes of \" + appx_session.currsendfile.datalengthneeded.toString() + \" Needed\");\r\n AppendFile(x.data);\r\n break;\r\n\r\n default:\r\n //append data to file via local connector\r\n break;\r\n }\r\n }\r\n else {\r\n //send client status EOF\r\n if (x.messagepart != -1) {\r\n var ms = {\r\n cmd: 'appxmessage',\r\n args: [0, 0],\r\n handler: 'appxsendfilehandler',\r\n data: null\r\n };\r\n appx_session.ws.send(JSON.stringify(ms));\r\n }\r\n }\r\n}", "onFileUpload() {\n \n let templateNameInput = document.getElementById('template-name');\n let isEmptyField = false;\n let isTemplateNameCorrectFormat = true;\n let templateName = this.state['templateName'];\n\n this.setState({ message: null });\n //Validate template name\n if (this.isEmptyStringOrNull(templateName.trim())) {\n isEmptyField = true;\n templateNameInput.classList.add(\"inputError\");\n } else {\n templateNameInput.classList.remove(\"inputError\");\n }\n\n if (!this.isTemplateNameFormattedCorrectly(templateName)) {\n isTemplateNameCorrectFormat = false;\n templateNameInput.classList.add(\"inputError\");\n } else {\n templateNameInput.classList.remove(\"inputError\");\n }\n\n var allowedExtensions = /(\\.docx)$/i;\n var fileInput = this.state.selectedFile;\n var filePath;\n\n if (fileInput) {\n filePath = fileInput.name;\n }\n\n if (!fileInput || isEmptyField) {\n this.setState({ message: this.messages.EMPTY_FIELD });\n } else if (!isTemplateNameCorrectFormat) {\n this.setState({ message: this.messages.TEMPLATE_NAME_INCORRECT_FORMAT });\n } else if (!allowedExtensions.exec(filePath)) {\n this.setState({ message: this.messages.WRONG_FILE_TYPE });\n } else {\n this.setState({ uploading: true });\n uploadFile(fileInput, 'docxtemplates', templateName).then(() => {\n this.setState({ message: this.messages.SUCCESS, processing: false, uploading: false });\n this.props.onUploadSuccess();\n }).catch(error => {\n console.log(\"File Upload Error:\",error);\n this.setState({ message: this.messages.UPLOAD_FAIL + \": \" + error.message, uploading: false });\n });\n }\n }", "function uploadSuccess(event, file, data, response) {\n\t\t\t\t// Getting JSON answer\n\t\t\t\ttry { data = $.parseJSON(data); }\n\t\t\t\t//Not JSON\n\t\t\t\tcatch(e) {\n\t\t\t\t\tresetUploadUI();\n\t\t\t\t\treturn $.ui.dialog.error(__('serverResponseUnknown'), __('error'));\n\t\t\t\t}\n\n\t\t\t\t// JSON return error\n\t\t\t\tif (data.error) {\n\t\t\t\t\tif (timeoutSamplePreview) clearTimeout(timeoutSamplePreview);\n\t\t\t\t\tresetUploadUI();\n\t\t\t\t\t$.ui.dialog.error(data.message, { 'title' : __('error') });\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Passing in finished mode\n\t\t\t\tuploadElement.removeClass('uploading finalizing').addClass('finished');\n\t\t\t\t// Getting the newly id based on the document type (document or image)\n\t\t\t\tif (documentType==\"image\") {\n\t\t\t\t\tidField.val(data.data.Image.id);\n\t\t\t\t} else {\n\t\t\t\t\tidField.val(data.data.Document.id);\n\t\t\t\t}\n\t\t\t\tpreviewElement.html(data.html);\n\t\t\t\treturn true;\n\t\t\t}", "function uploadSlides(e) {\n /*jshint validthis: true*/\n e.preventDefault();\n var file = this.querySelector('input[type=file]').files[0];\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n var reader = new FileReader();\n\n reader.onload = (function(file) {\n return parseFile.bind(this, file.type);\n })(file);\n\n if (file.type.match('text/html'))\n reader.readAsText(file, 'utf8');\n else\n reader.readAsDataURL(file);\n } else {\n alert('File reading not supported');\n }\n}", "function uploadSlides(e) {\n /*jshint validthis: true*/\n e.preventDefault();\n var file = this.querySelector('input[type=file]').files[0];\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n var reader = new FileReader();\n\n reader.onload = (function(file) {\n return parseFile.bind(this, file.type);\n })(file);\n\n if (file.type.match('text/html'))\n reader.readAsText(file, 'utf8');\n else\n reader.readAsDataURL(file);\n } else {\n alert('File reading not supported');\n }\n}", "function fileUpload() {\n\t\t\n\t\t\tif (file){\n\t\t\t\t\n\t\t\t\tif (file.size > maxFileSize * 1000 * 1000)\n\t\t\t\t{\n\t\t\t\t\talert('You can only send files with max. ' + maxFileSize + ' MB Size');\n\t\t\t\t}\n\t\t\t\telse if (file.type.substring(0,5) === 'image'){\n\t\t\t\t\tfileInfo = {\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tfileType: 'image'\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tfileReader.readAsDataURL(file);\n\t\t\t\t}\n\t\t\t\telse if (file.type.substring(0,5) === 'video'){\n\t\t\t\t\tfileInfo = {\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tfileType: 'video'\n\t\t\t\t\t};\n\t\t\t\t\tfileReader.readAsDataURL(file);\n\t\t\t\t}\n\t\t\t\telse if (file.type.substring(0,5) === 'audio'){\n\t\t\t\t\tfileInfo = {\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tfileType: 'audio'\n\t\t\t\t\t}\n\t\t\t\t\tfileReader.readAsDataURL(file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfileInfo = {\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tfileType: 'other'\n\t\t\t\t\t}\n\t\t\t\t\tfileReader.readAsDataURL(file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('#fileselect').val('');\n\t\t\t\tfile = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talert(\"Error: No file selected!\");\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}", "complete( results, file ){\n //call parseUpload and pass the results.data to it (the array of json objects)\n Meteor.call( 'parseUpload', results.data, ( error, response ) => {\n if (error){\n Bert.alert(error.reason, 'warning');\n //console.log(error.reason);\n }else{\n template.uploading.set( false );\n\t Bert.alert('Upload Complete', 'success', 'growl-top-right');\n }\n });\n }", "function uploadFile_(type, env, apiKey, domain, baseUrl, blob) {\n\n var url = baseUrl + \"multimedia/\";\n if (!domain) domain = \"\";\n\n var headers = {\n \"X-DOMAIN\": domain,\n \"X-Auth-Token\": \"api-key \" + apiKey\n };\n var boundary = \"labnol\";\n\n var attributes = \"{\\\"name\\\":\\\"\" + blob.getName() + \"\\\"}\";\n\n var requestBody = Utilities.newBlob(\n \"--\" + boundary + \"\\r\\n\" +\n \"Content-Disposition: form-data; name=\\\"attributes\\\"\\r\\n\\r\\n\" +\n attributes + \"\\r\\n\" + \"--\" + boundary + \"\\r\\n\" +\n \"Content-Disposition: form-data; name=\\\"file\\\"; filename=\\\"\" + blob.getName() + \"\\\"\\r\\n\" +\n \"Content-Type: \" + blob.getContentType() + \"\\r\\n\\r\\n\").getBytes()\n .concat(blob.getBytes())\n .concat(Utilities.newBlob(\"\\r\\n--\" + boundary + \"--\\r\\n\").getBytes());\n\n var options = {\n \"method\": \"post\",\n \"contentType\": \"multipart/form-data; boundary=\" + boundary,\n \"payload\": requestBody,\n \"muteHttpExceptions\": false,\n \"headers\": headers\n };\n\n var response = UrlFetchApp.fetch(url, options);\n\n Logger.log(response.getContentText());\n return response;\n }", "handleSending(file, xhr) {\n this.props.actions.queuedFiles.updateQueuedFile(file._queuedAtTime, { xhr });\n }", "function UploadFile3(file) {\n\n\tvar xhr = new XMLHttpRequest();\n\tif (xhr.upload && (file.type == \"image/jpeg\" || file.type == \"image/png\") && file.size <= $id(\"MAX_FILE_SIZE\").value) {\n\t\t//start upload\n\t\txhr.open(\"POST\", $id(\"upload3\").action, true);\n\t\txhr.setRequestHeader(\"X_FILENAME\", file.name);\n\t\txhr.send(file);\n\t}\n\telse\n\t{\n\t\talert('The upload does not work.');\n\t}\n\n}", "saveToFile() {\r\n saveFile({\r\n idParent: this.currentOceanRequest.id,\r\n fileType: this.fileType,\r\n strFileName: this.fileName\r\n })\r\n .then(() => {\r\n // refreshing the datatable\r\n this.getRelatedFiles();\r\n })\r\n .catch(error => {\r\n // Showing errors if any while inserting the files\r\n this.dispatchEvent(\r\n new ShowToastEvent({\r\n title: \"Error while uploading File\",\r\n message: error.message,\r\n variant: \"error\"\r\n })\r\n );\r\n });\r\n }", "function fileReceived(e) {\n // if user clicks 'cancel' on file dialogue, the filelist might be zero\n if (typeof e === 'undefined' || e.target.files.length === 0) return null;\n const selectedFile = e.target.files[0];\n console.log(selectedFile)\n if (Constants.VALID_EXTENSIONS.indexOf(selectedFile.name.split('.').pop()) >= 0) {\n console.log(`Selected file: ${selectedFile.name}`)\n // when the file has been read in, it will trigger the on load reader event\n reader.readAsArrayBuffer(selectedFile);\n } else {\n alert(`The file extension ${selectedFile.name.split('.').pop()} is invalid, must be in ${Constants.VALID_EXTENSIONS}`);\n }\n }", "function uploadFile(file, signedRequest, url) {\n const xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", signedRequest);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n console.log(\"uploaded file\");\n } else {\n reject(\"Could not upload file.\");\n }\n }\n };\n xhr.send(file);\n }", "function processFile (event) {\n var content = event.target.result;\n sendFileToCloudVision(content.replace('data:image/jpeg;base64,', ''));\n}", "function processFile (event) {\n var content = event.target.result;\n sendFileToCloudVision(content.replace('data:image/jpeg;base64,', ''));\n}", "function postExpenseAdditionThruFile_SuccessCallback(webReqResponse) {\n\n alert(\"Expense addition through XL file upload got successful : \" + webReqResponse);\n document.location.replace(\"./UploadExpenseFile.html\");\n }", "function uploadFile(file) {\n var\n url,\n xhr = new XMLHttpRequest(),\n formData = new FormData()\n ;\n\n if (file.media) {\n url = Medias.getUploadUrl(file.media);\n } else if (file.uploadURL) {\n url = file.uploadURL;\n } else {\n return;\n }\n\n file.isUploading = true;\n\n if (Shace.accessToken) {\n url += '?access_token='+Shace.accessToken.token;\n }\n\n // Request event handlers\n xhr.upload.addEventListener('progress', function (event) {\n $rootScope.$apply(function() {\n uploadProgress(file, event);\n });\n }, false);\n xhr.upload.addEventListener('load', function (event) {\n // Update progress: upload is not done yet, waiting for server response\n $rootScope.$apply(function() {\n uploadProgress(file, event);\n });\n }, false);\n xhr.upload.addEventListener('error', function (event) {\n $rootScope.$apply(function() {\n uploadDone(file, event);\n });\n }, false);\n xhr.upload.addEventListener('abort', function (event) {\n $rootScope.$apply(function() {\n uploadDone(file, event);\n });\n }, false);\n xhr.addEventListener('load', function (event) {\n var response, json;\n\n $rootScope.$apply(function() {\n response = xhr.response;\n try {\n json = JSON.parse(response);\n response = json;\n } catch (e) {}\n uploadDone(file, event, response);\n });\n }, false);\n\n // Open connection\n xhr.open('POST', url);\n formData.append('file', file);\n // Execute request\n xhr.send(formData);\n }", "function uploadFile() {\n const files = fileUpload.files;\n if (files.length > 1) {\n resetFileInput();\n showPrompt(\"Can't upload more than 1 file!\");\n return;\n }\n const file = fileUpload.files[0];\n if (file.size > MAX_FILE_SIZE) {\n resetFileInput();\n showPrompt(`Can't upload more than ${MAX_FILE_SIZE / (1024 * 1024)}MB`);\n return;\n }\n submit.removeAttribute(\"disabled\");\n progressContainer.style.display = \"block\";\n const formData = new FormData();\n formData.append(\"myfile\", file);\n const xhr = new XMLHttpRequest();\n xhr.onreadystatechange = () => {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n showLink(JSON.parse(xhr.response));\n }\n };\n xhr.upload.onprogress = uploadProgress;\n xhr.upload.onerror = () => {\n resetFileInput();\n showPrompt(`Error in upload: ${xhr.statusText}`);\n };\n xhr.open(\"POST\", url);\n xhr.send(formData);\n}", "function fileDialogStart()\n {\n \t$swfUpload.cancelUpload();\n \n if (typeof(handlers.file_dialog_start_handler) == 'function')\n {\n handlers.file_dialog_start_handler();\n }\n }", "function uploaded(file) {\n\tuploadLoading = true;\n\tuploadedAudio = loadSound(file.data, uploadedAudioPlay);\n}", "function handleUploads() {\n \n}", "function uploadFiles (event) {\n event.preventDefault(); // Prevent the default form post\n\n // Grab the file and asynchronously convert to base64.\n var file = $('#fileform [name=fileField]')[0].files[0];\n console.log(file);\n var reader = new FileReader();\n reader.onloadend = processFile;\n reader.readAsDataURL(file);\n}", "function ajaxExcelUpload()\n{ \n var attachmentFileName = document.getElementById('file').value; \n if(attachmentFileName.length==0){\n document.getElementById('resultMessage').innerHTML = \"<font color=red>Please upload File.</font>\";\n }\n else { \n $.ajaxFileUpload({ \n url:'ajaxExcelUpload.action', \n secureuri:false,//false\n fileElementId:'file',//id <input type=\"file\" id=\"file\" name=\"file\" />\n dataType: 'json',// json\n success: function(data,status){ \n var displaymessage = \"<font color=red>Please try again later</font>\"; \n // alert(data);\n if(data.indexOf(\"uploaded\")>0){ \n //if(data==\"uploaded\"){ \n displaymessage = \"<font color=green>Uploaded Successfully.</font>\";\n } \n if(data.indexOf(\"Error\")>0){ \n //if(data==\"Error\"){ \n displaymessage = \"<font color=red>Internal Error!, Please try again later.</font>\"\n } //if(data==\"Exceded\"){ \n if(data.indexOf(\"Exceded\")>0){ \n displaymessage = \"<font color=red>Max records exceded.Please upload less than 1500 .</font>\"\n } \n if(data.indexOf(\"InvalidFormat\")>0){ \n //if(data==\"InvalidFormat\"){ \n displaymessage = \"<font color=red>Please upoload excelsheet with specified header fileds.</font>\"\n } \n document.getElementById('resultMessage').innerHTML = displaymessage; \n },\n error: function(e){ \n document.getElementById('resultMessage').innerHTML = \"<font color=red>Please try again later</font>\"; \n }\n }); \n }\n //}\t\n return false;\n}", "function fileControlFileGet(filePath)\n{\n\t\n\t\t\t\t\t\t console.log(\"filePath\",filePath);\n\t\t\t\t\t\t const formData = new FormData();\n\tvar messageAttributes={\n\t\t\t\t\tStaffuserName:\"admin\",\n\t\t\t\t\tServerDate:\"\",\n\t\t\t\t\tsms_unique_id:\"\", \n\t\t\t\t\t}\n\t\t\t\t\tformData.append('file', $('#formInputFile')[0].files[0]);\n \t\t\t\t\tgeneralChannel.sendMessage(formData,messageAttributes).then(function(message){\n\t\t\t\t\t\t console.log(\"message\",message);\n\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(document).height() }, 10);\n\t\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\n}", "async function onSubmit(event) {\n \n event.preventDefault(); //prvents the form being submitted the usual way. \n if (form.fileOne.files.length < 1 || form.fileTwo.files.length < 1) { //checks if user has added 2 files (this is the only validation done client side)\n alert('Please select two files');\n return false;\n }\n \n const ladCode = form.lad.value //Local Authority code selected by user in form\n const fileOne = form.fileOne.files[0]; //First file chosen (EXTRACT file)\n const fileTwo = form.fileTwo.files[0]; //Second file chosen (MANI file)\n const fileOneObject = {\n fileSize: fileOne.size,\n fileType: fileOne.type\n }\n const urlWithParameters = url + `?fileOneName=${fileOne.name}&fileOneType=${fileOne.type}&fileTwoName=${fileTwo.name}&fileTwoType=${fileTwo.type}&ladCode=${ladCode}&fileOneSize=${fileOne.size}&fileTwoSize=${fileTwo.size}&fileOne=${fileOneObject}&fileTwo=${fileTwo}`;\n\n fetch(urlWithParameters, options) //pings API Gateway which triggers lambda. File verification is carried out by lambda - the message in the reponse depeneds on if and why the files fail the checks\n .then(response => response.json()) \n .then(data => { \n console.log(\"message : \" + data.message)\n if(data.message === \"file is incorrect type\"){\n alert(`${data.filename} is not csv`);\n \n } else if(data.message === \"file incorrectly named\") {\n alert(`${data.filename} is incorrectly named`);\n \n } else if(data.message === \"file is empty\") {\n alert(`${data.filename} is empty`);\n \n } else if(data.message === \"file names dont match\") {\n alert(`File names dont match. Please check`);\n console.log(data.q)\n \n \n \n } else {\n uploadFile(data.uploadURLFileOne, fileOne).then(data => { //If all file verification checks pass, each file is uploded to its individual pre-signed URL which puts file in s3 bucket\n alert('Hooray! You uploaded ' + fileOne.name); //Bucket is specified in lambda\n })\n uploadFile(data.uploadURLFileTwo, fileTwo).then(data => {\n alert('Hooray! You uploaded ' + fileTwo.name);\n })\n }\n });\n \n}", "function UploadFile(fileName) {\n\n var filedata = new FormData();\n for (i = 0; i < fileArray.length; i++) {\n var filename = \"UploadedFile\" + i;\n filedata.append(filename, fileArray[i][0]);\n }\n filedata.append(\"UserID\", get_current_user_id());\n filedata.append(\"OrgID\", get_current_user_org_id());\n\n fileArray = [];\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"SMTHDashboard\", true);\n xhr.send(filedata);\n xhr.onreadystatechange = function (data) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n alert('' + fileName + ' is Save Successfully.');\n }\n else if (xhr.status == 404) {\n ShowErrorBoxMessage(\"File cannot Imported!.\"); \n } \n };\n}", "function WrapFile (file){\n\n\t\t\t\t\tvar submitDeferred = null;\n\t\t\t\t\tvar fileSubmission = null;\n\t\t\t\t\tvar nativeFile = file.files[0]; //html5 file object\n\n\t\t\t\t\tvar onProgress = function(event, data){\n\t\t\t\t\t\tif(data.files[0] === file.files[0]){\n\t\t\t\t\t\t\tsubmitDeferred.notify(data._progress);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tvar removeProgressHandler = function(){\n\t\t\t\t\t\t$el.off('fileuploadprogress', onProgress);\n\t\t\t\t\t};\n\n\t\t\t\t\t$el.on('fileuploadprogress', onProgress);\n\n\t\t\t\t\tvar fileName = FileUtil.parseFileName(nativeFile.name) || {};\n\t\t\t\t\tvar extension = fileName.extension || '';\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: nativeFile.name,\n\t\t\t\t\t\tprettyName: fileName.prettyName || '',\n\t\t\t\t\t\textension: extension,\n\n\t\t\t\t\t\tsize: nativeFile.size,\n\t\t\t\t\t\tisVideoFile: FileUtil.isVideoFile(extension),\n\t\t\t\t\t\tisImageFile: FileUtil.isImageFile(extension),\n\t\t\t\t\t\tinputName: file.fileInput && file.fileInput.attr(\"name\"),\n\n\t\t\t\t\t\tsetOptions: function(options){\n\t\t\t\t\t\t\t_.extend(file, options);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t//upload the file\n\t\t\t\t\t\tsubmit: function(){\n\t\t\t\t\t\t\tif(submitDeferred){\n\t\t\t\t\t\t\t\tthrow new Error(\"File upload in progress\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubmitDeferred = $q.defer();\n\n\t\t\t\t\t\t\tfile.url = Util.addQueryParams(file.url, {\n\t\t\t\t\t\t\t\tvbrickAccessToken: UserContext.getAccessToken()\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tfileSubmission = file.submit();\n\n\t\t\t\t\t\t\tfileSubmission.then(function (response){\n\t\t\t\t\t\t\t\t\t//prevent $apply in progress errors\n\t\t\t\t\t\t\t\t\twindow.setTimeout(function(){\n\t\t\t\t\t\t\t\t\t\tsubmitDeferred.resolve(response);\n\t\t\t\t\t\t\t\t\t\tsubmitDeferred = null;\n\t\t\t\t\t\t\t\t\t\tscope.$apply();\n\t\t\t\t\t\t\t\t\t},0);\n\n\t\t\t\t\t\t\t\t\tremoveProgressHandler();\n\n\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\t//prevent $apply in progress errors\n\t\t\t\t\t\t\t\t\twindow.setTimeout(function(){\n\t\t\t\t\t\t\t\t\t\tsubmitDeferred.reject(err);\n\t\t\t\t\t\t\t\t\t\tsubmitDeferred = null;\n\t\t\t\t\t\t\t\t\t\tscope.$apply();\n\t\t\t\t\t\t\t\t\t},0);\n\n\t\t\t\t\t\t\t\t\tremoveProgressHandler();\n\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\treturn submitDeferred.promise;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tabort: function(){\n\t\t\t\t\t\t\tif(fileSubmission){\n\t\t\t\t\t\t\t\tfileSubmission.abort();\n\t\t\t\t\t\t\t\tsubmitDeferred === null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tremoveProgressHandler();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tgetImageUrl: function(){\n\t\t\t\t\t\t\tvar deferred = $q.defer();\n\t\t\t\t\t\t\tif(!window.FileReader || !nativeFile.type.match(/^image/)){\n\t\t\t\t\t\t\t\tdeferred.reject();\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 self=this;\n\t\t\t\t\t\t\t\tvar reader = new FileReader();\n\t\t\t\t\t\t\t\treader.onload = function(e) {\n\t\t\t\t\t\t\t\t\tscope.$apply(function(){\n\t\t\t\t\t\t\t\t\t\tdeferred.resolve(e.target.result);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t// Read in the image file as a data URL.\n\t\t\t\t\t\t\t\treader.readAsDataURL(nativeFile);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn deferred.promise;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tgetImageDimensions: function(url){\n\t\t\t\t\t\t\tvar deferred = $q.defer();\n\n\t\t\t\t\t\t\tvar img = $(\"<img>\").attr(\"src\", url)\n\t\t\t\t\t\t\t\t.on(\"load\", function(e){\n\t\t\t\t\t\t\t\t\tdeferred.resolve({\n\t\t\t\t\t\t\t\t\t\twidth: this.width,\n\t\t\t\t\t\t\t\t\t\theight: this.height\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\timg.remove();\n\n\t\t\t\t\t\t\t\t\tscope.$apply();\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.on(\"error\", function(e){\n\t\t\t\t\t\t\t\t\tdeferred.reject(e);\n\t\t\t\t\t\t\t\t\tscope.$apply();\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\treturn deferred.promise;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}", "uploadFile(e) {\n // get the file and send\n const selectedFile = this.postcardEle.getElementsByTagName(\"input\")[0].files[0];\n const formData = new FormData();\n formData.append('newImage', selectedFile, selectedFile.name);\n // build a browser-style HTTP request data structure\n const xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/upload\", true);\n xhr.addEventListener('loadend', (e) => {\n this.onImageLoad(e, xhr);\n });\n xhr.send(formData);\n }", "handleFileUploadStarted() {\n this.isWorking = true\n }", "function getUserFile(e) {\n\te.preventDefault();\n\tprogressPopUp.show();\n\tvar file = inputFile[0].files[0];\n\tfileParser.postMessage({ command: \"decode\", id: \"signal\", file: file });\n}", "function uploadSavedataPending(file) {\n runCommands.push(function () { \n gba.loadSavedataFromFile(file) \n });\n }" ]
[ "0.6802467", "0.64451814", "0.6315319", "0.62748504", "0.6202645", "0.6177801", "0.61405754", "0.6117803", "0.6061337", "0.60337394", "0.6030239", "0.6023879", "0.59792835", "0.5921451", "0.5910848", "0.58695996", "0.585191", "0.585032", "0.5832177", "0.58171964", "0.5787905", "0.57701176", "0.57687193", "0.5763862", "0.5763862", "0.57478917", "0.57334477", "0.5728743", "0.57202935", "0.5719097", "0.57143945", "0.5713129", "0.5703197", "0.57027656", "0.5688609", "0.5686502", "0.5677122", "0.56769943", "0.5675227", "0.5673032", "0.5670184", "0.5662921", "0.56529266", "0.564326", "0.56408197", "0.5634381", "0.56327444", "0.56260335", "0.5622822", "0.5622822", "0.56197953", "0.56140774", "0.5613084", "0.56042314", "0.55932915", "0.559164", "0.55903095", "0.55819535", "0.5580509", "0.5576617", "0.5572337", "0.5569212", "0.55679774", "0.55621505", "0.55530757", "0.55444217", "0.5539396", "0.55357945", "0.55345196", "0.5534214", "0.5531032", "0.55157495", "0.5514624", "0.5514624", "0.55126476", "0.5507886", "0.5501908", "0.5499006", "0.5498087", "0.5495324", "0.5490593", "0.5480216", "0.54792976", "0.54792976", "0.54752666", "0.5474959", "0.5474849", "0.54712903", "0.54680747", "0.5467111", "0.5464744", "0.54629266", "0.546033", "0.5457848", "0.54487306", "0.544651", "0.5446252", "0.5443728", "0.5437846", "0.5437722" ]
0.7078655
0
This helper function ensures that the byte array passed in is returned in a format that's required for the contents of a file sent to SharePoint for storage as a list item attachment.
function fixBuffer(buffer) { var binary = ''; var bytes = new Uint8Array(buffer); var len = bytes.byteLength; for (var i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } return binary; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareAttachmentForStorage(attData, cb) {\n readAsBinaryString(attData, cb);\n}", "function isByteArray(data) {\n return (typeof data === 'object' && Array.isArray(data) \n && data.length > 0 && typeof data[0] === 'number')\n}", "raw_blob(txt) { return Base64.decode(txt) }", "attachmentWithBinary(data, fileName, contentType) {\n return { data, fileName, contentType };\n }", "function getAttachmentString (grAttachment /* GlideRecord of the attachment */) {\n\tvar gsa = new GlideSysAttachment();\n\tvar attBytes = gsa.getBytes(grAttachment); //Gets it as a Java Binary Array, not useable yet\n\tvar attJavaString = Packages.java.lang.String(fileBytes); //Convert the bytes array to a Java-Rhino string\n\tvar attString = String(attJavaString); //We don't trust Rhino, convert it into a Javascript string\n\t\n\treturn attString;\n}", "function findBookPdfAttachment(attachmentItems){\n var fileData=false;\n for (let attachmentItem of attachmentItems ){\n console.debug(`>>> Looking at attachment \"${attachmentItem.get('title')}\"...`);\n fileData = attachmentItem.apiObj.links.enclosure;\n // skip all non-pdf attachments\n if ( fileData.type != \"application/pdf\" ){\n console.debug(\">>> Is not a PDF, skipping...\");\n continue;\n }\n break;\n }\n if( ! fileData ){\n throw new Error(\"No main PDF.\");\n }\n return fileData;\n }", "function isBytesArray(bytes) {\n return bytes.byteLength === 20;\n}", "function fileAttachmentDataProvider() {\n\n var localFile = 'file://c:/local/package/file/batFile.bat';\n var urlFile = 'http://www.intuit.com/some/file/zipFile.zip';\n var httpsURLFile = 'https://www.intuit.com/some/file/zipFile.zip';\n var linkText = 'some link text';\n\n /**\n * FieldInfo and expectations for no flags\n */\n var fieldInfo_NoFlags = [{\n id : 7,\n name : 'file',\n datatypeAttributes: {\n type: 'FILE_ATTACHMENT'\n },\n type : 'CONCRETE'\n }];\n\n var recordInputLocalFile = [[{\n id : 7,\n value: localFile\n }]];\n var recordInputURLFile = JSON.parse(JSON.stringify(recordInputLocalFile));\n recordInputURLFile[0][0].value = urlFile;\n var recordInputHttpsURLFile = JSON.parse(JSON.stringify(recordInputLocalFile));\n recordInputHttpsURLFile[0][0].value = httpsURLFile;\n\n var expectedLocalFile_NoFlags = [[{\n id : 7,\n value : localFile,\n display: localFile\n }]];\n var expectedURLFile_NoFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedURLFile_NoFlags[0][0].value = urlFile;\n expectedURLFile_NoFlags[0][0].display = urlFile;\n var expectedHttpsURLFile_NoFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedHttpsURLFile_NoFlags[0][0].value = httpsURLFile;\n expectedHttpsURLFile_NoFlags[0][0].display = httpsURLFile;\n\n\n /**\n * FieldInfo and expectations for all flags\n */\n var fieldInfo_AllFlags = JSON.parse(JSON.stringify(fieldInfo_NoFlags));\n fieldInfo_AllFlags[0].datatypeAttributes.linkText = linkText;\n var expectedLocalFile_AllFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedLocalFile_AllFlags[0][0].value = localFile;\n expectedLocalFile_AllFlags[0][0].display = linkText;\n var expectedURLFile_AllFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedURLFile_AllFlags[0][0].value = urlFile;\n expectedURLFile_AllFlags[0][0].display = linkText;\n var expectedHttpsURLFile_AllFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedHttpsURLFile_AllFlags[0][0].value = httpsURLFile;\n expectedHttpsURLFile_AllFlags[0][0].display = linkText;\n\n /**\n * Expectations for empty and null URL values\n */\n var recordsNull = JSON.parse(JSON.stringify(recordInputLocalFile));\n recordsNull[0][0].value = null;\n var expectedNull = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedNull[0][0].display = '';\n expectedNull[0][0].value = null;\n\n var recordsEmpty = JSON.parse(JSON.stringify(recordInputLocalFile));\n recordsEmpty[0][0].value = '';\n var expectedEmpty = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedEmpty[0][0].display = '';\n expectedEmpty[0][0].value = '';\n\n var cases = [\n // No flags\n {message: 'FileAttachment - local file with no flags', records: recordInputLocalFile, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedLocalFile_NoFlags},\n {message: 'FileAttachment - http url file with no flags', records: recordInputURLFile, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedURLFile_NoFlags},\n {message: 'FileAttachment - https url file with no flags', records: recordInputHttpsURLFile, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedHttpsURLFile_NoFlags},\n\n // All flags\n {message: 'FileAttachment - local file with all flags', records: recordInputLocalFile, fieldInfo: fieldInfo_AllFlags, expectedRecords: expectedLocalFile_AllFlags},\n {message: 'FileAttachment - http url file with all flags', records: recordInputURLFile, fieldInfo: fieldInfo_AllFlags, expectedRecords: expectedURLFile_AllFlags},\n {message: 'FileAttachment - https url file with all flags', records: recordInputHttpsURLFile, fieldInfo: fieldInfo_AllFlags, expectedRecords: expectedHttpsURLFile_AllFlags},\n\n // Null and Empty File strings\n {message: 'FileAttachment - null -> empty string', records: recordsNull, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedNull},\n {message: 'FileAttachment - empty string -> empty string', records: recordsEmpty, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedEmpty}\n ];\n\n return cases;\n }", "supportsByteArrayValues() {\n return true;\n }", "function convertAttachmentToHex(fileData) {\n let hexStr = '0x';\n for (let i = 0; i < fileData.length; i++) {\n let hex = (fileData[i] & 0xff).toString(16);\n hex = (hex.length === 1) ? '0' + hex : hex;\n hexStr += hex;\n }\n return hexStr.toUpperCase();\n }", "function tryParseAsDataURI(filename){if(!isDataURI(filename)){return;}return intArrayFromBase64(filename.slice(dataURIPrefix.length));}", "function verifyAttachment(digest, callback) {\n\t txn.get(stores.attachmentStore, digest, function (levelErr) {\n\t if (levelErr) {\n\t var err = createError$2(MISSING_STUB,\n\t 'unknown stub attachment with digest ' +\n\t digest);\n\t callback(err);\n\t } else {\n\t callback();\n\t }\n\t });\n\t }", "function verifyAttachment(digest, callback) {\n txn.get(stores.attachmentStore, digest, function (levelErr) {\n if (levelErr) {\n var err = createError(MISSING_STUB,\n 'unknown stub attachment with digest ' +\n digest);\n callback(err);\n } else {\n callback();\n }\n });\n }", "function getAttachmentBase64(grAttachment /* GlideRecord of the attachment */) {\n\tvar gsa = new GlideSysAttachment();\n\tvar attBytes = gsa.getBytes(grAttachment); //Gets it as a Java Binary Array, not useable yet\n\tvar attBase64 = GlideStringUtil.base64Encode(attBytes); //Converts it into a Javascript string, holding the contents as a Base6-encoded string\n\t\n\treturn attBase64;\n}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody$1.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob$1([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER$1]: buf\n\t\t\t});\n\t\t});\n\t}", "function createAttachmentEnvelopeItem(\n\t attachment,\n\t textEncoder,\n\t) {\n\t const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n\t return [\n\t dropUndefinedKeys({\n\t type: 'attachment',\n\t length: buffer.length,\n\t filename: attachment.filename,\n\t content_type: attachment.contentType,\n\t attachment_type: attachment.attachmentType,\n\t }),\n\t buffer,\n\t ];\n\t}", "function convertToFacebookAttachments (items) {\n\n\treturn items.map(item => {\n\n\t\tlet fbType;\n\n\t\tswitch (item.type) {\n\t\t\tcase `file`: fbType = `file`; break;\n\t\t\tcase `image`: fbType = `image`; break;\n\t\t\tcase `audio`: fbType = `audio`; break;\n\t\t\tcase `video`: fbType = `video`; break;\n\t\t\tdefault: throw new Error(`Invalid attachment type \"${item.type}\".`);\n\t\t}\n\n\t\tconst payload = {};\n\n\t\t// Payload must be an empty object unless there is a remote URL for the attachment.\n\t\tif (item.remoteUrl) {\n\t\t\tpayload.url = item.remoteUrl;\n\t\t}\n\n\t\treturn {\n\t\t\ttype: fbType,\n\t\t\tpayload,\n\t\t\t_data: item.data,\n\t\t\t_filename: item.filename,\n\t\t\t_mimeType: item.mimeType,\n\t\t};\n\n\t});\n\n}", "function blobify(data) {\n if (typeof data === \"string\") return s2ab(data);\n if (Array.isArray(data)) return a2u(data);\n return data;\n }", "function createAttachmentEnvelopeItem(\n attachment,\n textEncoder,\n ) {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n return [\n dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n }", "addFile(name, bytes) {\r\n return this.postCore({\r\n body: jsS({\r\n \"@odata.type\": \"#microsoft.graph.fileAttachment\",\r\n contentBytes: bytes,\r\n name: name,\r\n }),\r\n });\r\n }", "function isFile(obj) {\n return isBlob(obj) && isString(obj.name);\n }", "function blobify(data) {\n\tif(typeof data === \"string\") return s2ab(data);\n\tif(Array.isArray(data)) return a2u(data);\n\treturn data;\n}", "function blobify(data) {\n\tif(typeof data === \"string\") return s2ab(data);\n\tif(Array.isArray(data)) return a2u(data);\n\treturn data;\n}", "function blobify(data) {\n\tif(typeof data === \"string\") return s2ab(data);\n\tif(Array.isArray(data)) return a2u(data);\n\treturn data;\n}", "function blobify(data) {\n\tif(typeof data === \"string\") return s2ab(data);\n\tif(Array.isArray(data)) return a2u(data);\n\treturn data;\n}", "function blobify(data) {\n\tif(typeof data === \"string\") return s2ab(data);\n\tif(Array.isArray(data)) return a2u(data);\n\treturn data;\n}", "function prepareAttachmentForStorage(attData, cb) {\n\t cb(attData);\n\t}", "getBase64(file, cb) {\n let reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = function () {\n cb(reader.result)\n };\n reader.onerror = function (error) {\n console.log('Error: ', error);\n };\n }", "function isFile(obj) {\n return isBlob(obj) && isString(obj.name);\n }", "function createAttachmentEnvelopeItem(\n attachment,\n textEncoder,\n) {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n return [\n object.dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n}", "function tryParseAsDataURI(filename) {\nif (!isDataURI(filename)) {\nreturn;\n}\nreturn intArrayFromBase64(filename.slice(dataURIPrefix.length));\n}", "async blob() {\n\t\tconst ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS].body && this[INTERNALS].body.type) || '';\n\t\tconst buf = await this.buffer();\n\n\t\treturn new Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}", "get blobBody() {\n return undefined;\n }", "get blobBody() {\n return undefined;\n }", "function r(e){return e instanceof ArrayBuffer?a.default.resolve(e):e.toArrayBuffer?a.default.resolve(e.toArrayBuffer()):e.buffer?a.default.resolve(e.buffer):new a.default(function(t,n){var r=new FileReader;r.onload=function(){t(new Uint8Array(this.result))},r.onerror=n,r.readAsArrayBuffer(e)})}", "function parse_EncInfoExt(blob, vers) { throw new Error(\"File is password-protected: ECMA-376 Extensible\"); }", "function parse_EncInfoExt(blob, vers) { throw new Error(\"File is password-protected: ECMA-376 Extensible\"); }", "function parse_EncInfoExt(blob, vers) { throw new Error(\"File is password-protected: ECMA-376 Extensible\"); }", "function parse_EncInfoExt(blob, vers) { throw new Error(\"File is password-protected: ECMA-376 Extensible\"); }", "apply_blob(blob) { return Base64.encode(blob) }", "function validateAttachFile() {\n var tempName = \"\";\n var fileName = fileInput.files[0].name;\n var fileExtension = fileName.split('.').pop().toLowerCase();\n var fileSize = fileInput.files[0].size;\n \n if(jQuery.inArray(fileExtension, ['png', 'jpg', 'jpeg', 'PNG', 'JPG', 'JPEG']) == -1) {\n errorMsg = \"<i>\" + fileName + \"</i> has invalid file type<br>\";\n attachment = \"\"\n } else if(fileSize > 4000000) {\n errorMsg = \"The size of <i>\" + fileName + \"</i> is too big<br>\";\n fileInputText.value = \"\";\n attachment = \"\";\n } else {\n errorMsg = \"\";\n if (fileName.lastIndexOf('\\\\')) {\n tempName = fileName.lastIndexOf('\\\\') + 1;\n } else if (fileName.lastIndexOf('/')) {\n tempName = fileName.lastIndexOf('/') + 1;\n }\n fileInputText.value = fileName.slice(tempName, fileName.length);\n attachment = fileInput.files[0];\n }\n}", "get contentAsBlob() {\n return this.originalResponse.blobBody;\n }", "get contentAsBlob() {\n return this.originalResponse.blobBody;\n }", "function fetchData(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ourFetch(genDBUrl(host, path)).then(function (response) {\n if (typeof process !== 'undefined' && !process.browser) {\n return response.buffer();\n } else {\n /* istanbul ignore next */\n return response.blob();\n }\n }).then(function (blob) {\n if (opts.binary) {\n // TODO: Can we remove this?\n if (typeof process !== 'undefined' && !process.browser) {\n blob.type = att.content_type;\n }\n return blob;\n }\n return new Promise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "getBlob() {\r\n return this.clone(File, \"$value\", false).get(new BlobParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\r\n }", "function intArrayFromBase64(s){try{var decoded=decodeBase64(s);var bytes=new Uint8Array(decoded.length);for(var i=0;i<decoded.length;++i){bytes[i]=decoded.charCodeAt(i);}return bytes;}catch(_){throw new Error('Converting base64 string to bytes failed.');}}// If filename is a base64 data URI, parses and returns data (Buffer on node,", "readAsArrayBuffer() {\n\t\tconsole.error('UploadFS.readAsArrayBuffer is deprecated, see https://github.com/jalik/jalik-ufs#uploading-from-a-file');\n\t}", "function read(){\n\t\t\t\n\t\t\tvar deferred = $q.defer();\n\t\t\t//deferred.resolve( UtilsService.byteArrayToString(byteArray) );\n\t\t\t//deferred.reject(new Error());\n\t\t\treturn deferred.promise;\n\t\t\t\n\t\t}", "function getFileContentAsBase64(path, callback){\n window.resolveLocalFileSystemURL(path, gotFile, fail);\n\n function fail(e) {\n alert('Cannot found requested file');\n }\n\n function gotFile(fileEntry) {\n fileEntry.file(function(file) {\n var reader = new FileReader();\n reader.onloadend = function(e) {\n var content = this.result;\n callback(content);\n };\n // The most important point, use the readAsDatURL Method from the file plugin\n reader.readAsDataURL(file);\n });\n }\n}", "function fetchData(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ourFetch(genDBUrl(host, path)).then(function (response) {\n if (typeof process !== 'undefined' && !process.browser) {\n return response.buffer();\n } else {\n /* istanbul ignore next */\n return response.blob();\n }\n }).then(function (blob) {\n if (opts.binary) {\n // TODO: Can we remove this?\n if (typeof process !== 'undefined' && !process.browser) {\n blob.type = att.content_type;\n }\n return blob;\n }\n return new Promise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function readAsBinaryString(blob, callback) {\n var reader = new FileReader();\n var hasBinaryString = typeof reader.readAsBinaryString === 'function';\n reader.onloadend = function (e) {\n var result = e.target.result || '';\n if (hasBinaryString) {\n return callback(result);\n }\n callback(arrayBufferToBinaryString(result));\n };\n if (hasBinaryString) {\n reader.readAsBinaryString(blob);\n } else {\n reader.readAsArrayBuffer(blob);\n }\n }", "function decodeURI(data) {\n var byteString;\n if (data.split(',')[0].indexOf('base64') >= 0)\n byteString = atob(data.split(',')[1]);\n else\n byteString = unescape(data.split(',')[1]);\n\n // separate out the mime component\n var mimeString = data.split(',')[0].split(':')[1].split(';')[0];\n\n // Create blob to hold data\n var blob = new Blob([byteString], {type: mimeString});\n\n return blob;\n }", "function buildBlob(items, contentType)\n{\n if (contentType === undefined)\n return new Blob(items);\n return new Blob(items, {type:contentType});\n}", "function readAsBinaryString(blob, callback) {\n if (typeof FileReader === 'undefined') {\n // fix for Firefox in a web worker\n // https://bugzilla.mozilla.org/show_bug.cgi?id=901097\n return callback(arrayBufferToBinaryString(\n new FileReaderSync().readAsArrayBuffer(blob)));\n }\n\n var reader = new FileReader();\n var hasBinaryString = typeof reader.readAsBinaryString === 'function';\n reader.onloadend = function (e) {\n var result = e.target.result || '';\n if (hasBinaryString) {\n return callback(result);\n }\n callback(arrayBufferToBinaryString(result));\n };\n if (hasBinaryString) {\n reader.readAsBinaryString(blob);\n } else {\n reader.readAsArrayBuffer(blob);\n }\n }", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function sjb_is_attachment( event ) {\n var error_free = true;\n $(\".sjb-attachment\").each(function () {\n\n var element = $(\"#\" + $(this).attr(\"id\"));\n var valid = element.hasClass(\"valid\");\n var is_required_class = element.hasClass(\"sjb-not-required\"); \n\n // Set Error Indicator on Invalid Attachment\n if (!valid) {\n if (!(is_required_class && 0 === element.get(0).files.length)) {\n error_free = false;\n }\n }\n\n // Stop Form Submission\n if (!error_free) {\n event.preventDefault();\n }\n });\n\n return error_free;\n }", "function getBoundary(contentType) {\n DEBUG_LOG(\"mimeDecrypt.js: getBoundary: \"+contentType+\"\\n\");\n\n contentType = contentType.replace(/[\\r\\n]/g, \"\");\n let boundary = \"\";\n let ct = contentType.split(/;/);\n for (let i=0; i < ct.length; i++) {\n if (ct[i].search(/[ \\t]*boundary[ \\t]*=/i) >= 0) {\n boundary = ct[i];\n break;\n }\n }\n boundary = boundary.replace(/\\s*boundary\\s*=/i, \"\").replace(/[\\'\\\"]/g, \"\");\n DEBUG_LOG(\"mimeDecrypt.js: getBoundary: found '\"+ boundary+\"'\\n\");\n return boundary;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n }" ]
[ "0.6067535", "0.56576943", "0.5500187", "0.53863144", "0.529308", "0.5230164", "0.52195746", "0.5169015", "0.5137089", "0.5107119", "0.50754255", "0.506259", "0.5021915", "0.49969152", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.4987845", "0.49448523", "0.4939382", "0.49386096", "0.49368238", "0.49308124", "0.49231294", "0.48851112", "0.48768878", "0.48768878", "0.48768878", "0.48768878", "0.48768878", "0.48439237", "0.48431164", "0.48168707", "0.47951037", "0.4791286", "0.47857183", "0.4777619", "0.4777619", "0.47748193", "0.47495657", "0.47495657", "0.47495657", "0.47495657", "0.4735696", "0.47320768", "0.47306544", "0.47306544", "0.47229493", "0.47083935", "0.47058812", "0.47049123", "0.47048607", "0.47037262", "0.4698816", "0.46921292", "0.46828538", "0.46755314", "0.466362", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46484855", "0.46458554", "0.46405703", "0.4637971" ]
0.0
-1
This function runs when the file input is used to uplaod a proposal document for a opportunity
function oppAttach(event) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } if (!event.target) { var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("The FileSystem APIs are not supported in this browser.")); errArea.appendChild(divMessage); return (false); } var files = event.target.files; if (!window.FileReader) { var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("The FileSystem APIs are not supported in this browser.")); errArea.appendChild(divMessage); return (false); } if (files.length > 0) { // Get the first file. In this case, only one file can be selected but because the file input could support // multi-file selection in some browsers we still need to access the file as the 0th member of the files collection file = files[0]; // Wire up the HTML5 FileReader to read the selected file var reader = new FileReader(); reader.onload = oppFileOnload; reader.onerror = function (event) { var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Error reading file: " + event.target.error.code)); errArea.appendChild(divMessage); }; // Reading the file triggers the oppFileOnLoad function that was wired up above reader.readAsArrayBuffer(file); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newFile() {\n\teditor.reset();\n\tpathToFileBeingEdited = undefined;\n\tparse();\n}", "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId,internalReference,documentType,description,dateCreated,diffusionDate,externalReference,localization,form,status);\n //Internal Reference as Full\n } else if (projectType == \"Full\") {\n internalReference = documentType + \"-\" + padToFour(projectCode) + \"-\" + padToTwo(avenant) + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n //Internal Reference as Full Without Project \n } else {\n\n internalReference = documentType + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n }\n }", "mainLogic() {\n this.apexParser = new ApexParser(this.accessModifiers,this.sourceDirectory);\n const filesArray = this.getClassFilesFromPackageDirectories();\n\n //Create a new array of ClassModels\n const classModels = this.getClassModelsFromFiles(filesArray);\n const mapGroupNameToClassGroup = this.createMapGroupNameToClassGroup(classModels, this.sourceDirectory);\n\n const projectDetail = this.fm.parseHTMLFile(this.bannerFilePath);\n const homeContents = this.fm.parseHTMLFile(this.homefilepath);\n this.fm.createDoc(mapGroupNameToClassGroup, classModels, projectDetail, homeContents, this.hostedSourceUrl);\n console.log('ApexDoc has completed!');\n }", "function addRelatedDoc(uploadfilepath) {\n //Use filename for title of related doc\n var pathFilename = uploadfilepath.split(\"\\\\\");\n var filename = pathFilename[pathFilename.length - 1];\n\n //Save all change document properties in an object to send to post/put web service \n var properties = new Object();\n properties.Change_Record_Id = id;\n properties.DocTitle = $('#addLinkTitle').val();\n properties.DocType = $('#addLinkType').val();\n\n if (properties.DocType === \"Link\")\n properties.DocLocation = $('#addLinkValue').val();\n\n if (properties.DocType === \"File\")\n properties.DocLocation = uploadfilepath;\n\n properties.CreateDate = new Date($.now());\n\n $.ajax({\n url: 'api/data/PostChangeDocument',\n method: 'post',\n data: properties\n })\n .done(function (e) {\n getRelatedDocs();\n $('#errorInsert').hide();\n $('#errorUpdate').hide();\n $('#errorSelect').hide();\n $('#successInsert').hide();\n\n //Clear out fileupload entry\n var fileuploadclear = $('#fileUpload');\n fileuploadclear.replaceWith(fileuploadclear.clone(true));\n\n $('#success').html(\"Added related document successfully.\").fadeIn(1000);\n setTimeout\n (function () {\n $(\"#success\").fadeOut();\n }, 5000\n );\n })\n .fail(function (e) {\n $('#errorSelect').hide();\n $('#successInsert').hide();\n $('#successUpdate').hide();\n $('#errorInsert').hide();\n\n $('#error').html(\"Failed to Add Related Document.\").fadeIn(1000);\n setTimeout(function () {\n $(\"#error\").fadeOut();\n }, 5000);\n });\n}", "_onOpen(doc) {\r\n if (doc.languageId !== 'python') {\r\n return;\r\n }\r\n let params = { processId: process.pid, uri: doc.uri, requestEventType: request_1.RequestEventType.OPEN };\r\n let cb = (result) => {\r\n if (!result.succesful) {\r\n console.error(\"Lintings failed on open\");\r\n console.error(`File: ${params.uri.toString()}`);\r\n console.error(`Message: ${result.message}`);\r\n }\r\n };\r\n this._doRequest(params, cb);\r\n }", "enterFile_input(ctx) {\n\t}", "function setup() {\n var docId = DocumentApp.getActiveDocument().getId();\n var file = DriveApp.getFileById(docId);\n var folders = file.getParents();\n \n // var folder is the folder that contains the script\n while (folders.hasNext()) {\n var folder = folders.next();\n } \n \n var folderId = folder.getId();\n \n // check if archive folder created - create if not\n try {\n var archive = folder.getFoldersByName(\"Archive\").next();\n }\n catch(e) {\n var archive = folder.createFolder(\"Archive\").getId();\n }\n \n // check if today folder create - create if not\n try {\n var todayFolder = folder.getFoldersByName(\"Today\").next();\n }\n catch(e) {\n var todayFolder = folder.createFolder(\"Today\").getId();\n }\n \n // check if template file create - create if not\n try {\n var template = DriveApp.getFilesByName(\"meetingTemplate\").next();\n }\n catch(e) {\n var template = DocumentApp.create(\"meetingTemplate\");\n var templateFile = DriveApp.getFileById(template.getId());\n DriveApp.getFolderById(folderId).addFile(templateFile);\n DriveApp.getRootFolder().removeFile(templateFile)\n }\n\n // Deletes all triggers in the current project.\n var triggers = ScriptApp.getProjectTriggers();\n for (var i = 0; i < triggers.length; i++) {\n ScriptApp.deleteTrigger(triggers[i]);\n }\n \n // Creates triggers for creating and cleaning up docs\n // Runs at 1am in the timezone of the script\n ScriptApp.newTrigger(\"cleanupDocs\")\n .timeBased()\n .atHour(1)\n .everyDays(1) // Frequency is required if you are using atHour() or nearMinute()\n .create();\n\n // Runs every 10m\n ScriptApp.newTrigger(\"createDocForEvents\")\n .timeBased()\n .everyMinutes(10)\n .create();\n \n}", "function handleFileLine(originalFileName) {\n let fileName = originalFileName.toLowerCase().replace('\\\\', '/'); // Normalize the name by bringing to lower case and replacing backslashes:\n localCull = true;\n // saveThisCommentLine = false;\n let isEmpty = part.steps.length === 0 && step.isEmpty();\n\n if (isEmpty && !self.mainModel) { // First model\n self.mainModel = part.ID = fileName;\n }\n else if (isEmpty && self.mainModel && self.mainModel === part.ID) {\n console.warn(\"Special case: Main model ID change from \" + part.ID + \" to \" + fileName);\n self.mainModel = part.ID = fileName;\n }\n else { // Close model and start new as no FILE directive has been encountered:\n closeStep(false);\n\n if (!part.ID) { // No ID in main model: \n console.warn(originalFileName, 'No ID in main model - setting default ID', defaultID);\n console.dir(part); console.dir(step);\n part.ID = defaultID;\n if (!self.mainModel) {\n self.mainModel = defaultID;\n }\n }\n // if (!skipPart) {\n self.setPartType(part);\n loadedParts.push(part.ID);\n // }\n // skipPart = false;\n self.onProgress(part.ID);\n\n part = new LDRPartType();\n inHeader = true;\n part.ID = fileName;\n }\n part.name = originalFileName;\n modelDescription = null;\n }", "onChange(document) {\n if (fspath.basename(document.uri.fsPath) == \"property.json\") {\t\t\n this.refreshProperty.updateFolder(serve.opeParam.rootPath,serve.opeParam.workspacePath,document.uri.fsPath);\n this.refreshProperty.updatePrjInfo(serve.opeParam.rootPath,document.uri.fsPath);\n return;\n }\n if (!this.getHDLDocumentType(document)) {\n return;\n }\n else if (this.getHDLDocumentType(document) == 1 ) {\n this.HDLparam = this.parser.removeCurrentFileParam(document, this.HDLparam);\n this.parser.get_HDLfileparam(document, null, 0, null, this.HDLparam);\n this.parser.get_instModulePath(this.HDLparam);\n this.refresh();\n }\n }", "function UploadProcess(serverIP, fileName, dbObj) {\r\n\r\n\t// Delete the doc before insert\r\n\tDBOperationRemoveDocByNode(serverIP, fileName, dbObj);\r\n\r\n\t// Parse the doc to MongoD\r\n\tDBOperationParseETLToMongoD(serverIP, fileName, dbObj);\r\n\r\n\t//Query count\r\n\t//DBOperationFindDoc(serverIP, fileName, dbObj);\r\n}", "function importLesson() {\n\n var referer = cocoon.request.getHeader(\"referer\");\n var uploadHelper = new UploadHelper(\"/tmp\");\n var flowHelper = new FlowHelper();\n var pageEnvelope = flowHelper.getPageEnvelope(cocoon);\n var documentHelper = flowHelper.getDocumentHelper(cocoon);\n var document = pageEnvelope.getDocument();\n var publication = pageEnvelope.getPublication();\n var relativeAuthoringDirectoryPath = \"content\" + File.separator + \"authoring\";\n var authoringDirectory = new File(publication.getDirectory(), relativeAuthoringDirectoryPath);\n var documentCreator = new DocumentCreator();\n var resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);\n var lessonDOM = null;\n\n\n var languages = publication.getLanguages();\n \n cocoon.sendPageAndWait(\"upload.jx\", {\"languages\": languages});\n\n var language = cocoon.request.get(\"language\");\n\n if (cocoon.request.get(\"submit\") == \"cancel\") {\n cocoon.redirectTo(referer);\n return; \n }\n \n if (cocoon.request.get(\"upload-file\") == null) {\n /* Recurse */\n importLesson();\n } \n\n \n var file = uploadHelper.save(cocoon.request, \"upload-file\");\n var zip = new ZipFile(file);\n var entries = zip.entries();\n\n if (!entries.hasMoreElements()) {\n var msg = \"Zip archive empty\";\n cocoon.sendPage(\"error.jx\", {\"msg\" : msg}); \n return;\n }\n \n\n var parserFactory = Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance();\n parserFactory.setNamespaceAware(true);\n var domParser = parserFactory.newDocumentBuilder();\n \n var lessonDOM = null;\n\n for (entries; entries.hasMoreElements();) {\n var entry = entries.nextElement();\n\n var name = entry.getName();\n\n if (!entry.isDirectory() && name.indexOf(language) == name.indexOf(\"/\") + 1 && name.indexOf(\".xml\") == name.length() - 4) {\n\n cocoon.log.error(\"Creating lesson for language: \" + language + \"\\n\");\n\n var is = zip.getInputStream(entry);\n\n try {\n var documentDOM = domParser.parse(is);\n var documentElement = documentDOM.documentElement;\n if (documentElement.localName == \"lesson\" && documentElement.namespaceURI == 'http://www.elml.ch') {\n cocoon.log.error(\"Adding lesson to lessons\\n\");\n lessonDOM = documentDOM; \n } \n\n } catch (e) {\n cocoon.log.error(e);\n } finally {\n is.close();\n }\n }\n }\n \n \n if (!lessonDOM) {\n var msg = \"No lesson found in archive\";\n cocoon.sendPage(\"error.jx\", {\"msg\" : msg});\n return; \n }\n\n\n /* Create documents */\n\n var id = document.getId();\n var parentId = id.substring(0, id.lastIndexOf(\"/\"));\n var title = null;\n\n var documentElement = lessonDOM.documentElement;\n\n if (documentElement.hasAttribute(\"title\")) {\n title = documentElement.getAttribute(\"title\");\n } else {\n title = \"Lesson Title\";\n }\n\n if (parentId == \"\") \n var parentId = \"/\";\n\n documentCreator.create(publication, authoringDirectory, \"authoring\", parentId, id, title , \"leaf\", \"lesson\", language, true);\n \n var lessonDocument = buildDocument(id, language);\n var lessonURL = pageEnvelope.getContext() + lessonDocument.getCompleteURL();\n var sourceUri = documentHelper.getSourceUri(lessonDocument);\n var src = resolver.resolveURI(sourceUri);\n\n var existingLanguages = document.getLanguages();\n var languageExists = false;\n for (var i=0; i < existingLanguages; i++) {\n if (existingLanguages[i] == language) \n languageExists = true;\n }\n\n\n if (!languageExists && language != publication.getDefaultLanguage()) {\n var siteTree = publication.getTree(\"authoring\");\n var treeNode = siteTree.getNode(lessonDocument.getId());\n var label = new Label(title, language);\n treeNode.addLabel(label);\n } \n\n\n createAssets(zip, lessonDOM, lessonDocument); // FIXME: add assets to confirmation page\n\n var out = src.getOutputStream();\n cocoon.processPipelineTo(\"createdocument\", {\"dom\" : lessonDOM} , out); \n out.close();\n\n resolver.release(src);\n\n cocoon.releaseComponent(resolver);\n\n // Init Workflow History. FIXME: How to remove the hack\n\n\n if (!languageExists) {\n var wfSource = resolver.resolveURI(\"usecases/elml/import/content/workflow.xml\"); \n var destSource = resolver.resolveURI(\"content/workflow/history/authoring/\" + lessonDocument.getId() + \"/index_\" + language + \".xml\");\n \n var sourceUtil = Packages.org.apache.lenya.cms.cocoon.source.SourceUtil;\n sourceUtil.copy(wfSource, destSource, false);\n }\n\n cocoon.log.error(\"Lesson created\");\n\n cocoon.sendPage(\"confirmation.jx\", {\"url\" : lessonURL});\n\n\n}", "function oppFileOnload(event) {\n contents = event.target.result;\n // The storePOAsAttachment function is called to do the actual work after we have a reference to SP.RequestExecutor.js\n $.getScript(web.get_url() + \"/_layouts/15/SP.RequestExecutor.js\", storeOppAsAttachment);\n}", "function postDoc(username,fileName, fileType, doc){\n UserAccountService.postDoc(username, fileName, fileType, doc)\n .then(\n function(d) {\n vm.cancelModal();\n },\n function(errResponse){\n console.error('Error while updating doc');\n }\n );\n }", "function writeFile() {\n const ERR_MESS_WRITE = \"TODO: Trouble writing file\";\n\n todocl.dbx.filesUpload({\n contents: todocl.todoText,\n path: todocl.path,\n mode: 'overwrite',\n autorename: false,\n mute: true\n }).then(function (response) {\n\n }).catch(function (error) {\n todocl.dbx.accessToken = null;\n todocl.out.innerHTML = ERR_MESS_WRITE;\n });\n }", "onChange(updatedFile) {\n this.merge();\n }", "function main() {\n\n // Sets AsciiDoc file from url query string \n const params = new URLSearchParams(location.search);\n let aDocName = params.get('aDoc');\n if (aDocName === null || aDocName === '') {\n aDocName = 'indice';\n }\n aDoc = aDocs.find(aDoc => aDoc.name === aDocName);\n \n // Updates UI with HTML content from AsciiDoc file\n updateDocContents(aDoc);\n}", "async CreateProposal(ctx, domain, uri, author_id, message, type, originalID){\n //get amount of total proposals, for later update\n let total_proposals = await ctx.stub.getState('total_proposals');\n let valid = parseInt(total_proposals) + 1;\n //generate a new id\n let id = 'proposal'+ valid;\n //get the author\n let member = await ctx.stub.getState(author_id);\n member = JSON.parse(member);\n //get the amount of tokens this author, and charge 20 tokens as deposit of the proposal\n let tokens = member.Tokens;\n tokens = parseInt(tokens) -20;\n if (tokens < 0) {\n return ('Sorry you do not have enough tokens!');\n } else {\n member.Tokens = tokens;\n }\n //Check whether this proposal is a veto proposal\n if(type !== 'newProposal'){\n //Check whether the author is able to create a veto proposal\n let vetoPower = await this.CheckVetoProposal(ctx, type, author_id, originalID);\n console.log('*****It is a veto proposal'+vetoPower + type + author_id);\n if(vetoPower === true){\n return ('Sorry You are not able to create this veto proposal');\n }\n }\n const proposal = {\n ID: id,\n URI: uri,\n Domain: domain,\n Valid: valid.toString(),\n AuthorID: author_id,\n Proposal_Message: message,\n Creation_Date: Date(),\n State: 'open',\n Type: type,\n OriginalID: originalID,\n AcceptedVotes: 0,\n RejectedVotes: 0,\n Hash:'',\n };\n await ctx.stub.putState('total_proposals', Buffer.from(JSON.stringify(parseInt(total_proposals) + 1)));\n //the author's total proposals should increase by 1\n member.Total_Proposal = parseInt(member.Total_Proposal)+1;\n await ctx.stub.putState(author_id, Buffer.from(JSON.stringify(member)));\n //add new proposal to the world state\n await ctx.stub.putState(id, Buffer.from(JSON.stringify(proposal)));\n return ('You successfully create a proposal!');\n }", "function processDataFromDocusky() {\n\tparseDocInfo();\n\ttoolSetting();\n}", "async update(type) {\n let changelog = await read();\n changelog = parse(changelog);\n\n // Different words, phrases and text sections\n let header = \"\";\n let verb = \"\";\n let past = \"\";\n\n // Get the correct section header based on type\n switch (type) {\n case \"add\":\n header = \"Added\";\n verb = \"added\";\n past = \"additions\";\n break;\n case \"change\":\n header = \"Changed\";\n verb = \"changed\";\n past = \"changes\";\n break;\n case \"deprecate\":\n header = \"Deprecated\";\n verb = \"deprecated\";\n past = \"deprecations\";\n break;\n case \"remove\":\n header = \"Removed\";\n verb = \"removed\";\n past = \"removals\";\n break;\n case \"fix\":\n header = \"Fixed\";\n verb = \"fixed\";\n past = \"fixes\";\n break;\n case \"secure\":\n header = \"Security\";\n verb = \"secured\";\n past = \"secures\";\n break;\n }\n\n // Add unreleased header if one is not already present\n let newHeader = \"\"; // To show an additional message after creation\n if (!changelog.length) {\n changelog.unshift({\n version: \"Unreleased\",\n released: false,\n date: null,\n link: null,\n content: {}\n });\n newHeader = \"\\n# There was no content - creating new \\\"Unreleased\\\" header.\";\n } else if (changelog[0].released) {\n changelog.unshift({\n version: \"Unreleased\",\n released: false,\n date: null,\n link: null,\n content: {}\n });\n newHeader = \" - creating new \\\"Unreleased\\\" header.\";\n }\n\n // Generate update edit message\n let msg = \"\\n# Please enter what you have \" + verb + \" in this new version. Lines\\n# starting with '#' will be ignored and an empty message aborts\\n# the update. Multiple lines will be treated as multiple \" + past + \".\";\n if (changelog.length > 1) {\n msg += \"\\n# Currently on version \" + changelog[1].version;\n }\n msg += newHeader;\n msg += \"\\n#\";\n\n // Create .UPDATE_EDITMSG file with above contents and open $EDITOR\n fs.writeFile(\".UPDATE_EDITMSG\", msg, function(err) {\n if (err) {\n fatal(`Could not create temporary file in ${cwd}`);\n } else {\n editor(\".UPDATE_EDITMSG\", function(code, sig) {\n\n // Get the content from the file\n fs.readFile(\".UPDATE_EDITMSG\", \"utf8\", function(err, contents) {\n if (err) {\n fatal(`Could not read from temporary file in ${cwd}`);\n } else {\n\n // Delete/clean-up the temporary file\n fs.unlink(\".UPDATE_EDITMSG\");\n\n // Perform validation on update contents\n let lines = contents.split(\"\\n\"); // Seperate into newlines\n let items = []; // An array of the actual items to add\n for (let i = 0; i < lines.length; i++) {\n\n // Ignore lines with absolutely no content or start with \"#\"\n if (lines[i].length > 0 && lines[i].split(\" \").join(\"\").split(\"\")[0] !== \"#\") {\n items.push(lines[i]);\n }\n\n }\n\n // Abort if no content\n if (items.length === 0) {\n fatal(\"No message was supplied, so the update was aborted\");\n } else {\n\n // Make sure header exists\n if (!changelog[0].content[header]) {\n changelog[0].content[header] = [];\n }\n\n // For each update item, add it to the changelog\n for (let i = 0; i < items.length; i++) {\n changelog[0].content[header].push(items[i]);\n }\n\n // Stringify and save to file\n let data = stringify(changelog);\n fs.writeFile(\"CHANGELOG.md\", data, function(err) {\n if (err) {\n fatal(`Could not write updated ${filename}`);\n } else {\n\n // Make sure pluralisation of \"item\" is correct\n if (items.length === 1) {\n console.log(\"Added \" + items.length + \" item to \\\"\" + header + \"\\\"\");\n } else {\n console.log(\"Added \" + items.length + \" items to \\\"\" + header + \"\\\"\");\n }\n\n }\n });\n }\n }\n });\n });\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 updateFile() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes,'\\t'), err => {\n if (err) throw err;\n return true;\n });\n }", "function triggerManageDetailsPrompts(\n ev,\n fileName,\n filePath,\n textareaID1,\n textareaID2\n) {\n filePath[\"files\"][fileName][\"additional-metadata\"] = document\n .getElementById(textareaID2)\n .value.trim();\n filePath[\"files\"][fileName][\"description\"] = document\n .getElementById(textareaID1)\n .value.trim();\n // check for \"Apply to all files\"\n if (document.getElementById(\"input-add-file-metadata\").checked) {\n for (var file in filePath[\"files\"]) {\n filePath[\"files\"][file][\"additional-metadata\"] = document\n .getElementById(textareaID2)\n .value.trim();\n }\n }\n if (document.getElementById(\"input-add-file-description\").checked) {\n for (var file in filePath[\"files\"]) {\n filePath[\"files\"][file][\"description\"] = document\n .getElementById(textareaID1)\n .value.trim();\n }\n }\n // $(this).html(\"Done <i class='fas fa-check'></i>\");\n}", "function onEditDialogSave(){\r\n\t\t\r\n\t\tif(!g_codeMirror)\r\n\t\t\tthrow new Error(\"Codemirror editor not found\");\r\n\t\t\r\n\t\tvar content = g_codeMirror.getValue();\r\n\t\tvar objDialog = jQuery(\"#uc_dialog_edit_file\");\r\n\t\t\r\n\t\tvar item = objDialog.data(\"item\");\r\n\t\t\r\n\t\tvar data = {filename: item.file, path: g_activePath, pathkey: g_pathKey, content: content};\r\n\t\t\r\n\t\tg_ucAdmin.setAjaxLoaderID(\"uc_dialog_edit_file_loadersaving\");\r\n\t\tg_ucAdmin.setErrorMessageID(\"uc_dialog_edit_file_error\");\r\n\t\tg_ucAdmin.setSuccessMessageID(\"uc_dialog_edit_file_success\");\r\n\t\t\r\n\t\tassetsAjaxRequest(\"assets_save_file\", data);\r\n\t\t\r\n\t}", "function process () {\n if (!processed) {\n var editor = EditorManager.getCurrentFullEditor();\n var currentDocument = editor.document;\n var originalText = currentDocument.getText();\n var processedText = Processor.process(originalText);\n var cursorPos = editor.getCursorPos();\n var scrollPos = editor.getScrollPos();\n\n // Bail if processing was unsuccessful.\n if (processedText === false) {\n return;\n }\n\n // Replace text.\n currentDocument.setText(processedText);\n\n // Restore cursor and scroll positons.\n editor.setCursorPos(cursorPos);\n editor.setScrollPos(scrollPos.x, scrollPos.y);\n\n // Save file.\n CommandManager.execute(Commands.FILE_SAVE);\n\n // Prevent file from being processed multiple times.\n processed = true;\n } else {\n processed = false;\n }\n }", "_save() {\n let content = this.input.getContent().split(\"</div>\").join(\"\")\n .split(\"<div>\").join(\"\\n\");\n this.file.setContent(content);\n\n // create new file\n if (this.createFile)\n this.parentDirectory.addChild(this.file);\n }", "function MainScript() {\n debug('');\n audit('MainScript', '======START======');\n // processFile( // UNIQUE INSTITUTION\n // './ABAI_RAW/UNIQUE.csv',\n // 'A Spicy Boy', parseUniqueInstitution, UNIQUE_INSTITUTIONS\n // );\n processFile( // INSTITUTION\n './ABAI_RAW/unique.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n ABAI_TABLES.INSTITUTION, parseInstitution, ABAI_INSTITUTION,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbage' + '.json', JSON.stringify(ABAI_INSTITUTION) );\n processFile( // DEPARTMENT ID\n './ABAI_RAW/NetSuiteInstitution-Department.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n 'depo', parseDepo, ABAI_DEPARTMENT,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbageDepartment' + '.json', JSON.stringify(ABAI_DEPARTMENT) );\n // debug('Matched: ' + matchedInstitutions + ' : ' + unMatchedInstitutions)\n processFile( // INSTITUTION ADDRESS\n './ABAI_RAW/institution_address.csv',//abaiBatchRecord['custrecord_institueaddr_fileid'),\n ABAI_TABLES.INSTITUTION_ADDRESS, parseInstitutionAddress, ABAI_INSTITUTION_ADDRESS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageIA' + '.json', JSON.stringify(ABAI_INSTITUTION_ADDRESS) );\n processFile( // COORDINATOR\n './ABAI_RAW/coordinator.csv',//abaiBatchRecord['custrecord_coordinaor_fileid'),\n ABAI_TABLES.COORDINATOR, parseCoordinator, ABAI_COORDINATOR\n );\n file.writeFileSync('./RC_RAW/' + 'garbagecoord' + '.json', JSON.stringify(ABAI_COORDINATOR) );\n processFile( // COURSE SEQUENCE\n './ABAI_RAW/course_sequence.csv',//abaiBatchRecord['custrecord_coursesseq_fileid'),\n ABAI_TABLES.COURSE_SEQUENCE, parseCourseSequence, ABAI_COURSE_SEQUENCE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCS' + '.json', JSON.stringify(ABAI_COURSE_SEQUENCE) );\n processFile( // COURSE\n './ABAI_RAW/course.csv',//abaiBatchRecord['custrecord_course_fileid'),\n ABAI_TABLES.COURSE, parseCourse, ABAI_COURSE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCourse' + '.json', JSON.stringify(ABAI_COURSE) );\n processFile( // AP WAIVER\n './ABAI_RAW/ap_waiver.csv', //abaiBatchRecord['custrecord_apwaiver_fileid'),\n ABAI_TABLES.APWAIVER, parseApWaiver, ABAI_AP_WAIVER\n );\n file.writeFileSync('./RC_RAW/' + 'garbageWaiver' + '.json', JSON.stringify(ABAI_AP_WAIVER) );\n processFile( // INSTRUCTOR GROUP\n './ABAI_RAW/instructor_group.csv',//abaiBatchRecord['custrecord_instructorgrp_fileid'),\n ABAI_TABLES.INSTRUCTOR_GROUP, parseInstructor, ABAI_INSTRUCTOR\n );\n processFile( // COURSE SEQUENCE ASSIGNMENT\n './ABAI_RAW/course_sequence_course_assignment.csv',//abaiBatchRecord['custrecord_courseseq_crsass_fileid'),\n ABAI_TABLES.COURSE_ASSIGNEMNT, parseAssignment, ABAI_ASSIGNMENT\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA' + '.json', JSON.stringify(ABAI_ASSIGNMENT) );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA2' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence) );\n processFile( // ALT COURSE ID\n './ABAI_RAW/alternative_courseID.csv', //abaiBatchRecord['custrecord_alt_courseid_fileid'),\n ABAI_TABLES.ALT_COURSE_ID, parseAltCourseId, ABAI_ALT_ID\n );\n file.writeFileSync('./RC_RAW/' + 'altCourse' + '.json', JSON.stringify(ABAI_ALT_ID) );\n processFile( // CONTENT HOURS\n './ABAI_RAW/content_hours.csv',//abaiBatchRecord['custrecord_cont_hours_fileid'),\n ABAI_TABLES.CONTENT_HOURS, parseContentHours, ABAI_CONTENT_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'CHGarbage' + '.json', JSON.stringify(ABAI_CONTENT_HOURS) );\n processFile( // ALLOCATION HOURS\n './ABAI_RAW/content_area_hours_allocation.csv', //abaiBatchRecord['custrecord_cont_hsallocat_fileid'),\n ABAI_TABLES.ALLOCATION, parseAllocation, ABAI_ALLOCATION_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageAllocation' + '.json', JSON.stringify(ABAI_ALLOCATION_HOURS) );\n audit('MainScript', 'FILE LOAD COMPLETE');\n file.writeFileSync('./RC_RAW/' + 'xref_sequence' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence));\n\n\n audit('MainScript', '=======END=======');\n}", "function uploadSavedataPending(file) {\n runCommands.push(function () { \n gba.loadSavedataFromFile(file) \n });\n }", "function processFileHTML(doc){\n // parse out into blocks\n // re-assemble with new paragraph numbering\n // add style sheet\n // move assets to the assets folder\n return doc;\n}", "function postProcess() {\r\n for (var key in _opf.manifest) {\r\n var mediaType = _opf.manifest[key][\"media-type\"];\r\n var href = _opf.manifest[key][\"href\"];\r\n var result = '';\r\n\r\n if (mediaType === \"text/css\") {\r\n result = postProcessCSS(href);\r\n } else if (mediaType === \"application/xhtml+xml\") {\r\n result = postProcessHTML(href);\r\n }\r\n //only change the current file stored in _files if result is defined.\r\n if (result) {\r\n _files[href] = result;\r\n }\r\n }\r\n publish(EVENT.BOOKDATA_READY, STATE.OK, MSG.INIT_EBOOK_READER);\r\n }", "function changeFilename_() {\n var doc = DocumentApp.openById(Config.get('CLASSES_AND_GROUPS_DOCUMENT_ID'));\n var docTitle = doc.getName();\n var dateOnPresentDoc = getDateTimeFromDocTitle_(docTitle);\n \n var ss = SpreadsheetApp.openById(Config.get('PROMOTION_DEADLINES_CALENDAR_ID'));\n var sheet = ss.getSheetByName('Communications Director Master');\n var ranges = sheet.getRangeList(['D4:D', 'E4:E']).getRanges();\n var dates = ranges[0].getValues();\n var titles = ranges[1].getValues();\n \n var foundNewDoc = false;\n \n for (var i = 0; i < titles.length; i++) {\n \n var nextTitle = String(titles[i][0]).trim();\n var date = dates[i][0];\n \n // Look at future date for the new C&G GDoc\n \n if (date > dateOnPresentDoc && \n nextTitle.indexOf('Christ Church Communities (C3)') !== -1 && \n nextTitle.indexOf('Classes + Groups') !== -1) {\n var timeZone = Session.getScriptTimeZone();\n var dateTitle = Utilities.formatDate(date, timeZone, '[ yyyy.MM.dd ]');\n \n // [ 2020.01.05 ] Christ Church Communities (C3) Winter Classes + Groups_Booklet\n \n var newTitle = \n dateTitle + ' ' + \n 'Christ Church Communities (C3) ' + \n getSeason(date.getMonth()) + ' ' + // zero-index\n 'Classes + Groups_Booklet';\n \n doc.setName(newTitle);\n Log_.info('Renamed GDoc to \"' + newTitle + '\"');\n \n createChangeFilenameTrigger_(\n date.getYear(), \n date.getMonth() + 1, \n date.getDate());\n \n foundNewDoc = true;\n }\n \n } // for each row in PDC\n \n if (!foundNewDoc) { \n \n // Look again tomorrow\n var today = new Date();\n \n createChangeFilenameTrigger_(\n today.getYear(), \n today.getMonth() + 1, \n today.getDate() + 1);\n }\n \n return;\n \n // Private Functions\n // -----------------\n \n function getSeason(month) {\n var season;\n \n if (month === 11) {\n season = 'Winter';\n } else if (month >= 0 && month < 2) {\n season = 'Winter'; \n } else if (month >= 2 && month < 5) {\n season = 'Spring';\n } else if (month >= 5 && month < 8) {\n season = 'Summer';\n } else if (month >= 8 && month < 11) {\n season = 'Fall';\n } else {\n throw new Error('Invalid month: ' + month);\n }\n\n return season;\n \n } // changeFilename_.getSeason()\n \n}", "function recordInDB_file_deleted(file) {\n if (file.search(\"select-27.csv\") == -1) return;\n MongoClient.connect(DB_CONN_STR, {useNewUrlParser: true, useUnifiedTopology: true}, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO DELETE WHOLE FILE LINES\");\n var dbo = db.db(\"sap-cx\");\n var collection = dbo.collection(\"CCv2LongRunningDeployment\");\n collection.updateMany({ChangedFile: file, DeleteTime: \"/\", ChangeType: {$ne: \"Delete\"}}, {\n $set: {\n DeleteTime: Date(),\n ChangeType: \"Delete\"\n }\n }, function (err, res) {\n if (err) console.log(err);\n console.log(res.result.nModified + \"Documents Updated.\\n\");\n });\n db.close();\n });\n readFileToArr('./modelt-az-report-repository/' + file, function (file_content) {\n //console.log(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 file_content.forEach(function (file_content_i) {\n //console.log(file_content[i].length);\n //if(file_content_i != file_content[0] && file_content_i.length == file_content[0].length) {\n if (file_content_i != file_content[0] && file_content_i.length == file_content[0].length && file_content_i[0] != \"-----------\") {\n const link = getModelTLink(file, file_content_i[6]);\n updated_file_content = updated_file_content + \"-\" + file_content_i.join(',') + \"\\n\" + link + \"\\n\";\n }\n });\n // send notification email\n sendNotificationEmail(file, 1, updated_file_content)\n });\n}", "static async initializeProposals(data) {\n\n let folder = false;\n let config = DappLib.getConfig();\n\n config.ipfs = {\n host: 'ipfs.infura.io',\n protocol: 'https',\n port: 5001\n }\n\n // Push files to IPFS\n let ipfsResult = await DappLib.ipfsUpload(config, data.files, folder, (bytes) => {\n console.log(bytes);\n });\n\n let proposals = [];\n for (let f = 0; f < ipfsResult.length; f++) {\n let file = ipfsResult[f];\n console.log('IPFS file', file);\n proposals.push(file.cid.string);\n }\n\n let result = await Blockchain.post({\n config: config,\n roles: {\n proposer: data.admin,\n }\n },\n 'ballot_initialize_proposals',\n {\n proposals: { value: proposals, type: t.Array(t.String) }\n }\n );\n return {\n type: DappLib.DAPP_RESULT_TX_HASH,\n label: 'Transaction Hash',\n result: result.callData.transactionId\n }\n\n }", "function parse_interaction_file(file)\n{\n modal.style.display = \"block\";\n span.onclick = function() {\n modal.style.display = \"none\";\n div.children[0].remove();\n }; \n \n var methods = returnMethods();\n var membranes = returnMembranes();\n var refs = returnRefs();\n \n var size = (file.length); \n \n var table = document.createElement(\"table\");\n\n form.setAttribute(\"method\", \"post\"); \n form.setAttribute(\"enctype\",\"multipart/form-data\");\n \n table.setAttribute(\"class\", \"dataParser\");\n \n var count = file[0].length;\n var tr = document.createElement(\"tr\");\n tr.setAttribute(\"class\", \"types\");\n var types = [\"Don't use\", \"Name\", \"Primary_reference\", \"Note\", \"Q\", \"X_min\", \"X_min_acc\", \"G_pen\", \"G_pen_acc\", \"G_wat\", \"G_wat_acc\", \"LogK\", \"LogK_acc\", \"LogP\", \"LogPerm\", \"LogPerm_acc\"\n ,\"theta\", \"theta_acc\", \"abs_wl\", \"abs_wl_acc\", \"fluo_wl\", \"fluo_wl_acc\", \"QY\", \"QY_acc\", \"lt\", \"lt_acc\", \"MW\", \"SMILES\", \"DrugBank_ID\", \"PubChem_ID\", \"PDB_ID\", \"Area\", \"Volume\"];\n \n for(var i=0; i<count; i++){\n var td = document.createElement(\"td\");\n var select = document.createElement(\"select\");\n select.setAttribute(\"class\", \"form-control attr-chooser\");\n select.setAttribute(\"required\", \"true\");\n \n for(var j=0; j<types.length; j++){\n var option = document.createElement(\"option\");\n if(j == 0)\n option.value = \"\";\n else\n option.value = types[j];\n \n option.innerHTML = types[j];\n select.appendChild(option);\n }\n td.appendChild(select);\n tr.appendChild(td);\n }\n table.appendChild(tr);\n \n \n for(i=0; i<size; i++){\n tr = document.createElement(\"tr\");\n var input = document.createElement(\"input\"); \n \n if(i==0)\n tr.setAttribute(\"class\", \"head\");\n for(j=0; j<count; j++){\n var td = document.createElement(\"td\");\n var input = document.createElement(\"input\");\n input.setAttribute(\"class\", \"form-control\");\n input.setAttribute(\"name\", \"row_\" + i + \"[]\");\n if(i == 0 || j != 0){\n input.setAttribute(\"readonly\", \"true\");\n if (i==0)\n input.setAttribute(\"style\", \"cursor: pointer;\");\n }\n \n input.value = file[i][j];\n\n td.appendChild(input);\n tr.appendChild(td);\n }\n table.appendChild(tr);\n }\n \n var input = document.createElement(\"input\");\n input.setAttribute(\"value\", \"save_dataset\");\n input.setAttribute(\"name\", \"postType\");\n input.setAttribute(\"hidden\", \"true\");\n form.appendChild(input);\n form.appendChild(table);\n \n var label = document.createElement(\"label\");\n label.innerHTML = \"Temperature [°C]\";\n \n input = document.createElement(\"input\");\n input.setAttribute(\"value\", \"25\");\n input.setAttribute(\"name\", \"temp\");\n input.setAttribute(\"class\", \"form-control, parserInput\");\n input.setAttribute(\"required\", \"true\");\n \n var button = document.createElement(\"button\");\n button.setAttribute(\"type\", \"button\");\n button.setAttribute(\"class\", \"btn btn-sm btn-success pull-right\");\n button.setAttribute(\"style\", \"margin: 5px 0px;\");\n button.setAttribute(\"onclick\", \"submit_datafile()\");\n button.innerHTML = \"Save\";\n \n var rowCount = document.createElement(\"input\"); rowCount.setAttribute(\"hidden\", \"true\"); rowCount.value = size; rowCount.setAttribute(\"name\", \"rowCount\");\n rowCount.setAttribute(\"id\", \"rowCount\");\n var colCount = document.createElement(\"input\"); colCount.setAttribute(\"hidden\", \"true\"); colCount.value = count; colCount.setAttribute(\"name\", \"colCount\");\n \n form.appendChild(rowCount);\n form.appendChild(colCount);\n \n form.appendChild(label);\n form.appendChild(input);\n form.appendChild(refs);\n form.appendChild(membranes);\n form.appendChild(methods);\n form.appendChild(button);\n div.appendChild(form);\n}", "function updateProposalFormat(req, res) {\n\n if (!mongoose.Types.ObjectId.isValid(req.body.configId)) {\n res.json({ code: Constant.ERROR_CODE, message: Constant.INVALID_OBJECT });\n } else if( !req.body.totalConfig || !req.body.columnsConfig ) {\n res.json({ code: Constant.ERROR_CODE, message: Constant.REQUIRED_FILED_MISSING });\n } else if( req.body.totalConfig.length === 0 || req.body.columnsConfig.length === 0 ) {\n res.json({ code: Constant.ERROR_CODE, message: Constant.REQUIRE_FILED_CONFIGURATION });\n } else {\n if (req.body.configId) {\n proposalConfig.findByIdAndUpdate(req.body.configId, req.body, function (err, formatData) {\n if (err) {\n res.json({ code: Constant.ERROR_CODE, message: err });\n }\n else {\n res.json({ code: Constant.SUCCESS_CODE, message: Constant.FORMAT_UPDATE_SUCCESS, data: formatData });\n }\n\n });\n }\n else {\n res.json({ code: Constant.ERROR_CODE, message: Constant.REQUIRED_FILED_MISSING });\n }\n }\n}", "afterImport(){\n // this.transitionTo('app.dashboard.editor', this.get('currentModel').targetDocument);\n let doc = this.get('currentModel').targetDocument;\n // console.log(doc);\n let docID = doc.get('id'); \n // console.log(docID);\n this.transitionTo('app.documents.editor', docID);\n }", "static async update(\n viewer: ViewerShape,\n data: ProposalInputArgs,\n loaders: DataLoaders,\n ) {\n // throw Error('TESTERROR');\n\n if (!data || !data.id) return null;\n const proposalInDB = await Proposal.gen(viewer, data.id, loaders);\n if (!proposalInDB) return null;\n let workTeam;\n if (proposalInDB.workTeamId) {\n workTeam = await WorkTeam.gen(viewer, proposalInDB.workTeamId, loaders);\n }\n // authorize\n if (!canMutate(viewer, { ...data, workTeam }, Models.PROPOSAL)) return null;\n // validate\n\n const newValues: ProposalRowType = { updated_at: new Date() };\n\n const [updatedProposal = null] = await knex.transaction(async trx => {\n const activePoll = await proposalInDB.getActivePoll(viewer, loaders);\n if (!activePoll) {\n throw new Error('Could no load poll');\n }\n if (data.state) {\n const helper = new StateTransitionHelper({\n viewer,\n newState: data.state,\n trx,\n loaders,\n activePoll,\n });\n\n if (helper.canTransition(proposalInDB)) {\n await helper.closeOpenPolls(proposalInDB);\n\n if (proposalInDB.isNewPollRequired(data.state)) {\n const pollTwo = await helper.createNextPoll(data.poll);\n newValues.poll_two_id = pollTwo.id;\n }\n\n newValues.state = data.state;\n } else {\n throw new Error(\n `State transition not allowed from ${proposalInDB.state} to ${\n data.state\n }`,\n );\n }\n }\n\n if (proposalInDB.isSurveyAndShouldClose(data.poll)) {\n await closePoll(viewer, activePoll.id, loaders, trx);\n }\n return knex('proposals')\n .transacting(trx)\n .where({\n id: data.id,\n })\n .update(newValues)\n .returning('*');\n });\n\n const proposal = updatedProposal && new Proposal(updatedProposal);\n if (proposal) {\n EventManager.publish('onProposalUpdated', {\n viewer,\n proposal,\n ...(newValues.state && { info: { newState: newValues.state } }),\n ...(data.workTeamId && { groupId: data.workTeamId }),\n subjectId: data.workTeamId,\n });\n }\n return proposal;\n }", "function postUploadCleanup(file) {\n //update the datasource dropdown list to reflect the new datasource\n var item = { username: localStorage.user.username, filename: file.name, columns: []};\n self.datasourceList.data.push(item);\n // parse a sample of the file and show it as table\n parsePartialFile(file);\n // call factory method to update the file metadata\n homeService.parsePartialFile(file);\n }", "function handleNewClick() {\n const newDoc = stubNewDocument()\n addUpdate(newDoc)\n appendToExtendedData([newDoc])\n }", "enterFile(ctx) {\n\t}", "function handlePOObject(filename, po) {\n // Remove previous results\n $(\"#results\").empty();\n // Go through PO file and try to auto-translate untranslated strings.\n let newPO = handleTranslations(po);\n let autoTranslatedCount = newPO.translations[''].length;\n $(\"#progressMsg\").text(`Auto-translated ${autoTranslatedCount} strings`)\n // Export to new PO\n downloadFile(new POExporter(newPO).compile(),\n filename + \".translated.po\",\n 'text/x-gettext-translation')\n}", "function fillInfoIntoFileObject() { $('#uploadBtn1').attr('name', $('#popUpNet_value').val() + \"|\" + $('#popUpComment').val() + \"|\" + pressedButton + \"|\" + $('#btnApproveWithdraw').attr('order_type') + \"|\" + $('#btnApproveWithdraw').attr('order_id')); }", "function editorUploadFile(file) {\n if (!file) return;\n const reader = new FileReader();\n reader.addEventListener('load', (event) => {\n console.log('File loaded');\n const json = event.target.result;\n try {\n mapBlueprint = JSON.parse(json);\n storageSaveMap();\n edDoUpdate = true; // This will trigger update next turn\n } catch (err) {\n alert('Failed to open file. Maybe wrong json format?')\n return;\n }\n });\n reader.readAsText(file);\n}", "function performImport() {\n // Gets the folder in Drive associated with this application.\n const folder = getFolderByName_(PROJECT_FOLDER_NAME);\n // Gets the Google Docs files found in the folder. \n const files = getFiles(folder);\n\n // Warns the user if the folder is empty.\n const ui = DocumentApp.getUi();\n if (files.length === 0) {\n const msg =\n `No files found in the folder '${PROJECT_FOLDER_NAME}'.\n Run '${MENU.SETUP}' | '${MENU.SAMPLES}' from the menu\n if you'd like to create samples files.`\n ui.alert(APP_TITLE, msg, ui.ButtonSet.OK);\n return;\n }\n\n /** Processes main document */\n // Gets the active document and body section.\n const docTarget = DocumentApp.getActiveDocument();\n const docTargetBody = docTarget.getBody();\n\n // Appends import summary section to the end of the target document. \n // Adds a horizontal line and a header with today's date and a title string.\n docTargetBody.appendHorizontalRule();\n const dateString = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), 'MMMM dd, yyyy');\n const headingText = `Imported: ${dateString}`;\n docTargetBody.appendParagraph(headingText).setHeading(APP_STYLE);\n // Appends a blank paragraph for spacing.\n docTargetBody.appendParagraph(\" \");\n\n /** Process source documents */\n // Iterates through each source document in the folder.\n // Copies and pastes new updates to the main document.\n let noContentList = [];\n let numUpdates = 0;\n for (let id of files) {\n\n // Opens source document; get info and body.\n const docOpen = DocumentApp.openById(id);\n const docName = docOpen.getName();\n const docHtml = docOpen.getUrl();\n const docBody = docOpen.getBody();\n\n // Gets summary content from document and returns as object {content:content}\n const content = getContent(docBody);\n\n // Logs if document doesn't contain content to be imported.\n if (!content) {\n noContentList.push(docName);\n continue;\n }\n else {\n numUpdates++\n // Inserts content into the main document.\n // Appends a title/url reference link back to source document.\n docTargetBody.appendParagraph('').appendText(`${docName}`).setLinkUrl(docHtml);\n // Appends a single-cell table and pastes the content.\n docTargetBody.appendTable(content);\n }\n docOpen.saveAndClose()\n }\n /** Provides an import summary */\n docTarget.saveAndClose();\n let msg = `Number of documents updated: ${numUpdates}`\n if (noContentList.length != 0) {\n msg += `\\n\\nThe following documents had no updates:`\n for (let file of noContentList) {\n msg += `\\n ${file}`;\n }\n }\n ui.alert(APP_TITLE, msg, ui.ButtonSet.OK);\n}", "SaveAndReimport() {}", "function approveLetter()\n\t{\n\t\t\n\t\t\n\t\tvar editor2 = CKEDITOR.instances['editor2'].getData();\t\n\t\n\t \n\t\t$(\"#lettercontentAp\").val(editor2);\n\t\t$(\"#approveletterfromfile\").submit();\n\t\t\n\t}", "formatPopulate(file, data, dir) {\n\n\t\tlet fileData = fs.readFileSync(`${appRoot}/base-template/${file}`, 'utf8');\n\t\tlet processedData = this.format(fileData, data);\n\n\n\t\t// Create individual folders for specific js files.\n if (this.isStatic()) {\n switch(file) {\n case 'static.js':\n fs.writeFileSync(`${dir}/${Static}/${file}`, processedData, 'utf8');\n break;\n case 'index.html':\n case 'overwrite.scss':\n case 'image-paths.js':\n for (var version in versions) {\n if(versions.hasOwnProperty(version)) {\n fs.writeFileSync(`${dir}/${Static}/${versions[version]}/${file}`, processedData, 'utf8');\n }\n }\n break;\n case 'main.js':\n fs.writeFileSync(`${dir}/${file}`, processedData, 'utf8');\n break;\n default:\n //console.log(\"Unknown file\");\n }\n }\n if (this.DoubleClick) {\n switch(file) {\n case 'index.html':\n case 'overwrite.scss':\n case 'doubleclick.js':\n fs.writeFileSync(`${dir}/${DoubleClick}/${file}`, processedData, 'utf8');\n break;\n case 'main.js':\n fs.writeFileSync(`${dir}/${file}`, processedData, 'utf8');\n break;\n default:\n //console.log(\"Unknown file\");\n }\n }\n\t}", "_updateJSON(filename) {\n return __awaiter(this, void 0, void 0, function* () {\n //dbnames have to be lowercase and start with letters\n let dbname = \"couch\" + filename.toLowerCase().split(\".\")[0];\n let githash = yield Git_1.default.getFileHash(path.join(this.localRepoPath, \"/data/\", filename), this.localRepoPath);\n let inCouch = yield this._isInCouch(dbname, this.EVENT_METADATA_ID);\n let outOfDate;\n if (inCouch) {\n outOfDate = yield this._isOutofDate(dbname, this.EVENT_METADATA_ID, githash);\n }\n if (!inCouch || outOfDate) {\n let data = yield readFile(path.join(this.localRepoPath, \"/data/\", filename), \"utf8\");\n let json = JSON.parse(data.replace(/&quot;/g, '\\\\\"'));\n json[\"githash\"] = githash;\n let eventProccesor = new EventParser_1.default(json);\n if (eventProccesor.error)\n throw new Error(\"Event for \" + dbname + \" had error parsing event\");\n if (!inCouch)\n yield this._insertEvent(dbname, eventProccesor.parsedEvent);\n if (outOfDate)\n yield this._updateEvent(dbname, eventProccesor.parsedEvent);\n }\n });\n }", "async function processPost(){\n\n const src_post = `${src_dir}/post`;\n\n let file_list = getAllPugFiles(src_post);\n // check if there are even files to be read in first place.\n let no_more_files_to_add = file_list.length == 0;\n let files_remaining_to_parse = file_list.length;\n let aFileLessToParse = ()=>{files_remaining_to_parse-=1;}\n\n file_list.forEach( (file, index) =>{\n parseFileMetaTags( file, aFileLessToParse );\n no_more_files_to_add = index == file_list.length-1;\n });\n \n // for some reason when building with parcel, it continues\n // even before the first file is added, this line avoids it.\n await until(()=>(no_more_files_to_add)); \n \n await until(()=>(files_remaining_to_parse==0));\n\n // edit all the files that need to be published\n post_to_publish.forEach( key=> publishPost(key) );\n await until(()=>(post_to_publish.length==0));\n\n writeCatalogJS(src_post, post_catalog);\n}", "function uploadFile() {\n\t// name of the paper\n\tname = $F('papername');\n\t// allowable: letters, numbers, underscore, space\n\tpattern = /^(\\w|_)+$/;\n\t// if the filename is allowable\n\tif (name.match(pattern)) {\n\t\t// DEBUG\n\t\t$('filecheck').innerHTML = name;\n\t\tif (!$('a' + name) && !$('li' + name)) {\n\t\t\t// gets the text of the file out of the file object\n\t\t\t// *NOTE*: only works in Firefox 3 currently\n\t\t\tfile = $('paperfile').files.item(0).getAsText(\"\");\n\t\t\t// resets the form so that the same paper could be\n\t\t\t// immediately uploaded with a different name\n\t\t\t$('paperupload').reset();\n\t\t\t// XHR action: to add the paper\n\t\t\t// papername contains the name of the file to be added\n\t\t\t// paperfile contains the contents of the file as text\n\t\t\tnew Ajax.Request('ART', {\n\t\t\t\tmethod :'post',\n\t\t\t\tparameters : {\n\t\t\t\t\taction :'addpaper',\n\t\t\t\t\tpapername :name,\n\t\t\t\t\tpaperfile :file\n\t\t\t\t},\n\t\t\t\t// response goes to populateLinks()\n\t\t\t\tonComplete :populateLinks\n\t\t\t});\n\t\t\t// get here if name is already taken\n\t\t} else {\n\t\t\talert('This name is already taken -- choose a different name, or click delete on the existing file');\n\t\t}\n\t\t// get here if the filename contained disallowed characters\n\t} else {\n\t\talert('Please use only letters, numbers and underscores in filenames.')\n\t\t// DEBUG -- make this a more user friendly message\n\t\t// $('filecheck').innerHTML = name + ' was rejected';\n\t\t$('paperupload').reset();\n\t}\n}", "function winnerAdding() {\n\nvar docid = winnerPersonId;\nvar winnerMailId = document.getElementById('winneremailsid').value;\n//console.log(winnerMailId);\n//console.log(docid);\n notificatiions({\n messages: 'Updating Database',\n });\n// console.log(className);\n// note that this whole object is push to the database as a map and replace existing data by this map\n // this is where editted data take in just like the writeData object\n console.log(weeklyChallenegs_data_saver);\n for (var i = 0; i < weeklyChallenegs_data_saver.length; i++) {\n if (weeklyChallenegs_data_saver[i].id == docid) {\n // console.log(weeklyChallenegs_data_saver[i].data.inputsDatas.name);\n var inputsDatas= {\n name: weeklyChallenegs_data_saver[i].data.inputsDatas.name,\n desc: weeklyChallenegs_data_saver[i].data.inputsDatas.desc,\n winnerStatus: '1',\n status: '0',\n winnersMail: winnerMailId,\n imgUrl: weeklyChallenegs_data_saver[i].data.inputsDatas.imgUrl,\n rules: weeklyChallenegs_data_saver[i].data.inputsDatas.rules,\n };\n }\n }\n\n // this function also have future functions\n console.log(inputsDatas);\n editDatas({\n inputsDatas : inputsDatas,\n documents : docid,\n collection : 'SpecialEvents',\n }).then((promisedData) =>{\n // Reloading page when update function is done\n console.log(\"insd\");\n window.location.href = \"specialEvents.html\";\n })\n}", "async Init_Ledger(ctx) {\n const proposals =[\n {\n ID: 'proposal1',\n URI: 'http://localhost:3006/v1',\n Domain: 'manufacturing',\n Valid: '1',\n AuthorID: 'member1',\n Proposal_Message: 'Add a new use case in the ontology Manufacture, the use case called Danobat',\n Creation_Date: '20201023',\n State: 'ongoing',\n Type: 'newProposal',\n OriginalID: '',\n AcceptedVotes: 0,\n RejectedVotes: 0,\n Hash: 'https://ipfs.io/ipfs/QmSWDa85q8FQzB8qAnuoxZ4LDoXoWKmD6t4sPszdq5FiW2?filename=test.owl',\n },\n {\n ID: 'proposal2',\n URI: 'http://localhost:3006/v2',\n Domain: 'manufacturing',\n Valid: '2',\n AuthorID: 'member2',\n Proposal_Message: 'Add a new use case 2',\n Creation_Date: '20201030',\n State: 'open',\n Type: 'vetoProposal',\n OriginalID: 'http://localhost:3006/v1',\n AcceptedVotes: 0,\n RejectedVotes: 0,\n Hash: '',\n },\n ];\n for(const proposal of proposals){\n proposal.docType = 'proposal';\n await ctx.stub.putState(proposal.ID, Buffer.from(JSON.stringify(proposal)));\n let indexName = 'proposal-order';\n let ProposalOrderKey = ctx.stub.createCompositeKey(indexName, [proposal.Valid, proposal.ID]);\n await ctx.stub.putState(ProposalOrderKey, null);\n console.info(`Proposal ${proposal.ID} initialized`);\n }\n //time is used for the count-down of the ongoing proposal\n //Every time we check whether (current time - time) < (valid time for each proposal),\n // if no the current ongoing proposal will be closed\n const time = Date();\n await ctx.stub.putState('time', Buffer.from(JSON.stringify(time)));\n //A closed proposal will be stored in this object. Its ID will change from 'proposalX' to 'closedproposalX'\n const closedProposals = [\n {\n ID: 'closedproposal20',\n State: 'accepted',\n EndDate: Date(),\n Veto: false\n },\n {\n ID: 'closedproposal22',\n State: 'rejected',\n EndDate: Date(),\n Veto: false\n },\n {\n ID: 'closedproposal23',\n State: 'empty',\n EndDate: Date(),\n Veto: false\n }\n ];\n for(const closedProposal of closedProposals){\n closedProposal.docType = 'closedProposal';\n await ctx.stub.putState(closedProposal.ID, Buffer.from(JSON.stringify(closedProposal)));\n console.info(`AcceptedProposal ${closedProposal.ID} initialized`);\n }\n const members = [\n {\n ID: 'member1',\n Name: 'Luo',\n Email: '[email protected]',\n Role: 'Expert',\n Domain: 'Manufacturing',\n Tokens: 210,\n Total_Proposal: 0,\n Total_Accepted_Proposal: 0\n },\n {\n ID: 'member2',\n Name: 'Lan',\n Email: '[email protected]',\n Role: 'Lobe_Owner',\n Domain: 'Manufacturing',\n Tokens: 200,\n Total_Proposal: 0,\n Total_Accepted_Proposal: 0\n },\n {\n ID: 'member3',\n Name: 'Lun',\n Email: '[email protected]',\n Role: 'Expert',\n Domain: 'Manufacturing',\n Tokens: 300,\n Total_Proposal: 0,\n Total_Accepted_Proposal: 0\n }\n ];\n for(const member of members){\n member.docType = 'member';\n await ctx.stub.putState(member.ID, Buffer.from(JSON.stringify(member)));\n console.info(`Member ${member.ID} initialized`);\n }\n await ctx.stub.putState('members', Buffer.from(JSON.stringify(members)));\n //acceptVoter1 stands for voters who vote for proposal 1 as accptance\n //this array helps to record members votes and later reward them\n const acceptVoter1 = [\n {\n ID: 'member3',\n Message: 'Test'\n }\n ];\n await ctx.stub.putState('acceptVoter1', Buffer.from(JSON.stringify(acceptVoter1)));\n //Similar to acceptVoter\n const rejectVoter1 = [\n {\n ID: 'member3',\n Message: ''\n }\n ];\n await ctx.stub.putState('rejectVoter1', Buffer.from(JSON.stringify(rejectVoter1)));\n //record the current obe owner in a lobe\n const domainLobeOwners = [\n {\n ID: 'Manufacturing',\n LobeOwner: 'member2',\n Tokens: 200\n }\n ];\n for(const domain of domainLobeOwners){\n domain.docType = 'domain';\n await ctx.stub.putState(domain.ID, Buffer.from(JSON.stringify(domain)));\n console.info(`Member ${domain.ID} initialized`);\n }\n const total_members = 3;\n await ctx.stub.putState('total_members', Buffer.from(JSON.stringify(total_members)));\n const total_proposals = 3;\n await ctx.stub.putState('total_proposals', Buffer.from(JSON.stringify(total_proposals)));\n const ongoingProposal = 1;\n await ctx.stub.putState('ongoingProposal', Buffer.from(JSON.stringify(ongoingProposal)));\n const latestDR = 'http://localhost:3006/v0';\n await ctx.stub.putState('latestDR', Buffer.from(JSON.stringify(latestDR)));\n const fileHash = 'https://ipfs.io/ipfs/QmSWDa85q8FQzB8qAnuoxZ4LDoXoWKmD6t4sPszdq5FiW2?filename=test.owl';\n await ctx.stub.putState('fileHash', Buffer.from(JSON.stringify(fileHash)));\n }", "function _submit() {\n let type = dialog.typeSelected;\n let content = dialog.annotations[type];\n\n // Pigrizia...\n if (type === 'denotesRhetoric') {\n content.rhetoric = _expandRhetoricURI(content.rhetoric);\n }\n\n content.type = type;\n dialog.provenance.time = new Date(); // Vogliamo l'ora aggiornata\n content.provenance = dialog.provenance;\n content.fragment = dialog.fragment;\n content.url = model.docUrl;\n content.subject = dialog.subject;\n let newAnno = newAnnotationService.generateAnnotation(content);\n newAnnotationService.saveLocal(newAnno);\n $mdToast.showSimple('Annotazione modificata.');\n $mdDialog.hide();\n }", "function handleFileSave() {\n if(isStorytellerCurrentlyActive) {\n //a file save happened, let the project manager know\n projectManager.saveTextFileState();\n }\n}", "function UpdatePouchDB() {\n console.log('updating pouchdb using google drive data');\n startUpdatingUI();\n }", "static uploadPoPFile() {\n return `purchase/payment-methods/regular-eft/payment-proof/upload`\n }", "function InFile() {\r\n}", "function process_importConfigurationFromAnotherFileActiveTab(documentId, sheetName) {\n\n /* Before loading */\n processStep_resetProcess();\n\n processStep_importConfigurationFromAnotherFileActiveTab(documentId, sheetName); \n\n /* After loading */\n processStep_completeProcess();\n}", "function AddOrgAttach(curDoc,templateFilename){\n var newomOrgAttach = objCommon.InputBox(\"org 文件名\", \"请输入需要添加的 org 附件的文件名(可包含或不包含 .org 后缀,但必须为 Windows 文件名允许的字符串):\", \"default\");\n if(MFGetFileExtension(newomOrgAttach).toLowerCase() !== '.org'){\n newomOrgAttach = newomOrgAttach + \".org\";\n }\n else{\n newomOrgAttach = newomOrgAttach;\n }\n\n var templateFileRelativePath = \"Templates/\";\n var TemplateFile = org_mode_pluginPath + templateFileRelativePath + templateFilename;\n var attachPath;\n var destinationFile;\n\n // 确认该 Document 没有包含 org 附件\n if(newomOrgAttach !== \"\" && newomOrgAttach !== \".org\"){\n // 先添加一个附件到 Document,防止没有创建附件文件夹\n var localTemplateFileHdl = curDoc.AddAttachment(TemplateFile);\n attachPath = curDoc.AttachmentsFilePath;\n var localTemplateFile = attachPath + templateFilename;\n destinationFile = attachPath + newomOrgAttach;\n // 附件文件夹下,复制模板附件文件到org附件文件\n objCommon.CopyFile(localTemplateFile,destinationFile);\n // 重命名附件文件名\n // objCommon.RunExe(\"cmd\", \"/c ren \\\"\" + localTemplateFile + \"\\\" \\\"\" + newomOrgAttach + \"\\\"\", true);\n //添加新附件\n var localOrgFileHdl = curDoc.AddAttachment(destinationFile);\n //删除原附件\n localTemplateFileHdl.Delete();\n }\n else{\n objWindow.ShowMessage(\"输入的文件名 \"+ newomOrgAttach + \"错误\", \"Error-org-attach-filename\",0);\n }\n return;\n}", "function onEditDialogOpen(item){\r\n\t\t\r\n\t\tvar objTextarea = jQuery(\"#uc_dialog_edit_file_textarea\");\r\n\t\t\r\n\t\tif(g_codeMirror)\r\n\t\t\tg_codeMirror.toTextArea();\r\n\r\n\t\tobjTextarea.hide();\r\n\t\t\r\n\t\tvar data = {filename: item.file, path: g_activePath, pathkey: g_pathKey};\r\n\t\tg_ucAdmin.setErrorMessageID(\"uc_dialog_edit_file_error\");\r\n\t\tg_ucAdmin.setAjaxLoaderID(\"uc_dialog_edit_file_loader\");\r\n\t\tassetsAjaxRequest(\"assets_get_file_content\", data, function(response){\r\n\t\t\t\r\n\t\t\tobjTextarea.show();\r\n\t\t\tobjTextarea.val(response.content);\r\n\t\t \r\n\t\t\tvar modeName;\r\n\t\t\t\r\n\t\t\tswitch(item.type){\r\n\t\t\t\tdefault:\r\n\t\t\t\tcase \"html\":\r\n\t\t\t\t\tmodeName = \"htmlmixed\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"xml\":\r\n\t\t\t\t\tmodeName = \"xml\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"css\":\r\n\t\t\t\t\tmodeName = \"css\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"javascript\":\r\n\t\t\t\t\tmodeName = \"javascript\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar optionsCM = {\r\n\t\t\t\t\tmode: {name: modeName },\r\n\t\t\t\t\tlineNumbers: true\r\n\t\t\t };\r\n\t\t\t\r\n\t\t\tg_codeMirror = CodeMirror.fromTextArea(objTextarea[0], optionsCM);\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t}", "function doLoad() {\n\n\tdocClient = new AWS.DynamoDB.DocumentClient();\n\ttblName = process.env.stageName + \"-pds-data\";\n\n\tconsole.log(\"Loading \" + data_file.length + \" items into table: \" + tblName);\n\n\t// Loop through objects in the JSON file\n\tdata_file.forEach(function(person) {\n\n\t\tif('postcode' in person) {\n\t\t\tperson.postcodeTrimmed = person.postcode.replace(\" \",\"\");\n\t\t}\n\n\t var params = {\n\t TableName: tblName,\n\t Item: {\n\t\t\t\t\"nhs_number\": person.nhs_number,\n\t\t\t\t\"dob\": person.dob,\n\t\t\t\t\"dod\": person.dod,\n\t\t\t\t\"family_name\": person.family_name,\n\t\t\t\t\"given_name\": person.given_name,\n\t\t\t\t\"other_given_name\": person.other_given_name,\n\t\t\t\t\"title\": person.title,\n\t\t\t\t\"gender\": person.gender,\n\t\t\t\t\"address1\": person.address1,\n\t\t\t\t\"address2\": person.address2,\n\t\t\t\t\"address3\": person.address3,\n\t\t\t\t\"address4\": person.address4,\n\t\t\t\t\"address5\": person.address5,\n\t\t\t\t\"sensitiveflag\": person.sensitiveflag,\n\t\t\t\t\"primary_care_code\": person.primary_care_code,\n\t\t\t\t\"postcode\": person.postcode,\n\t\t\t\t\"telecom\": person.telecom,\n\t\t\t\t\"traceindex\": person.family_name + person.postcodeTrimmed + person.dob\n\t }\n\t };\n\n\t docClient.put(params, function(err, data) {\n\t if (err) {\n\t console.error(\"Unable to add person\", person.nhs_number, \". Error JSON:\", JSON.stringify(err, null, 2));\n\t }\n\t });\n\t}); // End of the forEach\n}", "function inputFile() {\n const self = this;\n\n self.init = function(fakeHook, inputHook) {\n const fake = document.querySelectorAll(fakeHook);\n\n if (fake) {\n Array.prototype.slice.call(fake).forEach(\n function(el) {\n\n const fakeUpload = function() {\n const parent = el.parentNode,\n input = parent.querySelector(inputHook);\n\n input.click();\n };\n\n el.addEventListener('click', fakeUpload);\n }\n );\n }\n };\n\n }", "function orthoPrepareUpload(event)\n {\n\n orthodonticFiles = event.target.files;\n }", "function createFile() {\n var e = new emitter();\n\n fs.readFile('newdocument.txt', function (err) {\n if (err) throw err;\n e.emit('theProcess');\n });\n\n return e;\n}", "function editAndCommit(oDocument, sContent, sCommitMessage) {\n\t\t\treturn oDocument.setContent(sContent).then(function () {\n\t\t\t\treturn oDocument.save().then(function () {\n\t\t\t\t\treturn stageFilesAndCommit([oDocument.getEntity().getName()], sCommitMessage);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function addCourseBasedOnScrap(event) {\n\n var file = event.target.files[0];\n if (file === undefined) {\n return;\n }\n\n var reader = new FileReader();\n reader.onload = function (event) {\n // The file's text will be printed here\n\n let inputAsText = event.target.result;\n\n let course = { // The Object that will be contained in \"items\" array\n courseName: \"\",\n lecturerName: \"\",\n typeOfCourse: \"\",\n days: [],\n beginningTime: [],\n duration: []\n };\n\n let copyFrom, paste, tmp;\n\n course.courseName = inputAsText.substring(inputAsText.indexOf('<link rel=\"stylesheet\" href=\"./') + 31, inputAsText.indexOf(\"_files/\"));\n\n while ((tmp = inputAsText.indexOf(\"<b>\")) != -1) {\n\n inputAsText = inputAsText.slice(tmp + 3);\n\n course.typeOfCourse = inputAsText.substring(0, inputAsText.indexOf(\"</b>\"));\n\n // This section might be problematic in case we got more than one type that not includes in coursesTypes --->\n if (!coursesTypes.includes(course.typeOfCourse)) {\n course.typeOfCourse = coursesTypes[3]; // if the type in not \"הרצאה, תרגיל , מעבדה או אחר\" put \"אחר\" in type\n }\n // <---- End of problematic section\n\n inputAsText = inputAsText.slice(inputAsText.indexOf(\"<b>\") + 3);\n var _timer = Date.now();\n for (var i = 0; (inputAsText.indexOf(\"<b>\") > (copyFrom = inputAsText.indexOf(\"<td>&nbsp;\")) || (inputAsText.indexOf(\"<b>\") === -1 && copyFrom !== -1)) && copyFrom !== -1; i++) {\n\n inputAsText = inputAsText.slice(copyFrom + 10);\n paste = inputAsText.substring(0, inputAsText.indexOf(\"</td>\"));\n\n switch (i % 5) {\n case 0:\n\n break;\n case 1:\n course.days.push(cDay(paste));\n break;\n case 2:\n course.beginningTime.push(paste);\n break;\n case 3:\n course.duration.push(parseInt(paste) - parseInt(course.beginningTime[parseInt(i / 5)])); // can also write course.beginningTime.length - 1 insted of i / 5\n break;\n case 4:\n course.lecturerName = paste;\n break;\n // default is useless here because i is an integer and (i % 5) cant be different than 0,1,2,3,4\n }\n if(Date.now() - _timer > 5000) break;\n }\n\n if (course.days.length !== course.duration.length || course.days[0] === undefined) {\n alert(\"קיים חשש לקריאת נתונים שגויה מהקובץ!\");\n } else {\n\n // In case that cDay did not succeed to convert well :\n for(var i = 0; i < course.days.length ; i++){\n if(course.days[i] === undefined || course.beginningTime[i] === undefined)\n return;\n }\n\n var existedCourse = false;\n for (const x of items) { // Checks if this lesson already exist in \"items\"\n if (isEquivalent(course, x)) existedCourse = true;\n }\n \n\n if (!existedCourse) { // Adding lesson\n addItem(JSON.parse(JSON.stringify(course)));\n }\n }\n // Reset the array before we are taking the next lesson:\n course.days = [];\n course.duration = [];\n course.beginningTime = [];\n course.lecturerName = \"\";\n course.typeOfCourse = \"\";\n }\n }\n reader.readAsText(file);\n }", "function run(){\n\n\t// 01. 対象ファイルをPhotoshop内へ読み込む\n\t//-----------------------------------------------------\n\t//指定形式のファイルを順に開き処理を行う\n\tfor(var i=0; i<filecnt; i++){\n\n\t\t//ファイル名までのフルパス取得\n\t\tvar nameOfFile = String(files[i].fullName);\n\n\t\t//ファイルオブジェクト定義\n\t\tvar openObj = new File(nameOfFile);\n\n\t\t//ファイルオープン\n\t\ttry{\n\n\t\t\t//最初とそれ以降の処理を分けるための分岐作り\n\t\t\tif(i==0){\n\t\t\t\t//【対象の複数ファイルの一番最初のファイルに対する処理)】\n\n\t\t\t\t//ベースとなるファイルを開く(ファイル名ソートで最初に来るファイル)\n\t\t\t\t(function(){app.open(openObj);})();\n\t\t\t\t//ベースとなるファイルを扱いやすいように変数に定義\n\t\t\t\tvar _doc = app.activeDocument;\n\t\t\t\t//ドキュメントサイズを求める\n\t\t\t\tpreferences.rulerUnits = Units.PIXELS;\n\t\t\t\tvar docW = _doc.width.value;\n\t\t\t\tvar docH = _doc.height.value;\n\t\t\t\t//新規ドキュメントを作成(ベースファイルと同じ width/height/dpi で作成)\n\t\t\t\tvar res = _doc.resolution;\n\n\t\t\t\t//新規ドキュメントを作成\n\t\t\t\tdocuments.add(docW,docH,res);\n\t\t\t\t//新規ドキュメントを扱いやすいように変数に定義\n\t\t\t\t_docNew = app.activeDocument;\n\n\t\t\t\t//ベースファイルを保存せずに閉じる\n\t\t\t\t_doc.close(SaveOptions.DONOTSAVECHANGES);\n\n\t\t\t\t//新規ドキュメントにベースファイルを配置(スマートオブジェクトファイルとして)\n\t\t\t\ttry{\n\t\t\t\t\tplaceFile(openObj);\n\t\t\t\t}catch(e){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//レイヤー名をファイル名と同じにする()\n\t\t\t\t_docNew.activeLayer.name = decodeURIComponent(files[i].name);\n\n\t\t\t\t//新規ドキュメント内の「背景」レイヤーを削除\n\t\t\t\t_docNew.layers[1].remove();\n\t\t\t}else{\n\n\t\t\t\t//【対象の複数ファイルの2番目以降のファイルの処理 (スマートオブジェクト化してアクティブドキュメントに配置)】\n\t\t\t\ttry{\n\t\t\t\t\tapp.open(openObj);\n\t\t\t\t\tvar _doc = app.activeDocument;\n\t\t\t\t\t// selectFullLayers();\n\t\t\t\t\tmergeVisLayers();\n\t\t\t\t\tsmartSet();\n\t\t\t\t\t// _doc.activeLayer.name = _doc.name;\t\t\t\t\t//レイヤー名の変更\n\t\t\t\t\t_doc.activeLayer.duplicate(_docNew,ElementPlacement.PLACEATBEGINNING);\t//ドキュメントの先頭に複製\n\t\t\t\t\t_doc.close(SaveOptions.DONOTSAVECHANGES);\n\t\t\t\t}catch(e){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//レイヤー名の変更\n\t\t\t\t_docNew.activeLayer.name = decodeURIComponent(files[i].name);\n\n\t\t\t}\n\n\t\t}catch(e){\n\t\t\terrorCount++;\n\t\t}\n\n\t}//for\n\n\n\t// 02. ドキュメント内のレイヤーを横並びにしてcanvasサイズを広げる\n\t//-----------------------------------------------------\n\tvar ChildLyaers = _docNew.layers;\t\t\t\t// レイヤー定義\n\tvar layerCount = ChildLyaers.length;\t\t\t// レイヤー数カウント\n\n\t// ドキュメント内のレイヤー数分処理する\n\tfor(var i=0; i<layerCount; i++){\n\t\tvar targetLayerNum = (layerCount)-1-i;\n\n\t\t// レイヤー2つ目以降からの処理\n\t\tif(0<i){\n\t\t\twholeDocWidth += marginWidth;\n\t\t\tChildLyaers[targetLayerNum].translate(wholeDocWidth, 0);\n\t\t}\n\t\t// 特定レイヤーの大きさ取得\n\t\tcalcDocumentSize(ChildLyaers[targetLayerNum]);\n\t}\n\t// canvasサイズの変更\n\tapp.activeDocument.resizeCanvas(wholeDocWidth, wholeDocHeight, AnchorPosition.TOPLEFT);\n\n\n\t// 03. 各レイヤーの名前のテキストレイヤーを作成、ドキュメント全体用の背景レイヤーを作成\n\t//-----------------------------------------------------\n\tvar setLayerNumber = 0;\t\t\t\t\t\t// 処理対象のレイヤー番号をセットするための入れ物\n\tvar addNumVal = 0;\t\t\t\t\t\t\t// レイヤー指定のための調整値\n\n\t// レイヤー名を取得してテキストレイヤーに起こしていく\n\tfor(var i=0; i<layerCount; i++){\n\n\t\t// 初めは処理しない\n\t\tif(i!==0) setLayerNumber=i+addNumVal;\n\n\t\t// テキストレイヤー追加\n\t\t_docNew.suspendHistory(\"Add TextLayer\", \"addTextLayer(setLayerNumber)\");\n\n\t\taddNumVal++;\n\t}\n\n\tvar maxLayerCount = layerCount*2-1;\t\t\t// この時点でのレイヤーの合計数\n\n\t// レイヤー名を所定の位置へ移動\n\tfor(var i=0; i<layerCount; i++){\n\t\ttranslateLayerAbsolutePosition(i, getLayerPositionX(maxLayerCount), getLayerPositionY(maxLayerCount)+posYtop);\n\t\tmaxLayerCount--;\n\t}\n\n\t// canvasサイズの変更\n\t_docNew.resizeCanvas(_docNew.width+addCanvasSizeW, _docNew.height+addCanvasSizeH, AnchorPosition.MIDDLECENTER);\n\n\t// レイヤー追加\n\t_docNew.artLayers.add();\n\t_docNew.activeLayer.name = \"Background\";\n\n\t// レイヤー塗りつぶし\n\tvar myColor = new SolidColor();\n\tmyColor.rgb.red = myColor.rgb.green = myColor.rgb.blue = 0;\n\tmyColor.rgb.red = setBackgroundColorR;\n\tmyColor.rgb.green = setBackgroundColorG;\n\tmyColor.rgb.blue = setBackgroundColorB;\n\tapp.activeDocument.selection.selectAll();\t\t\t// 全てを選択する\n\tapp.activeDocument.selection.fill(myColor, ColorBlendMode.NORMAL, 100, false);\t\t\t// 塗りつぶし\n\tapp.activeDocument.selection.deselect();\t\t\t// 選択範囲の解除\n\n\t// レイヤーを最背面へ移動\n\tsendToBackEnd();\n\n\n\t// 04. psd保存とpng書き出し(YYYYMMDDddd_HHMMmm.psd)\n\t//-----------------------------------------------------\n\n\t//ファイル名設定\n\tvar saveFileName = getTimeStamp();\n\tvar fileObj = new File(_root + saveFileName + \".psd\");\n\t//ファイルを別名保存\n\tsaveAsFile(fileObj, _docNew);\n\n\t// jpg書き出し\n\t// jpgExport_fullPath(_root, saveFileName, 100);\n\n\t// png書き出し\n\tpng24Export_fullPath(_root, saveFileName);\n\n\t// ドキュメントを保存せずに閉じる\n\t_docNew.close(SaveOptions.DONOTSAVECHANGES);\n\n}//run", "postIngestData() {}", "function commitToFile ( ) {\r\n var arrayLength = books.length;\r\n var bookData;\r\n// var fileHandle = 'insert appropriate API function here'\r\n var writeData;\r\n writeData = 'var = books [';\r\n for ( var i=0 ; i < arrayLength ; i++ ) {\r\n bookData = newlineText + ' { ';\r\n for ( var propertyName in books[i] ) {\r\n\t if ( propertyName !== bookNumberProperty ) {\r\n\t bookData += propertyName + ': ' + books[i][propertyName] + ', ';\r\n\t }\r\n }\r\n writeData += bookData.replace ( /, $/, ' },' );\r\n }\r\n writeData += newlineText + '];';\r\n // in lieu of some API function such as: writeToFile ( writeData );\r\n outputDiv.innerHTML = '<br />Source: ' + bookDataFile + '<br />' + nonBreakingSpaceText + '<br />was intended to be the recipient of this data:<br />' + nonBreakingSpaceText + '<pre>' + writeData + '</pre>';\r\n console.log ( writeData );\r\n}", "function uploadDealcsv() { }", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "function writeToFile(fileName, data) { \n\n fs.writeFileSync(fileName, generateReadme(data));\n LicenseBadge(data);\n console.log(\"User Inputs updated, your Readme file is ready to view.\")\n}", "handleTheFile(event) {\n event.preventDefault();\n if (this.inputFile.current.files[0] === undefined) { return; }\n\n // Confirm file extension and read the data as text\n console.log('Reading the file...');\n let fileName = this.inputFile.current.files[0].name;\n if (!fileName.endsWith('.asc')) {\n console.error('Error opening the file: Invalid file extension, .asc expected.');\n return;\n }\n let file = this.inputFile.current.files[0];\n let reader = new FileReader();\n reader.onload = (event) => {\n console.log('Done.');\n this.ParseTheData(event.target.result);\n }\n reader.onerror = () => {\n console.error('Error opening the file: Cannot read file.');\n return;\n }\n reader.readAsText(file);\n }", "function updateFile(bookList){\n \n /* truncate dient dazu alle Bücher aus der books.json zu löschen. Dadurch, dass bereits zuvor der Inhalt in die Variable bookList \n geschrieben wurde, wird problemlos der Inhalt der Variable\n bookList, welche alle Bücher enthält, in die books.json geschrieben.\n */\n fs.truncate(_path,0, function(err){\n \n for(var i = 0 ; i < bookList.length;i++){ // schreibt jedes einzelne Buch aus der Liste der Bücher in die books.json\n \n var writeLine = JSON.stringify(bookList[i])+\",\";\n \n fs.appendFile(_path,writeLine, function(err){\n \n });\n }\n });\n}", "function MUPS_Save(mode, el_input){\n console.log(\" ----- MUPS_Save ---- mode: \", mode);\n\n // --- get urls.url_user_allowedsections_upload\n const upload_dict = {\n mode: \"update\",\n user_pk: mod_MUPS_dict.user_pk,\n allowed_sections: mod_MUPS_dict.allowed_sections\n }\n const url_str = urls.url_user_allowedsections_upload;\n console.log(\" url_str: \", url_str);\n\n UploadChanges(upload_dict, url_str);\n\n // --- show modal\n $(\"#id_mod_userallowedsection\").modal(\"hide\");\n }", "articleStep1Post () {\n\t\t\tif (this.allKewords.length < 6) this.swalfire('error','6 keywords are required.');\n\t\t\telse {\n\t\t\t\tif (this.manu_script_id) {\n\t\t\t\t\tthis.$axios.patch('api/manuScriptContrlr/'+this.manu_script_id,this.aStep1Data).then(res => {\n\t\t\t\t\t\tthis.swalfire('success','Form data is saved successfully.');\n\t\t\t\t\t\t/*UPDATING KEYWORDS AND FILES ARRAY*/\n\t\t\t\t\t\tthis.uploadKywrds(this.manu_script_id);\n\t\t\t\t\t\tthis.getAllAddFiles(this.manu_script_id);\n\t\t\t\t\t\tthis.getAllMyFiles(this.manu_script_id);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.$axios.post('api/manuScriptContrlr',this.aStep1Data).then(res => {\n\t\t\t\t\t\tthis.manu_script_id = res.data;\n\t\t\t\t\t\tthis.swalfire('success','Form data is saved successfully.');\n\t\t\t\t\t\t/*UPDATING KEYWORDS AND FILES ARRAY*/\n\t\t\t\t\t\tthis.uploadKywrds(res.data);\n\t\t\t\t\t\tthis.getAllAddFiles(res.data);\n\t\t\t\t\t\tthis.getAllMyFiles(res.data);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function handleFileSelect(evt){\n var f = evt.target.files[0]; // FileList object\n window.reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function(theFile){\n return function(e){\n editor.setData(e.target.result);\n evt.target.value = null; // allow reload\n };\n })(f);\n // Read file as text\n reader.readAsText(f);\n thisDoc = f.name;\n }", "async postProcess () {\n\t\tawait this.creator.postCreate();\t\t\n\t}", "function editannounement() {\n\n}", "initGenerateProposal(){\n var _this = this;\n $('[data-action=\"generate-proposal\"]').click(function(){\n _this.generateProposal();\n });\n $('[data-action=\"update-proposal\"]').click(function(){\n _this.updateProposal();\n });\n }", "function postFileObj(reqPkg) { // console.log('postFileObj called. reqPkg%O', reqPkg);\n asyncErr() || reqPkg.fSysEntry.file(function (fileObj) {\n postMsg('fileObj', pkgFSysResponse(reqPkg, fileObj));\n }); \n }", "function handleNewFiles() {\n var fileName;\n do {\n // If there is a file, move it from staging into the application folder\n fileName = inbox.nextFile();\n if (fileName) {\n console.log(\"/private/data/\" + fileName + \" is now available\");\n // refresh weather now\n weatherFromFile();\n }\n } while (fileName);\n}", "async function onDidSave(document) {\n \n // vscode.window.showErrorMessage(document.fileName);\n if (document.fileName.endsWith('.git')){\n freshCompile(document.fileName.slice(0, -4));}\n else{\n freshCompile(document.fileName);}\n\n}", "function createNewFromExistingFormat(fileFormatId) {\r\n if (fileFormatId) {\r\n var existingFormat = null;\r\n try {\r\n existingFormat = nlapiLoadRecord('customrecord_2663_payment_file_format', fileFormatId);\r\n }\r\n catch(ex) {\r\n nlapiLogExecution('error', '[ep] Format Updater:createNewFromExistingFormat', 'Error in loading payment file format - id: ' + fileFormatId);\r\n }\r\n \r\n if (existingFormat && existingFormat.getFieldValue('custrecord_2663_native_format') == 'T') {\r\n nlapiLogExecution('debug', '[ep] Format Updater:createNewFromExistingFormat', 'Load page for copy of format: ' + existingFormat.getFieldValue('name'));\r\n var params = {};\r\n params['custparam_id'] = fileFormatId;\r\n nlapiSetRedirectURL('RECORD', 'customrecord_2663_payment_file_format', null, true, params);\r\n }\r\n }\r\n }", "import() {\n\t\tthis.msg.clear();\n\t\t//open a dialog asking the user to upload\n\t\t//must be named 'presentationConfig.pres'\n\t\t// .pres is just a rename of .zip\n\t\t// but must be 'presentationConfig' to match the directory name here\n\t\tdialog.showOpenDialog(\n\t\t\t{ filters: [ { name: 'presentationFlow', extensions: ['pres'] } ], properties:['openFile'] },\n\t\t\tthis.importChosenFiles.bind(this)\n\t\t);\n\n\t}", "function installAppendClickHandler() {\n $('#selectfile-append').on('click', function() {\n logConsoleMessage(`Import Append project button clicked`);\n $('#import-project-dialog').modal('hide');\n appendProjectCode();\n\n // Set the status message in the modal dialog\n // This only happens after the import project dialog has fired\n // if (importProjectDialog.isProjectFileValid === true) {\n // $('#selectfile-verify-valid').css('display', 'block');\n // document.getElementById('selectfile-replace').disabled = false;\n // document.getElementById('selectfile-append').disabled = false;\n // // uploadedXML = xmlString;\n // } else {\n // $('#selectfile-verify-notvalid').css('display', 'block');\n // document.getElementById('selectfile-replace').disabled = true;\n // document.getElementById('selectfile-append').disabled = true;\n // }\n });\n}", "async createUpdatePromise(uri, item) {\n if (!item.document) {\n item.document = await this.loadDocument(uri);\n if (item.document) {\n item.version = item.document.version;\n }\n }\n if (item.document) {\n item.fresh = true;\n await this.parseDocument(uri, item.document);\n // Very important, release document memory usage after symbols generated\n if (!item.opened) {\n item.document = null;\n }\n console.log(`${uri} loaded${item.opened ? ' from opened document' : ''}`);\n }\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 DBOperationParseETLToMongoD(serverIP, fileName, dbObj) {\r\n\r\n\ttry {\r\n\r\n\t\t// DB Collection instance\r\n\t\tvar dbCollection = dbObj.collection(serverIP);\r\n\r\n\t\t// DB object\r\n\t\tvar bulk = dbCollection.initializeOrderedBulkOp();\r\n\r\n\t\t//Abs path\r\n\t\tvar etlPath = etlRoot + fileName;\r\n\r\n\t\t// Check if file exist\r\n\t\tif (!fs.existsSync(etlPath))\r\n\t\t\treturn false;\r\n\r\n\t\t// Async reading file\r\n\t\tfs.readFile(etlPath, 'utf8', function (err, data) {\r\n\r\n\t\t\tif (err) throw err;\r\n\r\n\t\t\t// Parent doc for querying\r\n\t\t\tvar parentDoc = fileName;\r\n\r\n\t\t\tvar lines = data.split('*!TOKEN!*');\r\n\t\t\tvar counter = 0;\r\n\r\n\t\t\tlines.forEach(function (element) {\r\n\t\t\t\tvar timestamp = element.substring(0, 25);\r\n\r\n\t\t\t\tbulk.insert({\r\n\t\t\t\t\t'parent': parentDoc,\r\n\t\t\t\t\t'timestamp': timestamp,\r\n\t\t\t\t\t'trace': element\r\n\t\t\t\t})\r\n\t\t\t\tcounter++;\r\n\r\n\t\t\t\tif (counter % 10 == 0 || counter == lines.length - 1) {\r\n\t\t\t\t\tconsole.log(\"Uploading - \" + counter + \" - Total - \" + lines.length)\r\n\t\t\t\t\t//console.log(bulk);\r\n\t\t\t\t\tbulk.execute(function (err, res) {\r\n\t\t\t\t\t\t//if(err != \"\") console.log(err)\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t\t// INIT bulk object\r\n\t\t\t\t\tbulk = dbCollection.initializeOrderedBulkOp();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tconsole.log('Done' + Date.now());\r\n\t\t});\r\n\r\n\t} catch (err) {\r\n\t\tconsole.log(err);\r\n\t}\r\n}", "function loadfile() {\n // pop up a file upload dialog\n // when file is received, send to server and populate db with it\n}", "function creativity_doc(input){ \n if (input.files && input.files[0]) {\n var reader = new FileReader();\n alert('HI doc'+input.files[0].type); \n $supported_filetype=['application/pdf','text/plain','application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'application/vnd.ms-powerpoint','application/vnd.ms-excel'];\n \n\n if($supported_filetype.indexOf(input.files[0].type) < 0){\n \n alert('file format not supported'); \n return false;\n }\n\n if(input.files[0].size >= 100004800){\n \n alert('Uploaded Doc size is more the allowed size');\n return false;\n }\n\n alert('validated');\n var div='<div class=\"sel-hob-main\">'+\n '<span class=\"text-file sel-copy\">&nbsp;</span>'+\n '<div class=\"sel-close\"></div>'+\n '</div>';\n \n $('#preview_cre_image').html(div);\n \n \n \n }\n }", "function readProposalOfSubmittedPolicy1() {\n // alert(\"I m from ReadProposalOfSUbmittedPolicy1\");\n document.getElementById(\"policyproposaldiv\").style.display = \"block\";\n\n regulatorInstance.getProposalofSubmittedPolicy_agent(0).then(function (data) {\n\n var address= JSON.stringify((data[0]));\n var status= JSON.stringify((data[2].c[0]));\n var ipfs_hash= JSON.stringify(data[1]);\n\n var hash= JSON.stringify(hex2string(data[1]));\n var final_hash= hash.slice(1,-1);\n\n\n var JsonData= \"\";\n\n ipfs.files.get(final_hash, function (err, files) {\n files.forEach((file) => {\n console.log(file.path);\n JsonData= file.content.toString('utf8');\n var parseData= JSON.parse(JsonData);\n console.log(parseData.customerName+\" Age: = \"+JsonData[0].MedicalHistory);\n $(\"#customerName1\").html(parseData.customerName);\n $(\"#c_dob\").html(parseData.Dob);\n $(\"#c_age\").html(parseData.Age);\n $(\"#c_Occupation\").html(parseData.Occupation);\n $(\"#gender\").html(parseData.Gender);\n $(\"#martialStatus\").html(parseData.MartialStatus);\n $(\"#policyType\").html(parseData.PolicyType);\n $(\"#term\").html(parseData.Base_Term);\n $(\"#sumAssured\").html(parseData.Base_SumAssured);\n $(\"#DiseasesCovered\").html(parseData.Diseases_Covered_Customer);\n $(\"#c_status\").html(getStatus(parseData.Status));\n $(\"#c_Pharmacies_Allowed\").html(parseData.Pharmacies_Allowed);\n $(\"#c_Hospitals_Allowed\").html(parseData.Hospitals_Allowed);\n $(\"#c_Reemberse\").html(parseData.Remberse);\n $(\"#c_RoomRent\").html(parseData.RoomRent);\n $(\"#c_Pharmacy_Limit\").html(parseData.Pharmacy_Limit);\n $(\"#c_Deductable_Rider_Customer\").html(parseData.Deductible_Rider_customer);\n $(\"#c_Deductable_Base_Customer\").html(parseData.Deductible_Base_customer);\n $(\"#c_Coverage_Rider\").html(parseData.Coverage_Rider);\n $(\"#c_Rider_Term\").html(parseData.Rider_Term);\n $(\"#c_Medical_History\").html(parseData.MedicalHistory);\n $(\"#POwner\").html(parseData.PolicyOwner);\n $(\"#c_limitperDay\").html(parseData.LimitPerDay);\n $(\"#c_policyNumber\").html(parseData.PolicyNumber);\n $(\"#c_limit_per_year\").html(parseData.Limit_per_Year);\n $(\"#c_limit_emergency\").html(parseData.Emergency_Amount);\n\n console.log(\"File content >> \",file.content.toString('utf8'))\n })\n })\n })\n\n\n /*If base and sum assured entites to be added do the following\n * add rest of the html fields in the policyproposaldiv\n *\n * */\n /* if (getStatus(data[5].c[0]) == \"Approved\") {\n $(\"#clinicalTrialAddress\").html('<i class=\"fa fa-address-card\"></i> ' + data[6]);\n $(\"#clinicalTrialCreationTxnHash\").html('<i class=\"fa fa-list-alt\"></i> ' + clinicalTrailCreationTxnHash);\n $(\"#clinicalTrialHash\").html('<i class=\"fa fa-check\"</i>' + \" Clinical Trial Contract mined!\");\n $(\"#clinicalTrialHash\").show().delay(5000).fadeOut();\n ctContractAddress = data[6];\n initializeClinicalTrialEvents();\n }*/\n\n\n}", "handleFilechange(event, path) {\n console.log('PdfjsViewerView: file', event, path)\n this.reloadPdf()\n }", "__initImportButton() {\n let instance = this;\n $( \"#import-points\").click(\n function () {\n $(\"#file\").click();\n }\n ).button({\n icon: \"ui-icon-arrowthickstop-1-n\",\n text: false\n });\n $( \"#file\" ).change(\n function () {\n //It should only be one file.\n let file = this.files[0];\n let json = Utils.loadJSON(file,\n function(event){\n var corrupt = false;\n let text = event.target.result;\n let json = JSON.parse(text);\n\n let json_check = JSON.parse(JSON.stringify(json));\n delete json_check['checksum'];\n delete json_check['timestamp'];\n\n $.ajax({\n url: '/_add_checksum_to_json',\n type: \"POST\",\n data: JSON.stringify(json_check),\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n success: \n function(data){\n if(json['checksum'] == data['checksum']){\n //Warn when the file we are importing doesn't match the model.\n let url = document.URL;\n let documentFilename = url.substring(url.lastIndexOf('/') + 1);\n let jsonFilename = json.filename;\n if (jsonFilename !== documentFilename) {\n $( \"#not-same-model-warn\").dialog({\n title: \"Warning!\",\n });\n }\n\n //Load annotations.\n let annotations = json.annotations;\n for (let annotation of annotations) {\n let point = annotation.points[0];\n let tag = annotation.tag;\n instance.annotations.addPoint(point, tag);\n }\n //Load measurements.\n let measurements = json.measurements;\n for (let measurement of measurements) {\n let point1 = measurement.points[0];\n let point2 = measurement.points[1];\n let tag = measurement.tag;\n instance.measurements.addPoint(point1, tag);\n instance.measurements.addPoint(point2, tag);\n }\n\n }else{\n $.ajax({\n url: '/get_user_rol',\n type: \"POST\",\n data: JSON.stringify(data),\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n success: \n function(data){\n if(data['rol'] == 'Profesor'){\n $( \"#copy-warn\").dialog({\n title: \"Warning!\",\n });\n }else{\n $( \"#copy-warn-student\").dialog({\n title: \"Warning!\",\n });\n }\n }\n });\n }\n\n $(\"#file\").val('');\n }\n });\n }\n );\n }\n );\n }", "function run() {\n\t\tif ( preferences.getValue( 'enabled' ) && !processed ) {\n\t\t\tvar editor = EditorManager.getCurrentFullEditor(),\n\t\t\t\tcurrentDocument = editor.document,\n\t\t\t\toriginalText = currentDocument.getText(),\n\t\t\t\tprocessedText = autoprefixer.compile( originalText ),\n\t\t\t\tcursorPos = editor.getCursorPos(),\n\t\t\t\tscrollPos = editor.getScrollPos();\n\t\t\t\n\t\t\t// Replace text.\n\t\t\tcurrentDocument.setText( formatCode( processedText ) );\n\t\t\t\n\t\t\t// Restore cursor and scroll positons.\n\t\t\teditor.setCursorPos( cursorPos );\n\t\t\teditor.setScrollPos( scrollPos.x, scrollPos.y );\n\t\t\t\n\t\t\t// Save file.\n\t\t\tCommandManager.execute( Commands.FILE_SAVE );\n\t\t\t\n\t\t\t// Prevent file from being processed multiple times.\n\t\t\tprocessed = true;\n\t\t} else {\n\t\t\tprocessed = false;\n\t\t}\n\t}", "function convert(fieldchanged) {\n\tvar docNumber = document.getElementById(\"docNumber\").value;\n\tvar docVers = document.getElementById(\"docVers\").value;\n\tvar docExt = document.getElementById(\"docExt\").value;\n\tvar fileName = document.getElementById(\"fileName\").value;\n\tvar fileMethod = \"\";\n\tvar fileVersion = \"\";\n\tvar fileExtension = \"\";\n\tvar extPos = 0;\n\n\t// remove any alert\n\tdocument.getElementById(\"docNumberComment\").value = \"\";\n\tdocument.getElementById(\"docVersComment\").value = \"\";\n\tdocument.getElementById(\"docExtComment\").value = \"\";\n\tdocument.getElementById(\"fileNameComment\").value = \"\";\n\t//console.log(docNumber + \"-\" + docVers + \"-\" + docExt + \"-\" + fileNameEnh + \"-\" + fileNameUnix);\n\t\n\t// switch based on the value of changes. check values: doc number must be a number only, version must be a number between 1 and 99, ext a text of 4 char max\n\tswitch(fieldchanged) {\n\t\tcase 'docN':\n\t\t\tif (isNaN(docNumber)) \n\t\t\t\t{ document.getElementById(\"docNumberComment\").value = \"--> must be a number\";\n\t\t\t\tdocument.getElementById(\"docNumber\").value = 1;\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\tdocument.getElementById(\"fileNameEnh\").value = Num2DOCSEnh(docNumber, docVers, docExt);\n\t\t\t\tdocument.getElementById(\"fileNameUnix\").value = Num2DOCSunix(docNumber, docVers, docExt);\n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 'verN':\n\t\t\tdocument.getElementById(\"docVers\").value = pad2(docVers);\n\t\t\tdocument.getElementById(\"fileNameEnh\").value = Num2DOCSEnh(docNumber, pad2(docVers), docExt);\n\t\t\tdocument.getElementById(\"fileNameUnix\").value = Num2DOCSunix(docNumber, pad2(docVers), docExt);\n\t\t\tbreak;\n\t\tcase 'ext':\n\t\t\tif (docExt.length < 2 || docExt.length > 4 || docExt.lastIndexOf(\".\") != -1) \n\t\t\t\t{ document.getElementById(\"docExtComment\").value = \"--> between 2 & 4 chars and no '.'\";\n\t\t\t\t document.getElementById(\"docExt\").value = 'txt';\n\t\t\t\t }\n\t\t\telse {\n\t\t\tdocument.getElementById(\"fileNameEnh\").value = Num2DOCSEnh(docNumber, docVers, docExt);\n\t\t\tdocument.getElementById(\"fileNameUnix\").value = Num2DOCSunix(docNumber, docVers, docExt);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'fileChange':\n\t\t\t// if the filename has a \"!\" then its enhanced, if it has a \"_\" then its unix, otherwise it's not a valid file name\n\t\t\t\n\t\t\textPos = fileName.lastIndexOf(\".\");\n\t\t\t// extract method, version number and extension\n\t\t\tif (extPos === -1) {\n\t\t\t\tdocument.getElementById(\"fileNameComment\").value = \"--> not a valid name: missing '.'\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfileMethod = fileName.slice(extPos-1, extPos);\n\t\t\t\tfileVersion = pad2(Number(fileName.slice(extPos-3, extPos-1)));\n\t\t\t\tfileExtension = fileName.slice(extPos+1, fileName.length);\n\t\t\t}\n\n\t\t\tif (fileMethod === \"!\"){\n\t\t\t\t// calculate document number and extract version and extension to display\n\t\t\t\tdocument.getElementById(\"docNumber\").value = DOCSEnh2Num(fileName.slice(0, extPos-3));\n\t\t\t\tdocument.getElementById(\"docVers\").value = fileVersion;\n\t\t\t\tdocument.getElementById(\"docExt\").value = fileExtension;\n\t\t\t\tdocument.getElementById(\"fileNameEnh\").value = \"Enhanced\";\n\t\t\t\tdocument.getElementById(\"fileNameUnix\").value = \"\";\n\t\t\t}\n\t\t\telse if (fileMethod === \"_\") {\n\t\t\t\t// calculate document number and extract version and extension to display\n\t\t\t\tdocument.getElementById(\"docNumber\").value = DOCSUnix2Num(fileName.slice(0, extPos-3));\n\t\t\t\tdocument.getElementById(\"docVers\").value = fileVersion;\n\t\t\t\tdocument.getElementById(\"docExt\").value = fileExtension;\n\t\t\t\tdocument.getElementById(\"fileNameEnh\").value = \"\";\n\t\t\t\tdocument.getElementById(\"fileNameUnix\").value = \"Unix\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdocument.getElementById(\"fileNameComment\").value = \"--> not a valid name\";\n\t\t\t\t}\t\t\t\n\t\t\t// file name to test: 2801!.docx = 80 | 5jp01!.wpd = 7189 | 7w201_.xls = 7490\n\t\t\tbreak;\n\t}\n}", "function processInput() {\n\n\tvar boundaryInfo = getCourseBoundaries(fileContents);\n\tvar boundaries = boundaryInfo.boundaries;\n\tvar oneSection = RegExp( sectionChunk, 'gim' );\n\tvar j = 0;\n\tfor (var i = 0; i < boundaryInfo.boundaries.length ; ++i) {\n\t\tvar courseSection = fileContents.substring(boundaries[i], boundaries[i+1]);\n\t\twhile(true) {\n\t\t\tvar result = oneSection.exec(courseSection);\n\t\t\tif (!result) break;\n\t\t\tvar sectionInfo = { \n\t\t\t\ttimes : result[4].trim().split('\\n'),\n\t\t\t\trooms : result[5].trim().split('\\n'),\n\t\t\t\tinstructors : result[6].trim().split('\\n'),\n\t\t\t\tdates\t\t\t\t: result[7].trim().split('\\n'),\n\t\t\t};\n\t\t\tsections[j] = {\n\t\t\t\tname : boundaryInfo.courses[i].name,\n\t\t\t\tdisc : boundaryInfo.courses[i].disc,\n\t\t\t\tnum : boundaryInfo.courses[i].num,\n\t\t\t\tCFID : result[1],\n\t\t\t\tsectionName : result[2],\n\t\t\t\tsectionType : result[3],\n\t\t\t\tisFull : ( result[8].trim()[0] === 'O' ? false : true ), // Is it open? TODO: Make case insensitive.\n\t\t\t\tdays : getSessions( sectionInfo ),\n\t\t\t};\n\t\t\t++j;\n\t\t}\n\t\toneSection.lastIndex = 0;\n\t}\n\tconsole.log( JSON.stringify(sections, null, 1) ); // DEBUG\n}", "function seedLanguages(filename){\n // Read csv file, parse into an object and then insert values into table JetBlue\n let parsed_data = reader.readFile(filename, function(parsed_data){\n db.insertData(\"CountryLanguage\", con, parsed_data);\n console.log(\"file: \" + filename + \" read and db populated correctly\");\n });\n}", "onInputChanged(codeMirror, change, value) {\n store.file.setContents(value, { isDirty: true })\n store.project.updatedContentsFor(store.file)\n // auto-compile 2 seconds after input settles\n store.compileAppSoon(2)\n }", "function addHdlFileToEditor(file) {\n var rawFile = new XMLHttpRequest();\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status === 0) {\n var allText = rawFile.responseText;\n\n // Create the editor if it doesn't exist\n if (dot_editor === null) {\n var count = $(\"#editor-pane-nav li\").length;\n $(\"#editor-pane-nav\").append(\"<li><a data-target='#file\" + count + \"'>HDL</a><p></p></li>\");\n fileIndexMap.HDL = count;\n\n var editor_div = \"<div class='tab-pane' id='file\" + count + \"' style='height:500px;'>\";\n editor_div += \"<div class='well' id='dot_editor_well'></div></div>\";\n $(\"#editor-pane .tab-content\").append(editor_div);\n\n dot_editor = ace.edit($(\"#dot_editor_well\")[0]);\n dot_editor.setTheme( \"../ace/theme/xcode\" );\n dot_editor.setFontSize( 12 );\n dot_editor.getSession().setUseWrapMode( true );\n dot_editor.getSession().setNewLineMode( \"unix\" );\n\n fileJSON.push({\"editor\":dot_editor, \"absName\":\"HDL\", \"name\":\"HDL\", \"path\":\"HDL\", \"content\":allText});\n }\n\n // Set the file content\n if (file.endsWith(\".vhd\")) {\n dot_editor.getSession().setMode( \"../ace/mode/vhdl\" );\n } else {\n dot_editor.getSession().setMode( \"../ace/mode/verilog\" );\n }\n dot_editor.setValue( allText.replace( /(\\r\\n)/gm, \"\\n\" ) );\n dot_editor.setReadOnly( true );\n\n syncEditorPaneToLine(1, \"HDL\");\n } else {\n alert(\"Something went wrong trying to get HDL file\", file);\n }\n }\n };\n rawFile.send(null);\n}", "clickDone(){\n const self = this;\n let sections = this.get('sectionsProxy').filterBy('selected', true).map(o => o.data);\n this.get('documents').importSections(this.get('targetDocument'), sections, this.isLink()).then(() => {\n // this.sendAction('afterImport');\n // this.transitionTo('app.documents.editor', this.get('docid'));\n this.get('router').transitionTo('app.documents.editor', this.get('docid'));\n });\n }", "handleFileActivate(event, file) {\n // Disable file editing if the file has not finished uploading\n // or the upload has errored.\n if (file.created === null) {\n return;\n }\n\n this.props.onOpenFile(file.id, file);\n }" ]
[ "0.559201", "0.5418875", "0.530729", "0.5121854", "0.50767225", "0.5063616", "0.5063237", "0.50583225", "0.50316024", "0.500559", "0.4974667", "0.4973006", "0.49413094", "0.4929875", "0.49256665", "0.49239013", "0.49227002", "0.4920849", "0.4916842", "0.4915906", "0.49107948", "0.48788202", "0.487391", "0.48563728", "0.48492694", "0.4819591", "0.4794465", "0.478913", "0.47826985", "0.47752878", "0.476504", "0.4758001", "0.475438", "0.47524843", "0.47500825", "0.47487858", "0.47435543", "0.47421053", "0.47358072", "0.4732474", "0.47270513", "0.47237545", "0.47230884", "0.47219083", "0.47117773", "0.47102228", "0.47021064", "0.47000927", "0.46954417", "0.46939722", "0.46898803", "0.46808586", "0.4680673", "0.46789283", "0.46784744", "0.46607155", "0.46569195", "0.4645368", "0.46429843", "0.46421242", "0.46320873", "0.4630941", "0.46285126", "0.4628051", "0.46275815", "0.46237686", "0.46236414", "0.4622692", "0.462077", "0.46117678", "0.46113068", "0.46092978", "0.4608363", "0.4600427", "0.45854563", "0.45770714", "0.45763892", "0.4576323", "0.45739263", "0.45686424", "0.45637614", "0.4562666", "0.45623878", "0.456174", "0.45606545", "0.45517316", "0.4550963", "0.45478207", "0.4546582", "0.45423022", "0.4540704", "0.45353687", "0.45328215", "0.45305112", "0.45222762", "0.45219877", "0.45202857", "0.45184356", "0.45167878", "0.4512866", "0.45124352" ]
0.0
-1
This function runs after we are sure we have a reference to SP.RequestExecutor.js. It uses the REST API to upload the file as an attachment
function storeOppAsAttachment() { var fileContents = fixBuffer(contents); var createitem = new SP.RequestExecutor(web.get_url()); createitem.executeAsync({ url: web.get_url() + "/_api/web/lists/GetByTitle('Prospects')/items(" + currentItem.get_id() + ")/AttachmentFiles/add(FileName='" + file.name + "')", method: "POST", binaryStringRequestBody: true, body: fileContents, success: storeOppSuccess, error: storeOppFailure, state: "Update" }); function storeOppSuccess(data) { // Success callback var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } // Workaround to clear the value in the file input. // What we really want to do is clear the text of the input=file element. // However, we are not allowed to do that because it could allow malicious script to interact with the file system. // So we’re not allowed to read/write that value in JavaScript (or jQuery) // So what we have to do is replace the entire input=file element with a new one (which will have an empty text box). // However, if we just replaced it with HTML, then it wouldn’t be wired up with the same events as the original. // So we replace it with a clone of the original instead. // And that’s what we need to do just to clear the text box but still have it work for uploading a second, third, fourth file. $('#oppUpload').replaceWith($('#oppUpload').val('').clone(true)); var oppUpload = document.getElementById("oppUpload"); oppUpload.addEventListener("change", oppAttach, false); showOppDetails(currentItem.get_id()); } function storeOppFailure(data) { // Failure callback var errArea = document.getElementById("errAllOpps"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("File upload failed.")); errArea.appendChild(divMessage); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadAttachment()\n {\n if (Office.context.mailbox.item.attachments == undefined)\n {\n app.showNotification(\"Sorry attachments are not supported by your Exchange server.\");\n }\n else if (Office.context.mailbox.item.attachments.length == 0)\n {\n app.showNotification(\"Oops there are no attachments on this email.\");\n }\n else\n {\n var apicall = \"https://api.workflowmax.com/job.api/document?apiKey=\"+ apiKey + \"&accountKey=\" + accountKey;\n\n var documentXML = \"<Document><Job>\" + cJobID + \"</Job><Title>Document Title</Title><Text>Note for document</Text><FileName>test.txt</FileName><Content>\" + string64 + \"</Content></Document>\";\n\n var xhr = new XMLHttpRequest();\n\n xhr.open('POST', apicall);\n\n xhr.send(documentXML);\n }\n }", "function uploadFile() {\n\n // Define the folder path for this example.\n //var serverRelativeUrlToFolder = '/sites/flows/shared documents';\n //var serverRelativeUrlToFolder = '/sites/engineering/Spec and Revision Library/';\n //var dashboardPageUrl = 'https://bjsmarts001.sharepoint.com/sites/engineering/SitePages/Dashboard.aspx';\n\n var serverRelativeUrlToFolder = '/sites/wyman/eswa/data/Spec and Revision Library/';\n var dashboardPageUrl = '/sites/wyman/eswa/';\n\n\n // Get test values from the file input and text input page controls.\n var fileInput = jQuery('#getFile');\n newName = jQuery('#displayName').val();\n\n // Get the server URL.\n var serverUrl = _spPageContextInfo.webAbsoluteUrl;\n\n // Initiate method calls using jQuery promises.\n // Get the local file as an array buffer.\n var getFile = getFileBuffer();\n getFile.done(function (arrayBuffer) {\n\n // Add the file to the SharePoint folder.\n var addFile = addFileToFolder(arrayBuffer);\n addFile.done(function (file, status, xhr) {\n\n // Get the list item that corresponds to the uploaded file. \n _fileListItemUri = file.d.ListItemAllFields.__deferred.uri; \n var getItem = getListItem(_fileListItemUri);\n getItem.done(function (listItem, status, xhr) {\n \n // Change the display name and title of the list item.\n var changeItem = updateListItem(listItem.d.__metadata);\n changeItem.done(function (data, status, xhr) {\n alert('Your spec has been submitted to internal/external reviewers'); \n window.location = dashboardPageUrl;\n });\n changeItem.fail(onChangeItemError); \n });\n getItem.fail(onError); \n });\n addFile.fail(onError); \n });\n getFile.fail(onError);\n \n\n // Get the local file as an array buffer.\n function getFileBuffer() {\n var deferred = jQuery.Deferred();\n var reader = new FileReader();\n reader.onloadend = function (e) {\n deferred.resolve(e.target.result);\n }\n reader.onerror = function (e) {\n deferred.reject(e.target.error);\n }\n reader.readAsArrayBuffer(fileInput[0].files[0]);\n return deferred.promise();\n }\n\n // Add the file to the file collection in the Shared Documents folder.\n function addFileToFolder(arrayBuffer) {\n\n // Get the file name from the file input control on the page.\n var parts = fileInput[0].value.split('\\\\');\n var fileName = parts[parts.length - 1];\n\n // Construct the endpoint.\n var fileCollectionEndpoint = String.format(\n \"{0}/data/_api/web/getfolderbyserverrelativeurl('{1}')/files\" +\n \"/add(overwrite=true, url='{2}')\",\n serverUrl, serverRelativeUrlToFolder, fileName);\n\n // Send the request and return the response.\n // This call returns the SharePoint file.\n return jQuery.ajax({\n url: fileCollectionEndpoint,\n type: \"POST\", \n data: arrayBuffer,\n processData: false,\n beforeSend : function() {\n $.blockUI({ \n message: '<h4>Uploading Document ...</h4>',\n css: { \n border: 'none', \n padding: '15px', \n backgroundColor: '#000', \n '-webkit-border-radius': '10px', \n '-moz-border-radius': '10px', \n opacity: .5, \n color: '#fff' \n } }); \n }, \n complete: function () {\n $.unblockUI(); \n },\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-length\": arrayBuffer.byteLength\n }\n });\n }\n\n // Get the list item that corresponds to the file by calling the file's ListItemAllFields property.\n function getListItem(fileListItemUri) {\n\n // Send the request and return the response.\n return jQuery.ajax({\n url: fileListItemUri,\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" }\n });\n }\n\n // Change the display name and title of the list item.\n function updateListItem(itemMetadata) {\n\n // Define the list item changes. Use the FileLeafRef property to change the display name. \n // For simplicity, also use the name as the title. \n // The example gets the list item type from the item's metadata, but you can also get it from the\n // ListItemEntityTypeFullName property of the list.\n\n //var user = \"8\";\n //var users = \"{ 'results': ['8', '13'] }\";\n var users = getApprovals();\n \n //var extUsers = \"[email protected]\";\n var extUsers = getExternalApprovals();\n\n var body = String.format(\"{{'__metadata':{{'type':'{0}'}},'FileLeafRef':'{1}','Title':'{2}','ApproversId':{3},'Specification':'{4}','Issue':'{5}','ExtApprovers':'{6}'}}\",\n itemMetadata.type, SpecName, SpecName, users, newName, issueName, extUsers );\n \n // var body = String.format(\"{{'__metadata':{{'type':'{0}'}},'FileLeafRef':'{1}','Title':'{2}','ApproversId':{3},'Specification':'{4}','Issue':'{5}'}}\",\n // itemMetadata.type, SpecName, SpecName, users, newName, issueName );\n\n //var body = String.format(\"{{'__metadata':{{'type':'{0}'}},'Title':'{1}','ApproversId':{2}}}\",\n //itemMetadata.type, newName, users );\n \n // Send the request and return the promise.\n // This call does not return response content from the server.\n return jQuery.ajax({\n url: itemMetadata.uri,\n type: \"POST\",\n data: body,\n beforeSend : function() {\n $.blockUI({ \n message: '<h4>Updating Document Properties ...</h4>',\n css: { \n border: 'none', \n padding: '15px', \n backgroundColor: '#000', \n '-webkit-border-radius': '10px', \n '-moz-border-radius': '10px', \n opacity: .5, \n color: '#fff' \n } }); \n }, \n complete: function () {\n $.unblockUI(); \n }, \n headers: {\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-type\": \"application/json;odata=verbose\",\n \"content-length\": body.length,\n \"IF-MATCH\": itemMetadata.etag,\n //\"IF-MATCH\": \"*\",\n \"X-HTTP-Method\": \"MERGE\"\n }\n });\n }\n}", "function uploadFile_(type, env, apiKey, domain, baseUrl, blob) {\n\n var url = baseUrl + \"multimedia/\";\n if (!domain) domain = \"\";\n\n var headers = {\n \"X-DOMAIN\": domain,\n \"X-Auth-Token\": \"api-key \" + apiKey\n };\n var boundary = \"labnol\";\n\n var attributes = \"{\\\"name\\\":\\\"\" + blob.getName() + \"\\\"}\";\n\n var requestBody = Utilities.newBlob(\n \"--\" + boundary + \"\\r\\n\" +\n \"Content-Disposition: form-data; name=\\\"attributes\\\"\\r\\n\\r\\n\" +\n attributes + \"\\r\\n\" + \"--\" + boundary + \"\\r\\n\" +\n \"Content-Disposition: form-data; name=\\\"file\\\"; filename=\\\"\" + blob.getName() + \"\\\"\\r\\n\" +\n \"Content-Type: \" + blob.getContentType() + \"\\r\\n\\r\\n\").getBytes()\n .concat(blob.getBytes())\n .concat(Utilities.newBlob(\"\\r\\n--\" + boundary + \"--\\r\\n\").getBytes());\n\n var options = {\n \"method\": \"post\",\n \"contentType\": \"multipart/form-data; boundary=\" + boundary,\n \"payload\": requestBody,\n \"muteHttpExceptions\": false,\n \"headers\": headers\n };\n\n var response = UrlFetchApp.fetch(url, options);\n\n Logger.log(response.getContentText());\n return response;\n }", "function oppFileOnload(event) {\n contents = event.target.result;\n // The storePOAsAttachment function is called to do the actual work after we have a reference to SP.RequestExecutor.js\n $.getScript(web.get_url() + \"/_layouts/15/SP.RequestExecutor.js\", storeOppAsAttachment);\n}", "function uploadAttachment() {\n $scope.inProgress = true;\n\n var formData = new FormData();\n formData.append('EntityTypeId', $scope.entityTypeId || '');\n formData.append('EntityRecordId', $scope.entityRecordId || '');\n formData.append('AttachmentId', null);\n formData.append('AttachmentTypeId', $scope.selectedAttachmentTypeId || '');\n formData.append('FileDescription', $scope.fileDescription || '');\n formData.append('UserId', $scope.userid || '');\n angular.forEach($scope.files, function(obj) {\n if (!obj.isRemote) {\n fileName = obj.lfFileName;\n formData.append('attachments', obj.lfFile);\n }\n });\n\n var deferred = $q.defer();\n var url = svApiURLs.Attachment;\n var request = {\n 'url': url,\n 'method': 'POST',\n 'data': formData,\n 'headers': {\n 'Content-Type' : undefined // important\n }\n };\n\n $http(request).then(function successCallback(response) {\n $scope.curAttachments = getAttachmentsByEntityTypeId($scope.entityTypeId);\n $scope.fileDescription = '';\n $scope.inProgress = false;\n deferred.resolve(response);\n svToast.showSimpleToast('Attachment \"' + fileName + '\" has been saved successfully.');\n }, function errorCallback(error) {\n $scope.inProgress = false;\n svDialog.showSimpleDialog($filter('json')(error.data), 'Error');\n $mdDialog.hide();\n });\n\n return deferred.promise;\n }", "upload() {\n return this.loader.file\n .then(file => new Promise((resolve, reject) => {\n this._sendRequest(file, resolve, reject);\n }));\n }", "static async Create(req, res) {\n var attachment = req.file;\n var blobName = getBlobName(attachment.originalname);\n const containerClient = blobServiceClient.getContainerClient(containerName);\n await uploadStream(containerClient, blobName, attachment.buffer);\n var url = `https://${key.getStorageAccountName()}.blob.core.windows.net/${containerName}/${blobName}`;\n let body = JSON.parse(req.body.body);\n new mssql.ConnectionPool(config.config).connect().then((pool) => {\n return pool.request().query(`EXEC sp_create_attachment ${body.id_person},${body.id_attachment_catalog},'${url}','${body.description}'`)\n }).then((fields) => {\n mssql.close();\n res.json(\"CREATED SUCCESSFULLY\");\n }).catch((err) => {\n mssql.close();\n res.json(err)\n\n })\n }", "async imageInput(turnContext) {\n\n // Prepare Promises to download each attachment and then execute each Promise.\n const promises = turnContext.activity.attachments.map(this.downloadAttachmentAndWrite);\n const successfulSaves = await Promise.all(promises);\n\n\n async function replyForReceivedAttachments(localAttachmentData) {\n\n // function for making for making asynchronous request \n async function asyncRequest(options) {\n return new Promise((resolve, reject) => {\n request(options, (error, response, body) => resolve({ error, response, body }));\n });\n }\n\n // function for making for making asynchronous request. (POST request)\n async function asyncRequestPost(options) {\n return new Promise((resolve, reject) => {\n request.post(options.url, {\n json: options\n }, (error, response, body) => resolve({ error, response, body }));\n });\n }\n\n // If image uploaded and save, start sending request to Azure for object and scene recognition\n if (localAttachmentData) {\n var imageUrl = './'+localAttachmentData.fileName\n console.log()\n const options = {\n uri: uriBase,\n qs: params,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/octet-stream',\n 'Ocp-Apim-Subscription-Key' : subscriptionKey\n },\n body: fs.readFileSync( imageUrl )\n };\n\n let response = await asyncRequest(options);\n let azureObject = JSON.parse(response.response.body)\n let caption = \"\";\n let tags = azureObject.description.tags;\n if (azureObject.description.captions.length > 0) {\n caption = azureObject.description.captions[0].text\n }\n\n //console.log(caption)\n //console.log(tags)\n\n /* after getting reponse from Azure, start sending request to poem generater API\n */\n let options_poem = {\n \"url\":\"http://localhost:5000/todo/api/v1.0/tasks\",\n \"inputString\":caption,\n \"inputTags\":tags,\n \"queryType\":\"Image\"\n };\n let response_poem = await asyncRequestPost(options_poem);\n //let jsonResponse_poem = JSON.stringify(response_poem.response.body.task, null, ' ')\n var printPoem = response_poem.response.body.task.poem.join(\"\\r\\n\")\n var printkeywords = response_poem.response.body.task.keywords.join(\"\\r\\n\")\n \n\n await this.sendActivity(`Keywords: \\n ${ printkeywords } ` )\n await this.sendActivity(`Poem: \\n ${ printPoem } ` )\n } else {\n await this.sendActivity('Attachment was not successfully saved to disk.');\n }\n }\n\n // Prepare Promises to reply to the user with information about saved attachments.\n // The current TurnContext is bound so `replyForReceivedAttachments` can also send replies.\n const replyPromises = successfulSaves.map(replyForReceivedAttachments.bind(turnContext));\n await Promise.all(replyPromises);\n }", "function clickSendAttachments(inputFile) {\n // upload image\n QB.content.createAndUpload({name: inputFile.name, file: inputFile, type:\n inputFile.type, size: inputFile.size, 'public': false}, function(err, response){\n if (err) {\n console.log(err);\n } else {\n $(\"#progress\").fadeOut(400);\n var uploadedFile = response;\n\n sendMessageQB(\"[attachment]\", uploadedFile.id);\n\n $(\"input[type=file]\").val('');\n }\n });\n}", "function handleFileAttach(issueKey, jiraProxyRootUrl) {\n var form = document.forms.namedItem(\"feedbackfrm\");\n var oData = new FormData(form);\n\n var url = jiraProxyRootUrl + \"jiraproxyattchmnt\";\n\n var oReq = new XMLHttpRequest();\n oReq.open(\"POST\", url, true);\n oReq.onload = function (oEvent) {\n if (oReq.status == 200) {\n if (oJIRA_FDBCK.DEBUG) {\n console.log(oJIRA_FDBCK.LOGGINGPREFIX + \"File(s) successfully uploaded.\");\n }\n } else {\n console.error(oJIRA_FDBCK.LOGGINGPREFIX + \"Error: \" + oReq.status + \" occurred when trying to upload file(s).\");\n }\n };\n oData.append(\"issue\", issueKey);\n oReq.send(oData);\n }", "function uploadNext() {\n var xhr = new XMLHttpRequest();\n var fd = new FormData();\n var file = document.getElementById('files').files[filesUploaded];\n fd.append(\"multipartFile\", file);\n xhr.upload.addEventListener(\"progress\", onUploadProgress, false);\n xhr.addEventListener(\"load\", onUploadComplete, false);\n xhr.addEventListener(\"error\", onUploadFailed, false);\n xhr.open(\"POST\", \"save-product\");\n debug('uploading ' + file.name);\n xhr.send(fd);\n }", "function uploadAndAttachNewResource(event) {\n var formData = new FormData();\n var resourceData = {}\n var title = \"\"\n if ($('#resourceImportModal .fileInput').attr('type') === 'button') { //using icab\n formData = new FormData($('#resourceImportModal #fileUploadIcabFix')[0])\n title = $('#resourceImportModal .fileInput').val()\n if (title == \"Select File\" && $('#resourceImportModal #fileUploadIcabFix input[type=\"hidden\"]').length == 0) {\n $('#resourceImportModal #upload .validation-box').addClass('error required')\n return\n }\n resourceData['type'] = 'file'\n formData.append('title', title)\n //formData.append('file', file, file.name)\n } else {\n var files = $('#resourceImportModal .fileInput')[0].files\n if (files.length == 0) {\n $('#resourceImportModal #upload .validation-box').addClass('error required')\n return\n }\n var file = files[0]\n title = file.name\n resourceData['content-type'] = file.type\n if (file.type.split('/')[0] == 'image') {\n resourceData['type'] = 'image'\n } else if (file.type.indexOf('pdf') != -1) {\n resourceData['type'] = 'pdf'\n } else {\n resourceData['type'] = 'file'\n }\n formData.append('file', file, file.name)\n formData.append('title', file.name)\n }\n formData.append('owner', 'schoolbag')\n formData.append('creator', 'noticeboard')\n formData.append('clientId', $('.hidden input[name=\"client-id\"]').val())\n formData.append('key', $('.hidden input[name=\"key\"]').val())\n\n resourceFunctions.uploadResource(resourceData, formData, function(response) {\n var row = $('<div>')\n row.append('<input type=\"hidden\" name=\"file-id\" value=\"' + response.id + '\">')\n row.append('<span class=\"col-sm-9\">' + title + '</span>')\n $('#openAddResourceModal').before(row)\n\n var remove = $('<span class=\"col-sm-3\"><span class=\"btn-remove btn-icon fa fa-times\" title=\"Remove\"></span></span>')\n row.append(remove)\n remove.on('click', function(event) {\n $(event.currentTarget).closest('div').remove()\n })\n $('#resourceImportModal').modal('hide')\n }, function(request, status, error){\n $('#resourceImportModal #upload .error').removeClass('hidden')\n $('#resourceImportModal #upload .loading').addClass('hidden')\n })\n $('#resourceImportModal #upload .contents').addClass('hidden')\n $('#resourceImportModal #upload .loading').removeClass('hidden')\n $('#resourceImportModal button.close').addClass('hidden')\n }", "upload(file, folderId, folderPath, fileName, charsetHunch, options, options = { headers: {} }) {\n return __awaiter(this, void 0, void 0, function* () {\n const localVarPath = this.basePath + '/files/v3/files';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', '*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n if (file !== undefined) {\n localVarFormParams['file'] = file;\n }\n localVarUseFormData = true;\n if (folderId !== undefined) {\n localVarFormParams['folderId'] = models_1.ObjectSerializer.serialize(folderId, \"string\");\n }\n if (folderPath !== undefined) {\n localVarFormParams['folderPath'] = models_1.ObjectSerializer.serialize(folderPath, \"string\");\n }\n if (fileName !== undefined) {\n localVarFormParams['fileName'] = models_1.ObjectSerializer.serialize(fileName, \"string\");\n }\n if (charsetHunch !== undefined) {\n localVarFormParams['charsetHunch'] = models_1.ObjectSerializer.serialize(charsetHunch, \"string\");\n }\n if (options !== undefined) {\n localVarFormParams['options'] = models_1.ObjectSerializer.serialize(options, \"string\");\n }\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.hapikey.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.hapikey.applyToRequest(localVarRequestOptions));\n }\n if (this.authentications.oauth2.accessToken) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.oauth2.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = models_1.ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n });\n }", "function upload_image()\n{\n\n const file = document.querySelector('input[type=file]').files[0];\n //const reader = new FileReader();\n send_request_and_receive_payload(file)\n\n\n/*\n reader.addEventListener(\"load\", () => {\n\tsend_request_and_receive_payload(reader.result);\n });\n\n if (file) {\n\treader.readAsDataURL(file);\n }\n*/\n\n}", "function upload_file(data){\n\t\tvar file_obj = upload_info[data.file_name].file;\n\t\tconsole.log('UploadFile: ', data.signed_request,' URL: ',data.url,'F_name: ', data.file_name,'OrgFileName: ',file_obj.name);\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"PUT\", data.signed_request);\n\t\txhr.setRequestHeader('x-amz-acl', 'public-read');\n\t\txhr.upload.addEventListener(\"progress\", update_progress);\n\t\txhr.onload = function() {\n\t\t\tupload_success(xhr.status,data.url,file_obj.name,data.file_name);\n\t\t};\n\t\txhr.onerror = function() {\n\t\t\talert(\"Could not upload file.\");\n\t\t};\n\t\txhr.send(file);\n\t}", "function _uploadAttachment(apiHost, eventType, uploadDesc, formData) {\r\n var deferred = $q.defer();\r\n var strURL = checkURL(apiHost + ATTACHMENT_UPLOAD_URL.replace('<eventType>',eventType).replace('<uploadDesc>',uploadDesc));\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: strURL,\r\n dataType: 'json',\r\n processData: false,\r\n contentType: false,\r\n data: formData\r\n }).success(function(response) {\r\n deferred.resolve(response);\r\n }).error(function(response) {\r\n deferred.resolve(response);\r\n });\r\n \r\n return deferred.promise; \r\n \r\n }", "function triggerSaveRequest(this_file){\n\tconsole.log(\"your file info is \");\n\tconsole.log(this_file);\n\tvar fd = new FormData();\n\tfd.append('blob', this_file, this_video_name);\n\tconsole.log(fd);\n\tfetch('/save',\n\t{\n\t method: 'post',\n\t body: fd\n\t});\n}", "function addFileToFolder(arrayBuffer, fileInput, serverUrl, serverRelativeUrlToFolder) {\n \n // Get the file name from the file input control on the page.\n var parts = fileInput[0].value.split('\\\\');\n var fileName = parts[parts.length - 1];\n\n // Construct the endpoint.\n var fileCollectionEndpoint = String.format(\n \"{0}/data/_api/web/getfolderbyserverrelativeurl('{1}')/files\" +\n \"/add(overwrite=true, url='{2}')\",\n serverUrl, serverRelativeUrlToFolder, fileName);\n\n // Send the request and return the response.\n // This call returns the SharePoint file.\n return jQuery.ajax({\n url: fileCollectionEndpoint,\n type: \"POST\", \n data: arrayBuffer,\n processData: false,\n beforeSend : function() {\n // $.blockUI({ \n // message: '<h4>Uploading Document ...</h4>',\n // css: { \n // border: 'none', \n // padding: '15px', \n // backgroundColor: '#000', \n // '-webkit-border-radius': '10px', \n // '-moz-border-radius': '10px', \n // opacity: .5, \n // color: '#fff' \n // } }); \n }, \n complete: function () {\n // $.unblockUI(); \n },\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-length\": arrayBuffer.byteLength\n }\n });\n}", "function postFileObj(reqPkg) { // console.log('postFileObj called. reqPkg%O', reqPkg);\n asyncErr() || reqPkg.fSysEntry.file(function (fileObj) {\n postMsg('fileObj', pkgFSysResponse(reqPkg, fileObj));\n }); \n }", "async uploadFile(importFilePath) {\n }", "async uploadFile(importFilePath) {\n }", "_uploadImage(file) {\n if (!this._isImage(file)) {\n return;\n }\n\n const userFileAttachment = new RB.UserFileAttachment({\n caption: file.name,\n });\n\n userFileAttachment.save()\n .then(() => {\n this.insertLine(\n `![Image](${userFileAttachment.get('downloadURL')})`);\n\n userFileAttachment.set('file', file);\n userFileAttachment.save()\n .catch(err => alert(err.message));\n })\n .catch(err => alert(err.message));\n }", "async _uploadPart(filename, uploadID, partNumber, blob, options) {\n const path = options.dashboard && options.widget ? `/data/files/${options.dashboard}/${options.widget}` : `/files`;\n const form = new form_data_1.default();\n form.append(\"filename\", filename);\n form.append(\"upload_id\", uploadID);\n form.append(\"part\", String(partNumber));\n form.append(\"file\", blob, filename);\n form.append(\"multipart_action\", \"upload\");\n const headers = { \"Content-Type\": \"multipart/form-data\" };\n const result = await this.doRequest({\n path,\n method: \"POST\",\n body: form,\n headers,\n });\n return {\n ETag: result.ETag,\n PartNumber: partNumber,\n };\n }", "static async Update(req, res) {\n let body = JSON.parse(req.body.body);\n var attachment = req.file;\n var url = \"\";\n if (typeof attachment !== 'undefined') {\n let blobnameold = body.attachment_old.split(\"/\")[(body.attachment_old.split(\"/\").length - 1)];\n const containerClientold = blobServiceClient.getContainerClient(containerName);\n const blobClientold = containerClientold.getBlobClient(blobnameold);\n const blockBlobClientold = blobClientold.getBlockBlobClient();\n try {\n await blockBlobClientold.delete();\n } catch (error) { }\n const blobName = getBlobName(attachment.originalname);\n const containerClient = blobServiceClient.getContainerClient(containerName);\n url = `https://${key.getStorageAccountName()}.blob.core.windows.net/${containerName}/${blobName}`;\n await uploadStream(containerClient, blobName, attachment.buffer);\n } else {\n url = body.attachment_old;\n }\n new mssql.ConnectionPool(config.config).connect().then((pool) => {\n return pool.request().query(`EXEC sp_update_attachment ${body.id_attachment},${body.id_person},${body.id_attachment_catalog},'${url}','${body.description}'`)\n }).then((fields) => {\n mssql.close();\n res.json(\"UPDATED SUCCESSFULLY\");\n }).catch(err => {\n mssql.close();\n res.json(err);\n })\n }", "function uploadMediaFile(locationURL_) {\n\t//Build post string from object\n\t\n var post_data = querystring.stringify({\n 'username' : username,\n 'url' : locationURL_\n });\n \n //create the request parameter object\n \n var request_parameters = {\n\t host : 'voice.africastalking.com',\n\t port : 443,\n\t path : '/mediaUpload',\n\t \n\t method : 'POST',\n\t \n\t rejectUnauthorized : false,\n\t requestCert : true,\n\t agent : false,\n\t \n\t headers : { \n 'Content-Type' : 'application/x-www-form-urlencoded',\n 'Content-Length' : post_data.length,\n 'apikey' : apiKey,\n 'Accept' : 'application/json'\n }\n\t }\n \n request = https.request(request_parameters, function (response) {\n \tresponse.setEncoding('utf8');\n \tresponse.on('data', function (data_chunk) {\n \t\ttry {\n \t\t\tvar jsObject = JSON.parse(data_chunk);\n \t\t\tif(jsObject.Status != \"Success\")\n \t\t\t throw jsObject.ErrorMessage;\n \t\t\t \n \t\t\t console.log('File uploaded. Time for song and dance');\n \t\t}\n \t\tcatch (error) {\n \t\t\tconsole.log(\"Error: \" + error);\n \t\t\t}\n \t\t});\n \t});\n \n request.write(post_data);\n request.end();\n}", "async handleAttachments () {\n\t\t// not yet supported\n\t}", "function uploadFile(uploadObject) {\r\n//\tconsole.log(uploadObject);\r\n showProgressAnimation();\r\n\t/* Create a FormData instance */\r\n var formData = new FormData();\r\n\t/* Add the file */\r\n formData.append(\"file\", uploadObject.file.files[0]);\r\n formData.append(\"fkId\", uploadObject.fkId);\r\n formData.append(\"uploadType\", uploadObject.type);\r\n formData.append(\"folderType\", uploadObject.folderType);\r\n $.ajax({\r\n url: 'uploadFile', // point to server-side\r\n dataType: 'text', // what to expect back from server, if anything\r\n cache: false,\r\n contentType: false,\r\n processData: false,\r\n data: formData,\r\n type: 'post',\r\n success: function(response){\r\n uploadObject.hideProgressAnimation();\r\n if(uploadObject.message && uploadObject.message != '') {\r\n showMessageContent('Success', uploadObject.message);\r\n }\r\n if(uploadObject.url && uploadObject.url != '') {\r\n window.location.href = uploadObject.url;\r\n }\r\n\r\n },\r\n error:function(){\r\n uploadObject.hideProgressAnimation();\r\n if(uploadObject.message && uploadObject.message != '') {\r\n showMessageContent('Success', uploadObject.message);\r\n }\r\n }\r\n });\r\n}", "resume_() {\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", this.url, true);\n xhr.setRequestHeader(\"Content-Range\", \"bytes */\" + this.file.size);\n xhr.setRequestHeader(\"X-Upload-Content-Type\", this.file.type);\n if (xhr.upload) {\n xhr.upload.addEventListener(\"progress\", this.onProgress);\n }\n xhr.onload = this.onContentUploadSuccess_.bind(this);\n xhr.onerror = this.onContentUploadError_.bind(this);\n xhr.send();\n }", "function upload() {\n if (resumable == null)\n resumable = resumableInit(fileInfo, uploadCompleteHandler);\n}", "static async postUpload(request, response) {\n const { userId } = await userUtils.getUserIdAndKey(request);\n\n if (!basicUtils.isValidId(userId)) {\n return response.status(401).send({ error: 'Unauthorized' });\n }\n if (!userId && request.body.type === 'image') {\n await fileQueue.add({});\n }\n\n const user = await userUtils.getUser({\n _id: ObjectId(userId),\n });\n\n if (!user) return response.status(401).send({ error: 'Unauthorized' });\n\n const { error: validationError, fileParams } = await fileUtils.validateBody(\n request\n );\n\n if (validationError)\n return response.status(400).send({ error: validationError });\n\n if (fileParams.parentId !== 0 && !basicUtils.isValidId(fileParams.parentId))\n return response.status(400).send({ error: 'Parent not found' });\n\n const { error, code, newFile } = await fileUtils.saveFile(\n userId,\n fileParams,\n FOLDER_PATH\n );\n\n if (error) {\n if (response.body.type === 'image') await fileQueue.add({ userId });\n return response.status(code).send(error);\n }\n\n if (fileParams.type === 'image') {\n await fileQueue.add({\n fileId: newFile.id.toString(),\n userId: newFile.userId.toString(),\n });\n }\n\n return response.status(201).send(newFile);\n }", "function fileUpload() {\n\tvar files = this.files;\n\tvar sendData = new FormData();\n\tsendData.append('tree', properties.toLink());\n\tsendData.append('types', properties.typesAllowed);\n\tsendData.append('action', 'upload');\n\tif (files.length > 1) {\n\t\tfor (var f = 0; f < files.length; f++) {\n\t\t\tsendData.append('upload[]', files[f]);\n\t\t}\n\t} else\n\t\tsendData.append('upload', files[0]);\n\tsendFilehandlingRequest(sendData);\n}", "function upload(email, session) {\n $.ajax({\n 'url': 'client.php',\n 'data': {\n 'email': email,\n 'session': session,\n 'method': 'static_upload',\n 'file_type': file_type\n },\n 'method': 'POST',\n 'dataType': 'json',\n 'success': function(response) {\n if (response.success) {\n //Set file_id\n client.setOption('file_id', response.result.file_id);\n //Show wizard page\n $('#upload_file').hide();\n $('.api-box').show();\n //Start wizard\n wizard.init();\n }\n }\n })\n}", "finishUpload(uploadId, fileOffset, fragment) {\r\n return this.clone(File, `finishUpload(uploadId = guid'${uploadId}', fileOffset = ${fileOffset})`, false)\r\n .postCore({ body: fragment })\r\n .then(response => {\r\n return {\r\n data: response,\r\n file: new File(odataUrlFrom(response)),\r\n };\r\n });\r\n }", "function onPhotoDataSuccess(imageData) {\n // Uncomment to view the base64-encoded image data\n console.log(\"imageData:%s\",imageData);\n // Get image handle\n var smallImage = document.getElementById('smallImage');\n // Unhide image elements\n smallImage.style.display = 'block';\n if ( $('#woNumber')[0].selectedIndex != 0 ) {\n $('.btnupload').prop('disabled',false);\n }\n // Show the captured photo\n // The in-line CSS rules are used to resize the image\n smallImage.src = \"data:image/jpeg;base64,\" + imageData;\n /****************************************************/\n // create blob object from the base64-encoded image data\n blob = dataURItoBlob(smallImage.src);\n //var fd = new FormData(document.forms[0]);\n console.log('blob in capture.js:',blob);\n\n \n //formData.append('file', blob);\n /* This code is for testing\n var attachUrl = 'http://10.0.2.2:9090/rest/api/2/issue/' + $('#woNumber option:selected').val() + '/attachments'\n $.ajax({\n\n beforeSend: function(xhr){xhr.setRequestHeader(\"X-Atlassian-Token\", \"no-check\");},\n url: attachUrl , // Url to which the request is send\n type: \"POST\", // Type of request to be send, called as method\n data: formData, // Data sent to server, a set of key/value pairs (i.e. form fields and values)\n contentType: false, // The content type used when sending data to the server.\n cache: false, // To unable request pages to be cached\n processData:false, // To send DOMDocument or non processed data file it is set to false\n success: function(data) // A function to be called if request succeeds\n {\n console.log('uploaded to jira'); \n alert('Success - Uploaded'); \n $('#loading').hide();\n $(\"#message\").html(data);\n },\n error: function(data){\n console.log('fail to upload');\n }\n }); \n */ \n/****************************************************/\n\n }", "function upload()\n {\n // Set headers\n vm.ngFlow.flow.opts.headers = {\n 'X-Requested-With': 'XMLHttpRequest',\n //'X-XSRF-TOKEN' : $cookies.get('XSRF-TOKEN')\n };\n\n vm.ngFlow.flow.upload();\n }", "uploadFile(file, cb) {\n\n function transferComplete(e) {\n if(e.currentTarget.status === 200) {\n var data = JSON.parse(e.currentTarget.response)\n var path = '/media/' + data.name\n cb(null, path)\n } else {\n cb(new Error(e.currentTarget.response))\n }\n }\n\n function updateProgress(e) {\n if (e.lengthComputable) {\n //var percentage = (e.loaded / e.total) * 100;\n //self.documentSession.hubClient.emit('upload', percentage);\n }\n }\n\n var formData = new window.FormData()\n formData.append(\"files\", file)\n var xhr = new window.XMLHttpRequest()\n xhr.addEventListener(\"load\", transferComplete)\n xhr.upload.addEventListener(\"progress\", updateProgress)\n xhr.open('post', this.config.httpUrl, true)\n xhr.send(formData)\n }", "function uploadFileMeta(filePath,user_id,CT,shared_users,t,url)\n{\n //once we have successfully uploaded file on dropbox we need to upload metadata on cloud server as well\n var data = {\n \"filePath\":filePath,\n \"owner\":user_id,\n \"CT\":CT,\n \"shared\":shared_users,\n \"t\":t,\n \"shared_url\":url,\n \"file_signature\": \"signature\",\n \"public_key\": \"public\"\n };\n var oReq = new XMLHttpRequest();\n oReq.open(\"POST\",CLOUD_SERVER+'upload_file_meta',true);\n oReq.responseType = \"json\";\n oReq.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n oReq.onload = function(oEvent){\n if(oReq.response.success)\n console.log(\"File metadata uploaded successfully.\");\n };\n oReq.send(JSON.stringify(data)); \n}", "async createMultipartUpload(filename, options) {\n const path = options.dashboard && options.widget ? `/data/files/${options.dashboard}/${options.widget}` : `/files`;\n const result = await this.doRequest({\n path,\n method: \"POST\",\n body: {\n multipart_action: \"start\",\n filename,\n public: options.isPublic,\n contentType: options.contentType,\n },\n });\n return result;\n }", "addFile(name, bytes) {\r\n return this.postCore({\r\n body: jsS({\r\n \"@odata.type\": \"#microsoft.graph.fileAttachment\",\r\n contentBytes: bytes,\r\n name: name,\r\n }),\r\n });\r\n }", "function upload() {\n // Set headers\n vm.ngFlow.flow.opts.headers = {\n 'X-Requested-With': 'XMLHttpRequest',\n //'X-XSRF-TOKEN' : $cookies.get('XSRF-TOKEN')\n };\n\n vm.ngFlow.flow.upload();\n }", "function uploadViewerFile(arg){\n\n\tvar deferred = Q.defer();\n\t\n\tvar view_upload_srv_Str = credentials.viewer_credentials.BaseUrl +\n\t\t\t\t\t\t\t\tcredentials.viewer_credentials.ViewerUploadFileSrv + '/' +\n\t\t\t\t\t\t\t\tcredentials.viewer_credentials.BucketNameStr +\n\t\t\t\t\t\t\t\t '/objects/' + arg.filename;\n\tvar options = {\n\t\tmethod: 'PUT',\n\t\turi: view_upload_srv_Str,\n\t\theaders:{ 'Authorization': 'Bearer ' + arg.token,\n\t\t\t\t 'Content-Type': 'application/stream' }, \n\t\t body:arg.fileblob\n\t}; \n\t\n\t request.put(options, \n\t\t\t\t function optionalCallback(err, httpResponse, body) {\t\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t if(err){\n\t\t\t\t\t\tvar msg = '>>uploadViewerFile Failed!>>'+ arg.fullfilename+ '>>' + err ;\n\t\t\t\t\t\tconsole.log(new Date().toISOString() + msg);\t\n\t\t\t\t\t\tdeferred.reject(msg);\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif(httpResponse.statusCode == 200){\n\t\t\t\t\t\t\tvar json = eval('(' + body + ')'); \n\t\t\t\t\t\t\tvar base64URN = Helper.Base64.encode(json.objects[0].id); \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar str = '>>uploadViewerFile ok!>>' + base64URN;\n\t\t\t\t\t\t\tconsole.log(new Date().toISOString() +str);\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(arg.isMainDWG)\n\t\t\t\t\t\t\t\targ.viewurn = base64URN;\n\t\t\t\t\t\t\targ.fileblob = ''; \n\t\t\t\t\t\t\tdeferred.resolve(arg);\t\t\n \t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tvar msg = '>>uploadViewerFile Failed!>> response code:' + httpResponse.statusCode ;\n\t\t\t\t\t\t\tconsole.log(new Date().toISOString() + msg);\t\n \t\t\t\t\t\t\tdeferred.reject(msg);\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn deferred.promise;\n\t\t\t }); \n\treturn deferred.promise;\n}", "static async postUpload(request, response) {\n const fileQueue = new Queue('fileQueue');\n // Retrieve the user based on the token\n const userId = await findUserIdByToken(request);\n if (!userId) return response.status(401).json({ error: 'Unauthorized' });\n\n let fileInserted;\n\n // Validate the request data\n const { name } = request.body;\n if (!name) return response.status(400).json({ error: 'Missing name' });\n const { type } = request.body;\n if (!type || !['folder', 'file', 'image'].includes(type)) { return response.status(400).json({ error: 'Missing type' }); }\n\n const isPublic = request.body.isPublic || false;\n const parentId = request.body.parentId || 0;\n const { data } = request.body;\n if (!data && !['folder'].includes(type)) { return response.status(400).json({ error: 'Missing data' }); }\n // parentId (optional) as ID of the parent (default 0-> root)\n if (parentId !== 0) {\n const parentFileArray = await dbClient.files.find({ _id: ObjectID(parentId) }).toArray();\n if (parentFileArray.length === 0) return response.status(400).json({ error: 'Parent not found' });\n const file = parentFileArray[0];\n if (file.type !== 'folder') return response.status(400).json({ error: 'Parent is not a folder' });\n }\n\n // if no data, and not a folder, error\n if (!data && type !== 'folder') return response.status(400).json({ error: 'Missing Data' });\n\n // if type is folder then insert into DB, owner is ObjectID(userId)\n if (type === 'folder') {\n fileInserted = await dbClient.files.insertOne({\n userId: ObjectID(userId),\n name,\n type,\n isPublic,\n parentId: parentId === 0 ? parentId : ObjectID(parentId),\n });\n // if not folder, store file in DB unscrambled\n } else {\n // Create a folder for this file\n const folderPath = process.env.FOLDER_PATH || '/tmp/files_manager';\n if (!fs.existsSync(folderPath)) fs.mkdirSync(folderPath, { recursive: true }, () => {});\n // the actual location is the root computer 'C:/tmp/files_manager\n\n // Create an ID and a new path to the new file\n const filenameUUID = uuidv4();\n const localPath = `${folderPath}/${filenameUUID}`;\n\n // Unscramble data and write to new path\n const clearData = Buffer.from(data, 'base64');\n await fs.promises.writeFile(localPath, clearData.toString(), { flag: 'w+' });\n await fs.readdirSync('/').forEach((file) => {\n console.log(file);\n });\n\n // Insert into the DB\n fileInserted = await dbClient.files.insertOne({\n userId: ObjectID(userId),\n name,\n type,\n isPublic,\n parentId: parentId === 0 ? parentId : ObjectID(parentId),\n localPath,\n });\n\n // if the file is an image, save it in binary\n if (type === 'image') {\n await fs.promises.writeFile(localPath, clearData, { flag: 'w+', encoding: 'binary' });\n await fileQueue.add({ userId, fileId: fileInserted.insertedId, localPath });\n }\n }\n\n // Return the new file with a status code 201\n return response.status(201).json({\n id: fileInserted.ops[0]._id, userId, name, type, isPublic, parentId,\n });\n }", "function uploadFile(file, callback) {\n\n var now = new Date();\n\n function two(x) {\n return x <= 9 ? '0' + x : x;\n }\n\n // file prefix - current timestamp\n var prefix = now.getFullYear()\n + \"_\" + two(now.getMonth())\n + \"_\" + two(now.getDay())\n + \"_\" + two(now.getHours())\n + \"_\" + two(now.getMinutes())\n + \"_\" + two(now.getSeconds()) + \"_\";\n\n // FileList page url\n var fileListUrl = location.origin + \"/Tools/Private/FileList.aspx\";\n\n fetch(fileListUrl).then(function (response) {\n\n var p = new DOMParser();\n response.text().then(function (html) {\n\n var doc = p.parseFromString(html, \"text/html\");\n var __EVENTTARGET = doc.querySelector(\"#__EVENTTARGET\").getAttribute(\"value\");\n // console.log('__EVENTTARGET=', __EVENTTARGET);\n var __EVENTARGUMENT = doc.querySelector(\"#__EVENTARGUMENT\").getAttribute(\"value\");\n // console.log('__EVENTARGUMENT=', __EVENTARGUMENT);\n var __VIEWSTATE = doc.querySelector(\"#__VIEWSTATE\").getAttribute(\"value\");\n // console.log('__VIEWSTATE=', __VIEWSTATE);\n var __VIEWSTATEGENERATOR = doc.querySelector(\"#__VIEWSTATEGENERATOR\").getAttribute(\"value\");\n // console.log('__VIEWSTATEGENERATOR=', __VIEWSTATEGENERATOR);\n var __EVENTVALIDATION = doc.querySelector(\"#__EVENTVALIDATION\").getAttribute(\"value\");\n // console.log('__EVENTVALIDATION=', __EVENTVALIDATION);\n\n var formData = new FormData();\n formData.append(\"__EVENTTARGET\", __EVENTTARGET);\n formData.append(\"__EVENTARGUMENT\", __EVENTARGUMENT);\n formData.append(\"__VIEWSTATE\", __VIEWSTATE);\n formData.append(\"__VIEWSTATEGENERATOR\", __VIEWSTATEGENERATOR);\n formData.append(\"__EVENTVALIDATION\", __EVENTVALIDATION);\n formData.append(\"uploadedFile\", file, prefix + file.name);\n formData.append('uploadButton', 'Загрузить');\n\n fetch(fileListUrl, { method: \"POST\", body: formData }).then(function (response) {\n\n response.text().then(function (newHtml) {\n var newDoc = p.parseFromString(newHtml, \"text/html\");\n var a = newDoc.querySelector(\"#errorText > a\");\n if (a) {\n callback(a.href);\n } else {\n var errorTextNode = newDoc.querySelector(\"#errorText\");\n console.warn(\"File uploaded but href for the uploaded file not found\");\n if (errorTextNode && errorTextNode.textContent)\n callback(errorTextNode.textContent);\n }\n }, function (err) {\n console.error('Cannot read upload file page content', err);\n })\n }, function (err) {\n console.error('Failed to upload file (POST filaed):', fileListUrl, err);\n })\n }, function (err) {\n console.error('Failed to read files page content:', err);\n });\n\n }, function (err) {\n console.error('Failed to get files page (GET filaed):', fileListUrl, err);\n })\n }", "async uploadDocumentToIPFS() {\n const formData = new FormData();\n const files = Array.from(document.querySelector(\"#document\").files);\n if (files.length > 0) {\n if (this.approveFileType(files[0])) {\n formData.set(\"document\", files[0]);\n const { IpfsHash } = await fetch(\"http://localhost:3000/upload\", {\n method: \"POST\",\n body: formData,\n }).then((response) => response.json());\n return IpfsHash;\n } else {\n new Alert(\n \"#alert-container\",\n \"alert\",\n \"danger\",\n \"File type is not approved\"\n );\n }\n } else {\n return \"\";\n }\n }", "async handleFileUploads(req, res) {\n if (typeof apollo_server_core_1.processFileUploads !== 'function') {\n return;\n }\n const contentType = req.headers['content-type'];\n if (this.uploadsConfig && contentType && contentType.startsWith('multipart/form-data')) {\n ;\n req.filePayload = await apollo_server_core_1.processFileUploads(req, res, this.uploadsConfig);\n }\n }", "function handleUploads() {\n \n}", "async addAttachements(data) {\n const url = API_URL + \"/Container/remoteMethod/upload\";\n return new Promise((resolve, reject) => {\n var xhr = new XMLHttpRequest();\n var fd = new FormData();\n\n xhr.open(\"POST\", url, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4 && xhr.status == 200) {\n resolve(JSON.parse(xhr.responseText));\n } else {\n reject(\"error\");\n }\n };\n\n fd.append(\"file\", data);\n xhr.send(fd);\n });\n }", "function storeFile(fileRequest, username, callback) {\n db = app.get(\"db_conn\");\n grid = app.get(\"grid_conn\");\n\n // source - Inbox/Outbox/Upload\n // details - Some details about the file (doctor name (sender )for Inbox, user comments for Upload, doctor name (to whom it was sent) for Outbox)\n var source = '';\n var details = '';\n\n if (fileRequest.source) {\n source = fileRequest.source;\n }\n if (fileRequest.details) {\n details = fileRequest.details;\n }\n\n console.log(\"Storage PUT call\");\n //console.log(fileRequest);\n\n if (fileRequest.filename === undefined || fileRequest.filename.length < 1 || fileRequest.filename === null) {\n callback('Error, filname bad.');\n }\n\n if (fileRequest.file === undefined || fileRequest.file.length < 1 || fileRequest.file === null) {\n callback('Error, file bad.');\n }\n\n var fileType = 'binary/octet-stream';\n if (fileRequest.filename && fileRequest.filename.length > 3) {\n var extension = fileRequest.filename.substring(fileRequest.filename.lastIndexOf(\".\") + 1, fileRequest.filename.length);\n if (extension.toLowerCase() === 'xml') {\n fileType = 'text/xml';\n }\n }\n\n //console.log(\"---\");\n //console.log(fileRequest.file);\n //console.log(\"---\");\n\n try {\n var bb = blueButton(fileRequest.file);\n\n var bbMeta = bb.document();\n\n if (bbMeta.type === 'ccda') {\n fileType = \"CCDA\";\n }\n } catch (e) {\n //do nothing, keep original fileType\n console.log(e);\n }\n\n //TODO: Fix once auth is implemented.\n var buffer = new Buffer(fileRequest.file);\n grid.put(buffer, {\n metadata: {\n source: source,\n details: details,\n owner: username,\n parsedFlag: false\n },\n 'filename': fileRequest.filename,\n 'content_type': fileType\n }, function(err, fileInfo) {\n if (err) {\n throw err;\n }\n var recordId = fileInfo._id;\n //console.log(\"Record Stored in Gridfs: \" + recordId);\n callback(err, fileInfo);\n });\n\n}", "function addFileToFolder(arrayBuffer) {\n\n // Get the file name from the file input control on the page.\n var parts = fileInput[0].value.split('\\\\');\n var fileName = parts[parts.length - 1];\n\n // Construct the endpoint.\n var fileCollectionEndpoint = String.format(\n \"{0}/data/_api/web/getfolderbyserverrelativeurl('{1}')/files\" +\n \"/add(overwrite=true, url='{2}')\",\n serverUrl, serverRelativeUrlToFolder, fileName);\n\n // Send the request and return the response.\n // This call returns the SharePoint file.\n return jQuery.ajax({\n url: fileCollectionEndpoint,\n type: \"POST\", \n data: arrayBuffer,\n processData: false,\n beforeSend : function() {\n $.blockUI({ \n message: '<h4>Uploading Document ...</h4>',\n css: { \n border: 'none', \n padding: '15px', \n backgroundColor: '#000', \n '-webkit-border-radius': '10px', \n '-moz-border-radius': '10px', \n opacity: .5, \n color: '#fff' \n } }); \n }, \n complete: function () {\n $.unblockUI(); \n },\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-length\": arrayBuffer.byteLength\n }\n });\n }", "function addAttachment(image, key){\n var xhr = new XMLHttpRequest();\n\n var formData = new FormData();\n formData.append(\"file\", image, \"Screenshot.jpeg\");\n\n xhr.open(\"POST\", \"https://yexttest.atlassian.net/rest/api/2/issue/\"+key+\"/attachments/\", false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"X-Atlassian-Token\", \"no-check\");\n xhr.onreadystatechange=function() {\n if (xhr.readyState === 4){ //if complete\n if(xhr.status === 200){ //check if \"OK\" (200)\n var result = JSON.parse(xhr.responseText);\n var jiraURL = \"https://yexttest.atlassian.net/browse/\" + key\n chrome.tabs.create({ url: jiraURL });\n }\n else {\n console.log(\"Error\", xhr.responseText);\n }\n }\n }\n\n xhr.send(formData);\n}", "function addFileToFolder(arrayBuffer) {\n \n // Get the file name from the file input control on the page.\n var parts = fileInput[0].value.split('\\\\');\n var fileName = parts[parts.length - 1];\n \n // Construct the endpoint.\n var fileCollectionEndpoint = String.format(\n \"{0}/data/_api/web/getfolderbyserverrelativeurl('{1}')/files\" +\n \"/add(overwrite=true, url='{2}')\",\n serverUrl, serverRelativeUrlToFolder, fileName);\n \n // Send the request and return the response.\n // This call returns the SharePoint file.\n return jQuery.ajax({\n url: fileCollectionEndpoint,\n type: \"POST\", \n data: arrayBuffer,\n processData: false,\n beforeSend : function() {\n $.blockUI({ \n message: '<h4>Uploading Document ...</h4>',\n css: { \n border: 'none', \n padding: '15px', \n backgroundColor: '#000', \n '-webkit-border-radius': '10px', \n '-moz-border-radius': '10px', \n opacity: .5, \n color: '#fff' \n } }); \n }, \n complete: function () {\n $.unblockUI(); \n },\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-length\": arrayBuffer.byteLength\n }\n });\n }", "function uploadSignatureBase(filePath, upload)\n{ \n var apiFuncPath = '';\n if($('#USER_SIG_FILE'))\n {\n var spf = document.getElementById('USER_SIG_FILE');\n \n if(upload)\n {\n $('#userSigFileInput').val(spf.value.replace(/^.*[\\\\\\/]/, ''));\n apiFuncPath= \"/api/1/flash/uploadProjectSigFile\";\n }\n else//clear\n {\n $('#userSigFileInput').val('');\n apiFuncPath = \"/api/1/flash/deleteProjectSigFile\";\n }\n \n uploadSignature(spf.files, filePath, apiFuncPath);\n }\n}", "function uploadFile(fileContent) {\n dbx.filesUpload({\n contents: fileContent,\n path: conf.get('filePath'),\n mode: \"overwrite\"\n }).then(function(response) {\n //console.log(JSON.stringify(response));\n }).catch(function(error) {\n //console.log(JSON.stringify(error.response));\n });\n}", "function api_completeupload(t, uq, k, ctx) {\n // Close nsIFile Stream\n if (is_chrome_firefox && uq._close) uq._close();\n if (uq.repair) uq.target = M.RubbishID;\n api_completeupload2({\n callback: api_completeupload2,\n t: base64urlencode(t),\n path: uq.path,\n n: uq.name,\n k: k,\n fa: uq.faid ? api_getfa(uq.faid) : false,\n ctx: ctx\n }, uq);\n}", "onUploadAttachment(claimsIdentity, conversationId, attachmentUpload) {\n return __awaiter(this, void 0, void 0, function* () {\n throw new statusCodeError_1.StatusCodeError(botbuilder_core_1.StatusCodes.NOT_IMPLEMENTED, `ChannelServiceHandler.onUploadAttachment(): ${botbuilder_core_1.StatusCodes.NOT_IMPLEMENTED}: ${http_1.STATUS_CODES[botbuilder_core_1.StatusCodes.NOT_IMPLEMENTED]}`);\n });\n }", "function upload() {\n console.log(\"hello\");\n\n var formData = new FormData();\n\n var fileField = document.querySelector(\"input[type='file']\");\n\n\n console.log(fileField);\n\n var author = $('input#author').val();\n var name = $('input#name').val();\n var license = $('input#license').val();\n\n var metaData = {\n author: author,\n name: name,\n license: license\n };\n\n var stringData = JSON.stringify(metaData);\n var blob = new Blob([stringData], {type: \"application/json\"});\n\n formData.append(\"rawdata\", fileField.files[0]);\n formData.append(\"metadata\", blob);\n\n fetch(buildUrl(\"\"), {\n method: \"POST\",\n body: formData\n });\n\n\n return false;\n}", "function uploadMultipleFile(req, res) {\n\n var fileSize = req.swagger.params.file.value.size\n var timestamp = Number(new Date()); // current time as number\n var file = req.swagger.params.file.value;\n var opportunityId = req.swagger.params.id.value;\n var filename = timestamp + '_' + file.originalname;\n var docPath = \"./images/common/\" + timestamp + '_' + file.originalname;\n var extention = path.extname(filename);\n var allowedExtensionsImg = /(\\.jpg|\\.jpeg|\\.png|\\.gif)$/i;\n var allowedExtensionsDoc = /(\\.txt|\\.rtf|\\.doc|\\.docx|\\.pdf|\\.xls|\\.xlsx|\\.ppt|\\.pptx|\\.pps|\\.msg|\\.log|\\.odt|\\.pages|\\.csv|\\.xml)$/i;\n var fileType;\n if (allowedExtensionsImg.exec(filename)) {\n fileType = 1\n }\n else if (allowedExtensionsDoc.exec(filename)) {\n fileType = 2\n }\n else {\n fileType = 3\n }\n fs_extra.writeFile(path.resolve(docPath), file.buffer, function(err) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: Constant.INTERNAL_ERROR});\n } else {\n var saveData = {\n filePath: Config.webUrl + \"/images/common/\" + filename,\n opportunityId: opportunityId,\n filename: filename,\n size: fileSize / 1000, //size in kb\n uploader: req.swagger.params.uploader.value,\n fileTypeId: fileType,\n createdBy: req.swagger.params.uploader.createdBy,\n modifiedBy: req.swagger.params.uploader.modifiedBy\n };\n attachmentFile(saveData).save(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: Constant.INTERNAL_ERROR});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n }\n );\n}", "documentUpload(e) {\n let file = e.target.files[0];\n let fileSize = file.size / 1024 / 1024;\n let fileType = file.type;\n let fileName = file.name;\n let validDocFormat = false;\n let docFormat = fileName.split('.')[1];\n if(docFormat === 'doc'|| docFormat === 'docx' || docFormat === 'xls' || docFormat === 'xlsx'|| docFormat === 'pdf')validDocFormat= true;\n this.setState({ fileType: file.type, fileName: file.name, fileSize: fileSize });\n this.getCentralLibrary();\n if (this.state.totalLibrarySize < 50) {\n let fileExists = this.checkIfFileAlreadyExists(file.name, \"document\");\n let typeShouldBe = _.compact(fileType.split('/'));\n if (file && typeShouldBe && typeShouldBe[0] !== \"image\" && typeShouldBe[0] !== \"video\" && validDocFormat) {\n if (!fileExists) {\n let data = { moduleName: \"PROFILE\", actionName: \"UPDATE\" }\n let response = multipartASyncFormHandler(data, file, 'registration', this.onFileUploadCallBack.bind(this, \"document\"));\n } else {\n toastr.error(\"Document with the same file name already exists in your library\")\n }\n } else {\n toastr.error(\"Please select a Document Format\")\n }\n } else {\n toastr.error(\"Allotted library limit exceeded\");\n }\n }", "function initUpload(){\n var files = document.getElementById('file-input').files;\n var file = files[0];\n if(file == null){\n return alert('No file selected.');\n }\n uploadRequest(file);\n}", "function initUpload(){\n const files = document.getElementById('file_upload').files;\n const file = files[0];\n if(file == null){\n return alert('No file selected.');\n }\n getSignedRequest(file);\n}", "function uploadGoogleFilesToDropbox(attachment) {\n \n var path = '/Auditions/' + attachment.getName();\n \n var headers = {\n \"Content-Type\": \"application/octet-stream\",\n 'Authorization': 'Bearer ' + dropbox_token,\n \"Dropbox-API-Arg\": JSON.stringify({\"path\": path})\n \n };\n \n var options = {\n \"method\": \"POST\",\n \"headers\": headers,\n \"payload\": attachment.getBytes()\n };\n \n var apiUrl = \"https://content.dropboxapi.com/2/files/upload\";\n var response = JSON.parse(UrlFetchApp.fetch(apiUrl, options).getContentText());\n \n Logger.log(\"File uploaded successfully to Dropbox\");\n \n}", "uploadResource (file, portalOpts) {\n // Valid types\n // const validTypes = ['json', 'xml', 'txt', 'png', 'jpeg', 'gif', 'bmp', 'pdf', 'mp3', 'mp4', 'zip'];\n // TODO: Check type\n const urlPath = `/portals/self/addresource?f=json`;\n let options = {};\n options.body = new FormData();\n // stuff the file into the formData...\n options.body.append('file', file);\n options.body.append('text', null);\n options.body.append('key', file.name);\n options.method = 'POST';\n return this.request(urlPath, options, portalOpts);\n }", "function finalizeUploading() {\n\n}", "function handleUploadFile(req, res) {\n var domain = checkUserIpAddress(req, res);\n if (domain == null) return;\n if ((domain.id !== '') || (!req.session) || (req.session == null) || (!req.session.userid) || (domain.userQuota == -1)) { res.sendStatus(401); return; }\n var user = obj.users[req.session.userid];\n if ((user.siteadmin & 8) == 0) { res.sendStatus(401); return; } // Check if we have file rights\n\n var multiparty = require('multiparty');\n var form = new multiparty.Form();\n form.parse(req, function (err, fields, files) {\n if ((fields == null) || (fields.link == null) || (fields.link.length != 1)) { res.sendStatus(404); return; }\n var xfile = getServerFilePath(user, domain, decodeURIComponent(fields.link[0]));\n if (xfile == null) { res.sendStatus(404); return; }\n // Get total bytes in the path\n var totalsize = readTotalFileSize(xfile.fullpath);\n if (totalsize < xfile.quota) { // Check if the quota is not already broken\n if (fields.name != null) {\n // Upload method where all the file data is within the fields.\n var names = fields.name[0].split('*'), sizes = fields.size[0].split('*'), types = fields.type[0].split('*'), datas = fields.data[0].split('*');\n if ((names.length == sizes.length) && (types.length == datas.length) && (names.length == types.length)) {\n for (var i = 0; i < names.length; i++) {\n if (obj.common.IsFilenameValid(names[i]) == false) { res.sendStatus(404); return; }\n var filedata = new Buffer(datas[i].split(',')[1], 'base64');\n if ((totalsize + filedata.length) < xfile.quota) { // Check if quota would not be broken if we add this file\n obj.fs.writeFileSync(xfile.fullpath + '/' + names[i], filedata);\n }\n }\n }\n } else {\n // More typical upload method, the file data is in a multipart mime post.\n for (var i in files.files) {\n var file = files.files[i], fpath = xfile.fullpath + '/' + file.originalFilename;\n if (obj.common.IsFilenameValid(file.originalFilename) && ((totalsize + file.size) < xfile.quota)) { // Check if quota would not be broken if we add this file\n obj.fs.rename(file.path, fpath);\n } else {\n try { obj.fs.unlinkSync(file.path); } catch (e) { }\n }\n }\n }\n }\n res.send('');\n obj.parent.DispatchEvent([user._id], obj, 'updatefiles') // Fire an event causing this user to update this files\n });\n }", "uploadFile(e) {\n // get the file and send\n const selectedFile = this.postcardEle.getElementsByTagName(\"input\")[0].files[0];\n const formData = new FormData();\n formData.append('newImage', selectedFile, selectedFile.name);\n // build a browser-style HTTP request data structure\n const xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/upload\", true);\n xhr.addEventListener('loadend', (e) => {\n this.onImageLoad(e, xhr);\n });\n xhr.send(formData);\n }", "function uploadFile(mimetype, bookname, filedata) {\n var bookname1 = 'dcbook.pdf'; // console.log(bookname,bookname1);\n\n try {\n var response = drive.files.create({\n requestBody: {\n name: bookname,\n mimeType: mimetype\n },\n media: {\n mimeType: mimetype,\n body: fs.createReadStream('./public/books/' + bookname)\n }\n });\n var promises = response.data.id;\n if (filedata === 'myFile1') fille1id = response.data.id;\n if (filedata === 'myFile2') file2id = response.data.id; // console.log(response.data.id);\n\n Promise.all(promises).then(function () {\n generatePublicurl(response.data.id, filedata);\n console.log('File uploaded in drive creating link wait....');\n })[\"catch\"](console.error);\n } catch (error) {\n console.error(error.message);\n }\n} // uploadFile();", "function uploadFile(file, signedRequest, url) {\n const xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", signedRequest);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n console.log(\"uploaded file\");\n } else {\n reject(\"Could not upload file.\");\n }\n }\n };\n xhr.send(file);\n }", "async multipartInit() {\n if (this.cacheData.UploadId) {\n return;\n }\n const { Bucket, Region, Key } = this.getParams();\n const { ContentLength, ...multipartInitParams } = this.object;\n if (this.mode === 'NEW_UPLOAD_ID_ONLY') {\n const { UploadId } = await this.cosSdkInstance.multipartInitRetry(multipartInitParams);\n this.cacheData.UploadId = UploadId;\n } else {\n const { Upload = [] } = await this.cosSdkInstance.multipartListRetry({\n Bucket,\n Region,\n Prefix: Key,\n });\n const uploadIds = Upload.filter(item => item.Key === Key).map(item => item.UploadId);\n if (uploadIds.length) {\n this.cacheData.UploadId = uploadIds[0];\n } else {\n const { UploadId } = await this.cosSdkInstance.multipartInitRetry(multipartInitParams);\n this.cacheData.UploadId = UploadId;\n }\n }\n this.cacheData.Parts = [];\n }", "function initUpload () {\n return makePost('media/upload', {\n command : 'INIT',\n total_bytes: mediaSize,\n media_type : mediaType,\n }).then(data => data.media_id_string);\n }", "function uploadPhoto(photoURI, photoType, databaseID){\n // !! Assumes variable fileURL contains a valid URL to a text file on the device,\n // for example, cdvfile://localhost/persistent/path/to/file.txt\n\n var leafSuccess = function (r) {\n //navigator.notification.alert(\"leaf photo uploaded\");\n console.log(\"Code = \" + r.responseCode);\n console.log(\"Response = \" + r.response);\n console.log(\"Sent = \" + r.bytesSent);\n cosole.log(\"survey.timeStart = \" + survey.timeStart);\n // deleteSurvey(survey.timeStart);\n };\n\n var fail = function (error) {\n navigator.notification.alert(\"An error has occurred: Code = \" + error.code);\n alert(\"upload error source: \" + error.source);\n alert(\"upload error target: \" + error.target);\n console.log(\"upload error source \" + error.source);\n console.log(\"upload error target \" + error.target);\n };\n\n var arthropodSuccess = function(r){\n //navigator.notification.alert(\"order photo uploaded\");\n\n //Increment number of arthropods submitted\n //here when there is a photo to upload\n //to prevent duplicate success alerts\n console.log(\"Code = \" + r.responseCode);\n console.log(\"Response = \" + r.response);\n console.log(\"Sent = \" + r.bytesSent);\n\n //If this was the last order photo to submit, clear form, submission succeeded\n // if(numberOfArthropodsSubmitted == numberOfArthropodsToSubmit) {\n // navigator.notification.alert(\"Successfully submitted survey data!\");\n // clearFields();\n\n // }\n };\n\n var options = new FileUploadOptions();\n options.fileKey = \"file\";\n options.mimeType=\"image/jpeg\";\n options.chunkedMode = false;\n options.headers = {\n Connection: \"close\"\n };\n\n // var params = {};\n // params.fullpath = imageURI;\n // params.name = options.fileName;\n \n // options.params = params;\n\n var ft = new FileTransfer();\n //If uploading leaf photo\n if(photoType.localeCompare(\"leaf-photo\") === 0) {\n options.fileName = \"survey_\" + databaseID + \"_leaf_photo.jpg\";\n ft.upload(photoURI, encodeURI(DOMAIN + \"/api/uploads.php?surveyID=\" + databaseID), leafSuccess, fail, options);\n }\n //Uploading arthropod photo\n else if(photoType.localeCompare(\"arthropod-photo\") === 0){\n options.fileName = \"order_\" + databaseID + \"_arthropod_photo.jpg\";\n ft.upload(photoURI, encodeURI(DOMAIN + \"/api/uploads.php?orderID=\" + databaseID), arthropodSuccess, fail, options);\n }\n}", "upload(req, res, id) {\n this.Model.findById(id, (err, item) => {\n if (err) return res.status(500).jsend.error('item to attach file to not found');\n\n var file;\n if (req.file) {\n file = req.file;\n } else if (req.files) {\n file = req.files[Object.keys(req.files)[0]][0];\n }\n if (!file) return res.status(400).jsend.fail('no file');\n\n // console.log('#--- file:', req.file);\n // console.log('#--- files:', req.files);\n // console.log('#--- var file:', file);\n\n this._processUploadedFile(id, file, (err, path) => {\n if (err) return res.status(500).jsend.error({\n message: 'error processing uploaded file',\n data: err\n });\n\n this._linkFileToItem(item, file.fieldname, path, err => {\n if (err) return res.status(500).jsend.err({\n message: 'error linking file to item',\n data: err\n });\n\n res.json({\n success: true,\n uuid: path\n });\n });\n });\n\n });\n }", "packageUploads(e) {\n let fileData = new FormData();\n\n fileData.append(this.sendAs, e.target.files[0]);\n\n return fileData;\n }", "function uploadMedia() {\n var signedURL;\n var file;\n file = self.myFile;\n if(file !== undefined){\n //get a signed S3 request for the file selected by user\n homeService.getSignedS3Request(file).then(function(response){\n //if signed request is received successfully\n if(response.status === 200){\n signedURL = response.data.signed_request;\n console.log(response.data);\n // upload the file with the signed request\n var xhr = new XMLHttpRequest();\n // define event listeners to track update status and progress\n xhr.upload.addEventListener(\"progress\", uploadProgress, false);\n xhr.addEventListener(\"load\", uploadComplete, false);\n xhr.addEventListener(\"error\", uploadFailed, false);\n xhr.addEventListener(\"abort\", uploadCanceled, false);\n // open a PUT request to upload the file\n xhr.open(\"PUT\", signedURL);\n // make the file publically downloadable\n xhr.setRequestHeader('x-amz-acl', 'public-read');\n //disable the submit while file is being uploaded\n // set the progress bar value to zero in case user uploads multiple files back to back\n self.progress = 0;\n\n xhr.onload = function() {\n //if file upload request is completed successfully\n if (xhr.status === 200) {\n console.log(\"File upload complete\");\n self.postUploadCleanup(file);\n }\n };\n xhr.onerror = function() {\n alert(\"Could not upload file.\");\n };\n\n self.progressVisible = true;\n console.log(signedURL);\n xhr.send(file);\n\n }\n else {\n console.log(response);\n }\n });\n }\n\n }", "_fileUploadResponse(e) {\n super._fileUploadResponse(e);\n // @todo put in logic to support the response actually\n // just outright returning a haxElement. This is rare\n // but if the HAX developer has control over the endpoint\n // then they could get HAX to streamline some workflows\n // or by-pass the gizmo selection step to improve UX\n // for end users even further. Examples could be a media\n // management system that has remote rendering (cms-token)\n // or a highly specific endpoint that we know we can only\n // present in one way effectively Box / Google doc viewer.\n this.newAssetConfigure();\n }", "function createListItem(itemProperties,attachment){\n //before the request make sure you obtain a new form digest value and the list type\n $.when(\n getFormDigest(),\n getListType()\n ).then(function(data){\n $.ajax({\n url: siteUrl + \"/_api/web/lists/getbytitle('WDGIntakeForm')/items\",\n type: \"POST\",\n contentType: \"application/json;odata=verbose\",\n data: JSON.stringify(itemProperties),\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": data[0].d.GetContextWebInformation.FormDigestValue\n },\n success: function (successData) {\n //the id of the list item that was just created\n var itemId = successData.d.Id;\n //text value of the footer at the time the submission succeeded\n //used as part of the thank you screen text\n var typeofRequest = $(\".typeOfRequest.selected\").attr(\"data-footerVal\");\n //check if there is an attachment\n //if there is send all the attached file to the newly created sharepoint list item\n if(typeof attachmentFiles !== \"undefined\"){\n //a promise to pass to the sendAttachments function\n //will be resolved if all attachments are successfully attached\n //and will be rejected if one of the attachments fail to be sent properly\n var promise = $.Deferred();\n promise.promise();\n sendAttachments(itemId,attachment,promise);\n //when the promise passed to sendAttachments resolves, show the thank you screen\n // or if the promise is rejected show the error\n $.when(promise).then(function(e){\n //stop the loading timer and hide the image\n loadingTimer.stopTimer();\n console.log(\"Created new list item \");\n //enable the submit button\n $(\"#addBtn\").removeClass(\"disabled\");\n //show the thank you screen\n showThankYou(itemId,typeofRequest);\n //trigger the flow\n triggerFlow(itemId);\n },function(data){\n //stop the loading timer and hide the image\n loadingTimer.stopTimer();\n alert(\"There was an error with the attached file.\");\n //enable the submit button\n $(\"#addBtn\").removeClass(\"disabled\");\n console.log(data);\n throw new Error(\"There was an error in attaching the file to the sharepoint list\");\n });\n }\n //if there is no attachment alert that a new item has been created\n else{\n //stop the loading timer and hide the image\n loadingTimer.stopTimer();\n console.log(\"Created new list item \");\n $(\"#addBtn\").removeClass(\"disabled\");\n showThankYou(itemId,typeofRequest);\n triggerFlow(itemId);\n }\n },\n error: function (data) {\n //stop the loading timer and hide the image\n loadingTimer.stopTimer();\n alert(\"There was an error with writing to the sharepoint list\");\n $(\"#addBtn\").removeClass(\"disabled\");\n console.log(data);\n throw new Error(\"There was an error in writing to the sharepoint list\");\n }\n });\n });\n}", "start(callback=null)\n {\n if (this.el==null){\n console.error(\"upload.js -> element file is nothing !\");\n return;\n }\n if (this.el.length)\n {\n try\n {\n var collection_info = [];\n\n // create XMLHttpRequest object\n var x = XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHttp');\n \n // looping data inside of 'el'\n for (var i = 0; i <= (this.el.length-1); i++) {\n // get element by id\n var el = document.getElementById(this.el[i]);\n if (el==null){\n console.info(\"upload.js -> element \"+this.el[i]+\" is not found !\");\n continue;\n }\n // get attribute by name\n var attr = el.getAttribute('name');\n // check if input file is TRUE\n if (el.files[0])\n {\n // append file to the form\n this.form.append(attr, el.files[0]);\n var file_name = el.files[0].name;\n var file_size = el.files[0].size;\n var file_type = el.files[0].type;\n \n // collecting information file into array\n var info_file = {\n 'file_name' : file_name,\n 'file_size' : file_size,\n 'file_type' : file_type\n }\n\n collection_info[i] = info_file;\n }\n }\n this.info_files = collection_info;\n \n // append _token to the form\n this.form.append(this.string_token, this.token);\n // append _data to the form\n this.form.append(this.string_data, JSON.stringify(this.data));\n\n // try to access the URL\n x.open(this.request_method, this.url);\n \n //x.setRequestHeader(\"Content-type\", \"multipart/form-data\");\n \n x.onreadystatechange = function($info) {\n // if status is 200 | success\n if (this.readyState == 4 && this.status == 200) {\n // check if callback is VALID\n if (callback!=null)\n {\n // call user function with responseText and more information\n callback(this.responseText,$info);\n }else{\n console.error(\"upload.js -> You have to use callback function !\");\n }\n }\n };\n // send form\n x.send(this.form);\n }catch(error)\n {\n console.error(\"upload.js -> \"+error);\n }\n }\n else{\n console.log(\"Element should be collecting in array !\")\n }\n return this;\n }", "uploadFileRes(cloudPath, tempPath) {\n return new Promise(function (resolve, reject) {\n wx.cloud.uploadFile({\n cloudPath: cloudPath,\n filePath: tempPath\n }).then(res => {\n resolve(res.fileID)\n })\n })\n }", "function uploadDealcsv() { }", "function UploadFile(fileName) {\n\n var filedata = new FormData();\n for (i = 0; i < fileArray.length; i++) {\n var filename = \"UploadedFile\" + i;\n filedata.append(filename, fileArray[i][0]);\n }\n filedata.append(\"UserID\", get_current_user_id());\n filedata.append(\"OrgID\", get_current_user_org_id());\n\n fileArray = [];\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"SMTHDashboard\", true);\n xhr.send(filedata);\n xhr.onreadystatechange = function (data) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n alert('' + fileName + ' is Save Successfully.');\n }\n else if (xhr.status == 404) {\n ShowErrorBoxMessage(\"File cannot Imported!.\"); \n } \n };\n}", "async function handleUpload(e) {\n\n e.preventDefault();\n\n var VideoURL = null;\n var FileURL = null;\n const videoName = formData.title;\n const fileName = videoName + \" - Resources\"\n\n console.log(formData);\n console.log(video);\n console.log(file);\n\n const fullpath = `${formData.college}/${formData.sem}/${formData.branch}/discussion/${formData.subject}/`;\n const path = `${formData.college}/${formData.sem}/${formData.branch}`\n\n console.log(fullpath);\n console.log(path);\n\n console.log(formData);\n\n (async () => {\n // if (linkToggle) {\n // VideoURL = await fileUploader(fullpath, video, videoName);\n // console.log(\"Video URL: \" + VideoURL);\n // } else {\n // VideoURL = video;\n // console.log(\"Video URL: \" + VideoURL);\n // }\n\n })().then(async () => {\n if (file != null) {\n // FileURL = await fileUploader(fullpath, file, fileName);\n console.log(\"File URL: \" + FileURL);\n }\n }).then(async () => {\n console.log('Creating Document...');\n // make a new doc for every new video/topic\n await firestore.collection(`${fullpath}`)\n .add({\n title: formData.title,\n dec: formData.desc,\n branch: formData.branch,\n createdAt: new Date(),\n module: formData.moduleID,\n moduleName: formData.module,\n sem: formData.sem,\n subject: formData.subject,\n author: formData.author,\n uid: formData.uid,\n fileURL: FileURL,\n videoURL: VideoURL,\n resloved: false\n })\n .then((res) => {\n document.getElementById(\"upload-form\").reset();\n console.log(\"sucessfully added question\")\n }).catch((error) => {\n console.log(error);\n });\n })\n\n }", "function uploadFile(request, response) {\n // parse a file upload\n //var mime = require('mime'); //error: can't find module mime\n var formidable = require('formidable'); //extra thing installed\n var util = require('util');\n\n var form = new formidable.IncomingForm();\n\n //var dir = !!process.platform.match(/^win/) ? '\\\\uploads\\\\' : '/uploads/';\n\n form.uploadDir = __dirname;// + dir;\n form.keepExtensions = true;\n form.maxFieldsSize = 10 * 1024 * 1024;\n form.maxFields = 1000;\n form.multiples = false;\n\n //rename the file or it will be a random string\n form.on('file', function(field, file) {\n fs.rename(file.path, path.join(__dirname, './testdata/'+tempFileName+'/'+tempFileName+\".webm\"), function(err){\n if (err) throw err;\n });\n });\n\n form.parse(request, function(err, fields, files) {\n var file = util.inspect(files);\n response.writeHead(200, {\n 'Content-Type': 'application/json'\n });\n response.write(JSON.stringify({'fileURL': tempFileName+\".webm\"}));\n response.end();\n });\n}", "function uploadFile(request, response) {\n // parse a file upload\n //var mime = require('mime'); //error: can't find module mime\n var formidable = require('formidable'); //extra thing installed\n var util = require('util');\n\n var form = new formidable.IncomingForm();\n\n //var dir = !!process.platform.match(/^win/) ? '\\\\uploads\\\\' : '/uploads/';\n\n form.uploadDir = __dirname;// + dir;\n form.keepExtensions = true;\n form.maxFieldsSize = 10 * 1024 * 1024;\n form.maxFields = 1000;\n form.multiples = false;\n\n //rename the file or it will be a random string\n form.on('file', function(field, file) {\n fs.rename(file.path, path.join(__dirname, './testdata/'+tempFileName+'/'+tempFileName+\".webm\"), function(err){\n if (err) throw err;\n });\n });\n\n form.parse(request, function(err, fields, files) {\n var file = util.inspect(files);\n response.writeHead(200, {\n 'Content-Type': 'application/json'\n });\n response.write(JSON.stringify({'fileURL': tempFileName+\".webm\"}));\n response.end();\n });\n}", "async createFile(name, filePath, fileKeys) {\n let auth = this.auth;\n let res = {\"fileId\": \"\", \"keyId\": \"\", \"name\": name, keys: fileKeys};\n var drive = google.drive({ version: 'v3', auth });\n var fileMetadata = {\n 'name': name\n };\n var media = {\n mimeType: 'text/plain', \n body: fs.createReadStream(filePath+\".enc\")\n };\n var key_media = {\n mimeType: 'text/plain', \n body: fs.createReadStream(filePath+\".key\")\n }\n \n const fileRes = await drive.files.create({\n resource: fileMetadata,\n media: media,\n fields: 'id'\n });\n res.fileId = fileRes.data.id;\n fs.unlinkSync(filePath+\".enc\");\n \n const keyRes = await drive.files.create({\n resource: {\n 'name': fileMetadata[\"name\"] + \".key\"\n },\n media: key_media,\n fields: 'id'\n });\n res.keyId = keyRes.data.id;\n fs.unlinkSync(filePath+\".key\");\n this.db.collection('filesCollection').insertOne(res);\n var jsonUpload= {\n \"$class\": \"org.example.mynetwork.Document\",\n \"DocumentId\" : res.fileId.toString(),\n \"owner\": \"u1\",\n \"description\": \"test\",\n \"UsersWithAccess\": [\n \"u1\"\n ]\n };\n request.post(this.BLOCKCHAIN_URL+'/api/Document',{json: jsonUpload}, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body)\n }\n });\n return res;\n }", "function uploadFile(filepath,data,contentLength,contentType,CT,shared_users,t,callback){\n var url = \"https://api-content.dropbox.com/1/files_put/auto\"+filepath;\n var headers = {\n Authorization: 'Bearer ' + getAccessToken(),\n contentLength: contentLength,\n };\n var args = {\n url: url,\n headers: headers,\n crossDomain: true,\n crossOrigin: true,\n processData: false,\n type: 'PUT',\n contentType: contentType,\n data : data,\n dataType: 'json',\n success: function(data)\n {\n getMetadata(filepath.substring(0, filepath.lastIndexOf(\"/\")+1),createFolderViews);\n if(callback)\n callback(filepath,function(url){\n uploadFileMeta(filepath,user_id,CT,shared_users,t,url);\n });\n },\n error: function(jqXHR)\n {\n console.log(jqXHR);\n }\n };\n $.ajax(args);\n}", "function addFileToFolder(arrayBuffer) {\n\n // Get the file name from the file input control on the page.\n var parts = fileInput[0].value.split('\\\\');\n var fileName = parts[parts.length - 1].split(\".\")[0] + id + \".\" + parts[parts.length - 1].split(\".\")[1];\n\n // Construct the endpoint.\n var fileCollectionEndpoint = String.format(\n \"{0}/_api/sp.appcontextsite(@target)/web/getfolderbyserverrelativeurl('{1}')/files\" +\n \"/add(overwrite=true, url='{2}')?@target='{3}'\",\n appWebUrl, serverRelativeUrlToFolder, fileName, hostWebUrl);\n\n // Send the request and return the response.\n // This call returns the SharePoint file.\n return $.ajax({\n url: fileCollectionEndpoint,\n type: \"POST\",\n data: arrayBuffer,\n processData: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": $(\"#__REQUESTDIGEST\").val(),\n //\"content-length\": arrayBuffer.byteLength\n }\n });\n }", "function uploadNextFile() {\n\tvar xhr = new XMLHttpRequest();\n\tvar fd = new FormData();\n\tvar file = document.getElementById('files').files[uploadedFiles];\n\tfd.append(\"multipartFile\", file);\n\txhr.upload.addEventListener(\"progress\", onFileUploadProgress, false);\n\txhr.addEventListener(\"load\", onUploadFinished, false);\n\txhr.addEventListener(\"error\", onFileUploadFailed, false);\n\txhr.open(\"POST\", \"upload\");\n\tconsole.log(\"fd\", file);\n\txhr.send(fd);\n}", "function sendAttachments(itemId,attachmentArray,deferredPromise){\n //if the arrachment array length is 0 all attachemtns have been send\n //resolve the promise and return out of the function\n if(attachmentArray.length <= 0){\n deferredPromise.resolve(\"All attachments sent\");\n return;\n }\n //if the attachemnt array is not empty send the next attachment to sharepoint\n else{\n $.when(getFormDigest()).then(function(data){\n $.ajax({\n url: siteUrl + \"/_api/web/lists/getbytitle('WDGIntakeForm')/items(\"+itemId+\")/AttachmentFiles/add(FileName='\"+attachmentArray[0].fileName+\"')\",\n type: \"POST\",\n data: attachmentArray[0].fileString,\n processData: false,\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"content-type\": \"application/json; odata=verbose\",\n \"X-RequestDigest\": data.d.GetContextWebInformation.FormDigestValue\n },\n success: function (data) {\n console.log(\"Attached file to list item\");\n //remove the attachment that was just sent to sharepoint from the array\n attachmentArray.shift();\n //call the function again\n sendAttachments(itemId,attachmentArray,deferredPromise);\n },\n error: function (data) {\n console.log(data);\n //reject the promise as the attachment failed to be sent\n deferredPromise.reject(\"there was an error with one or more of the attachments\");\n }\n });\n });\n }\n}", "function triggerFileUpload() {\n fileInputElement.current.click();\n }", "function toupload(){\n const uploader = document.getElementById('uploadfile');\n uploader.addEventListener('change', (event) => {\n const [ file ] = event.target.files;\n const validFileTypes = [ 'image/jpeg', 'image/png', 'image/jpg' ]\n const valid = validFileTypes.find(type => type === file.type);\n if (! valid){\n window.alert(\"You must upload an image file (jpg/jpeg/png) !\");\n return false;\n }\n const upload_2 = document.getElementById('upload_button_2');\n upload_2.onclick = function () {\n const description = document.getElementById('filedes').value;\n if (! description){\n window.alert(\"The description must not left empty!\");\n return false;\n }\n const reader = new FileReader();\n reader.readAsDataURL(file);\n\n reader.onload = (e) => {\n const payload = {\n \"description_text\": description,\n \"src\" : (e.target.result.split(','))[1]\n }\n const path = 'post';\n const headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization' : 'Token ' + checkStore('token')\n };\n const method = 'POST';\n api.makeAPIRequest(path, {\n method, headers,\n body: JSON.stringify(payload)\n }).then(function () {\n window.alert('You have successfully uploaded!');\n location.reload();\n });\n };\n }\n });\n}", "sendFile_() {\n var content = this.file;\n var end = this.file.size;\n\n if (this.offset || this.chunkSize) {\n // Only bother to slice the file if we're either resuming or uploading in chunks\n if (this.chunkSize) {\n end = Math.min(this.offset + this.chunkSize, this.file.size);\n }\n content = content.slice(this.offset, end);\n }\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", this.url, true);\n xhr.setRequestHeader(\"Content-Type\", this.contentType);\n xhr.setRequestHeader(\n \"Content-Range\",\n \"bytes \" + this.offset + \"-\" + (end - 1) + \"/\" + this.file.size\n );\n xhr.setRequestHeader(\"X-Upload-Content-Type\", this.file.type);\n if (xhr.upload) {\n xhr.upload.addEventListener(\"progress\", this.onProgress);\n }\n xhr.onload = this.onContentUploadSuccess_.bind(this);\n xhr.onerror = this.onContentUploadError_.bind(this);\n xhr.send(content);\n }", "sending(file, xhr, formData) {}", "async _completeMultipartUpload(filename, uploadID, parts, options) {\n const path = options.dashboard && options.widget ? `/data/files/${options.dashboard}/${options.widget}` : `/files`;\n const partsOrdered = parts.sort((a, b) => a.PartNumber - b.PartNumber);\n const headers = { \"Content-Type\": \"multipart/form-data\" };\n const result = await this.doRequest({\n path,\n method: \"POST\",\n body: {\n multipart_action: \"end\",\n upload_id: uploadID,\n filename,\n parts: partsOrdered,\n },\n });\n }", "uploadFile(accessToken, file, todoId) {\n\n var upload = this.app.Upload();\n upload = upload.setFile(file.path);\n return upload\n .save()\n .then((result) => {\n\n fs.unlink(file.path);\n // fetch the uploaded object and then save the uid for the particular todo\n var uploadId = result.toJSON().uid;\n var updateObject = this.dbObject({\n 'uid': todoId\n })\n .pushValue('uploads', uploadId);\n updateObject = updateObject.setHeader('access_token', accessToken);\n return this.makePromise(updateObject.save());\n });\n }", "_uploadSuccess(event){// parse the raw response cause it won't be natively\n// since event wants to tell you about the file generally\nlet response=JSON.parse(event.detail.xhr.response);this.uploadTitle=response.data.node.title;this.shadowRoot.querySelector(\"#content\").innerHTML=response.data.node.nid;this.shadowRoot.querySelector(\"#dialog\").open()}", "saveToFile() {\r\n saveFile({\r\n idParent: this.currentOceanRequest.id,\r\n fileType: this.fileType,\r\n strFileName: this.fileName\r\n })\r\n .then(() => {\r\n // refreshing the datatable\r\n this.getRelatedFiles();\r\n })\r\n .catch(error => {\r\n // Showing errors if any while inserting the files\r\n this.dispatchEvent(\r\n new ShowToastEvent({\r\n title: \"Error while uploading File\",\r\n message: error.message,\r\n variant: \"error\"\r\n })\r\n );\r\n });\r\n }", "function assignmentsUploadFile() {\n\tvar idx = assignmentsGetCurrentIdx();\n\tif (idx == -1) return;\n\t\n\tvar filesSelect = document.getElementById(\"filesSelect\");\n\t\n\t// This code uploads file from a file selection widget using addFile web service\n\tvar file = document.getElementById('uploadFileWidget').files[0];\n\tconsole.log(file);\n\tvar xmlhttp = new XMLHttpRequest();\n\tvar formData = new FormData();\n\t\n\txmlhttp.onreadystatechange = function() {\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\ttry {\n\t\t\t\tvar result = JSON.parse(xmlhttp.responseText);\n\t\t\t\tif (result.success && result.success == \"true\") {\n\t\t\t\t\tvar found = false;\n\t\t\t\t\tfor (var i=0; i < assignments[idx].files.length; i++)\n\t\t\t\t\t\tif (assignments[idx].files[i].filename == file.name)\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\tif (!found) {\n\t\t\t\t\t\tvar option = document.createElement(\"option\");\n\t\t\t\t\t\toption.value = file.name;\n\t\t\t\t\t\toption.text = file.name;\n\t\t\t\t\t\tfilesSelect.add(option);\n\t\t\t\t\t\t\n\t\t\t\t\t\tassignments[idx].files.push({\"filename\" : file.name, \"binary\":false, \"show\":false});\n\t\t\t\t\t\tassignmentsSendToServer();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\talert(\"Upload failed\");\n\t\t\t} catch(e) {\n\t\t\t\talert(\"Upload failed\");\n\t\t\t}\n\t\t\tdocument.getElementById('uploadFileWrapper').style.display='none';\n\t\t\tdocument.getElementById('uploadProgress').style.display=\"none\";\n\t\t}\n\t}\n\t\n\txmlhttp.upload.addEventListener('progress', function(e) {\n\t\tvar percent_complete = (e.loaded / e.total)*100;\n\t\tdocument.getElementById('uploadProgressBar').value = percent_complete;\n\t});\n\n\tformData.append(\"add\", file); // is it possible to rename???\n\tformData.append(\"task_direct\", assignments[idx].id);\n\txmlhttp.open(\"POST\", '/assignment/ws.php?action=addFile&'+courseUrlPart);\n\txmlhttp.send(formData);\n\tdocument.getElementById('uploadProgress').style.display=\"block\";\n}", "async upload (pathToBinary) { return this.API.upload(await readFile(pathToBinary), {}) }", "function uploadFile(file) {\n renderProgressItems(file, target);\n var url = 'http://localhost:8989/upload';\n var xhr = new XMLHttpRequest();\n var formData = new FormData();\n xhr.open('POST', url, true);\n\n xhr.onprogress = function (event) {\n if (event.lengthComputable) {\n console.log(e.loaded + \" / \" + event.total);\n }\n };\n\n xhr.onloadstart = function (event) {\n console.log(\"start\");\n };\n\n xhr.addEventListener('readystatechange', function (event) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n // Done. Inform the user\n\n } else if (xhr.readyState == 4 && xhr.status != 200) {\n // Error. Inform the user\n }\n });\n\n formData.append('file', file);\n xhr.send(formData);\n }", "function ajaxFileUpload(id,filename,module)\t\r\n{\t//alert(\"id,filename,module,imagename\"+id + \" \"+ filename+ \" \"+ module+ \" \"+ imagename);\r\n\tvar callurl=CMSSITEPATH+'/doajaxfileupload.php?elementname='+id;\t\r\n\t$.ajaxFileUpload\r\n\t\t(\r\n\t\t\t{\t\r\n\t\t\t\turl:callurl, \r\n\t\t\t\tsecureuri:false,\r\n\t\t\t\tfileElementId:id,\r\n\t\t\t\tfileElementName:filename,\r\n\t\t\t\tmoduleName:module,\r\n\t\t\t\tdataType: 'json',\r\n\t\t\t\tasync:false,\r\n\t\t\t\tsuccess: function (data, status)\r\n\t\t\t\t{\t//alert(data.msg);\r\n\t\t\t\t\tif(typeof(data.error) != 'undefined')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(data.error != '')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar set=0;\r\n\t\t\t\t\t\t\tsendrequest();\r\n\t\t\t\t\t\t}else{ \t\r\n\t\t\t\t\t\t\tsendrequest(data.msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\terror: function (data, status, e)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t)\r\n}", "function fileUpload(response, request)\n{\n var body=\"\";\n console.log (\" File_upload request received \");\n if(request.method== \"POST\")\n {\n request.on('data', function (data) {\n body += data;\n });\n request.on('end', function ()\n {\n body = qs.parse(body);\n task=body.task;\n\n console.log(\" ________________________\" + task);\n\n if(uploadFile_buffer)\n {\n\n console.log(uploadFile_buffer + \" called at first_attempt \" + uploadFile_name);\n var path= \"C:/AMD/\"+uploadFile_name;\n\n\n fs.open(path, 'a', 0755, function(err, fd) {\n if (err) throw err;\n\n fs.write(fd, uploadFile_buffer, null, 'Binary', function(err, written, buff) {\n fs.close(fd, function() {\n console.log('File saved successful!');\n\n sup.upload_server(uploadFile_name, response, global_user,task);\n\n\n\n });\n })\n });\n }\n\n else\n {\n\n console.log(uploadFile_buffer + \" called at second_attempt \" + uploadFile_name);\n\n setTimeout(function(){var path= \"C:/AMD/\"+uploadFile_name;\n\n\n var path= \"C:/AMD/\"+uploadFile_name;\n\n\n fs.open(path, 'a', 0755, function(err, fd) {\n if (err) throw err;\n\n fs.write(fd, uploadFile_buffer, null, 'Binary', function(err, written, buff) {\n fs.close(fd, function() {\n console.log('File saved successful!' + task);\n\n sup.upload_server(uploadFile_name, response, global_user, task);\n\n\n\n });\n })\n });},3000)\n }\n\n\n });\n\n }\n }" ]
[ "0.72109455", "0.68065494", "0.6431627", "0.64285105", "0.6408927", "0.6329918", "0.6251092", "0.6233021", "0.62218744", "0.62139416", "0.61401397", "0.6127133", "0.6110041", "0.6096919", "0.60918397", "0.60884875", "0.6083382", "0.6028441", "0.6026446", "0.60027665", "0.60027665", "0.6002115", "0.59935534", "0.599292", "0.5990773", "0.59870696", "0.5951977", "0.5934242", "0.59310377", "0.5930536", "0.59019774", "0.58845335", "0.588426", "0.58427095", "0.58424634", "0.5834366", "0.5829392", "0.5816171", "0.5811678", "0.5810339", "0.5800274", "0.57880014", "0.57700205", "0.57680196", "0.5762598", "0.57498515", "0.57393193", "0.5734949", "0.57280797", "0.57193875", "0.57044464", "0.57028556", "0.5701374", "0.5700698", "0.5698951", "0.5688861", "0.5688176", "0.5684812", "0.5675321", "0.567263", "0.5665433", "0.5661884", "0.5652354", "0.5638563", "0.5634628", "0.5621229", "0.56120986", "0.5601257", "0.5601247", "0.5594568", "0.5591447", "0.55914176", "0.55910915", "0.55900025", "0.5586035", "0.5582896", "0.55811125", "0.55773467", "0.55757356", "0.55696446", "0.55632764", "0.55632764", "0.55551386", "0.5553134", "0.5544224", "0.5540398", "0.5538457", "0.55375147", "0.55363435", "0.5532152", "0.55291677", "0.55276656", "0.5518363", "0.5509637", "0.54966795", "0.5493765", "0.5493736", "0.5475499", "0.54746056", "0.54742855" ]
0.6841957
1
This function retrieves all sales from Prospects list
function showSales() { //Highlight selected tile $('#LeadsTile').css("background-color", "#0072C6"); $('#OppsTile').css("background-color", "#0072C6"); $('#SalesTile').css("background-color", "orange"); $('#LostSalesTile').css("background-color", "#0072C6"); $('#ReportsTile').css("background-color", "#0072C6"); var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var hasSales = false; hideAllPanels(); var saleList = document.getElementById("AllSales"); list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var saleTable = document.getElementById("SaleList"); // Remove all nodes from the sale <DIV> so we have a clean space to write to while (saleTable.hasChildNodes()) { saleTable.removeChild(saleTable.lastChild); } // Iterate through the Propsects list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Sale") { // Create a DIV to display the organization name var sale = document.createElement("div"); var saleLabel = document.createTextNode(listItem.get_fieldValues()["Title"]); sale.appendChild(saleLabel); // Add an ID to the sale DIV sale.id = listItem.get_id(); // Add an class to the sale DIV sale.className = "item"; // Add an onclick event to show the sale details $(sale).click(function (sender) { showSaleDetails(sender.target.id); }); saleTable.appendChild(sale); hasSales = true; } } if (!hasSales) { var noSales = document.createElement("div"); noSales.appendChild(document.createTextNode("There are no sales. You can add a new sale from here.")); saleTable.appendChild(noSales); } $('#AllSales').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get sales. Error: " + args.get_message())); errArea.appendChild(divMessage); $('#SaleList').fadeIn(500, null); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "getAllSalesList() {\n fetch(process.env.REACT_APP_API_URL+\"/sales\")\n .then(res => res.json())\n .then(\n result => {\n this.setState({\n isLoaded: true,\n salesList: result,\n });\n },\n error => {\n this.setState({\n isLoaded: true,\n error: error\n });\n }\n );\n }", "function getAllProductsForSaleByStore() {\n return datacontext.get('Product/GetAllProductsForSaleByStore');\n }", "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function salesByProduct(products, lineItems){\n //TODO\n}", "function viewDeptSales() {\n salesByDept();\n}", "function viewSalesbyDept () {\n connection.query(\"SELECT department_name FROM departments\", function(err, res) {\n if (err) throw err;\n\n var departments = [];\n for(i in res) {\n join = `SELECT departments.department_name, departments.over_head_costs, SUM(product_sales) as 'total_sales'\n FROM departments INNER JOIN products \n ON departments.department_name = products.department_name\n WHERE departments.department_name = '${res[i].department_name}'; \n `\n\n connection.query(join, function(err, res2) {\n total_profit = res2[0].total_sales - res2[0].over_head_costs;\n salesInfo = new DepartmentSales(res2[0].department_name, res2[0].over_head_costs, res2[0].total_sales, total_profit);\n departments.push(salesInfo);\n console.table(salesInfo);\n });\n }\n });\n}", "function viewProductSales() {\n connection.query(\n 'SELECT department_id, departments.department_name, over_head_costs, sum(product_sales) as product_sales, sum(product_sales) - over_head_costs as total_profit FROM products right join departments on products.department_name=departments.department_name group by department_id, products.department_name, over_head_costs',\n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "function salesReport() {\n var totalSales = 0;\n \n // [ [ 102, 103, 104 ], [ 106, 107 ], [], [], [] ]\n for(var i = 0; i < bookedRooms.length; i++) {\n totalSales += bookedRooms[i].length * roomPrices[i]\n \n }\n \n return totalSales;\n}", "function calculateSales(salesData){\n var totalSales = 0;\n for (var sale in salesData){\n totalSales = totalSales + salesData[sale];\n }\n return totalSales;\n}", "function totalSales(products, lineItems){\n //TODO\n\n}", "function getRecords(datain)\n{\n var filters = new Array();\n var daterange = 'daysAgo90';\n var projectedamount = 0;\n var probability = 0;\n if (datain.daterange) {\n daterange = datain.daterange;\n }\n if (datain.projectedamount) {\n projectedamount = datain.projectedamount;\n }\n if (datain.probability) {\n probability = datain.probability;\n }\n \n filters[0] = new nlobjSearchFilter( 'trandate', null, 'onOrAfter', daterange ); // like daysAgo90\n filters[1] = new nlobjSearchFilter( 'projectedamount', null, 'greaterthanorequalto', projectedamount);\n filters[2] = new nlobjSearchFilter( 'probability', null, 'greaterthanorequalto', probability );\n \n // Define search columns\n var columns = new Array();\n columns[0] = new nlobjSearchColumn( 'salesrep' );\n columns[1] = new nlobjSearchColumn( 'expectedclosedate' );\n columns[2] = new nlobjSearchColumn( 'entity' );\n columns[3] = new nlobjSearchColumn( 'projectedamount' );\n columns[4] = new nlobjSearchColumn( 'probability' );\n columns[5] = new nlobjSearchColumn( 'email', 'customer' );\n columns[6] = new nlobjSearchColumn( 'email', 'salesrep' );\n columns[7] = new nlobjSearchColumn( 'title' );\n \n // Execute the search and return results\n \n var opps = new Array();\n var searchresults = nlapiSearchRecord( 'opportunity', null, filters, columns );\n \n // Loop through all search results. When the results are returned, use methods\n // on the nlobjSearchResult object to get values for specific fields.\n for ( var i = 0; searchresults != null && i < searchresults.length; i++ )\n {\n var searchresult = searchresults[ i ];\n var record = searchresult.getId( );\n var salesrep = searchresult.getValue( 'salesrep' );\n var salesrep_display = searchresult.getText( 'salesrep' );\n var salesrep_email = searchresult.getValue( 'email', 'salesrep' );\n var customer = searchresult.getValue( 'entity' );\n var customer_display = searchresult.getText( 'entity' );\n var customer_email = searchresult.getValue( 'email', 'customer' );\n var expectedclose = searchresult.getValue( 'expectedclosedate' );\n var projectedamount = searchresult.getValue( 'projectedamount' );\n var probability = searchresult.getValue( 'probability' );\n var title = searchresult.getValue( 'title' );\n \n opps[opps.length++] = new opportunity( record,\n title,\n probability,\n projectedamount,\n customer_display,\n salesrep_display);\n }\n \n var returnme = new Object();\n returnme.nssearchresult = opps;\n return returnme;\n}", "function processAllDailySales(){\n for (var index = 0; index < allStores.length; index++){\n processDailySales(allStores[index]);\n }\n\n}", "function loadSaleData() {\n fetch(`https://arnin-web422-ass1.herokuapp.com/api/sales?page=${page}&perPage=${perPage}`)\n .then((response) => {\n return response.json();\n })\n .then((myJson) => {\n saleData = myJson;\n let rows = saleTableTemplate(saleData);\n $(\"#sale-table tbody\").html(rows);\n $(\"#current-page\").html(page);\n })\n}", "function displaySaleItems() {\n var query = \"SELECT p.item_id AS Product_ID, p.product_name AS Item_Name, p.price AS Sale_Price FROM products p;\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n var productList = [];\n var productData = {};\n for (var i = 0; i < res.length; i++) {\n productData = { Product_ID: res[i].Product_ID, Item_Name: res[i].Item_Name, Sale_Price: res[i].Sale_Price };\n productList.push(productData);\n }\n console.log(\"\\r\\n***** PRODUCT LIST *****\\r\\n\")\n console.table(productList, \"\\r\\n\");\n purchaseItems();\n })\n}", "function salesReport(req, res) {\n let db = req.app.get('db');\n let limit = req.body.limit || 50;\n let offset = req.body.offset || 0;\n let baseQuery = `SELECT * from items where sold = true`;\n\n // if sortAttr is provided, add sort command to the query\n let sortAttr = req.body.sortAttr;\n let sortOrder = req.body.sortOrder || 'asc';\n if (sortAttr) baseQuery += ` order by ${sortAttr} ${sortOrder}`\n\n // add limit and offset to the query\n baseQuery += ` limit $1 offset $2`\n\n return db.query(baseQuery, [limit, offset])\n .then(items => {\n let numResults = items.length;\n let offsetForNextPage = offset + numResults;\n let offsetForPrevPage = offset - limit;\n if (offsetForPrevPage < 0) offsetForPrevPage = 0;\n // If we dont get a full set of results back, we're at the end of the data\n if (numResults < limit) offsetForNextPage = null;\n let data = {\n items,\n offsetForPrevPage: offsetForPrevPage,\n offsetForNextPage, offsetForNextPage\n }\n return sendSuccess(res, data);\n })\n .catch(e => sendError(res, e, 'salesReport'))\n}", "function productsForSale() {\n console.log(\"products for sale fxn\");\n connection.query(\"SELECT * FROM products\",function(err, res){\n if (err) throw err;\n for (var i=0; i<res.length;i++) {\n console.log(`Product Name: ${res[i].product_name}`);\n console.log(`Department Name: ${res[i].department_name}`);\n console.log(`Selling Price: $${res[i].price}`);\n console.log(`Quantity in Stock: ${res[i].stock_quantity}`);\n console.log(\"---------------------\");\n }\n });\n connection.end();\n }", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function showSale(){ \n // clear the console\n console.log('\\033c');\n // displaying the product list\n console.log(`\\x1b[7m Product Sales By Department \\x1b[0m`);\n // creating the query string\n var query = 'SELECT D.department_id AS \"DeptID\", D.department_name AS \"Department\", D.over_head_costs AS \"OverHeadCosts\", SUM(P.product_sales) AS \"ProductSales\", '; \n query += 'SUM(P.product_sales) - D.over_head_costs AS \"TotalProfit\" FROM departments D INNER JOIN products P ON D.department_name = P.department_name ';\n query += 'GROUP BY D.department_id';\n\n connection.query(\n query,\n function(err, res){\n if (err) throw err;\n\n console.table(\n res.map(rowData => {\n return{ \n \"Dept ID\": rowData.DeptID,\n \"Department Name\": rowData.Department,\n \"Over Head Costs\": rowData.OverHeadCosts,\n \"Product Sales\": rowData.ProductSales,\n \"Total Profit\": rowData.TotalProfit\n }\n })\n );\n endRepeat();\n }\n );\n}", "function totalSale(){\n\n console.log(sale.name);\n}", "function retriveMultiple() {\n var req = new XMLHttpRequest();\n req.open(\"GET\", Xrm.Page.context.getClientUrl() + \"/api/data/v9.1/new_salespersons?$filter=new_workingtype eq 2\", true);\n req.setRequestHeader(\"OData-MaxVersion\", \"4.0\");\n req.setRequestHeader(\"OData-Version\", \"4.0\");\n req.setRequestHeader(\"Accept\", \"application/json\");\n req.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\");\n req.onreadystatechange = function () {\n if (this.readyState === 4) {\n req.onreadystatechange = null;\n if (this.status === 200) {\n var results = JSON.parse(this.response);\n for (var i = 0; i < results.value.length; i++) {\n var new_salespersonid = results.value[i][\"new_salespersonid\"];\n updatemultiple(new_salespersonid);\n }\n } else {\n Xrm.Utility.alertDialog(this.statusText);\n }\n }\n };\n req.send();\n}", "function salesByDept() {\n var query =\n 'SELECT departments.department_id, departments.department_name, over_head_costs, SUM(product_sales) AS total_sales, (SUM(product_sales) - over_head_costs) AS total_profit ';\n query +=\n 'FROM departments INNER JOIN products ON (departments.department_name = products.department_name) ';\n query += 'GROUP BY departments.department_name';\n connection.query(query, function(err, res) {\n if (err) {\n throw err;\n } else {\n console.table(res);\n reset();\n }\n });\n}", "function forSale() {\n\t//Select item_id, product_name and price from products table.\n\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(error, results) {\n\t\tif (error) throw error;\n\t\tconsole.log(\"\\n\");\n\t\t//the below code displays the item_id, product_name and the price for all of items that available for sale. \n\t\tfor ( var index = 0; index < results.length; index++) {\n\t\t\tconsole.log(\"Product Id: \" + results[index].item_id + \"\\n\" +\n\t\t\t \"Product Name: \" + results[index].product_name + \"\\n\" +\n\t\t\t \"Price: $\" + results[index].price + \"\\n\" + \"Quantity: \" + results[index].stock_quantity + \"\\n\" + \n\t\t\t \"--------------------------------------------------------------------------\\n\");\n\t\t}// end for loop\n\t\trunSearch();\n\t});// end of query.\n\t\n} // end of forSale function", "function summarizedSalesByProduct() {\n // var dataSummarized = [];\n var data = get.mappedSalesData();\n\n return data.reduce(function(allSummary, week){\n var keeptrack = {};\n allSummary.push(week.reduce(function(weekSum, sale) {\n if (!keeptrack[sale.product]) {\n keeptrack[sale.product] = 1;\n weekSum.push({week: sale.week, category: sale.category, product: sale.product, quantity: sale.quantity, unitprice: sale.unitprice, revenue: sale.revenue, totalcost: sale.totalcost, profit: sale.profit });\n } else {\n var product = weekSum.find(function(item) {return item.product === sale.product;});\n product.quantity += sale.quantity;\n product.revenue += sale.revenue;\n product.totalcost += sale.totalcost;\n product.profit += sale.profit;\n\n if (typeof product.unitprice!== 'object' && product.unitprice!==sale.unitprice) {\n product.unitprice = [product.unitprice, sale.unitprice];\n } else if (typeof product.unitprice === 'object' && product.unitprice.indexOf(sale.unitprice)===-1) {\n product.unitprice.push(sale.unitprice);\n }\n }\n\n return weekSum;\n },[])\n );\n return allSummary;\n },[]);\n // return dataSummarized;\n }", "function totalSales(companysSales) {\n var sum = 0;\n for (var i = 0; i < companysSales.length; i++) {\n sum += companysSales[i];\n }\n return sum;\n}", "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "function getProductsStore(selectedStoreName) {\n \n // get the data in the active sheet \n var sheet = getOutputSheet(1); \n \n var cell = getOutputFirstCell(1);\n \n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select F, G, H, K, sum(I), max(L) where J='No Vendido' and K='\"+selectedStoreName+\"' group by G, F, H, K\\\")\");\n \n\t// create a 2 dim area of the data in the carrier names column and codes \n\tvar products = sheet.getRange(2, 1, sheet.getLastRow() -1, 6).getValues().reduce( \n\t\tfunction(p, c) { \n \n // add the product to the list\n\t\t\tp.push(c); \n\t\t\treturn p; \n\t\t}, []); \n \n return JSON.stringify(products);\n}", "function soldItems(){\n reportInfo.style.display = \"block\";\n\n $.ajax({\n url:\"/getSold\",\n type:\"post\", //\"post\" is behind the scenes (invisible) versus \"get\" (hijackable)\n success:function(resp){\n //loop through the select\n for(var i = 0; i<resp.length; i++){\n var tr = reportInfo.insertRow();\n var name = document.createElement(\"td\");\n var price = document.createElement(\"td\");\n var qty = document.createElement(\"td\");\n var type = document.createElement(\"td\");\n var revenue = document.createElement(\"td\");\n \n var soldQty = startQty - resp[i].qty;\n var revenueEarned = soldQty * resp[i].price;\n \n name.textContent = resp[i].itemname;\n price.textContent = resp[i].price;\n qty.textContent = soldQty;\n type.textContent = resp[i].type;\n revenue.textContent = \"$\" + revenueEarned;\n\n tr.appendChild(name);\n tr.appendChild(price);\n tr.appendChild(qty);\n tr.appendChild(type);\n tr.appendChild(revenue);\n \n if(resp[i].type == \"main\"){\n mainPrice += revenueEarned;\n } else if(resp[i].type == \"sides\") {\n sidePrice += revenueEarned;\n } else if(resp[i].type == \"dessert\") {\n dessPrice += revenueEarned;\n } else if(resp[i].type == \"beverage\") {\n bevPrice += revenueEarned;\n }\n \n revenueTotalPrice = revenueTotalPrice + revenueEarned;\n }\n revenueTotal.innerHTML = \"Total price of earned revenue: $\" + revenueTotalPrice;\n }\n });\n }", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "function salesByDep() {\n // console.log(\"loading product sales...\");\n\n // join department and products \n // table needs to have depid, depName, overhead, productSales and totalProfits \n\n\nconnection.query(`SELECT departments.department_id AS 'Department ID', \ndepartments.department_name AS 'Department Name', \ndepartments.over_head_costs as 'Overhead Costs', \nSUM(products.product_sales) AS 'Product Sales', \n(SUM(products.product_sales) - departments.over_head_costs) AS 'Total Profit' \nFROM departments\nLEFT JOIN products on products.department_name=departments.department_name\nGROUP BY departments.department_name, departments.department_id, departments.over_head_costs\nORDER BY departments.department_id ASC`, (err, res) => {\n if (err) throw err;\n console.log('\\n ----------------------------------------------------- \\n');\n console.table(res);\n\n startSuper();\n\n });\n\n\n}", "function productsForSale() {\n connection.query('SELECT * FROM products', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity', 'product_sales'],\n colWidths: [10, 25, 20, 10, 18, 15]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].department_name, allProducts[i].price, allProducts[i].stock_quantity, allProducts[i].product_sales]);\n }\n\n console.log(table.toString());\n console.log('\\n');\n managerView();\n });\n}", "function GetProducListFromUI() {\n var returnProductList = [];\n\n\n var rowCount = $('#itemList').rowCount();\n for (var iProd = 1; iProd <= rowCount; iProd++) {\n var prod_ID = iProd;\n var prod_name = $('#itemName' + iProd).val();\n var prod_HSNCode = $('#itemHSNSAC' + iProd).val();\n var prod_description = $('#itemDescription' + iProd).val();\n var prod_Gst = $('#itemGST' + iProd).val();\n var prod_Rate = $('#itemRate' + iProd).val();\n var prod_Qty = $('#itemQty' + iProd).val();\n var prod_TotalAmount = $('#itemAmount' + iProd).val();\n var product = { Name: prod_name, HSNCode: prod_HSNCode, Description: prod_description, GSTPercentage: prod_Gst, ID: prod_ID }\n returnProductList.push(product);\n }\n }", "function displaySalesRecords() {\n\t\n\tvar table = document.getElementById(\"table\");\n\t\n\tvar json = getJSONObject();\n\t\n\t//Uncomment to debug json variable\n\t//console.log(json);\n\t\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", \"../dp2-api/api/\", true);\t// All requests should be of type post\n\txhr.onreadystatechange = function() {\n\t\tif(xhr.readyState == 4) {\n\t\t\tif(xhr.status == 200) {\n\t\t\t\tconsole.log(JSON.parse(xhr.responseText)); // Barring error conditions, responses will be valid JSON\n\t\t\t\tvar data = JSON.parse(xhr.responseText); \n\t\t\t\t\n\t\t\t\tvar i;\n\t\t\t\t\n\t\t\t\t//Construct HTML table header row\n\t\t\t\t//This needs to be exist singularly every time a new table is generated\n\t\t\t\tvar html = \"<caption>Sales Records</caption><thead><tr><th>ID</th><th>Product ID</th><th>Name</th><th>Quantity</th><th>Amount</th><th>DateTime</th></tr></thead><tbody>\";\n\t\t\t\t\n\t\t\t\tfor(i=0; i < data[0].length; i++)\n\t\t\t\t{\n\t\t\t\t\thtml += \"<tr><td>\" + data[0][i].id + \"</td><td>\" + data[0][i].product + \"</td><td>\" + data[0][i].name + \"</td><td>\" + data[0][i].quantity + \"</td><td>\" + displayAmount(data[0][i].value, data[0][i].quantity) + \"</td><td>\" + formatDateAndTime(data[0][i].dateTime) + \"</td></tr>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\thtml += \"</tbody>\";\n\t\t\t\t\n\t\t\t\t//Uncomment to debug html variable e.g. see the table HTML that has been generated\n\t\t\t\t//console.log(html);\n\t\t\t\t\n\t\t\t\t//This writes the newly generated table to the table element \n\t\t\t\ttable.innerHTML = html;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tconsole.error(xhr.responseText);\n\t\t\t}\n\t\t}\n\t};\n\txhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\txhr.send(\"request=\" + encodeURIComponent(JSON.stringify(json)));\n}", "list(req, res) {\n return Student\n .findAll({\n // include: [{\n // model: CommunityService,\n // as: 'community_service',\n // }],\n })\n .then(student => res.status(200).send(student))\n .catch(error => res.status(400).send(error));\n }", "function querySaleProducts() {\n\tinquirer\n\t.prompt({\n\t\tname: \"customer_name\",\n\t\ttype: \"input\",\n\t\tmessage: \"Dear Customer, please enter your name.\"\n\t})\n\t.then(function(answer) {\n\t\tconsole.log(\"Welcome to Bamazon, \" + answer.customer_name + \":) Here is our special sales for you!\");\n\n\t\tvar query = \"SELECT * FROM products WHERE stock_quantity <> 0\";\n\n\t\tconnection.query(query, function(err, res) {\n\t\t\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Item ID: \" + res[i].item_id + \" | \" + res[i].department_name + \": \" + res[i].product_name + \" for $\" + numberWithCommas(res[i].price));\n\t\t}\n\n\t\tqueryOrder();\n\t\t});\t\n\t});\n}", "function getAllSales() {\n if (!sessionStorage.current_user) {\n window.location.href = \"index.html\";\n }\n var init = {\n method : 'GET',\n headers : header\n \n };\n\n req = new Request(sales_url,init)\n\n fetch(req)\n .then((res)=>{\n console.log(res);\n status = res.status\n return res.json();\n })\n .then((data)=>{\n if (status==401){\n window.location.href = \"index.html\";\n }\n\n rowNum = 1; //the row id\n data['Sales Record'].forEach(sale => {\n\n // save the queried data in a list for ease of retrieving\n\n sales_record[sale['sales_id']] = {\n \"user_id\": sale['user_id'],\n \"product_id\": sale['product_id'],\n \"quantity\": sale['quantity'],\n \"sales_amount\": sale['sales_amount'],\n \"sales_date\": sale['sales_date']\n };\n console.log(sales_record)\n sales_table = document.getElementById('tbl-products')\n let tr = createNode('tr'),\n td = createNode('td');\n \n\n // table data\n t_data=[\n rowNum,sale['product_name'],\n sale['username'],\n sale['sales_date'],\n sale['sales_amount']\n ];\n console.log(t_data)\n\n tr = addTableData(tr,td,t_data);\n console.log(tr);\n\n\n // add the view edit and delete buttons\n td = createNode('td')\n td.innerHTML=` <i id=\"${sale['sales_id']}\" onclick=\"showProductPane(this)\" class=\"fas fa-eye\"> </i>`;\n td.className=\"text-green\";\n appendNode(tr,td);\n console.log(\"here\")\n\n \n \n\n appendNode(sales_table,tr);\n rowNum +=1\n });\n\n });\n}", "function viewProductsForSale(callback) {\n // Query DB\n connection.query(`SELECT id,\n product_name, \n department_name, \n price,\n stock_quantity\n FROM products`, function (error, results, fields) {\n if (error) throw error;\n\n // Display results\n console.log();\n console.table(results);\n\n if (callback) {\n callback();\n }\n });\n}", "function viewDepartmentSales() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n 2: {\n alignment: 'right'\n },\n 3: {\n alignment: 'right'\n },\n 4: {\n alignment: 'right'\n }\n }\n };\n data[0] = [\"Department ID\".cyan, \"Department Name\".cyan, \"Over Head Cost ($)\".cyan, \"Products Sales ($)\".cyan, \"Total Profit ($)\".cyan];\n let queryStr = \"departments AS d INNER JOIN products AS p ON d.department_id=p.department_id GROUP BY department_id\";\n let columns = \"d.department_id, department_name, over_head_costs, SUM(product_sales) AS sales\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n DEPARTMENTS\".magenta);\n for (let i = 0; i < res.length; i++) {\n let profit = res[i].sales - res[i].over_head_costs;\n data[i + 1] = [res[i].department_id.toString().yellow, res[i].department_name, res[i].over_head_costs.toFixed(2), res[i].sales.toFixed(2), profit.toFixed(2)];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "async function getSalesData(date) {\n const salesRequest = {\n functionName: 'getOperations',\n parameters: {\n OperType: 2,\n fromDate: `${date.toISOString().substring(0, 10)} 00:00:00`,\n },\n functionData: null,\n };\n const sales = await fetchData(salesRequest);\n return sales;\n}", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function viewSalesByDept(){\n console.log(\"******************************\");\n console.log(\"* Product Sales By Department*\");\n console.log(\"******************************\");\n\n connection.query('SELECT * FROM departments', function(err, res){\n if(err) throw err;\n \n // empty array to store table contents\n var values = [] ;\n for(var i = 0; i<res.length;i++){\n var resArr = [res[i].department_id, res[i].department_name, (res[i].over_head_costs).toFixed(2), (res[i].product_sales).toFixed(2), (res[i].product_sales - res[i].over_head_costs).toFixed(2)];\n \n // looping through the data and push the values into the array\n values = values.concat([resArr]);\n }\n \n // console.table performs as we need, first parameter being headers for the table, second parameter being the rows underneath \n console.table(['department_id', 'department_name', 'over_head_costs', 'product_sales', 'total_profit'], values);\n\n // confirm whether or not the user wants to see the options again\n rerun();\n })\n}", "function getAllPurchases() {\n return Purchase.find();\n}", "function getSalesByEmployee(data) {\n var employeeSales = {};\n\n for (var i = 0; i < data.length; i++) {\n var d = data[i];\n if (!employeeSales[d.salesman]) {\n employeeSales[d.salesman] = 0;\n }\n employeeSales[d.salesman] += Number(d.amount);\n }\n return employeeSales;\n}", "allProducts(productsListFromProps) {\n if (productsListFromProps.length > 0) {\n const l = productsListFromProps.length;\n let indexedProductsAll = [];\n for (let x = 0; x < l; x++) {\n indexedProductsAll.push({ seqNumb: x, details: productsListFromProps[x] })\n }\n return indexedProductsAll;\n } else {\n return [];\n }\n }", "function getProducers() {\n\tajax('GET', 'producers', null, createExternalList);\n}", "function displayForSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n\n if (err) throw err;\n var price;\n items = res.length;\n var sales;\n console.log(\"=====================================================================\");\n var tableArr = [];\n for (var i = 0; i < res.length; i++) {\n sales = parseFloat(res[i].product_sales).toFixed(2);\n price = parseFloat(res[i].price).toFixed(2);\n tableArr.push(\n {\n ID: res[i].item_id,\n PRODUCT: res[i].product_name,\n DEPARTMENT: res[i].department_name,\n PRICE: price,\n ONHAND: res[i].stock_quantity,\n SALES: sales\n }\n )\n }\n console.table(tableArr);\n console.log(\"=====================================================================\");\n promptChoice();\n })\n}", "function getSuppliers() {\n\tajax('GET', 'suppliers', null, createExternalList);\n}", "function getEmployees(data) {\n var employees = [];\n\n for (var i = 0; i < data.length; i++) {\n var d = data[i];\n\n if (!employees.includes(d.salesman)) {\n employees.push(d.salesman);\n }\n }\n return employees;\n}", "function forSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id + \"; Product: \" + res[i].product_name + \"; Department: \" + res[i].department_name + \"; Price: $\" + res[i].price + \"; Quantity Available: \" + res[i].stock_quantity);\n };\n nextToDo();\n });\n}", "getProducts() {}", "function getDiscounts() {\n var pagina = 'ProjectPlans/listDiscounts';\n var par = `[{\"level\":\"1\"}]`;\n var tipo = 'json';\n var selector = putDiscounts;\n fillField(pagina, par, tipo, selector);\n}", "function getProducts(){\n return catalog;\n }", "saleList() {\n axios.get(`Sales/GetSales`)\n .then(({data}) => {\n this.setState({\n sales: data\n });\n })\n .catch(err => console.log(err));\n }", "obtenerTodosProductorPersona() {\n return axios.get(`${API_URL}/v1/productorpersonaReporte/`);\n }", "function loopingData1() {\n //create a variable named 'saleDates' which should be initialized as an empty array.\n let saleDates = [];\n\n //write a for loop to iterate over sales data for store3, and uses the .push() method to add the value stored in the [date] key for each index of the array to our 'saleDates' variable\n for (let i = 0; i < store3.length; i++) {\n saleDates.push(store3[i]['date']);\n }\n\n //return the now populated 'saleDates' variable\n return saleDates;\n}", "function productsForSale() {\n\tvar query = \"SELECT * FROM products HAVING stock_quantity > 0\";\n\tconnection.query(query, function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n\t\t\tconsole.log(\"-----------------------------\");\n\t\t}\n\trunSearch();\n\t});\n}", "function getTotalProductSales(dept, newOHC) {\n connection.query(\"SELECT SUM(product_sales) AS totalProductSales FROM products WHERE department_name = ?\", [dept], function (err, res) {\n if (err) throw err;\n let totalProductSales;\n for (let i = 0; i < res.length; i++) {\n totalProductSales = res[i].totalProductSales;\n }\n console.log(\"Total product sales for \" + dept + \" is: \" + totalProductSales);\n updateProductSales(dept,newOHC, totalProductSales)\n })\n}", "function productsales(){\n\n var query=\"select departments.department_id,departments.department_name,departments.over_head_costs,sum(products.product_sales) as productsales from departments \" \n + \"left join products on departments.department_name=products.department_name where products.product_sales is not null \"\n + \"group by products.department_name\";\n connection.query(query, function(err,res){\n if(err) throw err;\n //if no record found\n if(res.length<=0)\n {\n console.log(\"\\nNo Records found!!\\n\");\n }\n else\n {\n \n var table = new Table({\n head: ['Id', 'department_name', 'over_head_costs','product_sales','total_profit']\n , colWidths: [4, 20, 17, 15, 15]\n });\n for(i=0;i<res.length;i++){\n var total_profit=((res[i].productsales)-(res[i].over_head_costs));\n table.push(\n [res[i].department_id, res[i].department_name, res[i].over_head_costs, res[i].productsales,total_profit]\n );\n }\n \n console.log(table.toString());\n }\n runSearch();\n });\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function totalSales(shirtQuantity, pantQuantity, shoeQuantity) {\n const cart = [\n { name: 'shirt', price: 100, quantity: shirtQuantity },\n { name: 'pant', price: 200, quantity: pantQuantity },\n { name: 'shoe', price: 500, quantity: shoeQuantity }\n ];\n let cartTotal = 0;\n for (const product of cart) {\n const productTotal = product.price * product.quantity;\n cartTotal = cartTotal + productTotal;\n }\n return cartTotal;\n}", "getProducts() {\n this.productService.getProducts({ page: 1, perPage: 5, filter: '' }).subscribe(products => {\n this.products = products.docs;\n this.docsTotal = products.total;\n }, err => {\n console.log(err);\n });\n }", "getProductItems(data) {\n const items = [];\n for (let i = 0; i < data.products.length; i += 1) {\n const p = data.products[i];\n items.push({ id: p.aonr, price: p.priceData.total, quantity: p.quantity });\n }\n return items;\n }", "function getProducts () {\n getRequest('products', onGetProducts);\n }", "function GetSummary() {\n var YearQuery = '';\n if (FilterList.DashboardFilterYear === '') {\n YearQuery =\n ' business_year = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('YYYY') +\n \"'\";\n } else {\n YearQuery =\n ' business_year = ' + \"'\" + FilterList.DashboardFilterYear + \"'\";\n }\n\n var MonthQuery = '';\n if (FilterList.DashboardFilterMonth === '') {\n MonthQuery =\n ' and business_month = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('MMMM') +\n \"'\";\n } else {\n MonthQuery =\n ' and business_month = ' + \"'\" + FilterList.DashboardFilterMonth + \"'\";\n }\n\n var TeamQuery = '';\n if (\n FilterList.DashboardFilterTeam === '' ||\n FilterList.DashboardFilterTeam === 'ALL'\n ) {\n TeamQuery = ' and team IN ' + global.TeamAccessList;\n } else {\n TeamQuery = ' and team = ' + \"'\" + FilterList.DashboardFilterTeam + \"'\";\n }\n\n var VendorQuery = '';\n if (\n FilterList.DashboardFilterVendor === '' ||\n FilterList.DashboardFilterVendor === 'ALL'\n ) {\n VendorQuery = ' and principal_name like ' + \"'%%' \";\n } else {\n VendorQuery =\n ' and principal_name = ' + \"'\" + FilterList.DashboardFilterVendor + \"'\";\n }\n\n dbperymtsat.transaction((tx) => {\n tx.executeSql(\n 'SELECT SUM(amount) as amount , SUM(target) as target FROM perymtsat_tbl where ' +\n YearQuery +\n MonthQuery +\n TeamQuery +\n VendorQuery +\n ' order by invoice_date asc ',\n [],\n (tx, results) => {\n var len = results.rows.length;\n if (len > 0) {\n // console.log(results.rows.item(0).target);\n //console.log(results.rows.item(0).amount);\n //setTotalSales();\n setTotalTarget(parseInt(results.rows.item(0).target));\n setTotalSales(parseInt(results.rows.item(0).amount));\n settotalSalesAnimation(true);\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n\n // console.log(\n // 'Successfully got summary of ' +\n // FilterList.DashboardFilterMonth +\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n // );\n }\n },\n SQLerror,\n );\n });\n }", "function viewSales() {\n // This was the hardest part of the whole assignment (I know if I say that this query slightly intimidates me with its complexity that whoever is grading this will just laugh to themselves)\n connection.query(\"SELECT id AS ID, name AS Department_Name, over_head_costs AS Overhead_Costs, Product_Sales, (newTable.Product_Sales - departments.over_head_costs) AS Total_Sales FROM departments LEFT JOIN (SELECT sum(product_sales) AS Product_Sales, department_name FROM products GROUP BY department_name) AS newTable ON departments.name = newTable.department_name;\", function (error, results) {\n // Format the table a bit better\n // This is mostly to get better column names and to format dollar amounts\n let formatted = [];\n for (let i = 0; i < results.length; i++) {\n let obj = {\n ID: results[i].ID,\n \"Department Name\": results[i].Department_Name,\n \"Overhead Costs\": parseFloat(results[i].Overhead_Costs).toLocaleString('en-US', { style: 'currency', currency: 'USD' }),\n \"Product Sales\": parseFloat(results[i].Product_Sales).toLocaleString('en-US', { style: 'currency', currency: 'USD' }),\n \"Total Sales\": parseFloat(results[i].Total_Sales).toLocaleString('en-US', { style: 'currency', currency: 'USD' })\n };\n formatted.push(obj);\n }\n\n // Display the table\n console.log(\"\\n********************************************\");\n console.table(formatted);\n console.log(\"********************************************\\n\");\n\n // Ask the user again what they would like to do\n start();\n });\n}", "function getNotSoldProducts(store) {\n \n // get the output1 sheet\n\tvar sheet = getOutputSheet(1)\n \n // get the first cell of the Output1 sheet\n var cell = getOutputFirstCell(1);\n \n // set the formula to get the asked information\n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select F, G, H, J, L, sum(I) where J='No Vendido' and K='\"+store+\"' group by G, F, H, J, L\\\")\");\n \n\t// create a 2 dim area of the data in the carrier names column and codes \n\tvar products = sheet.getRange(2, 1, sheet.getLastRow()-1, 6).getValues();\n \n if (products.length > 0) {\n \n products.reduce( \n\t\tfunction(p, c) { \n \n // if the inventory is greater than zero, add it to the list\n var inventory = c[5];\n \n if (inventory > 0) {\n \n\t\t\tp.push(c); \n }\n\t\t\treturn p; \n\t\t}, []); \n }\n \n \n return JSON.stringify(products);\n}", "function getCommercials() {\n const options = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"bearer \" + localStorage.getItem(\"token\"),\n },\n };\n\n fetch(\"http://localhost:4000/admin/view-commercials\", options)\n .then((response) => {\n return response.json();\n })\n .then(\n (data) => {\n setCommercial(data);\n },\n (error) => {\n console.log(error);\n }\n );\n }", "function obtenerProductos(req, res) {\n ProductoSucursal.find().populate('sucursal', 'nombreSucursal').exec((err, productosEncontrados) => {\n if (err) {\n return res.status(500).send({ ok: false, message: 'Hubo un error en la petición.' });\n }\n\n if (!productosEncontrados) {\n return res.status(404).send({ ok: false, message: 'Error en la consulta o no existen datos para mostrar.' });\n }\n\n return res.status(200).send({ ok: true, productosEncontrados });\n });\n}", "function shop(shoppers,item){\n var person = [];\n var profit = 0;\n var stok = item[2];\n for (var i = 0; i < shoppers.length; i++){\n if(shoppers[i].product === item[0] && shoppers[i].amount <= stok){\n stok -= shoppers[i].amount;\n profit += item[1]*shoppers[i].amount;\n person.push(shoppers[i].name);\n }\n }\n return [person,profit,stok];\n }", "function listProducts(prods) {\n let product_names = [];\n for ( i = 0; i < prods.length; i += 1 ) {\n product_names.push(prods[i].name);\n }\n return product_names;\n}", "function filterSalesRecords(event) {\n\t\n\t//construct empty retrieve JSON object\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"retrieve\"\n\t\t\t}\n\t\t]\n\t};\n\t\n\t//console.log(json);\n\t\n\treturn sendAPIRequest(json, event, displaySalesRecords);\n}", "async function menu_ViewProductsForSale() {\n console.log(`\\n\\tThese are all products for sale.\\n`);\n\n //* Query\n let products;\n try {\n products = (await bamazon.query_ProductsSelectAll(\n ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity']\n )).results;\n } catch(error) {\n if (error.code && error.sqlMessage) {\n // console.log(error);\n return console.log(`Query error: ${error.code}: ${error.sqlMessage}`);\n }\n // else\n throw error;\n }\n // console.log(products);\n\n //* Display Results\n if (Array.isArray(products) && products.length === 0) {\n return console.log(`\\n\\t${colors.red(\"Sorry\")}, there are no such product results.\\n`);\n }\n\n bamazon.displayTable(products, \n [ bamazon.TBL_CONST.PROD_ID, \n bamazon.TBL_CONST.PROD , \n bamazon.TBL_CONST.DEPT , \n bamazon.TBL_CONST.PRICE , \n bamazon.TBL_CONST.STOCK ], \n colors.black.bgGreen, colors.green);\n\n return;\n}", "function readAllProds() {\n $(\"#tableProd td\").remove(); //destroi tabela e remonta\n listAllItems(\"produtos\", showProd);\n}", "getProducts() {\n this.productService.getProducts({ page: 1, perPage: 10, filter: '' }).subscribe(products => {\n this.products = products.docs;\n }, err => {\n console.log(err);\n });\n }", "function productsForSale (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "static get_All_products(){\n return products;\n }", "function viewSalesByDept(){\n\n connection.query('SELECT * FROM Departments', function(err, res){\n if(err) throw err;\n\n // Table header\n console.log('\\n' + ' ID | Department Name | OverHead Costs | Product Sales | Total Profit');\n console.log('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -')\n \n // Loop through database and show all items\n for(var i = 0; i < res.length; i++){\n\n //=============================== Add table padding ====================================\n var departmentID = res[i].DepartmentID + ''; // convert to string\n departmentID = padText(\" ID \", departmentID);\n\n var departmentName = res[i].DepartmentName + ''; // convert to string\n departmentName = padText(\" Department Name \", departmentName);\n\n // Profit calculation\n var overHeadCost = res[i].OverHeadCosts.toFixed(2);\n var totalSales = res[i].TotalSales.toFixed(2);\n var totalProfit = (parseFloat(totalSales) - parseFloat(overHeadCost)).toFixed(2);\n\n\n // Add $ signs to values\n overHeadCost = '$' + overHeadCost;\n totalSales = '$' + totalSales;\n totalProfit = '$' + totalProfit;\n\n // Padding for table\n overHeadCost = padText(\" OverHead Costs \", overHeadCost);\n totalSales = padText(\" Product Sales \", totalSales);\n \n // =================================================================================================\n\n console.log(departmentID + '|' + departmentName + '|' + overHeadCost + '|' + totalSales + '| ' + totalProfit);\n }\n connection.end();\n });\n}", "function getLicenses() {\n console.log(\"google.payments.inapp.getPurchases\");\n statusDiv.text(\"Retreiving list of purchased products...\");\n google.payments.inapp.getPurchases({\n 'parameters': {env: \"prod\"},\n 'success': onLicenseUpdate,\n 'failure': onLicenseUpdateFailed\n });\n}", "obtenerProductoresMasculino() {\n return axios.get(`${API_URL}/v1/productorpersonaReporteM/`);\n }", "function retrieveAll() {\n console.log(\"* ProductsController: retrieveAll\");\n ProductsService\n .retrieveAll()\n .then(function (data) {\n console.log(\"> Controller Result:\", data);\n vm.result = data;\n // vm.result.sort(CommonService.sortCusine);\n })\n .catch(function (err) {\n console.log(\"> Controller Error:\", err);\n // console.log(\"Controller Error 2:\", JSON.stringify(err));\n });\n }", "function salesAPI($http) {\n\t'use strict';\n\n\t/**\n\t * Get the initial supply quantities for the day.\n\t **/\n\tvar getSalesRecords = function() {\n\t \treturn $http({\n\t \t\t\tmethod: 'GET', \n\t \t\t\turl: '/data/sales'\n\t \t\t});\n\t};\t\n\n\t//API\n\treturn {\n\t\tgetSalesRecords: getSalesRecords\n\t};\n\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "ListTheEmailProServices(packName) {\n let url = `/pack/xdsl/${packName}/emailPro/services`;\n return this.client.request('GET', url);\n }", "function getSaleLinesData(shopObj, endPoint, clear){\n var objSheet = shopObj.saleLineSheetName;\n var ssID = shopObj.ID;\nlogSales(\"Shop Object\",shopObj.saleLineSheetName)\nvar ss = SpreadsheetApp.openById(ssID);\n var sheet = ss.getSheetByName(objSheet);\n sheet.activate();\n var saleOffset = getCurrentSaleLineID(sheet,ssID); \n if(UIONOFF){ ss.toast(\"Sale Line Off set ID =\"+saleOffset);}\n var headerRows = 1;\n var offset = 0;\n // == -- Specify the type of call needed -- == \\\\ \n var type = \"GET\";\n // == -- Build the URL with any offsets -- == \\\\\n var url = shopObj.saleLine;\n // == -- adjust process for updating info or replacing info -- == \\\\ \n if(!clear && saleOffset){ \n // logSales(\"sales object\",shopObj);\n url = url+\"&saleLineID=%3E,\"+saleOffset;\n// logSales(\"log Url\",url);\n updateSaleID(shopObj.name,saleOffset)\n } else {\n clearSheet(headerRows, sheet);\n saleOffset = 0;\n }\n \n// logSales(\"url\",url);\n // == -- Initiate the OAuth / Api Call with the given variables -- == \\\\ \n var data = getData(offset,url,endPoint,type);\n if(data.length>=0 ){\n for(var i = 0; i<data.length; i++){\n var row = data[i];\n// logSales(\"Data Row\",row);\n getNames(row);\n// fixItems(row);\n fixDates(row);\n }}\n // == -- Make the call to insert the rows needed for the new data and insert the data -- == \\\\ \n insertData(sheet,data);\n}", "function topSellerByRevenue(products, lineItems){\n //TODO\n}", "function viewSales() {\n connection.query(\"SELECT departments.Department_ID,departments.Department_Name,SUM(departments.Over_Head_Costs) AS Total_Costs,SUM(products.Product_Sales) AS Total_Sales,(SUM(products.Product_Sales)-SUM(departments.Over_Head_Costs)) AS Total_Profit FROM departments LEFT JOIN products ON departments.Department_Name = products.Department_Name GROUP BY Department_ID\",\n\n // CREATES TABLE FOR DEPARTMENT SALES //\n function (err, res) {\n if (err) throw err;\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗'\n , 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝'\n , 'left': '║', 'left-mid': '╟', 'mid': '─', 'mid-mid': '┼'\n , 'right': '║', 'right-mid': '╢', 'middle': '│'\n }\n }); \n\n // SPECIFIES WHERE DATA FROM DATABASE IS PLACED IN TABLE //\n table.push(\n [colors.cyan('Department ID#'), colors.cyan('Department Name'), colors.cyan('Overhead Costs'), colors.cyan('Product Sales'), colors.cyan(\"Total Profit\")]\n );\n\n // ITERATES THROUGH ALL ITEMS AND FILLS TABLE WITH ALL RELEVANT INFORMATION FROM DATABASE //\n for (var i = 0; i < res.length; i++) {\n\n // SETTING UP FUNCTIONS TO PREVENTS DATA BEING DISPLAYED AS NULL //\n let tSales = res[i].Total_Sales;\n let pSales = res[i].Total_Profit;\n \n // VALIDATES TOTAL SALES //\n function validateT (amt){\n if (amt === null){\n return 0.00;\n } else return amt;\n }; \n\n // VALIDATES PRODUCT SALES //\n function validateP (amt){\n if (amt === null){\n return 0.00;\n } else return amt;\n }; \n\n table.push(\n [colors.cyan(res[i].Department_ID), res[i].Department_Name, \"$\" + res[i].Total_Costs, '$' + validateT(tSales), \"$\" + validateP(pSales)]\n );\n }\n console.log(table.toString());\n console.log(colors.grey(\"----------------------------------------------------------------------\"));\n \n // PROMPTS WITH SUPERVISOR SELECTION //\n runInquirer();\n })\n}", "function drillSale() {\n var hasSale = false;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n var type = \"Sale\";\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n\n // Success returned from executeQueryAsync\n var saleTable = document.getElementById(\"drillTable\");\n\n // Remove all nodes from the drillTable <DIV> so we have a clean space to write to\n while (saleTable.hasChildNodes()) {\n saleTable.removeChild(saleTable.lastChild);\n }\n\n // Iterate through the Prospects list\n var listItemEnumerator = listItems.getEnumerator();\n\n var listItem = listItemEnumerator.get_current();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n // Get information for each Sale\n var saleTitle = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n var salePerson = document.createTextNode(listItem.get_fieldValues()[\"ContactPerson\"]);\n var saleNumber = document.createTextNode(listItem.get_fieldValues()[\"ContactNumber\"]);\n var saleEmail = document.createTextNode(listItem.get_fieldValues()[\"Email\"]);\n var saleAmt = document.createTextNode(listItem.get_fieldValues()[\"DealAmount\"]);\n\n\n drillTable(saleTitle.textContent, salePerson.textContent, saleNumber.textContent, saleEmail.textContent, saleAmt.textContent, type, saleAmount);\n }\n hasSale = true;\n }\n\n if (!hasSale) {\n // Text to display if there are no Sales\n var noSales = document.createElement(\"div\");\n noSales.appendChild(document.createTextNode(\"There are no Sales.\"));\n saleTable.appendChild(noSales);\n }\n $('#drillDown').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get Sales. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n\n });\n}", "function getAllsSPaymentTerm(prodId, channelId){\n\t\t \t\tvar q = $q.defer();\n\t\t\t\t var policyTerm = commonDBFuncSvc.getParamValue(prodId,channelId,'PPT');\n\t\t\t\t policyTerm.then(function(val) {\n\t\t\t\t \t$log.debug('kkk',val);\n\t\t\t\t \tvar p = JSON.parse(val);\n\t\t\t\t \tvar arr = [];\n\t\t\t\t \tfor (var prop in p) {\n\t\t\t\t\t if( p.hasOwnProperty( prop ) ) {\n\t\t\t\t\t var obj = {};\n\t\t\t\t\t obj.id=prop;\n\t\t\t\t\t obj.name = p[prop][0];\n\t\t\t\t\t arr.push(obj);\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\t$log.debug(\"Object:::\" , arr);\n\t\t\t\t\tq.resolve(arr);\n\t\t\t\t });\n \t \t\t\treturn q.promise;\n\n\t \t\t}", "function accessesingData1() {\n let bananaSaleDates = [];\n for (var i = 0; i < store2['sale dates']['Banana Bunches'].length; i++) {\n bananaSaleDates.push(store2['sale dates']['Banana Bunches'][i]);\n } return bananaSaleDates;\n}", "function getProductList() {\n console.log(\"google.payments.inapp.getSkuDetails\");\n statusDiv.text(\"Retreiving list of available products...\");\n google.payments.inapp.getSkuDetails({\n 'parameters': {env: \"prod\"},\n 'success': onSkuDetails,\n 'failure': onSkuDetailsFailed\n });\n}", "function fillCustomerandSales(){\n for (var i = 0; i<allStores.length; i++){\n popCustomer(allStores[i]);\n popSales(allStores[i]);\n }\n}", "async getAllProduct() {\n const productList = [];\n const snapshot = await firebase.firestore().collection('product').get();\n snapshot.forEach(doc => {\n productList.push(doc.data().value);\n });\n return productList;\n }", "function getServicesList() {\n\t\t\tcustApi.getServices().\n\t\t\tsuccess(function (data, status, header, config) {\n\t\t\t\tconsole.log(\"Services retrieved successfully\");\n\t\t\t\tvm.apptCost = data.payload[0].rate;\n\t\t\t\tvar serviceMap = buildServicesMap(data.payload);\n\t\t\t\tvm.physiotherapyId = serviceMap[\"physiotherapy\"];\n\t\t\t\tcustportalGetSetService.setPhysioId({\"physioId\": vm.physiotherapyId, \"apptCost\": vm.apptCost});\n\t\t\t}).\n\t\t\terror(function (data, status, header, config) {\n\t\t\t\tconsole.log(\"Error in retrieving services\");\n\t\t\t});\n\t\t}", "function getProducts(storeId) {\n StoreService.getProductLines(storeId).\n then(function (data) {\n var productlines = data;\n\n $scope.productLines = productlines;\n });\n\n }", "function getStoreProducts(storeId) {\n StoreService.getProductLines(storeId).\n then(function (data) {\n var productlines2 = data;\n\n $scope.productLines2 = productlines2;\n });\n\n }", "calculateProfit(data) {\n for (var i = 0; i < data.length; i ++) {\n data[i].profit = data[i].revenue - data[i].totalCost\n }\n return data;\n }", "function getSalesByEvent(req,res){\n let eventID = req.params.eventID;\n\n Ticket.aggregate(\n [\n {\n $match:\n { \"event\" : mongoose.Types.ObjectId(eventID) }\n } //Para aggregate es necesario hacer casting explícito!!\n ,{\n $group:\n { \n _id: null,\n total: {$sum: \"$price\"} \n }\n }\n ]\n , function (err, result)\n {\n if (err) return res.status(500).send({ message:`Error al realizar la petición ${err}`});\n\n let total = 0;\n\n if (result.length)\n total = result[0].total;\n\n res.status(200).send({total});\n }\n );\n}", "function calculateReport()\n{\n for(var i=0; i<json.stock.length; i++)\n {\n invest[i]= json.stock[i].noofshare * json.stock[i].shareprice\n totalInvest += invest[i]\n }\n return invest;\n}" ]
[ "0.66979516", "0.62137157", "0.60977745", "0.6088173", "0.6077098", "0.59924906", "0.5975461", "0.5859383", "0.58162403", "0.5774087", "0.57652336", "0.57155746", "0.5700134", "0.56405514", "0.56146747", "0.56059897", "0.5603738", "0.5575388", "0.557178", "0.5532657", "0.55256337", "0.5509945", "0.5465655", "0.54419196", "0.54080904", "0.5402806", "0.5395914", "0.538807", "0.53809357", "0.5365832", "0.5334265", "0.5331587", "0.5329385", "0.53214705", "0.5319428", "0.5294958", "0.529106", "0.52908677", "0.52885777", "0.5283375", "0.5274288", "0.52486193", "0.52461934", "0.52261126", "0.5225778", "0.52171797", "0.5214662", "0.5208985", "0.5193025", "0.5192866", "0.519195", "0.51858723", "0.5184384", "0.5171185", "0.51706165", "0.5163195", "0.516273", "0.5157171", "0.5150906", "0.51426864", "0.51408416", "0.5139929", "0.51395977", "0.51363033", "0.5124346", "0.5121181", "0.51158464", "0.51156217", "0.51030445", "0.5100207", "0.5097793", "0.50965786", "0.5093331", "0.509154", "0.5091305", "0.5087275", "0.50841594", "0.5083522", "0.5080892", "0.50747377", "0.5068467", "0.5067028", "0.5065559", "0.5064598", "0.5062248", "0.5060156", "0.50558615", "0.50509536", "0.5050275", "0.5047826", "0.50422955", "0.50393295", "0.50389284", "0.5036085", "0.5035913", "0.5035131", "0.50339895", "0.5032784", "0.5027179", "0.502619", "0.50258064" ]
0.0
-1
This function shows the details for a specific sale
function showSaleDetails(itemID) { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#SaleDetails').hide(); currentItem = list.getItemById(itemID); context.load(currentItem); context.executeQueryAsync( function () { $('#editSale').val(currentItem.get_fieldValues()["Title"]); $('#editSalePerson').val(currentItem.get_fieldValues()["ContactPerson"]); $('#editSaleNumber').val(currentItem.get_fieldValues()["ContactNumber"]); $('#editSaleEmail').val(currentItem.get_fieldValues()["Email"]); $('#editSaleStatus').val(currentItem.get_fieldValues()["_Status"]); $('#editSaleAmount').val("$" + currentItem.get_fieldValues()["DealAmount"]); $('#SaleDetails').fadeIn(500, null); }, function (sender, args) { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totalSale(){\n\n console.log(sale.name);\n}", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "function showCustomerSale(customerId,product_id){\n $(\".shopInfo\").css(\"display\", \"block\");\n custModule.queryCustomerRecord(customerId,product_id,function(responseData) {\n var httpResponse = JSON.parse(responseData.response);\n if (responseData.ack == 1 && httpResponse.retcode ==200) {\n var retData = httpResponse.retbody;\n $(\"#sale_dt\").html(common.isNotnull(retData.sale_dt) ? retData.sale_dt : '-');\n $(\"#last_sale_price\").html(common.isNotnull(retData.sale_price) ?'¥'+ retData.sale_price : '-');\n $(\"#last_sale_num\").html(common.isNotnull(retData.sale_num) ? retData.sale_num + retData.unit: '-');\n if(retData.sale_price){\n $(\".product_price\").val(retData.sale_price);\n }\n } else {\n $.toast(\"本地网络连接有误\", 2000, 'error');\n }\n });\n }", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "populateSale(sale) {\n $.each(sale, (key, sala) => {\n $(\".saleTbody\").append('<tr class= \"saleTr\"><td class=\"nomeSala\">' + sala.Nome + '</td><td class=\"nomeEdificio\">' + sala.NomeEdificio + '</td><td class=\"stato\">' + sala.Stato + '</td></tr>');\n $(\".saleTbody\").append('<tr><td class=\"numeroPostiDisponibili\" colspan=\"3\"><h6> Numero posti disponibili: </h6>' + sala.NumeroPostiDisponibili + '</td></tr>');\n });\n $('.saleTr').click(function () {\n $(this).nextUntil('.saleTr').toggleClass('hide');\n }).click();\n }", "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "function saleToggle(event) {\n // console.log(event);\n if (event.target.name === 'sale') {\n currentInventory.beers[event.target.id].toggleSale();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "function forSale() {\n\t//Select item_id, product_name and price from products table.\n\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(error, results) {\n\t\tif (error) throw error;\n\t\tconsole.log(\"\\n\");\n\t\t//the below code displays the item_id, product_name and the price for all of items that available for sale. \n\t\tfor ( var index = 0; index < results.length; index++) {\n\t\t\tconsole.log(\"Product Id: \" + results[index].item_id + \"\\n\" +\n\t\t\t \"Product Name: \" + results[index].product_name + \"\\n\" +\n\t\t\t \"Price: $\" + results[index].price + \"\\n\" + \"Quantity: \" + results[index].stock_quantity + \"\\n\" + \n\t\t\t \"--------------------------------------------------------------------------\\n\");\n\t\t}// end for loop\n\t\trunSearch();\n\t});// end of query.\n\t\n} // end of forSale function", "function viewProductsForSale(callback) {\n // Query DB\n connection.query(`SELECT id,\n product_name, \n department_name, \n price,\n stock_quantity\n FROM products`, function (error, results, fields) {\n if (error) throw error;\n\n // Display results\n console.log();\n console.table(results);\n\n if (callback) {\n callback();\n }\n });\n}", "function viewSale() {\n // console.log(\"view product....\")\n\n connection.query(\"SELECT * FROM products\", (err, data) => {\n if (err) throw err;\n console.table(data);\n connection.end();\n })\n}", "function viewDeptSales() {\n salesByDept();\n}", "function salesman(name1, age2){\n\tthis.name = name1;\n\tthis.age = age2;\n\tthis.showDetails=function(){\n\t\treturn this.name + \":\" + this.age;\n\t};\n}", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "async paySale(sale){\n\t\t\ttry{\n\t\t\t\tlet response = await axios.put(\"/api/sales/\" + sale._id);\n\t\t\t\tawait this.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "function showSale(){ \n // clear the console\n console.log('\\033c');\n // displaying the product list\n console.log(`\\x1b[7m Product Sales By Department \\x1b[0m`);\n // creating the query string\n var query = 'SELECT D.department_id AS \"DeptID\", D.department_name AS \"Department\", D.over_head_costs AS \"OverHeadCosts\", SUM(P.product_sales) AS \"ProductSales\", '; \n query += 'SUM(P.product_sales) - D.over_head_costs AS \"TotalProfit\" FROM departments D INNER JOIN products P ON D.department_name = P.department_name ';\n query += 'GROUP BY D.department_id';\n\n connection.query(\n query,\n function(err, res){\n if (err) throw err;\n\n console.table(\n res.map(rowData => {\n return{ \n \"Dept ID\": rowData.DeptID,\n \"Department Name\": rowData.Department,\n \"Over Head Costs\": rowData.OverHeadCosts,\n \"Product Sales\": rowData.ProductSales,\n \"Total Profit\": rowData.TotalProfit\n }\n })\n );\n endRepeat();\n }\n );\n}", "function loadSaleData() {\n fetch(`https://arnin-web422-ass1.herokuapp.com/api/sales?page=${page}&perPage=${perPage}`)\n .then((response) => {\n return response.json();\n })\n .then((myJson) => {\n saleData = myJson;\n let rows = saleTableTemplate(saleData);\n $(\"#sale-table tbody\").html(rows);\n $(\"#current-page\").html(page);\n })\n}", "async showItemsForSale() {\n const character = this.character;\n\n let description = character.location.getDescription(character)\n + character.location.getShopDescription(character, this.info.type);\n\n let attachments = new Attachments().add({\n title: \"What do you want to buy?\",\n fields: character.getFields(),\n color: COLORS.INFO\n });\n\n [description, attachments] = this.getEquipmentForSale(character, description, attachments);\n [description, attachments] = this.getSpellsForSale(character, description, attachments);\n [description, attachments] = this.getItemsForSale(character, description, attachments);\n\n attachments.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({ description, attachments });\n }", "function showDetails({bookTitle, price}){\n console.log(`Name: ${bookTitle}, price: ${price} `)\n }", "async function menu_ViewProductsForSale() {\n console.log(`\\n\\tThese are all products for sale.\\n`);\n\n //* Query\n let products;\n try {\n products = (await bamazon.query_ProductsSelectAll(\n ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity']\n )).results;\n } catch(error) {\n if (error.code && error.sqlMessage) {\n // console.log(error);\n return console.log(`Query error: ${error.code}: ${error.sqlMessage}`);\n }\n // else\n throw error;\n }\n // console.log(products);\n\n //* Display Results\n if (Array.isArray(products) && products.length === 0) {\n return console.log(`\\n\\t${colors.red(\"Sorry\")}, there are no such product results.\\n`);\n }\n\n bamazon.displayTable(products, \n [ bamazon.TBL_CONST.PROD_ID, \n bamazon.TBL_CONST.PROD , \n bamazon.TBL_CONST.DEPT , \n bamazon.TBL_CONST.PRICE , \n bamazon.TBL_CONST.STOCK ], \n colors.black.bgGreen, colors.green);\n\n return;\n}", "showInvoiceDetails(e){\n e.preventDefault();\n var _this = e.data.context,\n id = $.trim($(this).attr('data-receipt-id')),\n name = $.trim($(this).attr('data-name'));\n\n $.ajax({\n type : 'GET',\n url : '/warehouse/sales/byReceiptId',\n data : {\n receipt_id : id\n },\n success : function(transactions){\n if(transactions.length){\n _this.setInvoiceModalHeader(id, name);\n _this.setInvoicePrintID(id);\n _this.appendInvoiceModalTableHeader();\n _this.appendInvoiceModalTableBody();\n _this.appendItemsToInvoiceModalDOM(transactions);\n _this.showInvoiceModal();\n }\n }\n });\n }", "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function showSales() {\n //Highlight selected tile\n $('#LeadsTile').css(\"background-color\", \"#0072C6\");\n $('#OppsTile').css(\"background-color\", \"#0072C6\");\n $('#SalesTile').css(\"background-color\", \"orange\");\n $('#LostSalesTile').css(\"background-color\", \"#0072C6\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n var hasSales = false;\n hideAllPanels();\n var saleList = document.getElementById(\"AllSales\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Success returned from executeQueryAsync\n var saleTable = document.getElementById(\"SaleList\");\n\n // Remove all nodes from the sale <DIV> so we have a clean space to write to\n while (saleTable.hasChildNodes()) {\n saleTable.removeChild(saleTable.lastChild);\n }\n // Iterate through the Propsects list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n // Create a DIV to display the organization name\n var sale = document.createElement(\"div\");\n var saleLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n sale.appendChild(saleLabel);\n\n // Add an ID to the sale DIV\n sale.id = listItem.get_id();\n\n // Add an class to the sale DIV\n sale.className = \"item\";\n\n // Add an onclick event to show the sale details\n $(sale).click(function (sender) {\n showSaleDetails(sender.target.id);\n });\n\n saleTable.appendChild(sale);\n hasSales = true;\n }\n }\n if (!hasSales) {\n var noSales = document.createElement(\"div\");\n noSales.appendChild(document.createTextNode(\"There are no sales. You can add a new sale from here.\"));\n saleTable.appendChild(noSales);\n }\n $('#AllSales').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get sales. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#SaleList').fadeIn(500, null);\n });\n}", "function updateSales(sales) {\n\tvar salesDiv = document.getElementById(\"sales\");\n\n\tfor (var i = 0; i < sales.length; i++) {\n\t\tvar sale = sales[i];\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.setAttribute(\"class\", \"saleItem\");\n\t\tdiv.innerHTML = sale.name + \" sold \" + sale.sales + \" gumbaslls\";\n\t\tsalesDiv.appendChild(div);\n\t}\n\t\n\tif (sales.length > 0) {\n\t\tlastReportTime = sales[sales.length-1].time;\n\t}\n}", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "async updateSale(saleID, storeID) {\n\n}", "function renderSalesOrder(name, data, parameters={}, options={}) {\n\n var html = `<span>${data.reference}</span>`;\n\n var thumbnail = null;\n\n if (data.customer_detail) {\n thumbnail = data.customer_detail.thumbnail || data.customer_detail.image;\n\n html += ' - ' + select2Thumbnail(thumbnail);\n html += `<span>${data.customer_detail.name}</span>`;\n }\n\n if (data.description) {\n html += ` - <em>${trim(data.description)}</em>`;\n }\n\n html += renderId('{% trans \"Order ID\" %}', data.pk, parameters);\n\n return html;\n}", "function getAllSales() {\n if (!sessionStorage.current_user) {\n window.location.href = \"index.html\";\n }\n var init = {\n method : 'GET',\n headers : header\n \n };\n\n req = new Request(sales_url,init)\n\n fetch(req)\n .then((res)=>{\n console.log(res);\n status = res.status\n return res.json();\n })\n .then((data)=>{\n if (status==401){\n window.location.href = \"index.html\";\n }\n\n rowNum = 1; //the row id\n data['Sales Record'].forEach(sale => {\n\n // save the queried data in a list for ease of retrieving\n\n sales_record[sale['sales_id']] = {\n \"user_id\": sale['user_id'],\n \"product_id\": sale['product_id'],\n \"quantity\": sale['quantity'],\n \"sales_amount\": sale['sales_amount'],\n \"sales_date\": sale['sales_date']\n };\n console.log(sales_record)\n sales_table = document.getElementById('tbl-products')\n let tr = createNode('tr'),\n td = createNode('td');\n \n\n // table data\n t_data=[\n rowNum,sale['product_name'],\n sale['username'],\n sale['sales_date'],\n sale['sales_amount']\n ];\n console.log(t_data)\n\n tr = addTableData(tr,td,t_data);\n console.log(tr);\n\n\n // add the view edit and delete buttons\n td = createNode('td')\n td.innerHTML=` <i id=\"${sale['sales_id']}\" onclick=\"showProductPane(this)\" class=\"fas fa-eye\"> </i>`;\n td.className=\"text-green\";\n appendNode(tr,td);\n console.log(\"here\")\n\n \n \n\n appendNode(sales_table,tr);\n rowNum +=1\n });\n\n });\n}", "function salesReport(req, res) {\n let db = req.app.get('db');\n let limit = req.body.limit || 50;\n let offset = req.body.offset || 0;\n let baseQuery = `SELECT * from items where sold = true`;\n\n // if sortAttr is provided, add sort command to the query\n let sortAttr = req.body.sortAttr;\n let sortOrder = req.body.sortOrder || 'asc';\n if (sortAttr) baseQuery += ` order by ${sortAttr} ${sortOrder}`\n\n // add limit and offset to the query\n baseQuery += ` limit $1 offset $2`\n\n return db.query(baseQuery, [limit, offset])\n .then(items => {\n let numResults = items.length;\n let offsetForNextPage = offset + numResults;\n let offsetForPrevPage = offset - limit;\n if (offsetForPrevPage < 0) offsetForPrevPage = 0;\n // If we dont get a full set of results back, we're at the end of the data\n if (numResults < limit) offsetForNextPage = null;\n let data = {\n items,\n offsetForPrevPage: offsetForPrevPage,\n offsetForNextPage, offsetForNextPage\n }\n return sendSuccess(res, data);\n })\n .catch(e => sendError(res, e, 'salesReport'))\n}", "function convertToSale(itemID) {\n $('#AllOpps').hide();\n $('#OppDetails').hide();\n clearEditOppForm();\n\n currentItem.set_item(\"_Status\", \"Sale\");\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditOppForm();\n showSales();\n }\n ,\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n}", "getAllSalesList() {\n fetch(process.env.REACT_APP_API_URL+\"/sales\")\n .then(res => res.json())\n .then(\n result => {\n this.setState({\n isLoaded: true,\n salesList: result,\n });\n },\n error => {\n this.setState({\n isLoaded: true,\n error: error\n });\n }\n );\n }", "function getSOId(sonumber,tranType)\n{\n\tvar vType='SalesOrd';\n\tif(tranType=='salesorder')\n\t\tvType='SalesOrd';\n\telse if(tranType=='transferorder')\n\t\tvType='TrnfrOrd';\n\n\tvar soId = '';\n\tvar SODetails=new Array();\n\tvar transactionsearchresult = new nlapiLoadSearch('transaction', 'customsearch_wmsse_transactiondetail_srh');\n\tif(sonumber != null && sonumber != '' && sonumber != 'null')\n\t\ttransactionsearchresult.addFilter(new nlobjSearchFilter('tranid', null, 'is', sonumber));\n\ttransactionsearchresult.addFilter(new nlobjSearchFilter('type', null, 'anyof', vType));\n\tvar resLenDetails = transactionsearchresult.runSearch();\n\t\n\t\n\tvar resultsPage = resLenDetails.getResults(0, 1000);\n\tvar offset = 0;\n\twhile (!!resultsPage && resultsPage.length > 0) \n\t{\n\t\tSODetails = SODetails.concat(resultsPage);\n\t\toffset += 1000;\n\t\tresultsPage = resLenDetails.getResults(offset, offset + 1000);\n\t}\n\t\n\tnlapiLogExecution('ERROR', 'SODetails', SODetails);\n\tif(SODetails != null && SODetails != '')\n\t{\n\t\tsoId = SODetails[0].getValue('internalid');\n\t}\n\n\treturn soId;\n}", "function printStoreDetails() {\n console.log(\"\\n\");\n console.log(chalk.white.bgBlack.bold(\"Days opened: \" + store.days));\n console.log(chalk.white.bgBlack.bold(\"Money: $\" + store.money));\n console.log(\"\\n\");\n}", "function getDetails() {\n\n}", "function viewSaleProducts(callback){\n //create a query to select all the products\n var allprods = connection.query(\n 'select item_id, product_name, department_id, price, stock_qty, product_sales from products', \n function(err, res){\n if(err){\n throw err;\n }\n else{\n console.log('\\n');\n console.table(res);\n //if call back exists call that function\n if(callback){\n callback();\n }\n //else display the products\n else{\n managerMenu();\n }\n }\n });\n}", "function displayDetail(indice)\n{\n RMPApplication.debug(\"displayDetail : indice = \" + indice);\n v_ol = var_order_list[indice];\n c_debug(dbug.detail, \"=> displayDetail: v_ol (mini) = \", v_ol);\n\n // we want all details for the following work order before showing on the screen\n var wo_query = \"^wo_number=\" + $.trim(v_ol.wo_number);\n var input = {};\n var options = {};\n input.query = wo_query;\n // var input = {\"query\": wo_query};\n c_debug(dbug.detail, \"=> displayDetail: input = \", input);\n id_get_work_order_full_details_api.trigger(input, options, wo_details_ok, wo_details_ko);\n\n RMPApplication.debug(\"end displayDetail\");\n}", "function showDetails(id){ \n\n let productDetails = [];\n let order = \"\";\n\n all_orders.forEach(_order =>{\n if(_order.id == id){\n order = _order;\n }\n })\n \n order.orderProducts.forEach(product =>{\n let details = {\n name: product.product.name,\n quantity: product.quantity\n }\n productDetails.push(details);\n })\n\n auxDetails(productDetails);\n\n}", "function viewProductSales() {\n connection.query(\n 'SELECT department_id, departments.department_name, over_head_costs, sum(product_sales) as product_sales, sum(product_sales) - over_head_costs as total_profit FROM products right join departments on products.department_name=departments.department_name group by department_id, products.department_name, over_head_costs',\n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function viewProductsForSale(runMgrView, cb) {\n\n // console.log(\"Inside viewProductsForSale()\");\n\n let queryString = \"SELECT * FROM products\";\n\n let query = connection.query(queryString, function (err, res) {\n\n if (err) throw err;\n\n console.log(\"\\n\\n\");\n console.log(\"\\t\\t\\t\\t---- Products for sale ---- \\n\");\n\n console.log(\"\\tITEM ID\" + \"\\t\\t|\\t\" + \"ITEM NAME\" + \"\\t\\t|\\t\" + \"ITEM PRICE\" + \"\\t|\\t\" + \"QUANTITY\");\n console.log(\"\\t-------\" + \"\\t\\t|\\t\" + \"---------\" + \"\\t\\t|\\t\" + \"----------\" + \"\\t|\\t\" + \"--------\");\n\n res.forEach(item =>\n console.log(\"\\t\" + item.item_id + \"\\t\\t|\\t\" + item.product_name + \"\\t\\t|\\t\" + item.price.toFixed(2) + \"\\t\\t|\\t\" + item.stock_quantity)\n );\n\n if (runMgrView) {\n //Call manager view\n console.log(\"\\n\\n\");\n bamazonManagerView();\n } else {\n cb();\n }\n\n });\n\n\n}", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function GetSummary() {\n var YearQuery = '';\n if (FilterList.DashboardFilterYear === '') {\n YearQuery =\n ' business_year = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('YYYY') +\n \"'\";\n } else {\n YearQuery =\n ' business_year = ' + \"'\" + FilterList.DashboardFilterYear + \"'\";\n }\n\n var MonthQuery = '';\n if (FilterList.DashboardFilterMonth === '') {\n MonthQuery =\n ' and business_month = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('MMMM') +\n \"'\";\n } else {\n MonthQuery =\n ' and business_month = ' + \"'\" + FilterList.DashboardFilterMonth + \"'\";\n }\n\n var TeamQuery = '';\n if (\n FilterList.DashboardFilterTeam === '' ||\n FilterList.DashboardFilterTeam === 'ALL'\n ) {\n TeamQuery = ' and team IN ' + global.TeamAccessList;\n } else {\n TeamQuery = ' and team = ' + \"'\" + FilterList.DashboardFilterTeam + \"'\";\n }\n\n var VendorQuery = '';\n if (\n FilterList.DashboardFilterVendor === '' ||\n FilterList.DashboardFilterVendor === 'ALL'\n ) {\n VendorQuery = ' and principal_name like ' + \"'%%' \";\n } else {\n VendorQuery =\n ' and principal_name = ' + \"'\" + FilterList.DashboardFilterVendor + \"'\";\n }\n\n dbperymtsat.transaction((tx) => {\n tx.executeSql(\n 'SELECT SUM(amount) as amount , SUM(target) as target FROM perymtsat_tbl where ' +\n YearQuery +\n MonthQuery +\n TeamQuery +\n VendorQuery +\n ' order by invoice_date asc ',\n [],\n (tx, results) => {\n var len = results.rows.length;\n if (len > 0) {\n // console.log(results.rows.item(0).target);\n //console.log(results.rows.item(0).amount);\n //setTotalSales();\n setTotalTarget(parseInt(results.rows.item(0).target));\n setTotalSales(parseInt(results.rows.item(0).amount));\n settotalSalesAnimation(true);\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n\n // console.log(\n // 'Successfully got summary of ' +\n // FilterList.DashboardFilterMonth +\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n // );\n }\n },\n SQLerror,\n );\n });\n }", "function totalSales(products, lineItems){\n //TODO\n\n}", "function productsForSale (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "getProductDetails() {\n return `Product id: ${this.id}, Product Name: ${this.name}, Product Base Price: ${this.basePrice} `;\n }", "saleList() {\n axios.get(`Sales/GetSales`)\n .then(({data}) => {\n this.setState({\n sales: data\n });\n })\n .catch(err => console.log(err));\n }", "function productsForSale() {\n console.log(\"products for sale fxn\");\n connection.query(\"SELECT * FROM products\",function(err, res){\n if (err) throw err;\n for (var i=0; i<res.length;i++) {\n console.log(`Product Name: ${res[i].product_name}`);\n console.log(`Department Name: ${res[i].department_name}`);\n console.log(`Selling Price: $${res[i].price}`);\n console.log(`Quantity in Stock: ${res[i].stock_quantity}`);\n console.log(\"---------------------\");\n }\n });\n connection.end();\n }", "function getTotalSales() {\n fetch('https://inlupp-fa.azurewebsites.net/api/total-sales')\n .then(res => res.json()) \n .then(data => {\n document.getElementById('totalSales').innerHTML = data.currency + data.amount;\n })\n}", "function getSalesDiscount(price, tax, discount) {\n if (isNaN(price) || isNaN(tax) || isNaN(discount)) {\n return \"Price, Tax, Discount harus dalam angka\";\n }\n\n const totalDiscount = price * (discount / 100);\n const priceAfterDiscount = price - totalDiscount;\n const pajak = priceAfterDiscount * (tax / 100);\n const totalPayment = priceAfterDiscount + pajak;\n\n return `\n Total Sales : Rp.${price}\n Discount (${discount}%) : Rp.${totalDiscount}\n PriceAfterDiscount : Rp.${priceAfterDiscount}\n Pajak (${tax}%) : Rp.${pajak}\n ----------------------------------------------------\n totalPayment : Rp.${totalPayment}\n `;\n}", "function displayForSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n\n if (err) throw err;\n var price;\n items = res.length;\n var sales;\n console.log(\"=====================================================================\");\n var tableArr = [];\n for (var i = 0; i < res.length; i++) {\n sales = parseFloat(res[i].product_sales).toFixed(2);\n price = parseFloat(res[i].price).toFixed(2);\n tableArr.push(\n {\n ID: res[i].item_id,\n PRODUCT: res[i].product_name,\n DEPARTMENT: res[i].department_name,\n PRICE: price,\n ONHAND: res[i].stock_quantity,\n SALES: sales\n }\n )\n }\n console.table(tableArr);\n console.log(\"=====================================================================\");\n promptChoice();\n })\n}", "function sumWithSale() {\n \n let sum = prompt(\"Введите сумму покупки:\");\n sum = Number(sum);\n let sale;\n if (sum > 500 && sum < 800) {\n sale = 0.03;\n } else if (sum > 800) {\n sale = 0.05;\n } else {\n sale = 0;\n };\n sum = sum - (sum * sale);\n let viewSale = sale * 100;\n alert(`Сумма покупки с учетом скидки - ${viewSale}% составляет: ${sum} грн.`);\n console.log(`3) Purchase sum with sale ${viewSale}%: ${sum} uah.`);\n }", "function populateDetails(name) {\n directView(\"shop-view\");\n let url = URL + \"sneaker/\" + name;\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(appendDetails)\n .catch(handleRequestError);\n }", "function salesByProduct(products, lineItems){\n //TODO\n}", "function display () {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.log(\"Welcome to Bamazon! Here's what we have for sale:\")\n // for loop to loop through each item in the sql file for display\n for (var i=0; i < res.length; i++) {\n console.log(\"Item ID: \" + res[i].id + ' ' + res[i].product_name + ' $' + res[i].price);\n }\n purchase();\n })\n}", "render() {\n\n const sales = this.state.sales;\n return (\n <div style={{ marginTop: 20, marginLeft: 20 }}>\n\n <CreateSale loadfun={this.fetchSales} />\n \n <Table celled striped>\n <Table.Header>\n <Table.Row>\n <Table.HeaderCell>Customer</Table.HeaderCell>\n <Table.HeaderCell>Product</Table.HeaderCell>\n <Table.HeaderCell>Store</Table.HeaderCell>\n <Table.HeaderCell>Date Sold</Table.HeaderCell>\n <Table.HeaderCell>Actions</Table.HeaderCell>\n <Table.HeaderCell>Actions</Table.HeaderCell>\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {sales.map(sale => (\n <Table.Row key={sale.id} >\n <Table.Cell>{sale.customerName}</Table.Cell>\n <Table.Cell>{sale.productName}</Table.Cell>\n <Table.Cell>{sale.storeName}</Table.Cell>\n <Table.Cell>{sale.dateSold}</Table.Cell>\n <Table.Cell selectable>\n <EditSale loadfun={this.fetchSales} data={sale} />\n </Table.Cell>\n <Table.Cell selectable>\n <DeleteSale loadfun={this.fetchSales} data={sale} />\n </Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n\n\n\n </Table>\n\n </div>\n );\n }", "function displayItemsForSale() {\n connection.query(\"SELECT item_id, product_name, price, department_name,stock_quantity FROM products\", function (err, result) {\n if (err) throw err;\n\n if (result.length == 0) {\n console.log(\"There are no items for sale.\");\n }\n\n for (var i = 0; i < result.length; i++) {\n console.log(colors.green(\"\\nBook ID: \" + result[i].item_id.toString() + \"\\n\" +\n \"Book Name: \" + result[i].product_name + \"\\n\" +\n \"Book Price: \" + parseInt(result[i].price).toFixed(2) + \"\\n\" +\n \"Department: \" + result[i].department_name + \"\\n\" +\n \"Stock: \" + result[i].stock_quantity));\n }\n chooseMenu();\n });\n}", "function ProductsForSale() {\n console.log(\"Items up for sale\");\n console.log(\"------------------\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | $\" + res[i].price + \" | \" + res[i].quantity);\n console.log(\"------------------\");\n }\n MainMenu();\n });\n }", "async get(sales_item_id) {\n return db\n .query(\n `SELECT * FROM brand_sales_item\n WHERE sales_item_id = $1`,\n [sales_item_id]\n )\n .then(Result.one);\n }", "function forSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id + \"; Product: \" + res[i].product_name + \"; Department: \" + res[i].department_name + \"; Price: $\" + res[i].price + \"; Quantity Available: \" + res[i].stock_quantity);\n };\n nextToDo();\n });\n}", "getSaleId(id){\n const query = Sale.findOne({_id: id}).exec();\n return query;\n }", "function querySaleProducts() {\n\tinquirer\n\t.prompt({\n\t\tname: \"customer_name\",\n\t\ttype: \"input\",\n\t\tmessage: \"Dear Customer, please enter your name.\"\n\t})\n\t.then(function(answer) {\n\t\tconsole.log(\"Welcome to Bamazon, \" + answer.customer_name + \":) Here is our special sales for you!\");\n\n\t\tvar query = \"SELECT * FROM products WHERE stock_quantity <> 0\";\n\n\t\tconnection.query(query, function(err, res) {\n\t\t\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Item ID: \" + res[i].item_id + \" | \" + res[i].department_name + \": \" + res[i].product_name + \" for $\" + numberWithCommas(res[i].price));\n\t\t}\n\n\t\tqueryOrder();\n\t\t});\t\n\t});\n}", "function viewPurchases() {\n $.ajax({\n url: '/get/purchases/',\n method: 'GET',\n success: (data) => buildListingArea(data);\n })\n}", "function productsForSale() {\n connection.query('SELECT * FROM products', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity', 'product_sales'],\n colWidths: [10, 25, 20, 10, 18, 15]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].department_name, allProducts[i].price, allProducts[i].stock_quantity, allProducts[i].product_sales]);\n }\n\n console.log(table.toString());\n console.log('\\n');\n managerView();\n });\n}", "function displaySalesRecords() {\n\t\n\tvar table = document.getElementById(\"table\");\n\t\n\tvar json = getJSONObject();\n\t\n\t//Uncomment to debug json variable\n\t//console.log(json);\n\t\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", \"../dp2-api/api/\", true);\t// All requests should be of type post\n\txhr.onreadystatechange = function() {\n\t\tif(xhr.readyState == 4) {\n\t\t\tif(xhr.status == 200) {\n\t\t\t\tconsole.log(JSON.parse(xhr.responseText)); // Barring error conditions, responses will be valid JSON\n\t\t\t\tvar data = JSON.parse(xhr.responseText); \n\t\t\t\t\n\t\t\t\tvar i;\n\t\t\t\t\n\t\t\t\t//Construct HTML table header row\n\t\t\t\t//This needs to be exist singularly every time a new table is generated\n\t\t\t\tvar html = \"<caption>Sales Records</caption><thead><tr><th>ID</th><th>Product ID</th><th>Name</th><th>Quantity</th><th>Amount</th><th>DateTime</th></tr></thead><tbody>\";\n\t\t\t\t\n\t\t\t\tfor(i=0; i < data[0].length; i++)\n\t\t\t\t{\n\t\t\t\t\thtml += \"<tr><td>\" + data[0][i].id + \"</td><td>\" + data[0][i].product + \"</td><td>\" + data[0][i].name + \"</td><td>\" + data[0][i].quantity + \"</td><td>\" + displayAmount(data[0][i].value, data[0][i].quantity) + \"</td><td>\" + formatDateAndTime(data[0][i].dateTime) + \"</td></tr>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\thtml += \"</tbody>\";\n\t\t\t\t\n\t\t\t\t//Uncomment to debug html variable e.g. see the table HTML that has been generated\n\t\t\t\t//console.log(html);\n\t\t\t\t\n\t\t\t\t//This writes the newly generated table to the table element \n\t\t\t\ttable.innerHTML = html;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tconsole.error(xhr.responseText);\n\t\t\t}\n\t\t}\n\t};\n\txhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\txhr.send(\"request=\" + encodeURIComponent(JSON.stringify(json)));\n}", "function viewSalesByDept(){\n\n connection.query('SELECT * FROM Departments', function(err, res){\n if(err) throw err;\n\n // Table header\n console.log('\\n' + ' ID | Department Name | OverHead Costs | Product Sales | Total Profit');\n console.log('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -')\n \n // Loop through database and show all items\n for(var i = 0; i < res.length; i++){\n\n //=============================== Add table padding ====================================\n var departmentID = res[i].DepartmentID + ''; // convert to string\n departmentID = padText(\" ID \", departmentID);\n\n var departmentName = res[i].DepartmentName + ''; // convert to string\n departmentName = padText(\" Department Name \", departmentName);\n\n // Profit calculation\n var overHeadCost = res[i].OverHeadCosts.toFixed(2);\n var totalSales = res[i].TotalSales.toFixed(2);\n var totalProfit = (parseFloat(totalSales) - parseFloat(overHeadCost)).toFixed(2);\n\n\n // Add $ signs to values\n overHeadCost = '$' + overHeadCost;\n totalSales = '$' + totalSales;\n totalProfit = '$' + totalProfit;\n\n // Padding for table\n overHeadCost = padText(\" OverHead Costs \", overHeadCost);\n totalSales = padText(\" Product Sales \", totalSales);\n \n // =================================================================================================\n\n console.log(departmentID + '|' + departmentName + '|' + overHeadCost + '|' + totalSales + '| ' + totalProfit);\n }\n connection.end();\n });\n}", "function details() {\n let did = dsel.value;\n if (!did) return;\n fetch(base + \"/dispenser/\" + did)\n .then(resp => resp.json()).then(function(json) {\n let perc = Math.ceil(json[\"valor_atual\"]/json[\"vol_max\"]*100);\n curml.innerText = json[\"valor_atual\"] + \" mL (\" + perc + \"%)\";\n curdesc.innerText = json[\"desc\"];\n });\n}", "function getTotalSalesChart() {\n fetch('https://inlupp-fa.azurewebsites.net/api/total-sales-chart')\n .then(res => res.json()) \n .then(data => {\n document.getElementById('revenue').innerHTML = data.revenue;\n document.getElementById('returns').innerHTML = data.returns;\n document.getElementById('queries').innerHTML = data.queries;\n document.getElementById('invoices').innerHTML = data.invoices;\n // Resten ligger i dashboard.js!\n })\n}", "function viewPalletDetails(pallet_no, transaction_id) {\n\tif (null != transaction_id && \"\" != transaction_id && \"-- Select a transaction --\" != transaction_id) {\n\t\tif (null != pallet_no && \"\" != pallet_no) {\n\t\t\twindow.location = \"view-entries?TrxTransactionDetailsSearch[pallet_no]=\" + pallet_no + \"&id=\" + transaction_id;\n\t\t} else {\n\t\t\talert('Please enter pallet no.');\n\t\t}\n\t} else {\n\t\talert('Please select a transaction.');\n\t}\n}", "function showLostSales() {\n $('#LeadsTile').css(\"background-color\", \"#0072C6\");\n $('#OppsTile').css(\"background-color\", \"#0072C6\");\n $('#SalesTile').css(\"background-color\", \"#0072C6\");\n $('#LostSalesTile').css(\"background-color\", \"orange\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n\n var errArea = document.getElementById(\"errAllLostSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n var haslostSales = false;\n hideAllPanels();\n var saleList = document.getElementById(\"AllLostSales\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Success returned from executeQueryAsync\n var saleTable = document.getElementById(\"LostSaleList\");\n\n // Remove all nodes from the lostSale <DIV> so we have a clean space to write to\n while (saleTable.hasChildNodes()) {\n saleTable.removeChild(saleTable.lastChild);\n }\n // Iterate through the Propsects list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n // Create a DIV to display the organization name\n var lostSale = document.createElement(\"div\");\n var saleLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n lostSale.appendChild(saleLabel);\n\n // Add an ID to the lostSale DIV\n lostSale.id = listItem.get_id();\n\n // Add an class to the lostSale DIV\n lostSale.className = \"item\";\n\n // Add an onclick event to show the lostSale details\n $(lostSale).click(function (sender) {\n showLostSaleDetails(sender.target.id);\n });\n\n saleTable.appendChild(lostSale);\n haslostSales = true;\n }\n }\n if (!haslostSales) {\n var noLostSales = document.createElement(\"div\");\n noLostSales.appendChild(document.createTextNode(\"There are no lost sales.\"));\n saleTable.appendChild(noLostSales);\n }\n $('#AllLostSales').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get lost sales. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#LostSaleList').fadeIn(500, null);\n });\n}", "function getSaleLinesData(shopObj, endPoint, clear){\n var objSheet = shopObj.saleLineSheetName;\n var ssID = shopObj.ID;\nlogSales(\"Shop Object\",shopObj.saleLineSheetName)\nvar ss = SpreadsheetApp.openById(ssID);\n var sheet = ss.getSheetByName(objSheet);\n sheet.activate();\n var saleOffset = getCurrentSaleLineID(sheet,ssID); \n if(UIONOFF){ ss.toast(\"Sale Line Off set ID =\"+saleOffset);}\n var headerRows = 1;\n var offset = 0;\n // == -- Specify the type of call needed -- == \\\\ \n var type = \"GET\";\n // == -- Build the URL with any offsets -- == \\\\\n var url = shopObj.saleLine;\n // == -- adjust process for updating info or replacing info -- == \\\\ \n if(!clear && saleOffset){ \n // logSales(\"sales object\",shopObj);\n url = url+\"&saleLineID=%3E,\"+saleOffset;\n// logSales(\"log Url\",url);\n updateSaleID(shopObj.name,saleOffset)\n } else {\n clearSheet(headerRows, sheet);\n saleOffset = 0;\n }\n \n// logSales(\"url\",url);\n // == -- Initiate the OAuth / Api Call with the given variables -- == \\\\ \n var data = getData(offset,url,endPoint,type);\n if(data.length>=0 ){\n for(var i = 0; i<data.length; i++){\n var row = data[i];\n// logSales(\"Data Row\",row);\n getNames(row);\n// fixItems(row);\n fixDates(row);\n }}\n // == -- Make the call to insert the rows needed for the new data and insert the data -- == \\\\ \n insertData(sheet,data);\n}", "function ArticlesDetails() {\n}", "function showDetail(d) {\n var content = `\n <div class=\"pa1 lh-title\">\n <div class=\"ttu mid-gray f6 fw6\"><span class=\"pr1\">${\n d.name\n }</span><span class=\"ph1\">&#8226;</span><span class=\"pl1\">${\n d.year\n }</span></div>\n <div class=\"pv2 f3\">$${addCommas(d.value)}</div>\n ${\n d.account\n ? `<div class=\"pb1 mid-gray f6\"><span class=\"name\">${\n english\n ? translations.fundingSource.eng\n : translations.fundingSource.esp\n }: </span><span class=\"value\">${d.account}</span></div>`\n : \"\"\n }\n ${\n d.description\n ? `<div class=\"pt2 mt2 bt b--light-gray overflow-scroll\" style=\"max-height: 8rem;\"><span class=\"name b f6\">${\n english\n ? translations.description.eng\n : translations.description.esp\n }: </span><span class=\"value f6 js-description\">${\n d.description ? d.description.substring(0, 120) : \"\"\n }...</span><a href=\"#\" class=\"link f7 mv1 dim underline-hover wola-blue pl1 js-read-more\">${\n english ? translations.readMore.eng : translations.readMore.esp\n }</a></div>`\n : \"\"\n }\n </div>\n `;\n\n return content;\n }", "function filterSalesRecords(event) {\n\t\n\t//construct empty retrieve JSON object\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"retrieve\"\n\t\t\t}\n\t\t]\n\t};\n\t\n\t//console.log(json);\n\t\n\treturn sendAPIRequest(json, event, displaySalesRecords);\n}", "async show(request, response) {\n const result = await Customers.findByPk(request.params.id);\n if(result != null) \n return response.json(result);\n else \n return response.json({status: 'Invalid Id'})\n }", "function viewDepartmentSales() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n 2: {\n alignment: 'right'\n },\n 3: {\n alignment: 'right'\n },\n 4: {\n alignment: 'right'\n }\n }\n };\n data[0] = [\"Department ID\".cyan, \"Department Name\".cyan, \"Over Head Cost ($)\".cyan, \"Products Sales ($)\".cyan, \"Total Profit ($)\".cyan];\n let queryStr = \"departments AS d INNER JOIN products AS p ON d.department_id=p.department_id GROUP BY department_id\";\n let columns = \"d.department_id, department_name, over_head_costs, SUM(product_sales) AS sales\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n DEPARTMENTS\".magenta);\n for (let i = 0; i < res.length; i++) {\n let profit = res[i].sales - res[i].over_head_costs;\n data[i + 1] = [res[i].department_id.toString().yellow, res[i].department_name, res[i].over_head_costs.toFixed(2), res[i].sales.toFixed(2), profit.toFixed(2)];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "function renderSalesTable(sales) {\n let salesTableBody = $('#salesTableBody')\n salesTableBody.empty()\n for (let i = 0; i < sales.length; i++) {\n let row = `<tr id=tr-${sales[i].id}>\n <th scope=\"row\">${sales[i].orderNumber}</th>\n <td>${sales[i].userEmail}</td>\n <td>${sales[i].customerInitials}</td>\n <td>${sales[i].purchaseDate}</td>\n <td>${sales[i].quantity}</td>\n <td>${sales[i].listOfProducts}</td>\n <td>${sales[i].orderSummaryPrice}</td>\n </tr>`\n salesTableBody.append(row)\n }\n}", "function showDetails(row){\n\tvar controller = View.controllers.get('abGbRptFpSrcCatCtrl');\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClauses(controller.consoleRestriction);\n\tif(typeof(row) == \"object\" && typeof(row) != \"string\" && row != \"total_row\" ){\n\t\tif(valueExistsNotEmpty(row[\"bl.site_id\"])){\n\t\t\trestriction.addClause(\"bl.site_id\", row[\"bl.site_id\"], \"=\", \"AND\", true);\n\t\t}\n\t\tif(valueExistsNotEmpty(row[\"gb_fp_totals.calc_year\"])){\n\t\t\trestriction.addClause(\"gb_fp_totals.calc_year\", row[\"gb_fp_totals.calc_year\"], \"=\", \"AND\", true);\n\t\t}\n\t}\n\tcontroller.abGbRptFpSrcCat_bl.addParameter(\"isGroupPerArea\", controller.isGroupPerArea);\n\tcontroller.abGbRptFpSrcCat_bl.refresh(restriction);\n\tshowReportColumns(controller.abGbRptFpSrcCat_bl);\n\tcontroller.abGbRptFpSrcCat_tabs.selectTab(\"abGbRptFpSrcCat_bl_tab\");\n}", "show(req, res, next) {\n var cartId = req.params.id;\n var user = req.user;\n Cart.findOne({userid: user._id, _id:cartId}, function(err, cart) {\n if (err) return next(err);\n if (!cart) return perf.ProcessResponse(res).send(401);\n perf.ProcessResponse(res).status(200).json(cart);\n });\n }", "function Sales(shopName,min,max,avg){\n this.shopName = shopName;\n this.minCust = min;\n this.maxCust = max ;\n this.avgCookies= avg;\n this.nOfCusts = [];\n this.avgCookiesH = [];\n this.total = 0;\n\n}", "function loadSaleData() {\n //fetch data from heroku\n fetch(`https://w2020116a.herokuapp.com/api/sales?page=${page}&perPage=${perPage}`)\n .then(function (response) {\n return response.json();\n })\n .then(function (myJson) {\n //set the global saleData array to be the data returned from the request\n saleData = myJson.data;\n //invoke the saleTableTemplate from the request,store the return value in a variable\n let saleTable = saleTableTemplate({saleData});\n //set <tbody> element \"sale-table\"\n $(\"#sale-table tbody\").html(saleTable);\n //set current-page element to be the value of the current page\n $(\"#current-page\").html(page);\n\n })\n .catch(err => { console.log(`Fetch error`, err) });\n}", "function customerView () {\n common.openConnection(connection);\n let querySQL = 'SELECT item_id, product_name, stock_quantity, price FROM products where stock_quantity > 0'; // exclude from \"where\" to premit out-of-stock items\n connection.query(querySQL, (error, result) => {\n if (error) throw error;\n let msg = ''; \n let title = 'LIST OF PRODUCTS FOR SALE';\n common.displayProductTable(title, result) // pass title and queryset to function that will print out information\n console.log('\\n');\n customerSelect();\n });\n \n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "function viewTransactionSummary(transaction_id, transaction_type) {\n\tif (null != transaction_id && \"\" != transaction_id && \"-- Select a transaction --\" != transaction_id) {\n\t\twindow.location = \"view-entries?id=\" + transaction_id + \"&transaction_type=\" + transaction_type;\n\t} else {\n\t\talert('Please select a transaction.');\n\t}\n}", "function find_hotel_sale (cb, results) {\n const criteriaObj = {\n checkInDate: sessionObj.checkindate,\n checkOutDate: sessionObj.checkoutdate,\n numberOfGuests: sessionObj.guests,\n numberOfRooms: sessionObj.rooms,\n hotel: results.create_hotel.id,\n or: [\n { saleType: 'fixed' },\n { saleType: 'auction' }\n ]\n }\n HotelSale.find(criteriaObj)\n .then(function (hotelSale) {\n sails.log.debug('Found hotel sales: ')\n sails.log.debug(hotelSale)\n\n if (hotelSale && Array.isArray(hotelSale)) {\n sails.log.debug('checking hotel sails')\n const sales = hotelSale.filter(function (sale) {\n const dateDif = new Date(sale.checkindate) - new Date()\n const hours = require('../utils/TimeUtils').createTimeUnit(dateDif).Milliseconds.toHours()\n if ((sale.saleType == 'auction' && hours <= 24) || (sale.saleType == 'fixed' && hours <= 0)) {\n _this.process_hotel_sale(sale)\n return false\n }else if (sale.status == 'closed') {\n return false\n }else {\n return true\n }\n })\n if (sales.length)\n sails.log.debug('Found hotel sales ')\n return cb(null, sales)\n } else {\n sails.log.debug('Did not find any sales, creating new sale')\n return cb(null, null)\n }\n }).catch(function (err) {\n sails.log.error(err)\n return cb({\n wlError: err,\n error: new Error('Error finding hotel sale')\n })\n })\n }", "getEditSale(data) {\n return dispatch => {\n dispatch({\n type: \"GET_EDIT_SALE\",\n payload: data\n });\n };\n }", "function getProductDetail(productId, callDisplayProduct) {\n\n // API call to get product details\n fetch(`https://my-store2.p.rapidapi.com/catalog/product/${productId}`, {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"ef872c9123msh3fdcc085935d35dp17730cjsncc96703109e1\",\n \"x-rapidapi-host\": \"my-store2.p.rapidapi.com\"\n }\n })\n .then(response => {\n return response.json();\n })\n .then(response => {\n\n // add product in array\n products.push(response);\n\n // if it is true means this was last product under this category\n if(callDisplayProduct) {\n displayProducts();\n }\n })\n .catch(err => {\n console.error(err);\n });\n\n }", "function showCostIndexTransDetails(context){\n\tvar costIndexTransId = context.row.getFieldValue(\"cost_tran_recur.cost_index_trans_id\");\n\tif (valueExistsNotEmpty(costIndexTransId)) {\n\t\tvar restriction = new Ab.view.Restriction();\n\t\trestriction.addClause(\"cost_index_trans.cost_index_trans_id\", costIndexTransId, \"=\");\n\t\tView.panels.get(\"abRepmCostLsProfileCostIndexTrans\").refresh(restriction);\n\t\tView.panels.get(\"abRepmCostLsProfileCostIndexTrans\").showInWindow({closeButton: true});\n\t}\n}", "function OrderDetail(props) {\n const { quantity, price, product } = props.orderdetail\n const { name, rating, imageUrl } = product\n\n return (\n <div className=\"individual-detail-container\">\n <div className=\"individual-detail\">\n <img src={imageUrl} alt=\"loading\" />\n <div className=\"info\">\n {getDisplayItem('Name', name)}\n {getDisplayItem('Rating', rating)}\n {getDisplayItem('Quantity', quantity)}\n {getDisplayItem('Total', `$${getMoney(price)}`)}\n </div>\n </div>\n </div>\n )\n}", "function getAndDisplaySellList() {\n getSellList();\n console.log('getAndDisplaySellList works');\n}", "display() {\n for (let i = 0; i < this.data.stock.length; i++) {\n console.log(i + 1 + \". \" + this.data.stock[i].corporation);\n }\n }", "displayPrice(book) {\r\n\t\tif(book.saleInfo.saleability === \"FOR_SALE\" && \r\n\t\t\tbook.saleInfo.listPrice.amount !== 0) {\r\n\t\t\treturn(\r\n\t\t\t\t\"$\" + \r\n\t\t\t\tbook.saleInfo.listPrice.amount + \r\n\t\t\t\t\" \" +\r\n\t\t\t\tbook.saleInfo.listPrice.currencyCode\r\n\t\t\t)\r\n\t\t} else {\r\n\t\t\treturn(\r\n\t\t\t\t\"FREE\"\r\n\t\t\t)\r\n\t\t}\r\n\t}", "function getOutskirtShop()\r\n {\r\n \r\n var outskirtShop = \"Type(?WarehouseShop, Shop), PropertyValue(?WarehouseShop, hasRoad, MotorwayRoad)\";\r\n \r\n new jOWL.SPARQL_DL(outskirtShop).execute({ onComplete : displayOutskirtShops});\r\n \r\n }", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "function contract_detail(request, response, next) {\n console.log('Contract detail');\n}", "function displayProducts() {\n \n // query/get info from linked sql database/table\n let query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n // map the data response in a format I like, and make it show the info I need it show\n // show the customer the price\n let data = res.map(res => [` ID: ${res.id}\\n`, ` ${res.product_name}\\n`, ` Price: $${res.price} \\n`]);\n console.log(`This is what we have for sale \\n\\n${data}`);\n console.log(\"-----------------\");\n\n userItemChoice();\n quitShopping();\n\n });\n}", "function totalSales(totalShirtSale,totalPantSale,totalShoesSale){ \n let perShirtMRP = 100;\n let perPantMRP = 200;\n let perShoesMRP = 500;\n\n let totalShirtSalePrice = totalShirtSale * perShirtMRP;\n let totalPantSalePrice = totalPantSale * perPantMRP;\n let totalShoesSalePrice = totalShoesSale * perShoesMRP;\n let totalSalesPrice = totalShirtSale + totalPantSale + totalShoesSale;\n\n return totalSalesPrice;\n }", "async show(req, res) {\n const { page = 1 } = req.query;\n\n // Check if deliveryman exists\n\n const { id } = req.params;\n\n const deliverymanExists = await Deliveryman.findOne({\n where: { id },\n });\n\n if (!deliverymanExists) {\n return res.status(400).json({ error: 'Deliveryman does not exist' });\n }\n const deliveriesConcluded = await Delivery.findAll({\n where: {\n deliveryman_id: id,\n end_date: {\n [Op.ne]: null,\n },\n },\n order: ['id'],\n attributes: ['id', 'product', 'created_at', 'start_date', 'end_date'],\n include: [\n {\n model: Recipient,\n as: 'recipient',\n attributes: [\n 'name',\n 'street',\n 'number',\n 'complement',\n 'state',\n 'city',\n 'zipcode',\n ],\n },\n ],\n limit: 10,\n offset: (page - 1) * 10,\n });\n\n return res.json(deliveriesConcluded);\n }", "function topSellerByRevenue(products, lineItems){\n //TODO\n}", "function getBookingItemForDisplay(id) {\n var url = 'data/bookingDetailData-' + id + '.json';\n return $http.get(url, {\n transformResponse: transformBookingItemForDisplay\n })\n .then(sendResponseData)\n .catch(sendGetBookingError);\n }", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }" ]
[ "0.69730794", "0.6691109", "0.6495654", "0.6490595", "0.6486762", "0.64315", "0.60111", "0.59943", "0.5987773", "0.5975199", "0.5952797", "0.59054244", "0.58577776", "0.5830926", "0.58250487", "0.57536995", "0.5723273", "0.5676545", "0.5671133", "0.56689286", "0.56684625", "0.5638419", "0.56382626", "0.5627355", "0.5626994", "0.56045514", "0.5592375", "0.5571056", "0.5562062", "0.5526334", "0.55257046", "0.5492104", "0.5472831", "0.54649675", "0.544332", "0.54308784", "0.5428779", "0.54260075", "0.5424644", "0.5423467", "0.54072434", "0.53872746", "0.5368108", "0.53627694", "0.5358298", "0.53573984", "0.53566927", "0.53362626", "0.53359103", "0.5326772", "0.5310019", "0.5306604", "0.5288499", "0.52746606", "0.5273002", "0.5257074", "0.5241705", "0.5226988", "0.5201697", "0.5189666", "0.51850754", "0.51822126", "0.5178995", "0.51785713", "0.51654047", "0.5156141", "0.515286", "0.5139485", "0.5130274", "0.51256067", "0.5125224", "0.51157945", "0.511132", "0.5097716", "0.5088248", "0.5086264", "0.5085924", "0.5083441", "0.50734395", "0.50683296", "0.50675976", "0.5064165", "0.5060917", "0.50549847", "0.50548446", "0.5047897", "0.5040984", "0.5031213", "0.5030029", "0.502347", "0.5022391", "0.5013397", "0.5008328", "0.49996042", "0.49966463", "0.4995529", "0.49942935", "0.4989459", "0.49888206", "0.49842197" ]
0.53304154
49
This function clears the inputs on the edit form for a sale
function cancelEditSale() { clearEditSaleForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "function clear_form_data() {\n $(\"#customer_id\").val(\"\");\n $(\"#product_id\").val(\"\");\n $(\"#text\").val(\"\");\n $(\"#quantity\").val(\"\");\n $(\"#price\").val(\"\");\n }", "function clearDetailForm(){\n inputIdDetail.val(\"\");\n inputDetailItem.val(\"\");\n inputDetailQuantity.val(\"\");\n inputDetailPrice.val(\"\");\n inputDetailTotal.val(\"\");\n inputDetailItem.focus();\n}", "function clear_form_data() {\n $(\"#cust_id\").val(\"\");\n $(\"#order_id\").val(\"\");\n $(\"#item_order_status\").val(\"\");\n }", "function clearEditSaleForm() {\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in future operations\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n $('#SaleDetails').fadeOut(500, function () {\n $('#SaleDetails').hide();\n $('#editSaleName').val(\"\");\n $('#editSalePerson').val(\"\");\n $('#editSaleNumber').val(\"\");\n $('#editSaleEmail').val(\"\");\n $('#editSaleAmount').val(\"\");\n });\n}", "clearFields(){\n this.description.value = \"\"\n this.amount.value = \"\"\n this.date.value = \"\"\n }", "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item_year\").val(\"\");\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_search\").prop(\"disabled\", true);\n $(\"#btn_add_item\").prop(\"disabled\", true);\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n // disable link to author page\n $(\"#link_current_author\").removeClass(\"text-primary\");\n $(\"#link_current_author\").addClass(\"text-muted\");\n // hide editions page\n $(\"#page_editions\").hide(\"slow\");\n }", "clearFields() {\n document.getElementById('title').value='';\n document.getElementById('author').value='';\n document.getElementById('isbn').value='';\n }", "function clear_form_data() {\n $(\"#product_id\").val('');\n $(\"#rec_product_id\").val('');\n $(\"#rec_type_id\").val('1');\n $(\"#weight_id\").val('');\n }", "function clear_form_data() {\n $(\"#inventory_product_id\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_quantity\").val(\"\");\n $(\"#inventory_restock_level\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n }", "function clear_form_data() {\n $(\"#inventory_name\").val(\"\");\n $(\"#inventory_category\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_count\").val(\"\");\n }", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function clearFields() {\r\n\t\t\t\t\t\t$('#tf_Id').val(null);\r\n\t\t\t\t\t\t$('#tf_Descricao').val(null);\r\n\t\t\t\t\t\t$('#slc_Marca').val(0);\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').val(0);\r\n\t\t\t\t\t\t$('#slc_Status').val(0);\r\n\t\t\t\t\t\t$('#btn-operation').val(\"Criar Modelo\");\r\n\t\t\t\t\t}", "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 clear_item_form_data() {\n $(\"#item_product_id\").val(\"\");\n $(\"#item_order_id\").val(\"\");\n $(\"#item_name\").val(\"\");\n $(\"#item_quantity\").val(\"\");\n $(\"#item_price\").val(\"\");\n $(\"#item_status\").val(\"\");\n }", "clearFields() {\r\n document.getElementById('title').value = '',\r\n document.getElementById('author').value = '',\r\n document.getElementById('isbn').value = '';\r\n }", "function clear_form_data() {\n var item_area=$('#item_area');\n console.log(\"Clear all data\");\n item_area.val(\"\");\n $('#change_course_dis_text').val(\"\");\n $('#course_name_text').val(\"\");\n $('#course_dis_text').val(\"\");\n\n }", "function clear_form_data() {\n $(\"#product_id\").val(\"\");\n $(\"#recommended_product_id\").val(\"\");\n $(\"#recommendation_type\").val(\"\");\n $(\"#likes\").val(\"\");\n }", "function clear_form_data() {\n $(\"#promo_name\").val(\"\");\n $(\"#promo_type\").val(\"\");\n $(\"#promo_value\").val(\"\");\n $(\"#promo_start_date\").val(\"\");\n $(\"#promo_end_date\").val(\"\");\n $(\"#promo_detail\").val(\"\");\n $(\"#promo_available_date\").val(\"\");\n }", "function clearAddform(){\n $(\"#qty\").css(\"border-color\", \"#eee\"); //rollback when not empty\n $(\"#qty\").val('');\n $(\"#searchInventory_id\").val('');\n $(\"#disc_amt\").val(\"\");\n $(\"#disc_percent\").val(\"\");\n $(\"#discount_type_select\").val(\"\").change();\n $(\".percentage_div\").hide();\n $(\".amount_div\").hide();\n }", "clearFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#reference').value = '';\n document.querySelector('#price').value = '';\n }", "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "function clear_form_data() {\n $(\"#promotion_title\").val(\"\");\n $(\"#promotion_promotion_type\").val(\"\");\n $(\"#promotion_start_date\").val(\"\");\n $(\"#promotion_end_date\").val(\"\");\n $(\"#promotion_active\").val(\"\");\n }", "function resetForm() {\n $('#productID').val(null);\n $('#productName').val('');\n $('#description').val('');\n $('#price').val('');\n $('#Currency').val('1');\n $('#Status').val('1');\n }", "function resetProd(){\n $(\"#nombre\").val(\"\")\n $(\"#marca\").val(\"\")\n $(\"#costo\").val(\"\")\n $(\"#ganancia\").val(\"\")\n $(\"#cantidad\").val(\"\")\n}", "clearCheckoutFields() {\n $(\"#c_p_name\").val('').focus();\n $(\"#c_p_quantity\").val('');\n $(\"#c_p_r_price\").val('');\n $(\"#c_p_unit_price\").val('');\n $(\"#c_p_discount\").val('');\n $(\"#receipt_name, #receipt_address, #receipt_no\").val('');\n this.product = {};\n }", "function clearFields() {\n name.value = \"\";\n title.value = \"\";\n hourlyRate.value = \"\";\n hours.value = \"\";\n salary.value = \"\";\n baseSalary.value = \"\";\n commissionRate.value = \"\";\n sales.value = \"\";\n commissionOption.checked = false;\n salaryOption.checked = false;\n hourlyOption.checked = false;\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\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 clearIngredientForm() {\n dishMakerIngredientsTable.clear().draw();\n $(\"#newDishName\").val('');\n $(\"#profitMarginInput\").val('');\n $(\"#addIngredientNameInput\").val('');\n $(\"#addIngredientAmountInput\").val('');\n $(\"#totalCostCalculated\").text('');\n $(\"#sellingPrice\").text('');\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}", "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 }", "static clearFields(){\n document.querySelector('#title').value ='';\n document.querySelector('#author').value ='';\n document.querySelector('#isbn').value ='';\n }", "function resetEditModal() {\n $('#userIdEdit').val('');\n $('#firstNameEdit').val('');\n $('#lastNameEdit').val('');\n $('#ageEdit').val('');\n}", "function clearFields() {\n movie_name.value = '';\n release_date.value = '';\n movie_banner.value = '';\n description.value = '';\n}", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "clearInputs() {\n\t\t$(this.elementConfig.nameInput).val(\"\");\n\t\t$(this.elementConfig.courseInput).val(\"\");\n\t\t$(this.elementConfig.gradeInput).val(\"\");\n\n\t}", "function clearTable(){\n form.locationName.value = '';\n form.locationMinCustomers.value = '';\n form.locationMaxCustomers.value = '';\n form.locationAvgCookiesSold.value = '';\n}", "static clearField(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clear_form_data() {\n $(\"#recommendation_id\").val(\"\");\n $(\"#recommendation_productId\").val(\"\");\n $(\"#recommendation_suggestionId\").val(\"\");\n $(\"#recommendation_categoryId\").val(\"\");\n $(\"#recommendation_old_categoryId\").val(\"\");\n }", "function clearAddform(){\n $(\"#price\").css(\"border-color\", \"#eee\"); //rollback when not empty\n $(\"#price\").val('');\n $(\"#searchPayment\").css(\"border-color\", \"#eee\"); //rollback when not empty\n $(\"#searchPayment\").val('');\n $(\"#searchPayment_id\").val('');\n}", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \n \t\n \t$('#frmMain').find(':input').each(function(){\n \t\tvar id = $(this).prop('id');\n \t\tvar Value = $('#' + id).val(\" \");\n \t});\n \t \t\n \t$('#txtShape').val('Rod'); \n \t$(\"#drpInch\").val(0);\n $(\"#drpFraction\").val(0);\n \n UncheckAllCheckBox();\n clearSelect2Dropdown();\n \n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \n }", "resetFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'||this.type=='hidden') {\n this.value = '';\n }\n else if (this.type == 'radio' || this.type == 'checkbox') {\n this.checked = false;\n }\n else if (this.type == 'select-one' || this.type == 'select-multiple') {\n this.value = '-1';\n }\n });\n\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 resetEditMenuItemForm(){\r\n EMenuItemNameField.reset();\r\n \tEMenuItemDescField.reset();\r\n \tEMenuItemValidFromField.reset();\r\n EMenuItemValidToField.reset();\r\n \tEMenuItemPriceField.reset();\r\n \tEMenuItemTypePerField.reset();\r\n\t\t\t\t\t \r\n }", "function restablecer(){\n\t\t$(\"#miCod\").val(\"\");\n\t\t$(\"#miNom\").val(\"\");\n\t\t$(\"#miNota\").val(\"\");\n\t}", "function clearSI() {\n $('#siId').val(\"\");\n $('#siTitle').val(\"\");\n $('#siCreatedBy').val(\"\");\n $('#siFY').val(\"\");\n $('#siOwner').val(\"\");\n $('#siDescr').text(\"\");\n $('#siActive').prop('checked', false);\n}", "function ridInputs() {\n dateInput.value = ''\n supplierInput.value = ''\n warehouseInput.value = ''\n productInput.value = ''\n quantityInput.value = ''\n sumInput.value = ''\n}", "function reset_form_data() {\n $(\"#order_customer_id\").val(\"\");\n $(\"#order_created_date\").val(\"\");\n\n row_num = 0;\n $(\"#order_items\").empty();\n add_row();\n }", "function clearInputs() {\r\n document.getElementById('addressBookForm').reset();\r\n }", "function clearInputFields(el) {\r\n\tel.parent().siblings('.modal-body').find('input').val('');\r\n}", "function clearCalculations() {\n $('.field').val('');\n }", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\n}", "function resetEdit() {\n\t$('.icons').removeClass('editable');\n\t$('#save-recipe, #cancel-recipe').hide();\n\t$('#detail-description, #detail-name').attr('contenteditable', false);\n\t$('#detail-new-ingredient-input').hide();\n}", "function clearFields(){\n $(\"#idInput\").val('');\n $(\"#titleInput\").val('');\n $(\"#contentInput\").val('');\n $(\"#authorInput\").val('');\n $(\"#dateInput\").val(''); \n $(\"#authorSearch\").val('');\n $(\"#idDelete\").val('');\n}", "function clearInputfields() {\r\n\t$('#title').val('');\r\n\t$('#desc').val('');\r\n\t$('#email').val('');\r\n}", "function clearInputs(){\n\t//array is filled with the HTML ids of the input value fields\n\t//array loops through each id,resets the value to empty string\n\t\tvar inputIds = [\n\t\t\t\ttitleInput,\n\t\t\t\turgency,\n\t\t\t\t ];\n\n\t\t\tinputIds.forEach(function(id){\n\t\t\t\t\tid.value = '';\n\t\t\t});\n}", "function cleanExpenseView()\n {\n $(\"#table-items tbody tr\").remove();\n row_item_first.find('.quantity input').val('');\n row_item_first.find('.description input').val('');\n row_item_first.find('.total-item input').val('');\n $(\"#table-items tbody\").append(row_item_first);\n $(\".tot-document\").show();\n $(\"#proof-type\").val(\"1\").attr(\"disabled\",false);\n $(\"#ruc\").val('').attr('disabled',false);\n $(\"#ruc-hide\").val('');\n $(\"#razon\").html('');\n $(\"#razon\").val(0);\n $(\"#razon\").attr(\"data-edit\",0);\n $(\"#number-prefix\").val('').attr('disabled',false);\n $(\"#number-serie\").val('').attr('disabled',false);\n $(\"#sub-tot\").val(0);\n $(\"#imp-ser\").val(0);\n $(\"#igv\").val(0);\n $(\"#total-expense\").val('');\n $(\"#tot-edit-hidden\").val('');\n $(\"#desc-expense\").val('');\n //$( '#cancel-expense' ).hide();\n $(\"#table-expense tbody tr\").removeClass(\"select-row\");\n }", "function clear_inputs() {\n\n\t\t\t\t$('.form-w').val(\"\");\n\t\t\t\t$('.form-b').val(\"\");\n\t\t\t\t$('.form-mf').val(\"\");\n\t\t\t\t$('.form-mt').val(\"\");\n\n\t\t\t\tlocalStorage.clear();\n\n\t\t\t}", "function clear() {\n productName.value = \"\";\n productPrice.value = \"\";\n productCategory.value = \"\";\n productDescription.value = \"\";\n\n productName.classList.remove(\"is-valid\");\n productPrice.classList.remove(\"is-valid\");\n productCategory.classList.remove(\"is-valid\");\n}", "function clearHeadForm(){\n inputHeadEntity.val(\"\");\n inputHeadIdEntity.val(\"\");\n inputHeadTotal.val(\"\");\n}", "function clearForm() {\n\t\t\t$('#rolForm input[type=\"text\"]').val(\"\");\n\t\t}", "function delInputCommon() {\r\n blocknumber.value = \"\";\r\n namespace.value = \"\";\r\n memo.value = \"\";\r\n amount.value = \"\";\r\n recipient.value = \"\";\r\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 resetInputs () {\n document.querySelector('#nm').value = \"\"\n document.querySelector('#desc').value = \"\"\n }", "function resetEditMenuForm(){\r\n EMenuNameField.reset();\r\n EMenuDescField.reset();\r\n EMStartDateField.reset();\r\n EMEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "function clearSupplierInputsCheck()\r\n{\r\n // if supplier information found assign to inputs\r\n if ($quantityProductClaim == 0 ) // print product to screen\r\n {\r\n $('#claimdetails-supplierid-input').val('');\r\n $('#claimdetails-suppliername-input').val('');\r\n $('#claimdetails-supplierphone-input').val('');\r\n $('#claimdetails-supplieremail-input').val('');\r\n $('#claimdetails-supplieraddress-input').val('');\r\n }\r\n}", "function func_reset()\r\n{\r\n document.getElementById(\"txt_Vendor\").value=\"\";\r\n document.getElementById(\"datepicker\").value=\"\";\r\n document.getElementById(\"txt_StatementOfWork\").value=\"\";\r\n document.getElementById(\"txt_NumberOfPallets\").value=\"\";\r\n document.getElementById(\"txt_PickupLocation\").value=\"\";\r\n document.getElementById(\"txt_LocalRIMContact\").value=\"\";\r\n document.getElementById(\"search-box\").value=\"\";\r\n document.getElementById(\"txt_Description\").value=\"\";\r\n document.getElementById(\"txt_Weight\").value=\"\";\r\n document.getElementById(\"txt_WO\").value=\"\";\r\n\r\n}", "function clearInputs() {\n $('#employeeFirstName').val('');\n $('#employeeLastName').val('');\n $('#employeeId').val('');\n $('#employeeTitle').val('');\n $('#employeeSalary').val('');\n}", "function reset() {\n\t$(\"#nombre\").val(null);\n\t$(\"#apellido\").val(null);\n\t$(\"#email\").val(null);\n\t$(\"#telefono\").val(null);\n\t$(\"#institucionSelect\").val(null);\n}", "static clearFeilds() {\n document.querySelector(\"#title\").value = \"\";\n document.querySelector(\"#author\").value = \"\";\n document.querySelector(\"#isbn\").value = \"\";\n }", "function resetInputs() {\n $('#qty').val(\"1\");\n $(\"#name\").val(\"\");\n $(\"#comments\").val(\"\");\n}", "function clearForm() {\n qty.value = \"\";\n totalPrice.innerHTML = \"\";\n}", "function clearRecipeInputs() {\n $('#title').val('');\n $('#ingredient-list').empty();\n $('#instruction').val('');\n}", "function clearInputFields() {\n $('#firstName').val('');\n $('#lastName').val('');\n $('#idNumber').val('');\n $('#jobTitle').val('');\n $('#annualSalary').val('');\n} // END: clearInputFields()", "function clearTextBox() {\n\n /* Mengganti Judul Utility Modal */\n $(\"#modalTitle\").text(\"Formulir Penambahan Data Master BatchFile\");\n\n /* Mengosongkan Field Id */\n $(\"#id\").val(\"\");\n\n /* Mengosongkan Field Nama */\n $(\"#name\").val(\"\");\n\n /* Menghilangkan Tombol Update */\n $(\"#btnUpdate\").hide();\n\n /* Menghilangkan Tombol Delete */\n $(\"#btnDelete\").hide();\n\n /* Menampilkan Tombol Add */\n $(\"#btnAdd\").show();\n\n /* Mengaktifkan Semua Form Field Yang Ada Pada Utility Modal */\n enabledFormAllField();\n\n}", "function resetECourseForm(){\r\n CourseNameField.reset();\r\n CourseDaysField.reset();\r\n \r\n }", "function clearInputFields(){\n $( '#idInput').val( '' );\n $( '#firstNameInput').val( '' );\n $( '#lastNameInput').val( '' );\n $( '#roleInput').val( '' );\n $( '#salaryInput').val( '' );\n}", "function stockModalClearFields() {\n $(\"#stockId\").val(\"\")\n $(\"#stockTitle\").val(\"\")\n $('#stockText').summernote('code', \"\")\n $(\"#startDate\").val(\"\")\n $(\"#endDate\").val(\"\")\n}", "function clearInputs() {\n setInputTitle(\"\");\n setInputAuthor(\"\");\n setInputPages(\"\");\n setInputStatus(\"read\");\n}", "function resetPresidentForm(){\n consecuenciasField.setValue('');\n descripcionField.setValue('');\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 clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function resetPresidentForm(){\n fechaInicioField.setValue('');\n descripcionEventoField.setValue('');\n }", "function clearCurrent() {\n //the below lines of code selects all the input fields, necessary because tag and class names didn't work\n document.getElementById(\"incomeinput\").value = \"\";\n document.getElementById(\"savings\").value = \"\";\n document.getElementById(\"food\").value = \"\";\n document.getElementById(\"clothing\").value = \"\";\n document.getElementById(\"shelter\").value = \"\";\n document.getElementById(\"transportation\").value = \"\";\n document.getElementById(\"electricity\").value = \"\";\n document.getElementById(\"water\").value = \"\";\n document.getElementById(\"miscellaneous\").value = \"\";\n\n document.getElementById(\"modal-bod\").innerHTML = \"\";\n alert(\"Cleared!\");\n\n}", "function clearForm(){\nnum.value=\"\";\nservice.value=\"\";\n}", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.name = \"\";\r\n self.model.address = \"\";\r\n }", "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 clearForm(){\n typeValue.value = \"\";\n amountValue.value = \"\";\n dateValue.value = \"\";\n selectValue.value = \"Choose\";\n}", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.component = \"\";\r\n }", "function clearForm(event) {\n event.target.elements['title'].value = null;\n event.target.elements['author'].value = null;\n event.target.elements['pages'].value = null;\n event.target.elements['read'].value = false ;\n}", "clear() {\n this.jQueryName.val('');\n this.jQueryEmail.val('');\n this.jQueryCount.val('');\n this.jQueryPrice.val('$');\n\n this.jQueryCities.selectAll.prop('checked', false);\n this.jQueryCities.cities.prop('checked', false);\n\n this.clearInvalid();\n this.hideNotes();\n }", "function clearForm(){\n\t$('#hid_id_data').val('');\n\t$('#hid_data_saldo').val('');\n\t$('#hid_data_nm_awl').val('');\n $(\"#txttgl\").val('');\n $('#txtnominal').val('');\n $('#txtketerangan').val(''); \n}", "clearFields() {\n this._form.find('.form-group input').each((k, v) => {\n let $input = $(v);\n if ($input.attr('type') !== \"hidden\") {\n $input.val('');\n }\n });\n }", "function clearAllBarInputTextFields(){\n $(\"#barchart_gate_title_id\").val(\"\");\n $(\"#barchart_gate_remaining_id\").val(\"\");\n $(\"#barchart_gate_actual_id\").val(\"\");\n $(\"#barchart_gate_avg_days_id\").val(\"\");\n\n $(\"#barchart_name_id\").val(\"\");\n $(\"#barchart_num_gates_id\").val(\"\");\n $(\"#barchart_num_req_id\").val(\"\");\n}", "function clearOrderForm() {\n currentOrder = {};\n fillOrder({});\n fillOrderItemList({});\n $('#buttonDelete').hide();\n $('#buttonCreate').hide();\n $('#buttonSave').hide();\n}", "function resetInputFields() {\n document.getElementById(\"description\").value = '';\n document.getElementById(\"value\").value = '';\n}" ]
[ "0.756188", "0.756188", "0.7501576", "0.7443869", "0.74255663", "0.7381309", "0.73807275", "0.7321939", "0.7223663", "0.7220769", "0.7210711", "0.71952885", "0.719072", "0.7186856", "0.7184216", "0.7181345", "0.7169639", "0.71645117", "0.7163952", "0.7140837", "0.7138663", "0.71302295", "0.7094297", "0.70939535", "0.7088864", "0.70732003", "0.7067243", "0.70602965", "0.70551056", "0.70305634", "0.6987617", "0.69857365", "0.69802564", "0.697976", "0.69694096", "0.6967067", "0.6955632", "0.694794", "0.69283694", "0.6927443", "0.69183964", "0.6911896", "0.6894773", "0.6891399", "0.6889685", "0.68850493", "0.6881183", "0.68723595", "0.68684", "0.68575406", "0.68469423", "0.68422574", "0.68416923", "0.6834619", "0.68343186", "0.6827465", "0.68259376", "0.6822808", "0.6809225", "0.6807916", "0.6801089", "0.68007165", "0.6796323", "0.6790524", "0.678675", "0.67847437", "0.6784466", "0.67807525", "0.67744535", "0.67688316", "0.6767854", "0.676692", "0.6763584", "0.6761863", "0.6757867", "0.6757336", "0.6752955", "0.6747619", "0.6739444", "0.6733508", "0.6730989", "0.67296374", "0.6725411", "0.6721451", "0.6716171", "0.6716171", "0.6713356", "0.671251", "0.6712125", "0.6707174", "0.6704448", "0.6704186", "0.6696314", "0.6691199", "0.6684017", "0.6671932", "0.66710114", "0.66691464", "0.6668252", "0.6658504" ]
0.7445479
3
This function clears the inputs on the edit form for a sale
function clearEditSaleForm() { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to in future operations while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#SaleDetails').fadeOut(500, function () { $('#SaleDetails').hide(); $('#editSaleName').val(""); $('#editSalePerson').val(""); $('#editSaleNumber').val(""); $('#editSaleEmail').val(""); $('#editSaleAmount').val(""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "function clear_form_data() {\n $(\"#customer_id\").val(\"\");\n $(\"#product_id\").val(\"\");\n $(\"#text\").val(\"\");\n $(\"#quantity\").val(\"\");\n $(\"#price\").val(\"\");\n }", "function cancelEditSale() {\n clearEditSaleForm();\n}", "function clearDetailForm(){\n inputIdDetail.val(\"\");\n inputDetailItem.val(\"\");\n inputDetailQuantity.val(\"\");\n inputDetailPrice.val(\"\");\n inputDetailTotal.val(\"\");\n inputDetailItem.focus();\n}", "function clear_form_data() {\n $(\"#cust_id\").val(\"\");\n $(\"#order_id\").val(\"\");\n $(\"#item_order_status\").val(\"\");\n }", "clearFields(){\n this.description.value = \"\"\n this.amount.value = \"\"\n this.date.value = \"\"\n }", "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item_year\").val(\"\");\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_search\").prop(\"disabled\", true);\n $(\"#btn_add_item\").prop(\"disabled\", true);\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n // disable link to author page\n $(\"#link_current_author\").removeClass(\"text-primary\");\n $(\"#link_current_author\").addClass(\"text-muted\");\n // hide editions page\n $(\"#page_editions\").hide(\"slow\");\n }", "clearFields() {\n document.getElementById('title').value='';\n document.getElementById('author').value='';\n document.getElementById('isbn').value='';\n }", "function clear_form_data() {\n $(\"#product_id\").val('');\n $(\"#rec_product_id\").val('');\n $(\"#rec_type_id\").val('1');\n $(\"#weight_id\").val('');\n }", "function clear_form_data() {\n $(\"#inventory_product_id\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_quantity\").val(\"\");\n $(\"#inventory_restock_level\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n }", "function clear_form_data() {\n $(\"#inventory_name\").val(\"\");\n $(\"#inventory_category\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_count\").val(\"\");\n }", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function clearFields() {\r\n\t\t\t\t\t\t$('#tf_Id').val(null);\r\n\t\t\t\t\t\t$('#tf_Descricao').val(null);\r\n\t\t\t\t\t\t$('#slc_Marca').val(0);\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').val(0);\r\n\t\t\t\t\t\t$('#slc_Status').val(0);\r\n\t\t\t\t\t\t$('#btn-operation').val(\"Criar Modelo\");\r\n\t\t\t\t\t}", "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 clear_item_form_data() {\n $(\"#item_product_id\").val(\"\");\n $(\"#item_order_id\").val(\"\");\n $(\"#item_name\").val(\"\");\n $(\"#item_quantity\").val(\"\");\n $(\"#item_price\").val(\"\");\n $(\"#item_status\").val(\"\");\n }", "clearFields() {\r\n document.getElementById('title').value = '',\r\n document.getElementById('author').value = '',\r\n document.getElementById('isbn').value = '';\r\n }", "function clear_form_data() {\n var item_area=$('#item_area');\n console.log(\"Clear all data\");\n item_area.val(\"\");\n $('#change_course_dis_text').val(\"\");\n $('#course_name_text').val(\"\");\n $('#course_dis_text').val(\"\");\n\n }", "function clear_form_data() {\n $(\"#product_id\").val(\"\");\n $(\"#recommended_product_id\").val(\"\");\n $(\"#recommendation_type\").val(\"\");\n $(\"#likes\").val(\"\");\n }", "function clear_form_data() {\n $(\"#promo_name\").val(\"\");\n $(\"#promo_type\").val(\"\");\n $(\"#promo_value\").val(\"\");\n $(\"#promo_start_date\").val(\"\");\n $(\"#promo_end_date\").val(\"\");\n $(\"#promo_detail\").val(\"\");\n $(\"#promo_available_date\").val(\"\");\n }", "function clearAddform(){\n $(\"#qty\").css(\"border-color\", \"#eee\"); //rollback when not empty\n $(\"#qty\").val('');\n $(\"#searchInventory_id\").val('');\n $(\"#disc_amt\").val(\"\");\n $(\"#disc_percent\").val(\"\");\n $(\"#discount_type_select\").val(\"\").change();\n $(\".percentage_div\").hide();\n $(\".amount_div\").hide();\n }", "clearFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#reference').value = '';\n document.querySelector('#price').value = '';\n }", "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "function clear_form_data() {\n $(\"#promotion_title\").val(\"\");\n $(\"#promotion_promotion_type\").val(\"\");\n $(\"#promotion_start_date\").val(\"\");\n $(\"#promotion_end_date\").val(\"\");\n $(\"#promotion_active\").val(\"\");\n }", "function resetForm() {\n $('#productID').val(null);\n $('#productName').val('');\n $('#description').val('');\n $('#price').val('');\n $('#Currency').val('1');\n $('#Status').val('1');\n }", "function resetProd(){\n $(\"#nombre\").val(\"\")\n $(\"#marca\").val(\"\")\n $(\"#costo\").val(\"\")\n $(\"#ganancia\").val(\"\")\n $(\"#cantidad\").val(\"\")\n}", "clearCheckoutFields() {\n $(\"#c_p_name\").val('').focus();\n $(\"#c_p_quantity\").val('');\n $(\"#c_p_r_price\").val('');\n $(\"#c_p_unit_price\").val('');\n $(\"#c_p_discount\").val('');\n $(\"#receipt_name, #receipt_address, #receipt_no\").val('');\n this.product = {};\n }", "function clearFields() {\n name.value = \"\";\n title.value = \"\";\n hourlyRate.value = \"\";\n hours.value = \"\";\n salary.value = \"\";\n baseSalary.value = \"\";\n commissionRate.value = \"\";\n sales.value = \"\";\n commissionOption.checked = false;\n salaryOption.checked = false;\n hourlyOption.checked = false;\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\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 clearIngredientForm() {\n dishMakerIngredientsTable.clear().draw();\n $(\"#newDishName\").val('');\n $(\"#profitMarginInput\").val('');\n $(\"#addIngredientNameInput\").val('');\n $(\"#addIngredientAmountInput\").val('');\n $(\"#totalCostCalculated\").text('');\n $(\"#sellingPrice\").text('');\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}", "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 }", "static clearFields(){\n document.querySelector('#title').value ='';\n document.querySelector('#author').value ='';\n document.querySelector('#isbn').value ='';\n }", "function resetEditModal() {\n $('#userIdEdit').val('');\n $('#firstNameEdit').val('');\n $('#lastNameEdit').val('');\n $('#ageEdit').val('');\n}", "function clearFields() {\n movie_name.value = '';\n release_date.value = '';\n movie_banner.value = '';\n description.value = '';\n}", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "clearInputs() {\n\t\t$(this.elementConfig.nameInput).val(\"\");\n\t\t$(this.elementConfig.courseInput).val(\"\");\n\t\t$(this.elementConfig.gradeInput).val(\"\");\n\n\t}", "function clearTable(){\n form.locationName.value = '';\n form.locationMinCustomers.value = '';\n form.locationMaxCustomers.value = '';\n form.locationAvgCookiesSold.value = '';\n}", "static clearField(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clear_form_data() {\n $(\"#recommendation_id\").val(\"\");\n $(\"#recommendation_productId\").val(\"\");\n $(\"#recommendation_suggestionId\").val(\"\");\n $(\"#recommendation_categoryId\").val(\"\");\n $(\"#recommendation_old_categoryId\").val(\"\");\n }", "function clearAddform(){\n $(\"#price\").css(\"border-color\", \"#eee\"); //rollback when not empty\n $(\"#price\").val('');\n $(\"#searchPayment\").css(\"border-color\", \"#eee\"); //rollback when not empty\n $(\"#searchPayment\").val('');\n $(\"#searchPayment_id\").val('');\n}", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \n \t\n \t$('#frmMain').find(':input').each(function(){\n \t\tvar id = $(this).prop('id');\n \t\tvar Value = $('#' + id).val(\" \");\n \t});\n \t \t\n \t$('#txtShape').val('Rod'); \n \t$(\"#drpInch\").val(0);\n $(\"#drpFraction\").val(0);\n \n UncheckAllCheckBox();\n clearSelect2Dropdown();\n \n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \n }", "resetFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'||this.type=='hidden') {\n this.value = '';\n }\n else if (this.type == 'radio' || this.type == 'checkbox') {\n this.checked = false;\n }\n else if (this.type == 'select-one' || this.type == 'select-multiple') {\n this.value = '-1';\n }\n });\n\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 resetEditMenuItemForm(){\r\n EMenuItemNameField.reset();\r\n \tEMenuItemDescField.reset();\r\n \tEMenuItemValidFromField.reset();\r\n EMenuItemValidToField.reset();\r\n \tEMenuItemPriceField.reset();\r\n \tEMenuItemTypePerField.reset();\r\n\t\t\t\t\t \r\n }", "function restablecer(){\n\t\t$(\"#miCod\").val(\"\");\n\t\t$(\"#miNom\").val(\"\");\n\t\t$(\"#miNota\").val(\"\");\n\t}", "function clearSI() {\n $('#siId').val(\"\");\n $('#siTitle').val(\"\");\n $('#siCreatedBy').val(\"\");\n $('#siFY').val(\"\");\n $('#siOwner').val(\"\");\n $('#siDescr').text(\"\");\n $('#siActive').prop('checked', false);\n}", "function ridInputs() {\n dateInput.value = ''\n supplierInput.value = ''\n warehouseInput.value = ''\n productInput.value = ''\n quantityInput.value = ''\n sumInput.value = ''\n}", "function reset_form_data() {\n $(\"#order_customer_id\").val(\"\");\n $(\"#order_created_date\").val(\"\");\n\n row_num = 0;\n $(\"#order_items\").empty();\n add_row();\n }", "function clearInputFields(el) {\r\n\tel.parent().siblings('.modal-body').find('input').val('');\r\n}", "function clearInputs() {\r\n document.getElementById('addressBookForm').reset();\r\n }", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\n}", "function clearCalculations() {\n $('.field').val('');\n }", "function resetEdit() {\n\t$('.icons').removeClass('editable');\n\t$('#save-recipe, #cancel-recipe').hide();\n\t$('#detail-description, #detail-name').attr('contenteditable', false);\n\t$('#detail-new-ingredient-input').hide();\n}", "function clearFields(){\n $(\"#idInput\").val('');\n $(\"#titleInput\").val('');\n $(\"#contentInput\").val('');\n $(\"#authorInput\").val('');\n $(\"#dateInput\").val(''); \n $(\"#authorSearch\").val('');\n $(\"#idDelete\").val('');\n}", "function clearInputfields() {\r\n\t$('#title').val('');\r\n\t$('#desc').val('');\r\n\t$('#email').val('');\r\n}", "function cleanExpenseView()\n {\n $(\"#table-items tbody tr\").remove();\n row_item_first.find('.quantity input').val('');\n row_item_first.find('.description input').val('');\n row_item_first.find('.total-item input').val('');\n $(\"#table-items tbody\").append(row_item_first);\n $(\".tot-document\").show();\n $(\"#proof-type\").val(\"1\").attr(\"disabled\",false);\n $(\"#ruc\").val('').attr('disabled',false);\n $(\"#ruc-hide\").val('');\n $(\"#razon\").html('');\n $(\"#razon\").val(0);\n $(\"#razon\").attr(\"data-edit\",0);\n $(\"#number-prefix\").val('').attr('disabled',false);\n $(\"#number-serie\").val('').attr('disabled',false);\n $(\"#sub-tot\").val(0);\n $(\"#imp-ser\").val(0);\n $(\"#igv\").val(0);\n $(\"#total-expense\").val('');\n $(\"#tot-edit-hidden\").val('');\n $(\"#desc-expense\").val('');\n //$( '#cancel-expense' ).hide();\n $(\"#table-expense tbody tr\").removeClass(\"select-row\");\n }", "function clearInputs(){\n\t//array is filled with the HTML ids of the input value fields\n\t//array loops through each id,resets the value to empty string\n\t\tvar inputIds = [\n\t\t\t\ttitleInput,\n\t\t\t\turgency,\n\t\t\t\t ];\n\n\t\t\tinputIds.forEach(function(id){\n\t\t\t\t\tid.value = '';\n\t\t\t});\n}", "function clear_inputs() {\n\n\t\t\t\t$('.form-w').val(\"\");\n\t\t\t\t$('.form-b').val(\"\");\n\t\t\t\t$('.form-mf').val(\"\");\n\t\t\t\t$('.form-mt').val(\"\");\n\n\t\t\t\tlocalStorage.clear();\n\n\t\t\t}", "function clear() {\n productName.value = \"\";\n productPrice.value = \"\";\n productCategory.value = \"\";\n productDescription.value = \"\";\n\n productName.classList.remove(\"is-valid\");\n productPrice.classList.remove(\"is-valid\");\n productCategory.classList.remove(\"is-valid\");\n}", "function clearHeadForm(){\n inputHeadEntity.val(\"\");\n inputHeadIdEntity.val(\"\");\n inputHeadTotal.val(\"\");\n}", "function clearForm() {\n\t\t\t$('#rolForm input[type=\"text\"]').val(\"\");\n\t\t}", "function delInputCommon() {\r\n blocknumber.value = \"\";\r\n namespace.value = \"\";\r\n memo.value = \"\";\r\n amount.value = \"\";\r\n recipient.value = \"\";\r\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 resetInputs () {\n document.querySelector('#nm').value = \"\"\n document.querySelector('#desc').value = \"\"\n }", "function resetEditMenuForm(){\r\n EMenuNameField.reset();\r\n EMenuDescField.reset();\r\n EMStartDateField.reset();\r\n EMEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "function clearSupplierInputsCheck()\r\n{\r\n // if supplier information found assign to inputs\r\n if ($quantityProductClaim == 0 ) // print product to screen\r\n {\r\n $('#claimdetails-supplierid-input').val('');\r\n $('#claimdetails-suppliername-input').val('');\r\n $('#claimdetails-supplierphone-input').val('');\r\n $('#claimdetails-supplieremail-input').val('');\r\n $('#claimdetails-supplieraddress-input').val('');\r\n }\r\n}", "function func_reset()\r\n{\r\n document.getElementById(\"txt_Vendor\").value=\"\";\r\n document.getElementById(\"datepicker\").value=\"\";\r\n document.getElementById(\"txt_StatementOfWork\").value=\"\";\r\n document.getElementById(\"txt_NumberOfPallets\").value=\"\";\r\n document.getElementById(\"txt_PickupLocation\").value=\"\";\r\n document.getElementById(\"txt_LocalRIMContact\").value=\"\";\r\n document.getElementById(\"search-box\").value=\"\";\r\n document.getElementById(\"txt_Description\").value=\"\";\r\n document.getElementById(\"txt_Weight\").value=\"\";\r\n document.getElementById(\"txt_WO\").value=\"\";\r\n\r\n}", "function reset() {\n\t$(\"#nombre\").val(null);\n\t$(\"#apellido\").val(null);\n\t$(\"#email\").val(null);\n\t$(\"#telefono\").val(null);\n\t$(\"#institucionSelect\").val(null);\n}", "function clearInputs() {\n $('#employeeFirstName').val('');\n $('#employeeLastName').val('');\n $('#employeeId').val('');\n $('#employeeTitle').val('');\n $('#employeeSalary').val('');\n}", "static clearFeilds() {\n document.querySelector(\"#title\").value = \"\";\n document.querySelector(\"#author\").value = \"\";\n document.querySelector(\"#isbn\").value = \"\";\n }", "function resetInputs() {\n $('#qty').val(\"1\");\n $(\"#name\").val(\"\");\n $(\"#comments\").val(\"\");\n}", "function clearForm() {\n qty.value = \"\";\n totalPrice.innerHTML = \"\";\n}", "function clearRecipeInputs() {\n $('#title').val('');\n $('#ingredient-list').empty();\n $('#instruction').val('');\n}", "function clearInputFields() {\n $('#firstName').val('');\n $('#lastName').val('');\n $('#idNumber').val('');\n $('#jobTitle').val('');\n $('#annualSalary').val('');\n} // END: clearInputFields()", "function clearTextBox() {\n\n /* Mengganti Judul Utility Modal */\n $(\"#modalTitle\").text(\"Formulir Penambahan Data Master BatchFile\");\n\n /* Mengosongkan Field Id */\n $(\"#id\").val(\"\");\n\n /* Mengosongkan Field Nama */\n $(\"#name\").val(\"\");\n\n /* Menghilangkan Tombol Update */\n $(\"#btnUpdate\").hide();\n\n /* Menghilangkan Tombol Delete */\n $(\"#btnDelete\").hide();\n\n /* Menampilkan Tombol Add */\n $(\"#btnAdd\").show();\n\n /* Mengaktifkan Semua Form Field Yang Ada Pada Utility Modal */\n enabledFormAllField();\n\n}", "function resetECourseForm(){\r\n CourseNameField.reset();\r\n CourseDaysField.reset();\r\n \r\n }", "function clearInputFields(){\n $( '#idInput').val( '' );\n $( '#firstNameInput').val( '' );\n $( '#lastNameInput').val( '' );\n $( '#roleInput').val( '' );\n $( '#salaryInput').val( '' );\n}", "function stockModalClearFields() {\n $(\"#stockId\").val(\"\")\n $(\"#stockTitle\").val(\"\")\n $('#stockText').summernote('code', \"\")\n $(\"#startDate\").val(\"\")\n $(\"#endDate\").val(\"\")\n}", "function clearInputs() {\n setInputTitle(\"\");\n setInputAuthor(\"\");\n setInputPages(\"\");\n setInputStatus(\"read\");\n}", "function resetPresidentForm(){\n consecuenciasField.setValue('');\n descripcionField.setValue('');\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 clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function resetPresidentForm(){\n fechaInicioField.setValue('');\n descripcionEventoField.setValue('');\n }", "function clearCurrent() {\n //the below lines of code selects all the input fields, necessary because tag and class names didn't work\n document.getElementById(\"incomeinput\").value = \"\";\n document.getElementById(\"savings\").value = \"\";\n document.getElementById(\"food\").value = \"\";\n document.getElementById(\"clothing\").value = \"\";\n document.getElementById(\"shelter\").value = \"\";\n document.getElementById(\"transportation\").value = \"\";\n document.getElementById(\"electricity\").value = \"\";\n document.getElementById(\"water\").value = \"\";\n document.getElementById(\"miscellaneous\").value = \"\";\n\n document.getElementById(\"modal-bod\").innerHTML = \"\";\n alert(\"Cleared!\");\n\n}", "function clearForm(){\nnum.value=\"\";\nservice.value=\"\";\n}", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.name = \"\";\r\n self.model.address = \"\";\r\n }", "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 clearForm(){\n typeValue.value = \"\";\n amountValue.value = \"\";\n dateValue.value = \"\";\n selectValue.value = \"Choose\";\n}", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.component = \"\";\r\n }", "function clearForm(event) {\n event.target.elements['title'].value = null;\n event.target.elements['author'].value = null;\n event.target.elements['pages'].value = null;\n event.target.elements['read'].value = false ;\n}", "clear() {\n this.jQueryName.val('');\n this.jQueryEmail.val('');\n this.jQueryCount.val('');\n this.jQueryPrice.val('$');\n\n this.jQueryCities.selectAll.prop('checked', false);\n this.jQueryCities.cities.prop('checked', false);\n\n this.clearInvalid();\n this.hideNotes();\n }", "function clearForm(){\n\t$('#hid_id_data').val('');\n\t$('#hid_data_saldo').val('');\n\t$('#hid_data_nm_awl').val('');\n $(\"#txttgl\").val('');\n $('#txtnominal').val('');\n $('#txtketerangan').val(''); \n}", "clearFields() {\n this._form.find('.form-group input').each((k, v) => {\n let $input = $(v);\n if ($input.attr('type') !== \"hidden\") {\n $input.val('');\n }\n });\n }", "function clearAllBarInputTextFields(){\n $(\"#barchart_gate_title_id\").val(\"\");\n $(\"#barchart_gate_remaining_id\").val(\"\");\n $(\"#barchart_gate_actual_id\").val(\"\");\n $(\"#barchart_gate_avg_days_id\").val(\"\");\n\n $(\"#barchart_name_id\").val(\"\");\n $(\"#barchart_num_gates_id\").val(\"\");\n $(\"#barchart_num_req_id\").val(\"\");\n}", "function clearOrderForm() {\n currentOrder = {};\n fillOrder({});\n fillOrderItemList({});\n $('#buttonDelete').hide();\n $('#buttonCreate').hide();\n $('#buttonSave').hide();\n}", "function resetInputFields() {\n document.getElementById(\"description\").value = '';\n document.getElementById(\"value\").value = '';\n}" ]
[ "0.7559467", "0.7559467", "0.7499257", "0.7446134", "0.74417937", "0.7423586", "0.7379165", "0.73204905", "0.7221571", "0.7218246", "0.7208463", "0.7193243", "0.7189295", "0.71848047", "0.718238", "0.71793485", "0.7167522", "0.71626", "0.71624124", "0.7138791", "0.71364295", "0.7127897", "0.70923096", "0.7092233", "0.7086954", "0.7070887", "0.7064558", "0.7057569", "0.70531434", "0.7027531", "0.69848055", "0.69834286", "0.6978782", "0.69787365", "0.6968691", "0.6965105", "0.69543266", "0.6945123", "0.6926709", "0.6925938", "0.6916389", "0.69091743", "0.68920296", "0.68897235", "0.6886733", "0.68835443", "0.68812287", "0.6871576", "0.6866967", "0.68560404", "0.6844971", "0.6839702", "0.68389344", "0.6832556", "0.683247", "0.6827384", "0.6824089", "0.68210375", "0.68065363", "0.6806198", "0.67993623", "0.679835", "0.6794203", "0.67881316", "0.6786509", "0.6782566", "0.6782203", "0.6780638", "0.6772892", "0.67669946", "0.6764947", "0.67647964", "0.6762762", "0.6758983", "0.67549986", "0.67548823", "0.67504203", "0.67462105", "0.6737158", "0.67310363", "0.67298263", "0.67276734", "0.6723673", "0.67188317", "0.6713954", "0.6713954", "0.67117316", "0.6709999", "0.6709561", "0.6706627", "0.6702638", "0.6701393", "0.6695773", "0.66900796", "0.6681348", "0.66689676", "0.66688246", "0.6667126", "0.6666816", "0.66569763" ]
0.73803425
6
This function updates an existing sale's details
function saveEditSale() { if ($('#editSaleAmount').val() == "" || $('#editSale').val() == "") { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Organization Name or amount field is empty.")); errArea.appendChild(divMessage); } else { currentItem.set_item("Title", $('#editSale').val()); currentItem.set_item("ContactPerson", $('#editSalePerson').val()); currentItem.set_item("ContactNumber", $('#editSaleNumber').val()); currentItem.set_item("Email", $('#editSaleEmail').val()); currentItem.set_item("DealAmount", $('#editSaleAmount').val()); currentItem.update(); context.load(currentItem); context.executeQueryAsync(function () { showSales(); }, function (sender, args) { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updateSale(saleID, storeID) {\n\n}", "function updateProductSale() {\n // select the item in database\n connection.query(\"SELECT price, id FROM products WHERE id =?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // update sales of item in database\n connection.query(\"UPDATE products SET product_sales=product_sales + ? WHERE id=?\",\n [\n (parseFloat(res[0].price) * quantityToBuy),\n itemToBuy\n ],\n function (err, res) {\n if (err) throw err;\n viewAll();\n })\n }\n )\n}", "async paySale(sale){\n\t\t\ttry{\n\t\t\t\tlet response = await axios.put(\"/api/sales/\" + sale._id);\n\t\t\t\tawait this.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "function updateSales(count, iid){\n connection.query(\"UPDATE products SET product_sales = product_sales + price * ? WHERE item_id = ?\", [count, iid], function (err, res, fields){\n })\n }", "updateInvestmentDetails() {\n\t\tif (\"SecurityInvestment\" === this.transaction.transaction_type) {\n\t\t\t// Base amount is the quantity multiplied by the price\n\t\t\tthis.transaction.amount = (Number(this.transaction.quantity) || 0) * (Number(this.transaction.price) || 0);\n\n\t\t\t// For a purchase, commission is added to the cost; for a sale, commission is subtracted from the proceeds\n\t\t\tif (\"inflow\" === this.transaction.direction) {\n\t\t\t\tthis.transaction.amount += Number(this.transaction.commission) || 0;\n\t\t\t} else {\n\t\t\t\tthis.transaction.amount -= Number(this.transaction.commission) || 0;\n\t\t\t}\n\t\t}\n\n\t\t// If we're adding a new buy or sell transaction, update the memo with the details\n\t\tif (!this.transaction.id && \"SecurityInvestment\" === this.transaction.transaction_type) {\n\t\t\tconst\tquantity = Number(this.transaction.quantity) > 0 ? String(this.transaction.quantity) : \"\",\n\t\t\t\t\t\tprice = Number(this.transaction.price) > 0 ? ` @ ${this.currencyFilter(this.transaction.price)}` : \"\",\n\t\t\t\t\t\tcommission = Number(this.transaction.commission) > 0 ? ` (${\"inflow\" === this.transaction.direction ? \"plus\" : \"less\"} ${this.currencyFilter(this.transaction.commission)} commission)` : \"\";\n\n\t\t\tthis.transaction.memo = quantity + price + commission;\n\t\t}\n\t}", "function editData(event) {\n\tvar saleid = document.getElementById(\"saleid\").value;\n\tvar product = document.getElementById(\"editproduct\").value;\n\tvar quantity = document.getElementById(\"editquantity\").value;\n\tvar datetime = document.getElementById(\"editdatetime\").value;\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"edit\",\n\t\t\t\t\"updateTo\": {\n\t\t\t\t},\n\t\t\t\t\"filter\": {\n\t\t\t\t\t\"type\": \"column\",\n\t\t\t\t\t\"name\": \"id\",\n\t\t\t\t\t\"value\": saleid\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t};\n\t\n\tif(saleid && saleid.match(/^\\d*$/))\n\t{\n\t\tif(product != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.product = Number(product);\n\t\t}\n\t\t\n\t\tif(quantity != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.quantity = Number(quantity);\n\t\t}\n\t\t\n\t\tif(datetime != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.dateTime = getDateAndTime();\n\t\t}\n\t\t\t\t\t\t\n\t\treturn sendAPIRequest(json, event, displaySalesRecords);\n\t}\n\telse\n\t{\n\t\talert(\"Please enter a numerical value for sale id\");\n\t}\n\t\n}", "function updateProductSales(dept,newOHC, totalProductSales) {\n connection.query(\"UPDATE departments SET ? WHERE ?\",\n [\n { product_sales: totalProductSales },\n { department_name: dept }\n ], function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" The total product sales for \" + dept + \" has been updated in the Departments Table to: \" + totalProductSales + \" !\\n\");\n let totalProfit = parseFloat(totalProductSales - newOHC).toFixed(2);\n updateTotalProfit(dept, totalProfit, newOHC)\n })\n}", "function updateSaleItem(itemId, highestBidder, highestBid)\n\t{\n\t\thighestBidder = \"highestBidderC\";\n\t\thighestBid = 405;\n\n\t\tvar updateData = {\n\t\t\t\"highest_bidder\": highestBidder,\n\t\t\t\"highest_bid\": highestBid\n\t\t};\n\n\t\tvar itemId = 2;\n\n\t\t$.ajax({\n\t \tmethod: \"PUT\",\n\t \turl: \"/api/forsale/\" + itemId,\n\t \tdata: updateData\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\n\t });\n\t}", "function updateSales(total, item) {\n\t// finds the name of the department the ordered item belongs to\n\tconn.query('SELECT departmentName FROM products WHERE itemID = ' + conn.escape(item), function(err,res) {\n\t\tif (err) {throw err}\n\n\t\tvar depName = res[0].departmentName\n\n\t\t// based on the department, update that row in table departments with the sale total\n\t\tconn.query('UPDATE departments SET totalSales = totalSales + ' + conn.escape(total) + ' WHERE departmentName = ' + conn.escape(depName), function(err, res) {\n\t\t\tif (err) {throw err}\n\n\t\t\tconsole.log('Total Sales column updated:', depName, '+$' + total)\n\t\t})\n\t})\n}", "function updateSales(sales) {\n\tvar salesDiv = document.getElementById(\"sales\");\n\n\tfor (var i = 0; i < sales.length; i++) {\n\t\tvar sale = sales[i];\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.setAttribute(\"class\", \"saleItem\");\n\t\tdiv.innerHTML = sale.name + \" sold \" + sale.sales + \" gumbaslls\";\n\t\tsalesDiv.appendChild(div);\n\t}\n\t\n\tif (sales.length > 0) {\n\t\tlastReportTime = sales[sales.length-1].time;\n\t}\n}", "function updateStorage(newStock, id, quantity, price, sales){\n var totalCost = quantity * price;\n var newSales = sales + totalCost;\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock,\n product_sales: newSales\n },\n {\n item_id: id\n }\n ],\n function(err, res){\n if(err) throw err;\n console.log(colors.magenta(\"The total cost of your order is\",\"$\"+ totalCost + \"\\n\"));\n restartPrompt();\n }\n )\n}", "update() {\n const {name, address1, address2, city, state: stateVal, zip, phone, creditValuePercentage, maxSpending, payoutAmountPercentage} = this.displayData.details;\n const {companyId, storeId} = state.get(this).params;\n const params = {\n name,\n address1,\n address2,\n city,\n state: stateVal,\n zip,\n phone,\n companyId,\n storeId\n };\n // Alternate usage\n if (this.alternativeGcmgr) {\n params.creditValuePercentage = creditValuePercentage;\n params.maxSpending = maxSpending;\n params.payoutAmountPercentage = payoutAmountPercentage;\n }\n // Update the store\n Service.get(this).update(params)\n .then(() => {\n // Redirect\n state.get(this).go('main.corporate.store.details', {companyId: params.companyId, storeId: params.storeId});\n });\n }", "function updateProductSales(anItem_id, productSales) {\n\n var sql = \"UPDATE ProductsTable SET product_sales = \" + productSales + \" WHERE item_id = \" + anItem_id;\n console.log(\"UPDATE ProductsTable.product_sales SQL: \" + sql);\n connection.query(sql, function(err, result) {\n if (err) {\n throw err;\n } else { //qtyInStock > qtyToPurchase\n console.log(result.affectedRows + \" record(s) updated\");\n connection.close();\n }\n\n });\n}", "function updateWarehouseItem(quantity, warehouseID, warehouseName, userID, total) {\n \n \t\n \tvar post = {\n \tquantity: quantity,\n \twarehouseID: warehouseID,\n \twarehouseName: warehouseName,\n \tuserID: userID,\n \ttotal: total\n \t};\n\n \n $.ajax({\n method: \"PUT\",\n url: \"/api/make-purchase\" ,\n data: post\n })\n .done(function(data) {\n \t\n \tif (data.complete === true)\n \t\twindow.location = \"/user-homepage\";\n \n });\n }", "function updateTotalSales() {\n\n // Query to update total sales based on product id\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n\n // parseFloat is required to make sure the math is handled with decimal values, not string\n var grandTotalSales = parseFloat(newSales) + parseFloat(totalSales);\n\n connection.query(queryTerms,\n [\n {product_sales: grandTotalSales},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n });\n\n // Back to the start of the program\n start();\n} // End updateTotalSales function", "updateSupplier(params) {\r\n return Api().post('/updatesupplier', params)\r\n }", "function updatepurchase(newQty, id) {\n connection.query(\"UPDATE products SET stock_quantity =? WHERE idproducts =?\", [newQty, id], function (err, res) {\n if (err) throw err;\n });\n}", "function updateDatabase(itemName, itemInventory, totalSales) {\n\n connection.query(\"UPDATE products SET ? WHERE ?\", [\n {\n stock_quantity: itemInventory\n },\n {\n product_name: itemName\n }\n ], (err, results, fields) => {\n if (err) {\n throw err;\n }\n return continueShoppingPrompt();\n });\n}", "function _Update(objRequest, objResponse) {\n nlapiLogExecution('AUDIT','UPDATE Courses', '=====START=====');\n var stCustId = objRequest['CustomerId'];\n var httpBody = objRequest;\n nlapiLogExecution('AUDIT', 'Update Course', 'Update function in Departments executed.');\n\n var objDataResponse = {\n Response: 'F',\n Message: 'Default Value',\n ReturnId: ''\n };\n\n var loadedICourseRecord = nlapiLoadRecord('customrecord_rc_course', httpBody.Id);\n\n try {\n loadedICourseRecord.setFieldValue('custrecord_rc_course_title', httpBody.Title),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_number', httpBody.Number),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_level', httpBody.CreditLevel.Id),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_hours', httpBody.CreditHours),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_syllabi_name', httpBody.SyllabiName),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_institution', httpBody.ModeOfInstruction),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_reg_course', httpBody.RegisteredCourseId)\n objDataResponse.ReturnId = nlapiSubmitRecord(loadedICourseRecord, true)\n }\n catch (ex) {\n nlapiLogExecution('ERROR', 'Something broke trying to set fields' + ex.message)\n }\n\n if(objDataResponse.ReturnId){\n objDataResponse.Response = 'T';\n objDataResponse.Message = 'Yo it seems as though we have been successful with dis otha endevour' + JSON.stringify(loadedICourseRecord)\n }\n\n // Ask john.\n //1.)How to deal with \"missing\" values. What values must be supplied at any given stage\n // Mode up is required(looking at ns)\n\n // its either a list OR a record A list has id and value when writing i only provide an ID, don't pass anything but the id\n // think of it as an Enumerator, a number that means something else.\n //2.)How to deal with list objects\n\n nlapiLogExecution('AUDIT','UPDATE Courses', '======END======');\n return JSON.stringify(objDataResponse)\n}", "function updateProducts(id,quantity,product_Sales){\n \n connection.query(\"update products set stock_quantity = ?, product_sales = ? where item_id = ?\",[\n quantity, \n product_Sales,\n id\n ],function(error) {\n if (error) throw err;\n console.log(\"Quantity updated successfully!\");\n })\n \n}", "createSales() {\n\n this.setState({ isOpen: true, salesEditId: '', cusEditId: '', proEditId: '', strEditId: '', soldDate: '', proError: false, dateError: false, cusError: false, strError: false, proValMessage: '', cusValMessage: '', strValMessage: '', dateValMessage: ''});\n\n }", "function updateFactoryData(details, $scope, shoppingCarFactory) {\n\n setTotalPrice(details, shoppingCarFactory);\n\n $scope.emptyCar = setEmptyCar(details);\n\n shoppingCarFactory.setDetails(details);\n}", "update(req, res) {\n return OrderDetails.find({\n where: {\n OrderId: req.params.orderid,\n ItemId: req.body.itemid\n }\n })\n .then(item => {\n if (!item) {\n return res.status(404).send({\n message: \"Item Not Found\"\n });\n }\n\n return (\n item\n .update(req.body, { fields: Object.keys(req.body) })\n // .update({ quantity: 11 })\n .then(updatedOrderDetail =>\n res.status(200).send(updatedOrderDetail)\n )\n .catch(error => res.status(400).send(error))\n );\n })\n .catch(error => res.status(400).send(error));\n }", "salesCreate(event, data) {\n event.preventDefault();\n axios.post('/api/orders', data)\n .then((res) => {\n if (res.status === 200) {\n // add newest order id as new key/value into data\n data.latestOrderId = res.data.last_order.order_id;\n\n // trigger modal pop up to notify that sales has created\n this.salesCreatedToggle('success');\n this.getOrders();\n this.getInventoryCosts()\n\n // axios call to update useditem table and in inventory table in database\n axios.post('/api/useditems', data)\n\n } else {\n this.salesCreatedToggle('failed');\n }\n })\n\n }", "updateStore(value, id) {\n const expense = {\n name: value,\n }\n\n return fetch(`${this.baseUrl}/${id}`, {\n method: 'PATCH',\n headers: {\n 'content-type': 'application/json',\n 'accepts': 'application/json',\n },\n body: JSON.stringify({ expense }),\n }).then(res => res.json())\n }", "function updateDB(answer, stock, price, sales){ \n var newQuantity = stock - parseInt(answer.getUnits);\n var getTotal = price * parseInt(answer.getUnits); \n var newSales = sales + getTotal;\n var query = `UPDATE products SET stock_quantity = ${newQuantity}, product_sales=${newSales} WHERE productID=${answer.getItem}`;\n connection.query(query, (err) => {\n if(err) throw err;\n console.log(`You're purchase is complete. Your total is $${getTotal}.`);\n nextPrompt();\n })\n}", "async update ({ params, request, response }) {\n const product = await Product.find(params.id)\n const data = request.only([\n \"name\", \n \"description\", \n \"price\"\n ])\n product.merge(data)\n if (product) {\n response.status(200).json({\n success: 'Product Updated',\n data: data\n })\n await product.save()\n } else {\n response.status(304).send({ error: 'Product Not Updated' })\n }\n }", "function updateTransaction()\n{\n nlapiLogExecution('DEBUG', 'updateTransaction', 'Begin');\n \n var newRecord = nlapiGetNewRecord();\n var transactionId = newRecord.getFieldValue('custrecord_jobopt_transaction');\n var transactionType = newRecord.getFieldValue('custrecord_jobopt_transtype');\n var lineId = newRecord.getFieldValue('custrecord_jobopt_translineid');\n var updateItemOptions = (newRecord.getFieldValue('custrecord_jobopt_updateitemoptions') == 'T');\n \n if (updateItemOptions && transactionId && transactionType && lineId) {\n var transaction = nlapiLoadRecord(transactionType, transactionId);\n \n // Update the correct line item based on line ID\n var update = false;\n var i = 1, n = transaction.getLineItemCount('item') + 1;\n for (;i < n; i++) {\n if (transaction.getLineItemValue('item', 'custcol_lineid', i) == lineId) {\n transaction.setLineItemValue('item', 'custcol_bo_course', i, newRecord.getFieldValue('custrecord_jobopt_course'));\n transaction.setLineItemValue('item', 'custcol_bo_date', i, newRecord.getFieldValue('custrecord_jobopt_date'));\n transaction.setLineItemValue('item', 'custcol_bo_time', i, newRecord.getFieldValue('custrecord_jobopt_time')); \n update = true;\n }\n }\n if (update) {\n nlapiLogExecution('DEBUG', 'Info', 'Update item options on transaction/lineid: ' + transactionId + '/' + lineId);\n nlapiSubmitRecord(transaction);\n }\n }\n \n nlapiLogExecution('DEBUG', 'updateTransaction', 'Exit Successfully');\n}", "async addSale() {\n\t\t\tif(this.addedName == ''){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis.calcCommission();\n\t\t\tthis.oldDate = this.addedDate;\n\t\t\ttry {\n\t\t\t\tlet r1 = await axios.post(\"/api/sales\",{\n\t\t\t\t\tname: this.addedName,\n\t\t\t\t\tdate: this.addedDate,\n\t\t\t\t\tcontractValue: this.totalContractValue,\n\t\t\t\t\tcommission: this.commission,\n\t\t\t\t\tpaid: false,\n\t\t\t\t});\n\t\t\t\t//call functions that incriment local variables. \n\t\t\t\tthis.salescount += 1;\n\t\t\t\tthis.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\tthis.clearValues();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "function onSaveSale() {\n var recieved_amount = $('input#recieved').val();\n var recieveable_amount = $('input#payable').val();\n var pntType = $('#payment_type').val();\n var transCode = $('#transCode').val();\n var custId = $('#select_customer').val();\n var tax = $('input.tax_value').val();\n \n $.ajax({\n type: \"POST\",\n url: \"sale\",\n dataType: \"json\",\n // data: {'_token': $('input[name=_token]').val()},\n data: {'custID': custId, 'payment': pntType, 'recieved': recieved_amount, 'recieveable': recieveable_amount, 'transCode': transCode, 'tax': tax, '_token': $('input[name=_token]').val() },\n success: function (response) {\n $('#inv_message').css('display', 'block');\n $('#inv_message').attr('style', response.style);\n $('#inv_message').html(response.sale_msg);\n $('#inv_message').fadeOut(4000);\n // $('#sale_section').load(' #sale_section');\n setTimeout(function () { location.reload(); }, 5000);\n },\n error: function (error) { \n console.log(error);\n }\n });\n \n }", "function editSpartan(id, updated){\n // console.log(updated);\n var token = localStorage.getItem(\"token\") || \"\";\n var url = \"/api/spartan/\" + id;\n console.log(url);\n axios.request({\n method: \"PUT\",\n url: url,\n data: {\n update: updated\n },\n headers: {'token' : token}\n }).then(function(res){\n _spartan = res.data;\n ProfileStore.emit(MainConstant.PROFILE.UPDATE);\n console.log(res);\n }).catch(function(err){\n console.log(err);\n //browserHistory.push(\"/login\");\n });\n}", "async editMedicineData(\r\n name,\r\n medical_type,\r\n buy_price,\r\n sell_price,\r\n c_gst,\r\n s_gst,\r\n batch,\r\n shelf_no,\r\n expire_date,\r\n mfg_date,\r\n company_id,\r\n description,\r\n in_stock_total,\r\n qty_in_strip,\r\n medicinedetails,\r\n id\r\n ) {\r\n await this.checkLogin();\r\n var response = await axios.put(\r\n Config.medicineApiUrl + \"\" + id + \"/\",\r\n {\r\n name: name,\r\n medical_type: medical_type,\r\n buy_price: buy_price,\r\n sell_price: sell_price,\r\n c_gst: c_gst,\r\n s_gst: s_gst,\r\n batch: batch,\r\n shelf_no: shelf_no,\r\n expire_date: expire_date,\r\n mfg_date: mfg_date,\r\n company_id: company_id,\r\n description: description,\r\n in_stock_total: in_stock_total,\r\n qty_in_strip: qty_in_strip,\r\n medicine_details: medicinedetails,\r\n },\r\n {\r\n headers: { Authorization: \"Bearer \" + AuthHandler.getLoginToken() },\r\n }\r\n );\r\n return response;\r\n }", "function editJournal(journalID, amount)\r\n{\r\n\tvar journalDesc = '';\r\n\tvar journalRecord = null;\r\n\tvar noOfJournalLines = 0;\r\n\tvar totalValue = 0;\r\n\tvar submittedJournal = 0;\r\n\t\r\n\ttry\r\n\t{\r\n\t\t//convert everything to a float as we are dealing with currency\r\n\t\ttotalValue = parseFloat(amount);\r\n\t\tdebitingAccount = parseFloat(deferredRevenueAccountIntID);\r\n\t\tcreditingAccount = parseFloat(ItemRevenueAccountIntID);\r\n\r\n\t\t//loading the journal record\r\n\t\tjournalRecord = nlapiLoadRecord('journalentry', journalID);\r\n\r\n\t\t//getting the count of line items in the journal record\r\n\t\tnoOfJournalLines = journalRecord.getLineItemCount('line');\r\n\r\n\t\tfor(var index = noOfJournalLines; index >= 1; index--)\r\n\t\t{\r\n\t\t\tjournalRecord.selectLineItem('line', index);\t\t//selecting the line item\r\n\t\t\tjournalRecord.removeLineItem('line', index);\t\t//removing the line item\r\n\t\t}\r\n\r\n\t\t//calling the setJournalLineItems function\r\n\t\tjournalDesc = 'Item revenue account to deferred revenue account transfer for fulfilment: ' + fulfilmentID;\r\n\t\tsetJournalLineItems(journalDesc,journalRecord,totalValue, creditingAccount, debitingAccount, departmentIntID, locationIntID, customerIntID);\r\n\r\n\t\t//saving the changes in the journal by submitting the journal\r\n\t\tsubmittedJournal = nlapiSubmitRecord(journalRecord,true);\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler('editJournal', e);\r\n\t}\r\n\r\n}", "updateCoffeeLot(coffeeLotId, coffeeLot) {\r\n \r\n }", "function saleToggle(event) {\n // console.log(event);\n if (event.target.name === 'sale') {\n currentInventory.beers[event.target.id].toggleSale();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "function update(){\r\nCustomer.updateMany({dni:\"32111114-D\"},{note:\"nanai\"}, (err, ret) =>{\r\n\t\r\n\tif(err) {\r\n\t\tconsole.error(err);\r\n\t\t\r\n\t} else {\r\n\t\tconsole.log(\"Los dueños que coinciden con el criterio de busqueda han sido actualizados: \", ret);\r\n\t\tconsole.log(\"Todo correcto!!\");\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n});\r\n\r\n}", "function updateData(info) {\r\n try {\r\n nlapiSubmitField('workorder', info.id, info.field, info.value);\r\n } catch (e) {\r\n nlapiLogExecution('ERROR', 'Error during main updateDate', e.toString());\r\n }\r\n}", "function SyncSoCashSale(type) {\n\tnlapiLogExecution('DEBUG', 'type', type);\n\ttry {\n\t\tif (type != 'delete') {\n\t\t\tvar SO = nlapiGetFieldText('createdfrom');\n\t\t\tif ((SO != null)&&(SO != '')&&(SO.search('Sales Order')!= -1)) {\n\t\t\t\tvar string1 = '{ '; //Creating the body with data as requested by CLoudhub to Update SO in SFDC.\n\n\t\t\t\tvar action = '';\n\n\t\t\t\taction = '\"' + \"update\" + '\"';\n\n\t\t\t\tstring1 = string1 + '\"operationType\" : ' + action;\n\n\t\t\t\tvar header = new Array();\n\t\t\t\theader['Authorization'] = authorizationHeader;\n\t\t\t\theader['Accept'] = 'application/json';\n\t\t\t\theader['Content-Type'] = 'application/json';\n\t\t\t\tvar nssoid = nlapiGetFieldValue('createdfrom');\n\t\t\t\tvar r = nlapiLoadRecord('salesorder', nssoid);\n\t\t\t\tif ((r.getFieldValue('custbody_celigo_ns_sfdc_sync_id') != null) && (r.getFieldValue('custbody_celigo_ns_sfdc_sync_id') != '')) {\n\t\t\t\t\tvar actualShipDate = r.getFieldValue('actualshipdate');\n\t\t\t\t\tif ((actualShipDate == null) || (actualShipDate == '')) {\n\t\t\t\t\t\tactualShipDate = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tactualShipDate = '\"' + actualShipDate + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"actualShipDate\" : ' + actualShipDate;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'actualShipDate', actualShipDate);\n\t\t\t\t\tvar currency = r.getFieldValue('currencyname');\n\t\t\t\t\tif ((currency == null) || (currency == '')) {\n\t\t\t\t\t\tcurrency = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcurrency = '\"' + currency + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"currency\" : ' + currency;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'currency', currency);\n\t\t\t\t\t\n\t\t\t\t\t//Modified for CPQ, if CreatedFrom(QuoteId) is blank on sales order then get the FPX ID field to push along with other field values to SFDC : Begin\n\t\t\t\t\tvar createdfrom = '';\n\t\t\t\t\tvar createdquote = r.getFieldText('createdfrom');\n\t\t\t\t\tvar fpxId = r.getFieldValue('custbody_spk_fpx_id');\n\t\t\t\t\tif (((createdquote == null) || (createdquote == '')) && ((fpxId == null) || (fpxId == ''))) {\n\t\t\t\t\t\tcreatedfrom = '\"\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"createdFrom\" : ' + createdfrom;\n\t\t\t\t\t}\n\t\t\t\t\telse if(createdquote) {\n\t\t\t\t\t\tif(createdquote.search('#')>-1) {\n\t\t\t\t\t\t\tcreatedfrom = '\"' + createdquote.split('#')[1] + '\"';\n\t\t\t\t\t\t\tstring1 = string1 + ',\"createdFrom\" : ' + createdfrom;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnlapiLogExecution('DEBUG', 'createdfrom', createdquote.split('#')[1]);\n\t\t\t\t\t}\n\t\t\t\t\telse if(fpxId) {\n\t\t\t\t\t\tfpxId = '\"' + fpxId + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"createdFrom\" : ' + fpxId;\n\t\t\t\t\t\tnlapiLogExecution('DEBUG', 'fpxId', fpxId);\n\t\t\t\t\t}\n\n\t\t\t\t\t//End\n\t\t\t\t\tvar sfdcOpportunityId = r.getFieldValue('custbody_celigo_ns_sfdc_sync_id');\n\t\t\t\t\tif ((sfdcOpportunityId == null) || (sfdcOpportunityId == '')) {\n\t\t\t\t\t\tsfdcOpportunityId = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsfdcOpportunityId = '\"' + sfdcOpportunityId + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"sfdcOpportunityId\" : ' + sfdcOpportunityId;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'sfdcOpportunityId', sfdcOpportunityId);\n\t\t\t\t\tvar sfdcAccountId = r.getFieldValue('custbody_sfdc_id');\n\t\t\t\t\tif ((sfdcAccountId == null) || (sfdcAccountId == '')) {\n\t\t\t\t\t\tsfdcAccountId = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsfdcAccountId = '\"' + sfdcAccountId + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"sfdcAccountId\" : ' + sfdcAccountId;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'sfdcAccountId', sfdcAccountId);\n\t\t\t\t\tvar discountTotal = r.getFieldValue('discounttotal');\n\t\t\t\t\tif ((discountTotal == null) || (discountTotal == '')) {\n\t\t\t\t\t\tdiscountTotal = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdiscountTotal = '\"' + discountTotal + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"discountTotal\" : ' + discountTotal;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'discountTotal', discountTotal);\n\t\t\t\t\tvar endDate = r.getFieldValue('enddate');\n\t\t\t\t\tif ((endDate == null) || (endDate == '')) {\n\t\t\t\t\t\tendDate = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tendDate = '\"' + endDate + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"endDate\" : ' + endDate;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'endDate', endDate);\n\t\t\t\t\tvar memo = r.getFieldValue('memo');\n\t\t\t\t\tif ((memo == null) || (memo == '')) {\n\t\t\t\t\t\tmemo = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t\t\tmemo = escapeXML(memo);//Added by Rahul Shaw to escape special characters.DFCT0050651\n\t\t\t\t\t\tmemo = '\"' + memo + '\"';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tstring1 = string1 + ',\"memo\" : ' + memo;\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'memo', memo);\n\t\t\t\t\tvar netSuiteId = nssoid;\n\t\t\t\t\tif ((netSuiteId == null) || (netSuiteId == '')) {\n\t\t\t\t\t\tnetSuiteId = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnetSuiteId = '\"' + netSuiteId + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"netSuiteId\" : ' + netSuiteId;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'netSuiteId', netSuiteId);\n\t\t\t\t\tvar shipDate = r.getFieldValue('shipdate');\n\t\t\t\t\tif ((shipDate == null) || (shipDate == '')) {\n\t\t\t\t\t\tshipDate = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tshipDate = '\"' + shipDate + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"shipDate\" : ' + shipDate;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'shipDate', shipDate);\n\t\t\t\t\tvar shippingCost = r.getFieldValue('shippingcost');\n\t\t\t\t\tif ((shippingCost == null) || (shippingCost == '')) {\n\t\t\t\t\t\tshippingCost = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tshippingCost = '\"' + shippingCost + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"shippingCost\" : ' + shippingCost;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'shippingCost', shippingCost);\n\t\t\t\t\tvar startDate = r.getFieldValue('startdate');\n\t\t\t\t\tif ((startDate == null) || (startDate == '')) {\n\t\t\t\t\t\tstartDate = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstartDate = '\"' + startDate + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"startDate\" : ' + startDate;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'startDate', startDate);\n\t\t\t\t\tvar status = r.getFieldText('orderstatus');\n\t\t\t\t\tif ((status == null) || (status == '')) {\n\t\t\t\t\t\t status = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t status = '\"' + status + '\"';\n\t\t\t\t\t string1 = string1 + ',\"status\" : ' + status;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'status', status);\n\t\t\t\t\tvar subTotal = r.getFieldValue('subtotal');\n\t\t\t\t\tif ((subTotal == null) || (subTotal == '')) {\n\n\t\t\t\t\t\tsubTotal = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsubTotal = '\"' + subTotal + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"subTotal\" : ' + subTotal;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'subTotal', subTotal);\n\t\t\t\t\tvar taxTotal = r.getFieldValue('taxtotal');\n\t\t\t\t\tif ((taxTotal == null) || (taxTotal == '')) {\n\t\t\t\t\t\ttaxTotal = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttaxTotal = '\"' + taxTotal + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"taxTotal\" : ' + taxTotal;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'taxTotal', taxTotal);\n\t\t\t\t\tvar terms = r.getFieldValue('custbody_tran_term_in_months');\n\t\t\t\t\tif ((terms == null) || (terms == '')) {\n\t\t\t\t\t\tterms = 0;\n\t\t\t\t\t\tstring1 = string1 + ',\"termInMonths\" : ' + terms;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstring1 = string1 + ',\"termInMonths\" : ' + parseInt(terms);\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'terms', terms);\n\t\t\t\t\tvar total = r.getFieldValue('total');\n\t\t\t\t\tif ((total == null) || (total == '')) {\n\t\t\t\t\t\ttotal = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttotal = '\"' + total + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"total\" : ' + total;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'total', total);\n\t\t\t\t\tvar linkedTrackingNumbers = r.getFieldValue('linkedtrackingnumbers');\n\t\t\t\t\tif ((linkedTrackingNumbers == null) || (linkedTrackingNumbers == '')) {\n\t\t\t\t\t\tlinkedTrackingNumbers = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlinkedTrackingNumbers = '\"' + linkedTrackingNumbers + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"trackingNumbers\" : ' + linkedTrackingNumbers;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'linkedTrackingNumbers', linkedTrackingNumbers);\n\t\t\t\t\tvar tranDate = r.getFieldValue('trandate');\n\t\t\t\t\tif ((tranDate == null) || (tranDate == '')) {\n\t\t\t\t\t\ttranDate = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttranDate = '\"' + tranDate + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"tranDate\" : ' + tranDate;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'tranDate', tranDate);\n\t\t\t\t\tvar tranId = r.getFieldValue('tranid');\n\t\t\t\t\tif ((tranId == null) || (tranId == '')) {\n\t\t\t\t\t\ttranId = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttranId = '\"' + tranId + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"transactionId\" : ' + tranId;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'tranId', tranId);\n\t\t\t\t\t//Modified for JIRA CPQ-309, if PO# on Sales order has value the push along with other field values to Cloudhub for updating salesorder values in SFDC : Begin\n\t\t\t\t\tvar poNumber = r.getFieldValue('otherrefnum');\n\t\t\t\t\tif ((poNumber == null) || (poNumber == '')) \n\t\t\t\t\t{\n\t\t\t\t\t\tpoNumber = '\"\"';\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tpoNumber = '\"' + poNumber + '\"';\n\t\t\t\t\t\tstring1 = string1 + ',\"poNumber\" : ' + poNumber;\n\t\t\t\t\t}\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'poNumber', poNumber);\n\t\t\t\t\t//End\n\t\t\t\t\tstring1 = string1 + '}';\n\t\t\t\t\ttry{\n\t\t\t\t\t\tvar y = nlapiRequestURL(url, string1, header);\n\t\t\t\t\t\tnlapiLogExecution('DEBUG', 'URL Details', y.getBody() +'::::'+ y.getCode());\n\t\t\t\t\t\tif(parseInt(y.getCode())!= 200) //If the creation/update is not successful then populate error in custom fields in NetSuite.\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar fields = new Array();\n\t\t\t\t\t\t\tvar values = new Array();\n\t\t\t\t\t\t\tfields[0] = 'custbody_spk_cloudhuberror';\n\t\t\t\t\t\t\tfields[1] = 'custbody_spk_cloudhuberrortxt';\n\t\t\t\t\t\t\tvalues[0] = 'T';\n\t\t\t\t\t\t\tvalues[1] = y.getBody().toString();\n\t\t\t\t\t\t\tnlapiSubmitField('salesorder',nssoid,fields,values);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar fields = new Array();\n\t\t\t\t\t\t\tvar values = new Array();\n\t\t\t\t\t\t\tfields[0] = 'custbody_spk_cloudhuberror';\n\t\t\t\t\t\t\tfields[1] = 'custbody_spk_cloudhuberrortxt';\n\t\t\t\t\t\t\tvalues[0] = 'F';\n\t\t\t\t\t\t\tvalues[1] = '';\n\t\t\t\t\t\t\tnlapiSubmitField('salesorder',nssoid,fields,values);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\tvar fields = new Array();\n\t\t\t\t\t\tvar values = new Array();\n\t\t\t\t\t\tfields[0] = 'custbody_spk_cloudhuberror';\n\t\t\t\t\t\tfields[1] = 'custbody_spk_cloudhuberrortxt';\n\t\t\t\t\t\tvalues[0] = 'T';\n\t\t\t\t\t\tvalues[1] = e.toString();\n\t\t\t\t\t\tnlapiSubmitField('salesorder',nssoid,fields,values);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tcatch(e) {\n\t\tnlapiLogExecution('DEBUG', 'Error', e.toString());\n\t\tvar estring = '';\n\t\tif ( e instanceof nlobjError ) {\n\t\t\testring = 'system error '+ e.getCode() + '\\n' + e.getDetails();\n\t\t}\n\t\telse {\n\t\t\testring = 'unexpected error '+ e.toString();\n\t\t}\n\t\tvar fields = new Array();\n\t\tvar values = new Array();\n\t\tfields[0] = 'custbody_spk_cloudhuberror';\n\t\tfields[1] = 'custbody_spk_cloudhuberrortxt';\n\t\tvalues[0] = 'T';\n\t\tvalues[1] = estring;\n\t\tnlapiSubmitField('cashsale',nlapiGetRecordId(),fields,values);\n\t}\n}", "async function updateProduct({sku, VariantID, ...metaContent}) {\n\tconst spfMeta = {};\n\tconst dbMeta = {};\n\n\tif (Object.prototype.hasOwnProperty.call(metaContent, \"old_inventoryQty\") && Object.prototype.hasOwnProperty.call(metaContent, \"new_inventoryQty\")) {\n\t\tif (Number(metaContent.old_inventoryQty) !== Number(metaContent.new_inventoryQty)) {\n\t\t\tconst newVal = metaContent.new_inventoryQty;\n\t\t\tspfMeta[\"inventory_quantity\"] = newVal;\n\t\t\tdbMeta[\"inventoryQty\"] = newVal;\n \t}\n }\n\n\tif (Object.prototype.hasOwnProperty.call(metaContent, \"old_price\") && Object.prototype.hasOwnProperty.call(metaContent, \"new_price\")) {\n\t\tif (Number(metaContent.old_price) !== Number(metaContent.new_price)) {\n\t\t\tconst newVal = metaContent.new_price;\n\t\t\tspfMeta[\"price\"] = newVal;\n\t\t\tdbMeta[\"price\"] = newVal;\n\t\t}\n }\n\n\tif (Object.prototype.hasOwnProperty.call(metaContent, \"old_msrpPrice\") && Object.prototype.hasOwnProperty.call(metaContent, \"new_msrpPrice\")) {\n\t\tif (Number(metaContent.old_msrpPrice) !== Number(metaContent.new_msrpPrice)) {\n\t\t\tconst newVal = metaContent.new_msrpPrice;\n\t\t\tspfMeta[\"compare_at_price\"] = newVal;\n\t\t\tdbMeta[\"msrpPrice\"] = newVal;\n\t\t}\n\t}\n\n\tif (!Object.keys(spfMeta).length) {\n\t\treturn { success: null }\n\t};\n\n\t// define seqeulize transaction\n\tconst transaction = await Model.sequelize.transaction();\n\n\ttry {\n\t\t// update to database\n\t\tconst updated_db = await Model.Inventory.update(dbMeta, {\n\t\t\twhere: { VariantID },\n\t\t\ttransaction\n\t\t}).then(res => res[0]);\n\n\t\tif (updated_db) {\n\t\t\t// calling api to update shopify inventory item\n\t\t\tconst updated_spf = await shopifyApi.productVariant.update(VariantID, spfMeta);\n\t\t\tif (updated_spf.id === VariantID) {\n\t\t\t\tawait transaction.commit();\n\t\t\t\treturn { success: true }\n\t\t\t} \n\t\t\tthrow new Error(\"Error on updating shopify\");\n\t\t\t// await transaction.commit();\n\t\t\t// return { success: true }\n\t\t} else {\n\t\t\tthrow new Error(\"Error on updating database\")\n\t\t}\n\t} catch (err) {\n\t\tawait transaction.rollback();\n\t\t\n\t}\n}", "update() {\n let id = $(\"#rid\").val();\n let des = $(\"#rdescription\").val();\n let price = $(\"#rprice\").val();\n let rooms = $(\"#rrooms\").val();\n let mail = $(\"#rmail\").val();\n let name = $(\"#rname\").val();\n let pho = $(\"#rphoneNr\").val();\n let re = new Rent(id, des,price, rooms, mail, name, pho);\n reReg.update(re);\n $(\"#editDeleteModal\").modal('hide');\n }", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function getSaleLinesData(shopObj, endPoint, clear){\n var objSheet = shopObj.saleLineSheetName;\n var ssID = shopObj.ID;\nlogSales(\"Shop Object\",shopObj.saleLineSheetName)\nvar ss = SpreadsheetApp.openById(ssID);\n var sheet = ss.getSheetByName(objSheet);\n sheet.activate();\n var saleOffset = getCurrentSaleLineID(sheet,ssID); \n if(UIONOFF){ ss.toast(\"Sale Line Off set ID =\"+saleOffset);}\n var headerRows = 1;\n var offset = 0;\n // == -- Specify the type of call needed -- == \\\\ \n var type = \"GET\";\n // == -- Build the URL with any offsets -- == \\\\\n var url = shopObj.saleLine;\n // == -- adjust process for updating info or replacing info -- == \\\\ \n if(!clear && saleOffset){ \n // logSales(\"sales object\",shopObj);\n url = url+\"&saleLineID=%3E,\"+saleOffset;\n// logSales(\"log Url\",url);\n updateSaleID(shopObj.name,saleOffset)\n } else {\n clearSheet(headerRows, sheet);\n saleOffset = 0;\n }\n \n// logSales(\"url\",url);\n // == -- Initiate the OAuth / Api Call with the given variables -- == \\\\ \n var data = getData(offset,url,endPoint,type);\n if(data.length>=0 ){\n for(var i = 0; i<data.length; i++){\n var row = data[i];\n// logSales(\"Data Row\",row);\n getNames(row);\n// fixItems(row);\n fixDates(row);\n }}\n // == -- Make the call to insert the rows needed for the new data and insert the data -- == \\\\ \n insertData(sheet,data);\n}", "function updateDetails() {\n $.getJSON(window.location + 'details', {\n dag: _store.dag,\n id: _store.id\n }, function (data) {\n if (data.length > 0) {\n _store.owner = data[0].owner;\n }\n DetailViewStore.emit(DETAILS_UPDATE_EVENT);\n });\n}", "update(docID, { name, location, should_have, quantity, expiration }) {\n const updateData = {};\n if (name) {\n updateData.name = name;\n }\n if (location) {\n updateData.location = location;\n }\n if (_.isNumber(should_have)) {\n updateData.should_have = should_have;\n }\n // if (quantity) { NOTE: 0 is falsy so we need to check if the quantity is a number.\n if (_.isNumber(quantity)) {\n updateData.quantity = quantity;\n }\n if (expiration) {\n updateData.expiration = expiration;\n }\n this._collection.update(docID, { $set: updateData });\n }", "async function updateAsync(itemsold, itembought, earning, spending, tendered, duedate, accounttype, account, addToTransaction) {\n itemsold = isNaN(Number(itemsold)) ? null : Number(itemsold);\n itembought = isNaN(Number(itembought)) ? null : Number(itembought);\n earning = isNaN(Number(earning)) ? null : Number(earning);\n spending = isNaN(Number(spending)) ? null : Number(spending);\n\n var today = new Date();\n var data = await mdb.SaleData.findOne({ where: { days: today } });\n var upData;\n if (data) {\n var updateData = {};\n if (itemsold) updateData['itemsold'] = Sequelize.literal('itemsold + ' + itemsold);\n if (itembought) updateData['itembought'] = Sequelize.literal('itembought + ' + itembought);\n if (earning) updateData['earning'] = Sequelize.literal('earning + ' + earning);\n if (spending) updateData['spending'] = Sequelize.literal('spending + ' + spending);\n upData = await mdb.SaleData.update(updateData, { where: { days: today } });\n } else {\n var createData = { days: today };\n createData['itemsold'] = (itemsold ? itemsold : 0);\n createData['itembought'] = (itembought ? itembought : 0);\n createData['earning'] = (earning ? earning : 0);\n createData['spending'] = (spending ? spending : 0);\n upData = await mdb.SaleData.create(createData);\n }\n if (earning && addToTransaction) {\n var tData = await transactionAdd(account, accounttype, 'income', 'short term', earning, tendered, duedate, 'income from ' + account);\n if (Math.abs(Number(earning)) > Math.abs(Number(tendered))) await transactionAdd(account, accounttype, 'asset', 'short term', Number(earning) - Number(tendered), Number(earning) - Number(tendered), null, 'income from ' + account);\n } else if (spending && addToTransaction) {\n var tData = await transactionAdd(account, accounttype, 'expense', 'short term', spending, tendered, duedate, 'expense for ' + account);\n if (Math.abs(Number(spending)) > Math.abs(Number(tendered))) await transactionAdd(account, accounttype, 'liability', 'short term', Number(spending) - Number(tendered), Number(spending) - Number(tendered), duedate, 'expense for ' + account);\n }\n return upData;\n}", "update(id) {\n let convert = moment(this.state.newDate).format(\"DD-MM-YYYY\") // by default was MM-DD-YYYY\n\n let data = {\n customerID: this.state.selectUCustomer[0].key,\n productID: this.state.selectUProduct[0].key,\n storeID: this.state.selectUStore[0].key,\n dateSold: convert,\n id: id\n };\n\n $.ajax({\n url: '/Sales/UpdateSaleRecord',\n dataType: 'json',\n type: 'post',\n contentType: 'application/json',\n data: JSON.stringify(data)\n }).done((data) => {\n console.log(data);\n this.setState({\n serviceList: data\n });\n });\n window.location.reload();\n }", "function updateProduct(name, price, id){\r\n var index = getIndexById(id);\r\n shop.products[index].name = name;\r\n shop.products[index].price = price;\r\n\r\n dialogNameField.value = '';\r\n dialogPriceField.value = '';\r\n\r\n addProductBtn.value = '';\r\n updateProductList(); \r\n dialog.close();\r\n }", "function updateProduct(name, x, y) {\n var newAmt = x +y;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newAmt\n },\n {\n product_name: name\n }\n ],\n function (err, res) {\n console.log(res.affectedRows + \" product(s) updated!\\n\");\n console.log(\"Order Completed for \"+y+\" \"+name+\"(s)\");\n\n mainMenu();\n }\n );\n\n}", "async updateOrder(id, invoice_no, po_no, order_items, ordered_by, status, updated_by) {\n const order = await OrderModel.findByIdAndUpdate(id, {\n invoice_no: invoice_no,\n po_no: po_no,\n order_items: this.consolidate(order_items),\n ordered_by: ordered_by,\n status: status,\n updated_by: updated_by,\n updated: Date.now()\n },\n {new: true});\n\n return order;\n }", "function changeStatus (saleId){\r\n\tg_saleId = saleId;\r\n\tvar $form = $('#changeStatusForm');\r\n\t$form.find('#saleId' ).val(saleId);\r\n\t$('#modalChangeStatus').modal('show');\r\n}", "populateSale(sale) {\n $.each(sale, (key, sala) => {\n $(\".saleTbody\").append('<tr class= \"saleTr\"><td class=\"nomeSala\">' + sala.Nome + '</td><td class=\"nomeEdificio\">' + sala.NomeEdificio + '</td><td class=\"stato\">' + sala.Stato + '</td></tr>');\n $(\".saleTbody\").append('<tr><td class=\"numeroPostiDisponibili\" colspan=\"3\"><h6> Numero posti disponibili: </h6>' + sala.NumeroPostiDisponibili + '</td></tr>');\n });\n $('.saleTr').click(function () {\n $(this).nextUntil('.saleTr').toggleClass('hide');\n }).click();\n }", "function convertToSale(itemID) {\n $('#AllOpps').hide();\n $('#OppDetails').hide();\n clearEditOppForm();\n\n currentItem.set_item(\"_Status\", \"Sale\");\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditOppForm();\n showSales();\n }\n ,\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n}", "function updateSalesAuditChanged(grid,row,index,type,subtype) {\n console.log(\"updateSalesAuditChanged \",row)\n }", "update(objUpdate) {\n if(!objUpdate.id) return new Error('item missing id property');\n if(this.warehouse[objUpdate.id]) {\n this.warehouse[objUpdate.id] = Object.assign({}, objUpdate);\n return objUpdate;\n }\n else {\n return new Error('id not found');\n }\n }", "async update({ request, response, auth }) {\n try {\n let body = request.only(fillable)\n const id = request.params.id\n\n const data = await DownPayment.find(id)\n if (!data || data.length === 0) {\n return response.status(400).send(ResponseParser.apiNotFound())\n }\n /*\n As per client desicion no need to verify / send sms after verified\n const { is_verified } = request.post()\n if (is_verified && !data.verified_at) {\n const user = await auth.getUser()\n body.verified_by = user.id\n body.verified_at = new Date()\n // Send SMS\n const smsMessage = `No kwitansi: ${\n data.transaction_no\n } pelunasan 1 paket m3 dari ${\n data.name.trim().split(\" \")[0]\n } telah kami terima. Selamat Belajar (Admin Yapindo).`\n TwilioApi(data.phone, smsMessage)\n }\n */\n await data.merge(body)\n await data.save()\n const activity = `Update DownPayment '${data.transaction_no}'`\n await ActivityTraits.saveActivity(request, auth, activity)\n\n await RedisHelper.delete(\"DownPayment_*\")\n await data.load(\"target\")\n let parsed = ResponseParser.apiUpdated(data.toJSON())\n return response.status(200).send(parsed)\n } catch (e) {\n ErrorLog(request, e)\n return response.status(500).send(ResponseParser.unknownError())\n }\n }", "function check_edit_sales_fields()\n{\n var checking_status = true;\n reset_fields();\n check_name(\"sale_customer_name\") ? \"\" : checking_status = false;\n check_sales_address() ? \"\" : checking_status = false;\n sales_rate_quantity1() ? \"\" : checking_status = false;\n check_paid_amount(\"payments_paid_amount\") ? \"\" : checking_status = false; \nif(!checking_status)\n {\n error_message();\n }\n else{\n disabled_elements = $(\"sale_total_amount\");\n disabled_elements.disabled = false;\n for(i=1; i<= sales_add_row.counter; i++)\n {\n obj_quantity=$(\"product_quantity_\"+i);\n obj_quantity.disabled = false;\n obj_description=$(\"description_\"+i);\n obj_description.disabled = false;\n obj_serial = $(\"serial_number_\"+i);\n obj_serial.disabled = false;\n }\n }\nreturn checking_status;\n}", "updateInvoiceAPI () {\n if (!this.props.invoiceToEdit) {\n return;\n }\n updateInvoice({\n invoice_id: this.state.invoiceId,\n customer_id: this.state.customerId,\n total: this.state.total,\n discount: this.state.discount,\n }, ()=>{})\n }", "function updateTotalProfit(dept, totalProfit, newOHC) {\n\n connection.query(\"UPDATE departments SET ?,? WHERE ?\",\n [\n { over_head_cost: newOHC },\n { total_profit: totalProfit },\n { department_name: dept }\n ], function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" The total profit for \" + dept + \" has been updated in the Departments Table to: \" + totalProfit + \" !\\n\");\n })\n connection.end()\n}", "updateItemDetails(itemDetails) {\n const {\n consumerID,\n distributorID,\n itemSKU,\n itemState,\n itemUPC,\n originFarmInformation,\n originFarmLatitude,\n originFarmLongitude,\n originFarmName,\n originFarmerID,\n ownerID,\n productID,\n productNotes,\n productPrice,\n farmerDocumentID,\n } = itemDetails;\n\n farmerDocumentID !== \"\" &&\n this.jquery(\"#uploadedDocuments\").html(\n `<a href=\"https://gateway.pinata.cloud/ipfs/${farmerDocumentID}\">See farmer document</a>`\n );\n this.jquery(\"#productDetailsLabel\").html(`Product ${itemUPC}`);\n this.jquery(\"#productCurrentOwner\").val(ownerID);\n this.jquery(\"#productItemCode\").val(`${itemSKU}`);\n this.jquery(\"#productFarmerId\").val(originFarmerID);\n this.jquery(\"#productFarmName\").val(originFarmName);\n this.jquery(\"#productLatitude\").val(originFarmLatitude);\n this.jquery(\"#productLongitude\").val(originFarmLongitude);\n this.jquery(\"#productState\").val(parseInt(itemState));\n }", "function update(req, res, next) {\n\n TicketModel.findById(req.params.id, function (err, ticket) {\n\n if (err) { return next(err); }\n if (ticket) {\n\n // TODO create mongoose plugin to handle multiple fields\n ticket.state = req.body.state;\n ticket.status = req.body.status;\n ticket.urgency = req.body.urgency;\n ticket.type = req.body.type;\n ticket.title = req.body.title;\n ticket.description = req.body.description;\n\n ticket.save(function (err) {\n\n if (err) { return next(err); }\n res.send(ticket);\n });\n\n } else {\n\n return next({type: 'retrieval', status: 404, message: 'not found'});\n }\n });\n }", "function update_form_data(res) {\n $(\"#customer_id\").val(res.customer_id);\n $(\"#product_id\").val(res.product_id);\n $(\"#text\").val(res.text);\n $(\"#quantity\").val(res.quantity);\n $(\"#price\").val(res.price);\n }", "static async updatesStoredSerialNumberById(id, objBody){\n const serialNum = await Seriall.updateSerialNumberById(id, objBody);\n return serialNum;\n }", "handleSave(event) {\n // notify loading\n this.notifyLoading(true);\n const updatedFields = event.detail.draftValues;\n // Update the records via Apex\n updateBoatList({data: updatedFields})\n .then((resultado) => {\n const toastEvent = new ShowToastEvent({\n title: SUCCESS_TITLE,\n message: MESSAGE_SHIP_IT,\n variant: SUCCESS_VARIANT\n });\n this.dispatchEvent(toastEvent);\n this.refresh();\n })\n .catch(error => {\n const toastEvent = new ShowToastEvent({\n title: ERROR_TITLE,\n variant: ERROR_VARIANT\n });\n this.dispatchEvent(toastEvent);\n })\n .finally(() => {});\n }", "function editProduct(id) {\r\n addProductBtn.value = id;\r\n var index = getIndexById(id);\r\n dialogNameField.value = shop.products[index].name ;\r\n dialogPriceField.value = shop.products[index].price;\r\n\r\n dialog.showModal(); \r\n var event = new Event(\"input\");\r\n dialogPriceField.dispatchEvent(event);\r\n dialogNameField.dispatchEvent(event);\r\n }", "function updateInvoice() {\n var total = 0, cells, price, i;\n $(\"#item-details tr\").each( function(index, element) {\n cells = $(element).children().toArray();\n price = parseFloat($(cells[1]).text()) * parseFloat($(cells[2]).text());\n total += price;\n if (!isNaN(price)) {\n $(cells[3]).text(price);\n } else {\n $(cells[3]).text(0);\n }\n });\n if (!isNaN(total)) {\n $(\"#total-price\").text(total);\n }\n }", "_updateCurrencyDetails(data) {\n if (hasCurrencyDetailsData(data)) {\n this._addKeyToData(\"CurrencyDetails\");\n\n // Check if the new currency details data is different from the saved one, if yes, overwrite\n if (!isSameObject(this.data.CurrencyDetails, data.currencyDetails)) {\n this.data.CurrencyDetails = data.currencyDetails;\n }\n }\n }", "function storeDetailsInDb(obj) {\n db.customers.update({phoneNumber:obj.phoneNumber}, {$set: { name : obj.firstName+\" \"+obj.lastName,email:obj.email,phoneNumber:obj.phoneNumber,currentCity:obj.currentCity,prefferdJobLocation:obj.jobLocation }}, {upsert: true}, function (err) {\n // the update is complete\n if(err) throw err\n console.log(\"inside update\")\n })\n}", "async editEmployeeData(name, joining_date, phone, address, id) {\r\n await this.checkLogin();\r\n var response = await axios.put(\r\n Config.employeeApiUrl + \"\" + id + \"/\",\r\n {\r\n name: name,\r\n joining_date: joining_date,\r\n phone: phone,\r\n address: address,\r\n },\r\n {\r\n headers: { Authorization: \"Bearer \" + AuthHandler.getLoginToken() },\r\n }\r\n );\r\n return response;\r\n }", "update(restaurant) {\n let sqlRequest = \"UPDATE restaurants SET \" +\n \"name=$name, \" +\n \"description=$description \" +\n \"WHERE id=$id\";\n\n let sqlParams = {\n $name: restaurant.name,\n $description: restaurant.description,\n $id: restaurant.id\n };\n return this.common.run(sqlRequest, sqlParams).then(row => {\n return this.findById(restaurant.id);\n });\n }", "function editEvent(n,name,onlyAdults,price) {\n if(Events.length>=n) {\n if(name==undefined) {\n console.log(\"Name of the event is required.\");\n }\n else{\n Events[n].name=name;\n Events[n].onlyAdults=onlyAdults; \n Events[n].price=price;\n\n //if price not set, make it free(set price to 0)\n if (price==undefined) price=0;\n \n console.log(\"Changes applied successfully.\");\n }\n }\n else {\n console.log(\"No event with id: \"+n+\"is registered.\");\n }\n}", "async function updateOpportunityDetails (req, res) {\n res.send(await service.updateOpportunityDetails(req.authUser, req.params.opportunityId, req.body))\n}", "function update(req, res) {\n let data = [\n req.body.name,\n req.body.qty,\n req.body.amount,\n req.params.id\n ];\n\n connection.query('UPDATE items SET name = ?, qty = ?, amount = ? WHERE id = ?', data , function(error, results) {\n if (error) {\n res.status(500).send({\n message: `Error occured while updating item with id ${req.params.id}`\n });\n }\n\n apiResult = {\n message: 'Successfully updated',\n data: {\n id: req.params.id,\n name: req.body.name,\n qty: req.body.qty,\n amount: req.body.amount\n }\n };\n\n res.send(apiResult);\n });\n }", "markAsSold(product) {\n const queryString = `UPDATE products\n SET is_sold = TRUE\n WHERE products.id = $1`;\n\n const queryParams = [product.productId];\n\n console.log('markAsSold', queryString, queryParams);\n\n return db\n .query(queryString, queryParams)\n .then(result => result)\n .catch(error => error.message);\n }", "function updateToMonthlySalary(){\n\n}", "function refreshDetail(orderDetail) {\n var id = orderDetail.Product.Id;\n\n var $orderDetail = $('#item-' + id);\n var $name = $orderDetail.find('.item-name');\n var $unitPrice = $orderDetail.find('.item-unit-price');\n var $quantity = $orderDetail.find('.item-qty-ct');\n var $extendedPrice = $orderDetail.find('.item-extended-price');\n var $shipping = $orderDetail.find('.item-shipping');\n var $totalPrice = $orderDetail.find('.item-total-price');\n\n $name.text(orderDetail.Product.Name);\n $unitPrice.text('$' + orderDetail.UnitPrice.toFixed(2));\n $quantity.text(orderDetail.Quantity);\n $extendedPrice.text('$' + orderDetail.ExtendedPrice.toFixed(2));\n $shipping.text('$' + orderDetail.Shipping.toFixed(2));\n $totalPrice.text('$' + orderDetail.TotalPrice.toFixed(2));\n}", "function addTax(req, res, obj, id){\n moltin.Order.Update(id, obj, function(order) {\n res.status(200).json(order);\n }, function(error, response, c) {\n res.status(400).json(error);\n console.log(error);\n // Something went wrong...\n });\n\n }", "function setSalesOrder() {\r\n\r\n\t// console.log('setSalesOrder');\r\n\r\n\tif (validateForm() == true) {\r\n\t\tif (validateLength() == true) {\r\n\t\t\t\r\n\t\t\tvar data = saveSalesOrder();\r\n\t\t\tconsole.log(data);\r\n\t\t\t\tif (data == \"\") {\r\n\t\t\t\t\tbootstarpAlert('', 'Error while saving Sales order', true,\r\n\t\t\t\t\t'danger',3000);\r\n\t\t\t\t}\r\n\t\t\t\t// for data saved successfully\r\n\t\t\t\telse {\r\n\t\t\t\t\tbootstarpAlert('', 'Data saved successfully for Sales order Id '+data+' please use save and process button to process order at WMS', true,\r\n\t\t\t\t\t'success',6000);\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}", "function updateOrder(next){\n //function to update the order\n params.paymentdetails.reportdeliverymode = params.updateobj;\n update(params.id,{log:logs, paymentdetails:params.paymentdetails },function(e,r){\n if(e) return next(e)\n\n return next(null);\n }); \n }//end of update order ", "function updateQuantity() {\n\n // Query to update the item's quantity based on the item ID\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n var newQuantityOnHand = quantityOnHand - purchaseQuantity;\n \n connection.query(queryTerms,\n [\n {stock_quantity: newQuantityOnHand},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n }); \n\n // After that update is done, we need to update the total sales column\n updateTotalSales();\n} // End updateQuantity function", "saveModalDetails(restId, item) {\n\n const requestOptions = {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', 'authorization': this.props.token },\n body: JSON.stringify({\n name: item.name,\n longitude: item.longitude,\n latitude: item.latitude,\n description: item.description\n })\n };\n\n fetch(this.props.URL + '/restaurant/' + restId, requestOptions)\n .then(response => response.json())\n .then(data => {\n if (data.response == 'success') {\n toastada.success('You have successfully updated the restaurant details.');\n\n window.location.reload();\n }\n else {\n toastada.error('Failed: ' + data.message)\n }\n });\n }", "update(id, receipt) {\n return 1;\n }", "function updateDetails(email, phone, payment, fname, lname, nickname, bday){\r\n database.ref(\"users/\" + dbKey).update({ \r\n\t email: email,\r\n\t phone: phone,\r\n\t payment: payment,\r\n\t fname : fname,\r\n\t lname : lname,\r\n\t nickname : nickname,\r\n\t bday : bday\r\n\t});\r\n\r\n}", "function updateBook(request, response) {\n\n let id = request.params.book_id;\n\n let {\n title,\n authors,\n description,\n bookshelf\n } = request.body;\n\n let sql = 'UPDATE books SET title=$1, authors=$2, description=$3, bookshelf=$4 WHERE id=$5;';\n\n let safeVals = [title, authors, description, bookshelf, id];\n\n client.query(sql, safeVals)\n .then(sqlResults => {\n // redirect to the detail page with new values\n response.redirect(`/books/${id}`);\n }).catch(err => error(err, response));\n\n}", "updateStudent() {\n\n\t}", "function Editar(){\n const inputIdSalon = document.getElementById(\"idsalon\").value;\n const inputUbicacion = document.getElementById(\"ubicacion\").value;\n const inputCapacidad = document.getElementById(\"capacidad\").value;\n const inputNombreSalon = document.getElementById(\"nombresalon\").value;\n objClaveMateria = {\n \"IdSalon\": inputIdSalon,\n \"Ubicacion\": inputUbicacion,\n \"NombreClave\": inputNombreSalon,\n \"Capacidad\": inputCapacidad\n }\n fetch(uri,{\n method: 'PUT',\n headers:{\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(objClaveMateria)\n })\n .then(response => response.text())\n .then(data => Mensaje(data))\n .catch(error => console.error('Unable to Editar Item.',error ,objClaveMateria));\n}", "function updateInventory(dbResponse, orderQty) {\n // console.log(\"Updating inventory ...\\n\");\n // console.log(dbResponse);\n\n // update inventory\n var newqty = dbResponse.stock_quantity - orderQty;\n \n // update sales\n var totSales = dbResponse.product_sales + (orderQty * dbResponse.price);\n\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newqty, \n product_sales: totSales\n },\n {\n item_id: dbResponse.item_id\n }\n ],\n function(err, res) {\n // console.log(res.affectedRows + \" offer updated!\\n\");\n showCustomer(orderQty, dbResponse);\n\n loopIt();\n }\n );\n \n // logs the actual query being run\n // console.log(query.sql);\n}", "onApprove(data, actions) {\n\n const { _id, newTier, selectedListing, amount } = this.props;\n\n return actions.order\n .capture()\n .then((details) => {\n if (this.props.onSuccess) { //If the transaction was successful, update the subscriptionTier in the DB\n axios.get('/api/userPortal')\n .then(res => {\n console.log(res);\n res.data.find((info) => {\n if (info._id === _id) {\n let id = info._id; \n \n let myListings = info.listings\n\n myListings.find((target) => {\n if (target._id === selectedListing) {\n target.subscriptionTier = newTier\n\n }\n })\n\n\n\n axios.put('/api/userPortal/' + id, {\n \"name\": info.name,\n \"phone\": info.phone,\n \"emailAddress\": info.emailAddress,\n \"address\": info.address,\n \"service\": info.service,\n \"accessibility\": info.accessibility,\n \"password\": info.password,\n \"listings\": myListings\n })\n }\n })\n });\n\n\n return this.props.onSuccess(details, data);\n }\n })\n .catch((err) => {\n if (this.props.catchError) {\n return this.props.catchError(err);\n }\n });\n }", "function updateCostAndPrice() {\n $(\"#totalCostCalculated\").text(Math.round(totalCostCalculated * Math.pow(10, 2)) / Math.pow(10, 2));\n $(\"#sellingPriceAtSpan\").text($(\"#profitMarginInput\").val());\n $(\"#sellingPrice\").text((Math.round(sellingPrice * Math.pow(10, 2)) / Math.pow(10, 2)));\n alert('recalculated via updateCostAndPrice method');\n }", "function update(req, res, next) {\n const { data: order = {} } = req.body;\n const existingOrder = res.locals.order;\n\n const updatedOrder = {\n id: existingOrder.id,\n deliverTo: order.deliverTo,\n mobileNumber: order.mobileNumber,\n status: order.status,\n dishes: order.dishes,\n };\n\n res.json({ data: updatedOrder });\n}", "function updateStudent(id) {\n let list = students[id - 1];\n console.log(list);\n setName(list.name)\n setRollNo(list.rollno)\n setStudentID(list.id)\n setFlag(false);\n }", "function dispatch_details_update_row(items, obj) {\n var item;\n for(i in items) {\n\titem = items[i];\n\tif((order_list_store.getValue(item, 'id')==obj['id'])) {\n\t attrs = order_list_store.getAttributes(item);\n\t for(j in attrs) {\n\t\torder_list_store.setValue(item, attrs[j], obj[attrs[j]]);\n\t }\n\t return true;\n\t}\n }\n return false;\n}", "replaceModalItem(index, ProductId, CustomerId, StoreId, DataSold) {\n this.setState({\n item_Id: index,\n item_ProductId: ProductId,\n item_CustomerId: CustomerId,\n item_StoreId: StoreId,\n item_DataSold: DataSold \n });\n }", "function updateCustomer() {\n var cust = $scope.customer;\n\n CustomerService.save(cust)\n .success(function() {\n $location.path('/customer');\n $scope.status = 'Updated Customer! Refreshing customer list.';\n })\n .error(function(error) {\n $scope.status = 'Unable to update customer: ' + error.message;\n });\n }", "function updatePizza(req,res,customerId)\n{\n var updateObj = { \n \n \"devoured\": true, \n \"CustomerId\": customerId\n }; \n\n db.Pizza.update(updateObj, {\n where: {\n id: req.params.id\n }\n }).then(function(dbTodo) {\n res.redirect(\"/\");\n }); \n}", "constructor({\n saleId, contactId, price, estimatedPaymentTime, estimatedDeliveryTime,\n creationDate, status,\n }) {\n this.saleId = saleId;\n this.contactId = contactId;\n this.price = price;\n this.estimatedPaymentTime = estimatedPaymentTime;\n this.estimatedDeliveryTime = estimatedDeliveryTime;\n this.creationDate = creationDate;\n this.status = status;\n }", "function updateShop (name, address, wHours, coords, index){\r\n shopStorage[index].name = name;\r\n shopStorage[index].address = address;\r\n shopStorage[index].wHours = wHours;\r\n shopStorage[index].coords = coordsFromStr(coords);\r\n\r\n dialogNameField.value = '';\r\n dialogAddressField.value = ''; \r\n dialogHoursField.value = ''; \r\n\r\n addShopBtn.value = '';\r\n updateShopList(); \r\n dialog.close();\r\n }", "update(req, res) {\n RegistroEstudo.update(req.body, {\n where: {\n id: req.params.id\n }\n })\n .then(function (updatedRecords) {\n res.status(200).json(updatedRecords);\n })\n .catch(function (error) {\n res.status(500).json(error);\n });\n }", "function transact() {\n var newQuantity = stockQuantity - saleQuantity;\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n item_id: saleItem + 1\n }\n ], function (err, res) {\n if (err) throw err;\n //console.log(res.affectedRows + \" products updated!\\n\") //for testing\n console.log(\"Thank you! Please come again!\\n\".brightYellow);\n })\n connection.end();\n}", "function updatePrices() {\n}", "function addToBasket(detail) { }" ]
[ "0.7641599", "0.6589605", "0.6433845", "0.64084125", "0.6355225", "0.6160315", "0.6100403", "0.60600704", "0.6017934", "0.5945191", "0.5935192", "0.5914338", "0.58704233", "0.5862563", "0.5834998", "0.5833835", "0.5634119", "0.5612833", "0.56082404", "0.5605296", "0.55957294", "0.5575065", "0.5565051", "0.55627173", "0.55455965", "0.5512244", "0.550546", "0.5478702", "0.54695755", "0.5449907", "0.54493153", "0.54392636", "0.539145", "0.53809625", "0.53801006", "0.53622514", "0.5355314", "0.53526783", "0.5335883", "0.5325238", "0.5322011", "0.5320956", "0.5315913", "0.5315773", "0.5300627", "0.5286105", "0.5270704", "0.5270432", "0.52659327", "0.5264704", "0.5251452", "0.5238767", "0.5229953", "0.5228691", "0.52261424", "0.52255595", "0.5220666", "0.5212565", "0.52110547", "0.52091706", "0.52085775", "0.5208435", "0.5208415", "0.5203989", "0.51982653", "0.518376", "0.517972", "0.51786274", "0.5176771", "0.5169337", "0.516921", "0.51650083", "0.5164827", "0.5156015", "0.51490813", "0.5142578", "0.51418024", "0.5139481", "0.513143", "0.51278436", "0.51257205", "0.51256526", "0.5114379", "0.51106524", "0.51055634", "0.51045537", "0.50966465", "0.5092711", "0.5087191", "0.50848114", "0.5080159", "0.50779146", "0.50751495", "0.50748765", "0.5074305", "0.5072894", "0.5071762", "0.5071635", "0.5071087", "0.50660014" ]
0.5388544
33
This function retrieves all lost sales from Prospects list
function showLostSales() { $('#LeadsTile').css("background-color", "#0072C6"); $('#OppsTile').css("background-color", "#0072C6"); $('#SalesTile').css("background-color", "#0072C6"); $('#LostSalesTile').css("background-color", "orange"); $('#ReportsTile').css("background-color", "#0072C6"); var errArea = document.getElementById("errAllLostSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var haslostSales = false; hideAllPanels(); var saleList = document.getElementById("AllLostSales"); list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var saleTable = document.getElementById("LostSaleList"); // Remove all nodes from the lostSale <DIV> so we have a clean space to write to while (saleTable.hasChildNodes()) { saleTable.removeChild(saleTable.lastChild); } // Iterate through the Propsects list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Lost Sale") { // Create a DIV to display the organization name var lostSale = document.createElement("div"); var saleLabel = document.createTextNode(listItem.get_fieldValues()["Title"]); lostSale.appendChild(saleLabel); // Add an ID to the lostSale DIV lostSale.id = listItem.get_id(); // Add an class to the lostSale DIV lostSale.className = "item"; // Add an onclick event to show the lostSale details $(lostSale).click(function (sender) { showLostSaleDetails(sender.target.id); }); saleTable.appendChild(lostSale); haslostSales = true; } } if (!haslostSales) { var noLostSales = document.createElement("div"); noLostSales.appendChild(document.createTextNode("There are no lost sales.")); saleTable.appendChild(noLostSales); } $('#AllLostSales').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get lost sales. Error: " + args.get_message())); errArea.appendChild(divMessage); $('#LostSaleList').fadeIn(500, null); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNotSoldProducts(store) {\n \n // get the output1 sheet\n\tvar sheet = getOutputSheet(1)\n \n // get the first cell of the Output1 sheet\n var cell = getOutputFirstCell(1);\n \n // set the formula to get the asked information\n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select F, G, H, J, L, sum(I) where J='No Vendido' and K='\"+store+\"' group by G, F, H, J, L\\\")\");\n \n\t// create a 2 dim area of the data in the carrier names column and codes \n\tvar products = sheet.getRange(2, 1, sheet.getLastRow()-1, 6).getValues();\n \n if (products.length > 0) {\n \n products.reduce( \n\t\tfunction(p, c) { \n \n // if the inventory is greater than zero, add it to the list\n var inventory = c[5];\n \n if (inventory > 0) {\n \n\t\t\tp.push(c); \n }\n\t\t\treturn p; \n\t\t}, []); \n }\n \n \n return JSON.stringify(products);\n}", "function salesReport() {\n var totalSales = 0;\n \n // [ [ 102, 103, 104 ], [ 106, 107 ], [], [], [] ]\n for(var i = 0; i < bookedRooms.length; i++) {\n totalSales += bookedRooms[i].length * roomPrices[i]\n \n }\n \n return totalSales;\n}", "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "function profitLossCalculator(data) {\n const result = [];\n\n for (const stock of data) {\n\n // If sector exists\n if (result.some(e => e.name === stock['sector'])) {\n for (let obj of result) {\n\n if (obj['name'] === stock['sector']) {\n obj['worthNew'] = obj['worthNew'] + stock['current_price'] * stock['n_holding']\n obj['worthOld'] = obj['worthOld'] + stock['buy_price'] * stock['n_holding']\n }\n }\n } else result.push({ \"name\": stock['sector'], \"worthNew\": stock['current_price'] * stock['n_holding'], 'worthOld': stock['buy_price'] * stock['n_holding'] })\n }\n\n for (let i = 0; i < result.length; i++) {\n result[i]['value'] = ((result[i]['worthNew'] - result[i]['worthOld']) / result[i]['worthOld']) * 100\n result[i]['current_total'] = result[i]['value']\n result[i]['ticker'] = result[i]['name']\n }\n const finalResult = result;\n\n console.log(\"Profit/Loss\", finalResult);\n setPortfolioStatistics_profitLoss(finalResult);\n }", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "getAllSalesList() {\n fetch(process.env.REACT_APP_API_URL+\"/sales\")\n .then(res => res.json())\n .then(\n result => {\n this.setState({\n isLoaded: true,\n salesList: result,\n });\n },\n error => {\n this.setState({\n isLoaded: true,\n error: error\n });\n }\n );\n }", "getAppliedDiscounts() {\n return this.discountSrv.getAppliedDiscounts(this._checkoutProducts);\n }", "function viewProductSales() {\n connection.query(\n 'SELECT department_id, departments.department_name, over_head_costs, sum(product_sales) as product_sales, sum(product_sales) - over_head_costs as total_profit FROM products right join departments on products.department_name=departments.department_name group by department_id, products.department_name, over_head_costs',\n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function getEmployees(data) {\n var employees = [];\n\n for (var i = 0; i < data.length; i++) {\n var d = data[i];\n\n if (!employees.includes(d.salesman)) {\n employees.push(d.salesman);\n }\n }\n return employees;\n}", "function getRecords(datain)\n{\n var filters = new Array();\n var daterange = 'daysAgo90';\n var projectedamount = 0;\n var probability = 0;\n if (datain.daterange) {\n daterange = datain.daterange;\n }\n if (datain.projectedamount) {\n projectedamount = datain.projectedamount;\n }\n if (datain.probability) {\n probability = datain.probability;\n }\n \n filters[0] = new nlobjSearchFilter( 'trandate', null, 'onOrAfter', daterange ); // like daysAgo90\n filters[1] = new nlobjSearchFilter( 'projectedamount', null, 'greaterthanorequalto', projectedamount);\n filters[2] = new nlobjSearchFilter( 'probability', null, 'greaterthanorequalto', probability );\n \n // Define search columns\n var columns = new Array();\n columns[0] = new nlobjSearchColumn( 'salesrep' );\n columns[1] = new nlobjSearchColumn( 'expectedclosedate' );\n columns[2] = new nlobjSearchColumn( 'entity' );\n columns[3] = new nlobjSearchColumn( 'projectedamount' );\n columns[4] = new nlobjSearchColumn( 'probability' );\n columns[5] = new nlobjSearchColumn( 'email', 'customer' );\n columns[6] = new nlobjSearchColumn( 'email', 'salesrep' );\n columns[7] = new nlobjSearchColumn( 'title' );\n \n // Execute the search and return results\n \n var opps = new Array();\n var searchresults = nlapiSearchRecord( 'opportunity', null, filters, columns );\n \n // Loop through all search results. When the results are returned, use methods\n // on the nlobjSearchResult object to get values for specific fields.\n for ( var i = 0; searchresults != null && i < searchresults.length; i++ )\n {\n var searchresult = searchresults[ i ];\n var record = searchresult.getId( );\n var salesrep = searchresult.getValue( 'salesrep' );\n var salesrep_display = searchresult.getText( 'salesrep' );\n var salesrep_email = searchresult.getValue( 'email', 'salesrep' );\n var customer = searchresult.getValue( 'entity' );\n var customer_display = searchresult.getText( 'entity' );\n var customer_email = searchresult.getValue( 'email', 'customer' );\n var expectedclose = searchresult.getValue( 'expectedclosedate' );\n var projectedamount = searchresult.getValue( 'projectedamount' );\n var probability = searchresult.getValue( 'probability' );\n var title = searchresult.getValue( 'title' );\n \n opps[opps.length++] = new opportunity( record,\n title,\n probability,\n projectedamount,\n customer_display,\n salesrep_display);\n }\n \n var returnme = new Object();\n returnme.nssearchresult = opps;\n return returnme;\n}", "function getAllRentalsForActiveRental (rentalForCalculationOfGame, rentals, gracePeriodForGames, isWeekend, chargeMultiplierWithoutFood, serviceCharge, serviceTaxParameter, gameCgst, gameSgst) {\n var rentalsForActiveRental = [];\n var gameRentalTemp;\n rentalForCalculationOfGame.gameRevenue = 0;\n rentalForCalculationOfGame.noOfMilisecond = 0;\n rentalForCalculationOfGame.cgstOnGame = 0;\n rentalForCalculationOfGame.sgstOnGame = 0;\n rentalForCalculationOfGame.totalOnGame = 0;\n // rentalForCalculationOfGame.totalOnFood = 0;\n var currentRental = rentalForCalculationOfGame;\n var j = 0;\n/* var gracePeriodSystemParameter = (filterFilter($scope.systemparameters, {systemParameterName : 'Grace Period'})).pop();\nvar gracePeriod = Number(gracePeriodSystemParameter.value); */\n var gracePeriod = Number(gracePeriodForGames);\n\n/* var weekendSystemParameter = (filterFilter($scope.systemparameters, {systemParameterName : 'Weekend Holiday Today'})).pop();\n var weekend = weekendSystemParameter.value; */\n var weekend = isWeekend;\n\n while (currentRental) {\n gameRentalTemp = currentRental;\n gameRentalTemp.noOfMilisecond = (gameRentalTemp.activeRental === true ? (new Date()).getTime() : (new Date(currentRental.rentalEnd)).getTime()) - (new Date(currentRental.renewalRentalStart)).getTime();\n rentalsForActiveRental.push(gameRentalTemp);\n\n if (currentRental.renewalRental) {\n for (j = 0; j < rentals.length; j++) {\n if (rentals[j]._id === currentRental.renewalRental) {\n currentRental = rentals[j];\n break;\n }\n }\n } else currentRental = '';\n }\n\n var summarizedGameRentals = [];\n var summarizedGameRentalsForCategoryId = [];\n var tempGameRental;\n var tempIndexForGame;\n var tempGameRentalForCategory;\n\n for (var k = 0; k < rentalsForActiveRental.length; k++) {\n // console.log(rentalsForActiveRental[k]);\n if (summarizedGameRentalsForCategoryId.indexOf(rentalsForActiveRental[k].serial.product.category._id) < 0) {\n summarizedGameRentalsForCategoryId.push(rentalsForActiveRental[k].serial.product.category._id);\n // tempGameRental = {category: rentalsForActiveRental[k].serial.product.category};\n // $scope.test = {category : rentalsForActiveRental[k].serial.product.category , noOfMilisecond: rentalsForActiveRental[k].noOfMilisecond};\n // $scope.test = tempGameRental;\n summarizedGameRentals.push({ category: rentalsForActiveRental[k].serial.product.category, noOfMilisecond: rentalsForActiveRental[k].noOfMilisecond });\n // summarizedGameRentals.push( rentalsForActiveRental[k]);\n } else {\n tempIndexForGame = summarizedGameRentalsForCategoryId.indexOf(rentalsForActiveRental[k].serial.product.category._id);\n tempGameRentalForCategory = summarizedGameRentalsForCategoryId.splice(tempIndexForGame, 1).pop();\n tempGameRental = summarizedGameRentals.splice(tempIndexForGame, 1).pop();\n tempGameRental.noOfMilisecond = Number(tempGameRental.noOfMilisecond) + Number(rentalsForActiveRental[k].noOfMilisecond);\n summarizedGameRentalsForCategoryId.push(tempGameRental.category._id);\n summarizedGameRentals.push(tempGameRental);\n }\n }\n\n var hours = 0;\n var minutes = 0;\n\n // $scope.test = rentalsForActiveRental;\n for (var m = 0; m < summarizedGameRentals.length; m++) {\n hours = Math.floor((Number(summarizedGameRentals[m].noOfMilisecond) + 30000) / 3600000);\n minutes = Math.round((Number(summarizedGameRentals[m].noOfMilisecond) - hours * 3600000) / 60000);\n summarizedGameRentals[m].timePlayed = (hours < 10 ? '0' : '') + hours + ':' + (minutes < 10 ? '0' : '') + minutes;\n // summarizedGameRentals[m].hoursCharged = Math.ceil((Number(summarizedGameRentals[m].noOfMilisecond) - gracePeriod * 60000)/3600000);\n // $scope.test=summarizedGameRentals[m].isMember;\n summarizedGameRentals[m].hoursCharged = (rentalForCalculationOfGame.isMember === true ? 0 : Math.ceil((Number(summarizedGameRentals[m].noOfMilisecond) - gracePeriod * 60000) / 3600000));\n console.log(chargeMultiplierWithoutFood);\n summarizedGameRentals[m].ratePerHourCharged = parseFloat(Math.round(chargeMultiplierWithoutFood * (weekend === 'Y' ? summarizedGameRentals[m].category.ratePerHourWeekendHoliday : summarizedGameRentals[m].category.ratePerHourWeekday) * 100) / 100).toFixed(2);\n\n summarizedGameRentals[m].amountCharged = parseFloat(Math.round(summarizedGameRentals[m].hoursCharged * summarizedGameRentals[m].ratePerHourCharged * 100) / 100).toFixed(2);\n\n rentalForCalculationOfGame.gameRevenue = parseFloat(Math.round((Number(rentalForCalculationOfGame.gameRevenue) + Number(summarizedGameRentals[m].amountCharged)) * 100) / 100).toFixed(2);\n }\n // rentalForCalculationOfGame.games = [];\n rentalForCalculationOfGame.games = summarizedGameRentals;\n // console.log(gameCgst);\n rentalForCalculationOfGame.serviceChargeOnGame = parseFloat(Math.round(Number(rentalForCalculationOfGame.gameRevenue) * serviceCharge) / 100).toFixed(2);\n rentalForCalculationOfGame.cgstOnGame = parseFloat(Math.round((Number(rentalForCalculationOfGame.gameRevenue) + Number(rentalForCalculationOfGame.serviceChargeOnGame)) * gameCgst) / 100).toFixed(2);\n // console.log(rentalForCalculationOfGame.gameRevenue);\n rentalForCalculationOfGame.sgstOnGame = parseFloat(Math.round((Number(rentalForCalculationOfGame.gameRevenue) + Number(rentalForCalculationOfGame.serviceChargeOnGame)) * gameSgst) / 100).toFixed(2);\n\n rentalForCalculationOfGame.totalOnGame = parseFloat(Number(rentalForCalculationOfGame.gameRevenue) + Number(rentalForCalculationOfGame.serviceChargeOnGame) + Number(rentalForCalculationOfGame.cgstOnGame) + Number(rentalForCalculationOfGame.sgstOnGame)).toFixed(2);\n rentalForCalculationOfGame.subTotalAmountForCustomer = parseFloat(Math.round((Number(rentalForCalculationOfGame.totalOnGame) + Number(rentalForCalculationOfGame.totalOnFood)) * 100) / 100).toFixed(2);\n\n if (rentalForCalculationOfGame.deposit == null) {\n rentalForCalculationOfGame.deposit = 0;\n }\n\n rentalForCalculationOfGame.totalAmountForCustomer = parseFloat(Math.round((Number(rentalForCalculationOfGame.subTotalAmountForCustomer) - Number(rentalForCalculationOfGame.deposit)) * 100) / 100).toFixed(2);\n\n return rentalForCalculationOfGame;\n }", "function drillLost() {\n var hasLost = false;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n // Get the type of prospect and its percentage\n var type = \"Lost Sale\";\n var getDiv = document.getElementById(\"lostOpp\");\n var getWidth = parseFloat((getDiv.clientWidth / 800) * 100);\n getWidth = getWidth.toFixed(2);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n\n // Success returned from executeQueryAsync\n var lostSaleTable = document.getElementById(\"drillTable\");\n\n // Remove all nodes from the drillTable <DIV> so we have a clean space to write to\n while (lostSaleTable.hasChildNodes()) {\n lostSaleTable.removeChild(lostSaleTable.lastChild);\n }\n\n // Iterate through the Prospects list\n var listItemEnumerator = listItems.getEnumerator();\n\n var listItem = listItemEnumerator.get_current();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n // Get information for each Lost Sale\n var lostSaleTitle = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n var lostSalePerson = document.createTextNode(listItem.get_fieldValues()[\"ContactPerson\"]);\n var lostSaleNumber = document.createTextNode(listItem.get_fieldValues()[\"ContactNumber\"]);\n var lostSaleEmail = document.createTextNode(listItem.get_fieldValues()[\"Email\"]);\n var lostSaleAmt = document.createTextNode(listItem.get_fieldValues()[\"DealAmount\"]);\n drillConvert(lostSaleTitle.textContent, lostSalePerson.textContent, lostSaleNumber.textContent, lostSaleEmail.textContent, lostSaleAmt.textContent, getWidth.toString(), type.toString());\n\n }\n hasLost = true;\n }\n\n if (!hasLost) {\n // Text to display if there are no Lost Sales\n var noLostSales = document.createElement(\"div\");\n noLostSales.appendChild(document.createTextNode(\"There are no Lost Sales.\"));\n lostSaleTable.appendChild(noLostSales);\n }\n $('#drillDown').fadeIn(500, null);\n });\n}", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function calculateReport()\n{\n for(var i=0; i<json.stock.length; i++)\n {\n invest[i]= json.stock[i].noofshare * json.stock[i].shareprice\n totalInvest += invest[i]\n }\n return invest;\n}", "function viewSalesbyDept () {\n connection.query(\"SELECT department_name FROM departments\", function(err, res) {\n if (err) throw err;\n\n var departments = [];\n for(i in res) {\n join = `SELECT departments.department_name, departments.over_head_costs, SUM(product_sales) as 'total_sales'\n FROM departments INNER JOIN products \n ON departments.department_name = products.department_name\n WHERE departments.department_name = '${res[i].department_name}'; \n `\n\n connection.query(join, function(err, res2) {\n total_profit = res2[0].total_sales - res2[0].over_head_costs;\n salesInfo = new DepartmentSales(res2[0].department_name, res2[0].over_head_costs, res2[0].total_sales, total_profit);\n departments.push(salesInfo);\n console.table(salesInfo);\n });\n }\n });\n}", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "function countProfit(shoppers) {\n let listBarang = [ ['Sepatu Stacattu', 1500000, 10],\n ['Baju Zoro', 500000, 2],\n ['Sweater Uniklooh', 175000, 1]\n ];\n // you can only write your code here!\n if (shoppers.length == 0) {\n return []\n }\n let pot = {}\n // {\n // Sepatu: { \n // price: 15000000\n // stock: 10\n // } \n // }\n\n for (let i = 0; i < listBarang.length; i++) {\n pot[listBarang[i][0]] = {\n price: listBarang[i][1],\n stock: listBarang[i][2]\n }\n }\n \n // let namaShopper = countProfit[0]['name']\n let result = []\n for (let i = 0; i < listBarang.length; i++) {\n let shop = {\n product: listBarang[i][0],\n shoppers: [],\n leftOver: listBarang[i][2],\n totalProfit: 0,\n } \n result.push(shop)\n }\n \n for (let i = 0; i < shoppers.length; i++) {\n if (shoppers[i].product == 'Sepatu Stacattu' && result[0].leftOver >= shoppers[i].amount) {\n result[0].shoppers.push(shoppers[i].name)\n result[0].leftOver -= shoppers[i].amount\n result[0].totalProfit += shoppers[i].amount * listBarang[0][1] \n } else if (shoppers[i].product == 'Baju Zoro' && result[1].leftOver >= shoppers[i].amount) {\n result[1].shoppers.push(shoppers[i].name)\n result[1].leftOver -= shoppers[i].amount\n result[1].totalProfit += shoppers[i].amount * listBarang[1][1]\n } else if (shoppers[i].product == 'Sweater Uniklooh' && result[2].leftOver >= shoppers[i].amount) {\n result[2].shoppers.push(shoppers[i].name)\n result[2].leftOver -= shoppers[i].amount\n result[2].totalProfit += shoppers[i].amount * listBarang[2][1]\n }\n }\n \n \n return result\n}", "calculateProfit(data) {\n for (var i = 0; i < data.length; i ++) {\n data[i].profit = data[i].revenue - data[i].totalCost\n }\n return data;\n }", "function summarizedSalesByProduct() {\n // var dataSummarized = [];\n var data = get.mappedSalesData();\n\n return data.reduce(function(allSummary, week){\n var keeptrack = {};\n allSummary.push(week.reduce(function(weekSum, sale) {\n if (!keeptrack[sale.product]) {\n keeptrack[sale.product] = 1;\n weekSum.push({week: sale.week, category: sale.category, product: sale.product, quantity: sale.quantity, unitprice: sale.unitprice, revenue: sale.revenue, totalcost: sale.totalcost, profit: sale.profit });\n } else {\n var product = weekSum.find(function(item) {return item.product === sale.product;});\n product.quantity += sale.quantity;\n product.revenue += sale.revenue;\n product.totalcost += sale.totalcost;\n product.profit += sale.profit;\n\n if (typeof product.unitprice!== 'object' && product.unitprice!==sale.unitprice) {\n product.unitprice = [product.unitprice, sale.unitprice];\n } else if (typeof product.unitprice === 'object' && product.unitprice.indexOf(sale.unitprice)===-1) {\n product.unitprice.push(sale.unitprice);\n }\n }\n\n return weekSum;\n },[])\n );\n return allSummary;\n },[]);\n // return dataSummarized;\n }", "function restrictListProducts(prods, lactose, nut, organic) {\n\tlet products = [];\n\n\tprods.sort(function(a, b){\n\t\t\treturn a.price - b.price;\n\t})\n\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif (lactose && !prods[i].lactose) continue;\n\t\tif (nut && !prods[i].nutFree) continue;\n\t\tif (organic && !prods[i].organic) continue;\n\t\tproducts.push(prods[i]);\n\n\t}\n\treturn products;\n}", "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "function calculateSales(salesData){\n var totalSales = 0;\n for (var sale in salesData){\n totalSales = totalSales + salesData[sale];\n }\n return totalSales;\n}", "__validateSales() {\n let salescorrect = [];\n let salesIncorrect = [];\n\n this.sales.forEach((sale) => {\n if (\n sale.saleDate.isSameOrAfter(this.since) &&\n sale.saleDate.isSameOrBefore(this.until)\n ) {\n salescorrect.push(sale);\n } else {\n salesIncorrect.push(sale);\n }\n });\n\n this.sales = salescorrect.reverse();\n //TODO: Metodo que grantice un ordenamineto de fechas correcto siempre\n this.salesWithError = salesIncorrect;\n }", "function getPlayersItemsSold() {\n\tconsole.log(\"Get Players Items Sold.\");\n\n\tvar id = 0;\n\n\t$(\"#playersItemsSold\").empty();\n\t$(\"#playersItemsSold\").append(\"<h4>Your Inactive Listings</h4>\");\n\n\t$.get(\"api/users/\" + id + \"/listings\", function(data){\n\n\t\tvar numberOfListings = 5;\n\n\t\tfor (var i = 0; i < numberOfListings; i++){\n\t\t\t$(\"#playersItemsSold\").append(\"<p>=-=-=-=-=-=Listing \" + i + \" =-=-=-=-=-=</p>\");\n\t\t}\n\t});\n}", "function updateSales(sales) {\n\tvar salesDiv = document.getElementById(\"sales\");\n\n\tfor (var i = 0; i < sales.length; i++) {\n\t\tvar sale = sales[i];\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.setAttribute(\"class\", \"saleItem\");\n\t\tdiv.innerHTML = sale.name + \" sold \" + sale.sales + \" gumbaslls\";\n\t\tsalesDiv.appendChild(div);\n\t}\n\t\n\tif (sales.length > 0) {\n\t\tlastReportTime = sales[sales.length-1].time;\n\t}\n}", "function totalSales(products, lineItems){\n //TODO\n\n}", "function getSalesByDay(){\n console.log(\"getting Sales by day...\");\n \n socket.emit('requestSalesHistory', function(hist){\n console.log(\"GOT SALES HISTORY\");\n console.log(hist);\n \n //get today's date\n var date = new Date();\n\t\tdate.setTime(date.getTime());\n \n //LOOP THRU making sure every day has an entry\n //(even days for which there are no sales)...\n //populates completeHist in reverse chrono order\n for(var daysBefore = 0; daysBefore < 7; ++daysBefore){\n if(hist.length == 0){//if no sales records\n var thisDate = new Date();\n //add 7 $0.00 records\n for(var numRec = 0; numRec < 7; ++numRec){\n thisDate.setDate(date.getDate() - numRec);\n completeHist.push({\"cost\":\"0.00\", \"date\":thisDate});\n }\n \n break;//!!!!END LOOP THRU make sure every day has entry!!!//\n }\n //else at least one sales record... guaranteed for hist[0] to be defined\n ////////////////////////////////////\n //generate date to look for record//\n ////////////////////////////////////\n //get date in format of hist date\n var thisDate = new Date(hist[0].date);\n //set actual date to todays date - daysBefore\n thisDate.setDate(date.getDate() - daysBefore);\n \n //get index of that record\n var indexOfThsDate = _.findIndex(hist, function isSame(histEl){\n return (histEl.date == thisDate.toISOString());\n });//end findIndex\n \n //if this date not in the salesHistory\n //then no reported sales for that day --> add record with 0 sales\n if(indexOfThsDate == -1)\n completeHist.push({\"cost\":\"0.00\", \"date\":thisDate});\n else//else there is a record, so add it to completeHist\n completeHist.push({\"cost\":hist[indexOfThsDate].cost, \"date\":new Date(hist[indexOfThsDate].date)});\n }//END LOOP THRU making sure every day has an entry\n \n //this block to print completeHist array\n console.log(\"completeHist=\");\n for(var i = 0; i < completeHist.length; ++i)\n console.log(\"completeHist[\"+i+\"].date=\"+completeHist[i].date+\".cost=\"+completeHist[i].cost);\n });//end requestSalesHistory\n}//end getSalesByDay()", "function getAllProductsForSaleByStore() {\n return datacontext.get('Product/GetAllProductsForSaleByStore');\n }", "function loopingData2() {\n let amountSoldOnEachDate = {};\n let maxValue = 0;\n let dateWithMostSales;\n\n\n for (let key in store2['sale dates']) {\n for (let i = 0; i < store2['sale dates'][key].length; i++) {\n if (amountSoldOnEachDate[store2['sale dates'][key][i]] === undefined) {\n amountSoldOnEachDate[store2['sale dates'][key][i]] = 1;\n } else {\n amountSoldOnEachDate[store2['sale dates'][key][i]] = amountSoldOnEachDate[store2['sale dates'][key][i]] + 1;\n }\n }\n }\n\n for (let key in amountSoldOnEachDate) {\n if (amountSoldOnEachDate[key] > maxValue) {\n maxValue = amountSoldOnEachDate[key];\n dateWithMostSales = key;\n }\n // don't need else statement because amountSoldOnEachDate[key] is less than or equal to maxValue then we don't do anything\n }\n return dateWithMostSales;\n}", "noOfferProducts(productsListFromProps) {\n if (productsListFromProps.length > 0 && this.props.company && this.props.company.offers.items.length > 0) {\n let coOffers;\n this.props.company.offers.items.forEach((item) => { coOffers = coOffers + item.productID + ';;' });\n const l = productsListFromProps.length;\n let indexedProductsNoOffer = [];\n let count = 0;\n for (let x = 0; x < l; x++) {\n if (!coOffers.includes(productsListFromProps[x].id)) {\n indexedProductsNoOffer.push({\n seqNumb: count++,\n details: productsListFromProps[x]\n })\n }\n }\n return indexedProductsNoOffer;\n } else {\n return this.allProducts(productsListFromProps);\n }\n }", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function productsForSale() {\n\tvar query = \"SELECT * FROM products HAVING stock_quantity > 0\";\n\tconnection.query(query, function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n\t\t\tconsole.log(\"-----------------------------\");\n\t\t}\n\trunSearch();\n\t});\n}", "function viewDeptSales() {\n salesByDept();\n}", "async _getUnreimbursedExpenses(req, res) {\n logger.log(1, '_getUnreimbursedExpenses', 'Attempting to get all unreimbursed expenses');\n try {\n let expressionAttributes = {\n ':queryKey': null\n };\n let additionalParams = {\n ExpressionAttributeValues: expressionAttributes,\n FilterExpression: 'attribute_not_exists(reimbursedDate) or reimbursedDate = :queryKey'\n };\n let unreimbursedExpenses = await this.expenseDynamo.scanWithFilter('reimbursedDate', null, additionalParams);\n unreimbursedExpenses = _.map(unreimbursedExpenses, (expense) => {\n return new Expense(expense);\n });\n // log success\n logger.log(1, '_getUnreimbursedExpenses', 'Successfully got all unreimbursed expenses');\n\n // send successful 200 status\n res.status(200).send(unreimbursedExpenses);\n\n return unreimbursedExpenses;\n } catch (err) {\n // log error\n logger.log(1, '_getUnreimbursedExpenses', 'Failed to get all unreimbred expenses');\n\n // send error status\n this._sendError(res, err);\n\n // return error\n return err;\n }\n }", "function productsForSale() {\n console.log(\"products for sale fxn\");\n connection.query(\"SELECT * FROM products\",function(err, res){\n if (err) throw err;\n for (var i=0; i<res.length;i++) {\n console.log(`Product Name: ${res[i].product_name}`);\n console.log(`Department Name: ${res[i].department_name}`);\n console.log(`Selling Price: $${res[i].price}`);\n console.log(`Quantity in Stock: ${res[i].stock_quantity}`);\n console.log(\"---------------------\");\n }\n });\n connection.end();\n }", "function salesByDept() {\n var query =\n 'SELECT departments.department_id, departments.department_name, over_head_costs, SUM(product_sales) AS total_sales, (SUM(product_sales) - over_head_costs) AS total_profit ';\n query +=\n 'FROM departments INNER JOIN products ON (departments.department_name = products.department_name) ';\n query += 'GROUP BY departments.department_name';\n connection.query(query, function(err, res) {\n if (err) {\n throw err;\n } else {\n console.table(res);\n reset();\n }\n });\n}", "function accessesingData1() {\n let bananaSaleDates = [];\n for (var i = 0; i < store2['sale dates']['Banana Bunches'].length; i++) {\n bananaSaleDates.push(store2['sale dates']['Banana Bunches'][i]);\n } return bananaSaleDates;\n}", "function readAllProds() {\n $(\"#tableProd td\").remove(); //destroi tabela e remonta\n listAllItems(\"produtos\", showProd);\n}", "function getSaleLinesData(shopObj, endPoint, clear){\n var objSheet = shopObj.saleLineSheetName;\n var ssID = shopObj.ID;\nlogSales(\"Shop Object\",shopObj.saleLineSheetName)\nvar ss = SpreadsheetApp.openById(ssID);\n var sheet = ss.getSheetByName(objSheet);\n sheet.activate();\n var saleOffset = getCurrentSaleLineID(sheet,ssID); \n if(UIONOFF){ ss.toast(\"Sale Line Off set ID =\"+saleOffset);}\n var headerRows = 1;\n var offset = 0;\n // == -- Specify the type of call needed -- == \\\\ \n var type = \"GET\";\n // == -- Build the URL with any offsets -- == \\\\\n var url = shopObj.saleLine;\n // == -- adjust process for updating info or replacing info -- == \\\\ \n if(!clear && saleOffset){ \n // logSales(\"sales object\",shopObj);\n url = url+\"&saleLineID=%3E,\"+saleOffset;\n// logSales(\"log Url\",url);\n updateSaleID(shopObj.name,saleOffset)\n } else {\n clearSheet(headerRows, sheet);\n saleOffset = 0;\n }\n \n// logSales(\"url\",url);\n // == -- Initiate the OAuth / Api Call with the given variables -- == \\\\ \n var data = getData(offset,url,endPoint,type);\n if(data.length>=0 ){\n for(var i = 0; i<data.length; i++){\n var row = data[i];\n// logSales(\"Data Row\",row);\n getNames(row);\n// fixItems(row);\n fixDates(row);\n }}\n // == -- Make the call to insert the rows needed for the new data and insert the data -- == \\\\ \n insertData(sheet,data);\n}", "function topSellerByRevenue(products, lineItems){\n //TODO\n}", "function getUnapprovedDrinks(req, res) {\n mixedDrinkModel.unapprovedDrinks()\n .then(sendJson(res))\n .catch(error(res))\n}", "function getExistingServiceDeskResultInfo() {\r\n\t \tif($scope.existingServiceDeskInfo.serviceDeskYearlyDataInfoDtoList != null){\r\n\t \t\tfor (var y = 0; y < $scope.existingServiceDeskInfo.serviceDeskYearlyDataInfoDtoList.length; y++){\r\n\t \t\tvar yearlyDto = $scope.existingServiceDeskInfo.serviceDeskYearlyDataInfoDtoList[y];\r\n\t \t\tgetExistingServerPricingLevelWiseInfo($scope.serviceDeskInfo.contact.children[0],yearlyDto,y);\r\n\r\n\t \t}\r\n\t \t}\r\n\t }", "function salesByProduct(products, lineItems){\n //TODO\n}", "function totalSale(){\n\n console.log(sale.name);\n}", "function showSale(){ \n // clear the console\n console.log('\\033c');\n // displaying the product list\n console.log(`\\x1b[7m Product Sales By Department \\x1b[0m`);\n // creating the query string\n var query = 'SELECT D.department_id AS \"DeptID\", D.department_name AS \"Department\", D.over_head_costs AS \"OverHeadCosts\", SUM(P.product_sales) AS \"ProductSales\", '; \n query += 'SUM(P.product_sales) - D.over_head_costs AS \"TotalProfit\" FROM departments D INNER JOIN products P ON D.department_name = P.department_name ';\n query += 'GROUP BY D.department_id';\n\n connection.query(\n query,\n function(err, res){\n if (err) throw err;\n\n console.table(\n res.map(rowData => {\n return{ \n \"Dept ID\": rowData.DeptID,\n \"Department Name\": rowData.Department,\n \"Over Head Costs\": rowData.OverHeadCosts,\n \"Product Sales\": rowData.ProductSales,\n \"Total Profit\": rowData.TotalProfit\n }\n })\n );\n endRepeat();\n }\n );\n}", "function reasonable_products(products){\n let res=[];\n products.forEach((product, i) => {\n if(product.price<=100){\n res.push(product);\n }\n });\n return res;\n}", "function getExistingServiceDeskYearlyInfo() {\r\n \tif($scope.existingServiceDeskInfo.serviceDeskYearlyDataInfoDtoList != null){\r\n \t\tfor (var y = 0; y < $scope.existingServiceDeskInfo.serviceDeskYearlyDataInfoDtoList.length; y++){\r\n \t\tvar yearlyDto = $scope.existingServiceDeskInfo.serviceDeskYearlyDataInfoDtoList[y];\r\n \t\t$scope.serviceDeskInfo.contact.children[0].distributedVolume[y].year = yearlyDto.year;\r\n \t\t$scope.serviceDeskInfo.contact.children[0].distributedVolume[y].volume = yearlyDto.totalContacts;\r\n \t\tgetExistingVolumeLevelWiseInfo($scope.serviceDeskInfo.contact.children[0],yearlyDto,y);\r\n \t\tgetExistingServerPricingLevelWiseInfo($scope.serviceDeskInfo.contact.children[0],yearlyDto,y);\r\n \t}\r\n \t}\r\n }", "function displaySaleItems() {\n var query = \"SELECT p.item_id AS Product_ID, p.product_name AS Item_Name, p.price AS Sale_Price FROM products p;\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n var productList = [];\n var productData = {};\n for (var i = 0; i < res.length; i++) {\n productData = { Product_ID: res[i].Product_ID, Item_Name: res[i].Item_Name, Sale_Price: res[i].Sale_Price };\n productList.push(productData);\n }\n console.log(\"\\r\\n***** PRODUCT LIST *****\\r\\n\")\n console.table(productList, \"\\r\\n\");\n purchaseItems();\n })\n}", "milkProducedPerShed(sp = this._milkPrice) {\n let jsonReport = {};\n for (let [key, values] of Object.entries(this._data)) {\n const total = values.cows * values.productionPerCow * sp;\n jsonReport[key] = total;\n }\n return JSON.parse(JSON.stringify(jsonReport));\n }", "function loopingData1() {\n //create a variable named 'saleDates' which should be initialized as an empty array.\n let saleDates = [];\n\n //write a for loop to iterate over sales data for store3, and uses the .push() method to add the value stored in the [date] key for each index of the array to our 'saleDates' variable\n for (let i = 0; i < store3.length; i++) {\n saleDates.push(store3[i]['date']);\n }\n\n //return the now populated 'saleDates' variable\n return saleDates;\n}", "function getTotalEarningsFrom(sales) {\n return sales.reduce(function (totalAmount, sale) {\n totalAmount += sale.amount;\n return totalAmount;\n }, 0);\n}", "function shop(shoppers,item){\n var person = [];\n var profit = 0;\n var stok = item[2];\n for (var i = 0; i < shoppers.length; i++){\n if(shoppers[i].product === item[0] && shoppers[i].amount <= stok){\n stok -= shoppers[i].amount;\n profit += item[1]*shoppers[i].amount;\n person.push(shoppers[i].name);\n }\n }\n return [person,profit,stok];\n }", "function getAndDisplaySellList() {\n getSellList();\n console.log('getAndDisplaySellList works');\n}", "function getDiscounts() {\n var pagina = 'ProjectPlans/listDiscounts';\n var par = `[{\"level\":\"1\"}]`;\n var tipo = 'json';\n var selector = putDiscounts;\n fillField(pagina, par, tipo, selector);\n}", "function recent_products(products){\n let res=[];\n products.forEach((product, i) => {\n if(dayDiff(Date.now(), new Date(product.released))<15){\n res.push(product);\n }\n });\n return res;\n}", "function getTotalProductSales(dept, newOHC) {\n connection.query(\"SELECT SUM(product_sales) AS totalProductSales FROM products WHERE department_name = ?\", [dept], function (err, res) {\n if (err) throw err;\n let totalProductSales;\n for (let i = 0; i < res.length; i++) {\n totalProductSales = res[i].totalProductSales;\n }\n console.log(\"Total product sales for \" + dept + \" is: \" + totalProductSales);\n updateProductSales(dept,newOHC, totalProductSales)\n })\n}", "function loadSaleData() {\n fetch(`https://arnin-web422-ass1.herokuapp.com/api/sales?page=${page}&perPage=${perPage}`)\n .then((response) => {\n return response.json();\n })\n .then((myJson) => {\n saleData = myJson;\n let rows = saleTableTemplate(saleData);\n $(\"#sale-table tbody\").html(rows);\n $(\"#current-page\").html(page);\n })\n}", "function moreOutfits() {\n getLooks();\n }", "function driversWithRevenueOver(driver, revenue){\n return driver.filter(thing => thing.revenue > revenue);\n}", "function getAllSales() {\n if (!sessionStorage.current_user) {\n window.location.href = \"index.html\";\n }\n var init = {\n method : 'GET',\n headers : header\n \n };\n\n req = new Request(sales_url,init)\n\n fetch(req)\n .then((res)=>{\n console.log(res);\n status = res.status\n return res.json();\n })\n .then((data)=>{\n if (status==401){\n window.location.href = \"index.html\";\n }\n\n rowNum = 1; //the row id\n data['Sales Record'].forEach(sale => {\n\n // save the queried data in a list for ease of retrieving\n\n sales_record[sale['sales_id']] = {\n \"user_id\": sale['user_id'],\n \"product_id\": sale['product_id'],\n \"quantity\": sale['quantity'],\n \"sales_amount\": sale['sales_amount'],\n \"sales_date\": sale['sales_date']\n };\n console.log(sales_record)\n sales_table = document.getElementById('tbl-products')\n let tr = createNode('tr'),\n td = createNode('td');\n \n\n // table data\n t_data=[\n rowNum,sale['product_name'],\n sale['username'],\n sale['sales_date'],\n sale['sales_amount']\n ];\n console.log(t_data)\n\n tr = addTableData(tr,td,t_data);\n console.log(tr);\n\n\n // add the view edit and delete buttons\n td = createNode('td')\n td.innerHTML=` <i id=\"${sale['sales_id']}\" onclick=\"showProductPane(this)\" class=\"fas fa-eye\"> </i>`;\n td.className=\"text-green\";\n appendNode(tr,td);\n console.log(\"here\")\n\n \n \n\n appendNode(sales_table,tr);\n rowNum +=1\n });\n\n });\n}", "storeLostGear(pmcData, offraidData, sessionID) {\n console.log(offraidData);\n\n for (let insuredItem of pmcData.InsuredItems) {\n let found = false;\n\n /* find item */\n for (let item of offraidData.profile.Inventory.items) {\n if (insuredItem.itemId === item._id) {\n found = true;\n break;\n }\n }\n\n /* item is lost */\n if (!found) {\n for (let item of pmcData.Inventory.items) {\n if (insuredItem.itemId === item._id) {\n this.addGearToSend(pmcData, insuredItem, item, sessionID);\n }\n }\n }\n }\n }", "function getMarketMovers(){\n fetch(baseStockUrl + \"gainers?\" + financialModelAPIKey)\n .then(function(response) {\n if (response.ok) {\n response.json().then(function (data) {\n renderGainers(data.splice(0,3))\n });\n } else {\n console.log(\"Error\" + response.statusText);\n }\n })\n .catch(function (error) {\n console.log(\"unable to connect to financial model\");\n }); \n fetch(baseStockUrl + \"losers?\" + financialModelAPIKey)\n .then(function(response) {\n if (response.ok) {\n response.json().then(function (data) {\n renderLosers(data.splice(0,3))\n });\n } else {\n console.log(\"Error\" + response.statusText);\n }\n })\n .catch(function (error) {\n console.log(\"unable to connect to financial model\");\n }); \n}", "stockEarnings(stockSymbol) {\n return this.request(`/stock/${stockSymbol}/earnings`);\n }", "function soldItems(){\n reportInfo.style.display = \"block\";\n\n $.ajax({\n url:\"/getSold\",\n type:\"post\", //\"post\" is behind the scenes (invisible) versus \"get\" (hijackable)\n success:function(resp){\n //loop through the select\n for(var i = 0; i<resp.length; i++){\n var tr = reportInfo.insertRow();\n var name = document.createElement(\"td\");\n var price = document.createElement(\"td\");\n var qty = document.createElement(\"td\");\n var type = document.createElement(\"td\");\n var revenue = document.createElement(\"td\");\n \n var soldQty = startQty - resp[i].qty;\n var revenueEarned = soldQty * resp[i].price;\n \n name.textContent = resp[i].itemname;\n price.textContent = resp[i].price;\n qty.textContent = soldQty;\n type.textContent = resp[i].type;\n revenue.textContent = \"$\" + revenueEarned;\n\n tr.appendChild(name);\n tr.appendChild(price);\n tr.appendChild(qty);\n tr.appendChild(type);\n tr.appendChild(revenue);\n \n if(resp[i].type == \"main\"){\n mainPrice += revenueEarned;\n } else if(resp[i].type == \"sides\") {\n sidePrice += revenueEarned;\n } else if(resp[i].type == \"dessert\") {\n dessPrice += revenueEarned;\n } else if(resp[i].type == \"beverage\") {\n bevPrice += revenueEarned;\n }\n \n revenueTotalPrice = revenueTotalPrice + revenueEarned;\n }\n revenueTotal.innerHTML = \"Total price of earned revenue: $\" + revenueTotalPrice;\n }\n });\n }", "function bestSales(sales) {\n let output = {};\n let tempId = 0;\n let tempAmount = 0;\n sales.forEach(element => {\n let currentId = element.productId;\n let currentAmount = element.amount;\n if(tempId === 0){\n tempId = currentId;\n tempAmount += currentAmount;\n }else{\n if(currentAmount > tempAmount && currentId !== tempId){\n tempAmount = currentAmount;\n tempId = currentId;\n }else if(currentId === tempId){\n tempAmount += currentAmount;\n }\n }\n\n });\n\n if(tempId){\n output.id = tempId;\n output.total = tempAmount;\n }\n\n return output;\n}", "function fetchAllReceipt_view()\r\n\t{\r\n\t\tReceiptService.fetchAllReceipt_view()\r\n\t\t.then(\r\n\t\t\t\tfunction(receipt)\r\n\t\t\t\t{\r\n\t\t\t\t\tself.receipts=receipt;\r\n\t\t\t\t\tself.Filterreceipts=self.receipts;\r\n\t\t\t\t\tconsole.log(self.Filterreceipts);\r\n\t\t\t\t\tpagination();\r\n\t\t\t\t},\r\n\t\t\t\tfunction(errResponse)\r\n\t\t\t\t{\r\n\t\t\t\t\tconsole.log('Error while fetching Receipt');\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t}", "function findAll(req, res, next) {\n req.session.stock = {};\n const collection = db.collection('stock');\n collection.find({\n \"type\": \"stock\"\n }, function(err, stocks) {\n stocks.forEach(function(d) {\n req.session.stock[d.ticker] = [d.actual, d.difference];\n });\n });\n setTimeout(function() {\n next();\n }, 2000)\n }", "allStrongBeverages(strength) {\n // Using a local variable to collect the items.\n //\n var collector = [];\n\n // The DB is stored in the variable DB2, with \"spirits\" as key element. If you need to select only certain\n // items, you may introduce filter functions in the loop... see the template within comments.\n //\n for (let i = 0; i < this.DB2.spirits.length; i++) {\n // We check if the percentage alcohol strength stored in the data base is lower than the\n // given limit strength. If the limit is set to 14, also liqueuers are listed.\n //\n if (percentToNumber(this.DB2.spirits[i].alkoholhalt) > strength) {\n // The key for the beverage name is \"namn\", and beverage type is \"varugrupp\".\n //\n collector.push([\n this.DB2.spirits[i].namn,\n this.DB2.spirits[i].varugrupp,\n ]);\n }\n }\n\n // Don't forget to return the result.\n //\n return collector;\n }", "findNewProducts(oldProductsObj, newProductsObj, app) {\n const result = [];\n for(let key in newProductsObj) {\n if(!oldProductsObj[key]) {\n const resObj = {\n url: newProductsObj[key].url,\n id: newProductsObj[key].id,\n category: newProductsObj[key].category,\n name: newProductsObj[key].name,\n new: 'YES'\n };\n if ( app === 'hotp' ) {\n resObj['new amount'] = newProductsObj[key].quantity;\n resObj['new price'] = newProductsObj[key].price;\n resObj['new price - 30%'] = newProductsObj[key]['price - 30%'];\n } else {\n resObj['new price'] = newProductsObj[key].price;\n resObj['new price - 20%'] = newProductsObj[key]['price - 20%'];\n }\n result.push(resObj);\n } else if(oldProductsObj[key].removed === '1' && newProductsObj[key].removed !== '1') {\n const resObj = {\n url: newProductsObj[key].url,\n id: newProductsObj[key].id,\n category: newProductsObj[key].category,\n name: newProductsObj[key].name,\n appeared: 'YES',\n };\n if ( app === 'hotp' ) {\n resObj['old amount'] = oldProductsObj[key].quantity,\n resObj['new amount'] = newProductsObj[key].quantity;\n resObj['old price'] = oldProductsObj[key].price,\n resObj['old price - 30%'] = oldProductsObj[key]['price - 30%'],\n resObj['new price'] = newProductsObj[key].price;\n resObj['new price - 30%'] = newProductsObj[key]['price - 30%'];\n } else {\n resObj['old price'] = oldProductsObj[key].price,\n resObj['old price - 20%'] = oldProductsObj[key]['price - 20%'],\n resObj['new price'] = newProductsObj[key].price;\n resObj['new price - 20%'] = newProductsObj[key]['price - 20%'];\n }\n result.push(resObj);\n }\n }\n return result;\n }", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "function getProductsStore(selectedStoreName) {\n \n // get the data in the active sheet \n var sheet = getOutputSheet(1); \n \n var cell = getOutputFirstCell(1);\n \n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select F, G, H, K, sum(I), max(L) where J='No Vendido' and K='\"+selectedStoreName+\"' group by G, F, H, K\\\")\");\n \n\t// create a 2 dim area of the data in the carrier names column and codes \n\tvar products = sheet.getRange(2, 1, sheet.getLastRow() -1, 6).getValues().reduce( \n\t\tfunction(p, c) { \n \n // add the product to the list\n\t\t\tp.push(c); \n\t\t\treturn p; \n\t\t}, []); \n \n return JSON.stringify(products);\n}", "function chatSaleService(salesServiceRecord){\r\n var serviceFlagCounter =0;\r\n var salesFlagCounter=0;\r\n var onlyServiceData = [];\r\n var onlySaleData = [];\r\n\r\n for(var i=0; i<salesServiceRecord.length; i++){\r\n if(salesServiceRecord[i].SALE_SERVICE_FLAG == \"SERVICE\"){\r\n serviceFlagCounter++;\r\n onlyServiceData.push(salesServiceRecord[i]);\r\n }\r\n else if(salesServiceRecord[i].SALE_SERVICE_FLAG == \"SALES\"){\r\n salesFlagCounter++;\r\n onlySaleData.push(salesServiceRecord[i]);\r\n }\r\n else{ \r\n } \r\n }\r\n salesServiceDoughnut(serviceFlagCounter, salesFlagCounter);\r\n getOnlyChatServiceData(onlyServiceData, serviceFlagCounter);\r\n getOnlyChatSaleData(onlySaleData, salesFlagCounter);\r\n }", "getTotalNumberOfSales() {\n var sum = 0;\n for(var i = 0; i <= this.employees.length - 1; i++){\n sum += this.employees[i].salesUnits;\n\n }\n return sum;\n }", "function filterSalesRecords(event) {\n\t\n\t//construct empty retrieve JSON object\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"retrieve\"\n\t\t\t}\n\t\t]\n\t};\n\t\n\t//console.log(json);\n\t\n\treturn sendAPIRequest(json, event, displaySalesRecords);\n}", "function productsales(){\n\n var query=\"select departments.department_id,departments.department_name,departments.over_head_costs,sum(products.product_sales) as productsales from departments \" \n + \"left join products on departments.department_name=products.department_name where products.product_sales is not null \"\n + \"group by products.department_name\";\n connection.query(query, function(err,res){\n if(err) throw err;\n //if no record found\n if(res.length<=0)\n {\n console.log(\"\\nNo Records found!!\\n\");\n }\n else\n {\n \n var table = new Table({\n head: ['Id', 'department_name', 'over_head_costs','product_sales','total_profit']\n , colWidths: [4, 20, 17, 15, 15]\n });\n for(i=0;i<res.length;i++){\n var total_profit=((res[i].productsales)-(res[i].over_head_costs));\n table.push(\n [res[i].department_id, res[i].department_name, res[i].over_head_costs, res[i].productsales,total_profit]\n );\n }\n \n console.log(table.toString());\n }\n runSearch();\n });\n}", "function fetchNonprofit(ein) {\n return new Promise(function (resolve, reject) {\n external_commonjs_vue_commonjs2_vue_root_Vue_default.a.axios.get(\"\".concat(IRSSearchAPI, \"/nonprofits/\").concat(ein)).then(function (response) {\n resolve(response.data[0]);\n }).catch(function () {\n reject({\n code: 404\n });\n });\n });\n}", "function getCertainParties(){\n btnFeedback('secular')\n resultParties = [];\n resultParties = parties.filter(party => {\n return party.secular == true;\n });\n }", "function totalSales(companysSales) {\n var sum = 0;\n for (var i = 0; i < companysSales.length; i++) {\n sum += companysSales[i];\n }\n return sum;\n}", "function viewSales() {\n connection.query(\"SELECT departments.Department_ID,departments.Department_Name,SUM(departments.Over_Head_Costs) AS Total_Costs,SUM(products.Product_Sales) AS Total_Sales,(SUM(products.Product_Sales)-SUM(departments.Over_Head_Costs)) AS Total_Profit FROM departments LEFT JOIN products ON departments.Department_Name = products.Department_Name GROUP BY Department_ID\",\n\n // CREATES TABLE FOR DEPARTMENT SALES //\n function (err, res) {\n if (err) throw err;\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗'\n , 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝'\n , 'left': '║', 'left-mid': '╟', 'mid': '─', 'mid-mid': '┼'\n , 'right': '║', 'right-mid': '╢', 'middle': '│'\n }\n }); \n\n // SPECIFIES WHERE DATA FROM DATABASE IS PLACED IN TABLE //\n table.push(\n [colors.cyan('Department ID#'), colors.cyan('Department Name'), colors.cyan('Overhead Costs'), colors.cyan('Product Sales'), colors.cyan(\"Total Profit\")]\n );\n\n // ITERATES THROUGH ALL ITEMS AND FILLS TABLE WITH ALL RELEVANT INFORMATION FROM DATABASE //\n for (var i = 0; i < res.length; i++) {\n\n // SETTING UP FUNCTIONS TO PREVENTS DATA BEING DISPLAYED AS NULL //\n let tSales = res[i].Total_Sales;\n let pSales = res[i].Total_Profit;\n \n // VALIDATES TOTAL SALES //\n function validateT (amt){\n if (amt === null){\n return 0.00;\n } else return amt;\n }; \n\n // VALIDATES PRODUCT SALES //\n function validateP (amt){\n if (amt === null){\n return 0.00;\n } else return amt;\n }; \n\n table.push(\n [colors.cyan(res[i].Department_ID), res[i].Department_Name, \"$\" + res[i].Total_Costs, '$' + validateT(tSales), \"$\" + validateP(pSales)]\n );\n }\n console.log(table.toString());\n console.log(colors.grey(\"----------------------------------------------------------------------\"));\n \n // PROMPTS WITH SUPERVISOR SELECTION //\n runInquirer();\n })\n}", "function driversWithRevenueOver(driversObj, revenue) {\n return driversObj.filter(driver => driver[\"revenue\"] > revenue);\n}", "function excelReportDiscountsOffered(){\n\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t type: 'GET',\n\t\t\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/grandtotal_discounts?startkey=[\"'+request_date+'\"]&endkey=[\"'+request_date+'\"]',\n\t\t\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\t\t\t\tvar temp_discountedOrdersCount = 0;\n\t\t\t\t\t\t\t\tvar temp_discountedOrdersSum = 0;\n\n\t\t\t\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\ttemp_discountedOrdersCount = data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\ttemp_discountedOrdersSum = data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\texcelReportData_Overall.push({\n\t\t\t\t\t\t\t\t\t\"name\": 'Discount',\n\t\t\t\t\t\t\t\t\t\"value\": temp_discountedOrdersSum\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\t//Step 4: Total Round Off made\n\t\t\t\t\t\t\t\texcelReportRoundOffMade();\n\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t\t\thideLoading();\n\t\t\t\t\t\t\t\tshowToast('System Error: Failed to calculate discounts. Please contact Accelerate Support.', '#e74c3c');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}); \t\n\t\t\t\t\t} //end - step 3", "function processAllDailySales(){\n for (var index = 0; index < allStores.length; index++){\n processDailySales(allStores[index]);\n }\n\n}", "function GetProducListFromUI() {\n var returnProductList = [];\n\n\n var rowCount = $('#itemList').rowCount();\n for (var iProd = 1; iProd <= rowCount; iProd++) {\n var prod_ID = iProd;\n var prod_name = $('#itemName' + iProd).val();\n var prod_HSNCode = $('#itemHSNSAC' + iProd).val();\n var prod_description = $('#itemDescription' + iProd).val();\n var prod_Gst = $('#itemGST' + iProd).val();\n var prod_Rate = $('#itemRate' + iProd).val();\n var prod_Qty = $('#itemQty' + iProd).val();\n var prod_TotalAmount = $('#itemAmount' + iProd).val();\n var product = { Name: prod_name, HSNCode: prod_HSNCode, Description: prod_description, GSTPercentage: prod_Gst, ID: prod_ID }\n returnProductList.push(product);\n }\n }", "function getOutskirtShop()\r\n {\r\n \r\n var outskirtShop = \"Type(?WarehouseShop, Shop), PropertyValue(?WarehouseShop, hasRoad, MotorwayRoad)\";\r\n \r\n new jOWL.SPARQL_DL(outskirtShop).execute({ onComplete : displayOutskirtShops});\r\n \r\n }", "function restrictListProducts(prods) {\r\n\tlet product_names = [];\r\n\tprods.sort((a,b) => a.price - b.price);\r\n\tfor (let i=0; i<prods.length; i+=1) {\r\n\t\tif (!(((document.getElementById(\"lactoseFree\").checked==true) && (prods[i].lactoseFree == false)) ||\r\n\t\t((document.getElementById(\"nutFree\").checked==true) && (prods[i].nutFree == false)) ||\r\n\t\t((document.getElementById(\"organic\").checked==true) && (prods[i].organic == false)) ))\r\n\t\t{\r\n\t\t\tproduct_names.push(prods[i].name)\r\n\t\t}\r\n\t}\r\n\r\n\treturn product_names;\r\n}", "deliveries() {\n let allDeliveries = this.employees().map(employee => {\n return employee.deliveries();\n });\n let merged = [].concat.apply([], allDeliveries);\n return merged;\n }", "function scrapeNeighborhoodSalesAndImprovements(resultArr){\n\t\tconsole.log(\"scraping NSI and Imps\");\n\t\tvar promiseArr = [];\n\t\tvar neighborhoodSalesURL = utils.getNeighborhoodSalesURL(utils.padToNine(index));\n\t\tpromiseArr.push(xP([neighborhoodSalesURL, {neighborhoodSales: css.neighborhoodSalesInfo}])()); //scrape neighborhood sales info\n\t\tvar impnbr = resultArr[0].propertyInventory.numberOfImprovements;\n\t\tconsole.log(\"impnbr: \" + impnbr);\n\t\tconsole.log(utils.getPropertyImpURLs(propertyNumber, 3));\n\t\tif (impnbr > 1){\n \t\tvar propertyImpURLs = utils.getPropertyImpURLs(propertyNumber, impnbr);\n\t\t\tconsole.log(\"propimpurl: \" + propertyImpURLs);\n \t\t//console.log(\"propimpurl length: \" + propertyImpURLs.length);\n \t\tfor (var u = 0; u < propertyImpURLs.length; u++){\n\t\t\t\tpromiseArr.push(xP([propertyImpURLs[u], {propertyInventory: css.propertyInventory, improvements: css.improvements}])()); //scrape improvement info\n \t\t}\n\t\t}\n\t\tresultArr.push(promiseArr);\n\t\tconsole.log(\"finished scraping NSI and Imps\");\n\t\treturn resultArr;\n\t}", "function listUnspent1x2(redeem) {\n\n\t}", "function listUnspent2x2(redeem) {\n\n\t}", "function calculateProfit() {\n var spentCash = 100 - totalCash;\n var stockSaleCash = 0;\n var profit;\n for (var i = 0; i < arr1.length; i++) {\n //var calprice = Number(arr1[i].currentStockValue());\n stockSaleCash = Number(Number(stockSaleCash) + Number(arr1[i].currentStockValue())).toFixed(2);\n }\n profit = Number(stockSaleCash - spentCash).toFixed(2);\n\t\t\t\ttotalCash= Number(totalCash)+Number(stockSaleCash);\n $('.finalProfitDisplay').append('<span>Total Profit Made :: ' + profit + '</span>');\n\t\t\t\t$('#totalCash').find('span').remove();\n $('#totalCash').append('<span>' + totalCash+ '</span>');\n }", "function querySaleProducts() {\n\tinquirer\n\t.prompt({\n\t\tname: \"customer_name\",\n\t\ttype: \"input\",\n\t\tmessage: \"Dear Customer, please enter your name.\"\n\t})\n\t.then(function(answer) {\n\t\tconsole.log(\"Welcome to Bamazon, \" + answer.customer_name + \":) Here is our special sales for you!\");\n\n\t\tvar query = \"SELECT * FROM products WHERE stock_quantity <> 0\";\n\n\t\tconnection.query(query, function(err, res) {\n\t\t\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Item ID: \" + res[i].item_id + \" | \" + res[i].department_name + \": \" + res[i].product_name + \" for $\" + numberWithCommas(res[i].price));\n\t\t}\n\n\t\tqueryOrder();\n\t\t});\t\n\t});\n}", "function getAllExistingOffers() {\n var query = datastore.createQuery(\"Offer\");\n\n return datastore.runQuery(query)\n .then(res => {\n return res[0];\n })\n}", "function generateClubSavings(products) {\n var clubSavingsProportion = .2\n var maxSavings = .3\n var tempClubSavings = { }\n for (product in products) {\n if(Math.random() < clubSavingsProportion) {\n var clubSavings = Math.floor(products[product].price * (Math.random() * maxSavings) * 10) / 10\n if (clubSavings === 0) {\n clubSavings = .1\n }\n tempClubSavings[product] = clubSavings\n }\n }\n return tempClubSavings\n}", "function getProductsHarvested(month, year) {\n\tvar start = new Date(year, month, 1);\n\tvar end = new Date(year, month+1, 1);\n\tvar harvestsInDateRange = HarvestLog.find({'date': {$gte: start, $lt: end}}, {fields: {itemname:1}});\n\tvar products = _.uniq(harvestsInDateRange.fetch().map(function(log) { return log.itemname}));\n\treturn products;\n}", "function viewDepartmentSales() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n 2: {\n alignment: 'right'\n },\n 3: {\n alignment: 'right'\n },\n 4: {\n alignment: 'right'\n }\n }\n };\n data[0] = [\"Department ID\".cyan, \"Department Name\".cyan, \"Over Head Cost ($)\".cyan, \"Products Sales ($)\".cyan, \"Total Profit ($)\".cyan];\n let queryStr = \"departments AS d INNER JOIN products AS p ON d.department_id=p.department_id GROUP BY department_id\";\n let columns = \"d.department_id, department_name, over_head_costs, SUM(product_sales) AS sales\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n DEPARTMENTS\".magenta);\n for (let i = 0; i < res.length; i++) {\n let profit = res[i].sales - res[i].over_head_costs;\n data[i + 1] = [res[i].department_id.toString().yellow, res[i].department_name, res[i].over_head_costs.toFixed(2), res[i].sales.toFixed(2), profit.toFixed(2)];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "function salesReport(req, res) {\n let db = req.app.get('db');\n let limit = req.body.limit || 50;\n let offset = req.body.offset || 0;\n let baseQuery = `SELECT * from items where sold = true`;\n\n // if sortAttr is provided, add sort command to the query\n let sortAttr = req.body.sortAttr;\n let sortOrder = req.body.sortOrder || 'asc';\n if (sortAttr) baseQuery += ` order by ${sortAttr} ${sortOrder}`\n\n // add limit and offset to the query\n baseQuery += ` limit $1 offset $2`\n\n return db.query(baseQuery, [limit, offset])\n .then(items => {\n let numResults = items.length;\n let offsetForNextPage = offset + numResults;\n let offsetForPrevPage = offset - limit;\n if (offsetForPrevPage < 0) offsetForPrevPage = 0;\n // If we dont get a full set of results back, we're at the end of the data\n if (numResults < limit) offsetForNextPage = null;\n let data = {\n items,\n offsetForPrevPage: offsetForPrevPage,\n offsetForNextPage, offsetForNextPage\n }\n return sendSuccess(res, data);\n })\n .catch(e => sendError(res, e, 'salesReport'))\n}", "function getSalesDays() {\n\t\t\treturn new Promise ((resolve, reject)=> {\n\t\t\t\tdb.findMany(Sales, {}, 'date', function(result) {\n\t\t\t\t\tvar uniqueDates = [];\n\t\t\t\t\tvar unique = 1;\n\n\t\t\t\t\tfor (var i=0; i<result.length; i++) {\n\t\t\t\t\t\tvar date = new Date (result[i].date);\n\t\t\t\t\t\tvar unique = 1;\n\t\t\t\t\t\tdate.setHours(0,0,0,0);\n\n\t\t\t\t\t\t//checks if the date is new/unique, -1 means that it's not in the array\n\t\t\t\t\t\tfor (var j=0; j < uniqueDates.length; j++) {\n\t\t\t\t\t\t\tvar arrayDate = new Date (uniqueDates[j]);\n\t\t\t\t\t\t\tarrayDate.setHours(0,0,0,0);\n\t\t\t\t\t\t\t//console.log(\"date: \" + date + \", array date: \" + arrayDate);\n\t\t\t\t\t\t\t//console.log(uniqueDates);\n\t\t\t\t\t\t\tif (!(date > arrayDate || date < arrayDate)) {\n\t\t\t\t\t\t\t\tunique = 0;\n\t\t\t\t\t\t\t\t//console.log(\"not unique\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (unique == 1)\n\t\t\t\t\t\t\tuniqueDates.push(date)\n\n\t\t\t\t\t\t//console.log(uniqueDates);\n\t\t\t\t\t}\n\t\t\t\t\tresolve (uniqueDates)\n\t\t\t\t})\n\t\t\t})\n\t\t}", "function salesByDep() {\n // console.log(\"loading product sales...\");\n\n // join department and products \n // table needs to have depid, depName, overhead, productSales and totalProfits \n\n\nconnection.query(`SELECT departments.department_id AS 'Department ID', \ndepartments.department_name AS 'Department Name', \ndepartments.over_head_costs as 'Overhead Costs', \nSUM(products.product_sales) AS 'Product Sales', \n(SUM(products.product_sales) - departments.over_head_costs) AS 'Total Profit' \nFROM departments\nLEFT JOIN products on products.department_name=departments.department_name\nGROUP BY departments.department_name, departments.department_id, departments.over_head_costs\nORDER BY departments.department_id ASC`, (err, res) => {\n if (err) throw err;\n console.log('\\n ----------------------------------------------------- \\n');\n console.table(res);\n\n startSuper();\n\n });\n\n\n}" ]
[ "0.61157554", "0.5692415", "0.5599473", "0.55588496", "0.5500307", "0.54688597", "0.5408894", "0.5382795", "0.5346829", "0.5335059", "0.5281104", "0.5265118", "0.52641475", "0.525718", "0.52004206", "0.5200095", "0.51901793", "0.5168106", "0.51667845", "0.5166086", "0.51537263", "0.5140143", "0.5127702", "0.51254296", "0.51122487", "0.50828797", "0.50774527", "0.50674874", "0.5053107", "0.50494534", "0.5047179", "0.5042638", "0.5021776", "0.5016475", "0.50103056", "0.49962047", "0.49833778", "0.4974115", "0.4963514", "0.4955772", "0.4951498", "0.49362698", "0.49347848", "0.493037", "0.49238214", "0.49163115", "0.49012074", "0.48930994", "0.48915976", "0.48682654", "0.48642933", "0.48636952", "0.48622352", "0.4861613", "0.48608094", "0.48353755", "0.48234692", "0.48183182", "0.4817323", "0.48132095", "0.48055664", "0.48048902", "0.4790733", "0.478945", "0.47797868", "0.47790697", "0.47779718", "0.47696352", "0.47650772", "0.4764189", "0.4762823", "0.47503868", "0.4750232", "0.47478163", "0.4744211", "0.4742155", "0.47390658", "0.4739016", "0.47387233", "0.4738373", "0.47368684", "0.47355863", "0.47248316", "0.47241798", "0.47199386", "0.47136354", "0.47133434", "0.4708197", "0.47068885", "0.47002134", "0.46989504", "0.46926728", "0.468805", "0.46841246", "0.4681353", "0.46799734", "0.46786386", "0.4676541", "0.4674556", "0.4672358" ]
0.53702885
8
This function shows the details for a specific lost sale
function showLostSaleDetails(itemID) { var errArea = document.getElementById("errAllLostSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#LostSaleDetails').hide(); currentItem = list.getItemById(itemID); context.load(currentItem); context.executeQueryAsync( function () { $('#lostSale').val(currentItem.get_fieldValues()["Title"]); $('#lostSalePerson').val(currentItem.get_fieldValues()["ContactPerson"]); $('#lostSaleNumber').val(currentItem.get_fieldValues()["ContactNumber"]); $('#lostSaleEmail').val(currentItem.get_fieldValues()["Email"]); $('#lostSaleStatus').val(currentItem.get_fieldValues()["_Status"]); $('#lostSaleAmount').val("$" + currentItem.get_fieldValues()["DealAmount"]); $('#LostSaleDetails').fadeIn(500, null); }, function (sender, args) { var errArea = document.getElementById("errAllLostSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode(args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totalSale(){\n\n console.log(sale.name);\n}", "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "function convertToLostSale(itemID) {\n $('#AllOpps').hide();\n $('#OppDetails').hide();\n clearEditOppForm();\n\n currentItem.set_item(\"_Status\", \"Lost Sale\");\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditOppForm();\n showLostSales();\n }\n ,\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n}", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function showCustomerSale(customerId,product_id){\n $(\".shopInfo\").css(\"display\", \"block\");\n custModule.queryCustomerRecord(customerId,product_id,function(responseData) {\n var httpResponse = JSON.parse(responseData.response);\n if (responseData.ack == 1 && httpResponse.retcode ==200) {\n var retData = httpResponse.retbody;\n $(\"#sale_dt\").html(common.isNotnull(retData.sale_dt) ? retData.sale_dt : '-');\n $(\"#last_sale_price\").html(common.isNotnull(retData.sale_price) ?'¥'+ retData.sale_price : '-');\n $(\"#last_sale_num\").html(common.isNotnull(retData.sale_num) ? retData.sale_num + retData.unit: '-');\n if(retData.sale_price){\n $(\".product_price\").val(retData.sale_price);\n }\n } else {\n $.toast(\"本地网络连接有误\", 2000, 'error');\n }\n });\n }", "populateSale(sale) {\n $.each(sale, (key, sala) => {\n $(\".saleTbody\").append('<tr class= \"saleTr\"><td class=\"nomeSala\">' + sala.Nome + '</td><td class=\"nomeEdificio\">' + sala.NomeEdificio + '</td><td class=\"stato\">' + sala.Stato + '</td></tr>');\n $(\".saleTbody\").append('<tr><td class=\"numeroPostiDisponibili\" colspan=\"3\"><h6> Numero posti disponibili: </h6>' + sala.NumeroPostiDisponibili + '</td></tr>');\n });\n $('.saleTr').click(function () {\n $(this).nextUntil('.saleTr').toggleClass('hide');\n }).click();\n }", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function showLostSales() {\n $('#LeadsTile').css(\"background-color\", \"#0072C6\");\n $('#OppsTile').css(\"background-color\", \"#0072C6\");\n $('#SalesTile').css(\"background-color\", \"#0072C6\");\n $('#LostSalesTile').css(\"background-color\", \"orange\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n\n var errArea = document.getElementById(\"errAllLostSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n var haslostSales = false;\n hideAllPanels();\n var saleList = document.getElementById(\"AllLostSales\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Success returned from executeQueryAsync\n var saleTable = document.getElementById(\"LostSaleList\");\n\n // Remove all nodes from the lostSale <DIV> so we have a clean space to write to\n while (saleTable.hasChildNodes()) {\n saleTable.removeChild(saleTable.lastChild);\n }\n // Iterate through the Propsects list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n // Create a DIV to display the organization name\n var lostSale = document.createElement(\"div\");\n var saleLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n lostSale.appendChild(saleLabel);\n\n // Add an ID to the lostSale DIV\n lostSale.id = listItem.get_id();\n\n // Add an class to the lostSale DIV\n lostSale.className = \"item\";\n\n // Add an onclick event to show the lostSale details\n $(lostSale).click(function (sender) {\n showLostSaleDetails(sender.target.id);\n });\n\n saleTable.appendChild(lostSale);\n haslostSales = true;\n }\n }\n if (!haslostSales) {\n var noLostSales = document.createElement(\"div\");\n noLostSales.appendChild(document.createTextNode(\"There are no lost sales.\"));\n saleTable.appendChild(noLostSales);\n }\n $('#AllLostSales').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get lost sales. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#LostSaleList').fadeIn(500, null);\n });\n}", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function updateSales(sales) {\n\tvar salesDiv = document.getElementById(\"sales\");\n\n\tfor (var i = 0; i < sales.length; i++) {\n\t\tvar sale = sales[i];\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.setAttribute(\"class\", \"saleItem\");\n\t\tdiv.innerHTML = sale.name + \" sold \" + sale.sales + \" gumbaslls\";\n\t\tsalesDiv.appendChild(div);\n\t}\n\t\n\tif (sales.length > 0) {\n\t\tlastReportTime = sales[sales.length-1].time;\n\t}\n}", "function convertToSale(itemID) {\n $('#AllOpps').hide();\n $('#OppDetails').hide();\n clearEditOppForm();\n\n currentItem.set_item(\"_Status\", \"Sale\");\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditOppForm();\n showSales();\n }\n ,\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n}", "function viewSale() {\n // console.log(\"view product....\")\n\n connection.query(\"SELECT * FROM products\", (err, data) => {\n if (err) throw err;\n console.table(data);\n connection.end();\n })\n}", "function forSale() {\n\t//Select item_id, product_name and price from products table.\n\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(error, results) {\n\t\tif (error) throw error;\n\t\tconsole.log(\"\\n\");\n\t\t//the below code displays the item_id, product_name and the price for all of items that available for sale. \n\t\tfor ( var index = 0; index < results.length; index++) {\n\t\t\tconsole.log(\"Product Id: \" + results[index].item_id + \"\\n\" +\n\t\t\t \"Product Name: \" + results[index].product_name + \"\\n\" +\n\t\t\t \"Price: $\" + results[index].price + \"\\n\" + \"Quantity: \" + results[index].stock_quantity + \"\\n\" + \n\t\t\t \"--------------------------------------------------------------------------\\n\");\n\t\t}// end for loop\n\t\trunSearch();\n\t});// end of query.\n\t\n} // end of forSale function", "function saleToggle(event) {\n // console.log(event);\n if (event.target.name === 'sale') {\n currentInventory.beers[event.target.id].toggleSale();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "function printStoreDetails() {\n console.log(\"\\n\");\n console.log(chalk.white.bgBlack.bold(\"Days opened: \" + store.days));\n console.log(chalk.white.bgBlack.bold(\"Money: $\" + store.money));\n console.log(\"\\n\");\n}", "function showSale(){ \n // clear the console\n console.log('\\033c');\n // displaying the product list\n console.log(`\\x1b[7m Product Sales By Department \\x1b[0m`);\n // creating the query string\n var query = 'SELECT D.department_id AS \"DeptID\", D.department_name AS \"Department\", D.over_head_costs AS \"OverHeadCosts\", SUM(P.product_sales) AS \"ProductSales\", '; \n query += 'SUM(P.product_sales) - D.over_head_costs AS \"TotalProfit\" FROM departments D INNER JOIN products P ON D.department_name = P.department_name ';\n query += 'GROUP BY D.department_id';\n\n connection.query(\n query,\n function(err, res){\n if (err) throw err;\n\n console.table(\n res.map(rowData => {\n return{ \n \"Dept ID\": rowData.DeptID,\n \"Department Name\": rowData.Department,\n \"Over Head Costs\": rowData.OverHeadCosts,\n \"Product Sales\": rowData.ProductSales,\n \"Total Profit\": rowData.TotalProfit\n }\n })\n );\n endRepeat();\n }\n );\n}", "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function viewProductsForSale(callback) {\n // Query DB\n connection.query(`SELECT id,\n product_name, \n department_name, \n price,\n stock_quantity\n FROM products`, function (error, results, fields) {\n if (error) throw error;\n\n // Display results\n console.log();\n console.table(results);\n\n if (callback) {\n callback();\n }\n });\n}", "function getAllSales() {\n if (!sessionStorage.current_user) {\n window.location.href = \"index.html\";\n }\n var init = {\n method : 'GET',\n headers : header\n \n };\n\n req = new Request(sales_url,init)\n\n fetch(req)\n .then((res)=>{\n console.log(res);\n status = res.status\n return res.json();\n })\n .then((data)=>{\n if (status==401){\n window.location.href = \"index.html\";\n }\n\n rowNum = 1; //the row id\n data['Sales Record'].forEach(sale => {\n\n // save the queried data in a list for ease of retrieving\n\n sales_record[sale['sales_id']] = {\n \"user_id\": sale['user_id'],\n \"product_id\": sale['product_id'],\n \"quantity\": sale['quantity'],\n \"sales_amount\": sale['sales_amount'],\n \"sales_date\": sale['sales_date']\n };\n console.log(sales_record)\n sales_table = document.getElementById('tbl-products')\n let tr = createNode('tr'),\n td = createNode('td');\n \n\n // table data\n t_data=[\n rowNum,sale['product_name'],\n sale['username'],\n sale['sales_date'],\n sale['sales_amount']\n ];\n console.log(t_data)\n\n tr = addTableData(tr,td,t_data);\n console.log(tr);\n\n\n // add the view edit and delete buttons\n td = createNode('td')\n td.innerHTML=` <i id=\"${sale['sales_id']}\" onclick=\"showProductPane(this)\" class=\"fas fa-eye\"> </i>`;\n td.className=\"text-green\";\n appendNode(tr,td);\n console.log(\"here\")\n\n \n \n\n appendNode(sales_table,tr);\n rowNum +=1\n });\n\n });\n}", "async showItemsForSale() {\n const character = this.character;\n\n let description = character.location.getDescription(character)\n + character.location.getShopDescription(character, this.info.type);\n\n let attachments = new Attachments().add({\n title: \"What do you want to buy?\",\n fields: character.getFields(),\n color: COLORS.INFO\n });\n\n [description, attachments] = this.getEquipmentForSale(character, description, attachments);\n [description, attachments] = this.getSpellsForSale(character, description, attachments);\n [description, attachments] = this.getItemsForSale(character, description, attachments);\n\n attachments.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({ description, attachments });\n }", "function sumWithSale() {\n \n let sum = prompt(\"Введите сумму покупки:\");\n sum = Number(sum);\n let sale;\n if (sum > 500 && sum < 800) {\n sale = 0.03;\n } else if (sum > 800) {\n sale = 0.05;\n } else {\n sale = 0;\n };\n sum = sum - (sum * sale);\n let viewSale = sale * 100;\n alert(`Сумма покупки с учетом скидки - ${viewSale}% составляет: ${sum} грн.`);\n console.log(`3) Purchase sum with sale ${viewSale}%: ${sum} uah.`);\n }", "function getOutskirtShop()\r\n {\r\n \r\n var outskirtShop = \"Type(?WarehouseShop, Shop), PropertyValue(?WarehouseShop, hasRoad, MotorwayRoad)\";\r\n \r\n new jOWL.SPARQL_DL(outskirtShop).execute({ onComplete : displayOutskirtShops});\r\n \r\n }", "function infoTurnover() {\n var title = 'Turnover Rate';\n var msg = 'This measure refers to the average quantity sold per day over the last 30 days. ' +\n 'This helps to show the number of days worth of inventory is on hand.';\n app.showMessage(msg, title, ['Ok']);\n }", "function viewProductSales() {\n connection.query(\n 'SELECT department_id, departments.department_name, over_head_costs, sum(product_sales) as product_sales, sum(product_sales) - over_head_costs as total_profit FROM products right join departments on products.department_name=departments.department_name group by department_id, products.department_name, over_head_costs',\n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function find_hotel_sale (cb, results) {\n const criteriaObj = {\n checkInDate: sessionObj.checkindate,\n checkOutDate: sessionObj.checkoutdate,\n numberOfGuests: sessionObj.guests,\n numberOfRooms: sessionObj.rooms,\n hotel: results.create_hotel.id,\n or: [\n { saleType: 'fixed' },\n { saleType: 'auction' }\n ]\n }\n HotelSale.find(criteriaObj)\n .then(function (hotelSale) {\n sails.log.debug('Found hotel sales: ')\n sails.log.debug(hotelSale)\n\n if (hotelSale && Array.isArray(hotelSale)) {\n sails.log.debug('checking hotel sails')\n const sales = hotelSale.filter(function (sale) {\n const dateDif = new Date(sale.checkindate) - new Date()\n const hours = require('../utils/TimeUtils').createTimeUnit(dateDif).Milliseconds.toHours()\n if ((sale.saleType == 'auction' && hours <= 24) || (sale.saleType == 'fixed' && hours <= 0)) {\n _this.process_hotel_sale(sale)\n return false\n }else if (sale.status == 'closed') {\n return false\n }else {\n return true\n }\n })\n if (sales.length)\n sails.log.debug('Found hotel sales ')\n return cb(null, sales)\n } else {\n sails.log.debug('Did not find any sales, creating new sale')\n return cb(null, null)\n }\n }).catch(function (err) {\n sails.log.error(err)\n return cb({\n wlError: err,\n error: new Error('Error finding hotel sale')\n })\n })\n }", "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "function viewDeptSales() {\n salesByDept();\n}", "function saleOut(chest) {\n var com=[,,];\n var fee = 0;\n var sum = 0;\n com[0] = Level.getSignText(chest[0], chest[1]-2, chest[2], 0);//commodity Id\n com[1] = Level.getSignText(chest[0], chest[1]-2, chest[2], 1);//commodity Data\n com[2] = Level.getSignText(chest[0], chest[1]-2, chest[2], 2);//commodity Price\n fee = countChest(chest, CURRENCY);//read money\n stuffChest(chest, [0, 0], 0);//clean up this chest\n sum = Math.floor(fee / com[2]);\n if (sum > 0) {\n setChest(chest, 1, [com[0], com[1]], sum);\n clientMessage(\"§aThank You (*^-^*)\");\n clientMessage(\"§b收款\" + \"§e \" + fee);\n clientMessage(\"§b销售数量 \" + \"§e \" + sum);\n };\n if (fee % com[2] > 0) {\n setChest(chest, 0, CURRENCY, fee % com[2]);\n clientMessage(\"§b找零 \" + \"§e\" + fee % com[2])\n }\n}", "displayPrice(book) {\r\n\t\tif(book.saleInfo.saleability === \"FOR_SALE\" && \r\n\t\t\tbook.saleInfo.listPrice.amount !== 0) {\r\n\t\t\treturn(\r\n\t\t\t\t\"$\" + \r\n\t\t\t\tbook.saleInfo.listPrice.amount + \r\n\t\t\t\t\" \" +\r\n\t\t\t\tbook.saleInfo.listPrice.currencyCode\r\n\t\t\t)\r\n\t\t} else {\r\n\t\t\treturn(\r\n\t\t\t\t\"FREE\"\r\n\t\t\t)\r\n\t\t}\r\n\t}", "function details() {\n let did = dsel.value;\n if (!did) return;\n fetch(base + \"/dispenser/\" + did)\n .then(resp => resp.json()).then(function(json) {\n let perc = Math.ceil(json[\"valor_atual\"]/json[\"vol_max\"]*100);\n curml.innerText = json[\"valor_atual\"] + \" mL (\" + perc + \"%)\";\n curdesc.innerText = json[\"desc\"];\n });\n}", "function loadSaleData() {\n fetch(`https://arnin-web422-ass1.herokuapp.com/api/sales?page=${page}&perPage=${perPage}`)\n .then((response) => {\n return response.json();\n })\n .then((myJson) => {\n saleData = myJson;\n let rows = saleTableTemplate(saleData);\n $(\"#sale-table tbody\").html(rows);\n $(\"#current-page\").html(page);\n })\n}", "display() {\n for (let i = 0; i < this.data.stock.length; i++) {\n console.log(i + 1 + \". \" + this.data.stock[i].corporation);\n }\n }", "function productsForSale() {\n console.log(\"products for sale fxn\");\n connection.query(\"SELECT * FROM products\",function(err, res){\n if (err) throw err;\n for (var i=0; i<res.length;i++) {\n console.log(`Product Name: ${res[i].product_name}`);\n console.log(`Department Name: ${res[i].department_name}`);\n console.log(`Selling Price: $${res[i].price}`);\n console.log(`Quantity in Stock: ${res[i].stock_quantity}`);\n console.log(\"---------------------\");\n }\n });\n connection.end();\n }", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "function getTheData() {\n if(totalSale) {\n\tmod1.remove();\n }\n //get the data\n totalSale = d3.select(\"#totalRealSales\")\n .property(\"value\");\n totalTarget = d3.select(\"#totalTargetSales\")\n .property(\"value\");\n //use the function to show the painting\n show(parseInt(totalSale),parseInt(totalTarget));\n}", "function viewSaleProducts(callback){\n //create a query to select all the products\n var allprods = connection.query(\n 'select item_id, product_name, department_id, price, stock_qty, product_sales from products', \n function(err, res){\n if(err){\n throw err;\n }\n else{\n console.log('\\n');\n console.table(res);\n //if call back exists call that function\n if(callback){\n callback();\n }\n //else display the products\n else{\n managerMenu();\n }\n }\n });\n}", "function viewProductsForSale(runMgrView, cb) {\n\n // console.log(\"Inside viewProductsForSale()\");\n\n let queryString = \"SELECT * FROM products\";\n\n let query = connection.query(queryString, function (err, res) {\n\n if (err) throw err;\n\n console.log(\"\\n\\n\");\n console.log(\"\\t\\t\\t\\t---- Products for sale ---- \\n\");\n\n console.log(\"\\tITEM ID\" + \"\\t\\t|\\t\" + \"ITEM NAME\" + \"\\t\\t|\\t\" + \"ITEM PRICE\" + \"\\t|\\t\" + \"QUANTITY\");\n console.log(\"\\t-------\" + \"\\t\\t|\\t\" + \"---------\" + \"\\t\\t|\\t\" + \"----------\" + \"\\t|\\t\" + \"--------\");\n\n res.forEach(item =>\n console.log(\"\\t\" + item.item_id + \"\\t\\t|\\t\" + item.product_name + \"\\t\\t|\\t\" + item.price.toFixed(2) + \"\\t\\t|\\t\" + item.stock_quantity)\n );\n\n if (runMgrView) {\n //Call manager view\n console.log(\"\\n\\n\");\n bamazonManagerView();\n } else {\n cb();\n }\n\n });\n\n\n}", "function showLostSaleCount(lostCount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostCountLabel = document.createElement(\"DIV\");\n lostCountLabel.className = \"wonLostLabel\";\n lostCountLabel.appendChild(document.createTextNode(lostCount));\n $('#lostOpp').append(lostCountLabel);\n}", "function getAndDisplaySellList() {\n getSellList();\n console.log('getAndDisplaySellList works');\n}", "getReceipt(receiptId) {\n return Resource.get(this).resource('Employee:getReceipt', receiptId)\n .then(receipt => {\n this.displayData.receipt = receipt;\n // If has a modified denial amout\n this.displayData.hasModifiedDenial = typeof receipt.modifiedDenialAmount === 'number';\n // Don't display default customer\n if (receipt.customer.firstName !== '__default__') {\n this.displayData.customer = receipt.customer;\n }\n let total = receipt.total;\n if (!total) {\n total = this.determineTotals(receipt);\n }\n this.displayData.rejectionTotal = receipt.rejectionTotal;\n // Sale total\n this.displayData.total = total;\n this.displayData.grandTotal = total;\n // Customer owed money from previous rejections before this sale\n if (receipt.rejectionTotal) {\n this.displayData.rejectionTotal = receipt.rejectionTotal;\n this.displayData.grandTotal = receipt.grandTotal;\n this.displayData.remainingDenials = receipt.rejectionTotal - receipt.appliedTowardsDenials;\n // Values from DB\n if (receipt.appliedTowardsDenials) {\n this.displayData.subtracted = receipt.appliedTowardsDenials;\n // Determine amount for denials\n } else if (receipt.rejectionTotal) {\n const modifiedDenials = receipt.modifiedDenialAmount;\n const rejectionTotal = receipt.rejectionTotal;\n let appliedTowardsDenials = 0;\n // Apply modified amount\n if (modifiedDenials) {\n appliedTowardsDenials = modifiedDenials;\n // Apply full amount\n } else if (rejectionTotal >= total) {\n appliedTowardsDenials = total;\n // All denials paid, but receipt is higher value\n } else {\n appliedTowardsDenials = rejectionTotal;\n }\n // Amount applied towards denials\n this.displayData.subtracted = appliedTowardsDenials;\n this.displayData.grandTotal = total - appliedTowardsDenials;\n this.displayData.remainingDenials = receipt.rejectionTotal - appliedTowardsDenials;\n }\n }\n });\n }", "async paySale(sale){\n\t\t\ttry{\n\t\t\t\tlet response = await axios.put(\"/api/sales/\" + sale._id);\n\t\t\t\tawait this.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "function moreOutfits() {\n getLooks();\n }", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "function getSaleLinesData(shopObj, endPoint, clear){\n var objSheet = shopObj.saleLineSheetName;\n var ssID = shopObj.ID;\nlogSales(\"Shop Object\",shopObj.saleLineSheetName)\nvar ss = SpreadsheetApp.openById(ssID);\n var sheet = ss.getSheetByName(objSheet);\n sheet.activate();\n var saleOffset = getCurrentSaleLineID(sheet,ssID); \n if(UIONOFF){ ss.toast(\"Sale Line Off set ID =\"+saleOffset);}\n var headerRows = 1;\n var offset = 0;\n // == -- Specify the type of call needed -- == \\\\ \n var type = \"GET\";\n // == -- Build the URL with any offsets -- == \\\\\n var url = shopObj.saleLine;\n // == -- adjust process for updating info or replacing info -- == \\\\ \n if(!clear && saleOffset){ \n // logSales(\"sales object\",shopObj);\n url = url+\"&saleLineID=%3E,\"+saleOffset;\n// logSales(\"log Url\",url);\n updateSaleID(shopObj.name,saleOffset)\n } else {\n clearSheet(headerRows, sheet);\n saleOffset = 0;\n }\n \n// logSales(\"url\",url);\n // == -- Initiate the OAuth / Api Call with the given variables -- == \\\\ \n var data = getData(offset,url,endPoint,type);\n if(data.length>=0 ){\n for(var i = 0; i<data.length; i++){\n var row = data[i];\n// logSales(\"Data Row\",row);\n getNames(row);\n// fixItems(row);\n fixDates(row);\n }}\n // == -- Make the call to insert the rows needed for the new data and insert the data -- == \\\\ \n insertData(sheet,data);\n}", "function displayDetail(indice)\n{\n RMPApplication.debug(\"displayDetail : indice = \" + indice);\n v_ol = var_order_list[indice];\n c_debug(dbug.detail, \"=> displayDetail: v_ol (mini) = \", v_ol);\n\n // we want all details for the following work order before showing on the screen\n var wo_query = \"^wo_number=\" + $.trim(v_ol.wo_number);\n var input = {};\n var options = {};\n input.query = wo_query;\n // var input = {\"query\": wo_query};\n c_debug(dbug.detail, \"=> displayDetail: input = \", input);\n id_get_work_order_full_details_api.trigger(input, options, wo_details_ok, wo_details_ko);\n\n RMPApplication.debug(\"end displayDetail\");\n}", "async function menu_ViewProductsForSale() {\n console.log(`\\n\\tThese are all products for sale.\\n`);\n\n //* Query\n let products;\n try {\n products = (await bamazon.query_ProductsSelectAll(\n ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity']\n )).results;\n } catch(error) {\n if (error.code && error.sqlMessage) {\n // console.log(error);\n return console.log(`Query error: ${error.code}: ${error.sqlMessage}`);\n }\n // else\n throw error;\n }\n // console.log(products);\n\n //* Display Results\n if (Array.isArray(products) && products.length === 0) {\n return console.log(`\\n\\t${colors.red(\"Sorry\")}, there are no such product results.\\n`);\n }\n\n bamazon.displayTable(products, \n [ bamazon.TBL_CONST.PROD_ID, \n bamazon.TBL_CONST.PROD , \n bamazon.TBL_CONST.DEPT , \n bamazon.TBL_CONST.PRICE , \n bamazon.TBL_CONST.STOCK ], \n colors.black.bgGreen, colors.green);\n\n return;\n}", "function GetSummary() {\n var YearQuery = '';\n if (FilterList.DashboardFilterYear === '') {\n YearQuery =\n ' business_year = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('YYYY') +\n \"'\";\n } else {\n YearQuery =\n ' business_year = ' + \"'\" + FilterList.DashboardFilterYear + \"'\";\n }\n\n var MonthQuery = '';\n if (FilterList.DashboardFilterMonth === '') {\n MonthQuery =\n ' and business_month = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('MMMM') +\n \"'\";\n } else {\n MonthQuery =\n ' and business_month = ' + \"'\" + FilterList.DashboardFilterMonth + \"'\";\n }\n\n var TeamQuery = '';\n if (\n FilterList.DashboardFilterTeam === '' ||\n FilterList.DashboardFilterTeam === 'ALL'\n ) {\n TeamQuery = ' and team IN ' + global.TeamAccessList;\n } else {\n TeamQuery = ' and team = ' + \"'\" + FilterList.DashboardFilterTeam + \"'\";\n }\n\n var VendorQuery = '';\n if (\n FilterList.DashboardFilterVendor === '' ||\n FilterList.DashboardFilterVendor === 'ALL'\n ) {\n VendorQuery = ' and principal_name like ' + \"'%%' \";\n } else {\n VendorQuery =\n ' and principal_name = ' + \"'\" + FilterList.DashboardFilterVendor + \"'\";\n }\n\n dbperymtsat.transaction((tx) => {\n tx.executeSql(\n 'SELECT SUM(amount) as amount , SUM(target) as target FROM perymtsat_tbl where ' +\n YearQuery +\n MonthQuery +\n TeamQuery +\n VendorQuery +\n ' order by invoice_date asc ',\n [],\n (tx, results) => {\n var len = results.rows.length;\n if (len > 0) {\n // console.log(results.rows.item(0).target);\n //console.log(results.rows.item(0).amount);\n //setTotalSales();\n setTotalTarget(parseInt(results.rows.item(0).target));\n setTotalSales(parseInt(results.rows.item(0).amount));\n settotalSalesAnimation(true);\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n\n // console.log(\n // 'Successfully got summary of ' +\n // FilterList.DashboardFilterMonth +\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n // );\n }\n },\n SQLerror,\n );\n });\n }", "function viewPalletDetails(pallet_no, transaction_id) {\n\tif (null != transaction_id && \"\" != transaction_id && \"-- Select a transaction --\" != transaction_id) {\n\t\tif (null != pallet_no && \"\" != pallet_no) {\n\t\t\twindow.location = \"view-entries?TrxTransactionDetailsSearch[pallet_no]=\" + pallet_no + \"&id=\" + transaction_id;\n\t\t} else {\n\t\t\talert('Please enter pallet no.');\n\t\t}\n\t} else {\n\t\talert('Please select a transaction.');\n\t}\n}", "function getSalePrice(originalPrice) {\n var discount = originalPrice * saleAmount;\n var salePrice = originalPrice - discount;\n return salePrice;}", "getAllSalesList() {\n fetch(process.env.REACT_APP_API_URL+\"/sales\")\n .then(res => res.json())\n .then(\n result => {\n this.setState({\n isLoaded: true,\n salesList: result,\n });\n },\n error => {\n this.setState({\n isLoaded: true,\n error: error\n });\n }\n );\n }", "function getStorInfoAft( responseText ) {\r\n\t\r\n\t// Goods information.\r\n\tvar rData = JSON.parse(responseText).cmGoos;\r\n\tvar savTp = \"C\";\r\n\t\r\n\tfor( var i = 0; i < rData.length; i++ ) {\r\n\t\tconsole.log( rData[0].cmStor.savTp );\r\n\t\tnGoosRow = tblGoosBody.insertRow(), colGoosSavAmt = nGoosRow.insertCell(), colGoosGoosNm = nGoosRow.insertCell(), colGoosRmks = nGoosRow.insertCell();\r\n\t\t\r\n\t\tcolGoosSavAmt\t.className\t= \"text-right\";\r\n\t\tcolGoosGoosNm\t.className\t= \"text-left\";\r\n\t\tcolGoosRmks\t\t.className\t= \"text-left\";\r\n\t\t\r\n\t\tcolGoosGoosNm\t.style.whiteSpace = \"nowrap\";\t// make horizontal scroll in long text.\r\n\t\tcolGoosRmks\t\t.style.whiteSpace = \"nowrap\";\t// make horizontal scroll in long text.\r\n\t\t\r\n\t\tcolGoosSavAmt\t.innerHTML = '<td>' + toNumWithSep( rData[i].savAmt )\t+ '</td>';\r\n\t\tcolGoosGoosNm\t.innerHTML = '<td>' + rData[i].goosNm\t\t\t\t\t+ '</td>';\r\n\t\tcolGoosRmks\t\t.innerHTML = '<td>' + rData[i].rmks\t\t\t\t\t\t+ '</td>';\r\n\t}\r\n\t\r\n\t// Visit history.\r\n\trData = JSON.parse(responseText).chVisit;\r\n\t\r\n\tif( rData.length > 0 ) {\r\n\t\tif( rData[0].cmStor.savTp == \"P\" ) {\r\n\t\t\tsavTp = \"P\";\r\n\t\t}\r\n\t\tdocument.querySelector( \"#idStorSavImg\" ).style.display = \"\";\t\t\r\n\t\tdocument.querySelector( \"#idStorSavAmt\" ).innerHTML = \"&nbsp;\" + toNumWithSep( rData[0].accumAmt ) \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ ( savTp == \"C\" ? mLang.get(\"numberqty\") : mLang.get(\"pointquantitiesunit\") );\t// \"장\" : \"점\"\r\n\t} else {\r\n\t\tdocument.querySelector( \"#idStorSavImg\" ).style.display = \"none\";\r\n\t\tdocument.querySelector( \"#idStorSavAmt\" ).innerHTML = \"&nbsp;\";\r\n\t}\r\n\t\r\n\tfor( var i = 0; i < rData.length; i++ ) {\t\t\r\n\t\taddVisitHistory( rData[i].visitDtm, rData[i].useTp, rData[i].useAmt, rData[i].savAmt, rData[i].accumAmt, rData[i].goosNm );\r\n\t}\r\n\t\r\n}", "function displayItemsForSale() {\n connection.query(\"SELECT item_id, product_name, price, department_name,stock_quantity FROM products\", function (err, result) {\n if (err) throw err;\n\n if (result.length == 0) {\n console.log(\"There are no items for sale.\");\n }\n\n for (var i = 0; i < result.length; i++) {\n console.log(colors.green(\"\\nBook ID: \" + result[i].item_id.toString() + \"\\n\" +\n \"Book Name: \" + result[i].product_name + \"\\n\" +\n \"Book Price: \" + parseInt(result[i].price).toFixed(2) + \"\\n\" +\n \"Department: \" + result[i].department_name + \"\\n\" +\n \"Stock: \" + result[i].stock_quantity));\n }\n chooseMenu();\n });\n}", "function displayForSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n\n if (err) throw err;\n var price;\n items = res.length;\n var sales;\n console.log(\"=====================================================================\");\n var tableArr = [];\n for (var i = 0; i < res.length; i++) {\n sales = parseFloat(res[i].product_sales).toFixed(2);\n price = parseFloat(res[i].price).toFixed(2);\n tableArr.push(\n {\n ID: res[i].item_id,\n PRODUCT: res[i].product_name,\n DEPARTMENT: res[i].department_name,\n PRICE: price,\n ONHAND: res[i].stock_quantity,\n SALES: sales\n }\n )\n }\n console.table(tableArr);\n console.log(\"=====================================================================\");\n promptChoice();\n })\n}", "function getTotalSalesChart() {\n fetch('https://inlupp-fa.azurewebsites.net/api/total-sales-chart')\n .then(res => res.json()) \n .then(data => {\n document.getElementById('revenue').innerHTML = data.revenue;\n document.getElementById('returns').innerHTML = data.returns;\n document.getElementById('queries').innerHTML = data.queries;\n document.getElementById('invoices').innerHTML = data.invoices;\n // Resten ligger i dashboard.js!\n })\n}", "function showSales() {\n //Highlight selected tile\n $('#LeadsTile').css(\"background-color\", \"#0072C6\");\n $('#OppsTile').css(\"background-color\", \"#0072C6\");\n $('#SalesTile').css(\"background-color\", \"orange\");\n $('#LostSalesTile').css(\"background-color\", \"#0072C6\");\n $('#ReportsTile').css(\"background-color\", \"#0072C6\");\n\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to in case of errors\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n var hasSales = false;\n hideAllPanels();\n var saleList = document.getElementById(\"AllSales\");\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Success returned from executeQueryAsync\n var saleTable = document.getElementById(\"SaleList\");\n\n // Remove all nodes from the sale <DIV> so we have a clean space to write to\n while (saleTable.hasChildNodes()) {\n saleTable.removeChild(saleTable.lastChild);\n }\n // Iterate through the Propsects list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n // Create a DIV to display the organization name\n var sale = document.createElement(\"div\");\n var saleLabel = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n sale.appendChild(saleLabel);\n\n // Add an ID to the sale DIV\n sale.id = listItem.get_id();\n\n // Add an class to the sale DIV\n sale.className = \"item\";\n\n // Add an onclick event to show the sale details\n $(sale).click(function (sender) {\n showSaleDetails(sender.target.id);\n });\n\n saleTable.appendChild(sale);\n hasSales = true;\n }\n }\n if (!hasSales) {\n var noSales = document.createElement(\"div\");\n noSales.appendChild(document.createTextNode(\"There are no sales. You can add a new sale from here.\"));\n saleTable.appendChild(noSales);\n }\n $('#AllSales').fadeIn(500, null);\n },\n function (sender, args) {\n\n // Failure returned from executeQueryAsync\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Failed to get sales. Error: \" + args.get_message()));\n errArea.appendChild(divMessage);\n $('#SaleList').fadeIn(500, null);\n });\n}", "function display () {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.log(\"Welcome to Bamazon! Here's what we have for sale:\")\n // for loop to loop through each item in the sql file for display\n for (var i=0; i < res.length; i++) {\n console.log(\"Item ID: \" + res[i].id + ' ' + res[i].product_name + ' $' + res[i].price);\n }\n purchase();\n })\n}", "function getTotalSales() {\n fetch('https://inlupp-fa.azurewebsites.net/api/total-sales')\n .then(res => res.json()) \n .then(data => {\n document.getElementById('totalSales').innerHTML = data.currency + data.amount;\n })\n}", "function getSalesDiscount(price, tax, discount) {\n if (isNaN(price) || isNaN(tax) || isNaN(discount)) {\n return \"Price, Tax, Discount harus dalam angka\";\n }\n\n const totalDiscount = price * (discount / 100);\n const priceAfterDiscount = price - totalDiscount;\n const pajak = priceAfterDiscount * (tax / 100);\n const totalPayment = priceAfterDiscount + pajak;\n\n return `\n Total Sales : Rp.${price}\n Discount (${discount}%) : Rp.${totalDiscount}\n PriceAfterDiscount : Rp.${priceAfterDiscount}\n Pajak (${tax}%) : Rp.${pajak}\n ----------------------------------------------------\n totalPayment : Rp.${totalPayment}\n `;\n}", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "function infoSlowMoving() {\n var title = 'Slow Moving High Quantity';\n var msg = 'This measure refers to the products that have no sales/or few sales over the last 30 days.';\n app.showMessage(msg, title, ['Ok']);\n }", "function getDetails() {\n\n}", "function summarizer(pickerArray, hide) {\n var diff = {\n amount: 0,\n points: 0\n };\n\n $scope.summary.total.sessions = {};\n\n for (var ix in pickerArray) {\n\n // get the necessary values from the item\n var price = $scope.purchaseOrder.items[ix].price;\n var points = $scope.purchaseOrder.items[ix].points;\n var session = $scope.purchaseOrder.items[ix].session;\n var line = $scope.purchaseOrder.items[ix].line;\n var minQty = $scope.purchaseOrder.items[ix].minQty;\n var qty = pickerArray[ix];\n var itemHide;\n\n // if the method receives hide as true, then\n // the\n // itemHide will be the same as the hide\n // property of the item, that way the items\n // with\n // hide = true won't be considered.\n // Otherwise the itemHide receives false and\n // all\n // items will be considered.\n if (hide === true) {\n itemHide = $scope.purchaseOrder.items[ix].hide;\n } else {\n itemHide = false;\n }\n\n diff.amount += (pickerArray[ix] * price);\n diff.points += (pickerArray[ix] * points);\n\n // create the objects for the current\n // session\n // and line.\n if (!$scope.summary.total.sessions[session]) {\n $scope.summary.total.sessions[session] = {\n total: 0,\n minQty: 0,\n orderQty: 0,\n avg: 0,\n pts: 0,\n lines: {}\n };\n }\n if (!$scope.summary.total.sessions[session].lines[line]) {\n $scope.summary.total.sessions[session].lines[line] = {\n total: 0,\n minQty: 0,\n orderQty: 0,\n avg: 0,\n pts: 0\n };\n }\n\n // sum of the price per line and session\n if ((pickerArray[ix] * price) > 0 && itemHide === false) {\n $scope.summary.total.sessions[session].total += (pickerArray[ix] * price);\n $scope.summary.total.sessions[session].lines[line].total += (pickerArray[ix] * price);\n }\n // sum of the minQty per line and session\n if (minQty && itemHide === false) {\n $scope.summary.total.sessions[session].minQty += minQty;\n $scope.summary.total.sessions[session].lines[line].minQty += minQty;\n }\n // sum of the actual selected qty per line\n // and\n // session\n if (qty > 0 && itemHide === false) {\n $scope.summary.total.sessions[session].orderQty += qty;\n $scope.summary.total.sessions[session].lines[line].orderQty += qty;\n }\n // sum of the points per line and session\n if (qty > 0 && itemHide === false) {\n $scope.summary.total.sessions[session].pts += (pickerArray[ix] * points);\n $scope.summary.total.sessions[session].lines[line].pts += (pickerArray[ix] * points);\n }\n }\n\n // the total overall\n $scope.summary.total.amount = diff.amount;\n $scope.summary.total.points = diff.points;\n\n // calculate the average value.\n for (var ix1 in $scope.summary.total.sessions) {\n if ($scope.summary.total.sessions[ix1].orderQty > 0) {\n $scope.summary.total.sessions[ix1].avg =\n ($scope.summary.total.sessions[ix1].total) / ($scope.summary.total.sessions[ix1].orderQty);\n }\n for (var ix2 in $scope.summary.total.sessions[ix1].lines) {\n if ($scope.summary.total.sessions[ix1].lines[ix2].orderQty > 0) {\n $scope.summary.total.sessions[ix1].lines[ix2].avg =\n ($scope.summary.total.sessions[ix1].lines[ix2].total) /\n ($scope.summary.total.sessions[ix1].lines[ix2].orderQty);\n }\n }\n }\n }", "function listUnspent404(redeem) {\n\n\t}", "function populateDetails(name) {\n directView(\"shop-view\");\n let url = URL + \"sneaker/\" + name;\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(appendDetails)\n .catch(handleRequestError);\n }", "function showLostAmount(lostAmount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostAmtLabel = document.createElement(\"DIV\");\n lostAmtLabel.className = \"wonLostLabel\";\n lostAmtLabel.appendChild(document.createTextNode(\"$\" + lostAmount.toLocaleString()));\n $('#lostOpp').append(lostAmtLabel);\n}", "function salesman(name1, age2){\n\tthis.name = name1;\n\tthis.age = age2;\n\tthis.showDetails=function(){\n\t\treturn this.name + \":\" + this.age;\n\t};\n}", "function viewSalesByDept(){\n\n connection.query('SELECT * FROM Departments', function(err, res){\n if(err) throw err;\n\n // Table header\n console.log('\\n' + ' ID | Department Name | OverHead Costs | Product Sales | Total Profit');\n console.log('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -')\n \n // Loop through database and show all items\n for(var i = 0; i < res.length; i++){\n\n //=============================== Add table padding ====================================\n var departmentID = res[i].DepartmentID + ''; // convert to string\n departmentID = padText(\" ID \", departmentID);\n\n var departmentName = res[i].DepartmentName + ''; // convert to string\n departmentName = padText(\" Department Name \", departmentName);\n\n // Profit calculation\n var overHeadCost = res[i].OverHeadCosts.toFixed(2);\n var totalSales = res[i].TotalSales.toFixed(2);\n var totalProfit = (parseFloat(totalSales) - parseFloat(overHeadCost)).toFixed(2);\n\n\n // Add $ signs to values\n overHeadCost = '$' + overHeadCost;\n totalSales = '$' + totalSales;\n totalProfit = '$' + totalProfit;\n\n // Padding for table\n overHeadCost = padText(\" OverHead Costs \", overHeadCost);\n totalSales = padText(\" Product Sales \", totalSales);\n \n // =================================================================================================\n\n console.log(departmentID + '|' + departmentName + '|' + overHeadCost + '|' + totalSales + '| ' + totalProfit);\n }\n connection.end();\n });\n}", "function showDetails({bookTitle, price}){\n console.log(`Name: ${bookTitle}, price: ${price} `)\n }", "function drillLost() {\n var hasLost = false;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n // Get the type of prospect and its percentage\n var type = \"Lost Sale\";\n var getDiv = document.getElementById(\"lostOpp\");\n var getWidth = parseFloat((getDiv.clientWidth / 800) * 100);\n getWidth = getWidth.toFixed(2);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n\n // Success returned from executeQueryAsync\n var lostSaleTable = document.getElementById(\"drillTable\");\n\n // Remove all nodes from the drillTable <DIV> so we have a clean space to write to\n while (lostSaleTable.hasChildNodes()) {\n lostSaleTable.removeChild(lostSaleTable.lastChild);\n }\n\n // Iterate through the Prospects list\n var listItemEnumerator = listItems.getEnumerator();\n\n var listItem = listItemEnumerator.get_current();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n // Get information for each Lost Sale\n var lostSaleTitle = document.createTextNode(listItem.get_fieldValues()[\"Title\"]);\n var lostSalePerson = document.createTextNode(listItem.get_fieldValues()[\"ContactPerson\"]);\n var lostSaleNumber = document.createTextNode(listItem.get_fieldValues()[\"ContactNumber\"]);\n var lostSaleEmail = document.createTextNode(listItem.get_fieldValues()[\"Email\"]);\n var lostSaleAmt = document.createTextNode(listItem.get_fieldValues()[\"DealAmount\"]);\n drillConvert(lostSaleTitle.textContent, lostSalePerson.textContent, lostSaleNumber.textContent, lostSaleEmail.textContent, lostSaleAmt.textContent, getWidth.toString(), type.toString());\n\n }\n hasLost = true;\n }\n\n if (!hasLost) {\n // Text to display if there are no Lost Sales\n var noLostSales = document.createElement(\"div\");\n noLostSales.appendChild(document.createTextNode(\"There are no Lost Sales.\"));\n lostSaleTable.appendChild(noLostSales);\n }\n $('#drillDown').fadeIn(500, null);\n });\n}", "getOutofStockDetails() {\n return this.http.get(this.getOutofStockDetailsURL);\n }", "function printBill(purchasedShirts, purchasedPants, purchasedShoes, discount) {\n\n console.log('Purchased Stock');\n console.log('Shirts:' + purchasedShirts);\n console.log('pants:' + purchasedPants);\n console.log('Shoes:' + purchasedShoes);\n\n console.log('Remining Stock');\n console.log(`remaining stock ${stockShirts.quantity-purchasedShirts}`);\n console.log(`remaining stock ${stockPants.quantity-purchasedPants}`);\n console.log(`remaining stock ${stockShoes.quantity-purchasedShoes}`);\n\n console.log('total price');\n\n let shirtsPrice = purchasedShirts * stockShirts.price;\n let pantsPrice = purchasedPants * stockPants.price;\n let shoesPrice = purchasedShoes * stockShoes.price;\n let totalPrice = shirtsPrice + pantsPrice + shoesPrice;\n let discountPrice = totalPrice * discount / 100;\n\n console.log(`shirts price ${purchasedShirts * stockShirts.price}`);\n console.log(`pants price ${purchasedPants * stockPants.price}`);\n console.log(`shoes price ${purchasedShoes * stockShoes.price}`);\n console.log(`toatal price:${shirtsPrice + pantsPrice + shoesPrice}`);\n console.log(`discount:${totalPrice*discount/100}`);\n console.log(`payable Amount ${totalPrice-discountPrice}`);\n\n}", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function productsForSale (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "function Sell() {\n const {pageSeller, setPageSeller} = useContext(DataInSeellerContext)\n \n\n return (\n <div style={styles}>\n <Head>\n <title>Mes ventes</title>\n </Head>\n\n <main>\n <div className=\"flex flex-col w-screen\">\n <Nav></Nav>\n <div>\n <section className=\"text-gray-600 body-font overflow-hidden\">\n <div className=\"container px-1 py-20 mx-auto\">\n <div className=\"lg:w-5/5 mx-auto flex flex-wrap\">\n <img alt=\"ecommerce\" className=\"lg:w-1/3 w-full lg:h-auto h-64 object-cover object-center rounded\" src=\"https://dummyimage.com/400x400\" />\n <div className=\"lg:w-1/3 w-full lg:pl-10 lg:py-4 mt-6 lg:mt-0\">\n <h2 className=\"text-sm title-font text-gray-500 tracking-widest\">BRAND NAME</h2>\n <h1 className=\"text-gray-900 text-3xl title-font font-medium mb-1\">Poulet au cumin</h1>\n <div className=\"bg-red-500 w-24 text-center text-white text-sm font-montserrat\">Difficile</div>\n <div className=\"flex mb-4\">\n <span className=\"flex items-center space-x-0.5\">\n <svg fill=\"currentColor\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" className=\"w-4 h-4 text-yellow-500\" viewBox=\"0 0 24 24\">\n <path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\"></path>\n </svg>\n <svg fill=\"currentColor\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" className=\"w-4 h-4 text-yellow-500\" viewBox=\"0 0 24 24\">\n <path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\"></path>\n </svg>\n <svg fill=\"currentColor\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" className=\"w-4 h-4 text-yellow-500\" viewBox=\"0 0 24 24\">\n <path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\"></path>\n </svg>\n <svg fill=\"currentColor\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" className=\"w-4 h-4 text-yellow-500\" viewBox=\"0 0 24 24\">\n <path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\"></path>\n </svg>\n <svg fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" className=\"w-4 h-4 text-yellow-500\" viewBox=\"0 0 24 24\">\n <path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\"></path>\n </svg>\n <span className=\"text-gray-600 ml-3\">4 Reviews</span>\n </span>\n <span className=\"flex ml-3 pl-3 py-2 border-l-2 border-gray-200 space-x-2\">\n <a className=\"text-gray-500\">\n <svg fill=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" className=\"w-5 h-5\" viewBox=\"0 0 24 24\">\n <path d=\"M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z\"></path>\n </svg>\n </a>\n <a className=\"text-gray-500\">\n <svg fill=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" className=\"w-5 h-5\" viewBox=\"0 0 24 24\">\n <path d=\"M23 3a10.9 10.9 0 01-3.14 1.53 4.48 4.48 0 00-7.86 3v1A10.66 10.66 0 013 4s-4 9 5 13a11.64 11.64 0 01-7 2c9 5 20 0 20-11.5a4.5 4.5 0 00-.08-.83A7.72 7.72 0 0023 3z\"></path>\n </svg>\n </a>\n <a className=\"text-gray-500\">\n <svg fill=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" className=\"w-5 h-5\" viewBox=\"0 0 24 24\">\n <path d=\"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z\"></path>\n </svg>\n </a>\n </span>\n </div>\n <p className=\"leading-relaxed\">Fam locavore kickstarter distillery. Mixtape chillwave tumeric sriracha taximy chia microdosing tilde DIY. XOXO fam indxgo juiceramps cornhole raw denim forage brooklyn. Everyday carry +1 seitan poutine tumeric. Gastropub blue bottle austin listicle pour-over, neutra jean shorts keytar banjo tattooed umami cardigan.</p>\n <div className=\"flex mt-6 items-center pb-5 border-b-2 border-gray-100 mb-5\">\n\n </div>\n <div className=\"flex items-center space-x-3\">\n <span className=\"title-font font-medium text-2xl text-gray-900\">$158.00</span>\n </div>\n </div>\n\n <div className=\"lg:w-1/3 w-full lg:pl-10 lg:py-1 mt-2 lg:mt-0\">\n <div className=\"flex flex-col sm:flex-row mt-2\">\n <div className=\"text-center sm:pr-2 sm:py-2 items-center\">\n <div className=\"text-lg font-montserrat py-4\">INGRÉDIENTS:</div>\n <div className=\"flex flex-col space-y-2\">\n <OnlineAddIngredientsComponents courseId={pageSeller._id}></OnlineAddIngredientsComponents>\n {\n pageSeller.ingredients.map((ingredient, key) => {\n return <OnlineIngredient courseId={pageSeller._id} ingredient={ingredient} key={key}></OnlineIngredient>\n })\n }\n </div>\n\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n\n\n <div className=\"container px-1 py-2 mx-auto\">\n <div className=\"text-lg font-montserrat pb-5\">\n Ajouter une date de cours\n </div>\n\n <OnlineAddDateCourse courseId={pageSeller._id}></OnlineAddDateCourse>\n </div>\n\n <SellerResaDateComponent courseId={pageSeller._id}></SellerResaDateComponent>\n </section>\n </div>\n </div>\n </main>\n\n\n </div>\n )\n}", "function newPrice() {\n if (hotels.price < 100) {\n return (\n <>\n <Card.Text className=\"establishmentDetail__price--old\">\n NOK {hotels.price}\n </Card.Text>\n <Card.Text className=\"establishmentDetail__price--new\">\n NOK {discountPrice}\n </Card.Text>\n <Card.Text className=\"establishmentDetail__price--discount\">\n Save: {discount}&#37;\n </Card.Text>\n </>\n );\n }\n\n return (\n <Card.Text className=\"establishmentDetail__price--org text-center\">\n <strong>Total: NOK {hotels.price}</strong>\n </Card.Text>\n );\n }", "function totalSales(products, lineItems){\n //TODO\n\n}", "function getStatus(st, id, user, ref) {\n fetch(urlSale + '?st=' + st + '&user=' + user + '&id=' + id, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => response.json())\n .then((data) => {\n console.log(data);\n \n if (data != null) {\n balance = data.balance;\n listSales(data, ref); \n } else {\n if (balance<=0) {\n \n getCustomer(idC);\n }\n }\n\n });\n}", "function showDetails(id){ \n\n let productDetails = [];\n let order = \"\";\n\n all_orders.forEach(_order =>{\n if(_order.id == id){\n order = _order;\n }\n })\n \n order.orderProducts.forEach(product =>{\n let details = {\n name: product.product.name,\n quantity: product.quantity\n }\n productDetails.push(details);\n })\n\n auxDetails(productDetails);\n\n}", "function showEarnings(){\n\t$(\"#earnings_credentials\").hide();\n\t$(\"#earnings_container\").show();\n\tgetEarnings();\n\t\n}", "function salesReport(req, res) {\n let db = req.app.get('db');\n let limit = req.body.limit || 50;\n let offset = req.body.offset || 0;\n let baseQuery = `SELECT * from items where sold = true`;\n\n // if sortAttr is provided, add sort command to the query\n let sortAttr = req.body.sortAttr;\n let sortOrder = req.body.sortOrder || 'asc';\n if (sortAttr) baseQuery += ` order by ${sortAttr} ${sortOrder}`\n\n // add limit and offset to the query\n baseQuery += ` limit $1 offset $2`\n\n return db.query(baseQuery, [limit, offset])\n .then(items => {\n let numResults = items.length;\n let offsetForNextPage = offset + numResults;\n let offsetForPrevPage = offset - limit;\n if (offsetForPrevPage < 0) offsetForPrevPage = 0;\n // If we dont get a full set of results back, we're at the end of the data\n if (numResults < limit) offsetForNextPage = null;\n let data = {\n items,\n offsetForPrevPage: offsetForPrevPage,\n offsetForNextPage, offsetForNextPage\n }\n return sendSuccess(res, data);\n })\n .catch(e => sendError(res, e, 'salesReport'))\n}", "function showSaleDetails(itemID) {\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n $('#SaleDetails').hide();\n currentItem = list.getItemById(itemID);\n context.load(currentItem);\n context.executeQueryAsync(\n function () {\n $('#editSale').val(currentItem.get_fieldValues()[\"Title\"]);\n $('#editSalePerson').val(currentItem.get_fieldValues()[\"ContactPerson\"]);\n $('#editSaleNumber').val(currentItem.get_fieldValues()[\"ContactNumber\"]);\n $('#editSaleEmail').val(currentItem.get_fieldValues()[\"Email\"]);\n $('#editSaleStatus').val(currentItem.get_fieldValues()[\"_Status\"]);\n $('#editSaleAmount').val(\"$\" + currentItem.get_fieldValues()[\"DealAmount\"]);\n $('#SaleDetails').fadeIn(500, null);\n\n \n\n },\n function (sender, args) {\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n}", "function viewLowInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function (err, res) {\n if (err) throw err;\n let items = '';\n for (var i = 0; i < res.length; i++) {\n items = '';\n items += 'Product Name: ' + res[i].product_name + ' // ';\n items += 'Quantity: ' + res[i].stock_quantity + '\\n';\n console.log(items.toUpperCase());\n\n }\n return setTimeout(function () {\n managerPortal()\n }, 4000);\n })\n}", "function chatSaleService(salesServiceRecord){\r\n var serviceFlagCounter =0;\r\n var salesFlagCounter=0;\r\n var onlyServiceData = [];\r\n var onlySaleData = [];\r\n\r\n for(var i=0; i<salesServiceRecord.length; i++){\r\n if(salesServiceRecord[i].SALE_SERVICE_FLAG == \"SERVICE\"){\r\n serviceFlagCounter++;\r\n onlyServiceData.push(salesServiceRecord[i]);\r\n }\r\n else if(salesServiceRecord[i].SALE_SERVICE_FLAG == \"SALES\"){\r\n salesFlagCounter++;\r\n onlySaleData.push(salesServiceRecord[i]);\r\n }\r\n else{ \r\n } \r\n }\r\n salesServiceDoughnut(serviceFlagCounter, salesFlagCounter);\r\n getOnlyChatServiceData(onlyServiceData, serviceFlagCounter);\r\n getOnlyChatSaleData(onlySaleData, salesFlagCounter);\r\n }", "function parsePriceInfo(jsonOfferDetail) {\n\n if (jsonOfferDetail['offerType'] == \"BUYABLE\") {\n document.getElementById('sample-badge-div').hidden = true;\n document.getElementById(\"price\").innerText = \"$\" + jsonOfferDetail['offerPrice']['amount'];\n if (jsonOfferDetail['productType'] == \"NON_PERISHABLE\") {\n document.getElementById(\"discount\").hidden = false;\n } else {\n document.getElementById(\"discount\").hidden = true;\n }\n\n } else {\n document.getElementById(\"price\").hidden = true;\n document.getElementById(\"discount\").hidden = true;\n document.getElementById('sample-badge-div').hidden = false;\n }\n}", "function ProductsForSale() {\n console.log(\"Items up for sale\");\n console.log(\"------------------\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | $\" + res[i].price + \" | \" + res[i].quantity);\n console.log(\"------------------\");\n }\n MainMenu();\n });\n }", "function loadDetails() {\n var xhr = new XMLHttpRequest();\n xhr.open(\n \"GET\",\n \"https://www.ots.at/api/aussendung?app=6b572c35908e4a5c4f3b8a7ee3ea9c6d&schluessel=OTS_20190425_OTS0059&format=json\",\n true\n );\n\n xhr.onload = function() {\n if (this.status == 200) {\n var details = JSON.parse(this.responseText);\n\n // console.log(details);\n\n var output = \"\";\n for (var i in details) {\n output +=\n '<div class = \"detail\">' +\n \"<ul>\" +\n \"<li>TITEL: \" +\n details[i].TITEL +\n \"</li>\" +\n \"<li>UTL: \" +\n details[i].UTL +\n \"</li>\" +\n \"<li>INHALT: \" +\n details[i].INHALT +\n \"</li>\" +\n \"<li>RUECKFRAGEHINWEIS: \" +\n details[i].RUECKFRAGEHINWEIS +\n \"</li>\" +\n \"<li>EMITTENT : \" +\n details[i].EMITTENT +\n \"</li>\" +\n \"</ul>\" +\n \"</div>\";\n }\n\n document.getElementById(\"modal-content-result\").innerHTML = output;\n }\n };\n\n xhr.send();\n }", "async updateSale(saleID, storeID) {\n\n}", "function forSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id + \"; Product: \" + res[i].product_name + \"; Department: \" + res[i].department_name + \"; Price: $\" + res[i].price + \"; Quantity Available: \" + res[i].stock_quantity);\n };\n nextToDo();\n });\n}", "function getData(){\n\t\tvar shopString = localStorage.getItem(\"wedding\");\n\t\tif (shopString) {\n\t\t\tvar shopArray = JSON.parse(shopString);\n\t\t\tconsole.log(shopArray);\n\t\t\tvar html='';\n\t\t\tvar no=1;\n\t\t\tvar total=0;\n\t\t\t$.each(shopArray,function(i,v){\n\t\t\t\tvar name = v.name;\n\t\t\t\tvar photo = v.photo;\n\t\t\t\tvar unit_price = v.price;\n\t\t\t\t\n\t\t\t\t// if (discount) {\n\t\t\t\t// \tvar price_show=discount+'<del class=\"d-block\">'+unit_price+'</del>';\n\t\t\t\t// \tvar price = discount;\n\t\t\t\t// }else{\n\t\t\t\t// \tvar price_show = unit_price;\n\t\t\t\t// \tvar price = unit_price;\n\t\t\t\t// }\n\n\t\t\t\thtml += `<tr>\n\t\t\t\t\t\t<td>${no++}</td>\n\t\t\t\t\t\t<td>${name}</td>\n\t\t\t\t\t\t<td><img src=\"${photo}\" width=\"100\" height=\"100\"></td>\n\t\t\t\t\t\t<td>${unit_price}</td>\n\t\t\t\t\t</tr>`;\t\n\n\t\t\t\t\ttotal +=unit_price;\n\t\t\t});\n\n\t\t\thtml+=`<tr>\n\t\t\t\t<td colspan=\"3\">Total</td>\n\t\t\t\t<td>${total}</td>\n\t\t\t\t</tr>`\n\n\t\t\t$(\"tbody\").html(html);\n\t\t\t$(\".total\").val(total);\n\n\t\t}else{\n\t\t\thtml='';\n\t\t\t$(\"tbody\").html(html);\n\t\t}\n\n\t}", "function viewLowInvetory(){\n //create a query to select products with stock qty < 5\n var lowprods = connection.query(\n 'select item_id, product_name, department_id, price, stock_qty, product_sales from products where stock_qty < 5', \n function(err, res){\n if(err){\n throw err;\n }\n else{\n console.log('\\n');\n console.table(res);\n managerMenu();\n }\n });\n}", "function topSellerByRevenue(products, lineItems){\n //TODO\n}", "__validateSales() {\n let salescorrect = [];\n let salesIncorrect = [];\n\n this.sales.forEach((sale) => {\n if (\n sale.saleDate.isSameOrAfter(this.since) &&\n sale.saleDate.isSameOrBefore(this.until)\n ) {\n salescorrect.push(sale);\n } else {\n salesIncorrect.push(sale);\n }\n });\n\n this.sales = salescorrect.reverse();\n //TODO: Metodo que grantice un ordenamineto de fechas correcto siempre\n this.salesWithError = salesIncorrect;\n }", "function totalSales(){\r\n let totalSalesVar =0;\r\n \r\n\r\nfor(var i = 0; i <= hSaleTotal.length-1; i++){\r\n \r\n totalSalesVar += hSaleTotal[i];\r\n console.log(totalSalesVar)\r\n\r\n}\r\n\r\ndocument.getElementById('prueba').innerHTML= `Total Sales were: ${totalSalesVar} <br>`;\r\n\r\n\r\n}", "function fullDisplay() {\n query = \"SELECT * FROM products\";\n\n // Make the db query\n connection.query(query, function (err, data) {\n if (err) throw err;\n\n console.log(\"Existing Inventory: \");\n console.log(\"-------------------\\n\");\n\n let info = \"\";\n\n for (var i = 0; i < data.length; i++) {\n info = \"\";\n info += \"Item: \" + data[i].ID + \", \";\n info += \"Product Name: \" + data[i].product_name + \", \";\n info += \"Department: \" + data[i].department_name + \", \";\n info += \"Price: $\" + data[i].price + \"\\n\";\n console.log(info);\n }\n console.log(\"-------------------------------------------------\\n\");\n // start the sale!\n startGame();\n });\n\n}", "function displaySalesRecords() {\n\t\n\tvar table = document.getElementById(\"table\");\n\t\n\tvar json = getJSONObject();\n\t\n\t//Uncomment to debug json variable\n\t//console.log(json);\n\t\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", \"../dp2-api/api/\", true);\t// All requests should be of type post\n\txhr.onreadystatechange = function() {\n\t\tif(xhr.readyState == 4) {\n\t\t\tif(xhr.status == 200) {\n\t\t\t\tconsole.log(JSON.parse(xhr.responseText)); // Barring error conditions, responses will be valid JSON\n\t\t\t\tvar data = JSON.parse(xhr.responseText); \n\t\t\t\t\n\t\t\t\tvar i;\n\t\t\t\t\n\t\t\t\t//Construct HTML table header row\n\t\t\t\t//This needs to be exist singularly every time a new table is generated\n\t\t\t\tvar html = \"<caption>Sales Records</caption><thead><tr><th>ID</th><th>Product ID</th><th>Name</th><th>Quantity</th><th>Amount</th><th>DateTime</th></tr></thead><tbody>\";\n\t\t\t\t\n\t\t\t\tfor(i=0; i < data[0].length; i++)\n\t\t\t\t{\n\t\t\t\t\thtml += \"<tr><td>\" + data[0][i].id + \"</td><td>\" + data[0][i].product + \"</td><td>\" + data[0][i].name + \"</td><td>\" + data[0][i].quantity + \"</td><td>\" + displayAmount(data[0][i].value, data[0][i].quantity) + \"</td><td>\" + formatDateAndTime(data[0][i].dateTime) + \"</td></tr>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\thtml += \"</tbody>\";\n\t\t\t\t\n\t\t\t\t//Uncomment to debug html variable e.g. see the table HTML that has been generated\n\t\t\t\t//console.log(html);\n\t\t\t\t\n\t\t\t\t//This writes the newly generated table to the table element \n\t\t\t\ttable.innerHTML = html;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tconsole.error(xhr.responseText);\n\t\t\t}\n\t\t}\n\t};\n\txhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\txhr.send(\"request=\" + encodeURIComponent(JSON.stringify(json)));\n}", "function renderSaleTotal(currency, value, sharesToSell) {\n value = [...document.getElementsByClassName(\"blink\")].find(e => {\n return e.parentElement.id === currency;\n });\n value = value.innerText;\n // calls on a function that multiplies sharesToSell by value\n let total = parseFloat(value * sharesToSell).toFixed(2);\n // renders the return of that function on the page\n document.getElementsByClassName(\"total-sale\")[0].innerHTML = `\n Sale Value: <strong>$${total}</strong>\n `;\n}", "function viewLowInventory() {\n\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.log(\"All items that need to be restocked:\\n\");\n console.log(\"\\n-----------------------------------------\\n\");\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock_quantity <= 5) {\n console.log(\"Id: \".bold + res[i].item_id + \" | Product: \".bold + res[i].product_name + \" | Department: \".bold + res[i].department_name + \" | Price: \".bold + \"$\".green.bold +res[i].price + \" | QOH: \".bold + res[i].stock_quantity);\n }\n }\n console.log(\"\\n-----------------------------------------\\n\");\n });\n\n\n}", "function _displayBookingResponse(response) {\n try {\n if (response && response.success) {\n const revenue = {\n subTotal: response.cost.subTotal,\n serviceTax: response.cost.serviceTax,\n swachhBharatCess: response.cost.swachhBharatCess,\n krishiKalyanCess: response.cost.krishiKalyanCess,\n total: response.cost.total,\n tax: response.tax,\n }\n console.log('Successfully Booked', state.selectedShow.name);\n _displayLog(revenue);\n }\n else {\n console.log(response && response.message);\n }\n } catch (e) {\n console.log('failed due to unknown reason', e);\n }\n }", "function viewLowInv() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity <= 30\", function (err, results) {\n if (err) throw err;\n for (let i = 0; i < results.length; i++) {\n console.log(\"Item \" + results[i].item_id + \"| Product Name: \" + results[i].product_name + \"| Price: \" + results[i].price + \"| In Stock: \" + results[i].stock_quantity);\n }\n\n });\n connection.end();\n}" ]
[ "0.6457778", "0.6134489", "0.60750747", "0.6047149", "0.5972565", "0.58748937", "0.57993543", "0.57311463", "0.5690661", "0.5605454", "0.5584485", "0.55698514", "0.5507119", "0.5470921", "0.54649156", "0.54442716", "0.54122114", "0.54013485", "0.53928924", "0.53308886", "0.5318836", "0.52977586", "0.5297057", "0.5268715", "0.5247289", "0.5236712", "0.5230089", "0.52071375", "0.52005", "0.51875573", "0.51809126", "0.51688236", "0.5138652", "0.5133894", "0.5132917", "0.5132262", "0.5131148", "0.5130017", "0.5127911", "0.5113508", "0.51108426", "0.5105781", "0.5094381", "0.50889117", "0.5088763", "0.5074179", "0.5068608", "0.50477564", "0.5044836", "0.5028339", "0.5017401", "0.5016826", "0.5004482", "0.5002068", "0.4977717", "0.49764878", "0.49667817", "0.4965082", "0.49617818", "0.49569267", "0.49562815", "0.49484995", "0.49484548", "0.49427342", "0.49410492", "0.493912", "0.4934279", "0.49340954", "0.4917892", "0.4917844", "0.4916572", "0.49086484", "0.48966166", "0.48889107", "0.48798075", "0.48724556", "0.4872452", "0.48723134", "0.48721611", "0.48694474", "0.485626", "0.48556536", "0.484535", "0.48422545", "0.48416758", "0.48413524", "0.4838474", "0.48208448", "0.4815226", "0.4812903", "0.4801458", "0.47975063", "0.47969288", "0.47897202", "0.4781989", "0.47815892", "0.47798455", "0.47776428", "0.47766766", "0.47675693" ]
0.53581417
19
This function closes the lost sale detail form
function cancelLostSale() { var errArea = document.getElementById("errAllSales"); // Remove all nodes from the error <DIV> so we have a clean space to write to in future operations while (errArea.hasChildNodes()) { errArea.removeChild(errArea.lastChild); } $('#LostSaleDetails').fadeOut(500, function () { $('#LostSaleDetails').hide(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeDetails() {\n\n\tif (!Alloy.Globals.detailsWindow) {\n\t\treturn;\n\t}\n\n\t$.tab.closeWindow(Alloy.Globals.detailsWindow);\n\n\tAlloy.Globals.detailsWindow = null;\n}", "function closePriceWin(obj) {\n obj.hide()\n obj.find('.setPrice-num').val('');\n }", "function fhArrival_close() {\n\t\n\tif (fhArrival_data.currentMode == \"EDIT\") {\n\t\tif (!confirm(\"Sei sicuro di uscire senza salvare?\")) {\n\t\t\treturn false;\n\t\t}\n\t} \n\t\n\twindow.location = 'index.php?controller=arrival';\n\t\t\n}", "function closeQuoteForm()\n\t{\n\t\tdocument.getElementById('quote_form').style.display=\"none\";\n\t}", "function closeContactDetails() {\n\t\tmodal.style.display = \"none\";\n\t\temployeesData.forEach(employee => employee.detailsDisplayed = false);\n\t}", "function closeVatDetail() {\r\n if (!$isOnView)\r\n $validateVat.resetForm();\r\n $(\"#VatBaseAmount\").val('');\r\n $(\"#VatPercentage\").val('');\r\n $('#divVatBreakdown').dialog('close');\r\n}", "function handleClose() {\n setOpen(false)\n setEditItem(null)\n }", "function displayDetailClose()\n{\n RMPApplication.debug(\"begin displayDetailClose\");\n c_debug(dbug.detail, \"=> displayDetailClose\");\n id_search_filters.setVisible(true);\n id_search_results.setVisible(true);\n id_ticket_details.setVisible(false);\n $(\"#id_number_detail\").val (\"\");\n $(\"#id_correlation_id_detail\").val (\"\");\n $(\"#id_caller_detail\").val (\"\");\n $(\"#id_contact_detail\").val (\"\"); \n $(\"#id_company_detail\").val (\"\");\n $(\"#id_country_detail\").val (\"\");\n $(\"#id_affiliate_detail\").val (\"\");\n $(\"#id_location_detail\").val (\"\");\n $(\"#id_city_detail\").val (\"\");\n $(\"#id_opened_detail\").val (\"\");\n $(\"#id_priority_detail\").val (\"\");\n $(\"#id_state_detail\").val (\"\");\n $(\"#id_closed_detail\").val (\"\");\n $(\"#id_category_detail\").val (\"\");\n $(\"#id_product_type_detail\").val (\"\");\n $(\"#id_problem_type_detail\").val (\"\");\n $(\"#id_short_description_detail\").val (\"\");\n $(\"#id_description_detail\").val (\"\");\n $(\"#id_attachment\").html (\"\");\n clearTaskDataTable();\n $(\"#id_rowProgression\").hide();\n RMPApplication.debug(\"end displayDetailClose\");\n}", "function close(open){\r\n\t\t\tself.confirm_title = open;\r\n\t\t\tself.confirm_type = BootstrapDialog.TYPE_WARNING;\r\n\t\t\tself.confirm_msg = self.confirm_title + ' without saving data?';\r\n\t\t\tself.confirm_btnclass = 'btn-warning';\r\n\t\t\tConfirmDialogService.confirmBox(self.confirm_title, self.confirm_type, self.confirm_msg, self.confirm_btnclass)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t\t\tfunction (res) {\r\n\t\t\t\t\t\t\t\tfetchAllVehicles();\r\n\t\t\t\t\t\t\t\tself.save = \"saveclose\";\r\n\t\t\t\t\t\t\t\treset();\r\n\t\t\t\t\t\t\t\tnewOrClose();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t );\r\n\t\t}", "function endChange()\n{\n window.close();\n}", "function cancelEditSale() {\n clearEditSaleForm();\n}", "function otkazivanjeKupovine() {\r\n window.alert(\"Doviđenja\");\r\n window.close();\r\n}", "function win_close() {\n\n\twindow.opener.frmMain.submit();\n\tself.close();\n}", "function closeForm() {\n const form = document.querySelector('#form')\n let title = document.querySelector('#formTitle').value;\n let author = document.querySelector('#formAuthor').value;\n let pages = document.querySelector('#formPage').value;\n let read = document.querySelector('#formRead').value;\n let newBook = new book(title, author, pages, read);\n debugger\n console.log(newBook);\n form.style.display = 'block';\n //form grabs data but disapears????\n}", "function closeOption(param) {\n\n gw_com_api.hide(\"frmOption\");\n\n}", "function closeGenerateWindow() {\n\tdocument.getElementById('input-hider').style.display = 'none';\n\tdocument.getElementById('input-hider-button').style.display = 'none';\n}", "close() {\r\n \r\n if (!this.value || !this.selectedDisplay) {\r\n if (this.freeSolo === false) {\r\n this.clear();\r\n }\r\n }\r\n \r\n this.Focusinputbox = false;\r\n if(!this.disableCloseOnSelect)\r\n {\r\n this.results =[];\r\n this.icon = false;\r\n }\r\n \r\n this.error = null;\r\n this.removeEventListener();\r\n this.$emit(\"close\");\r\n }", "closeDetail(){\n this.selItem = null;\n this.props.itemSel(this.selItem);\n\n this.setState({\n isShowDetail : false,\n detailItem : {}\n });\n this.forceUpdate();\n }", "function close() {\n\t\t\t\t\t\t$scope.currentSubType = null;\n\t\t\t\t\t\t$scope.currentMeasureClass = null;\n\t\t\t\t\t\t$rootScope.$broadcast(\"DataTypeDetails:close\");\n\t\t\t\t\t}", "function handleClose() {\n navigate(\"/EscolherCondominio\"); // vai pra tela de condominios\n setDialog(false);\n }", "function close() {\n var desc1 = new ActionDescriptor();\n desc1.putEnumerated( stringIDToTypeID( \"saving\" ), stringIDToTypeID( \"yesNo\" ), stringIDToTypeID( \"no\" ) );\n desc1.putInteger( stringIDToTypeID( \"documentID\" ), app.activeDocument.id);\n desc1.putBoolean( stringIDToTypeID( \"forceNotify\" ), true );\n executeAction( stringIDToTypeID( \"close\" ), desc1, DialogModes.NO );\n}", "function handleClose() {\n setOpenModalId(0);\n }", "close() {\r\n if (this.widget_wizard != null) this.widget_wizard.close()\r\n // close all the widget of the page\r\n for (var id in this.widget_objects) {\r\n var widget_object = this.widget_objects[id]\r\n if(typeof widget_object.close === 'function')\r\n widget_object.close()\r\n }\r\n }", "function cerrar() {\twindow.close(); }", "function pageEditClose() {\n return PageService.pageEditClose();\n }", "function closeAppeal(f) {\n f.submit();\n window.close();\n}", "function close() {\n $modalInstance.dismiss();\n }", "_closeAddNewItem() {\n // Update current Order:\n this.order = this.orderService.getCurrentOrder();\n this.$scope.newItemModal.hide();\n this.item = this.defaultItem;\n }", "function Close() {\n } // Close", "function closeForm(){\n document.getElementsByClassName('container-toDO')[0].style.display = 'block';\n let PopUp = document.getElementsByClassName('pop-up')[0];\n PopUp.classList.add('hides');\n document.getElementById(\"myForm\").style.display = \"none\";\n }", "function closeWindow() {\n\t\t\t\tinfoWin.close();\n\t\t\t}", "function closeModalEdit(){\n modalEdit.style.display = \"none\"\n modalFormEdit.reset()\n }", "_handleCloseClick() {\n\t\tthis.close();\n\t}", "function closefeesModal2() {\n document.getElementById('fees-pop-screen').style.display='none';\n}", "function CerrarVentana(){\r\n\twindow.close();\r\n}", "closeOrder() {\n // Clear current Order:\n this.item = this.defaultItem;\n let order = this.orderService.factory();\n this.orderService.setCurrentOrder(order);\n this.$ionicHistory.clearCache();\n\n // second parameter true sets as history-root view:\n this.$location.path('/app/home', true);\n // delete history in order to avoid return to login screen:\n this.$ionicHistory.nextViewOptions({historyRoot: true});\n this.$ionicLoading.hide();\n this.$scope.createdOrderModal.hide();\n }", "close() {\n super.close();\n this._popupForm.reset();\n }", "function sellerModalClose() {\r\n document.getElementsByTagName('body')[0].classList.remove('ovh');\r\n document.querySelectorAll('.seller-registration-modal')[0].classList.remove('seller-registration-modal_opened');\r\n document.querySelectorAll('.seller-registration-window').forEach(function (win) {\r\n win.style.display = 'none';\r\n });\r\n }", "close() {\n\n // Pop the activity from the stack\n utils.popStackActivity();\n\n // Hide the screen\n this._screen.scrollTop(0).hide();\n\n // Hide the content behind the placeholders\n $(\"#page--info .ph-hidden-content\").hide();\n\n // Stop the placeholders animation\n this._placeholders.removeClass(\"ph-animate\").show();\n\n // Hide the delete button\n $(\"#info-delete\").hide();\n\n // Hide the info button\n $(\"#info-edit\").hide();\n\n // Show all the fields\n $(\".info-block\").show();\n\n // Delete the content of each of the fields\n $(\"#info-createdAt .info-content\").html(\"\");\n $(\"#info-updatedAt .info-content\").html(\"\");\n $(\"#info-coordinates .info-content\").html(\"\");\n $(\"#info-coordinatesAccuracy .info-content\").html(\"\");\n $(\"#info-altitude .info-content\").html(\"\");\n $(\"#info-altitudeAccuracy .info-content\").html(\"\");\n $(\"#info-type .info-content\").html(\"\");\n $(\"#info-materialType .info-content\").html(\"\");\n $(\"#info-hillPosition .info-content\").html(\"\");\n $(\"#info-water .info-content\").html(\"\");\n $(\"#info-vegetation .info-content\").html(\"\");\n $(\"#info-mitigation .info-content\").html(\"\");\n $(\"#info-mitigationsList .info-content\").html(\"\");\n $(\"#info-monitoring .info-content\").html(\"\");\n $(\"#info-monitoringList .info-content\").html(\"\");\n $(\"#info-damages .info-content\").html(\"\");\n $(\"#info-damagesList .info-content\").html(\"\");\n $(\"#info-notes .info-content\").html(\"\");\n\n // Show the image placeholder\n $(\"#info-photo-preview\").attr(\"src\", \"img/no-img-placeholder-200.png\");\n\n }", "function CloseERisk() {\n\tdocument.getElementById(\"EditRisk\").style.display = \"none\";\n\tdocument.getElementById(\"EditRiskName\").value = \"\";\n}", "function closeForm() {\n $('.add-parent-popup').hide();\n $('.overlay').hide();\n clearFields();\n $('#pin-message').hide();\n}", "function closeEditor(event) {\n event.preventDefault();\n var edit_window = document.getElementById('table_editor');\n edit_window.classList.remove('active');\n //edit_window.style.display = 'none';\n document.getElementsByClassName('sales-data')[0].style.opacity = 1;\n}", "function closeSave() {\n const title = document.querySelector('#title-input').value;\n const body = document.querySelector('#input-textarea').value;\n if(title) {\n fetch('/documents/' + document_id, {\n method: 'PUT',\n body: JSON.stringify({\n title: title,\n body: body\n })\n });\n }\n else {\n fetch('/documents/' + document_id, {\n method: 'PUT',\n body: JSON.stringify({\n body: body\n })\n });\n }\n if(title != \"\") {\n document.querySelector('#doc-title').innerHTML = title;\n }\n document.querySelector('#overlay').style.display = 'none';\n document.querySelector('#save-popup').style.display = 'none';\n}", "closetermsConditionModal() {\n this.$refs.termsConditionModal.close();\n if (document.querySelector('.checkout-order-summary-details')) {\n document.querySelector('.checkout-order-summary-details').style.zIndex = '';\n }\n }", "close() {\n // Remove blockchain buttons and nodes - full reset\n wallets.page.boxes.c2.buttonRanges.inputControls.removeButtons();\n }", "function closeContactFormular(indexDoc) {\n document.getElementById(\"popUpDate\" + indexDoc).style.display = \"none\";\n}", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function continueClose() {\n Alloy.eventDispatcher.trigger('session:renew');\n $.trigger('dashboard:dismiss', {});\n}", "function closePriviousEdit() {\n if (openedEditForm) {\n openedEditForm.value ? openedEditForm.value.html(openedEditForm.html) : '';\n openedEditForm = null;\n }\n }", "function setClose() {\n\t\tif (props.total_results != 0) {\n\t\t\tif (jobType != null) {\n\t\t\t\tsetJobType(null);\n\t\t\t\tdocument.getElementById('apps').style.display = 'initial';\n\t\t\t} else {\n\t\t\t\tdocument.getElementById('apps').style.display = 'none';\n\t\t\t}\n\t\t} else {\n\t\t\tif (jobType != null) {\n\t\t\t\tsetJobType(null);\n\t\t\t} else {\n\t\t\t}\n\t\t}\n\t}", "function closeDialog() {\n document.querySelector(\"#expel_student\").classList.add(\"hide\");\n document.querySelector(\"#expel_student .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#expel_student #expel_button_modal\").removeEventListener(\"click\", expelStudent);\n }", "function forcedClose_p () {\n// --------------------------------------------------------\n window_o.close(true);\n}", "function closeCreateIssueForm(elt) {\n $j(elt).closest('.code-issue-create-form').remove();\n return false;\n}", "function closeSelfEvaluation(save){\n\t$selfEvaluationOptions.hide();\n\tif(save){\n\t\tsetSelfEvaluationLabel($selfEvaluationInput.val());\n\t}else{\n\t\tsetSelfEvaluationInput($selfEvaluationText.text())\n\t}\n\t$selfEvaluationLabels.show();\n\t\n\tcloseWarningModal();\n}", "function edit() {\n $('#productInfo').trigger('close');\n show(\"editProduct\");\n}", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function closeEditModal() {\n editTodoModal.style.display = \"none\";\n console.log(\"fired\");\n }", "function handleClose() {\n setOpen(false)\n }", "function closeNewSession()\n{\n\tvar newSessionPopUp = document.getElementById('newStudySession');\n\tnewSessionPopUp.style.display = 'none';\n\tvar newSessionPopUp = document.getElementById('blur');\n\tnewSessionPopUp.style.display = 'none';\n buddiesClickedOn = new Array();\n}", "function fVolver(){\n window.close();\n }", "function closeDetails() {\n if (selectedDiv_ != null) {\n selectedDiv_.classList.remove(\"file-selected\");\n selectedDiv_ = null;\n }\n var detailsDiv = document.getElementById(\"details-body\");\n detailsDiv.parentNode.classList.add(\"hidden\");\n}", "function CloseAcceptCustomer() {\n window.location.href = \"index_all.html\";\n}", "function CloseLightBox() {\n $('#productInfo').trigger('close');\n}", "handleListSaved() {\n this.$refs.saveCartModal.close();\n }", "function endEarlyButton() {\n endEarlyDetails();\n}", "closeModal() {\n if (this.bFormEdited) {\n this.bShowConfirmationModal = true;\n }\n else {\n //re-initialize the track variable after successful transaction\n this.listValidTranferTo = [];\n this.listValidPremise = [];\n this.selectedTranferToSA = [];\n this.reasonSelected = false;\n this.dataTransferFrom = null;\n this.dataTransferTo = null;\n this.dataReasonOptions = null;\n\n this.bShowModal = false;\n }\n }", "static closeOrderWizard() {\n const handles = Common.getWindowHandles();\n if (handles.length > 1) {\n Common.switchToWindow(handles[1]);\n Common.closeBrowser();\n }\n }", "function CloseRisk() {\n\tdocument.getElementById(\"AddRisk\").style.display = \"none\";\n\tdocument.getElementById(\"newRisk\").value = \"\";\n}", "closeScreen() {\n this.loading = true;\n this[NavigationMixin.Navigate]({\n type: \"standard__recordPage\",\n attributes: {\n recordId: this.customerRecorId,\n objectApiName: \"Account\", // objectApiName is optional\n actionName: \"view\"\n }\n });\n this.loading = false;\n }", "function closeDisplayInformation() {\n document.getElementById(\"diseaseInformation\").style.display = \"none\";\n document.getElementById(\"diseaseInformation\").innerHTML = \"\";\n document.getElementById(\"diseaseInformationName\").innerHTML = \"\";\n document.getElementById(\"symptomsBox\").innerHTML = \"\";\n document.getElementById(\"symptomsBox\").style.display = \"none\";\n document.getElementById(\"goBtn\").innerHTML = \"\";\n document.getElementById(\"btnCloseTheWindowSymptoms\").style.display = \"none\";\n document.getElementById(\"showDialogBox\").style.display = \"block\";\n document.getElementById(\"diseaseInformationBtnClose\").style.display = \"none\";\n}", "function newOrClose(){\r\n\t\tconsole.log(self.save);\t\t\t\t\r\n\t\tif(self.save== \"saveclose\" ){\r\n\t\t\t drawerClose('.drawer') ;\r\n\t\t}\r\n\t\treset();\r\n\t}", "function OnBAEAModeFormsWindow_Close()\r\n{\r\n // Since we are referencing a global collection for our bindings,\r\n // make sure to call $.destroy() when you are done with the\r\n // controller/window. This will ensure that no memory is\r\n // leaked and that the bindings are properly released.\r\n $.destroy() ;\r\n}", "function closeVirtualstor() {\n\t\t\tdocument.getElementById(\"Virtualstor\").style.width = \"0\";\n\t\t}", "function handleCloseClick(){\n handleClose()\n }", "function closeNewRatingPage() {\n document.getElementById('newRatingModal').style.display=\"none\";\n document.getElementById(\"newRatingForm\").reset();\n\n if (document.getElementById('emptyFieldsRating') != null) {\n document.getElementById('emptyFieldsRating').style.display=\"none\";\n }\n}", "function potvrdaKupovine() {\r\n window.alert(\"Vaša kupovina je potvrđena\")\r\n window.close();\r\n}", "function closePlmn() {\n\t\t\tdocument.getElementById(\"Plmn\").style.width = \"0\";\n\t\t}", "handleCloseForm(event) {\n console.log('[psaActuals.handleCloseForm]');\n this.selectedPMIAId = undefined;\n this.selectedAccountId = undefined;\n this.selectedPMIId = undefined;\n this.showActualsForm = false;\n }", "function closeManagerEvaluation(save){\n\t$managerEvaluationOptions.hide();\n\tif(save) {\n\t\tsetManagerEvaluationLabel($managerEvaluationInput.val());\n\t\tsetEvaluationScoreLabel($evaluationScoreInput.val());\n\t}else{\n\t\tsetManagerEvaluationInput($managerEvaluationText.text())\n\t\tvar s = $evaluationScoreText.text();\n\t\tvar score = (s === NO_RATING) ? 0 : s.substring(s.length-1,s.length);\n\t\t\t\n\t\tsetManagerEvaluationScore(score);\n\t}\n\t$managerEvaluationLabels.show();\n\t\n\teditingRating = false;\n\tcloseWarningModal();\n}", "escrowClosed() {\n $(\"#concludeEscrowResultSuccess\").show();\n\n addAlertElement(\"Escrow Closed successfully\",\"success\");\n\n // only visible to auctionhouse\n $(\"#destroyContractListElement\").show();\n }", "function closeForm(hiddenFormID) {\n\tdocument.getElementById(hiddenFormID).style.display = 'none';\n}", "function _close() {\n var selectedTxt = selectItems[selected].text;\n selectedTxt != $label.text() && $original.change();\n $label.text(selectedTxt);\n\n $outerWrapper.removeClass(classOpen);\n isOpen = false;\n\n options.onClose.call(this);\n }", "function closePage() {\n if (!state.isNew) {\n app.router.load('contact', {id: contact._id});\n } else {\n app.mainView.loadPage('www/html/contact.html?id=' + contact._id, false);\n }\n app.f7.closeModal();\n }", "function win_unload() {\n\n\twindow.opener.frmMain.submit();\n}", "function buttonPoweClicked()\n{\n this.window.close();\n}", "function closeEms2() {\n\t\t\tdocument.getElementById(\"Ems2\").style.width = \"0\";\n\t\t}", "function closeNfvi2() {\n\t\t\tdocument.getElementById(\"Nfvi2\").style.width = \"0\";\n\t\t}", "function pay_more_close() {\n $(\".pay-more-popup-close\").click(function() {\n $(\".dialog_box\").empty();\n });\n }", "OnClickEditClosingBalance() {\n this.props.setCurrentPopup(\n SessionHelper.isEnableCashControl() ?\n SessionConstant.POPUP_CLOSE_SESSION_CASH_CONTROL : SessionConstant.POPUP_CLOSE_SESSION\n );\n }", "close () {\n // don't do anything when we have an error\n if (this.state === 'error') { return; }\n\n if (!this.leaveOpen && this.active) {\n this.closed = true;\n this.rsWidget.classList.add('rs-closed');\n let selected = document.querySelector('.rs-box.rs-selected');\n if (selected) {\n selected.setAttribute('aria-hidden', 'true');\n }\n } else if (this.active) {\n this.setState('connected');\n } else {\n this.setInitialState();\n }\n\n if (this.rsWidget.classList.contains('rs-modal')) {\n this.rsBackdrop.classList.remove('visible');\n setTimeout(() => {\n this.rsBackdrop.style.display = 'none';\n }, 300);\n }\n }", "closeLoginForm() {\n document.getElementById(\"showLoginForm\").checked = false;\n this.switchToLogin();\n updatePageTitle(\"Utforsk nye aktiviteter\");\n }", "function closeSubmitted(e) {\n if(e.target === submitBtn && bookTitle.value !== \"\" && bookAuthor.value !== \"\" && pages.value !== \"\"){\n formContainer.style.display = 'none'\n }else{\n displayData()\n }\n}", "function exitEditBookForm() {\n editForm.reset()\n editForm.style.visibility = 'hidden'\n allowPointerEvents()\n}", "function close() {\n $mdDialog.hide();\n }", "function onCloseButtonClick(){\n\t\tt.hide();\n\t}", "function scCloseWebEdit(url) {\n window.top.returnValue = window.returnValue = url;\n window.top.close();\n}", "function OnBtnBack_Click( e )\r\n{\r\n try\r\n {\r\n Alloy.Globals.ProtectedCleanUpEventListener( Ti.App , \"form:save_from_section\" ) ;\r\n\r\n // On iOS devices, the NavigationWindow will be closed.\r\n // Instead on Android devices, the Window will be close\r\n if( OS_IOS )\r\n {\r\n $.navigationWindowSectionFour.close() ;\r\n }\r\n else\r\n {\r\n $.aedesModeSectionFourWindow.close() ;\r\n }\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}", "close() {\n if (this._windowRef != null) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }" ]
[ "0.6926146", "0.6909939", "0.6806721", "0.6559106", "0.6443541", "0.64165354", "0.63693875", "0.63185865", "0.6302571", "0.62976885", "0.6297595", "0.62764835", "0.62740195", "0.62653846", "0.62377334", "0.6227472", "0.62108666", "0.61988795", "0.6198675", "0.6186229", "0.6181351", "0.6166891", "0.61590827", "0.6158534", "0.6156577", "0.61536616", "0.61377305", "0.6116897", "0.61140287", "0.61131644", "0.6100454", "0.6097702", "0.6095592", "0.6093995", "0.60932213", "0.60824585", "0.6065551", "0.60644245", "0.60624576", "0.6053876", "0.6052084", "0.6051824", "0.605041", "0.60422826", "0.60325485", "0.60304695", "0.6016569", "0.6016569", "0.6008703", "0.5992665", "0.599155", "0.59895", "0.5974452", "0.5970529", "0.5970255", "0.5963121", "0.5960912", "0.5960912", "0.5960912", "0.5954118", "0.5952328", "0.59516436", "0.5951469", "0.5949401", "0.594189", "0.5938321", "0.5932743", "0.59207", "0.5918914", "0.59186685", "0.591793", "0.59169555", "0.59154963", "0.59085286", "0.5905992", "0.5904375", "0.5903353", "0.5901061", "0.58970207", "0.589181", "0.58895636", "0.5879991", "0.5879229", "0.5879161", "0.5877803", "0.5872961", "0.5868747", "0.58647305", "0.58352566", "0.58306235", "0.58233196", "0.5818171", "0.5815746", "0.58151364", "0.5814703", "0.58140147", "0.58111995", "0.58083487", "0.58061576", "0.58044803", "0.5796068" ]
0.0
-1
This function creates report graphs
function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) { $('#pipelineName').show(); $('#conversionName').show(); $('#pipeLead').width((allLead / allCurrentPipe) * 800); $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800); $('#pipeSale').width((allSale / allCurrentPipe) * 800); $('#leadText').width((allLead / allCurrentPipe) * 800); $('#blankopp').width((allOpp / allCurrentPipe) * 800); $('#blankLead').width((allLead / allCurrentPipe) * 800); $('#oppText').width((allOpp / allCurrentPipe) * 800); $('#saleText').width((allSale / allCurrentPipe) * 800); // Calculate the widths for conversion rate var total = allLost + allSale; $('#wonOpp').width((allSale / total) * 660); $('#lostOpp').width((allLost / total) * 660); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateGraphs() {\n return [{\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BZDVkZmI0YzAtNzdjYi00ZjhhLWE1ODEtMWMzMWMzNDA0NmQ4XkEyXkFqcGdeQXVyNzYzODM3Mzg@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"It\",\n \"type\": \"column\",\n \"valueField\": \"It\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BNDAxMTZmZGItZmM2NC00M2E1LWI1NmEtZjhhODM2MGU0ZmJlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Hangover\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.5,\n \"valueField\": \"The Hangover\"\n }, {\n \"balloonText\": \"<img src='https://ia.media-imdb.com/images/M/MV5BMTk3OTM5Njg5M15BMl5BanBnXkFtZTYwMzA0ODI3._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Notebook\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.45,\n \"valueField\": \"The Notebook\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BYzE5MjY1ZDgtMTkyNC00MTMyLThhMjAtZGI5OTE1NzFlZGJjXkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Deadpool\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.4,\n \"valueField\": \"Deadpool\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMGE1ZTQ0ZTEtZTEwZS00NWE0LTlmMDUtMTE1ZWJiZTYzZTQ2XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Bad Boys\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.35,\n \"valueField\": \"Bad Boys\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BY2I1NWE2NzctNzNkYS00Nzg5LWEwZTQtN2I3Nzk3MTQwMDY2XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Caddyshack\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.3,\n \"valueField\": \"Caddyshack\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMzNmY2IwYzAtNDQ1NC00MmI4LThkOTgtZmVhYmExOTVhMWRkXkEyXkFqcGdeQXVyMTk5NDA3Nw@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Die Hard\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.25,\n \"valueField\": \"Die Hard\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMTg1MTY2MjYzNV5BMl5BanBnXkFtZTgwMTc4NTMwNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Black Panther\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.2,\n \"valueField\": \"Black Panther\"\n }];\n }", "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "function genChart(){ \n var cols = [ {\n id : \"t\",\n label : \"host\",\n type : \"string\"\n } ];\n angular.forEach(data.hit, function(v, index) {\n cols.push({\n id : \"R\" + index,\n label : v.hostname,\n type : \"number\"\n });\n });\n var rows = [];\n angular.forEach(data.hit, function(q, i) {\n var d = [ {\n v : q.name\n } ];\n angular.forEach(data.hit, function(r, i2) {\n d.push({\n v : r.runtime\n });\n });\n rows.push({\n c : d\n });\n });\n var options={\n title:'Compare: ' + data.suite + \" \" + data.query,\n vAxis: {title: 'Time (sec)'}\n ,hAxis: {title: 'System'}\n // ,legend: 'none'\n };\n return {\n type : \"ColumnChart\",\n options : options,\n data : {\n \"cols\" : cols,\n \"rows\" : rows\n }\n };\n }", "function generateGraphs(mode,graphType,graphData,filter){\n\n if(mode==null||mode==undefined){return;}\n\n console.log(\"graphData: \"+JSON.stringify(graphData) );\n console.log(\"mode: \"+JSON.stringify(mode) );\n console.log(\"graphType: \"+JSON.stringify(graphType) );\n console.log(\"filter: \"+JSON.stringify(filter) );\n\n var canvas=$('.'+mode+\"Canvas\"+graphType.charAt(0).toUpperCase()+graphType.slice(1))[0];\n\n fitToContainer(canvas);\n\n var filterToMomentTimeFormat={\"year\":\"YYYY\",\"month\":\"MM-YYYY\",\"day\":\"MM-DD-YYYY\" };\n\n var momentTimeFormat=filterToMomentTimeFormat[filter];\n\n ////console.log(\"timeFormat: \"+timeFormat);\n\n if( ['totalDonationsVsDate','numOfMembersVsDate'].includes(graphType)){\n\n let xValues=sortDates(Object.keys(graphData),'num');\n\n xValues.forEach((xVal,index)=>{\n // xValues[index]= capitalize(xVal)}\n //console.log(\"date:\"+ xValues[index]);\n xValues[index]=moment(xValues[index], momentTimeFormat);\n\n });\n\n\n let yValues=Object.values(graphData);\n\n var ctx = canvas.getContext('2d');\n\n var y_dataset= [{data: yValues,fill:false,backgroundColor: 'rgba(153, 102, 255, 0.4)',\n borderColor:'rgba(153, 102, 255, 1)',borderWidth: 1}];\n\n createCanvas(ctx,xValues, y_dataset,graphType,filter);\n }\n\n\n if( ['methodOfPaymentVsDate'].includes(graphType)){\n let xValues=sortDates(Object.keys(graphData),'num');\n\n //console.log(\"xValues: \"+JSON.stringify(xValues));\n\n yKeyToColorScheme={ 'cheque': 'rgba(181, 162, 199,0.8)','cash': 'rgba(199, 162, 181,0.8)',\n 'debit':'rgba(162, 181, 199,0.8)'};\n\n let y_dataset=[];let yValuesObj={};\n\n if (xValues){\n\n xValues.forEach( (xkey, xindex)=> {\n\n xValues[xindex]=moment(xValues[xindex], momentTimeFormat);\n for( [yKey,yVal] of Object.entries(graphData[xkey])){\n\n if(Object.keys(yValuesObj).includes(yKey) ){\n yValuesObj[yKey].push(yVal);\n }else{\n yValuesObj[yKey]=[yVal];\n }\n\n }\n });\n\n }\n \n\n //console.log(\"yValuesObj: \"+ JSON.stringify(yValuesObj));\n var randomColor=generateRandomColour();\n\n for([yLabel,yValues] of Object.entries(yValuesObj)){\n y_dataset.push({\n label:capitalize(yLabel),\n fill:false,\n backgroundColor:yKeyToColorScheme[yLabel] || randomColor,\n borderColor:yKeyToColorScheme[yLabel] || randomColor,\n data:yValuesObj[yLabel],\n });\n }\n\n //xValues.forEach((xVal,index)=>{ xValues[index]= capitalize(xVal)});\n var ctx = canvas.getContext('2d');\n\n createCanvas(ctx,xValues, y_dataset,graphType,filter);\n\n\n }\n\n\n}", "function CreateUsageGraph(usageArray) {\r\n var colorsArray = [\"#acacac\"\r\n , \"#34C6CD\"\r\n , \"#FFB473\"\r\n , \"#2A4380\"\r\n , \"#FFD173\"\r\n , \"#0199AB\"\r\n , \"#FF7600\"\r\n , \"#123EAB\"\r\n , \"#FFAB00\"\r\n , \"#1A7074\"\r\n , \"#A64D00\"\r\n , \"#466FD5\"\r\n , \"#BE008A\"\r\n , \"#B4F200\"\r\n , \"#DF38B1\"\r\n , \"#EF002A\"\r\n ];\r\n var data = new google.visualization.DataTable();\r\n \r\n data.addColumn(\"string\", \"Week Start\");\r\n var frequency = 2 * Math.PI / usageArray[0].length;\r\n // create the headings columns and colors array dynamically\r\n for (var i = 1; i < usageArray[0].length; i++) {\r\n var red = Math.sin(i * frequency + 0) * 127 + 128;\r\n var green = Math.sin(i * frequency + 2) * 127 + 128;\r\n var blue = Math.sin(i * frequency + 4) * 127 + 128;\r\n data.addColumn(\"number\", usageArray[0][i]);\r\n colorsArray.push(RGB2Color(red, green, blue));\r\n }\r\n\r\n // add the data\r\n //data.addColumn({ type: \"number\", role: \"annotation\" });\r\n for (var i = 1; i < usageArray.length; i++) \r\n data.addRows([usageArray[i]]);\r\n\r\n var options = {\r\n backgroundColor: \"#efeeef\",\r\n title: \"Distinct Logins a day by group by week\",\r\n titlePosition: \"out\",\r\n colors: colorsArray,\r\n lineWidth: 3,\r\n width: \"100%\",\r\n height: \"100%\",\r\n curveType: \"function\",\r\n explorer: {},\r\n hAxis: {\r\n textPosition: \"none\",\r\n slantedText: true,\r\n slantedTextAngle: 60\r\n //gridlines: {\r\n // color: \"#111\",\r\n // count: 5//data.getNumberOfRows()\r\n //}\r\n },\r\n legend: {\r\n position: 'top',\r\n textStyle: { fontSize: 13 }\r\n },\r\n chartArea: {\r\n left: 60,\r\n top: 70,\r\n width: \"100%\",\r\n height: \"90%\"\r\n },\r\n animation: {\r\n duration: 1000,\r\n easing: \"out\"\r\n },\r\n //selectionMode: \"multiple\",\r\n vAxis: {\r\n title: \"Distinct Users\"\r\n }\r\n };\r\n \r\n var chart = new google.visualization.LineChart(document.getElementById(\"usageByTime\"));\r\n //google.visualization.events.addListener(chart, \"select\", function () {\r\n // var arr = new Array();\r\n // $(\".grid\").find(\"td\").each(function () {\r\n // arr.push($(this).attr(\"id\"));\r\n // $(this).removeClass(\"graphRowHover\");\r\n // });\r\n // alert(arr);\r\n // var selectedItem = chart.getSelection()[0];\r\n // //alert(\"#cell\" + selectedItem.column + \",\" + (selectedItem.row + 1));\r\n // $(\"#cell\" + selectedItem.column + \",\" + (selectedItem.row + 1)).addClass(\"graphRowHover\");\r\n //});\r\n chart.draw(data, options);\r\n\r\n // create Data Table\r\n var table = document.createElement(\"table\");\r\n $(table).addClass(\"grid\");\r\n for (var i = 0; i < usageArray[1].length; i++) {\r\n var row = document.createElement(\"tr\");\r\n for (var j = 0; j < usageArray.length; j++) {\r\n var cell = document.createElement(\"td\");\r\n if (i == 0)\r\n cell = document.createElement(\"th\");\r\n\r\n \r\n\r\n // start Formatting\r\n $(cell).addClass(\"graphCellHover\");\r\n $(cell).hover(function () {\r\n $(this).closest(\"tr\").addClass(\"graphRowHover\");\r\n }, function () {\r\n $(this).closest(\"tr\").removeClass(\"graphRowHover\");\r\n });\r\n // end formatting\r\n\r\n cell.appendChild(document.createTextNode(usageArray[j][i]));\r\n // if heading, allow filter\r\n if (j === 0) {\r\n var userList = UsersByGroup(usageArray[j][i]);\r\n $(cell).css(\"width\", \"100px\");\r\n \r\n if (i !== 0) $(cell).addClass(\"showing\").addClass(\"rowHeader\").attr(\"id\", \"t\" + i).attr(\"title\", \"Hide/Show on graph \\n\\n\" + \r\n UsersByGroup(usageArray[j][i])\r\n );\r\n (function (d, opt, n) { // the onclick function\r\n $(cell).click(function () {\r\n view = new google.visualization.DataView(d);\r\n if ($(this).hasClass(\"showing\")) {\r\n $(this).closest(\"tr\").find(\"td\").each(function () {\r\n $(this).removeClass(\"showing\").removeClass(\"graphCellHover\").addClass(\"grapCellhHoverNotShow\");\r\n });\r\n } else {\r\n $(this).closest(\"tr\").find(\"td\").each(function () {\r\n $(this).removeClass(\"grapCellhHoverNotShow\").addClass(\"showing\").addClass(\"graphCellHover\");\r\n });\r\n }\r\n\r\n var showColumnsArray = new Array();\r\n // toggle\r\n $(\".rowHeader\").each(function () {\r\n if (!$(this).hasClass(\"showing\"))\r\n showColumnsArray.push(parseInt($(this).attr(\"id\").substr(1, $(this).attr(\"id\").length - 1)));\r\n //view.hideRows([parseInt($(this).attr(\"id\").substr(1, $(this).attr(\"id\").length - 1))]);\r\n });\r\n\r\n view.hideColumns(showColumnsArray);\r\n chart.draw(view, opt);\r\n });\r\n })(data, options, i);\r\n } else {\r\n $(cell).addClass(\"cellNumberTight\");\r\n if (i > 0) {\r\n $(cell).attr(\"id\", \"cell\" + i + \",\" + j);\r\n $(cell).mouseover(function () {\r\n var selectItem = chart.series;\r\n var split = $(this).attr(\"id\").substr(4, $(this).attr(\"id\").length - 4).split(\",\");\r\n });\r\n }\r\n }\r\n row.appendChild(cell);\r\n }\r\n table.appendChild(row);\r\n }\r\n $(\"#graphDetails\").html(table);\r\n \r\n // show the graph in full-screen mode\r\n $(\"#showFullScreen\").on(\"click\", function (e) {\r\n $(\"#usageByTime\").removeClass(\"graph\").css({\r\n \"position\": \"fixed\",\r\n \"left\": 0,\r\n \"top\": 0,\r\n \"z-index\": 5,\r\n \"width\": \"100%\",\r\n \"height\": \"100%\",\r\n \"margin\": 0\r\n });\r\n\r\n $(this).css(\"z-index\", 1);\r\n \r\n // create the Div for closing the full-screen\r\n var closeDiv = document.createElement(\"div\");\r\n $(closeDiv).addClass(\"float-right-absolute\").click(function () { \r\n $(\"#usageByTime\").css({\r\n \"position\": \"\",\r\n \"left\": \"\",\r\n \"top\": \"\",\r\n \"z-index\": \"\",\r\n \"width\": \"\",\r\n \"height\": \"\",\r\n \"margin\": \"\"\r\n }).addClass(\"graph\");\r\n $(\"#closeButtonDiv\").remove();\r\n chart.draw(data, options);\r\n $(\"#showFullScreen\").css(\"z-index\", 10);\r\n }).css({\r\n \"min-width\": \"20px\",\r\n \"min-height\": \"20px\",\r\n \"background-image\": \"url(../Images/x-circle.png)\",\r\n \"background-size\": \"cover\",\r\n \"cursor\": \"pointer\"\r\n }).attr(\"id\", \"closeButtonDiv\");\r\n\r\n closeDiv.appendChild(document.createTextNode(\" \"));\r\n document.body.appendChild(closeDiv);\r\n chart.draw(data, options);\r\n });\r\n}", "function update_graphs(res)\n{\n\t\t\n\n\t//code for generating the labels\t\n\t//to hold the labels for the graphs\n\tvar labels = [];\n\n\t//generate the labels for the graphs\n\tif(isSevenHours)\n\t{\n\t\t//if the labels must be generated in hours\n\t\t//hi\n\t\tvar i;\n\t\tfor(i = 6; i >= 0; i--)\n\t\t{\n\t\t\tvar prev_date = new Date();\n\t\t\tprev_date.setHours( prev_date.getHours() - i);\n\t\t\tvar full_date = convertToString(prev_date);\n\t\t\tlabels.push( full_date.charAt(8) + full_date.charAt(9) );\n\t\t}\n\t}\n\telse\n\t{\n\t\t//if the labels must be generated in days\n\t\tvar i;\n\t\tfor(i = 6; i >= 0; i--)\n\t\t{\n\t\t\tvar prev_date = new Date();\n\t\t\tprev_date.setDate( prev_date.getDate() - i);\n\t\t\tvar full_date = convertToString(prev_date);\n\t\t\t\n\t\t\t//char at 4 and 5 is the month, char at 6 and 7 is the date\n\t\t\tlabels.push(full_date.charAt(4) + full_date.charAt(5) + '/' \n\t\t\t\t\t\t\t\t\t\t\t+ full_date.charAt(6) + full_date.charAt(7) );\n\t\t}\n\n\t}\n\t//end of code for generating the labels\n\n\t//alert(JSON.stringify(labels));\n\n\n\n\t//code to parse through exercise history data\n\t\n\t//4 element array for trends section\n\tvar trendsData = [0,0,0,0];\n\t//7 by 4 element array for exercise history section; first index the day, second index the category\n\tvar exHisData = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]];\n\t//7 element array for step count section\n\tvar stepCountData = [0,0,0,0,0,0,0];\n\n\tvar sCompare = 0;\n\tvar eCompare = 0;\n\tvar sCompareLabel = 0;\n\tvar eCompareLabel = 0;\n\t//define comparison substring start and end index \n\t//for comparing dates // differend for hours and days\n\tif(isSevenHours)\n\t{\n\t\tsCompare = 8;\n\t\teCompare = 10;\n\t\tsCompareLabel = 0;\n\t\teCompareLabel = 2;\n\t}\n\telse\n\t{\n\t\tsCompare = 6;\n\t\teCompare = 8;\n\t\tsCompareLabel = 3;\n\t\teCompareLabel = 5;\n\t}\n\tvar data = JSON.parse(res);\n\tarrayLength= data.exData.length;\n\tlabelArrLength = labels.length;\n\tfor(var i = 0; i < arrayLength; i++)\n\t{\n\t\t//iterate through each of the labels\n\t\tfor(var j = 0; j < labelArrLength; j++ )\n\t\t\tif(data.exData[i].date.substring(sCompare,eCompare) == \n\t\t\t\t\tlabels[j].substring(sCompareLabel,eCompareLabel) )\n\t\t\t{\n\t\t\t\t//loop represents exData entry i that is to be put in array entry j\n\t\t\t\t\n\t\t\t\t//add step count\n\t\t\t\tstepCountData[j] += data.exData[i].stepsTaken;\n\n\t\t\t\t//get exdata\n\t\t\t\tvar exData = JSON.parse(data.exData[i].exercises_done);\n\n\t\t\t\t//iterate through each exercise\n\t\t\t\texData.forEach(item => \n\t\t\t\t\t{\n\t\t\t\t\t\t//get the category\n\t\t\t\t\t\tvar cat = sortByCategory(item);\n\t\t\t\t\t\t//increment the trends array\n\t\t\t\t\t\ttrendsData[cat]++;\n\t\t\t\t\t\texHisData[j][cat]++;\n\n\t\t\t\t\t});\n\t\t\t}\n\t}\n\n\t//Update the trends graph\n\tset_trends(\"Flexibility\", \"Strength\", \"Cardio\", \"Balance\" , trendsData[0], trendsData[1], trendsData[2] , trendsData[3]);\n\t//update the stepcount graph\n\tset_stepcount( labels[0],labels[1] ,labels[2] ,labels[3] ,labels[4] ,labels[5] ,labels[6] ,\n\t\t\tstepCountData[0],stepCountData[1],stepCountData[2],stepCountData[3],stepCountData[4],stepCountData[5],stepCountData[6]);\n\t//Update the exercise history graph\n\tset_exercise_history\n\t(\n\t\tlabels[0],labels[1] ,labels[2] ,labels[3] ,labels[4] ,labels[5] ,labels[6] ,\n\t\texHisData[0][0], exHisData[1][0], exHisData[2][0], exHisData[3][0], exHisData[4][0], exHisData[5][0], exHisData[6][0],\n\t\texHisData[0][1], exHisData[1][1], exHisData[2][1], exHisData[3][1], exHisData[4][1], exHisData[5][1], exHisData[6][1],\n\t\texHisData[0][2], exHisData[1][2], exHisData[2][2], exHisData[3][2], exHisData[4][2], exHisData[5][2], exHisData[6][2],\n\t\texHisData[0][3], exHisData[1][3], exHisData[2][3], exHisData[3][3], exHisData[4][3], exHisData[5][3], exHisData[6][3]\n\t);\n\n\n\n}", "function generateReportStats(reports, labelsFn, seriesFn, dataFn) {\n if (reports == null || reports.length == 0) {\n $scope.charts = [];\n return;\n }\n\n var chart = {\n labels: [],\n series: [],\n data: []\n };\n\n var labels = utilitiesService.groupBy(reports, labelsFn);\n var empty = labels.map(function(l) { return null; });\n\n var series = utilitiesService.groupBy(reports, seriesFn);\n\n series.forEach(function(serie, index) {\n chart.series.push(serie.key);\n chart.data.push(empty.slice());\n });\n\n labels.forEach(function(label, index) {\n chart.labels.push(label.key);\n\n label.items.forEach(function(report, index) {\n var s = chart.series.indexOf(seriesFn(report));\n var l = chart.labels.indexOf(labelsFn(report));\n chart.data[s][l] = dataFn(report);\n });\n });\n\n //add total series\n chart.series.push(\"Σύνολο\");\n var zeroes = labels.map(function(l) { return 0; });\n chart.data.push(zeroes);\n\n chart.labels.forEach(function (label, index) {\n var total = 0;\n for (var i = 0; i < chart.series.length; i++) {\n total += chart.data[i][index];\n }\n chart.data[chart.series.length-1][index] = total;\n });\n\n $scope.charts[reports[0].Type] = chart;\n\n return chart;\n }", "function show_available_graphs(table_data, data_type, county) {\n \n var skip_labels = ['Record ID', 'View report']\n , skip_labels_table = ['Record ID']\n , headings = []\n , table_headings = []\n , skip_indexes = []\n , too_many = []\n , data_and_msg\n , graph_type;\n //table stuff here \n table_data.cols.forEach(function(col, index) {\n if(skip_labels.indexOf(col.label) < 0) {\n headings.push({label:col.label, index: index});\n // group_on({label:col.label, index: index});\n }\n if (skip_labels_table.indexOf(col.label) < 0){\n table_headings.push(col);\n }\n else {\n skip_indexes.push(index);\n }\n });\n headings.forEach(function(heading) {\n data_and_msg = group_on(heading.label, data_type, headings, table_data.rows);\n \n if(data_and_msg['msg']) {\n too_many.push(data_and_msg['msg']);\n }\n\n });\n var source = find_source(county, data_type, headings, table_data.rows);\n make_table(table_data, table_headings, skip_indexes);\n if(too_many.length > 0) {\n var msg = '<div class=\"dd-graphs\"><p><b>The following fields have too many unique values to reasonably graph:</b></p>' + too_many.join(\"\\n\") + '</div>';\n $('#open-nc-widget').append(msg);\n\n }\n $('.graph-option').click(function() {\n which_graph = $(this).data('which');\n var graph_config = graph_configs[which_graph];\n $('.dd-graphs').each(function(index, el) {\n if($(this).attr('id') !== ('holder-' + which_graph)) {\n $(this).hide('slow');\n }\n });\n $(this).after('<button class=\"btn btn-default graph-show-all\">Back to all graphs</button>');\n $(this).hide();\n $('.graph-show-all').after(' <button class=\"btn btn-default graph-show-code\" style\"margin-left: 5px\">Get code</button>');\n $('.graph-show-code').click(function(e) {\n e.preventDefault();\n var graph_type = graph_config['graph_type'];\n var output_template = '_graph';\n var height = parseInt($('#graph-height').val()) || 'auto';\n var width = parseInt($('#graph-width').val());\n var context = {width: width, height: height, source: source, data: JSON.stringify(graph_config['data']), options: JSON.stringify(graph_config['options']), viz_type: graph_type ,script: 'script'};\n if(graph_type !== 'Table'){\n context['array_to'] = 'arrayTo';\n }\n else {\n context['view'] = JSON.stringify(graph_config.view);\n output_template = '_table';\n \n }\n var code = fill_template('embed_output' + output_template,context);\n var embed_textarea = fill_template('embed_textarea',{});\n $('#' + which_graph).before(embed_textarea);\n $('#embed-code').val(code);\n $('#embed-code').on('click',function() {\n this.select();\n });\n });\n $('.graph-show-all').click( function(e) {\n e.preventDefault();\n if(graph_type !== graph_config['graph_type']) {\n graph_type = graph_config['graph_type'];\n show_graph(graph_config,which_graph);\n }\n $('#embed-code-row, .widget-form, .graph-show-code').remove(); \n $('.dd-graphs').show('slow');\n $(this).remove();\n $('.graph-option').show();\n $('#graph-change-form').remove();\n });\n\n //puts existing values in form\n var form_template = 'graph_widget_form';\n var context = {};\n if(graph_config['graph_type'] === 'Table') {\n form_template = 'table_widget_form';\n context['headings'] = graph_config['headings'];\n }\n var form = fill_template(form_template, context);\n $('#holder-' + which_graph).append(form);\n if(graph_config['graph_type'] === 'LineChart') {\n $('#graph-change-row').remove();\n }\n $('.graph-change-param').each(function(i, el) {\n var param = $(this).data('option');\n var form_type = $(this).attr('type');\n var val;\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = graph_config['options'];\n keys.forEach( function(key) {\n val_obj = val_obj[key];\n });\n val = val_obj;\n }\n else {\n if(param === 'colors') {\n val = graph_config['options'][param][0];\n }\n else {\n val = graph_config['options'][param]; \n }\n }\n if(form_type === 'radio' || form_type === 'checkbox') {\n if($(this).val() === val) {\n $(this).attr('checked','checked');\n }\n \n }\n else {\n $(this).val(val);\n }\n });\n $('.graph-type').click( function() {\n graph_type = $(this).val();\n var temp_config = graph_config;\n graph_config['graph_type'] = graph_type;\n show_graph(graph_config,which_graph);\n });\n //puts form values in option obj\n $('#graph-change-button').click( function(e) {\n e.preventDefault();\n $('.graph-change-param').each( function(i, el) {\n var data_type = $(el).attr('type');\n if(data_type === 'number') {\n val = parseInt($(el).val());\n }\n else if (data_type === 'radio' || data_type === 'checkbox') {\n if($(el).is(':checked')) {\n val = $(el).val();\n }\n }\n else {\n val = $(el).val();\n }\n var param = $(el).data('option');\n if(param === 'hAxis.title' && val !== '' && val && (graph_config['graph_type'] === 'ColumnChart' || graph_config['graph_type'] === 'LineChart')) {\n graph_config['data'][0][1] = val;\n }\n if(param === 'vAxis.title' && val !== '' && val && graph_config['graph_type'] === 'BarChart') {\n graph_config['data'][0][1] = val;\n }\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = {};\n var last = keys.length;\n var first = keys[0];\n for(var i = 1; i < keys.length; i++) {\n val_obj[keys[i]] = val;\n }\n graph_config['options'][first] = val_obj;\n }\n else {\n if(param === 'colors') {\n if(graph_config['options']['colors'][0] !== val) {\n \n graph_config['options']['colors'].unshift(val);\n }\n }\n else {\n graph_config['options'][param] = val; \n }\n }\n \n });\n if(graph_config['graph_type'] === 'Table') {\n var show_cols = [];\n $('.table-fields').each(function(i, el) {\n if($(el).is(':checked')) {\n show_cols.push(parseInt($(el).val()));\n }\n });\n graph_config['view'] = show_cols;\n }\n show_graph(graph_config,which_graph);\n $('#embed-code-row').remove(); \n });\n $('#graph-change-reset').click(function(e) {\n e.preventDefault();\n $('.graph-change-param').each(function(i, el) {\n var param = $(this).data('option');\n var form_type = $(this).attr('type');\n var val;\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = graph_config['options'];\n keys.forEach( function(key) {\n val_obj = val_obj[key];\n });\n val = val_obj;\n }\n else {\n if(param === 'colors') {\n val = graph_config['options'][param][0];\n }\n else {\n val = graph_config['options'][param]; \n }\n }\n if(form_type === 'radio' || form_type === 'checkbox') {\n if($(this).val() === val) {\n $(this).prop('checked',true);\n }\n else {\n $(this).prop('checked', false);\n }\n \n }\n else {\n $(this).val(val);\n }\n if(graph_type !== 'ColumnChart') {\n graph_type = 'ColumnChart';\n show_graph(graph_config,which_graph);\n }\n }); \n });\n });\n }", "function generate_all_reports()\n{\n report_ToAnswer_emails();\n report_FollowUp_emails();\n report_Work_FollowUp_emails();\n}", "function generateReport(){\n\t//create reports folder (if it doesn't already exist)\n\tif(!fs.existsSync(\"reports\")){\n\t\tfs.mkdirSync(\"reports\");\n\t}\n\t\n\t//create a file called by timestamp\n\tvar date = new Date();\n\treportfile = \"reports/\"+date.getDate()+\"-\"+date.getMonth()+\"-\"+date.getFullYear()+\"--\"+date.getHours()+\"h\"+date.getMinutes()+\"m.tex\";\n\t\n\twriteReport();\n\tvar err = createPDF();\n\tif(err){\n\t\tconsole.log(\"ERR : Error during creation of PDF report\");\n\t}\n}", "function generateIdeaData()\n{\n createGraph();\n \n}", "function _makeReport() {\n document.getElementById(\"reportTable\").hidden = false;\n document.getElementById(\"chartContainer\").hidden = false;\n updateReportFromDB();\n}", "function makeGraphs(error, clinicData, attendenceData) {\n\n// create our crossfilter dimensions\n\n var ndx = crossfilter(clinicData); \n var visits = crossfilter(attendenceData);\n var parseDate = d3.time.format(\"%d/%m/%Y\").parse;\n attendenceData.forEach(function (d){\n d.date = parseDate(d.date);\n });\n\n\n\n clinicData.forEach(function (d) {\n \n d.time = +d.aveWaitingTime;\n d.routine = +d.routineAppointments;\n d.urgent = +d.urgentAppointments;\n d.doctors = parseInt(+d['staff/doctors']);\n d.nurses = parseInt(+d['staff/nurses']);\n d.councillors = parseInt(+d['staff/councillors']);\n d.consultants = parseInt(+d['staff/consultants']);\n d.departments = parseInt(+d['departments']); \n \n\n });\n \n attendenceData.forEach(function (d) {\n d.medClinic = +d.medicalClinic;\n d.medCenter\t= +d.medicalCenter;\n d.medHospital\t= +d.hospital;\n d.medWalkInClinic = +d.walkInClinic;\n d.medGp = +d.generalPractice;\n d.count = +d.spend;\n });\n\n\n\n\n// show our chart objects\n show_facility_type_selector(ndx);\n show_facility_name_selector(ndx);\n show_urgent_pie_type(ndx);\n show_routine_pie_type(ndx); \n show_number_staff(ndx);\n show_average_waiting_time(ndx);\n show_urgentAppointments_number(ndx);\n show_routineAppointments_number(ndx);\n show_services_number(ndx);\n show_number_visits(visits);\n show_departments(ndx)\n \n \n//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// \n// Console logs used in development //\n// //\n// console.log(clinicData); //\n// console.log(attendenceData); //\n//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// \n\n dc.renderAll();\n\n\n}", "function makeGraphs(error, fireData) {\n var ndx = crossfilter(fireData);\n var parseDate = d3.time.format(\"%d-%m-%y\").parse;\n var parseTime = d3.time.format(\"%H:%M:%S\").parse;\n var parseHour = d3.time.format(\"%H\");\n //converting from a string into a date format, and formatting as year only\n //to display in select menu drop down list as 2013,2014,2015\n\n fireData.forEach(function(d) {\n d.Incident_Counter = parseInt(d.Incident_Counter); // parsing the incident count key from text to a number.\n d.Date = parseDate(d.Date);\n d.TOC = parseHour(parseTime(d.TOC));\n d.Year = d.Date.getFullYear();\n });\n\n show_area_selector(ndx);\n show_type_selector(ndx);\n show_year_selector(ndx);\n totalIncidentCount(ndx);\n show_incidents_that_are_fire(ndx);\n show_incidents_that_are_special(ndx);\n show_fire_by_area(ndx);\n show_fire_by_date(ndx);\n show_fire_by_all_incidents(ndx);\n show_fire_by_description(ndx);\n show_fire_by_area10(ndx);\n show_fire_by_time(ndx);\n show_fire_by_day(ndx);\n \n dc.renderAll(); //call to render dimensional charting\n}", "function createGraphs(dataArray) {\n tempData = [];\n humData = [];\n distanceData = [];\n\n if (dataArray != null) {\n dataArray.forEach(function (data) {\n tempData.push([Date.parse(data.created), data.content.weather_readings.temperature]);\n humData.push([Date.parse(data.created), data.content.weather_readings.humidity]);\n distanceData.push([Date.parse(data.created), data.content.ultrasonic_distance]);\n });\n\n tempData.sort();\n humData.sort();\n distanceData.sort();\n }\n\n loadChart(\"temperature\", \"Temperature\", \"Degrees\", \"PIBOMETER\", tempData);\n loadChart(\"humidity\", \"Humidity\", \"Water Content\", \"PIBOMETER\", humData);\n loadChart(\"distance\", \"Distance Set off\", \"CM\", \"PIBOMETER\", distanceData);\n}", "function genChart(){\n var colors=[\"#3366cc\",\"#dc3912\",\"#ff9900\",\"#109618\",\"#990099\",\"#0099c6\",\"#dd4477\",\"#66aa00\",\"#b82e2e\",\"#316395\",\"#994499\",\"#22aa99\",\"#aaaa11\",\"#6633cc\",\"#e67300\",\"#8b0707\",\"#651067\",\"#329262\",\"#5574a6\",\"#3b3eac\",\"#b77322\",\"#16d620\",\"#b91383\",\"#f4359e\",\"#9c5935\",\"#a9c413\",\"#2a778d\",\"#668d1c\",\"#bea413\",\"#0c5922\",\"#743411\"];\n var states=_.map($scope.data.states,function(runs,state){return state;});\n\n var session=_.map($scope.data.queries,\n function(v,key){return {\n \"name\":key,\n \"runs\":_.sortBy(v,state)\n }\n ;});\n var c=[];\n if(session.length){\n c=_.map(session[0].runs,function(run,index){\n var state=run.mode + run.factor;\n var pos=states.indexOf(state);\n // console.log(\"��\",state,pos);\n return colors[pos];\n });\n c=_.flatten(c);\n };\n var options={\n title:'BenchX: ' + $scope.benchmark.suite + \" \" + $scope.benchmark.meta.description,\n vAxis: {title: 'Time (sec)'}\n ,hAxis: {title: 'Query'}\n // ,legend: 'none'\n ,colors: c\n };\n return utils.gchart(session,options);\n\n }", "async function generateReport()\n{\n\t// Reset the values:\n\tallSVGUri = [];\n\tall_imgs = [];\n\n\t// Finish these functions:\n\tawait SVGUri(\"#mapSvg\");\n\tawait SVGUri(\"#lineGraphSVG\");\n\n\t// console.log(allSVGUri);\n\n\tfor(var i = 0; i < allSVGUri.length; i++){\n\t\t// Wait for this function to finish:\n\t\tawait convertURIToImageData(allSVGUri[i]).then(function(imageData){\n\t\t\t// console.log(\"7: Finished convertURIToImageData called\")\n\n\t\t});\n\t}\n\n\t// await createPDF();\n\tawait generatePDF();\n}", "function makeGraphs(error, staffData) {\n var ndx = crossfilter(staffData);\n // Changes PizzaTime from a string to an integer\n staffData.forEach(function(d) {\n d.PizzaTime = parseInt(d.PizzaTime);\n });\n // Changes YearsService from string to integer\n staffData.forEach(function(d) {\n d.YearsService = parseInt(d.YearsService);\n });\n // Calls all data functions\n show_rank_balance(ndx);\n show_average_time_by_rank(ndx);\n show_years_of_service_vs_rank(ndx);\n show_years_service_vs_pizza_time(ndx);\n show_course_balance(ndx);\n show_number_of_staff(ndx);\n show_fastest_and_slowest_pizza_maker(ndx);\n show_percentage_split_of_under_40_seconds(ndx);\n show_longest_and_shortest_serving_worker(ndx);\n\n dc.renderAll();\n\n}", "function creategiftgraphs(ans){\n var graphscale = 40;\n var genY = nextyaxis();\n var genY2 = nextyaxis();\n var nxtcolor = nextcolor();\n\n var gift_ans = gifts.map(function(gift){return gift(ans);});\n\n //Remove the questions and directions\n document.getElementById(\"questions\").remove();\n document.getElementById(\"directions\").remove();\n\n document.getElementById(\"title\").innerHTML = \"Spiritual Gifts Survey Answers\";\n\n var graphContainer = d3.select(\"body\").append(\"p\").append(\"svg\")\n .attr(\"width\",1200)\n .attr(\"height\",980)\n .style(\"border\", \"1px solid black\");\n \n //To Create the bar graphs\n graphContainer.selectAll(\"rect\")\n .data(gift_ans)\n .enter()\n .append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"y\", function(){return genY.next().value;})\n .attr(\"width\", function(datum){return datum*graphscale})\n .attr(\"height\", 50)\n .style(\"fill\", function(){return nxtcolor.next().value;});\n\n //To create the answer strings next to the bar graphs\n graphContainer.selectAll(\"text\")\n .data(gift_ans)\n .enter()\n .append(\"svg:text\")\n .attr(\"x\",function(datum){return datum*graphscale+5})\n .attr(\"y\", function(){return genY2.next().value;})\n .attr(\"dy\", 25)\n .text(function(datum){return datum;})\n .style(\"fill\", \"black\");\n\n}", "function graph () {\n\n\t/*** private member variables ***/\n\n\t// colors for 9 different shades for each month in a year\n\tvar colors = [\"#ffffd9\",\"#edf8b1\",\"#c7e9b4\",\"#7fcdbb\",\"#41b6c4\",\"#1d91c0\",\"#225ea8\",\"#253494\",\"#081d58\"];\n\t// text for horizental labels\n\tvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\n\t// canvas size variables\n\tvar margin = { top: 50, right: 0, bottom: 100, left: 30 };\n\tvar width = width = 960 - margin.left - margin.right;\n\tvar height = height = 430 - margin.top - margin.bottom;\n\n\t// side width for each box whose color represent the each data in data array\n\tvar boxWidth = Math.floor(width / months.length); // px\n\n\t/*** private methods ***/\n\n\t// Method for rendering template where svg can be attached, not for drawing svg\n\tfunction render() {\n\t\treturn graphTpl;\n\t}\n\n\t// Method for creating svg->g element\n\tfunction createCanvas(selector, data) {\n\t\tvar canvasHeight = boxWidth * (data.length / months.length);\n\t\t// create canvas based on id selector, return a reference to g element\n\t\tvar svg = d3.select(selector)\n\t .append(\"div\")\n\t .classed('svg-container', true)\n\t .append(\"svg\")\n\t .attr(\"preserveAspectRatio\", \"xMinYMin meet\")\n\t .attr(\"viewBox\", \"0 0 \"+ (width+ 2*boxWidth) +\" \" + (canvasHeight + 2*boxWidth)) // min-x, min-y, width and height\n\t .classed(\"svg-content-responsive\", true)\n\t .append(\"g\")\n\t .attr(\"transform\", \"translate(\" + boxWidth* 1.5 + \",\" + boxWidth + \")\");\n\n\t return svg; // a 'g' element\n\t}\n\t// Method for draw horizontal labels\n\tfunction drawHorizontalLabel(svg, data) {\n\t\tvar timeLabels = svg.selectAll('.timeLabel')\n\t\t .data(months)\n\t\t .enter().append('text')\n\t\t .text(function(d) {\n\t\t return d;\n\t\t }) // below calculate position\n\t\t .attr('x', function (d, i) { return i * boxWidth})\n\t\t .attr('y', function (d, i) {return 0;})\n\t\t .style(\"text-anchor\", \"middle\")\n\t\t .attr(\"transform\", \"translate(\" + boxWidth / 2 + \", -6)\")\n\t\t .attr(\"class\", function(d, i) { return ((i >= 7 && i <= 16) ? \"timeLabel mono axis axis-worktime\" : \"timeLabel mono axis\"); });\n\t}\n\t// Method for drawing vertical labels\n\tfunction drawVerticalLable(svg, data) {\n\t\tvar categoryLineCount = data.length / months.length; // should be an integer\n\t\tvar categoryData = [];\n\t\tfor(var i = 0 ;i < categoryLineCount; i++) {\n\t\t categoryData.push(0); \n\t\t // it doesn't matter what the data really is, just alternate between 'kwh' and 'therm'\n\t\t}\n\t\tvar categoryLabel = svg.selectAll('.dayLabel')\n\t\t .data(categoryData)\n\t\t .enter()\n\t\t .append('text')\n\t\t .text(function(d, i){\n\t\t return i % 2 === 0? 'kwh': 'therm';\n\t\t })\n\t\t .attr('x', 0)\n\t\t .attr('y', function (d, i){\n\t\t return i * boxWidth;\n\t\t })\n\t\t .style('text-anchor', 'end')\n\t\t .attr('transform', 'translate(-6,'+ boxWidth / 1.5 + ')')\n\t\t .attr(\"class\", function (d, i) { return ((i >= 0 && i <= 4) ? \"dayLabel mono axis axis-workweek\" : \"dayLabel mono axis\"); });\n\t}\n\t// Method for draw heatmap boxes\n\tfunction drawHeatMap(svg, data) {\n\t\tvar length = months.length; // 12 month\n\t\tvar colorScale;\n\n\t\tvar cards = svg.selectAll('.hour')\n\t\t .data(data);\n\n\t\tcards.enter().append('rect')\n\t\t .attr('x', function(d, i) { \n\t\t return (i % length) * boxWidth;\n\t\t })\n\t\t .attr('y', function(d, i){\n\t\t return Math.floor(i / length) * boxWidth; // 0 ~ 11 -> 0, 12 ~ 23, ....\n\t\t })\n\t\t .attr(\"rx\", 4)\n\t\t .attr(\"ry\", 4)\n\t\t .attr(\"class\", \"hour bordered\")\n\t\t .attr(\"width\", boxWidth)\n\t\t .attr(\"height\", boxWidth)\n\t .style(\"fill\", function(d, i) {\n\t \n\t if (i % length === 0) {\n\t // create new scale for every year\n\t var yearData = data.slice(i, i + length);\n\t colorScale = d3.scaleQuantile()\n\t .domain([d3.min(yearData), d3.max (yearData)])\n\t .range(colors);\n\t }\n\t return colorScale(d); \n\t });\n\n\t\tcards.select(\"title\").text(function(d) { return d.value; });\n\n\t\tcards.exit().remove();\n\t}\n\t// Method for draw 2 whole svgs for residentials and commercials\n\tfunction drawSvg() {\n\t\t// selector can be #residential, or #commercial which should be in graph.html\n\t\tvar dataSources = [{selector: '#commercial', data: data.commGraphData}, \n\t\t\t{selector: '#residential', data: data.residGraphData}];\n\n\t\tdataSources.forEach(function(item) {\n\t\t\tvar canvas = createCanvas(item.selector, item.data);\n\t\t\tdrawHorizontalLabel(canvas);\n\t\t\tdrawVerticalLable(canvas, item.data);\n\t\t\tdrawHeatMap(canvas, item.data);\n\t\t});\n\t}\n\n\t/*** public methods ***/\n\n\treturn {\n\t\t/* parent view should \n\t\t\t1) first call render to attach the template, which contains the id tag for svg to attach.\n\t\t\t2) then call drawSvg to draw and attach svg to DOM, since d3js can only select element in DOM.\n\t\t*/\n\t\trender: render,\n\t\tdrawSvg: drawSvg\n\t}\n}", "function createGraph()\n\t{\n\t\tgraph = that.add('graph', {\n\t\t\tw: that.size,\n\t\t\th: that.size,\n\t\t\tinputCount: that.inputCount,\n\t\t\teq: [{eq:that.eq.eq, color: style.eqColor}],\n\t\t\txRange: that.axis.x,\n\t\t\tyRange: that.axis.y,\n\t\t\tlabelSkip: that.axis.skip,\n\t\t\tusePiLabels: that.axis.usePiLabels\n\t\t}, {\n\t\t\ttop: that.id + ' top ' + style.margin,\n\t\t\tleft: that.id + ' left ' + style.margin\n\t\t});\n\t}", "function buildPage(flow, outcomes, demo, yearlyData){\n \n // code to buld the graphs that have static data(yearly outcomes, yearly flow)\n // object variable to separate out yearly outcome data\n var monthlyOutcomesgraph = {}\n yearlyData.years.forEach(function(year) {\n function monthlyDictFilter(d) {\n return (String(d[0]).split('-')[0] === year)\n }\n monthlyOutcomesgraph[year] = {\n 'percentPHmo': Object.entries(yearlyData.monthlyOutcomes.percentPHmo).filter(monthlyDictFilter).map(d => d[1]),\n 'exitAll': Object.entries(yearlyData.monthlyOutcomes.exitAll).filter(monthlyDictFilter).map(d => d[1]),\n 'exitPH': Object.entries(yearlyData.monthlyOutcomes.exitPH).filter(monthlyDictFilter).map(d => d[1])\n }\n });\n console.log('Data For Page Load Exit to PH Graph : ', monthlyOutcomesgraph['2015'].percentPHmo)\n \n //will use update functions to build responsive part of rows\n updateFlow(flow, '2018');\n updateOutcomes(outcomes, '2018');\n updateDemo(demo,'2018');\n buildYearlyBar(yearlyData);\n\n // PH chart\n d3.select('container').html\n phChart = Highcharts.chart('container', {\n // chart: {\n // type: 'bar'\n // },\n title: {\n text: 'Program enrollees with permanent housing upon program exit'\n },\n // Turn off Highcharts.com label/link \n credits: {\n enabled: false\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n },\n yAxis: {\n title: {\n text: ''\n },\n labels: {\n format: '{value}%',\n }\n },\n series: [{\n name: '2015',\n // data: [\n // // if want to add N per period as well format as:\n // // {y: series data,\n // // myData: outside data}\n // ]\n }, \n {\n name: '2016',\n // data: []\n },\n {\n name: '2017',\n // data: []\n }, {\n name: '2018',\n // data: []\n }, {\n name: '2019',\n // data: []\n },\n ],\n // Moves location of series names to be as close as possible to line\n legend: {\n layout: 'proximate',\n align: 'right'\n },\n tooltip: {\n // shared: true, //makes all data for that time point visible\n useHTML: true, //allows for more custom and complicated tooltip design\n // headerFormat: '{point.key}<table>',\n // pointFormat: '<tr><td style=\"color: {series.color}\">{series.name}: </td>' +\n // '<td style=\"text-align: right\"><b>{point.y} EUR</b></td></tr>',\n // footerFormat: '</table>',\n // valueDecimals: 2\n formatter: function () {\n return this.x + \" \" +this.series.name + \": <b>\" + this.y\n +\"%</b><br> \" + this.point.myData2 + \" out of \" + this.point.myData \n + \"<br>Exited to permanent housing\";\n }\n },\n });\n let years = []\n let keys = Object.keys(monthlyOutcomesgraph);\n years.push(keys)\n \n let phSeries = []\n years[0].forEach(year =>{ \n var toPush = []\n monthlyOutcomesgraph[year].percentPHmo.forEach((item, index) => {\n toPush.push({'y':item, 'myData':monthlyOutcomesgraph[year].exitAll[index],\n 'myData2':monthlyOutcomesgraph[year].exitPH[index]})\n });\n phSeries.push(toPush);\n });\n // Limit predicted monthly values \n phSeries[4].length = 8;\n\n phChart.series.forEach(year => { \n let index = year.index\n\n year.update({\n data: phSeries[index]\n }, true)\n })\n\n}", "function genChartsData() {\n gameData.forEach((game) => {\n let date = new Date(game.videoData.uploadDate);\n let sPoint = game.stats.synergo.overall.tPoints;\n let s25 = game.stats.synergo.overall.t25;\n let rPoint = game.stats.redez.overall.tPoints;\n let r25 = game.stats.redez.overall.t25;\n let annotation = \"<a href='/\" + game.videoData.id + \"'>\" + game.videoData.title + \"</a>\"\n srPointsData.push([new Date(date), sPoint, rPoint, annotation])\n sPointsData.push([new Date(date), sPoint, annotation])\n rPointsData.push([new Date(date), rPoint, annotation])\n\n sr25Data.push([new Date(date), s25, r25, annotation]);\n s25Data.push([new Date(date), s25, annotation]);\n r25Data.push([new Date(date), r25, annotation]);\n })\n\n var chars = [\"castoro\", \"unicorno\", \"zucca\", \"gatto\", \"alieno\", \"granchio\", \"girasole\", \"drago\", \"coniglio\", \"gufo\", \"seppia\"]\n var fe = [\"numero di 5000\", \"numero di 25000\", \"numero di 50000\"]\n\n sCharData = Object.entries(stats.synergo.charStats);\n sCharData = replaceNames(sCharData, chars)\n sCharData.unshift([\"Tipo di Festa Estrema\", \"valore\"]);\n\n\n rCharData = Object.entries(stats.redez.charStats);\n rCharData = replaceNames(rCharData, chars)\n rCharData.unshift([\"Tipo di Festa Estrema\", \"valore\"]);\n\n\n sFEData = Object.entries(stats.synergo.FEstats);\n sFEData.pop();\n sFEData = replaceNames(sFEData, fe)\n sFEData.unshift([\"Tipo di Festa Estrema\", \"valore\"]);\n\n\n rFEData = Object.entries(stats.redez.FEstats);\n rFEData.pop();\n rFEData = replaceNames(rFEData, fe)\n rFEData.unshift([\"Tipo di Festa Estrema\", \"valore\"]);\n}", "function renderGraph() {\n // Initialize arrays\n var line_data = new Object();\n var tags = form_tags(SINGLEGRAPH_FORM);\n for (var i=0;i<tags.length;i++) {\n if (SINGLEGRAPH_IGNORE_TAGS.indexOf(tags[i]) === -1) {\n line_data[tags[i]] = new Array();\n }\n }\n \n // Calculate timestamps\n var start_timestamp = Number(moment(START_MONTH+\"-\"+START_YEAR, \"MM-YYYY\").unix() * 1000);\n var end_timestamp = Number(moment());\n\n // Parse each month\n var month_count = monthDifference(start_timestamp, end_timestamp);\n var month = Number(START_MONTH);\n var year = Number(START_YEAR);\n for (var i=0;i<month_count;i++) {\n\n // Append data\n var ts1 = Number(moment(month+\"-\"+year, \"MM-YYYY\").unix() * 1000);\n var ts2 = Number(moment((month+1)+\"-\"+year, \"MM-YYYY\").unix() * 1000);\n\n if (form_isLocationBound(SINGLEGRAPH_FORM)) {\n var loc = document.getElementById('static_location').value;\n if (loc !== \"\") {\n var doc = collection_findOne(form_name(SINGLEGRAPH_FORM), {location:Number(loc), timestamp:{$gt:ts1,$lt:ts2}});\n }\n } else {\n var doc = collection_findOne(form_name(SINGLEGRAPH_FORM), {timestamp:{$gt:ts1,$lt:ts2}});\n }\n \n for (var j=0;j<tags.length;j++) {\n if (SINGLEGRAPH_IGNORE_TAGS.indexOf(tags[j]) === -1) {\n if (doc && doc[tags[j]]) {\n line_data[tags[j]].push([ts1 + 86400000, Number(doc[tags[j]])]);\n } else {\n line_data[tags[j]].push([ts1 + 86400000, 0]);\n }\n }\n }\n\n // update the counter\n month++;\n if (month > GLOBAL_MONTHS.length) {\n month = 1;\n year++;\n }\n }\n\n // Now we have all data and labels so we can display the chart\n $('.chartContainer2').highcharts('StockChart', {\n rangeSelector: {selected:4,inputDateFormat:'%b %Y',inputEditDateFormat:'%b %Y'},\n xAxis:{gridLineWidth:1,type:'datetime',tickInterval:30*24*3600000,labels:{formatter:function() {return Highcharts.dateFormat(\"%b %Y\", this.value);}}},\n title: {text:''},\n legend: {enabled:true},\n chart: {type: 'spline'},\n tooltip: {\n headerFormat: '<span style=\"font-size:10px\">{point.key}</span><table>',\n pointFormat: '<tr><td style=\"color:{series.color};padding:0\">{series.name}: </td>' +\n '<td style=\"padding:0\"><b>{point.y:.1f} EUR</b></td></tr>',\n footerFormat: '</table>',\n shared: true,\n useHTML: true\n },\n series:buildSeries(tags, line_data)\n });\n}", "function generateChartData() {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 100);\n firstDate.setHours(0, 0, 0, 0);\n/// starting number\n var visits = 7.6;\n var hits = 13.4;\n var views = 7;\n\n var myData = {\n Zelenski: [7.6, 9.4, 8, 8.8, 9, 9.4, 10.8, 10.9, 11.9, 14.9, 15.2, 16.4, 17.5, 19.6, 19.9, 20.3, 23.1],\n Timoshenko: [13.4, 14.7, 14, 14.8, 14.2, 14.4, 13.4, 15.5, 15.1, 12.9, 9.6, 11.5, 13.5, 13.8, 13.9, 14],\n Poroshenko: [7, 6.2, 8, 8.1, 8.6, 10.8, 7.7, 8.2, 10.4, 10.1, 10.8, 13.1, 13.1, 13.4, 13.1, 12.4]\n }\n var mynewuselessvar;\n for (var i = 0; i < myData.candidate1.length; i++) {\n chartData.push({\n date: [\"1st Nov\", \"22nd Nov\", \"3rd Dec\",\"14th Dec\", \"18th Dec\", \"29th Dec\", \"3rd Jan\", \"15th Jan\", \"25th Jan\", \"4th Feb\", \"20th Feb\", \"27th Feb\", \"4th March\", \"7th March\", \"14th March\"],\n visits: myData.Zelenski[i],\n hits: myData.Timoshenko[i],\n views: myData.Poroshenko[i]\n });\n }\n\n\n // for (var i = 0; i < 15; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n // var newDate = new Date(firstDate);\n // newDate.setDate(newDate.getDate() + i);\n //\n // visits =\n // hits = Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n // views = Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n\n\n // }\n return chartData;\n}", "function generateDateChart(obj) {\n \n var chart, chartGroup, chartWidth, chartHeight,\n dateParser, xScaller, yScaller,\n gHeight, gWidth, max_min;\n\n chart = d3.select(obj.wrapper);\n chartWidth = chart.node().getBoundingClientRect().width;\n chartHeight = (chartWidth * 9) / 16; // generate a rough 16:9 ratio for the height\n \n gWidth = chartWidth - (obj.margins.left + obj.margins.right);\n gHeight = chartHeight - (obj.margins.top + obj.margins.bottom);\n \n dateParser = d3.timeParse(obj.dateParser);\n max_min = getMaxMin(obj.data);\n\n chart = chart.append('div')\n .classed('svg-container', true)\n .append('svg')\n .attr('preserveAspectRatio', 'xMinYMin meet')\n .attr('viewBox', '0 0 '+chartWidth+' '+chartHeight)\n .classed('svg-graph ' + obj.className, true);\n\n chartGroup = chart.append('g')\n .classed('display', true)\n .attr('transform', 'translate('+ obj.margins.left +', '+ obj.margins.top +')');\n\n xScaller = d3.scaleTime()\n .domain(d3.extent(obj.dates, function(d){\n var date = dateParser(d);\n return date;\n }))\n .range([0, gWidth]);\n\n yScaller = d3.scaleLinear()\n .domain([max_min.y.min, max_min.y.max])\n .range([gHeight, 0]);\n \n drawX_Axis.call(chartGroup, {\n scaller: xScaller,\n gHeight: gHeight,\n gWidth: gWidth,\n label: 'Dates'\n });\n\n drawY_Axis.call(chartGroup, {\n scaller: yScaller,\n gHeight: gHeight,\n label: 'Adjusted Close'\n });\n\n generateLines(chartGroup, obj, xScaller, yScaller, dateParser);\n }", "function makeGraphs(error, nflData2017) {\n if (error) {\n console.error('makeGraphs error on receiving dataset:', error.statusText);\n throw error;\n }\n\n //Create a Crossfilter instance\n var ndx = crossfilter(nflData2017);\n\n //Define Dimensions\n var weekDim = ndx.dimension(function (d) {\n return d.Week;\n });\n var quarterDim = ndx.dimension(function (d) {\n return d.qtr;\n });\n var passLocationDim = ndx.dimension(function (d) {\n return d.PassLocation;\n });\n var runLocationDim = ndx.dimension(function (d) {\n return d.RunLocation;\n });\n var runGapDim = ndx.dimension(function (d) {\n return d.RunGap;\n });\n var passOutcomeDim = ndx.dimension(function (d) {\n return d.PassOutcome;\n });\n var positionDim = ndx.dimension(function (d) {\n return d.Position;\n });\n var downDim = ndx.dimension(function (d) {\n return d.down;\n });\n var offenseTeamDim = ndx.dimension(function (d) {\n return d.posteam;\n });\n var playTypeDim = ndx.dimension(function (d) {\n return d.PlayType;\n });\n\n //Calculate metrics\n var totalYardsByWeekGroupSum = weekDim.group().reduceSum(function(d) { return d.YardsGained });\n var numRunPlaysByWeekGroupSum = weekDim.group().reduceSum(function(d) {return d.PlayType=='Run'});\n var numPassPlaysByWeekGroupSum = weekDim.group().reduceSum(function(d) {return d.PlayType=='Pass'});\n var quarterGroup = quarterDim.group();\n var passLocationGroupSum = passLocationDim.group().reduceSum(function(d) {return d.PlayType=='Pass'});\n var filteredPassLocationGroup = removeNAValues(passLocationGroupSum);\n var runLocationGroupSum = runLocationDim.group().reduceSum(function(d) {return d.PlayType=='Run'});\n var filteredRunLocationGroup = removeNAValues(runLocationGroupSum);\n var runGapGroupGroupSum = runGapDim.group().reduceSum(function(d) {return d.PlayType=='Run'});\n var passOutcomeGroupSum = passOutcomeDim.group().reduceSum(function(d) {return d.PlayType=='Pass'});\n var filteredPassOutcomeGroup = removeNAValues(passOutcomeGroupSum);\n var offenseTeamGroup = offenseTeamDim.group();\n var positionGroupSum = positionDim.group().reduceSum(function(d) {return d.PlayType=='Pass'});\n var downGroup = downDim.group();\n var playTypeGroup = playTypeDim.group();\n\n var all = ndx.groupAll();\n var totalYards = ndx.groupAll().reduceSum(function (d) {\n return d.YardsGained;\n });\n\n var avgYardsGroup = ndx.groupAll().reduce(\n function(p,v) {\n ++p.count;\n p.total += v.YardsGained;\n return p;\n },\n function(p,v) {\n --p.count;\n p.total -= v.YardsGained;\n return p;\n },\n function() {\n return {\n count: 0,\n total: 0\n };\n }\n );\n var avg = function(d){\n return d.count ? d.total/d.count : 0;\n };\n\n //Define first week and last week to be used in line charts\n var minWeek = weekDim.bottom(1)[0]['Week'];\n var maxWeek = weekDim.top(1)[0]['Week'];\n\n //Default colors\n var colorScheme = ['#013369','#D50A0A','#008000','#FFA500','#FFFF00'];\n var currentTeam = null;\n\n //Charts\n playsChart = dc.compositeChart('#plays-chart');\n yardsChart = dc.lineChart('#yards-chart');\n passLocationChart = dc.rowChart('#pass-location-row-chart');\n numberPlaysND = dc.numberDisplay('#number-plays-nd');\n totalYardsND = dc.numberDisplay('#total-yards-nd');\n avgYardsND = dc.numberDisplay('#avg-yards-nd');\n passOutcomeChart = dc.pieChart('#complete-chart');\n passToPositionChart = dc.pieChart('#position-chart');\n downChart = dc.rowChart('#down-row-chart');\n quarterChart = dc.rowChart('#quarter-row-chart');\n playTypeChart = dc.rowChart('#playtype-row-chart');\n runLocationChart = dc.rowChart('#run-location-row-chart');\n runGapChart = dc.rowChart('#run-gap-row-chart');\n offensiveTeamSelectField = dc.selectMenu('#team-menu-select');\n passOrRushSelectField = dc.selectMenu('#pass-or-rush-menu-select');\n\n offensiveTeamSelectField\n .height(100)\n .dimension(offenseTeamDim)\n .group(offenseTeamGroup)\n .useViewBoxResizing(true)\n .title(function(d) {return getTeamName(d.key) + \" (\" + d.key + \")\";});\n\n passOrRushSelectField\n .height(100)\n .dimension(playTypeDim)\n .group(playTypeGroup)\n .useViewBoxResizing(true)\n .on('pretransition', function(passOrRushSelectField) {\n //if pass toggle/hide run\n var currentState = passOrRushSelectField.filters();\n if (currentState == 'Pass'){\n $('#runRow').hide();\n $('#passRow').show();\n } else if (currentState == 'Run') {\n $('#passRow').hide();\n $('#runRow').show();\n } else {\n $('#passRow').show();\n $('#runRow').show();\n }\n })\n .title(function(d) {return d.key;});\n\n numberPlaysND\n .formatNumber(d3.format('d'))\n .valueAccessor(function (d) {\n return d;\n })\n .group(all);\n\n totalYardsND\n .formatNumber(d3.format('d'))\n .valueAccessor(function (d) {\n return d;\n })\n .group(totalYards);\n\n avgYardsND\n .formatNumber(d3.format('.3g'))\n .valueAccessor(avg)\n .group(avgYardsGroup);\n\n playsChart\n .height(250)\n .margins({top: 30, right: 20, bottom: 30, left: 50})\n .dimension(weekDim)\n .transitionDuration(500)\n .x(d3.scale.linear().domain([minWeek, maxWeek]))\n .xAxisLabel('Week')\n .yAxisLabel('Total Plays')\n .elasticY(true)\n .useViewBoxResizing(true)\n .brushOn(false)\n .legend(dc.legend()\n .legendText(function (d,i) {\n legendArray = ['Run','Pass'];\n return legendArray[i];\n })\n .horizontal(false)\n .x(1)\n .y(5)\n )\n .compose([\n dc.lineChart(playsChart)\n .group(numRunPlaysByWeekGroupSum)\n .ordinalColors(colorScheme)\n .renderArea(false)\n .xyTipsOn(true),\n dc.lineChart(playsChart)\n .group(numPassPlaysByWeekGroupSum)\n .ordinalColors(colorScheme)\n .renderArea(false)\n .xyTipsOn(true)\n ])\n .on('preRedraw', function(playsChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n var i=0;\n playsChart.children().forEach(function(child){\n child.ordinalColors([getTeamColors(currentTeam)[i]]);\n i++;\n });\n })\n .on('preRender', function(playsChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n var i=0;\n playsChart.children().forEach(function(child){\n child.ordinalColors([getTeamColors(currentTeam)[i]]);\n i++;\n });\n })\n .on('pretransition', function(playsChart){\n currentTeam = offensiveTeamSelectField.filters()[0];\n //Important: Drawing the bye week only works in the pretransition in this case.\n drawByeWeekLine(playsChart,getTeamByeWeek(currentTeam));\n })\n .yAxis().ticks(5);\n\n playsChart.renderVerticalGridLines(true);\n playsChart.xAxis().ticks(maxWeek);\n\n yardsChart\n .ordinalColors(colorScheme)\n .height(250)\n .margins({top: 30, right: 20, bottom: 30, left: 50})\n .dimension(weekDim)\n .group(totalYardsByWeekGroupSum)\n .xyTipsOn(true)\n .renderArea(true)\n .transitionDuration(500)\n .x(d3.scale.linear().domain([minWeek, maxWeek]))\n .elasticY(true)\n .useViewBoxResizing(true)\n .brushOn(false)\n .xAxisLabel('Week')\n .yAxisLabel('Total Yards')\n .on('preRedraw', function(yardsChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n yardsChart.ordinalColors(getTeamColors(currentTeam));\n setTeamLogo(currentTeam);\n setTeamURL(currentTeam);\n })\n .on('pretransition', function(yardsChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n yardsChart.ordinalColors(getTeamColors(currentTeam));\n drawByeWeekLine(yardsChart,getTeamByeWeek(currentTeam));\n })\n .on('preRender', function(yardsChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n yardsChart.ordinalColors(getTeamColors(currentTeam));\n })\n .yAxis().ticks(5);\n\n yardsChart.renderVerticalGridLines(true);\n yardsChart.xAxis().ticks(maxWeek);\n\n passLocationChart\n .ordinalColors(colorScheme)\n .height(250)\n .margins({top: 10, right: 10, bottom: 20, left: 40})\n .dimension(passLocationDim)\n .group(filteredPassLocationGroup)\n .labelOffsetX(-40)\n .ordering(function(d){\n if(d.key == 'left') return 0;\n else if (d.key == 'middle') return 1;\n else if (d.key == 'right') return 2;\n else return 3;\n })\n .elasticX(true)\n .useViewBoxResizing(true)\n .on('pretransition', function(passLocationChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passLocationChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRedraw', function(passLocationChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passLocationChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRender', function(passLocationChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passLocationChart.ordinalColors(getTeamColors(currentTeam));\n })\n .xAxis().ticks(4);\n\n downChart\n .ordinalColors(colorScheme)\n .height(250)\n .dimension(downDim)\n .group(downGroup)\n .labelOffsetX(-20)\n .ordering(function(d){\n if(d.key == '1') return 0;\n else if (d.key == '2') return 1;\n else if (d.key == '3') return 2;\n else return 4;\n })\n .elasticX(true)\n .useViewBoxResizing(true)\n .on('pretransition', function(downChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n downChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRedraw',function(downChart){\n currentTeam = offensiveTeamSelectField.filters()[0];\n downChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRender',function(downChart){\n currentTeam = offensiveTeamSelectField.filters()[0];\n downChart.ordinalColors(getTeamColors(currentTeam));\n })\n .xAxis().ticks(4);\n\n quarterChart\n .ordinalColors(colorScheme)\n .height(250)\n .dimension(quarterDim)\n .group(quarterGroup)\n .labelOffsetX(-20)\n .ordering(function(d){\n if(d.key == '1') return 0;\n else if (d.key == '2') return 1;\n else if (d.key == '3') return 2;\n else if (d.key == '4') return 3;\n else return 4;\n })\n .elasticX(true)\n .useViewBoxResizing(true)\n .on('pretransition', function(quarterChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n quarterChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRedraw',function(quarterChart){\n currentTeam = offensiveTeamSelectField.filters()[0];\n quarterChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRender',function(quarterChart){\n currentTeam = offensiveTeamSelectField.filters()[0];\n quarterChart.ordinalColors(getTeamColors(currentTeam));\n })\n .xAxis().ticks(4);\n\n playTypeChart\n .ordinalColors(colorScheme)\n .width(300)\n .height(300)\n .dimension(playTypeDim)\n .group(playTypeGroup)\n .elasticX(true)\n .on('pretransition', function(playTypeChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n playTypeChart.ordinalColors(getTeamColors(currentTeam));\n })\n .xAxis().ticks(3);\n\n runLocationChart\n .ordinalColors(colorScheme)\n .height(250)\n .margins({top: 10, right: 10, bottom: 30, left: 40})\n .dimension(runLocationDim)\n .group(filteredRunLocationGroup)\n .elasticX(true)\n .useViewBoxResizing(true)\n .labelOffsetX(-40)\n .on('pretransition', function(runLocationChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n runLocationChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRedraw', function(runLocationChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n runLocationChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRender', function(runLocationChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n runLocationChart.ordinalColors(getTeamColors(currentTeam));\n })\n .xAxis().ticks(4);\n\n runGapChart\n .ordinalColors(colorScheme)\n .height(250)\n .margins({top: 10, right: 10, bottom: 30, left: 40})\n .dimension(runGapDim)\n .group(runGapGroupGroupSum)\n .elasticX(true)\n .useViewBoxResizing(true)\n .labelOffsetX(-40)\n .on('pretransition', function(runGapChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n runGapChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRedraw', function(runGapChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n runGapChart.ordinalColors(getTeamColors(currentTeam));\n })\n .on('preRender', function(runGapChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n runGapChart.ordinalColors(getTeamColors(currentTeam));\n })\n .xAxis().ticks(4);\n\n passOutcomeChart\n .ordinalColors(colorScheme)\n .height(250)\n .radius(170)\n .innerRadius(25)\n .transitionDuration(1500)\n .dimension(passOutcomeDim)\n .group(filteredPassOutcomeGroup)\n .legend(dc.legend()\n .legendText(function (d) {return d.name;})\n .x(0)\n .y(5)\n )\n .useViewBoxResizing(true)\n .on('pretransition', function(passOutcomeChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passOutcomeChart.ordinalColors(getTeamColors(currentTeam));\n passOutcomeChart.selectAll('text.pie-slice').text(function (d) {\n return dc.utils.printSingleValue((d.endAngle - d.startAngle) / (2 * Math.PI) * 100) + '%';\n })\n })\n .on('preRender', function(passOutcomeChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passOutcomeChart.ordinalColors(getTeamColors(currentTeam));\n passOutcomeChart.selectAll('text.pie-slice').text(function (d) {\n return dc.utils.printSingleValue((d.endAngle - d.startAngle) / (2 * Math.PI) * 100) + '%';\n })\n })\n .on('preRedraw', function(passOutcomeChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passOutcomeChart.ordinalColors(getTeamColors(currentTeam));\n passOutcomeChart.selectAll('text.pie-slice').text(function (d) {\n return dc.utils.printSingleValue((d.endAngle - d.startAngle) / (2 * Math.PI) * 100) + '%';\n })\n });\n\n passToPositionChart\n .ordinalColors(colorScheme)\n .height(250)\n .radius(170)\n .innerRadius(25)\n .transitionDuration(1500)\n .dimension(positionDim)\n .group(positionGroupSum)\n .slicesCap(3)\n .useViewBoxResizing(true)\n .legend(dc.legend()\n .legendText(function (d) { return d.name; })\n .x(0)\n .y(5)\n )\n .on('pretransition', function(passToPositionChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passToPositionChart.ordinalColors(getTeamColors(currentTeam));\n passToPositionChart.selectAll('text.pie-slice').text(function (d) {\n if (d.endAngle - d.startAngle > .5) {\n return dc.utils.printSingleValue((d.endAngle - d.startAngle) / (2 * Math.PI) * 100) + '%';\n }\n })\n })\n .on('preRender', function(passToPositionChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passToPositionChart.ordinalColors(getTeamColors(currentTeam));\n passToPositionChart.selectAll('text.pie-slice').text(function (d) {\n if (d.endAngle - d.startAngle > .5) {\n return dc.utils.printSingleValue((d.endAngle - d.startAngle) / (2 * Math.PI) * 100) + '%';\n }\n })\n })\n .on('preRedraw', function(passToPositionChart) {\n currentTeam = offensiveTeamSelectField.filters()[0];\n passToPositionChart.ordinalColors(getTeamColors(currentTeam));\n passToPositionChart.selectAll('text.pie-slice').text(function (d) {\n if (d.endAngle - d.startAngle > .375) {\n return dc.utils.printSingleValue((d.endAngle - d.startAngle) / (2 * Math.PI) * 100) + '%';\n }\n })\n });\n\n dc.renderAll();\n showPage();\n}", "function makeChart() {\n //get the data for the chart and put it in the appropriate places\n //in the chartData and chartOptions objects\n const data = getData(currentSubject, currentMaxWordLength);\n chartData.datasets[0].data = data.BFS;\n chartData.datasets[1].data = data.DFS;\n chartOptions.scales.yAxes[0].scaleLabel.labelString = data.yAxisLabel;\n\n if (resultsChart) {\n resultsChart.destroy();\n }\n\n //create (or recreate) the chart\n const chartContext = $(\"#results-graph\")[0].getContext('2d');\n const chartConfig = {\"type\": \"line\",\n \"data\": chartData,\n \"options\": chartOptions};\n resultsChart = new Chart(chartContext, chartConfig);\n }", "function createContentForGraphs () {\n resetGraphValuesBeforeRendering();\n //first graph template\n var entireTemplateForGraphs = ``;\n AppData.listOfGraphsData.forEach(function (arrayItem, index, arrayObject) {\n var arrayItemWithDataSeriesAdded = returnDataSeriesForArrayItem(arrayItem); \n var tempGraphTemplate = \n `<div class=\"col-12 col-lg-6 mb-1\">\n <div class=\"card\"><div class=\"card-body\">` + returnGraphPlaceholder(arrayItemWithDataSeriesAdded) + `</div></div>\n </div>`;\n entireTemplateForGraphs = entireTemplateForGraphs + tempGraphTemplate;\n });\n /* since we created placeholder containers (returnGraphPlaceholder), we will start checking when those elements are added to DOM\n we want to attach Graphs when those elements are added to DOM\n */\n startCheckingForAddedGraphsPlaceholders();\n return entireTemplateForGraphs;\n }", "function createGraphs(dayPredData, date){\n var dataGraphNames = ['Temperatura (°C)', 'Humedad Relativa (%)', 'Prob Precipitación (%)', 'Viento (km/h)'];\n var tempValues = getTempArrayDataForGraph(dayPredData.temperatura);\n var humRelValues = getHumRelArrayDataForGraph(dayPredData.humedadRelativa);\n var [graphLabels, probPrecValues] = getProbPrecArrayDataForGraph(dayPredData.probPrecipitacion);\n var [vientoDirs, vientoValues] = getVientoArrayDataForGraph(dayPredData.viento);\n var canvas = document.getElementById(\"tempPredGraph\").getContext('2d');\n var tempPredGraph = new Chart(canvas, {\n type: 'line',\n data: {\n labels: graphLabels,\n datasets: [{\n label: dataGraphNames[0],\n fill: false,\n data: tempValues,\n borderColor: '#FF7E0C',\n pointBorderWidth: 3,\n pointRadius: 5,\n borderWidth: 1\n },\n {\n label: dataGraphNames[1],\n fill: false,\n data: humRelValues,\n borderColor: '#79A2FB',\n pointBorderWidth: 3,\n pointRadius: 5,\n borderWidth: 1\n },\n {\n label: dataGraphNames[2],\n fill: false,\n data: probPrecValues,\n borderColor: '#25ACFF',\n pointBorderWidth: 3,\n pointRadius: 5,\n borderWidth: 1\n },\n {\n label: dataGraphNames[3],\n fill: false,\n data: vientoValues,\n borderColor: '#4BC69B',\n pointBorderWidth: 3,\n pointRadius: 5,\n borderWidth: 1\n }],\n\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n xAxes: [{\n scaleLabel: {\n display: true,\n labelString: 'Horas',\n fontSize: 15\n },\n ticks: {\n beginAtZero: true\n }\n }],\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n },\n title: {\n display: true,\n text: date,\n fontSize: 25\n },\n tooltips: {\n callbacks: {\n label: function(tooltipItem, data) {\n var label = data.datasets[tooltipItem.datasetIndex].label + \": \" + tooltipItem.value;\n if(data.datasets[tooltipItem.datasetIndex].label == dataGraphNames[3]){\n label = data.datasets[tooltipItem.datasetIndex].label + \" → Dirección: \" + vientoDirs[tooltipItem.datasetIndex] + \". Velocidad: \" + tooltipItem.value + \" km/h\";\n }\n return label;\n }\n }\n }\n }\n });\n }", "function drawVirus() {\n\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'X');\n data.addColumn('number', 'PPM');\n\n\n var fixedParameter = self.selectedParameter.toLocaleLowerCase() + \"-ppm\";\n var rows = [];\n\n for (var i = 0; i < self.reports.length; i++) {\n report = self.reports[i];\n if (report[\"date-time\"] >= self.startDate.getTime() && report[\"date-time\"] <= self.endDate.getTime()) {\n rows.push([(report[\"date-time\"] - self.startDate.getTime()) / (6.048e+8), report[fixedParameter]]);\n }\n }\n // console.log(rows);\n data.addRows(rows);\n\n var options = {\n hAxis: {\n title: 'Week'\n },\n vAxis: {\n title: self.selectedParameter + ' PPM'\n }\n };\n\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n\n chart.draw(data, options);\n chart.draw(data, options);\n }", "function buildHTMLTable(reports) {\n // Get a reference to the table body\n var tbody = d3.select(\"tbody\");\n // Clear table body\n tbody.html(\"\")\n\n // loop through ech report and add to HTML table body\n reports.forEach((report) => {\n console.log(report)\n var row = tbody.append(\"tr\");\n Object.entries(report).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function renderReport(doc) {\n\n // ----------------------------------------------\n let br = document.createElement('br');\n let hr = document.createElement('hr');\n let page = document.createElement('span');\n\n let caption = document.createElement('h4'); //append caption\n let innerCaption = document.createElement('small');\n var t1 = document.createTextNode(\"PREVIOUS POSTS\");\n innerCaption.appendChild(t1);\n caption.appendChild(innerCaption)\n\n // append hr\n\n let title = document.createElement('h3'); //append title\n title.textContent = doc.data().studentUserName;\n\n let date = document.createElement('h5')//append date\n let icons = document.createElement('span')\n icons.classList.add('glyphicon');\n icons.classList.add('glyphicon-time');\n let time = document.createElement('span');\n time.textContent = doc.data().time;\n var t2 = document.createTextNode(' Posted on ');\n date.appendChild(icons);\n date.appendChild(t2);\n date.appendChild(time);\n\n\n let mainIcons = document.createElement('h5')//mainIcons\n let glyph1 = document.createElement('span');\n glyph1.classList.add('label');\n glyph1.classList.add('label-success');\n var t3 = document.createTextNode('created');\n var t5 = document.createTextNode(' ');\n glyph1.appendChild(t3);\n let glyph2 = document.createElement('span');\n glyph2.classList.add('label');\n glyph2.classList.add('label-primary');\n var t4 = document.createTextNode('read');\n glyph2.appendChild(t4);\n mainIcons.appendChild(glyph1);\n mainIcons.appendChild(t5);\n mainIcons.appendChild(glyph2);\n\n // append break (br)\n // append break (br)\n\n let comment = document.createElement('p')//append comment\n comment.textContent = doc.data().report;\n\n page.appendChild\n\n page.appendChild(caption);\n page.appendChild(hr);\n page.appendChild(title);\n page.appendChild(date);\n page.appendChild(mainIcons);\n page.appendChild(comment);\n page.appendChild(br);\n page.appendChild(br);\n page.appendChild(br);\n\n reportList.appendChild(page);\n\n}", "function matchreport(){\r\n\t\t\t\t\t\t\tvar radius = 350, numRounds = 7, segmentWidth = radius / (numRounds + 1);\r\n\r\n\t\t\t\t\t\t\tvar partition = d3.layout.partition()\r\n\t\t\t\t\t\t\t .sort(null)\r\n\t\t\t\t\t\t\t .size([2 * Math.PI, radius]) // x maps to angle, y to radius\r\n\t\t\t\t\t\t\t .value(function(d) { return 1; }); //Important!\r\n\r\n\t\t\t\t\t\t\tvar arc = d3.svg.arc()\r\n\t\t\t\t\t\t\t .startAngle(function(d) { return d.x; })\r\n\t\t\t\t\t\t\t .endAngle(function(d) { return d.x + d.dx; })\r\n\t\t\t\t\t\t\t .innerRadius(function(d) { return d.y; })\r\n\t\t\t\t\t\t\t .outerRadius(function(d) { return d.y + d.dy; });\r\n\r\n\t\t\t\t\t\t\tfunction translateSVG(x, y) {\r\n\t\t\t\t\t\t\t return 'translate('+x+','+y+')';\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction rotateSVG(a, x, y) {\r\n\t\t\t\t\t\t\t a = a * 180 / Math.PI;\r\n\t\t\t\t\t\t\t return 'rotate('+a+')';\r\n\t\t\t\t\t\t\t return 'rotate('+a+','+x+','+y+')';\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction arcSVG(mx0, my0, rx, ry, xrot, larc, sweep, mx1, my1) {\r\n\t\t\t\t\t\t\t return 'M'+mx0+','+my0+' A'+rx+','+ry+' '+xrot+' '+larc+','+sweep+' '+mx1+','+my1;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tvar label = function(d) {\r\n\t\t\t\t\t\t\t if(d.x === 0 && d.y === 0)\r\n\t\t\t\t\t\t\t\treturn '';\r\n\t\t\t\t\t\t\t var t = rotateSVG(d.x + 0.5 * d.dx - Math.PI * 0.5, 0, 0);\r\n\t\t\t\t\t\t\t t += translateSVG(d.y + 0.5*d.dy, 0);\r\n\t\t\t\t\t\t\t t += d.x >= Math.PI ? rotateSVG(Math.PI) : '';\r\n\t\t\t\t\t\t\t return t;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction surname(d) {\r\n\t\t\t\t\t\t\t return d.name.split(' ')[0];\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction fullname(d) {\r\n\t\t\t\t\t\t\t var s = d.name.split(' ');\r\n\t\t\t\t\t\t\t return s.length === 3 ? s[2] + ' ' + s[0] + ' ' + s[1] : s[1] + ' ' + s[0];\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction result(d) {\r\n\t\t\t\t\t\t\t var m = d.match;\r\n\t\t\t\t\t\t\t var res = '';\r\n\t\t\t\t\t\t\t if(m !== undefined) {\r\n\t\t\t\t\t\t\t\tfor(var i=1; i<=2; i++) {\r\n\t\t\t\t\t\t\t\t if(m['W'+i] !== 0 && m['L'+i] !== 0)\r\n\t\t\t\t\t\t\t\t\tres += m['W'+i] + '-' + m['L'+i] + ' ';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t return res;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction playerHover(d) {\r\n\t\t\t\t\t\t\t var c = surname(d);\r\n\t\t\t\t\t\t\t d3.selectAll('g#player-labels text')\r\n\t\t\t\t\t\t\t\t.style('fill', 'white');\r\n\r\n\t\t\t\t\t\t\t // Highlight this player + children\r\n\t\t\t\t\t\t\t d3.select('g#player-labels text.'+c+'.round-'+d.round)\r\n\t\t\t\t\t\t\t\t.style('fill', 'yellow');\r\n\r\n\t\t\t\t\t\t\t if(d.round != 1 && d.children) {\r\n\t\t\t\t\t\t\t\tc = surname(d.children[0]);\r\n\t\t\t\t\t\t\t\td3.select('g#player-labels text.'+c+'.round-'+ +(d.round-1))\r\n\t\t\t\t\t\t\t\t .style('fill', 'yellow');\r\n\r\n\t\t\t\t\t\t\t\tc = surname(d.children[1]);\r\n\t\t\t\t\t\t\t\td3.select('g#player-labels text.'+c+'.round-'+ +(d.round-1))\r\n\t\t\t\t\t\t\t\t .style('fill', 'yellow');\r\n\t\t\t\t\t\t\t }\r\n\r\n\t\t\t\t\t\t\t // var l = surname(d.children[1]);\r\n\t\t\t\t\t\t\t // d3.selectAll('g#player-labels text.'+l)\r\n\t\t\t\t\t\t\t // .style('fill', 'gray');\r\n\r\n\r\n\t\t\t\t\t\t\t var m = d.match;\r\n\t\t\t\t\t\t\t if(m !== undefined) {\r\n\t\t\t\t\t\t\t\td3.select('#result').text(fullname(d.children[0]) + ' beat ' + fullname(d.children[1]));\r\n\t\t\t\t\t\t\t\td3.select('#score').text(result(d));\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tvar xCenter = radius, yCenter = radius;\r\n\t\t\t\t\t\t\tvar svg = d3.select(\"#matchtree\").append('svg').attr(\"style\",\"height: 700px; width: 700px;\").append('g').attr('transform', translateSVG(xCenter,yCenter));\r\n\r\n\t\t\t\t\t\t//\td3.json('data/tree.json', function(err, root) {\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t var chart = svg.append('g');\r\n\t\t\t\t\t\t\t chart.datum(data).selectAll('g')\r\n\t\t\t\t\t\t\t\t.data(partition.nodes)\r\n\t\t\t\t\t\t\t\t.enter()\r\n\t\t\t\t\t\t\t\t.append('g');\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t // We use three groups: segments, round labels & player labels. This is to achieve a layering effect.\r\n\r\n\t\t\t\t\t\t\t // Segments\r\n\t\t\t\t\t\t\t chart.selectAll('g')\r\n\t\t\t\t\t\t\t\t.append('path')\r\n\t\t\t\t\t\t\t\t.attr('d', arc)\r\n\t\t\t\t\t\t\t\t.on('mouseover', playerHover);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t // Round labels\r\n\t\t\t\t\t\t\t var rounds = ['Round 1', 'Round 2', 'Round 3', 'Round 4', 'Quarter finals', 'Semi finals', 'Final'];\r\n\t\t\t\t\t\t\t var roundLabels = svg.append('g').attr('id', 'round-labels');\r\n\t\t\t\t\t\t\t roundLabels.selectAll('path')\r\n\t\t\t\t\t\t\t\t.data(rounds)\r\n\t\t\t\t\t\t\t\t.enter()\r\n\t\t\t\t\t\t\t\t.append('path')\r\n\t\t\t\t\t\t\t\t.attr('d', function(d, i) {\r\n\t\t\t\t\t\t\t\t var offset = (numRounds - i + 0.5) * segmentWidth - 10;\r\n\t\t\t\t\t\t\t\t return arcSVG(-offset, 0, offset, offset, 0, 1, 1, offset, 0);\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t.style({'fill': 'none', 'stroke': 'none'})\r\n\t\t\t\t\t\t\t\t.attr('id', function(d, i) {return 'round-label-'+ +(i+1);});\r\n\r\n\t\t\t\t\t\t\t roundLabels.selectAll('text')\r\n\t\t\t\t\t\t\t\t.data(rounds)\r\n\t\t\t\t\t\t\t\t.enter()\r\n\t\t\t\t\t\t\t\t.append('text')\r\n\t\t\t\t\t\t\t\t.append('textPath')\r\n\t\t\t\t\t\t\t\t.attr('xlink:href', function(d, i) {return '#round-label-'+ +(i+1);})\r\n\t\t\t\t\t\t\t\t.attr('startOffset', '50%')\r\n\t\t\t\t\t\t\t\t.text(function(d) {return d;});\r\n\r\n\r\n\t\t\t\t\t\t\t // Player labels\r\n\t\t\t\t\t\t\t var playerLabels = svg.append('g').attr('id', 'player-labels');\r\n\t\t\t\t\t\t\t playerLabels.datum(data).selectAll('g')\r\n\t\t\t\t\t\t\t\t.data(partition.nodes)\r\n\t\t\t\t\t\t\t\t.enter()\r\n\t\t\t\t\t\t\t\t.append('text')\r\n\t\t\t\t\t\t\t\t.text(function(d, i) {return i === 0 ? surname(d) : d.name.slice(0, 3);})\r\n\t\t\t\t\t\t\t\t.attr('transform', label)\r\n\t\t\t\t\t\t\t\t.attr('dy', '0.4em')\r\n\t\t\t\t\t\t\t\t.attr('class', function(d) {return surname(d)+' round-'+ +(d.round);});\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t//\t});\r\n\t\t\t\t\t\t}", "function createStyleSheet() {\n //Create stylesheet\n var stylesheet = Banana.Report.newStyleSheet();\n \n //Set page layout\n var pageStyle = stylesheet.addStyle(\"@page\");\n\n //Set the margins\n pageStyle.setAttribute(\"margin\", \"15mm 10mm 10mm 20mm\");\n\n //Set the page landscape\n //pageStyle.setAttribute(\"size\", \"landscape\");\n \n //Set the font\n stylesheet.addStyle(\"body\", \"font-family : Helvetica\");\n \n style = stylesheet.addStyle(\".footer\");\n style.setAttribute(\"text-align\", \"right\");\n style.setAttribute(\"font-size\", \"8px\");\n style.setAttribute(\"font-family\", \"Courier New\");\n\n style = stylesheet.addStyle(\".heading1\");\n style.setAttribute(\"font-size\", \"14px\");\n style.setAttribute(\"font-weight\", \"bold\");\n\n style = stylesheet.addStyle(\".img\");\n style.setAttribute(\"height\", \"40\");\n style.setAttribute(\"width\", \"120\");\n \n //Set Table styles\n style = stylesheet.addStyle(\"table\");\n style.setAttribute(\"width\", \"100%\");\n style.setAttribute(\"font-size\", \"8px\");\n stylesheet.addStyle(\"table.table td\", \"border: thin solid black; padding-bottom: 2px; padding-top: 5px\");\n\n stylesheet.addStyle(\".col1\", \"width:15%\");\n stylesheet.addStyle(\".col2\", \"width:10%\");\n stylesheet.addStyle(\".col3\", \"width:40%\");\n stylesheet.addStyle(\".col4\", \"width:12%\");\n stylesheet.addStyle(\".col5\", \"width:12%\");\n stylesheet.addStyle(\".col6\", \"width:12%\");\n\n stylesheet.addStyle(\".col1a\", \"width:15%\");\n stylesheet.addStyle(\".col2a\", \"width:10%\");\n stylesheet.addStyle(\".col3a\", \"width:40%\");\n stylesheet.addStyle(\".col4a\", \"width:12%\");\n stylesheet.addStyle(\".col5a\", \"width:12%\");\n stylesheet.addStyle(\".col6a\", \"width:12%\");\n\n stylesheet.addStyle(\".col1b\", \"width:15%\");\n stylesheet.addStyle(\".col2b\", \"width:10%\");\n stylesheet.addStyle(\".col3b\", \"width:40%\");\n stylesheet.addStyle(\".col4b\", \"width:12%\");\n stylesheet.addStyle(\".col5b\", \"width:12%\");\n stylesheet.addStyle(\".col6b\", \"width:12%\");\n\n style = stylesheet.addStyle(\".styleTableHeader\");\n style.setAttribute(\"background-color\", \"#464e7e\"); \n style.setAttribute(\"border-bottom\", \"1px double black\");\n style.setAttribute(\"color\", \"#fff\");\n\n style = stylesheet.addStyle(\".bold\");\n style.setAttribute(\"font-weight\", \"bold\");\n\n style = stylesheet.addStyle(\".alignRight\");\n style.setAttribute(\"text-align\", \"right\");\n\n style = stylesheet.addStyle(\".alignCenter\");\n style.setAttribute(\"text-align\", \"center\");\n\n style = stylesheet.addStyle(\".styleTitle\");\n style.setAttribute(\"font-weight\", \"bold\");\n style.setAttribute(\"background-color\", \"#eeeeee\");\n //style.setAttribute(\"padding-bottom\", \"5px\");\n\n style = stylesheet.addStyle(\".bordersLeftRight\");\n style.setAttribute(\"border-left\", \"thin solid black\");\n style.setAttribute(\"border-right\", \"thin solid black\");\n style.setAttribute(\"padding\", \"2px\");\n \n return stylesheet;\n}", "function drawChart() {\n \n if (submitted_yet){\n\n //collect the current user conditions\n var day = conditions[\"day\"];\n var hour = conditions[\"time\"];\n var weather = conditions[\"weather\"];\n\n var primSevArr = new Array();\n \n //let's get a severity for every hour \n for (hour = 0; hour<24; hour++){\n total_this_hour = 0;\n \n \n for (i = 0; i<=primEndIndex; i++){\n var sev_array = primSteps[i].severity;\n if(!sev_array){\n //this is for error handling\n continue;\n }\n var sev = sev_array[day][hour][weather];\n sev = fixSev(sev);\n\n total_this_hour += sev;\n }\n //add the sev total for this hour to the array\n primSevArr[hour] = total_this_hour;\n }\n\n // Create the data table.\n var prim_data = new google.visualization.DataTable();\n prim_data.addColumn('number', 'Hour');\n prim_data.addColumn('number', 'Primary Route Total Traffic Severity');\n\n //if alt route exists, get data for it and put it in a graph\n if(alt){\n\n var altSevArr = new Array();\n //get traff data for alt route\n for (i = 0; i<24; i++){\n alt_total_this_hour = 0;\n for (j = 0; j<=altEndIndex; j++){\n var sev_array = altSteps[j].severity;\n if(!sev_array){\n //this is for error handling\n continue;\n }\n var alt_sev = sev_array[day][i][weather];\n alt_sev = fixSev(alt_sev);\n\n alt_total_this_hour += alt_sev;\n }\n altSevArr[i] = alt_total_this_hour;\n }\n \n //add this data to the graph\n prim_data.addColumn('number', 'Alternate Total Traffic Severity');\n for(i=0; i<24; i++){\n prim_data.addRows([[i, primSevArr[i], altSevArr[i]]]);\n }\n //some rendering options for the graph\n var alt_options = {\n chart:{\n title: 'Alternate & Primary Route Total Traffic Severity vs. Hour'\n },\n series: {\n 0: {color: '#9966ff'},\n 1: {color: 'black'}\n }\n };\n \n //this chart is for the alt route, if applicable\n var alt_chart = new google.charts.Line(document.getElementById('prim_chart_div'));\n alt_chart.draw(prim_data, google.charts.Line.convertOptions(alt_options));\n }\n else{\n for(i=0; i<24; i++){\n prim_data.addRows([[i, primSevArr[i]]]);\n }\n var prim_options = {\n chart:{\n title: 'Primary Route Total Traffic Severity vs. Hour'\n },\n series: {\n 0: {color: '#9966ff'},\n }\n };\n\n var prim_chart = new google.charts.Line(document.getElementById('prim_chart_div'));\n prim_chart.draw(prim_data, google.charts.Line.convertOptions(prim_options));\n }\n }\n}", "function populateData() {\n let counts = {};\n let chartPieData = {'possible': 0, 'probable': 0, 'certain': 0, 'gueri': 0, 'mort': 0};\n let chartDateData = {};\n let chartAgeData = {\n 'total': [0,0,0,0,0,0,0,0,0,0],\n 'possible': [0,0,0,0,0,0,0,0,0,0],\n 'probable': [0,0,0,0,0,0,0,0,0,0],\n 'certain': [0,0,0,0,0,0,0,0,0,0],\n 'gueri': [0,0,0,0,0,0,0,0,0,0],\n 'mort': [0,0,0,0,0,0,0,0,0,0]\n };\n let chartSexData = {\n 'total': {'F': 0, 'M': 0},\n 'possible': {'F': 0, 'M': 0},\n 'probable': {'F': 0, 'M': 0},\n 'certain': {'F': 0, 'M': 0},\n 'gueri': {'F': 0, 'M': 0},\n 'mort': {'F': 0, 'M': 0}\n };\n for (let cas of cases) {\n let loc = cas['Domicile'];\n if (!(loc in counts)) {\n counts[loc] = {'total': 0, 'possible': 0, 'probable': 0, 'certain': 0, 'gueri': 0, 'mort': 0};\n }\n let filtered = (viewConfig.filter ? viewConfig.filter(cas) : viewFilterDefault(cas));\n if (filtered) {\n counts[loc]['total'] += 1;\n counts[loc][filtered['Condition']] += 1;\n\n chartPieData[filtered['Condition']] += 1;\n\n let date = new Date(filtered['Date symptomes']);\n if (!isNaN(date)) {\n date = date.toISOString();\n chartDateData[date] = (chartDateData[date] || 0 ) + 1;\n }\n\n chartAgeData['total'][Math.floor(filtered['Age']/10)] += 1;\n chartAgeData[filtered['Condition']][Math.floor(filtered['Age']/10)] += 1;\n\n chartSexData['total'][filtered['Sexe']] += 1;\n chartSexData[filtered['Condition']][filtered['Sexe']] += 1;\n }\n }\n data = {\n 'map': counts,\n 'globalpie': chartPieData,\n 'date': chartDateData,\n 'age': chartAgeData,\n 'sex': chartSexData,\n };\n}", "function fndrawGraph() {\r\n setOptionValue();\r\n\t\t\t\tlayout = new Layout(\"line\", options);\r\n//\t\t\t\talert(\"called.........fngraph............\");\r\n\t\t\t\tvar atempDataPopulation;\r\n\t\t\t\tvar atempPopulationlefive;\r\n\t\t\t\tvar atemparrPopulationbetFive;\r\n\t\t\t\tvar atemparrpopulationlabovefifteen; \r\n\t\t\t\t\r\n\t\t\t\tatempDataPopulation=arrDataPopulation;\r\n\t\t\t\tvar populationlen = atempDataPopulation.length; \r\n\t\t\t\t\r\n\t\t\t\t//arrPopulationleFive.push(populationlefive);\r\n\t\t\t\tatempPopulationlefive=arrPopulationleFive;\r\n\t\t\t\t\r\n\t\t\t\t//arrPopulationlbetFive.push(populationlbetfive);\r\n\t\t\t\tatemparrPopulationbetFive=arrPopulationlbetFive;\r\n\t\t\t\t\r\n\t\t\t\t//arrpopulationlabovefifteen.push(populationlabovefifteen);\r\n\t\t\t\tatemparrpopulationlabovefifteen=arrpopulationlabovefifteen;\r\n\t\t\t\t\r\n\t\t\t\t// Total Population \r\n\t\t\t\tvar tpBeforeInstruction=\"layout.addDataset('Totalpopulation',[\";\r\n\t\t\t\tvar tpInstruction=\"\";\r\n\t\t\t\t\r\n\r\n\t\t\t\t// less then five population \r\n\t\t\t\tvar tpltfiveBeforeInstruction=\"layout.addDataset('Populationltfive',[\";\r\n\t\t\t\tvar tpltfiveInstruction=\"\";\r\n\t\t\t\tvar populationltfivelen = atempPopulationlefive.length;\r\n\r\n \t\t\t\t// less then five to fourteen population \r\n\t\t\t\tvar tpbftofourtBeforeInstruction=\"layout.addDataset('PopulationAge5to14',[\";\r\n\t\t\t\tvar tpbftofourtInstruction=\"\";\r\n\t\t\t\tvar populationbetFivelen = atemparrPopulationbetFive.length;\r\n\t\t\t\t\r\n\t\t\t\t// above then fifteen population \r\n\t\t\t\tvar tpabfifteenBeforeInstruction=\"layout.addDataset('PopulationAge15plus',[\";\r\n\t\t\t\tvar tpabfifteenInstruction=\"\";\r\n\t\t\t\tvar populationabfifteenlen = atemparrpopulationlabovefifteen.length;\r\n\r\n\r\n\t\t\t\t// creating diffrent Dataset according Data \r\n\t\t\t\t\r\n\t\t\t\tfor (var i=0; i<populationlen; i++ )\r\n\t\t\t\t\t{\r\n\t\t\t\t\ttpInstruction=tpInstruction+ \"[\"+i+\", \"+atempDataPopulation[i]+\"]\";\t\r\n\t\t\t\t\ttpltfiveInstruction=tpltfiveInstruction+ \"[\"+i+\", \"+atempPopulationlefive[i]+\"]\";\t\r\n\t\t\t\t\ttpbftofourtInstruction=tpbftofourtInstruction+ \"[\"+i+\", \"+atemparrPopulationbetFive[i]+\"]\";\t\r\n\t\t\t\t\ttpabfifteenInstruction=tpabfifteenInstruction+ \"[\"+i+\", \"+atemparrpopulationlabovefifteen[i]+\"]\";\t\r\n\t\t\t\t\tif (i!=populationlen-1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\ttpInstruction=tpInstruction + \",\";\r\n\t\t\t\t\t\ttpltfiveInstruction=tpltfiveInstruction + \",\";\r\n\t\t\t\t\t\ttpbftofourtInstruction=tpbftofourtInstruction + \",\";\r\n\t\t\t\t\t\ttpabfifteenInstruction=tpabfifteenInstruction + \",\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttpInstruction=tpBeforeInstruction+tpInstruction +\"])\";\r\n\t\t\t\t\ttpltfiveInstruction=tpltfiveBeforeInstruction+tpltfiveInstruction+\"])\";\r\n\t\t\t\t\ttpbftofourtInstruction=tpbftofourtBeforeInstruction+tpbftofourtInstruction+\"])\";\r\n\t\t\t\t\ttpabfifteenInstruction=tpabfifteenBeforeInstruction+tpabfifteenInstruction+\"])\";\r\n\t\t\t\t\teval(tpInstruction);\r\n\t\t\t\t\teval(tpltfiveInstruction);\r\n\t\t\t\t\teval(tpbftofourtInstruction);\r\n\t\t\t\t\teval(tpabfifteenInstruction);\r\n\t\t\t\t\r\n\t\t\t\tlayout.evaluate();\r\n\t\t\t\t\t\r\n\t\t\t\tvar strTemp='';\r\n\t\t\t\tcanvas = MochiKit.DOM.getElement(\"graph\");\r\n\t\t\t\tplotter = new PlotKit.SweetCanvasRenderer(canvas, layout, options);\r\n\t\t\t\tplotter.render();\r\n\t\t}", "function createDashboardIr(data, data2) {\n\n /*\n * Loading all Units os Assessment and use this for populating\n * select box which will control the whole layout and all the visualizations\n * on this page\n */\n // Load all Unit of Assessment options\n var uoas = dataManager.loadAllUoAs(data);\n\n // Load all City options\n var cities = dataManager.loadAllCities(data);\n\n // Populate the select boxes with the options\n (0, _populateCities2.default)(cities);\n\n // Get the current city from the select box\n var selectBoxCity = document.getElementById('selector-city');\n var selectedCity = 'Aberdeen';\n var selectedUoa = 'Business and Management Studies';\n\n // Load all universities\n var universities = dataManager.loadAllUniversitiesInCity(data, selectedCity);\n var selectedUni = universities[0];\n\n /*\n * Creating the first visualization, which is a map of the UK,\n * with the universities of the selected city and a selected field (Unit\n * of Assessment) which are passed on as an argument from the selectbox\n */\n var mapMarkers = dataManager.getLocationByCity(data, selectedCity);\n var hierarchical = new _hierarchical2.default(data2, data, selectedUoa, selectedUni, 'ShowUniversity', true);\n\n var barChart = new _hBarChart2.default(data, dataManager.getUoaByUniversity(data, selectedUni), selectedUoa, selectedUni, 'StackUoa');\n\n // Create the map\n var map = new _map2.default(mapMarkers, 'mean');\n map.createMap();\n map.render();\n\n // Create the hierarchical sunburst chart\n hierarchical.createChart();\n\n // Create a horizontal stacked bar chart\n barChart.createChart();\n\n // Listen for changes on the City selectbox and get the selected value\n selectBoxCity.addEventListener('change', function (event) {\n selectedCity = selectBoxCity.options[selectBoxCity.selectedIndex].value;\n console.log(selectedCity);\n\n // Load all universities\n universities = dataManager.loadAllUniversitiesInCity(data, selectedCity);\n selectedUni = universities[0];\n\n // Reload the map with the new dataset\n map.reload(dataManager.getLocationByCity(data, selectedCity));\n\n // Reload the map with the new dataset\n barChart.reload(selectedUni, selectedUoa, data, dataManager.getUoaByUniversity(data, selectedUni), 'StackUoa');\n });\n}", "function initStepGraph(report) {\n // hover details\n var hoverDetail = new Rickshaw.Graph.HoverDetail( {\n graph: report.graph,\n yFormatter: function(y) { // Display percentage of total users\n return (report.total === 0) ? '0' : Math.round(y / report.total * 100) + '%';\n }\n } );\n\n // y axis\n var yAxis = new Rickshaw.Graph.Axis.Y({\n graph: report.graph\n });\n\n yAxis.render();\n\n var labels = function(step) {\n var map = {\n 1.5: report.steps[1].substr(4),\n 2.5: report.steps[2].substr(4),\n 3.5: report.steps[3].substr(4),\n 4.5: report.steps[4].substr(4)\n };\n return map[step];\n }\n\n // Show steps as x axis labels\n var xAxis = new Rickshaw.Graph.Axis.X({\n graph: report.graph,\n element: report.tab.find('.x_axis')[0],\n orientation: 'bottom',\n tickFormat: labels\n });\n\n xAxis.render();\n\n initStepTable(report);\n}", "function createReport() {\n let month = document.getElementById(\"reportMonth\").value;\n let thisMonthOper = JSON.parse(localStorage.getItem(\"operations\"));\n let reportObj = {};\n document.querySelector(\"tbody\").innerHTML = \"\";\n if (thisMonthOper === null) {\n thisMonthOper = [];\n }\n for (var i = 0; i < thisMonthOper.length; i++) {\n let operationsMonth = thisMonthOper[i].date[0]+thisMonthOper[i].date[1]+thisMonthOper[i].date[2]+thisMonthOper[i].date[3]+thisMonthOper[i].date[4]+thisMonthOper[i].date[5]+thisMonthOper[i].date[6];\n //create object from LS info\n if (operationsMonth === month) {\n if (reportObj.hasOwnProperty(thisMonthOper[i].item)) {\n reportObj[thisMonthOper[i].item] += thisMonthOper[i].sum;\n } else {\n reportObj[thisMonthOper[i].item] = thisMonthOper[i].sum;\n }\n }\n }\n //create report table\n let items = Object.keys(reportObj);\n let values = Object.values(reportObj);\n for (var i = 0; i < items.length; i++) {\n let newRow = tbody.insertRow();\n let rows = table.getElementsByTagName(\"tr\");\n let num = rows.length - 2;\n newRow.innerHTML = `\n <td>${num}</td>\n <td>${items[i]}</td>\n <td>${parseFloat(values[i] / 100 * 100).toFixed(2)}</td>\n <td>${months[month.slice(5,7)-1] + \"-\" + month.slice(0,4)}</td>\n `;\n }\n}", "function createReport1(tmfile1) {\n\topenfile(tmfile1);\n\tif (reporttype == 0) {\n\t\toframe.ActiveDocument.Application.Run(\"createNormalReport\");\n\t} else {\n\t\toframe.ActiveDocument.Application.Run(\"analyze\");\n\t}\n}", "function displayReport(report){\n var data = [];\n for(var key in report){\n data.push([Number(key), report[key]]);\n }\n data.sort(function(d){return d[0]});\n var report = d3.select(\"#report\");\n report.selectAll('*').remove();\n var title = report.append(\"h3\");\n var total = 0;\n report.selectAll('p')\n .data(data)\n .enter()\n .append('p')\n .text(function(d){\n // console.log(d[1])\n var weekSum = 0;\n for(var item of d[1]){\n weekSum += item.Amount;\n }\n total += weekSum;\n return `Week Starting ${weekToDate(d[0])}: $${weekSum}`;\n })\n var titleTxt\n if(!currentReport.all){\n titleTxt = `${window.myName}'s Total (${currentReport.start} to ${currentReport.end}): $${total}`;\n }\n else{\n titleTxt = `${window.myName}'s Total Expenses: $${total}`;\n }\n title.text(titleTxt);\n}", "function generateChartData(details) {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 100);\n\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_0;\n var Dacoity = newData[1].cy_0;\n var HBsbyDay = newData[2].cy_0;\n var HBsbyNight = newData[3].cy_0;\n var Ordinary = newData[4].cy_0;\n var Robbery = newData[5].cy_0;\n\n chartData.push({\n date: \"2016\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_1;\n var Dacoity = newData[1].cy_1;\n var HBsbyDay = newData[2].cy_1;\n var HBsbyNight = newData[3].cy_1;\n var Ordinary = newData[4].cy_1;\n var Robbery = newData[5].cy_1;\n\n chartData.push({\n date: \"2014\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_2;\n var Dacoity = newData[1].cy_2;\n var HBsbyDay = newData[2].cy_2;\n var HBsbyNight = newData[3].cy_2;\n var Ordinary = newData[4].cy_2;\n var Robbery = newData[5].cy_2;\n\n chartData.push({\n date: \"2013\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_3;\n var Dacoity = newData[1].cy_3;\n var HBsbyDay = newData[2].cy_3;\n var HBsbyNight = newData[3].cy_3;\n var Ordinary = newData[4].cy_3;\n var Robbery = newData[5].cy_3;\n\n chartData.push({\n date: \"2012\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_4;\n var Dacoity = newData[1].cy_4;\n var HBsbyDay = newData[2].cy_4;\n var HBsbyNight = newData[3].cy_4;\n var Ordinary = newData[4].cy_4;\n var Robbery = newData[5].cy_4;\n\n chartData.push({\n date: \"2011\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n return chartData;\n }", "function makecharts() {\n dataprovider = [{\"time\":0,\"a\":50,\"b\":23,\"c\":23,\"d\":4,\"e\":4},{\"time\":1,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":2,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":3,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":11,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":22,\"a\":53,\"b\":43,\"c\":53,\"d\":4,\"e\":1},{\"time\":40,\"a\":50,\"b\":23,\"c\":23,\"d\":4,\"e\":4},{\"time\":41,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":42,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":43,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":51,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":52,\"a\":53,\"b\":43,\"c\":53,\"d\":4,\"e\":1}];\n variablel = [{\"name\":\"a\",\"axis\":0,\"description\":\"Somethinga\"},\n {\"name\":\"b\",\"axis\":0,\"description\":\"Somethingb\"},\n {\"name\":\"c\",\"axis\":1,\"description\":\"Somethingc\"},\n {\"name\":\"d\",\"axis\":0,\"description\":\"Somethingd\"}\n ]\n makechartswithdata(dataprovider,variablel); \n}", "function createStyleSheet() {\r\n\tvar stylesheet = Banana.Report.newStyleSheet();\r\n\r\n var pageStyle = stylesheet.addStyle(\"@page\");\r\n pageStyle.setAttribute(\"margin\", \"10mm 20mm 10mm 20mm\");\r\n\r\n\tvar style = \"\";\r\n\r\n\tstyle = stylesheet.addStyle(\".footer\");\r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\tstyle.setAttribute(\"font-size\", \"8px\");\r\n\tstyle.setAttribute(\"font\", \"Times New Roman\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading1\");\r\n\tstyle.setAttribute(\"font-size\", \"16px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\t\r\n\tstyle = stylesheet.addStyle(\".heading2\");\r\n\tstyle.setAttribute(\"font-size\", \"14px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading3\");\r\n\tstyle.setAttribute(\"font-size\", \"11px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading4\");\r\n\tstyle.setAttribute(\"font-size\", \"9px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".valueAmount1\");\r\n\tstyle.setAttribute(\"font-size\", \"9px\");\r\n\tstyle.setAttribute(\"padding-bottom\", \"5px\"); \r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\r\n\tstyle = stylesheet.addStyle(\".valueAmountText\");\r\n\tstyle.setAttribute(\"font-size\", \"9px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\tstyle.setAttribute(\"padding-bottom\", \"5px\"); \r\n\tstyle.setAttribute(\"background-color\", \"#eeeeee\"); \r\n\r\n\tstyle = stylesheet.addStyle(\".bold\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".right\");\r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\r\n\tstyle = stylesheet.addStyle(\".italic\");\r\n\t//style.setAttribute(\"font-style\", \"italic\");\r\n\tstyle.setAttribute(\"font-family\", \"Courier New\");\r\n\r\n\tstyle = stylesheet.addStyle(\".horizontalLine\");\r\n\tstyle.setAttribute(\"border-top\", \"1px solid black\");\r\n\t\r\n\tstyle = stylesheet.addStyle(\".valueTotal\");\r\n\tstyle.setAttribute(\"font-size\", \"9px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\tstyle.setAttribute(\"padding-bottom\", \"5px\"); \r\n\tstyle.setAttribute(\"background-color\", \"#eeeeee\"); \r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\tstyle.setAttribute(\"border-bottom\", \"1px double black\");\r\n\r\n\tvar tableStyle = stylesheet.addStyle(\".assetsTable\");\r\n\ttableStyle.setAttribute(\"width\", \"100%\");\r\n\ttableStyle.setAttribute(\"font-size\", \"8px\");\t\r\n\r\n\tvar tableStyle = stylesheet.addStyle(\".liabilitiesTable\");\r\n\ttableStyle.setAttribute(\"width\", \"100%\");\r\n\ttableStyle.setAttribute(\"font-size\", \"8px\");\t\r\n\r\n\tvar tableStyle = stylesheet.addStyle(\".incomeTable\");\r\n\ttableStyle.setAttribute(\"width\", \"100%\");\r\n\ttableStyle.setAttribute(\"font-size\", \"8px\");\t\r\n\t//stylesheet.addStyle(\"table.incomeTable td\", \"border: thin solid black\");\r\n\r\n\tvar tableStyle = stylesheet.addStyle(\".expensesTable\");\r\n\ttableStyle.setAttribute(\"width\", \"100%\");\r\n\ttableStyle.setAttribute(\"font-size\", \"8px\");\r\n\t//stylesheet.addStyle(\"table.expensesTable td\", \"border: thin solid black\");\t\r\n\r\n\treturn stylesheet;\r\n}", "function groupGraphs() {\n // getting the graph elements\n graphDiv = document.getElementById(\"graphs\");\n graphDiv.innerHTML = \"\";\n // getting the groupings as an array\n groupings = getGrouping(parameterList.concat(extra));\n // iterating through the graphs and appending them to the canvas\n let currCanvas = document.createElement(\"canvas\");\n graphDiv.appendChild(currCanvas);\n if (groupings[1].length) {\n // temp = {};\n // temp[metrics[7]] = displayData[metrics[7]];\n // temp[metrics[10]] = displayData[metrics[10]];\n // console.log(temp);\n singleGraph(displayData, [metrics[0],metrics[1]], groupings[0], currCanvas);\n }\n for (let i = 2; i < groupings.length; i++) {\n let currCanvas = document.createElement(\"canvas\");\n graphDiv.appendChild(currCanvas);\n if (groupings[i].length) {\n singleGraph(displayData, groupings[i], groupings[0], currCanvas);\n }\n }\n\n}", "createGraph() {\r\n\t\tlet oldLines = this.graph_container.selectAll('rect');\r\n\t\toldLines.remove();\r\n\t\toldLines = this.graph_details.selectAll('line');\r\n\t\toldLines.remove();\r\n\t\toldLines = this.graph_details.selectAll('text');\r\n\t\toldLines.remove();\r\n\t\tfor(let i = 0; i < this.numCols; i++) {\r\n\t\t\tfor(let j = 0; j < this.numRows; j++) {\r\n\t\t\t\tlet line = this.graph_container.append('rect')\r\n\t\t\t\t\t.attr('transform', `translate(${i * this.cell_size + this.offset.x} ${j * this.cell_size + this.offset.y})`)\r\n\t\t\t\t\t.attr('width', this.cell_size)\r\n\t\t\t\t\t.attr('height', this.cell_size)\r\n\t\t\t\t\t.attr('fill', 'white')\r\n\t\t\t\t\t.attr('stroke', 'gray')\r\n\t\t\t\t\t.attr('stroke-opacity', .3);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Now create the details such as bolded x and y lines, labeling, etc.\r\n\t\tlet x_jump = 0, y_jump = Math.abs(this.max_values.y / this.unit_per_square.y);\r\n\t\tif(this.min_values.x < 0)\r\n\t\t\tx_jump = Math.abs(this.min_values.x / this.unit_per_square.x);\r\n\t\tif(this.min_values.y < 0)\r\n\t\t\ty_jump = Math.abs(this.max_values.y / this.unit_per_square.y);\r\n\t\tthis.graph_details.append('line') //Left side line\r\n\t\t\t.attr('x1', this.offset.x + this.cell_size * x_jump)\r\n\t\t\t.attr('y1', this.offset.y)\r\n\t\t\t.attr('x2', this.offset.x + this.cell_size * x_jump)\r\n\t\t\t.attr('y2', this.numRows * this.cell_size + this.offset.y)\r\n\t\t\t.attr('stroke-width', 1.5)\r\n\t\t\t.attr('stroke', '#3f3f3f');\r\n\t\tthis.graph_details.append('line') //Botton line\r\n\t\t\t.attr('x1', this.offset.x)\r\n\t\t\t.attr('y1', this.cell_size * y_jump + this.offset.y)\r\n\t\t\t.attr('x2', this.numRows * this.cell_size + this.offset.x)\r\n\t\t\t.attr('y2', this.cell_size * y_jump + this.offset.y)\r\n\t\t\t.attr('stroke-width', 1.5)\r\n\t\t\t.attr('stroke', '#3f3f3f');\r\n\r\n\t\tlet every_x = 1;\r\n\t\tlet every_y = 1;\r\n\t\t//Loop for making the lines along the x axis\r\n\t\tlet group = this.graph_details.append('g');\r\n\t\tfor(let i = 0; i <= this.numCols; i+=every_x) {\r\n\t\t\tgroup.append('line') //Bottom lines of the graph\r\n\t\t\t\t.attr('x1', i * this.cell_size + this.offset.x)\r\n\t\t\t\t.attr('y1', this.cell_size * y_jump + this.offset.y - this.cell_size / 4)\r\n\t\t\t\t.attr('x2', i * this.cell_size + this.offset.x)\r\n\t\t\t\t.attr('y2', this.cell_size * y_jump + this.offset.y + this.cell_size / 4)\r\n\t\t\t\t.attr('stroke-width', 1.5)\r\n\t\t\t\t.attr('stroke', '#3f3f3f');\r\n\t\t\tgroup.append('text') //Text below the lines on the bottom on the graph\r\n\t\t\t\t.attr('x', i * this.cell_size + this.offset.x + this.cell_size / 10)\r\n\t\t\t\t.attr('y', this.cell_size * y_jump + this.offset.y + this.cell_size / 2)\r\n\t\t\t\t.attr('font-family', 'sans-serif')\r\n\t\t\t\t.attr('font-size', this.text_sizes.small)\r\n\t\t\t\t.text(Number(this.unit_per_square.x * i + this.min_values.x).toFixed(1));\r\n\t\t}\r\n\t\tfor(let i = 0; i <= this.numRows; i+=every_y) {\r\n\t\t\tgroup.append('line') //Left side lines of the graph\r\n\t\t\t\t.attr('x1', this.offset.x + this.cell_size * x_jump - this.cell_size / 4)\r\n\t\t\t\t.attr('y1', i * this.cell_size + this.offset.y)\r\n\t\t\t\t.attr('x2', this.offset.x + this.cell_size * x_jump + this.cell_size / 4)\r\n\t\t\t\t.attr('y2', i * this.cell_size + this.offset.y)\r\n\t\t\t\t.attr('stroke-width', 1.5)\r\n\t\t\t\t.attr('stroke', '#3f3f3f');\r\n\t\t\tgroup.append('text') //Text on the left side lines of the graph\r\n\t\t\t\t.attr('x', this.offset.x + this.cell_size * x_jump - this.cell_size / 2)\r\n\t\t\t\t.attr('y', i * this.cell_size + this.offset.y - this.cell_size / 10)\r\n\t\t\t\t.attr('font-family', 'sans-serif')\r\n\t\t\t\t.attr('font-size', this.text_sizes.small)\r\n\t\t\t\t.text(Number(this.max_values.y - this.unit_per_square.y * i).toFixed(1));\r\n\t\t}\r\n\r\n\t\tthis.createLabels(this.x_axis_label, this.y_axis_label);\r\n\t\tthis.deleteHandles();\r\n\t\tthis.createHandle(this.endPointA, '#30c1ff');\r\n\t\tthis.createHandle(this.endPointB, '#218cff');\r\n\t\tthis.update();\r\n\t}", "function BuildCharts(id) {\n \n //********Declare Local Variables *********/\n //Variables for Series and Axis Arrays\n var years = [];\n var acres_burned = [];\n var avg_acres_burned = [];\n var fatalities = [];\n var structures_destroyed = [];\n var structures_damaged = [];\n var years_small = [];\n var acres_burned_pct_increase = [];\n var incidents_small = [];\n var incident_small_pct_increase = []\n var years_medium = [];\n var incidents_medium= [];\n var incident_medium_pct_increase = []\n var years_large = [];\n var incidents_large = [];\n var incident_large_pct_increase = [];\n \n //------------------------------------------\n // Create the Metadata Card\n //------------------------------------------\n\n \n //------------------------------------------\n // Create the Metadata Card\n //------------------------------------------\n //Filter overall global data array by selection.\n td = overall_stats_data.filter(d => {return(d.county_description == id)});\n overall_stats_td = td.map(e => {return e});\n console.log(overall_stats_td);\n // Select the Metadata card in Index.html\n var metadataCard = d3.select(\"#sample-metadata\");\n var all_years_summary = {\n \"Total number of fires: \": overall_stats_td[0].total_fires,\n \"Total acres burned: \" : overall_stats_td[0].acres_burned,\n \"Total structures destroyed: \" : overall_stats_td[0].structures_destroyed,\n \"Total structures damaged: \" : overall_stats_td[0].structures_damaged,\n \"Total fatalities: \" : overall_stats_td[0].total_fatalities\n };\n\n // Create a list group in the Demographic Info card with some special styling \n var metadataList = metadataCard.append(\"ul\").attr(\"class\", \"list-group list-group-flush metadata-fields\")\n // Iterate through each key-value pair getting the values to build the Demographic Info card\n Object.entries(all_years_summary).forEach(([key, value]) => {\n var metadataItem = metadataList.append(\"li\").\n attr(\"class\", \"list-group-item p-1 details-text\").\n text(`${key}: ${value}`);\n }); \n\n //------------------------------------------\n // Filter Main Global Data Arrays By County Selection. Rebuild Axis and Category Arrays\n //------------------------------------------\n //Build Stack Barchart Axis and Category Arrays\n td = wildfire_year_incident_data.filter(d => {return(d.county_description == id & d.incident_level == \"Large\")});\n wildfire_year_incident_td = td.map(e => {return e}); \n years_large = wildfire_year_incident_td.map(e=>{return e.year});\n incidents_large = wildfire_year_incident_td.map(e=>{return e.total_fires});\n incident_large_pct_increase = wildfire_year_incident_td.map(e=>{return e.incident_pct + \"%\"});\n \n\n td = wildfire_year_incident_data.filter(d => {return(d.county_description == id & d.incident_level == \"Medium\")});\n wildfire_year_incident_td = td.map(e => {return e}); \n years_medium = wildfire_year_incident_td.map(e=>{return e.year});\n incidents_medium = wildfire_year_incident_td.map(e=>{return e.total_fires});\n incident_medium_pct_increase = wildfire_year_incident_td.map(e=>{return e.incident_pct + \"%\"});\n\n td = wildfire_year_incident_data.filter(d => {return(d.county_description == id & d.incident_level == \"Small\")});\n wildfire_year_incident_td = td.map(e => {return e}); \n years_small = wildfire_year_incident_td.map(e=>{return e.year});\n incidents_small = wildfire_year_incident_td.map(e=>{return e.total_fires});\n incident_small_pct_increase = wildfire_year_incident_td.map(e=>{return e.incident_pct + \"%\"});\n\n\n //Build Bar/Line Chart for total by year and add label.\n td = wildfire_year_data.filter(d => {return(d.county_description == id)});\n wildfire_year_td = td.map(e => {return e}); \n years = wildfire_year_td.map(e=>{return e.year}); \n acres_burned = wildfire_year_td.map(e=>{return e.acres_burned});\n acres_burned_increase_rate = wildfire_year_td.map(e=>{return e.acres_burned_increase_rate + \"%\"}); \n \n //Build Avaeage Bunred Acres Dataset\n avg_acres_burned = wildfire_year_td.map(e=>{return e.avg_acres_burned});\n\n //Build Grouped Bar Chart \n fatalities = wildfire_year_td.map(e=>{return e.total_fatalities});\n structures_damaged = wildfire_year_td.map(e=>{return e.structures_damaged});\n structures_destroyed = wildfire_year_td.map(e=>{return e.structures_destroyed});\n\n console.log(fatalities);\n console.log(fatalitiesg);\n \n\n //------------------------------------------\n // Chart Configuration \n //------------------------------------------\n //Acreage Burned Bar Chart Configuration\n var trace_bar = {\n x: years,\n y: acres_burned,\n type: \"bar\",\n name: \"Acres Burned\"\n };\n\n var trace_line = {\n x:years,\n y:acres_burned,\n type:\"scatter\",\n text:acres_burned_increase_rate,\n hovertemplate: '<br><b>%Increase</b><br>' +\n '<b>%{text}</b>',\n name:\"%Year Increase/Decrease\"\n };\n\n var layout_bar = {\n title: \"Acres Burned By Year\",\n xaxis: { title: \"Year\",\n type:\"Category\" },\n yaxis: { title: \"Acres Burned\",\n type:\"Linear\",\n }\n };\n\n var data_bar = [trace_bar,trace_line];\n //Average Acreage Burned Bar Chart Configuration\n var trace_avg_bar = {\n x: years,\n y: avg_acres_burned,\n type: \"bar\",\n name: \"Average Acres Burned\"\n };\n\n\n var layout_avg_bar = {\n title: \"Average Acres Burned per Wildfire\",\n xaxis: { title: \"Year\",\n type:\"Category\" },\n yaxis: { title: \"Average Acres Burned\",\n type:\"Linear\",\n }\n };\n\n var data_avg_bar = [trace_avg_bar];\n \n //Stacked Bar Chart Configuration\n var trace_small = {\n x: years_small,\n y: incidents_small,\n text:incident_small_pct_increase,\n name: \"Small\",\n type: \"bar\",\n marker: {color: \"#ffb727\"}\n };\n\n var trace_medium = {\n x: years_medium,\n y: incidents_medium,\n text:incident_medium_pct_increase,\n name: \"Medium\",\n type: \"bar\",\n marker: {color: \"#ff7f27\"}\n }; \n \n var trace_large = {\n x: years_large,\n y: incidents_large,\n text: incident_large_pct_increase,\n name: \"Large\",\n type: \"bar\",\n marker: {color: \"#88001b\"}\n }; \n var data_stack = [trace_small,trace_medium,trace_large];\n\n var layout_stack = {\n title: \"Fire Incidents By Year\",\n xaxis: { title: \"Year\",\n type:\"Category\" },\n yaxis: { title: \"Incident Count\",\n type:\"Linear\",\n },\n barmode: 'stack'\n };\n \n //Grouped Bar Chart Configuration\n var trace_fatalities = {\n x: years,\n y: fatalities,\n name: \"Fatalities\",\n type: \"bar\"\n };\n\n var trace_structures_damaged = {\n x: years,\n y: structures_damaged,\n name: \"Structures Damaged\",\n type: \"bar\"\n };\n\n var trace_structures_destroyed = {\n x: years,\n y: structures_destroyed,\n name: \"Structures Destroyed\",\n type: \"bar\"\n };\n\n var data_destruction = [trace_fatalities,trace_structures_damaged,trace_structures_destroyed];\n\n var layout_destruction = {\n title: \"Destruction Metrics By Year\",\n xaxis: { title: \"Year\",\n type:\"Category\" },\n yaxis: { title: \"Volume\",\n type:\"log\"\n }\n };\n \n\n //------------------------------------------\n // Rebuild Bar Chart\n //------------------------------------------\n Plotly.react(\"stackbar\", data_stack, layout_stack);\n Plotly.react(\"bar\", data_bar, layout_bar); \n Plotly.react(\"bar-avg\", data_avg_bar, layout_avg_bar); \n Plotly.react(\"cluster\",data_destruction,layout_destruction); \n}", "function generals() {\n doubleBarGraph('tablita.csv', 'Deaths in various corridors across the border.');\n}", "function drawSvg() {\n\t\t// selector can be #residential, or #commercial which should be in graph.html\n\t\tvar dataSources = [{selector: '#commercial', data: data.commGraphData}, \n\t\t\t{selector: '#residential', data: data.residGraphData}];\n\n\t\tdataSources.forEach(function(item) {\n\t\t\tvar canvas = createCanvas(item.selector, item.data);\n\t\t\tdrawHorizontalLabel(canvas);\n\t\t\tdrawVerticalLable(canvas, item.data);\n\t\t\tdrawHeatMap(canvas, item.data);\n\t\t});\n\t}", "function displayGraphs(data) {\n $('#charts').html('');\n $('#all-programs tbody').html('');\n $.each(data, function(i, item) {\n if (i < numCharts) {\n $('#charts').append('<div class=\"chart-container\" data-program-id=\"' + item.ProgramID + '\"><div id=\"graph-' + item.ProgramID + '\" class=\"chart\"><h2>' + item.Name + '</h2><a href=\"#\" onclick=\"toggleEditProgramName($(this)); return false;\" class=\"edit-icon\"></a><h3>Sales by month</h3><div id=\"chart-' + item.ProgramID + '\"></div></div><div class=\"total-monthly\">' +\n '<table><thead>' +\n '<tr><td>Total Monthly</td><td>Current</td><td>1-Year</td></tr>' +\n '</thead><tbody>' +\n '<tr><td>Sales</td><td>' + formatCurrency(item.TotalMonthlySales) + '</td><td id=\"line-' + item.ProgramID + '\" class=\"line\"></td></tr>' +\n '</tbody></table>' +\n '</div><a href=\"#\" onclick=\"getPricing($(this)); return false;\">more</a><div class=\"additional-data\"></div></div>');\n buildChartData(item.Sales, \"chart-\" + item.ProgramID);\n buildLineData(item.Sales, \"line-\" + item.ProgramID);\n }\n else {\n var output = '<tr><td class=\"chart-container\" data-program-id=\"' + item.ProgramID + '\">' + item.Name + '<a href=\"#\" onclick=\"getPricing($(this)); return false;\">more</a><div class=\"additional-data\"></div></td><td>' + formatCurrency(item.TotalMonthlySales) + '</td><td>' + item.MonthlyAttendance + ' <span class=\"unit\">vists</span></td></tr>';\n $('#all-programs table').append(output);\n }\n });\n}", "function makeGraphs(error, tourismData) {\n // first create a crossfilter, one per site\n // load the data in to the crossfilter\n var ndx = crossfilter(tourismData);\n \n // pass the crossfilter variable (ndx)\n // to the function that's going to draw the graph\n select_destination(ndx);\n show_paris_tourism(ndx);\n show_santorini_tourism(ndx);\n show_rome_tourism(ndx);\n \n // render graphs\n dc.renderAll();\n}", "function createReport(userID, data) {\n //console.log('in createRport')\n let Rows = []\n data.map(item => {\n item.events.map(e => {\n Rows.push({\n fechaHora: addHours(e.created, -5),\n estado: e.inputs.digital[0].value,\n lat: e.location.latitude.toFixed(6),\n lon: e.location.longitude.toFixed(6),\n velocidad: Math.round(parseFloat(e.location.speed)),\n odometro: (e.counters[0].value / 1000).toFixed(3),\n direccion: e.location.address,\n geozona: e.location.areas[0] ? e.location.areas[0].name : ' ',\n conductor: e.person,\n placa: e.vehicle,\n })\n\n })\n\n })\n const rowsTotal = Rows.length\n console.log('Documentos Consultados: ', rowsTotal)\n // console.log('Rows : ', Rows)\n let RowsReport = []\n if (rowsTotal > 0) {\n Rows.map((row, index, rowArray) => {\n\n if (index > 0 && row.placa != rowArray[index - 1].placa) {\n const dateTime4 = getDateAndTime(row.fechaHora)\n const date4 = dateTime4.date\n const time4 = dateTime4.time\n RowsReport.push({\n //fechaHora: row.fechaHora,\n fecha: date4,\n hora: time4,\n estado: row.estado ? 'En movimiento' : 'Detenido',\n lat: row.lat,\n lon: row.lon,\n velocidad: row.velocidad,\n odometro: row.odometro,\n direccion: row.direccion,\n geozona: row.geozona,\n conductor: row.conductor,\n placa: row.placa\n })\n } else {\n if (index > 0 && index <= (rowsTotal - 1)) {\n const diffMinutes = getMinutesDiff(row.fechaHora, rowArray[index - 1].fechaHora)\n if (diffMinutes > 1) {\n const beforeRow = rowArray[index - 1]\n for (let i = 1; i < diffMinutes; i++) {\n const dateTime0 = getDateAndTime(addMinutes(beforeRow.fechaHora, i))\n const date0 = dateTime0.date\n const time0 = dateTime0.time\n RowsReport.push({\n //fechaHora: addMinutes(beforeRow.fechaHora, i),\n fecha: date0,\n hora: time0,\n estado: beforeRow.estado ? 'En movimiento' : 'Detenido',\n lat: beforeRow.lat,\n lon: beforeRow.lon,\n velocidad: beforeRow.velocidad,\n odometro: beforeRow.odometro,\n direccion: beforeRow.direccion,\n geozona: beforeRow.geozona,\n conductor: beforeRow.conductor,\n placa: beforeRow.placa\n })\n }\n const dateTime1 = getDateAndTime(row.fechaHora)\n const date1 = dateTime1.date\n const time1 = dateTime1.time\n RowsReport.push({\n // fechaHora: row.fechaHora,\n fecha: date1,\n hora: time1,\n estado: row.estado ? 'En movimiento' : 'Detenido',\n lat: row.lat,\n lon: row.lon,\n velocidad: row.velocidad,\n odometro: row.odometro,\n direccion: row.direccion,\n geozona: row.geozona,\n conductor: row.conductor,\n placa: row.placa\n })\n } else {\n const dateTime2 = getDateAndTime(row.fechaHora)\n const date2 = dateTime2.date\n const time2 = dateTime2.time\n RowsReport.push({\n // fechaHora: row.fechaHora,\n fecha: date2,\n hora: time2,\n estado: row.estado ? 'En movimiento' : 'Detenido',\n lat: row.lat,\n lon: row.lon,\n velocidad: row.velocidad,\n odometro: row.odometro,\n direccion: row.direccion,\n geozona: row.geozona,\n conductor: row.conductor,\n placa: row.placa\n })\n }\n } else {\n const dateTime3 = getDateAndTime(row.fechaHora)\n const date3 = dateTime3.date\n const time3 = dateTime3.time\n RowsReport.push({\n //fechaHora: row.fechaHora,\n fecha: date3,\n hora: time3,\n estado: row.estado ? 'En movimiento' : 'Detenido',\n lat: row.lat,\n lon: row.lon,\n velocidad: row.velocidad,\n odometro: row.odometro,\n direccion: row.direccion,\n geozona: row.geozona,\n conductor: row.conductor,\n placa: row.placa\n })\n }\n }\n\n })\n // console.log('RowsReport: ',RowsReport)\n stNTPCCY.emit('Rows', userID, RowsReport)\n console.log('Documentos Creados: ', RowsReport.length)\n } else {\n stNTPCCY.emit('NoData', userID, 0)\n console.log('No hay data')\n }\n\n\n}", "function drawChart() \n {\n\n // Create our data table.\n var data = new google.visualization.DataTable();\n\n \t // Create and populate the data table.\n \t var yearData = google.visualization.arrayToDataTable(yearRowData);\n \t var yearTotalsData = google.visualization.arrayToDataTable(yearTotalsRowData);\n \t var monthData = google.visualization.arrayToDataTable(monthRowData);\n \t var monthTotalsData = google.visualization.arrayToDataTable(monthTotalsRowData);\n \t var weekData = google.visualization.arrayToDataTable(weekRowData);\n \t var weekTotalsData = google.visualization.arrayToDataTable(weekTotalsRowData);\n \t var dayData = google.visualization.arrayToDataTable(dayRowData);\n \t var dayTotalsData = google.visualization.arrayToDataTable(dayTotalsRowData);\n \n // Instantiate and draw our chart, passing in some options.\n \t var chartAreaSize = {width:\"90%\",height:\"80%\"};\n \t var dayChartAreaSize = {width:\"80%\",height:\"80%\"};\n \t var chartHeight = 300;\n \t var chartWidth = 710;\n \t var pieWidth = 370;\n \t var dayWidth = 400;\n \t var fontPxSize = 14;\n \t \n \t \n // day charts\n if(dayDataExist)\n {\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('dayPieChart'));\n\t pieChart.draw(dayTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('dayPieChart'));\n\t pieChart.draw(dayTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('dayStackChart'));\n\t \t columnChart.draw(dayData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('dayStackChart'));\n\t \t columnChart.draw(dayData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('dayBarChart'));\n\t \t columnChart.draw(dayData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('dayBarChart'));\n\t \t columnChart.draw(dayData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n }\n else\n {\n \t $('#dayPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 1 });\n \t $('#dayStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 1 });\n \t $('#dayBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 1 });\n }\n \n if(weekDataExist)\n {\n\t // weekCharts\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('weekPieChart'));\n\t pieChart.draw(weekTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('weekPieChart'));\n\t pieChart.draw(weekTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('weekStackChart'));\n\t \t columnChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('weekStackChart'));\n\t \t columnChart.draw(weekData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('weekBarChart'));\n\t \t columnChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('weekBarChart'));\n\t \t columnChart.draw(weekData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(weekRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('weekLineChart'));\n\t\t lineChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('weekLineChart'));\n\t\t lineChart.draw(weekData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('weekAreaChart'));\n\t\t \t areaChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('weekAreaChart'));\n\t\t \t areaChart.draw(weekData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t } \n\t }\n\t else\n\t {\n\t \t //$(\"#weekLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t //$(\"#weekAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $('#weekLineChartTab').hide();\n\t \t $( '#lineCharts' ).tabs({ selected: 1 });\n\t \t $('#weekAreaChartTab').hide();\n\t \t $( '#areaCharts' ).tabs({ selected: 1 });\n\t }\n }\n else\n {\n \t $('#weekPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 2 });\n \t $('#weekStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 2 });\n \t $('#weekBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 2 });\n \t $('#weekLineChartTab').hide();\n \t $( '#lineCharts' ).tabs({ selected: 1 });\n \t $('#weekAreaChartTab').hide();\n \t $( '#areaCharts' ).tabs({ selected: 1 });\n }\n \n if(monthDataExist)\n {\n\t // month charts\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('monthPieChart'));\n\t pieChart.draw(monthTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('monthPieChart'));\n\t pieChart.draw(monthTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('monthStackChart'));\n\t \t columnChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('monthStackChart'));\n\t \t columnChart.draw(monthData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('monthBarChart'));\n\t \t columnChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('monthBarChart'));\n\t \t columnChart.draw(monthData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(monthRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('monthLineChart'));\n\t\t lineChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('monthLineChart'));\n\t\t lineChart.draw(monthData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('monthAreaChart'));\n\t\t \t areaChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('monthAreaChart'));\n\t\t \t areaChart.draw(monthData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t }\n\t else\n\t {\n\t \t //$(\"#monthLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t //$(\"#monthAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $('#monthLineChartTab').hide();\n\t \t $( '#lineCharts' ).tabs({ selected: 2 });\n\t \t $('#monthAreaChartTab').hide();\n\t \t $( '#areaCharts' ).tabs({ selected: 2 });\n\t }\n }\n else\n {\n \t $('#monthPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 3 });\n \t $('#monthStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 3 });\n \t $('#monthBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 3 });\n \t $('#monthLineChartTab').hide();\n \t $( '#lineCharts' ).tabs({ selected: 2 });\n \t $('#monthAreaChartTab').hide();\n \t $( '#areaCharts' ).tabs({ selected: 2 });\n }\n \n if(yearDataExist)\n {\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('yearPieChart'));\n\t pieChart.draw(yearTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('yearPieChart'));\n\t pieChart.draw(yearTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('yearStackChart'));\n\t \t columnChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('yearStackChart'));\n\t \t columnChart.draw(yearData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('yearBarChart'));\n\t \t columnChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('yearBarChart'));\n\t \t columnChart.draw(yearData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(yearRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('yearLineChart'));\n\t\t lineChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('yearLineChart'));\n\t\t lineChart.draw(yearData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('yearAreaChart'));\n\t\t \t areaChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('yearAreaChart'));\n\t\t \t areaChart.draw(yearData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t }\n\t else\n\t {\n\t \t $(\"#yearLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $(\"#yearAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t }\n }\n else\n {\n \t $(\"#yearPieChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearStackChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearBarChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n }\n \n }", "function createChart(data,widgets){\n if(data.length == 2 ){\n $(\"#bar\").html('<div class=\"callout alert\"><h5>No results shown.</h5><p>There is no data for the selected options.</p></div>');\n $(\"#line\").html('<div class=\"callout alert\"><h5>No results shown.</h5><p>There is no data for the selected options.</p></div>');\n $(\"#table\").html('<div class=\"callout alert\"><h5>No results shown.</h5><p>There is no data for the selected options.</p></div>');\n return;\n }\n var type = window.location.pathname.split('/')[1];\n var widgetsArray = $.map(widgets, function(el) { return el });\n if (type == \"Results\") { \n $.each(widgetsArray[0],function(val){\n var dataTable = createDataTable(data,widgetsArray[0][val][\"type\"]);\n drawChart(dataTable,val,widgetsArray[0][val][\"options\"]);\n });\n }\n else if(type == \"Visitor\"){\n $.each(widgetsArray[1],function(val){\n var dataTable = createDataTable(data,widgetsArray[1][val][\"type\"]);\n drawChart(dataTable,val,widgetsArray[1][val][\"options\"]);\n });\n }\n }", "function generateCharts(data, db) {\n var countries = {};\n (countries.HIC = []), (countries.UMC = {}), (countries.LMC = {});\n var continents = {};\n (continents.AP = []),\n (continents.EU = []),\n (continents.LA = []),\n (continents.ME = []),\n (continents.NA = []);\n var mediaAP = 0,\n mediaEU = 0,\n mediaLA = 0,\n mediaME = 0,\n mediaNA = 0;\n var mediaUMC = [],\n mediaHIC = [],\n mediaLMC = [];\n var ap = 0,\n eu = 0,\n la = 0,\n me = 0,\n na = 0;\n var apVal = 0,\n euVal = 0,\n laVal = 0,\n meVal = 0,\n naVal = 0;\n const year2009 = db.filter((key) => key.Anno == 2009);\n const year2011 = db.filter((key) => key.Anno == 2011);\n const year2013 = db.filter((key) => key.Anno == 2013);\n const year2015 = db.filter((key) => key.Anno == 2015);\n const detailedYear2015 = data.filter((key) => key.Anno == 2015);\n\n function filterByIncome(yearArray, income) {\n return yearArray.filter((key) => {\n return key.incomeLevel == income;\n });\n }\n //organize countries by year and income level in array of objects\n countries.HIC[2009] = filterByIncome(year2009, \"HIC\");\n countries.HIC[2011] = filterByIncome(year2011, \"HIC\");\n countries.HIC[2013] = filterByIncome(year2013, \"HIC\");\n countries.HIC[2015] = filterByIncome(year2015, \"HIC\");\n countries.UMC[2009] = filterByIncome(year2009, \"UMC\");\n countries.UMC[2011] = filterByIncome(year2011, \"UMC\");\n countries.UMC[2013] = filterByIncome(year2013, \"UMC\");\n countries.UMC[2015] = filterByIncome(year2015, \"UMC\");\n countries.LMC[2009] = filterByIncome(year2009, \"LMC\");\n countries.LMC[2011] = filterByIncome(year2011, \"LMC\");\n countries.LMC[2013] = filterByIncome(year2013, \"LMC\");\n countries.LMC[2015] = filterByIncome(year2015, \"LMC\");\n\n function sumByYear(year) {\n return year.reduce((total, key) => {\n return total + Number(key.Tasso);\n }, 0);\n }\n mediaHIC.push(\n sumByYear(countries.HIC[2009]),\n sumByYear(countries.HIC[2011]),\n sumByYear(countries.HIC[2013]),\n sumByYear(countries.HIC[2015])\n );\n mediaUMC.push(\n sumByYear(countries.UMC[2009]),\n sumByYear(countries.UMC[2011]),\n sumByYear(countries.UMC[2013]),\n sumByYear(countries.UMC[2015])\n );\n mediaLMC.push(\n sumByYear(countries.LMC[2009]),\n sumByYear(countries.LMC[2011]),\n sumByYear(countries.LMC[2013]),\n sumByYear(countries.LMC[2015])\n );\n\n detailedYear2015.forEach((key) => {\n switch (key.Posizione) {\n case \"AP\":\n ap += Number(key.Tasso);\n apVal += Number(key.Valore);\n continents.AP.push(Number(key.Tasso));\n break;\n case \"CEE\":\n case \"WE\":\n eu += Number(key.Tasso);\n euVal += Number(key.Valore);\n continents.EU.push(Number(key.Tasso));\n break;\n case \"LA\":\n la += Number(key.Tasso);\n laVal += Number(key.Valore);\n continents.LA.push(Number(key.Tasso));\n break;\n case \"MEA\":\n me += Number(key.Tasso);\n meVal += Number(key.Valore);\n continents.ME.push(Number(key.Tasso));\n break;\n case \"NA\":\n na += Number(key.Tasso);\n naVal += Number(key.Valore);\n continents.NA.push(Number(key.Tasso));\n break;\n }\n });\n //HIC\n (mediaHIC[0] = Math.round(mediaHIC[0] / countries.HIC[2009].length)),\n (mediaHIC[1] = Math.round(\n mediaHIC[1] / countries.HIC[2011].length\n ));\n (mediaHIC[2] = Math.round(mediaHIC[2] / countries.HIC[2013].length)),\n (mediaHIC[3] = Math.round(\n mediaHIC[3] / countries.HIC[2015].length\n ));\n //UMC\n (mediaUMC[0] = Math.round(mediaUMC[0] / countries.UMC[2009].length)),\n (mediaUMC[1] = Math.round(\n mediaUMC[1] / countries.UMC[2011].length\n ));\n (mediaUMC[2] = Math.round(mediaUMC[2] / countries.UMC[2013].length)),\n (mediaUMC[3] = Math.round(\n mediaUMC[3] / countries.UMC[2015].length\n ));\n //LMC\n (mediaLMC[0] = Math.round(mediaLMC[0] / countries.LMC[2009].length)),\n (mediaLMC[1] = Math.round(\n mediaLMC[1] / countries.LMC[2011].length\n ));\n (mediaLMC[2] = Math.round(mediaLMC[2] / countries.LMC[2013].length)),\n (mediaLMC[3] = Math.round(\n mediaLMC[3] / countries.LMC[2015].length\n ));\n //per continents\n mediaAP = Math.round(ap / continents.AP.length);\n mediaEU = Math.round(eu / continents.EU.length);\n mediaLA = Math.round(la / continents.LA.length);\n mediaME = Math.round(me / continents.ME.length);\n mediaNA = Math.round(na / continents.NA.length);\n computeWealthCorrelation(year2015); //in this case only with data related to 2015 (latest)\n tassoMedioFasceGraph(mediaHIC, mediaUMC, mediaLMC);\n tassoMedioPercGraph(mediaAP, mediaEU, mediaLA, mediaME, mediaNA);\n valoreTotaleGraph(apVal, euVal, laVal, meVal, naVal);\n }", "function loadGraph (index, patient, organs, lines){\n // convert to cumulative\n // console.log(organs[choice])\n var converted = [];\n for(var i=0; i<lines.length; i++)\n {\n converted.push(convert(lines[i][index]));\n }\n\n // generate an array to pass in series options for all data sets\n var series = [];\n for(var i=0; i<converted.length; i++)\n {\n series.push({\n dragable: {\n color: '#ff3366',\n constrainTo: 'y'\n },\n markerOptions: {\n show: false,\n size: 2\n },\n label: organs[i]\n });\n }\n /////////////\n //BAR CHART//\n /////////////\n var bars = [];\n var barcolors = [];\n var k = 0;\n console.log(organs.length)\n for(var i=0; i<organs.length ; i++)\n {\n var testStr = organs[i];\n if(testStr.includes('otal')){ // 'Heart', 'Left Lung', 'Right Lung', 'Esophagus', 'PTV'\n bars.push([organs[i], returnPRP(converted[i])]);\n barcolors[k] = colors[i];\n k = k+1;};\n //colors[i] = \"#00FFFF\";\n //if(organs[i] === 'Right Lung') // 'Heart', 'Left Lung', 'Right Lung', 'Esophagus', 'PTV'\n // bars.push([organs[i], returnPRS(converted[i])]);\n if(testStr.includes('soph')){ // 'Heart', 'Left Lung', 'Right Lung', 'Esophagus', 'PTV'\n bars.push([organs[i], returnPRE(converted[i])]);\n barcolors[k] = colors[i];\n k = k+1;};\n //colors[i] = \"#7FFF00\";\n if(testStr.includes('eart')){ // 'Heart', 'Left Lung', 'Right Lung', 'Esophagus', 'PTV'\n bars.push([organs[i], returnPRH(converted[i])]);\n barcolors[k] = colors[i];\n k = k+1;};\n //colors[i] = \"#FF0000\";\n if(testStr.includes('ord')) { // 'Heart', 'Left Lung', 'Right Lung', 'Esophagus', 'PTV'\n bars.push([organs[i], returnPRS(converted[i])]);\n barcolors[k] = colors[i];\n k = k+1;};\n //colors[i] = \"#FFA500\";\n if(testStr.includes('ana')) { // 'Heart', 'Left Lung', 'Right Lung', 'Esophagus', 'PTV'\n bars.push([organs[i], returnPRS(converted[i])]);\n barcolors[k] = colors[i];\n k = k+1;};\n //colors[i] = \"#FFA500\";\n }\n console.log(barcolors)\n console.log(k)\n plot2 = $.jqplot('ntcpbar', [bars], {\n seriesColors: colors,\n seriesDefaults: {\n renderer:$.jqplot.BarRenderer,\n pointLabels: { show: true },\n rendererOptions: {\n varyBarColor: true\n }\n },\n axes: {\n xaxis: {\n renderer: $.jqplot.CategoryAxisRenderer,\n decimal:0,\n },\n yaxis:{\n label:'NTCP (%)',\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\n }\n }\n });\n\n /////////////////////////\n //TREATMENT RANGE CHART//\n /////////////////////////\n var range = [maxLine[choice], minLine[choice], converted[choice]];\n\n // add another one to the series for the new line\n series.push({\n dragable: {\n color: '#ff3366',\n constrainTo: 'y'\n },\n markerOptions: {\n show: false,\n size: 2\n },\n label: 'Not seen'\n });\n\n // generate the jqplot\n // fills the area in between the max and min\n // also draws the currently selected line on top\n plot3 = $.jqplot('dvhrange', range, {\n title: 'Treatment Range of '+organs[choice],\n seriesColors: [colors[choice], colors[choice], '#000000'],\n axesDefaults: {\n pad: 1.05\n },\n fillBetween: {\n series1: 0,\n series2: 1,\n color: colors[choice],\n baseSeries: 0,\n fill: true\n },\n axes: {\n xaxis:{\n label:'Dose (cGy)',\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\n min: 0,\n tickOptions: {\n mark: 'inside'\n },\n max: 8400\n },\n yaxis:{\n label:'Relative Volume',\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\n pad: 1.0,\n tickOptions: {\n mark: 'inside'\n }\n }\n },\n seriesDefaults: {\n rendererOptions: {\n smooth: true\n }\n },\n series: series\n });\n\n /////////////////////////\n //TRADEOFF RANGE CHART//\n /////////////////////////\n var tradeoff_range = [maxLine[choice], minLine[choice], maxLine[choice+1], minLine[choice+1]];\n // add another one to the series for the new line\n series.push({\n dragable: {\n //color: colors[choice] //'#ff3366',\n constrainTo: 'y'\n },\n markerOptions: {\n show: false,\n size: 2\n },\n label: 'Not seen'\n });\n\n // generate the jqplot\n // also draws the currently selected line on top\n plot4 = $.jqplot('dvhtradeoff', tradeoff_range, {\n title: 'Tradeoff of '+organs[choice]+' and '+organs[choice+1],\n seriesColors: [colors[choice], colors[choice], colors[choice+1], colors[choice+1]], // '#000000', '#000000'],\n axesDefaults: {\n pad: 1.05\n },\n fillBetween: {\n series1: 0,\n series2: 1,\n color: colors[choice],\n baseSeries: 0,\n fill: false\n },\n axes: {\n xaxis:{\n label:'Dose (cGy)',\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\n min: 0,\n tickOptions: {\n mark: 'inside'\n },\n max: 8400\n },\n yaxis:{\n label:'Relative Volume',\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\n pad: 1.0,\n tickOptions: {\n mark: 'inside'\n }\n }\n },\n seriesDefaults: {\n rendererOptions: {\n smooth: true\n }\n },\n series: series\n });\n\n\n\n // switch the Plugins on and off based on the chart being plotted\n $.jqplot.config.enablePlugins = true;\n // plot the data for the line chart\n plot(converted, series);\n // replot the data so graphs don't stack\n plot1.replot();\n $.jqplot.config.enablePlugins = false;\n plot2.replot();\n plot3.replot();\n plot4.replot();\n}", "function setupGraph() {\n var width = angular.element(el)[0].offsetWidth-65;\n\n var maxPages = d3.max(data, function(d) {\n return +d.book.num_pages;\n });\n\n graph.yScale = d3.scale.linear()\n .domain([0, maxPages])\n .range([width, 0]);\n\n graph.yAxis = d3.svg.axis()\n .scale(graph.yScale)\n .orient('left')\n .ticks(8);\n\n graph.xScale = d3.scale.ordinal()\n .domain(d3.range(data.length))\n .rangeBands([0, width], 0);\n\n // Colors\n graph.colorScale = d3.scale.linear()\n .domain([1,2,3,4,5])\n .range(['#C74131', '#D06559', '#77B789', '#CEE39E', '#9BC83B'])\n .interpolate(d3.interpolateHcl);\n }", "function initChart() {\n \n // Draw Links for Project 1\n var projectNumber = 1;\n // add link for each team member in project\n var linkProjects = chartGroup.append(\"g\")\n .attr(\"id\", \"linkProject\" + projectNumber);\n // Create links between teammates in project 1\n createLinksProject(groupProject1, linkProjects, projectNumber);\n\n // Draw Links for Project 2\n projectNumber = 2;\n // add link for each team member in project\n linkProjects = chartGroup.append(\"g\")\n .attr(\"id\", \"linkProject\" + projectNumber);\n // Create links between teammates in project 2\n createLinksProject(groupProject2, linkProjects, projectNumber);\n \n // Draw Links for Project 3\n projectNumber = 3;\n // add link for each team member in project\n var linkProjects = chartGroup.append(\"g\")\n .attr(\"id\", \"linkProject\" + projectNumber);\n // Create links between teammates in project 3\n createLinksProject(teams, linkProjects, projectNumber);\n\n // Create student circles for all the projects\n for(i=0; i<(numProjects+1); i++) {\n createGroupProject(chartGroup, i)\n }\n\n // Declare display string\n var display = ``\n // Append teams to display\n teams.forEach((team, ix) => {\n display = display + `Team ${ix+1}: ${team}<br>`\n });\n // Append Shuffle count to display string\n display = display + `<br><h6>Shuffle count: ${shuffleCounter}</h6>`;\n // render display in html\n d3.select(\"#displayNewTeams\").html(display);\n}", "function DrawDiagrams() {\n var selectedContractData = null;//selected contract from list of all Contracts (AppData.listOfContracts..)\n var rangeOfDataForCharts = [];\n //update selected Contract data when user searches for new Contract with Filters\n this.updateChangeSelectedContractData = function (inputNewData){\n selectedContractData = inputNewData\n }\n //update date range when user selects from datepicker\n this.updateDatepickerValue = function (inputDate_start, inputDate_end){\n var rangeArrayType = 'days';\n if (moment(inputDate_start).format('DD-MM-YYY') === moment(inputDate_end).format('DD-MM-YYY')){\n rangeArrayType = 'hours'\n }\n rangeOfDataForCharts = moment(inputDate_start).twix(inputDate_end, {allDay: true}).toArray(rangeArrayType);\n }\n //\n this.renderDiagrams = function (layoutType) {\n //check if we should render Tables or Graphs\n if (layoutType === appSettings.layoutEnums.tables) {\n return createContentForTables();\n } else if (layoutType === appSettings.layoutEnums.graphs) {\n return createContentForGraphs();\n } else {\n return '<div class=\"col-12\"><div class=\"card bg-light\"><div class=\"card-body text-center\"><i class=\"fas fa-info-circle\"></i> Start typing Contract ID or Mac Address to show data.</div></div></div>'\n }\n }\n /*\n START\n LOGIC FOR DRAWING TABLES\n */\n function createContentForTables () {\n //each column for TABLES will have it's template\n resetTableValuesBeforeRendering();\n var content_firstColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Overall Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">RSS Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Client RSS Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Sticky Client Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div><span class=\"c-card-title\">Interference Status - Overall</span>` + returnRandomBMGBadge() + `</div>\n <div><span class=\"c-card-title\">Interference Status Co- Channel</span>` + returnRandomBMGBadge() + `</div>\n <div><span class=\"c-card-title\">Interference Status - Adjecent</span>` + returnRandomBMGBadge() + `</div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference</span>\n <div class=\"row c-small-text-for-cards\">\n <div class=\"col-6\">UniFi` + returnRandomBMGBadge() + `</div>\n <div class=\"col-6\">Home` + returnRandomBMGBadge() + `</div>\n </div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Retransmission Status</span>` + returnRandomBMGBadge() + `\n <div class=\"c-small-text-for-cards\">HGw Number of retransmissions\n <span class=\"float-right\">` + returnRandomNumberInRange(4500, 5300) + `</span>\n </div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div class=\"c-small-text-for-cards\">Total Number of Clients\n <span class=\"float-right\">` + returnRandomNumberInRange(5, 200) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">Max. number of concurent clients\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 77) + `</span>\n </div> \n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Combined status</span>\n <div class=\"c-small-text-for-cards\">HGw Number of clients\n <span class=\"float-right\">` + returnRandomNumberInRange(10, 35) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">HGw Number of sticky clients\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 5) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">Data transfered [GB]\n <span class=\"float-right\">` + returnRandomNumberInRange(3, 35) + `</span>\n </div> \n </div></div>\n </div>`;\n var content_secondColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Bitrate [Mbps]</span>` + returnKpiTable('Bitrate', true) + `</div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div class=\"c-small-text-for-cards\">HGW total traffic [GB]\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 17) + `</span>\n </div> \n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw RSS</span>` + returnKpiTable('RSS [dBm]', true) + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference network RSS</span>` + returnKpiTable('RSS [dBm]', false) + `</div></div>\n </div>`;\n var content_thirdColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3 mt-1 mt-xl-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">WiFi connected time</span>` + returnPieChartPlaceholder(['Percent of time with connected user (s)']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\">\n <span class=\"c-card-title\">HGw Channel</span>\n <div class=\"c-small-text-for-cards c-xs\">Auto channel enabled: ` + returnYesNoIcon(selectedContractData.contractHgwInfo.autoChannelEnabled) +`</div>\n <div class=\"c-small-text-for-cards c-xs\">Current channel: ` + selectedContractData.contractHgwInfo.channel +`</div>\n <div class=\"c-small-text-for-cards c-xs\">No. of changes: ` + returnRandomNumberInRange(1,99) +`</div>\n <div>` + returnPieChartPlaceholder(['Auto: Yes', 'Auto: No']) + `</div>\n </div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw WiFi Usage</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Percent of time with Sticky Clients</span>` + returnPieChartPlaceholder(['Percent of time with sticky clients']) + `</div></div>\n </div> \n </div>\n </div>`;\n var content_fourthColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div> \n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Client's RSS Status</span>` + returnPieChartPlaceholder(['Good', 'Medium', 'Bad']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference Home</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw RSS Status</span>` + returnPieChartPlaceholder(['Good', 'Medium', 'Bad']) + `</div></div>\n </div> \n </div>\n </div>`; \n /* since we created placeholder containers (returnPieChartPlaceholder), we will start checking when those elements are added to DOM\n we want to attach PieChart graphs when those elements are added to DOM\n */\n startCheckingForAddedPiePlaceholders();\n //\n return (content_firstColumn + content_secondColumn + content_thirdColumn + content_fourthColumn);\n }\n //return random badge (Bad, Medium, Good..)\n function returnRandomBMGBadge () {\n var badgeBad = `<span class=\"badge badge-danger float-right\">Bad</span>`;\n var badgeMedium = `<span class=\"badge badge-warning float-right\">Medium</span>`;\n var badgeGood = `<span class=\"badge badge-success float-right\">Good</span>`;\n var badgeInvalid = `<span class=\"badge badge-secondary float-right\">Unavailable</span>`;\n var randomLevelInt = Math.floor(Math.random() * 3);\n switch (randomLevelInt) {\n case 0:\n return badgeBad\n case 1:\n return badgeMedium\n case 2:\n return badgeGood\n default:\n return badgeInvalid\n }\n }\n //Return random number in range\n function returnRandomNumberInRange (inputMinRange, inputMaxRange) {\n return (Math.floor(Math.random() * (inputMaxRange - inputMinRange + 1)) + inputMinRange);\n }\n //Return table that is different from others (diferent template)\n function returnKpiTable (inputKpiName, inputShowColumnForMin) {\n var displayStyleForMinColumn = (inputShowColumnForMin === true) ? '' : 'display:none;';\n var colorStyleForAvgColumn = (inputShowColumnForMin === true) ? 'color:#f00;' : '';\n var tableTemplate = `<div class=\"table-responsive table-borderless c-custom-table\"><table class=\"table table-striped\">\n <thead>\n <tr>\n <th>KPI Name</th>\n <th style=\"`+ displayStyleForMinColumn + `\">Min</th>\n <th>Avg</th>\n <th>Max</th>\n <th>Last</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>`+ inputKpiName + `</th>\n <td style=\"`+ displayStyleForMinColumn + `\">` + returnRandomNumberInRange(-50, 80) + `</td>\n <td style=\"`+ colorStyleForAvgColumn + `\">` + returnRandomNumberInRange(-50, 80) + `</td>\n <td>`+ returnRandomNumberInRange(-50, 80) + `</td>\n <td>`+ returnRandomNumberInRange(-50, 80) + `</td>\n </tr>\n </tbody>\n </table></div>`\n return tableTemplate;\n }\n //holds array of all pie charts that should be rendered on view\n var listOfAllPieChartElements = [];\n //used for temporary rendering of pie charts by removing each item that is rendered\n var remainingPieChartsForAdding = [];\n //create html element that will hold pie chart\n function returnPieChartPlaceholder (inputPieChartLegendTitles) {\n var idOfNewChartContainer = 'cid-pie-chart-holder-' + Math.random().toString(36).substr(2, 10);\n var newPieChartElement = {\n elementId: idOfNewChartContainer,\n chartLegend: inputPieChartLegendTitles\n }\n listOfAllPieChartElements.push(newPieChartElement);\n var templateToReturn = `<div id=\"` + idOfNewChartContainer + `\" style=\"width:100%;height:auto;min-height:200px;max-height:300px;\"></div>`;\n return templateToReturn;\n }\n //attach each pie chart to its html element\n function attachPieChartToPlaceholder (inputObjectWithData) {\n // Build the chart\n if (!inputObjectWithData || !inputObjectWithData.elementId || !inputObjectWithData.chartLegend) {\n return;\n }\n //\n Highcharts.chart(inputObjectWithData.elementId, {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false,\n type: 'pie'\n },\n exporting: {\n buttons: {\n contextButton: {\n menuItems: [\n 'printChart',\n 'downloadPNG',\n 'downloadJPEG',\n 'downloadPDF',\n 'downloadCSV'\n ]\n }\n }\n }, \n colors: ['#20fc8f', '#ffa100', '#ff5b58', '#27aae1', 'purple', 'brown'],\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: 'pointer',\n dataLabels: {\n enabled: false,\n //distance: -10\n },\n showInLegend: true\n }\n },\n title: false,\n legend: {\n width: 100,\n itemWidth: 100,\n itemStyle: {\n width: 100\n },\n align: 'left',\n verticalAlign: 'middle',\n layout: 'vertical'\n },\n series: [{\n colorByPoint: true,\n innerSize: '50%',\n data: returnOrganizedDataForPieChart(inputObjectWithData.chartLegend)\n }],\n tooltip: {\n formatter: function () {\n return this.key;\n }\n }\n });\n }\n //In here we are calculating data for each pie chart\n function returnOrganizedDataForPieChart (inputChartLegendAsArray) {\n //inputChartLegendAsArray will be list of labels that we inputed when we created placeholder element (returnPieChartPlaceholder('Low', 'Medium', 'High'))\n var tempArrayOfLabels = inputChartLegendAsArray;\n //\n var arrayOfLabelValues = [];\n var numberToDivideOnParts = 100;\n var x;\n for (x = 0; x < tempArrayOfLabels.length; x++) {\n var s = Math.round(Math.random() * (numberToDivideOnParts));\n numberToDivideOnParts -= s;\n if (x == (tempArrayOfLabels.length - 1) && (tempArrayOfLabels.length > 1) && (numberToDivideOnParts > 0)) {\n arrayOfLabelValues.push(s + numberToDivideOnParts);\n } else {\n arrayOfLabelValues.push(s);\n }\n }\n var dataToExport = []\n tempArrayOfLabels.forEach(function (item, index, object) {\n var newLabelObj = {\n name: tempArrayOfLabels[index] + \" \" + arrayOfLabelValues[index] + \"%\",\n y: arrayOfLabelValues[index]\n }\n dataToExport.push(newLabelObj);\n })\n if (tempArrayOfLabels.length == 1) {\n var newLabelObj = {\n name: \"Empty\",\n y: numberToDivideOnParts,\n color: \"#d3d3d3\"\n }\n dataToExport.push(newLabelObj);\n }\n return dataToExport;\n }\n //interval used for checking if all pie charts are added to dom\n var pieRenderedInterval = null;\n function startCheckingForAddedPiePlaceholders () {\n remainingPieChartsForAdding = JSON.parse(JSON.stringify(listOfAllPieChartElements));\n pieRenderedInterval = setInterval(checkForPieChartsAddedToView, 300)\n }\n function checkForPieChartsAddedToView () {\n remainingPieChartsForAdding.forEach(function (arrayItem, index, arrayObject) {\n if (document.getElementById(arrayItem.elementId)) {\n attachPieChartToPlaceholder(arrayItem);\n remainingPieChartsForAdding.splice(index, 1);\n }\n });\n if (remainingPieChartsForAdding.length < 1) {\n clearInterval(pieRenderedInterval);\n }\n }\n ///Return HGw Info table that will be displayed on view\n this.returnHgwInfoTable = function () {\n var tableTemplate = `<div class=\"card bg-dark mb-3\"><div class=\"card-body\">\n <div class=\"row\"><div class=\"col-12 text-center pb-3\"><span class=\"c-card-title\">HGw Info</span></div></div>\n <div class=\"row c-has-info-cards\">\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">WiFi enabled: <span class=\"float-right\"><b>`+ returnYesNoIcon(selectedContractData.contractHgwInfo.wifiEnabled) + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">HGw standard: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.hgwStandard + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">IP address: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.ipAddress + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">MAC: <span class=\"float-right\"><b>`+ selectedContractData.contractMacAddress + `</b></span></div></div></div>\n </div>\n <div class=\"row c-has-info-cards\">\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Contract No: <span class=\"float-right\"><b>`+ selectedContractData.contractNumber + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Auto channel enabled: <span class=\"float-right\"><b>`+ returnYesNoIcon(selectedContractData.contractHgwInfo.autoChannelEnabled) + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">SSID: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.ssid + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Security: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.security + `</b></span></div></div></div>\n </div>\n <div class=\"row c-has-info-cards\">\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Band: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.band + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Hidden SSID: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.hiddenSsid + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Bandwith: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.bandwith + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Up time: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.upTime + `</b></span></div></div></div>\n </div>\n <div class=\"row c-has-info-cards\">\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Equipment: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.equipment + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Description: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.description + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">CMTS ID: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.cmtsId + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Firmware: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.cmtsId + `</b></span></div></div></div>\n </div> \n </div></div>`\n return tableTemplate;\n }\n //return Yes/No with icon\n function returnYesNoIcon (inputBooleanValue){\n if (inputBooleanValue == true){\n return '<i class=\"fas fa-check text-success\"></i> Yes'\n }else{\n return '<i class=\"fas fa-ban text-danger\"></i> No'\n }\n }\n //reset all variables before rendering new content\n function resetTableValuesBeforeRendering (){\n listOfAllPieChartElements = [];\n remainingPieChartsForAdding = [];\n clearInterval(pieRenderedInterval);\n pieRenderedInterval = null;\n } \n /*\n START\n LOGIC FOR DRAWING GRAPHS \n */\n //reset all variables before rendering new Graph\n function resetGraphValuesBeforeRendering (){\n listOfAllGraphElements = [];\n remainingGraphsForAdding = [];\n clearInterval(graphsRenderedInterval);\n graphsRenderedInterval = null;\n }\n //crate html templates for each graph that will be diplayed on view\n function createContentForGraphs () {\n resetGraphValuesBeforeRendering();\n //first graph template\n var entireTemplateForGraphs = ``;\n AppData.listOfGraphsData.forEach(function (arrayItem, index, arrayObject) {\n var arrayItemWithDataSeriesAdded = returnDataSeriesForArrayItem(arrayItem); \n var tempGraphTemplate = \n `<div class=\"col-12 col-lg-6 mb-1\">\n <div class=\"card\"><div class=\"card-body\">` + returnGraphPlaceholder(arrayItemWithDataSeriesAdded) + `</div></div>\n </div>`;\n entireTemplateForGraphs = entireTemplateForGraphs + tempGraphTemplate;\n });\n /* since we created placeholder containers (returnGraphPlaceholder), we will start checking when those elements are added to DOM\n we want to attach Graphs when those elements are added to DOM\n */\n startCheckingForAddedGraphsPlaceholders();\n return entireTemplateForGraphs;\n }\n //create data series object used for HighCharts rendering options\n function returnDataSeriesForArrayItem(inputArrayItem){ \n inputArrayItem.series.forEach(function (arrayItem, index, arrayObject) {\n arrayItem.data = returnGraphDataBasedOnTimeRange();\n });\n\n return JSON.parse(JSON.stringify(inputArrayItem));\n }\n //Based on selected time range create some Graph data series\n function returnGraphDataBasedOnTimeRange (){\n var dataToReturn = []\n rangeOfDataForCharts.forEach(function (arrayItem, index, arrayObject) {\n var newSingleData = []\n var randomNumberOfData = returnRandomNumberInRange(7,20)\n var numB;\n for (numB=0;numB<randomNumberOfData;numB++){\n newSingleData.push(arrayItem);\n newSingleData.push(returnRandomNumberInRange(1,200));\n }\n //\n dataToReturn.push(newSingleData);\n });\n ///\n return dataToReturn;\n }\n //array of all graphs that should be renderedn on view\n var listOfAllGraphElements = [];\n //temp array used to check if all arrays are binded to dom\n var remainingGraphsForAdding = [];\n //return html element template that will hold graph\n function returnGraphPlaceholder (inputGraphData) {\n var idOfNewGraphContainer = 'cid-graph-holder-' + Math.random().toString(36).substr(2, 10);\n var newGraphElement = {\n elementId: idOfNewGraphContainer,\n graphData: inputGraphData\n }\n listOfAllGraphElements.push(newGraphElement);\n var templateToReturn = `<div id=\"` + idOfNewGraphContainer + `\" style=\"width:100%;height:auto;min-height:300px;max-height:500px;\"></div>`;\n return templateToReturn;\n }\n //interval that will check until all graphs are binded to dom\n var graphsRenderedInterval = null;\n function startCheckingForAddedGraphsPlaceholders () {\n remainingGraphsForAdding = JSON.parse(JSON.stringify(listOfAllGraphElements));\n graphsRenderedInterval = setInterval(checkForGraphsAddedToView, 300)\n }\n function checkForGraphsAddedToView () {\n remainingGraphsForAdding.forEach(function (arrayItem, index, arrayObject) {\n if (document.getElementById(arrayItem.elementId)) {\n attachGraphToPlaceholder(arrayItem);\n remainingGraphsForAdding.splice(index, 1);\n }\n });\n if (remainingGraphsForAdding.length < 1) {\n clearInterval(graphsRenderedInterval);\n }\n }\n ////attach graph to placeholder html elemnt\n function attachGraphToPlaceholder (inputObjectWithData) {\n // Build the Graph chart\n if (!inputObjectWithData || !inputObjectWithData.elementId || !inputObjectWithData.graphData) {\n return;\n }\n Highcharts.chart(inputObjectWithData.elementId, inputObjectWithData.graphData);\n }\n /*\n START\n LOGIC FOR DRAWING 'Currently Viewing Data' table\n */\n this.renderCurrentlyViewingDataTable = function () {\n return `<div class=\"c-custom-viewing-data-table\"><table class=\"table table-sm\">\n <thead><tr><th colspan=\"2\">Currently viewing data for contract:</th></tr></thead>\n <tbody>\n <tr>\n <td>MAC address:</td>\n <td><b>` + selectedContractData.contractMacAddress + `</b></td>\n </tr>\n <tr>\n <td>Contract ID:</td>\n <td><b>` + selectedContractData.contractNumber + `</b></td>\n </tr>\n <tr>\n <td>City:</td>\n <td><b>` + selectedContractData.contractCity + `</b></td>\n </tr> \n </tbody>\n </table></div>`;\n } \n}", "function makeGraphs(error, transactionsData, transactionsDataAltered) {\n var List = [];\n \n var ndx = crossfilter(transactionsDataAltered);\n \n transactionsDataAltered.forEach(function(d){\n d.Amount = parseInt(d.Amount);\n });\n show_selectors(ndx);\n MakePieChart(ndx);\n \n\n}", "function createCharts() {\n var chartElements = {\n alphaBar: {\n title: \"Trust Alpha\",\n chosenClass: \"bar\",\n elements: '<div id=\"secondary-chart\"></div>' +\n '<div class=\"slider-label\">Slide to Filter</div>' +\n '<div id=\"primary-chart\"></div>',\n textData:textData[\"alphaBar\"],\n param: \"trust_factor\",\n chartGenerator: barChartGenerator\n },\n alphaScatter: {\n title: \"Citations vs. Popularity\",\n chosenClass: \"scatter-point\",\n elements: '<div id=\"primary-chart\"></div>',\n textData:textData[\"alphaScatter\"],\n param: null,\n chartGenerator: scatterChartGenerator\n },\n citationBar: {\n title: \"Citations in Wikipedia\",\n chosenClass: \"bar\",\n elements: '<div id=\"secondary-chart\"></div>' +\n '<div class=\"slider-label\">Slide to Filter</div>' +\n '<div id=\"primary-chart\"></div>',\n textData:textData[\"citationBar\"],\n param: \"link_count\",\n chartGenerator: barChartGenerator\n },\n connectionGraph: {\n title: \"Citation Connections in Wikipedia\",\n chosenClass: \"node\",\n elements: '<div id=\"primary-chart\"></div>',\n textData: textData[\"connectedGraph\"],\n param: null,\n chartGenerator: connectedGraphGenerator\n }\n\n };\n\n // loop through each chart and add to object to dict\n for (var chart in chartElements) {\n var elements = chartElements[chart];\n charts[chart] = new Chart(elements.title, elements.chosenClass, elements.elements, elements.textData, elements.param, elements.chartGenerator);\n }\n}", "function create_report() {\n // send ajax request to server\n var callback = function(responseText) {\n // tmp\n //myT = responseText;\n // end tmp\n // process response from server\n var tests = JSON.parse(responseText);\n google.charts.setOnLoadCallback( function () {\n drawAnnotations(tests);\n });\n }\n httpAsync(\"GET\", window.location.origin + '/star_tests.json' + window.location.search, callback);\n\n}", "function createGraph() {\n // Set our height and width after we load.\n var windowWidth = element[0].clientWidth;\n if (windowWidth <= 0) {\n return;\n }\n else if (windowWidth - myCfg.ExtraWidthX < 0) {\n myCfg.w = windowWidth;\n }\n else if (windowWidth - myCfg.ExtraWidthY < 0) {\n myCfg.h = windowWidth;\n }\n else {\n myCfg.w = element[0].clientWidth - myCfg.ExtraWidthX;\n myCfg.h = element[0].clientWidth - myCfg.ExtraWidthX;\n }\n\n // Creat the chart.\n RadarChart.draw(\"#graph\", scope.data, myCfg); // eslint-disable-line no-undef\n\n // Setup our click events.\n if (typeof scope.legend !== \"undefined\" && scope.legend !== null && scope.legend.length > 0) {\n // Get all legend text elements.\n var legendItems = element[0].querySelectorAll(\"text.legend\"),\n thisItem;\n\n // For each legend item found with matching text, set up our click bind.\n angular.forEach(scope.legend, function (l) {\n thisItem = [...legendItems].filter(e => e.textContent === l.name || e.textContent === l.name + ' (NA)');\n angular.forEach(thisItem, function (i) {\n angular.element(i).bind('click', l.click);\n });\n });\n }\n }", "function buildChart() {\n barChartData = {\n labels: [],\n datasets: []\n };\n var calculations = [];\n var labelSetup = [];\n for (i in currentChart.outlets) {\n calculations.push(calculateData(currentChart.outlets[i]));\n }\n var lowerBound = moment(currentChart.timePeriod[0]);\n while (lowerBound.isSameOrBefore(currentChart.timePeriod[1])) {\n labelSetup.push(lowerBound.format('YYYY-MM-DD'));\n lowerBound = lowerBound.add(1, 'days');\n }\n for (j in calculations) { //sep method\n switch (currentChart.type) {\n case 'bar':\n case 'doughnut':\n var dataList = {\n label: null,\n backgroundColor: getRandomColor(),\n borderColor: '#000000',\n data: []\n };\n break;\n case 'radar':\n case 'line':\n var dataList = {\n label: null,\n borderColor: getRandomColor(),\n data: []\n };\n break;\n default:\n console.log(\"something went wrong\");\n break;\n }\n for (k in outlets) {\n if (outlets[k].id === currentChart.outlets[j]) {\n dataList.label = outlets[k].name;\n }\n }\n for (var key in calculations[j]) {\n if (calculations[j].hasOwnProperty(key)) {\n if (barChartData.labels.indexOf(key) === -1) {\n if (typeof key !== \"undefined\") {\n barChartData.labels.push(key);\n }\n }\n dataList.data.push(calculations[j][key]);\n }\n }\n\n barChartData.datasets.push(dataList);\n }\n myChart.destroy();\n myChart = new Chart(ctx, {\n type: currentChart.type,\n data: barChartData,\n options: {\n responsive: true,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n}", "function genReport(data){\n var byweek = {};\n function groupweek(value, index, array){\n if(value.Owner === window.myName){\n var d = new Date(value['Datetime']);\n d = Math.floor(d.getTime()/weekfactor);\n byweek[d] = byweek[d] || [];\n byweek[d].push(value);\n }\n\n }\n data.map(groupweek);\n return byweek;\n}", "function createDashboardUm(data, data2) {\n\n /*\n * Loading all Units os Assessment and use this for populating\n * select box which will control the whole layout and all the visualizations\n * on this page\n */\n // Load all Unit of Assessment options\n //let uoas = dataManager.loadAllUoAs(data);\n var unis = dataManager.loadAllUniversities(data);\n\n // Populate the select box with the options\n (0, _populateSelections2.default)(unis);\n\n // Get the current selection from the select box\n var selectBox = document.getElementById('selector');\n selectBox.selectedIndex = 0;\n var selectedUoa = 'Business and Management Studies';\n var selectedUni = 'Anglia Ruskin University';\n\n /*\n * Creating the first visualization, which is a map of the UK,\n * with all the locations of the universities in a selected field (Unit\n * of Assessment) which is passed on as an argument from the selectbox\n */\n var hierarchical = new _hierarchical2.default(data2, data, selectedUoa, selectedUni, 'ShowUoA', false);\n\n var force = new _force2.default(data2, data, selectedUoa, selectedUni, 'ShowUoA', false);\n\n var barChart = new _hBarChart2.default(data, dataManager.getLocationByUoA(data, selectedUoa), selectedUoa, selectedUni, 'ShowUoA');\n\n // Create a horizontal stacked bar chart\n barChart.createChart();\n\n // Create the hierarchical sunburst chart\n hierarchical.createChart();\n\n // Create the force layout\n force.createChart();\n\n // Listen for changes on the selectbox and get the selected value\n selectBox.addEventListener('change', function (event) {\n selectedUni = selectBox.options[selectBox.selectedIndex].value;\n console.log(selectedUni);\n\n // Reload the map with the new dataset\n barChart.reload(selectedUni, selectedUoa, data, dataManager.getLocationByUoA(data, selectedUoa), 'ShowUoA');\n\n // Reload the force layout \n force.reload(selectedUni, selectedUoa, data, dataManager.getLocationByUoA(data, selectedUoa), 'ShowUoA');\n });\n}", "function populateGraph() {\n\n\t\t\t\t\tcolorClasses = Color.harmonious(data.numberOfSeries);\n\n\t\t\t\t\tvar paths = [];\n\t\t\t\t\tvar areaPoints = [];\n\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < data.numberOfSeries; seriesIndex++) {\n\t\t\t\t\t\tpaths.push([]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar dotElements = [];\n\n\t\t\t\t\tvar tracker;\n\t\t\t\t\tvar reversedKeys = data.keys.slice().reverse();\n\t\t\t\t\tvar reversedColorClasses = colorClasses.slice().reverse();\n\t\t\t\t\tif (data.numberOfSeries > 1) {\n\t\t\t\t\t\ttracker = generateXTracker(reversedColorClasses, reversedKeys);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar drawDots = (width / data.rows.length > Config.MINIMUM_SPACE_PER_DOT);\n\t\t\t\t\t\n\t\t\t\t\tdata.rows.forEach(function(dataItem, xValue) {\n\t\t\t\t\t\tvar alignedDots = [];\n\t\t\t\t\t\tvar xPixel = xScale.getPixel(xValue);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! dataItem.isFill) {\n\t\t\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < dataItem.ySeries.length; seriesIndex++) {\n\t\t\t\t\t\t\t\tif (dataItem.ySeries[seriesIndex] === null) continue;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar yPixel = yScale.getPixel(dataItem.ySeries[seriesIndex].runningTotal);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpaths[seriesIndex].push({\n\t\t\t\t\t\t\t\t\tx: xPixel,\n\t\t\t\t\t\t\t\t\ty: yPixel\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (drawDots) {\n\t\t\t\t\t\t\t\t\tvar dot = drawDot(xPixel, yPixel)\n\t\t\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t\t\t.addClass('with-stroke')\n\t\t\t\t\t\t\t\t\t\t.addClass('fm-line-stroke');\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\tif (dataItem.ySeries[seriesIndex].annotation) {\n\t\t\t\t\t\t\t\t\tvar annotationPosition = yPixel - 20;\n\t\t\t\t\t\t\t\t\tvar\tannotationOrientation = 'top';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar tooltipObject = new Tooltip(paper, 'fm-stacked-area-tooltip fm-annotation', colorClasses[seriesIndex]);\n\t\t\t\t\t\t\t\t\tvar tooltip = tooltipObject.render(dataItem.xLabel, dataItem.ySeries[seriesIndex].annotation);\n\t\t\t\t\n\t\t\t\t\t\t\t\t\ttooltipObject.setPosition(xPixel, annotationPosition, annotationOrientation);\n\t\t\t\t\t\t\t\t\ttooltipObject.show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (drawDots) {\n\t\t\t\t\t\t\t\t\tdotElements.push(dot);\n\t\t\t\t\t\t\t\t\talignedDots.push(dot);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\thoverAreas.append(drawHoverArea(dataItem, xValue, tracker, alignedDots)\n\t\t\t\t\t\t\t.attr({opacity: 0})\n\t\t\t\t\t\t\t.data('data', dataItem)\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tpaths.forEach(function(path, index) {\n\t\t\t\t\t\tvar closingPoints = [];\n\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\tclosingPoints.push({\n\t\t\t\t\t\t\t\tx: path[path.length - 1].x,\n\t\t\t\t\t\t\t\ty: yScale.end\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tclosingPoints.push({\n\t\t\t\t\t\t\t\tx: path[0].x,\n\t\t\t\t\t\t\t\ty: yScale.end\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (var pointIndex = paths[index - 1].length - 1; pointIndex >= 0; pointIndex--) {\n\t\t\t\t\t\t\t\tclosingPoints.push(paths[index - 1][pointIndex]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tareaPoints.push(path.concat(closingPoints));\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tvar lines = [];\n\t\t\t\t\tvar areas = [];\n\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < data.numberOfSeries; seriesIndex++) {\n\t\t\t\t\t\tlines.push(\n\t\t\t\t\t\t\tdrawLine(paths[seriesIndex], false)\n\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t.addClass('with-stroke')\n\t\t\t\t\t\t\t\t.addClass('fm-line-stroke')\n\t\t\t\t\t\t\t\t.addClass('no-fill')\n\t\t\t\t\t\t);\n\t\t\t\t\t\tareas.push(\n\t\t\t\t\t\t\tdrawLine(areaPoints[seriesIndex], false)\n\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t.attr({opacity: Config.AREA_OPACITY})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tareas.forEach(function(area) {\n\t\t\t\t\t\tgraphContent.append(area);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tlines.forEach(function(line) {\n\t\t\t\t\t\tgraphContent.append(line);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tdotElements.forEach(function(dot) {\n\t\t\t\t\t\tgraphContent.append(dot);\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\tif (tracker) {\n\t\t\t\t\t\tgraphContent.append(tracker.line);\n\t\t\t\t\t\tgraphContent.append(tracker.label);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.numberOfSeries > 1) {\n\t\t\t\t\t\tdrawKey(data.keys);\n\t\t\t\t\t}\n\t\t\t\t}", "function singleClickWeeklyFinalReportRender(graphImage){\n\t\trunReportAnimation(100); //of Step 11 which completed the data processing\n\n\t\t//Get staff info.\n\t\tvar loggedInStaffInfo = window.localStorage.loggedInStaffData ? JSON.parse(window.localStorage.loggedInStaffData) : {};\n\t\t\n\t\tif(jQuery.isEmptyObject(loggedInStaffInfo)){\n\t\t\tloggedInStaffInfo.name = 'Staff';\n\t\t\tloggedInStaffInfo.code = '0000000000';\n\t\t}\t\n\n\n\t\tvar reportInfo_branch = window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '';\n\t\tvar temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\n\t\tif(reportInfo_branch == ''){\n\t\t\tshowToast('System Error: Branch name not found. Please contact Accelerate Support.', '#e74c3c');\n\t\t\treturn '';\n\t\t}\n\n\t\tvar temp_address_modified = (window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '') + ' - ' + (window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name : '');\n\t\tvar data_custom_footer_address = window.localStorage.bill_custom_footer_address ? window.localStorage.bill_custom_footer_address : '';\n\n\t\tvar reportInfo_admin = loggedInStaffInfo.name;\n\t\tvar reportInfo_time = moment().format('h:mm a, DD-MM-YYYY');\n\t\tvar reportInfo_address = data_custom_footer_address != '' ? data_custom_footer_address : temp_address_modified;\n\n\n\t\tif(graphImage && graphImage != ''){\n\t\t\twindow.localStorage.graphImageDataWeekly = graphImage;\n\t\t}\n\t\telse{\n\t\t\twindow.localStorage.graphImageDataWeekly = '';\n\t\t}\n\n\n\t\tvar graphRenderSectionContent = '';\n\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\tif(fromDate != toDate){\n\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t}\n\t else{ //Render graph only if report is for a day\n\n\t if(graphImage){\n\n\t \tvar temp_image_name = reportInfo_branch+'_'+fromDate;\n\t \ttemp_image_name = temp_image_name.replace(/\\s/g,'');\n\n\t graphRenderSectionContent = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">WEEKLY SALES TREND</h1>'+\n\t '</div>'+\n\t '<div class=\"weeklyGraph\">'+\n\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/report_trend_images_repo/'+temp_image_name+'.png\" style=\"max-width: 90%\">'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\t }\n\n\t var fancy_report_title_name = reportInfo_branch+' - '+temp_report_title;\n\n\n\t //Quick Summary Content\n\t var quickSummaryRendererContent = '';\n\n\t var a = 0;\n\t while(reportInfoExtras[a]){\n\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+reportInfoExtras[a].name+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t a++;\n\t }\n\n\t //PENDING --> TOTAL CALCULATED ROUND OFFFFF\n\t console.log('PENDING API --> TOTAL CALCULATED ROUND OFFFFF')\n\n\t var b = 1; //first one contains total paid\n\t while(completeReportInfo[b]){\n\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+completeReportInfo[b].name+'</td><td class=\"tableQuickAmount\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t b++;\n\t }\n\n\n\t //Sales by Billing Modes Content\n\t var salesByBillingModeRenderContent = '';\n\t var c = 0;\n\t var billSharePercentage = 0;\n\t while(detailedListByBillingMode[c]){\n\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t salesByBillingModeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t c++;\n\t }\n\n\t var salesByBillingModeRenderContentFinal = '';\n\t if(salesByBillingModeRenderContent != ''){\n\t salesByBillingModeRenderContentFinal = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t '</div>'+\n\t '<div class=\"tableQuick\">'+\n\t '<table style=\"width: 100%\">'+\n\t '<col style=\"width: 70%\">'+\n\t '<col style=\"width: 30%\">'+\n\t salesByBillingModeRenderContent+\n\t '</table>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\n\t //Sales by Payment Types Content\n\t var salesByPaymentTypeRenderContent = '';\n\t var d = 0;\n\t var paymentSharePercentage = 0;\n\t while(detailedListByPaymentMode[d]){\n\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t salesByPaymentTypeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>';\n\t d++;\n\t }\n\n\t var salesByPaymentTypeRenderContentFinal = '';\n\t if(salesByPaymentTypeRenderContent != ''){\n\t salesByPaymentTypeRenderContentFinal = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t '</div>'+\n\t '<div class=\"tableQuick\">'+\n\t '<table style=\"width: 100%\">'+\n\t '<col style=\"width: 70%\">'+\n\t '<col style=\"width: 30%\">'+\n\t salesByPaymentTypeRenderContent+\n\t '</table>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\n\n\n\n\t var temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\t var cssData = '<head> <style type=\"text/css\"> body{font-family:sans-serif;margin:0}#logo{min-height:60px;width:100%}.mainHeader{background:url(https://accelerateengine.app/clients/'+temp_licenced_client+'/pattern.jpg) #c63931;width:100%;min-height:95px;padding:10px 0;border-bottom:2px solid #a8302b}.headerLeftBox{width:55%;display:inline-block;padding-left:25px}.headerRightBox{width:35%;float:right;display:inline-block;text-align:right;padding-right:25px}.headerAddress{margin:0 0 5px;font-size:14px;color:#e4a1a6}.headerBranch{margin:10px 0;font-weight:700;text-transform:uppercase;font-size:21px;padding:3px 8px;color:#c63931;display:inline-block;background:#FFF}.headerAdmin{margin:0 0 3px;font-size:16px;color:#FFF}.headerTimestamp{margin:0 0 5px;font-size:12px;color:#e4a1a6}.reportTitle{margin:15px 0;font-size:26px;font-weight:400;text-align:center;color:#3498db}.introFacts{background:0 0;width:100%;min-height:95px;padding:10px 0}.factsArea{display:block;padding:10px 25px;text-align:center}.factsBox{margin-right: 5px; width:20%;display:inline-block;text-align:left;padding:20px 15px;border:2px solid #a8302b;border-radius:5px;color:#FFF;height:65px;background:#c63931}.factsBoxFigure{margin:0 0 8px;font-weight:700;font-size:32px}.factsBoxFigure .factsPrice{font-weight:400;font-size:40%;color:#e4a1a6;margin-left:2px}.factsBoxBrief{margin:0;font-size:16px;color:#F1C40F;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.summaryTableSectionHolder{width:100%}.summaryTableSection{padding:0 25px;margin-top:30px}.summaryTableSection table{border-collapse:collapse}.summaryTableSection td{border-bottom:1px solid #fdebed}.tableQuick{padding:10px}.tableQuickHeader{min-height:40px;background:#c63931;border-bottom:3px solid #a8302b;border-top-right-radius:15px;color:#FFF}.tableQuickHeaderText{margin:0 0 0 25px;font-size:18px;letter-spacing:2px;text-transform:uppercase;padding-top:10px;font-weight:700}.smallOrderCount{font-size:80%;margin-left:15px;color:#aba9a9;font-style:italic;}.tableQuickBrief{padding:10px;font-size:16px;color:#a71a14}.tableQuickAmount{padding:10px;font-size:18px;text-align:right;color:#a71a14}.tableQuickAmount .price{font-size:70%;margin-right:2px}.tableGraphRow{position:relative}.tableGraph_Graph{width:30%;display:inline-block;text-align:center;float:right;margin-top:30px}.footerNote,.weeklyGraph{text-align:center;margin:0}.tableGraph_Table{padding:10px;width:65%;display:inline-block}.weeklyGraph{padding:25px;border:1px solid #f2f2f2;border-top:none}.footerNote{font-size:12px;color:#595959}@media screen and (max-width:1000px){.headerLeftBox{display:none!important}.headerRightBox{padding-right:5px!important;width:90%!important}.reportTitle{font-size:18px!important}.tableQuick{padding:0 0 5px!important}.factsArea{padding:5px!important}.factsBox{width:90%!important;margin:0 0 5px!important}.smallOrderCount{margin:0!important;display:block!important}.summaryTableSection{padding:0 5px!important}}</style> </head>';\n\t \n\n\t var finalReport_emailContent = '<html>'+cssData+\n\t\t '<body>'+\n\t\t '<div class=\"mainHeader\">'+\n\t\t '<div class=\"headerLeftBox\">'+\n\t\t '<div id=\"logo\">'+\n\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/email_logo.png\">'+\n\t\t '</div>'+\n\t\t '<p class=\"headerAddress\">'+reportInfo_address+'</p>'+\n\t\t '</div>'+\n\t\t '<div class=\"headerRightBox\">'+\n\t\t '<h1 class=\"headerBranch\">'+reportInfo_branch+'</h1>'+\n\t\t '<p class=\"headerAdmin\">'+reportInfo_admin+'</p>'+\n\t\t '<p class=\"headerTimestamp\">'+reportInfo_time+'</p>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '<div class=\"introFacts\">'+\n\t\t '<h1 class=\"reportTitle\">'+reportInfo_title+'</h1>'+\n\t\t '<div class=\"factsArea\">'+\n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(0)+' <span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Net Sales</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(netSalesWorth).toFixed(0)+'<span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Gross Sales</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+netGuestsCount+'</h1><p class=\"factsBoxBrief\">Guests</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+completeReportInfo[0].count+'</h1><p class=\"factsBoxBrief\">Bills</p></div>'+\n\t\t '</div>'+\n\t\t '</div>'+graphRenderSectionContent+\n\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t '<div class=\"summaryTableSection\">'+\n\t\t '<div class=\"tableQuickHeader\">'+\n\t\t '<h1 class=\"tableQuickHeaderText\">Quick Summary</h1>'+\n\t\t '</div>'+\n\t\t '<div class=\"tableQuick\">'+\n\t\t '<table style=\"width: 100%\">'+\n\t\t '<col style=\"width: 70%\">'+\n\t\t '<col style=\"width: 30%\">'+\n\t\t '<tr><td class=\"tableQuickBrief\" style=\"font-weight: bold;\">Gross Sales</td><td class=\"tableQuickAmount\" style=\"font-weight: bold;\"><span class=\"price\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t quickSummaryRendererContent+\n\t\t '<tr><td class=\"tableQuickBrief\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\">Net Sales</td><td class=\"tableQuickAmount\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\"><span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t '</table>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t salesByBillingModeRenderContentFinal+\n\t\t salesByPaymentTypeRenderContentFinal+\n\t\t '<div style=\"border-top: 2px solid #989898; padding: 12px; background: #f2f2f2;\">'+\n\t\t '<p class=\"footerNote\">www.accelerate.net.in | [email protected]</p>'+\n\t\t '</div>'+\n\t\t '</body>'+\n\t\t '<html>';\n\t}", "function print_graph2()\n{\n var page = document.getElementById('page');\n page.innerHTML='';\n\n// Draw Graph total income in 3 months\n\n row1 = document.createElement('div');\n row1.className = 'row';\n\n col11 = document.createElement('div');\n col11.className = 'col-lg-2';\n row1.appendChild(col11);\n\n vis1 = document.createElement('div');\n vis1.className = 'col-lg-8';\n vis1.id = 'vis1';\n vis1.style=\"width:100%;height:76%;max-height:470px\";\n row1.appendChild(vis1);\n page.appendChild(row1);\n\n\n // ajax for chart 1 - total income orders month1\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.abort();\n xhr.open(\"GET\",\"../print_data.php?action=pie_income_orders_month1\",true);\n xhr.onreadystatechange=function()\n {\n if ((xhr.status == 200) && (xhr.readyState == 4))\n {\n next2(xhr.response);\n }\n\n }\n xhr.send(null);\n\n // ajax for chart 1 - total income orders month2\n function next2(month1)\n {\n var xhr2;\n xhr2 = new XMLHttpRequest();\n xhr2.abort();\n xhr2.open(\"GET\",\"../print_data.php?action=pie_income_orders_month2\",true);\n xhr2.onreadystatechange=function()\n {\n if ((xhr2.status == 200) && (xhr2.readyState == 4))\n {\n next3(month1,xhr2.response)\n }\n\n }\n xhr2.send(null);\n }\n // ajax for chart 2 - total leads 3 months ago\n function next3(month1,month2)\n {\n var xhr3;\n xhr3 = new XMLHttpRequest();\n xhr3.abort();\n xhr3.open(\"GET\",\"../print_data.php?action=pie_income_orders_month3\",true);\n xhr3.onreadystatechange=function()\n {\n if ((xhr3.status == 200) && (xhr3.readyState == 4))\n {\n drawChart(month1,month2,xhr3.response);\n }\n }\n xhr3.send(null);\n }\n\n // drawing chart\n function drawChart(month1,month2,month3)\n {\n var data = google.visualization.arrayToDataTable([\n ['Period', 'Total Sales in ILS', { role: 'style' }],\n ['Last Month', parseInt(month1), 'gold'], // RGB value\n ['1 M - 2 M', parseInt(month2), 'silver'], // English color name\n ['2 M - 3 M', parseInt(month3), 'gold']]);\n\n var options =\n {\n title: \"Total Sales Segmentation\",\n width: '100%',\n height: '100%',\n is3D: true\n };\n var chart = new google.visualization.BarChart(document.getElementById(\"vis1\"));\n chart.draw(data, options);\n }\n}", "function drawCharts() {\n // Get total used in this year\n $.getJSON('get_dashboard_values', function (result) {\n createSpiderChart(result['registers']);\n var year_per = (Math.floor(result.total_used.year.value__sum)/15512066)*100;\n var month_per = (Math.floor(result.total_used.month.value__sum)/1292672)*100;\n\n var gauge1 = loadLiquidFillGauge(\"circle-1\", year_per);\n var gauge1 = loadLiquidFillGauge(\"circle-2\", month_per);\n });\n // Get raw debits\n $.getJSON('api/v1/CouncilmanDebits/?format=json&limit=99999999', function (result) {\n createHorizontalBarChart(sumDebitsByCNPJ(result['objects']));\n createTreeMapChart(sumDebitsByCostObject(result['objects']));\n createBarChart(sumDebitsByCouncilman(result['objects']));\n createDataTable(result['objects']);\n });\n}", "function makeAccountDataGraphs(error, account){\n\n var parseDate = d3.time.format(\"%Y-%m-%d\").parse;\n account.forEach(function(d){\n d.PaymentDate = parseDate(d.PaymentDate);\n });\n\n account.forEach(function(d){\n d.Account = parseInt(d.Account, 10);\n });\n\n account.forEach(function(d){\n d.Sum = parseInt(d.Sum, 10);\n });\n\n var ndx=crossfilter(account);\n salary_type_selector(ndx);\n cost_per_account(ndx);\n cost_per_type(ndx);\n cost_over_time(ndx);\n dc.renderAll();\n addKrCostOverTime();\n}", "function generate_plot(args){\n var cohort_ids = [];\n //create list of actual cohort models\n for(var i in args.cohorts){\n cohort_ids.push(args.cohorts[i].cohort_id);\n }\n var plotFactory = Object.create(plot_factory, {});\n\n var plot_element = $(\"[worksheet_id='\"+args.worksheet_id+\"']\").parent().parent().find(\".plot\");\n var plot_loader = plot_element.find('.plot-loader');\n var plot_area = plot_element.find('.plot-div');\n var plot_legend = plot_element.find('.legend');\n var pair_wise = plot_element.find('.pairwise-result');\n pair_wise.empty();\n plot_area.empty();\n plot_legend.empty();\n var plot_selector = '#' + plot_element.prop('id') + ' .plot-div';\n var legend_selector = '#' + plot_element.prop('id') + ' .legend';\n\n plot_loader.fadeIn();\n plot_element.find('.resubmit-button').hide();\n plotFactory.generate_plot({ plot_selector : plot_selector,\n legend_selector : legend_selector,\n pairwise_element : pair_wise,\n type : args.type,\n x : args.x,\n y : args.y,\n color_by : args.color_by,\n gene_label : args.gene_label,\n cohorts : cohort_ids,\n color_override : false}, function(result){\n if(result.error){\n plot_element.find('.resubmit-button').show();\n }\n\n plot_loader.fadeOut();\n });\n }", "function generateReport(options, successCallback) {\n Database.getFullPlan(options.plan, function success(plan) {\n // Initialise data objects\n var resultsMatrix = {};\n var calc = {total: 0, pass: 0, fail: 0, pending: 0};\n Database.getAllWhere(\"results\", \"plan\", options.plan, function(results) {\n // Organise results so they can be accessed by page and criterion ID\n results.forEach(function(result) {\n resultsMatrix[result.page] = resultsMatrix[result.page] || {};\n resultsMatrix[result.page][result.criterion] = result;\n });\n // Generate the report and pass it back as a string\n successCallback(\"<h1>Web Accessibility Report (\" + plan.details.name + \")</h1>\" +\n \"<h4>Generated: \" + Date() + \"</h4>\" +\n \"<hr>\" +\n // Go through each pages group\n plan.pages.map(function(pages_group) {\n return \"<h2>Web page group: \" + pages_group.name + \"</h2>\" +\n \"<ul>\" +\n (pages_group.items.length ?\n // List all pages in this group\n pages_group.items.map(function(page) {\n return \"<li>\" + page.title + \" (\" + page.url + \")</li>\";\n }).join(\"\") +\n \"</ul>\" +\n // Go through each criteria group\n plan.criteria.map(function(criteria_group) {\n return \"<h3>Criteria set: \" + criteria_group.name + \"</h3>\" +\n \"<ul>\" +\n (criteria_group.items.length ?\n // Go through each criterion in this group\n criteria_group.items.map(function(criterion) {\n return \"<li>\" +\n // Include criterion details (where they exist and are requested in the options)\n \"<h4>\" + criterion.name + \"</h4>\" +\n \"<p>\" + criterion.description.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n (options.criteria_details ?\n \"<h5>Why is it important?</h5>\" +\n \"<p>\" + criterion.reasoning.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n \"<h5>Guidance</h5>\" +\n \"<p>\" + criterion.guidance.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n \"<h5>Documentation</h5>\" +\n \"<p>\" + criterion.links.map(function(link) { return \"<a href='\" + link + \"' target='_blank'>\" + link + \"</a>\"; }).join(\"<br>\") + \"</p>\"\n : \"\") +\n \"<h4>Results</h4>\" +\n // Work out result totals for all pages in this group\n pages_group.items.map(function(page, index) {\n if (index == 0) calc.total = calc.pass = calc.fail = calc.pending = 0;\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n if (options.statuses.indexOf(result.status) != -1) {\n calc.total++;\n calc[result.status]++;\n }\n return \"\";\n }).join(\"\") +\n // Calculate percentages from result totals (for status requested in the options)\n options.statuses.map(function(status) {\n return status.charAt(0).toUpperCase() + status.slice(1) + \": \" + calc[status] + \"/\" + calc.total + \" (\" + (calc.total > 0 ? (Math.round(calc[status] / calc.total * 100) + \"%\") : \"n/a\") + \")<br>\";\n }).join(\"\") +\n (options.level == \"individual\" ?\n // Include information about each individual test on each page (if requested in the options)\n \"<br><ul>\" +\n pages_group.items.map(function(page) {\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n // Only include this test result is it has one of the statuses requested\n return (options.statuses.indexOf(result.status) != -1) ?\n \"<li>\" +\n page.title + \" (\" + page.url + \") - \" + result.status +\n (options.results_annotations && result.annotation ?\n \"<p>\" + result.annotation.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\"\n : \"\") +\n (options.results_images && result.image ?\n \"<p><img src='\" + result.image + \"'></p>\"\n : \"\") +\n \"</li>\"\n : \"\";\n }).join(\"\") +\n \"</ul>\"\n : \"\") +\n \"</li>\";\n }).join(\"\")\n : \"<li><em>No criteria</em></li>\") +\n \"</ul>\" +\n \"\";\n }).join(\"\") +\n (options.tables ?\n // Create a table overview of tests on all the pages in this group\n \"<table border='1' cellspacing='2' cellpadding='2'>\" +\n \"<tr>\" +\n \"<th></th>\" +\n // List all pages on the x-axis\n pages_group.items.map(function(page) {\n return \"<th>\" + page.title + \"</th>\";\n }).join(\"\") +\n \"</tr>\" +\n plan.criteria.map(function(criteria_group) {\n // Include criteria group names\n return \"<tr><td><strong>\" + criteria_group.name + \"</strong></td></tr>\" +\n (criteria_group.items.length ?\n // Go through each criterion in the group\n criteria_group.items.map(function(criterion) {\n return \"<tr>\" +\n \"<td>\" + criterion.name + \"</td>\" +\n pages_group.items.map(function(page) {\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n return \"<td>\" +\n (options.statuses.indexOf(result.status) != -1 ?\n // Include tick icon for passing results\n (result.status == \"pass\" ? \"<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMZJREFUOE/FjjEKwkAQRWezdiFJZ29toWfwEoJ6Bw/hRYR4Jru0whYO2AU06B+Z1Y1F1gTEB0N2d/77hP5CwYWV0Ws/REw4KWV6l+ScW8OmJKa7DEr2uoqTcdaSMTfLdqPrbiCKfPiQ17omco2T0FivLczZWAgtGb/+lqumEnmHhcNM9flJVBZU9oFXyVeygIItlk0QdHib4RuXPRCWCNWBcA3O3bIHJQuEL4Ho5ZVG4iA8h3QaJHsgTSAfB8melNORHn8N0QMwhI66An4NAgAAAABJRU5ErkJggg=='> \" : \"\") +\n // Include cross icon for failing results\n (result.status == \"fail\" ? \"<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAKpJREFUOE+lU0EKgCAQ3CD7pPSK+kDQrd7qJehgkO2sJFHqoR0YCHdmWlclIBwHubYdXNctm7WNLGaAGjTQwiMI3kcz0ckMzph1n+dPCNZQEw20CGEvzGMy30TINKUQfD/MNxEyErf0LkSyYev7BsyYI9lLVYExizBfkx/UWiyTtc8tCl5DKhPmzJAFckyllkGu1Y5ZF6DagmqI6mNUXyT1VVY/JuD/cya6APHAd2wGj7MPAAAAAElFTkSuQmCC'> \" : \"\") +\n result.status.charAt(0).toUpperCase() + result.status.slice(1)\n : \"\") +\n \"</td>\";\n }).join(\"\") +\n \"</tr>\";\n }).join(\"\")\n : \"<tr><td colspan='\" + (pages_group.items.length + 1) + \"'><em>No criteria</em></td></tr>\")\n }).join(\"\") +\n \"</table>\"\n : \"\")\n : \"<li><em>No pages</em></li></ul>\");\n }).join(\"\") +\n \"\" +\n \"\");\n });\n });\n}", "function contentLiveReport() {\n\n if (arrLiveReports.length === 0) {\n $(\"#contentLiveReportPage\").html(`<div class=\"liveReportMsg\"> You must select at least one coin to receive Live Report. </div>`);\n }\n\n else {\n\n $(\"#contentLiveReportPage\").html(` <div id=\"chartContainer\" style=\"height: 300px; width: 100%;\"></div>`);\n waitLoad(\"chartContainer\");\n let arrCoinLive1 = [];\n let arrCoinLive2 = [];\n let arrCoinLive3 = [];\n let arrCoinLive4 = [];\n let arrCoinLive5 = [];\n let arrCoinNameLive = [];\n\n function getData() {\n \n $.ajax({\n\n type: \"GET\",\n url: `https://min-api.cryptocompare.com/data/pricemulti?fsyms=${arrLiveReports[0]},${arrLiveReports[1]},${arrLiveReports[2]},${arrLiveReports[3]},${arrLiveReports[4]}&tsyms=USD`,\n\n success: function (result) {\n\n let dateNow = new Date();\n let counter = 1;\n arrCoinNameLive = [];\n\n for (let key in result) {\n\n if (counter === 1) {\n arrCoinLive1.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 2) {\n arrCoinLive2.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 3) {\n arrCoinLive3.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 4) {\n arrCoinLive4.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 5) {\n arrCoinLive5.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n counter++;\n }\n\n createGraph();\n\n }\n\n })\n\n }\n \n stopIntervalId = setInterval(() => {\n getData();\n }, 2000);\n \n // function to create the graph //\n\n function createGraph() {\n\n const chart = new CanvasJS.Chart(\"chartContainer\", {\n exportEnabled: true,\n animationEnabled: false,\n\n title: {\n text: \"Favorite currencies\"\n },\n axisX: {\n valueFormatString: \"HH:mm:ss\",\n },\n axisY: {\n title: \"Coin Value\",\n suffix: \"$\",\n titleFontColor: \"#4F81BC\",\n lineColor: \"#4F81BC\",\n labelFontColor: \"#4F81BC\",\n tickColor: \"#4F81BC\",\n includeZero: true,\n },\n toolTip: {\n shared: true\n },\n legend: {\n cursor: \"pointer\",\n itemclick: toggleDataSeries,\n },\n data: [{\n type: \"spline\",\n name: arrCoinNameLive[0],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive1\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[1],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive2\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[2],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive3\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[3],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive4\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[4],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive5\n\n }]\n\n });\n\n chart.render();\n\n function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n }\n else {\n e.dataSeries.visible = true;\n }\n e.chart.render();\n }\n\n }\n\n }\n\n }", "function buildGraphs($scope) {\n buildWeekly();\n setWeekly($scope);\n\n buildMonthly();\n buildYearly();\n}", "function downloadGraph() {\n utils.prompt(\"Download Graph Output - Filename:\", 'Graph' + idProject, function (value) {\n if (value) {\n\n // put all of the pieces together into a downloadable file\n var saveData = (function () {\n var a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.style = \"display: none\";\n return function (data, fileName) {\n var blob = new Blob([data], {type: \"octet/stream\"});\n var url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = fileName;\n a.click();\n window.URL.revokeObjectURL(url);\n };\n }());\n\n // TODO: The chartStyle contains 16 CSS errors. These need to be addressed.\n var svgGraph = document.getElementById('serial_graphing'),\n pattern = new RegExp('xmlns=\"http://www.w3.org/2000/xmlns/\"', 'g'),\n findY = 'class=\"ct-label ct-horizontal ct-end\"',\n chartStyle = '<style>.ct-perfect-fourth:after,.ct-square:after{content:\"\";clear:both}.ct-label{fill:rgba(0,0,0,.4);color:rgba(0,0,0,.4);font-size:.75rem;line-height:1}.ct-grid-background,.ct-line{fill:none}.ct-chart-line .ct-label{display:block;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.ct-chart-donut .ct-label,.ct-chart-pie .ct-label{dominant-baseline:central}.ct-label.ct-horizontal.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{-webkit-box-align:flex-start;-webkit-align-items:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-vertical.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-end;-webkit-justify-content:flex-end;-ms-flex-pack:flex-end;justify-content:flex-end;text-align:right;text-anchor:end}.ct-label.ct-vertical.ct-end{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-grid{stroke:rgba(0,0,0,.2);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:10px;stroke-linecap:round}.ct-line{stroke-width:4px}.ct-area{stroke:none;fill-opacity:.1}.ct-series-a .ct-line,.ct-series-a .ct-point{stroke: #00f;}.ct-series-a .ct-area{fill:#d70206}.ct-series-b .ct-line,.ct-series-b .ct-point{stroke: #0bb;}.ct-series-b .ct-area{fill:#f05b4f}.ct-series-c .ct-line,.ct-series-c .ct-point{stroke: #0d0;}.ct-series-c .ct-area{fill:#f4c63d}.ct-series-d .ct-line,.ct-series-d .ct-point{stroke: #dd0;}.ct-series-d .ct-area{fill:#d17905}.ct-series-e .ct-line,.ct-series-e .ct-point{stroke-width: 1px;stroke: #f90;}.ct-series-e .ct-area{fill:#453d3f}.ct-series-f .ct-line,.ct-series-f .ct-point{stroke: #f00;}.ct-series-f .ct-area{fill:#59922b}.ct-series-g .ct-line,.ct-series-g .ct-point{stroke:#c0c}.ct-series-g .ct-area{fill:#0544d3}.ct-series-h .ct-line,.ct-series-h .ct-point{stroke:#000}.ct-series-h .ct-area{fill:#6b0392}.ct-series-i .ct-line,.ct-series-i .ct-point{stroke:#777}.ct-series-i .ct-area{fill:#f05b4f}.ct-square{display:block;position:relative;width:100%}.ct-square:before{display:block;float:left;content:\"\";width:0;height:0;padding-bottom:100%}.ct-square:after{display:table}.ct-square>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fourth{display:block;position:relative;width:100%}.ct-perfect-fourth:before{display:block;float:left;content:\"\";width:0;height:0;padding-bottom:75%}.ct-perfect-fourth:after{display:table}.ct-perfect-fourth>svg{display:block;position:absolute;top:0;left:0}.ct-line {stroke-width: 1px;}.ct-point {stroke-width: 2px;}text{font-family:sans-serif;}</style>',\n svgxml = new XMLSerializer().serializeToString(svgGraph);\n\n svgxml = svgxml.replace(pattern, '');\n\n // TODO: Lint is complaining about the search values. Should they be enclosed in quotes?\n // No: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n svgxml = svgxml.replace(/foreignObject/g, 'text');\n svgxml = svgxml.replace(/([<|</])a[0-9]+:/g, '$1');\n svgxml = svgxml.replace(/xmlns: /g, '');\n svgxml = svgxml.replace(/span/g, 'tspan');\n svgxml = svgxml.replace(/x=\"10\" /g, 'x=\"40\" ');\n\n svgxml = svgxml.substring(svgxml.indexOf('<svg'), svgxml.length - 6);\n var foundY = svgxml.indexOf(findY);\n var theY = parseFloat(svgxml.substring(svgxml.indexOf(' y=\"', foundY + 20) + 4, svgxml.indexOf('\"', svgxml.indexOf(' y=\"', foundY + 20) + 4)));\n var regY = new RegExp('y=\"' + theY + '\"', 'g');\n svgxml = svgxml.replace(regY, 'y=\"' + (theY + 12) + '\"');\n var breakpoint = svgxml.indexOf('>') + 1;\n svgxml = svgxml.substring(0, breakpoint) + chartStyle + svgxml.substring(breakpoint, svgxml.length);\n saveData(svgxml, value + '.svg');\n }\n });\n}", "function creategraph(obj) {\n\t\tobj._color.domain(\"Sensor_\"+obj.id);\n\t\t\n\t\t\n\t\tvar width;\n\t\tvar height;\n\t\t\n\n\t\tvar margin = {top: 10, right: 30, bottom: 20, left: 10};\n\n\t\twidth = obj.width - margin.left - margin.right;\n\t\theight = obj.height - margin.top - margin.bottom;\n\n\t\t// create the graph_temp object\n\t\tobj._graph = d3.select(\"#graph_\"+obj.id).append(\"svg\")\n\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\t.append(\"g\")\n\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\t\tobj._x = d3.scale.linear()\n\t\t.domain([0, MAX_DATA])\n\t\t.range([width, 0]);\n\t\tobj._y = d3.scale.linear()\n\t\t.domain([\n\t\td3.min(obj._series, function(l) { return d3.min(l.values, function(v) { return v*0.75; }); }),\n\t\td3.max(obj._series, function(l) { return d3.max(l.values, function(v) { return v*1.25; }); })\n\t\t])\n\t\t.range([height, 0]);\n\t\t//add the axes labels\n\t\tobj._graph.append(\"text\")\n\t\t.attr(\"class\", \"axis-label\")\n\t\t.style(\"text-anchor\", \"end\")\n\t\t.attr(\"x_\"+obj.id, 100)\n\t\t.attr(\"y_\"+obj.id, height)\n\n\n\n\t\tobj._line = d3.svg.line()\n\t\t.x(function(d, i) { return obj._x(i); })\n\t\t.y(function(d) { return obj._y(d); });\n\n\t\tobj._xAxis = obj._graph.append(\"g\")\n\t\t.attr(\"class\", \"x_\"+obj.id+\" axis\")\n\t\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t\t.call(d3.svg.axis().scale(obj._x).orient(\"bottom\"));\n\n\t\tobj._yAxis = obj._graph.append(\"g\")\n\t\t.attr(\"class\", \"y_\"+obj.id+\" axis\")\n\t\t.attr(\"transform\", \"translate(\" + width + \",0)\")\n\t\t.call(d3.svg.axis().scale(obj._y).orient(\"right\"));\n\n\t\tobj._ld = obj._graph.selectAll(\".series_\"+obj.id)\n\t\t.data(obj._series)\n\t\t.enter().append(\"g\")\n\t\t.attr(\"class\", \"series_\"+obj.id);\n\n\t\t// display the line by appending an svg:path element with the data line we created above\n\t\tobj._path = obj._ld.append(\"path\")\n\t\t.attr(\"class\", \"line\")\n\t\t.attr(\"d\", function(d) { return obj._line(d.values); })\n\t\t.style(\"stroke\", function(d) { return obj._color(d.name); });\n\t\t\n\t}", "function makeGraph(values, length, query_name, bin_size, start1, stop1) {\n /* console.log(\"Domain: \" + start1 + \",\" + stop1)\n console.log(values)\n console.log(values.length + \" total probes\")\n console.log(\"Start:\" + start1)\n console.log(\"Stop: \" + stop1)\n*/\n var formatCount = d3.format(\",.0f\");\n\n //set margins\n var margin = {top: 40, right: 30, bottom: 40, left: 40},\n width = 960 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom;\n\n //Round off length to nearest 1000000,100000, etc..\n if(length > 100000) {\n length = Math.ceil(length/100000)*100000\n }\n\n else if(length > 10000) {\n length = Math.ceil(length/10000)*10000\n }\n else if(length > 1000) {\n length = Math.ceil(length/1000)*1000\n }\n else if(length > 100) {\n length = Math.ceil(length/100)*100\n }\n\n var st, stp = 0\n\n //Figure out largest domain of all data to set as starting window\n if(start1 == 0 && stop1 == 0) {\n st = 0\n stp = length\n }\n else {\n st = start1\n stp = stop1\n }\n\n if(stop < stp) {\n stop = stp\n }\n\n if(start > st) {\n start = st\n }\n\n //Update text boxes\n $(\".start\").val(st)\n $(\".stop\").val(stp)\n\n var x = d3.scale.linear()\n .domain([st, stp])\n .range([0, width]);\n\n // Generate a histogram using uniformly-spaced bins.\n var data = d3.layout.histogram()\n .bins(x.ticks(bin_size))\n (values);\n\n //Calculate width of rectangles for bar representation\n barwidth = width/data.length - 2\n\n\n var y = d3.scale.linear()\n .domain([0, d3.max(data, function(d) {show_bin = d.dx; return d.y; })])\n .range([height, 0]);\n\n var xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\")\n .tickFormat(d3.format(\"d\"));\n\n\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .tickFormat(d3.format(\"d\"));\n\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) {\n return \"<strong>Frequency:</strong> <span style='color:red'>\" + d.y + \" probes (\" + d.x + \" - \" + (d.x+d.dx) + \")</span>\";\n })\n\n //Update bin size text box\n $(\"#b2\").text(\"Bin Size: \" + show_bin)\n\n\n\n //Main graph object\n var svg = d3.select(\"#tab5\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right + 30)\n .attr(\"height\", height + margin.top + margin.bottom + 30)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + (margin.left+30) + \",\" + margin.top + \")\");\n svgVar = svg;\n svg.call(tip);\n\n var bar = svg.selectAll(\".bar\")\n .data(data)\n .enter().append(\"g\")\n .attr(\"class\", \"bar\")\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.x) + \",\" + y(d.y) + \")\"; })\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .on('click', function(d){ redraw(d.x, d.x + d.dx);});\n\n //Create bars\n bar.append(\"rect\")\n .attr(\"x\", 1)\n .attr(\"width\", barwidth)\n .attr(\"height\", function(d) {return height - y(d.y); });\n\n //Create x axis\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n //Create y axis\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n //Label graph title\n svg.append(\"text\")\n .attr(\"x\", (width / 2)) \n .attr(\"y\", 0 - (margin.top / 2))\n .attr(\"text-anchor\", \"middle\") \n .style(\"font-size\", \"24px\") \n .style(\"text-decoration\", \"underline\") \n .text(query_name + \" Probe Distribution\");\n\n //Label graph x axis\n svg.append(\"text\") // text label for the x axis\n .attr(\"transform\", \"translate(\" + (width / 2) + \" ,\" + (height + margin.bottom + 15) + \")\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"20px\") \n .text(\"Position\");\n\n //Label graph y axis\n svg.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left - 15)\n .attr(\"x\",0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .style(\"font-size\", \"20px\") \n .style(\"text-anchor\", \"middle\")\n .text(\"# Probes\");\n\n $(\"#tab4\").append(\"<hr>\")\n }", "function renderPatientsJourneyChart(medicine) {\n $(\"#pharma_patientsjourney\").empty();\n\n let dataPJ = [];\n let maxWeeks = [];\n let minWeeks = [];\n\n\n dataPJ = analyticsPatientsJourney;\n maxWeeks = _.max(dataPJ, function(dataPJT) {\n return parseInt(dataPJT.Weeks);\n });\n minWeeks = _.min(dataPJ, function(dataPJT) {\n return parseInt(dataPJT.Weeks);\n });\n\n let groupedData = _.groupBy(dataPJ, 'MEDICATION');\n // console.log(dataPJ);\n let categoriesx = [];\n let seriesy = [];\n let maxvalue = maxWeeks.Weeks;\n let minvalue = minWeeks.Weeks;\n let plotBands = [];\n\n if (!($(\"#divWeekResponse input[type=radio]:checked\").val() == 'all' || $(\"#divWeekResponse input[type=radio]:checked\").val() == undefined)) {\n plotBands.push({\n from: 0,\n to: 8,\n color: '#EFFFFF',\n label: {\n text: 'Baseline',\n style: {\n color: '#999999'\n },\n y: 20\n }\n });\n\n let range = 0;\n range = $(\"#divWeekResponse input[type=radio]:checked\").val() == undefined ? 0 : $(\"#divWeekResponse input[type=radio]:checked\").val();\n if (range != 0) {\n var rangefrom = range.split('-')[0];\n var rangeto = range.split('-')[1];\n var from = 0,\n to = 0;\n dataPJ = dataPJ.filter(function(a) {\n return (parseInt(a.TREATMENT_PERIOD) >= parseInt(rangefrom) && parseInt(a.TREATMENT_PERIOD) <= parseInt(rangeto));\n });\n\n console.log(dataPJ);\n from = 8;\n to = parseInt(rangeto) + 8;\n plotBands.push({\n from: from,\n to: to,\n color: '#FFFFEF',\n label: {\n text: 'Treatment Period',\n style: {\n color: '#999999'\n },\n y: 20\n }\n });\n\n from = parseInt(rangeto) + 8;\n to = parseInt(maxvalue) + 8;\n\n plotBands.push({\n from: from,\n to: to,\n color: '#FFEFFF',\n label: {\n text: 'Follow-Up',\n style: {\n color: '#999999'\n },\n y: 20\n }\n });\n\n } else {\n\n from = 8;\n to = 16;\n\n plotBands.push({\n from: from,\n to: to,\n color: '#FFFFEF',\n label: {\n text: 'Treatment Period',\n style: {\n color: '#999999'\n },\n y: 20\n }\n });\n\n from = 16;\n to = parseInt(maxvalue) + 8;\n\n plotBands.push({\n from: from,\n to: to,\n color: '#FFEFFF',\n label: {\n text: 'Follow-Up',\n style: {\n color: '#999999'\n },\n y: 20\n }\n });\n }\n } // end of if condition for 'all' check\n\n // By Default if No radio button is selected, Select ALL\n if (!plotBands.length) {\n $(\"#divWeekResponse input[type=radio][value='all']\").prop('checked', true);\n }\n\n let ymaxvalue = 0;\n let xMaxValueCurr = 0;\n let xMaxValue = 0;\n let totalPatientsPerDrug = 0;\n if (chartMedication.length > 0) {\n for (let i = 0; i < chartMedication.length; i++) {\n let drugToBeFiltered = chartMedication[i];\n let jsonObj = {},\n filteredcount = [],\n dataweekcount = [];\n for (let week = parseInt(minvalue); week <= parseInt(maxvalue); week++) {\n let total = 0;\n\n filteredcount = dataPJ.filter(function(a) {\n // return (a.MEDICATION.toLowerCase().indexOf(drugToBeFiltered.toLowerCase()) > -1 && a.Weeks == week);\n return (a.MEDICATION.toLowerCase() == drugToBeFiltered.toLowerCase() && a.Weeks == week);\n });\n\n // Yurvaj (20th Feb 17): Switching back to PATIENT_ID_SYNTH\n let patientcount = _.pluck(filteredcount, 'PATIENT_ID_SYNTH');\n // let patientcount = _.pluck(filteredcount, 'IDW_PATIENT_ID_SYNTH');\n patientcount = _.uniq(patientcount).length;\n\n\n for (let j = 0; j < filteredcount.length; j++) {\n total = total + parseFloat(filteredcount[j].ViralLoad);\n }\n\n let valt = 0.0;\n\n if (filteredcount.length > 0 && total > 0)\n valt = Math.log(parseFloat(total / filteredcount.length)); // Math.log(parseFloat(total / filteredcount.length));\n\n if (valt < 0)\n valt = 0.0;\n\n // console.log(\"************* Week \" + week);\n // console.log(\"************* Total Viral Load \" + total);\n // console.log(\"************* Total Patient \" + filteredcount.length);\n // console.log(\"************* Total Unique Patient \" + patientcount);\n // console.log(\"************* Total Patient Increasing \" + totalPatientsPerDrug);\n\n\n // valt = parseFloat(valt).toFixed(2);\n\n // show only those points where data is available.\n //if(patientcount){\n xMaxValueCurr = week;\n dataweekcount.push({\n y: valt,\n patientcount: patientcount\n });\n // }\n\n totalPatientsPerDrug += patientcount;\n\n if (ymaxvalue < valt)\n ymaxvalue = valt;\n }\n\n if (xMaxValue < xMaxValueCurr) {\n xMaxValue = xMaxValueCurr;\n }\n\n var color = '';\n color = ['#D98880', '#D7BDE2', '#A9CCE3', '#A3E4D7', '#F7DC6F', '#B9770E', '#884EA0', '#D6EAF8', '#EDBB99', '#D98880', '#D7BDE2', '#A9CCE3', '#A3E4D7', '#F7DC6F', '#B9770E', '#884EA0', '#D6EAF8', '#EDBB99'];\n\n jsonObj['name'] = chartMedication[i];\n jsonObj['data'] = dataweekcount;\n jsonObj['color'] = color[i];\n seriesy.push(jsonObj);\n\n }\n\n // update Patatient Count\n $('.totalTreatmentEfficacyPatietnsPerDrug').html(commaSeperatedNumber(totalPatientsPerDrug));\n\n\n // console.log(seriesy);\n for (let week = parseInt(minvalue); week <= parseInt(maxvalue); week++) {\n categoriesx.push(week);\n }\n\n //console.log(seriesy);\n\n // Check if data is not available for selected Medications.\n let NoDataFlag = true;\n for (let i = 0; i < seriesy.length; i++) {\n if (seriesy[i].data.length != 0) {\n NoDataFlag = false;\n }\n }\n\n\n if (NoDataFlag) {\n $('#pharma_patientsjourney').html('<div class=\"providerNoDataFound\">No Data Available</div>');\n } else {\n Highcharts.chart('pharma_patientsjourney', {\n chart: {\n zoomType: 'xy'\n },\n title: {\n text: ' '\n\n },\n credits: {\n enabled: false\n },\n xAxis: {\n categories: categoriesx,\n title: {\n text: 'Weeks'\n },\n // min: 0,\n // max: (parseInt(xMaxValue) + 5),\n plotBands: plotBands\n },\n plotOptions: {\n series: {\n events: {\n legendItemClick: function() {\n var visibility = this.visible ? 'visible' : 'hidden';\n }\n }\n },\n line: {\n dataLabels: {\n enabled: true,\n formatter: function() {\n return Highcharts.numberFormat(this.y, 2) > 0 ? Highcharts.numberFormat(this.y, 2) : '';\n }\n }\n }\n },\n yAxis: {\n min: 0,\n max: (ymaxvalue + 5),\n // tickInterval: 1000,\n title: {\n text: 'Viral Load (in log)'\n },\n // labels: {\n // enabled: false,\n // format: yAxisData == '{value}'\n // },\n plotLines: [{\n value: 0,\n width: 1,\n color: '#808080'\n }]\n },\n // tooltip: {\n // valueSuffix: '°C'\n // },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'top',\n borderWidth: 0\n },\n\n series: seriesy,\n tooltip: {\n formatter: function() {\n var s = '<b> Week: </b>' + this.x;\n\n $.each(this.points, function() {\n s += '<br/><b>' + this.series.name + ': </b>' +\n this.y.toFixed(2);\n s += '<br/><b>Patient Count: </b>' +\n this.point.patientcount;\n });\n\n return s;\n },\n shared: true\n }\n });\n }\n\n\n }\n}", "function __process(reports) {\n\n var new_reports = _extract_and_sort_data(reports);\n return _generate_chart_data(new_reports);\n }", "generateChartsHTML() {\n\n\t\tlet plantingDate = new Date();\n\t\tlet harvestDate = new Date();\n\t\tlet harvestDateMin = new Date();\n\t\tlet harvestDateMax = new Date();\n\t\tlet rangeSelectorMin = new Date();\n\t\tlet rangeSelectorMax = new Date();\n\t\tlet ccChartDataArray = {}; // Associative array to store chart data\n\t\tlet biomassDates = [];\n\t\tlet biomassValues = [];\n\t\tlet cnDates = [];\n\t\tlet cnValues = [];\n\t\tlet cnMax = 60;\n\n\t\tlet cnRows = [];\n\t\tlet biomassRows = [];\n\n\t\tif (this.props.hasOwnProperty(\"userInputJson\") && this.props[\"userInputJson\"] !== null && this.props[\"userInputJson\"] !== undefined) {\n\n\t\t\tlet plantingYear = this.props[\"userInputJson\"][\"year_planting\"];\n\t\t\tlet harvestYear = plantingYear + 1;\n\t\t\tlet plantingDOY = this.props[\"userInputJson\"][\"doy_planting\"];\n\t\t\tlet harvestDOY = this.props[\"userInputJson\"][\"doy_harvest\"] - config.coverCropTerminationOffsetDays;\n\t\t\tplantingDate = new Date(plantingYear, 0, plantingDOY);\n\t\t\tharvestDate = new Date(harvestYear, 0, harvestDOY);\n\n\t\t\tharvestDateMin = new Date(harvestYear, 0, harvestDOY - (windowDurationDays/2));\n\t\t\tharvestDateMax = new Date(harvestYear, 0, harvestDOY + (windowDurationDays/2));\n\t\t\trangeSelectorMin = new Date(plantingYear, 0, plantingDOY - 1);\n\t\t\trangeSelectorMax = new Date(harvestYear, 0, harvestDOY + windowDurationDays);\n\t\t}\n\n\t\tccChartDataArray = this.state.ccDataArray;// generate charts for with cover crop case\n\t\tfor (let key in ccChartDataArray) {\n\t\t\tif(key.toString() === \"C:N ratio\"){\n\t\t\t\tif(ccChartDataArray[key].chartData !== undefined && ccChartDataArray[key].chartData.datasets.length) {\n\t\t\t\t\tcnRows = ccChartDataArray[key].chartData.datasets[0].data;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(key.toString() === \"TWAD\"){\n\t\t\t\tif(ccChartDataArray[key].chartData !== undefined && ccChartDataArray[key].chartData.datasets.length) {\n\t\t\t\t\tbiomassRows = ccChartDataArray[key].chartData.datasets[0].data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet prevCnDate = null;\n\n\t\tcnRows.forEach(function(element) {\n\t\t\tlet dt = element.x;\n\n\t\t\t// Adds 0s for missing date to make graph cleaner\n\t\t\tif(prevCnDate != null){\n\t\t\t\tlet dayDiff = calculateDayDifference(prevCnDate, dt);\n\t\t\t\twhile(dayDiff > 1){\n\t\t\t\t\tlet newDate = addDays(prevCnDate, 1);\n\t\t\t\t\tcnDates.push(newDate);\n\t\t\t\t\tcnValues.push(null);\n\t\t\t\t\tdayDiff--;\n\t\t\t\t\tprevCnDate = newDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcnDates.push(dt);\n\t\t\tcnValues.push(element.y);\n\t\t\tprevCnDate = element.x;\n\t\t});\n\n\t\tcnMax = Math.max(...cnValues);\n\t\tif(cnMax < 21){\n\t\t\tcnMax = 26;\n\t\t}\n\n\t\tlet prevBiomassDate = null;\n\t\tbiomassRows.forEach(function(element) {\n\t\t\tlet dt = element.x;\n\n\t\t\t// Adds 0s for missing date to make graph cleaner\n\t\t\tif(prevBiomassDate != null){\n\t\t\t\tlet dayDiff = calculateDayDifference(prevBiomassDate, dt);\n\t\t\t\twhile(dayDiff > 1){\n\t\t\t\t\tlet newDate = addDays(prevBiomassDate, 1);\n\t\t\t\t\tbiomassDates.push(newDate);\n\t\t\t\t\tbiomassValues.push(null);\n\t\t\t\t\tdayDiff--;\n\t\t\t\t\tprevBiomassDate = newDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbiomassDates.push(dt);\n\t\t\tbiomassValues.push(element.y);\n\t\t\tprevBiomassDate = element.x;\n\t\t});\n\n\n\t\tlet resultHtml = [];\n\t\tlet selectorOptions = {\n\t\t\tx: 0.01,\n\t\t\ty: 1.15,\n\t\t\tbuttons: [\n\t\t\t// \t{\n\t\t\t// \tstep: \"month\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"1m\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"month\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 6,\n\t\t\t// \tlabel: \"6m\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"year\",\n\t\t\t// \tstepmode: \"todate\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"YTD\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"year\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"1y\"\n\t\t\t// },\n\t\t\t\t{\n\t\t\t\tstep: \"all\",\n\t\t\t\tlabel: \"show all\"\n\t\t\t}],\n\n\t\t};\n\n\t\tlet biomass = {\n\t\t\tx: biomassDates, //[\"2019-01-01\", \"2019-03-01\", \"2019-06-01\", \"2019-09-03\"],\n\t\t\ty: biomassValues, //[0, 15, 19, 21],\n\t\t\tname: \"Plant Biomass\",\n\t\t\ttype: \"scatter\",\n\t\t\tmode: \"lines\",\n\t\t\tconnectgaps: false,\n\t\t\tline: {color: \"DeepSkyBlue\"}\n\t\t};\n\n\t\tlet cn = {\n\t\t\tx: cnDates, //[\"2019-01-01\", \"2019-03-01\", \"2019-06-01\", \"2019-09-03\"],\n\t\t\ty: cnValues, //[0, 3, 10, 13],\n\t\t\tname: \"C:N\",\n\t\t\tyaxis: \"y2\",\n\t\t\ttype: \"scatter\",\n\t\t\tmode: \"lines\", //lines+marks\n\t\t\tconnectgaps: false,\n\t\t\tline: {color: \"Orange\"}\n\t\t};\n\n\t\tlet data = [biomass, cn];\n\n\t\tlet highlightShapes = [\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: harvestDateMin,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: harvestDateMax,\n\t\t\t\ty1: 1,\n\t\t\t\tfillcolor: \"rgb(204, 255, 235)\", //\"LightYellow\",\n\t\t\t\topacity: 0.5,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 1, dash: \"dot\"}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"line\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: plantingDate,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: plantingDate,\n\t\t\t\ty1: 1.1,\n\t\t\t\tline: {width: 2}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"line\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: harvestDate,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: harvestDate,\n\t\t\t\ty1: 1.1,\n\t\t\t\tline: {width: 2}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"paper\",\n\t\t\t\tyref:\"y2\",\n\t\t\t\tx0: 0,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: 1,\n\t\t\t\ty1: 20,\n\t\t\t\tfillcolor: \"rgb(240, 240, 194)\",\n\t\t\t\topacity: 0.3,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 0.1}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"paper\",\n\t\t\t\tyref:\"y2\",\n\t\t\t\tx0: 0,\n\t\t\t\ty0: 20,\n\t\t\t\tx1: 1,\n\t\t\t\ty1: cnMax,\n\t\t\t\tfillcolor: \"rgb(240, 220, 220)\",\n\t\t\t\topacity: 0.3,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 0.1}\n\t\t\t},\n\t\t];\n\n\t\tlet annotations = [\n\t\t\t{\n\t\t\t\tx: plantingDate,\n\t\t\t\ty: 1.06,\n\t\t\t\txref: \"x\",\n\t\t\t\tyref: \"paper\",\n\t\t\t\ttext: \" IN \",\n\t\t\t\tborderpad: 4,\n\t\t\t\tbgcolor: \"SlateGray\",\n\t\t\t\tshowarrow: false,\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 14,\n\t\t\t\t\tcolor: \"White\"\n\t\t\t\t},\n\t\t\t\topacity: 0.8,\n\t\t\t\t// arrowhead: 3,\n\t\t\t\t// ax: -30,\n\t\t\t\t// ay: -40,\n\t\t\t\t//yanchor: \"top\",\n\t\t\t\txshift: -20\n\t\t\t},\n\t\t\t{\n\t\t\t\tx: harvestDate,\n\t\t\t\ty: 1.06,\n\t\t\t\txref: \"x\",\n\t\t\t\tyref: \"paper\",\n\t\t\t\ttext: \"OUT\",\n\t\t\t\tshowarrow: false,\n\t\t\t\tborderpad: 4,\n\t\t\t\tbgcolor: \"SlateGray\",\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 14,\n\t\t\t\t\tcolor: \"White\"\n\t\t\t\t},\n\t\t\t\topacity: 0.8,\n\t\t\t\t// arrowhead: 3,\n\t\t\t\t// ax: -30,\n\t\t\t\t// ay: -40,\n\t\t\t\t//yanchor: \"top\",\n\t\t\t\txshift: -22\n\n\t\t\t},\n\t\t\t// {\n\t\t\t// \ttext: \"Immobilization Begins<sup>*</sup>\",\n\t\t\t// \tshowarrow: true,\n\t\t\t// \tx: 0.5,\n\t\t\t// \ty: 20.25,\n\t\t\t// \tvalign: \"top\",\n\t\t\t// \txref:\"paper\",\n\t\t\t// \tyref: \"y2\",\n\t\t\t// \t// borderwidth: 1,\n\t\t\t// \t// bordercolor: \"black\",\n\t\t\t// \t// hovertext: \"Termination of CR with a C:N ratio ranging from 0-20 has the potential to result in soil N mineralization <br>\" +\n\t\t\t// \t// \t\"Termination of CR with a C:N ratio ranging >20 has the potential to result in soil N immobilization\",\n\t\t\t// }\n\t\t];\n\n\t\tlet layout = {\n\t\t\ttitle: \"Cover Crop Growth & C:N Prediction\",\n\t\t\twidth: 930,\n\t\t\theight: 600,\n\t\t\t// responsive: true,\n\t\t\txaxis: {\n\t\t\t\trangeselector: selectorOptions,\n\t\t\t\trangeslider: {borderwidth: 1},\n\t\t\t\trange: [rangeSelectorMin, rangeSelectorMax],\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tzeroline: true,\n\t\t\t\tticks: \"outside\"\n\t\t\t},\n\t\t\tyaxis: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: \"Plant Biomass (lb/acre)\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tcolor: \"DeepSkyBlue\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttickfont: {color: \"DeepSkyBlue\"},\n\t\t\t\tshowgrid: false,\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tticks: \"outside\"\n\t\t\t\t// range: [0,5000],\n\t\t\t\t// rangemode: \"tozero\"\n\t\t\t},\n\t\t\tyaxis2: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: \"C:N\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tcolor: \"Orange\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttickfont: {color: \"Orange\"},\n\t\t\t\toverlaying: \"y\",\n\t\t\t\tside: \"right\",\n\t\t\t\tshowgrid: false,\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tticks: \"outside\"\n\t\t\t},\n\t\t\tshapes: highlightShapes,\n\t\t\tannotations: annotations,\n\t\t\tlegend: {x:0.88, y: 1.40, borderwidth: 0.5}\n\t\t};\n\n\n\t\tresultHtml.push(\n\t\t\t\t\t<div >\n\t\t\t\t\t\t<Plot\n\t\t\t\t\t\t\tdata={data}\n\t\t\t\t\t\t\tlayout={layout}\n\t\t\t\t\t\t\tconfig={{\n\t\t\t\t\t\t\t\t\"displayModeBar\": false\n\t\t\t\t\t\t\t}}\n\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>);\n\n\t\treturn resultHtml;\n\t}", "function createGraph(params) {\n\n var startdate = params.date.getTime();\n var enddate = startdate + 1000*60*60*25;\n var n = (params.end - params.start)/params.incr;\n\n $.ajax({\n\turl: baseURL + \"station/\" + params.startStation + \n\t \"/to/\" + params.endStation + \"/\" + params.direction + \"?endDate=\" + enddate +\n\t \"&startDate=\" + startdate + \"&startTime=\" + params.start + \"&endTime=\" + \n\t (parseFloat(params.start)+parseFloat(params.offset)) + \"&\" + \"seriesTimeIncrement=\" + params.incr + \n\t \"&numberOfRuns=\" + n,\n\tdataType: 'jsonp',\n\ttimeout: 1000*60,\n\tsuccess: function( content ) {\n\t if (params.callback !== undefined) {\n\t\tparams.callback();\n\t }\n\n\t var data = [];\n\t var count = 0;\n\t for(var i=parseFloat(params.start);i<parseFloat(params.end);i+=parseFloat(params.incr)) {\n\t\tdata.push([i + params.offset, content[count]]);\n\t\tcount += 1;\n\t }\n\t \n\t renderChart(data, \n\t\t\t\"Time to \" + params.startStationName + \n\t\t\t\" to \" + params.endStationName,\n\t\t\tparams.element);\n\t}\n });\n}", "function createStyleSheet() {\n\tvar stylesheet = Banana.Report.newStyleSheet();\n\n var pageStyle = stylesheet.addStyle(\"@page\");\n pageStyle.setAttribute(\"margin\", \"15mm 15mm 15mm 25mm\");\n\n stylesheet.addStyle(\"body\", \"font-family : Arial\");\n\n\tstyle = stylesheet.addStyle(\".footer\");\n\tstyle.setAttribute(\"text-align\", \"center\");\n\tstyle.setAttribute(\"font-size\", \"8px\");\n\tstyle.setAttribute(\"font-family\", \"Courier New\");\n\t//style.setAttribute(\"border-top\", \"thin solid black\");\n\n\tstyle = stylesheet.addStyle(\".heading1\");\n\tstyle.setAttribute(\"font-size\", \"16px\");\n\tstyle.setAttribute(\"font-weight\", \"bold\");\n\n\tstyle = stylesheet.addStyle(\"table\");\n\tstyle.setAttribute(\"width\", \"100%\");\n\tstyle.setAttribute(\"font-size\", \"10px\");\n\tstylesheet.addStyle(\"table.table td\", \"padding-left:3px; padding-right:3px; padding-top:2px; padding-bottom:2px\");\n\t//stylesheet.addStyle(\"table.table td\", \"border: thin solid black;\");\n\n\tstyle = stylesheet.addStyle(\".borderBottom\");\n\tstyle.setAttribute(\"border-bottom\",\"thin solid black\");\n\n\tstyle = stylesheet.addStyle(\".bold\");\n\tstyle.setAttribute(\"font-weight\", \"bold\");\n\n\tstyle = stylesheet.addStyle(\".alignRight\");\n\tstyle.setAttribute(\"text-align\", \"right\");\n\n\tstyle = stylesheet.addStyle(\".alignCenter\");\n\tstyle.setAttribute(\"text-align\", \"center\");\n\n\tstyle = stylesheet.addStyle(\".underline\");\n\tstyle.setAttribute(\"text-decoration\", \"underline\");\n\n\tstyle = stylesheet.addStyle(\".font12\");\n\tstyle.setAttribute(\"font-size\", \"12px\");\n\t//style.setAttribute(\"border-bottom\", \"1px double black\");\n\n\treturn stylesheet;\n}", "function DrawReport(oJsonResult) {\n\n if (oJsonResult.ERROR != null) {\n window.alert(options.PluginName + \": Server error getting report:\\n\" + oJsonResult.ERROR);\n return;\n }\n\n try {\n\n //Get result table\n var oResultTable = oJsonResult.resultTable;\n\n //Get the DOM object displaying the result table\n var oPrintedTable = getReportTables(oResultTable, true/*Draw column names*/);\n\n //Add export to Excel link \n var oDivReportName = $(\".ReportDataExcel\", oContainer);\n applyExcelLinkWithPrintableColumns(oDivReportName, options);\n\n\n //Get template element to be populated by report \n var oDivReportData = $(\".ReportData\", oContainer);\n\n oDivReportData.html(oPrintedTable);\n\n }\n catch (errorMsg) {\n window.alert(options.PluginName + \": Error displaying report:\\n\" + errorMsg);\n }\n }", "function fillHistoryReport(visits) {\n\t$('#history-pane tbody').empty();\n\t$('#table-history').trigger('destroy.pager');\n\t$(\"#table-history\").trigger(\"update\"); //trigger an update after emptying\n\t//pad(number) function adds zeros in front of number, used to get consistent date / time display. \n\tfunction pad (number) {\n\t\treturn (\"00\" + number).slice(-2);\n\t}\n\n\tif(visits.length === 0) {\n\t\t$('#history-pane #visits').hide();\n\t\t$('#history-pane #no-visit').show();\n\t} else {\n\t\t$('#history-pane #no-visit').hide();\n\t\t$('#history-pane #visits').show();\n\t\t//for each visit found in the log add a row to the table\n\t\tvisits.forEach(function (visitElement) {\n\t\t\tif(visitElement) {\n\t\t\t\t//prepare the data for display\n\t\t\t\tvar visit = {};\n\t\t\t\t\n\t\t\t\tvar visitDate = new Date(+visitElement.timestamp);\n\t\t\t\tvisit.date = visitDate.getFullYear() + \"-\"+ \n\t\t\t\t\t\t\tpad((visitDate.getMonth()+1))+ \"-\" +\n\t\t\t\t\t\t\tpad(visitDate.getDate())+\" \"+\n\t\t\t\t\t\t\tpad(visitDate.getHours())+\":\"+\n\t\t\t\t\t\t\tpad(visitDate.getMinutes());\n\n\t\t\t\tvisit.title = decodeURI(visitElement.title);\n\t\t\t\t//visit.url = $('<a>', {'href': visitElement.url, 'text': removeUrlPrefix(visitElement.url)});\n\t\t\t\t//visit.url.attr(\"target\",\"_blank\");\n\n\t\t\t\t//create a row that will hold the data\n\t\t\t\tvar line = $('<tr>'); \n\t\t\t\t\n\t\t\t\t//for each attribute of the visit, create a table data element and put it in the row\n\t\t\t\tfor (var name in visit) {\n\t\t\t\t\tif (visit.hasOwnProperty(name)) {\n\t\t\t\t\t\tline.append($('<td>', {'text': visit[name]}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar url_cell=$('<td>').append($('<a>', {'href': decodeURI(visitElement.url), 'text': decodeURI(removeUrlPrefix(visitElement.url)), 'target':\"_blank\"}));\n\t\t\t\tline.append(url_cell);\n\t\t\t\t\n\t\t\t\t//append the line to the table\n\t\t\t\t$('#table-history')\n\t\t\t\t\t.find('tbody').append(line)\n\t\t\t\t\t.trigger('addRows',[$(line)]);\n\t\t\t}\n\t\t});\n\t\t$('#table-history').tablesorterPager(pagerOptions);\n\t\t$(\"#table-history\").trigger(\"update\"); //trigger update so that tablesorter reloads the table\n\t\t$(\".tablesorter-filter\").addClass(\"form-control input-md\");\n\t}\n}", "function generateDailyStats() {\n\n var widthDailyStats = dimension.dailyStatBarchartWidth,\n heightDailyStats = dimension.dailyStatBarchartHeight,\n padding = 30,\n yDomainDailyStats = ['00:00 AM - 4:00 AM', '04:00 AM - 8:00 AM', '08:00 AM- 12:00 PM', '12:00 PM - 16:00 PM', '16:00 PM- 20:00 PM', '20:00 PM - 00:00 AM'],\n fontFamilyDailyStatsText = \"sans-serif\",\n fontSizeDailyStatsText = \"12px\",\n fontfillDailyStatsText = \"white\",\n textAnchorDailyStatsText = \"middle\",\n rectangles, svgBlock,\n yScaleDailyStats,\n xScaleDailyStats,\n yAxis, axisGroup,\n barChartColorMap,\n toolTipDailyStatsText = \"This chart shows the average percentage of interactions done within the selected date.\" +\n \"When the chart starts moving this chart gradually shows the average percentage of interaction day after day until the final selected date\";\n\n\n var barchart = function (selection) {\n if (selection === 'undefined') {\n console.log(\"selection is undefined\");\n return;\n }\n //generate color scale for bar charts\n barChartColorMap = d3.scale.ordinal()\n .domain(yDomainDailyStats)\n .range(barChartColorRange);\n svgBlock = selection.append(\"g\")\n .attr(\"class\", \"svgDailyStats\")\n .attr(\"width\", widthDailyStats)\n .attr(\"height\", heightDailyStats);\n\n yScaleDailyStats = d3.scale.ordinal()\n .domain(yDomainDailyStats)\n .rangeRoundBands([padding, heightDailyStats - padding], 0.05);\n\n xScaleDailyStats = d3.scale.linear()\n .domain([0, d3.max(dailyTimeStatsPercentData, function (d) {\n return parseFloat(d);\n })])\n .range([0, widthDailyStats]);\n //add axis\n yAxis = d3.svg.axis()\n .scale(yScaleDailyStats)\n .orient(\"left\");\n axisGroup = selection.append(\"g\")\n .attr(\"class\", \"axisBarChart\")\n //.attr(\"transform\", \"translate(20,20)\")\n .call(yAxis)\n //add rectangles\n rectangles = svgBlock.selectAll(\"rect\")\n .data(dailyTimeStatsPercentData)\n .enter()\n .append(\"rect\")\n .attr({\n x: function (d, i) {\n return 0;\n },\n y: function (d, i) {\n return yScaleDailyStats(yDomainDailyStats[i]);\n },\n width: function (d) {\n return xScaleDailyStats(d);\n },\n height: yScaleDailyStats.rangeBand(),\n fill: function (d, i) {\n return barChartColorMap(yDomainDailyStats[i]);\n },\n })\n\n\n //add text\n svgBlock.selectAll(\"text\")\n .attr(\"class\", \"dailyStatus\")\n .data(dailyTimeStatsPercentData)\n .enter()\n .append(\"text\")\n .text(function (d) {\n return d\n })\n .attr(\"x\", function (d, i) {\n return xScaleDailyStats(d) - 15;\n })\n .attr(\"y\", function (d, i) {\n return yScaleDailyStats(yDomainDailyStats[i]) + yScaleDailyStats.rangeBand() / 1.5;\n })\n .attr(\"font-family\", fontFamilyDailyStatsText)\n .attr(\"font-size\", fontSizeDailyStatsText)\n .attr(\"fill\", fontfillDailyStatsText)\n .attr(\"text-anchor\", textAnchorDailyStatsText)\n\n\n //add title\n var dailyStatsChartTitle = \"(%) of Interactions vs Time\";\n var textElementDailyStatsChart = svgBlock.append(\"text\")\n .attr(\"class\", \"barChartTitle\")\n .attr(\"x\", (widthDailyStats / 2))\n .attr(\"y\", heightDailyStats)\n .attr(\"text-anchor\", textAnchorDailyStatsText)\n .style(\"font-size\", fontSizeDailyStatsText)\n .style(\"text-decoration\", \"underline\")\n .text(dailyStatsChartTitle);\n\n //Add tooltips to these chart titles\n //find the widht occupied by this text\n var bboxDailyStatsText = textElementDailyStatsChart.node().getBBox();\n\n var tooltipDailyStats = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"tooltip dailyStats\")\n .style(\"position\", \"absolute\")\n .style(\"z-index\", \"10\")\n .style(\"visibility\", \"hidden\")\n .text(toolTipDailyStatsText);\n\n\n var tooltipGroupDailyStats = selection\n .append(\"g\").attr(\"fill\", \"green\")\n .attr(\"transform\", \"translate(\" + eval((widthDailyStats / 2) + bboxDailyStatsText.width - 60) + \",\" + eval(heightDailyStats - 5) + \")\");\n\n tooltipGroupDailyStats.append(\"circle\")\n .attr(\"class\", \"tooltip1\")\n .attr(\"stroke\", \"none\")\n .attr(\"r\", 10)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"stroke\", \"green\")\n return tooltipDailyStats.style(\"visibility\", \"visible\");\n })\n .on(\"mousemove\", function () {\n d3.select(this).attr(\"stroke\", \"green\")\n return tooltipDailyStats.style(\"top\", (event.pageY - 10) + \"px\").style(\"left\", (event.pageX + 10) + \"px\");\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"stroke\", \"none\")\n return tooltipDailyStats.style(\"visibility\", \"hidden\");\n });\n\n tooltipGroupDailyStats.append(\"text\")\n .attr(\"y\", \"4\")\n .attr(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"14px\")\n .style(\"fill\", \"white\")\n .text(\"?\");\n\n return barchart;\n }\n barchart.rectangles = function (arg) {\n if (arguments.length == 0)\n return rectangles;\n rectangles = arg;\n return barchart;\n }\n barchart.widthDailyStats = function (arg) {\n if (arguments.length == 0)\n return widthDailyStats;\n widthDailyStats = arg;\n return barchart;\n }\n barchart.heightDailyStats = function (arg) {\n if (arguments.length == 0)\n return heightDailyStats;\n heightDailyStats = arg;\n return barchart;\n }\n\n barchart.reset = function (arg) {\n //remove all rectangles and texts\n\n svgBlock.selectAll(\"rect\")\n .data([])\n .exit().remove();\n svgBlock.selectAll(\"text\")\n .data([])\n .exit().remove();\n\n return barchart;\n }\n\n barchart.updateRectangles = function (arg) {\n\n if (arguments.length == 0)\n return rectangles;\n\n xScaleDailyStats.domain([0, d3.max(dailyTimeStatsPercentData, function (d) {\n return parseFloat(d);\n })])\n\n //update rectangles\n svgBlock.selectAll(\"rect\")\n .data(dailyTimeStatsPercentData)\n .attr({\n x: function (d, i) {\n return 0;\n },\n y: function (d, i) {\n return yScaleDailyStats(yDomainDailyStats[i]);\n },\n width: function (d) {\n return xScaleDailyStats(d);\n },\n height: yScaleDailyStats.rangeBand(),\n fill: function (d, i) {\n return barChartColorMap(yDomainDailyStats[i]);\n },\n })\n\n //update texts\n svgBlock.selectAll(\"text\")\n .data(dailyTimeStatsPercentData)\n .text(function (d) {\n return d\n })\n .attr(\"x\", function (d, i) {\n return xScaleDailyStats(d) - 15;\n })\n .attr(\"y\", function (d, i) {\n return yScaleDailyStats(yDomainDailyStats[i]) + yScaleDailyStats.rangeBand() / 1.5;\n })\n .attr(\"font-family\", fontFamilyDailyStatsText)\n .attr(\"font-size\", fontSizeDailyStatsText)\n .attr(\"fill\", fontfillDailyStatsText)\n .attr(\"text-anchor\", textAnchorDailyStatsText)\n\n return barchart;\n }\n\n return barchart;\n }", "function makeChart(students) { // takes in an array of students\n\n var progressScores = [];\n var dictSheet = {Sheet5:[] , Sheet4:[] , Sheet3:[] ,Sheet2:[], Sheet1:[], Sheet8:[], Sheet7:[], Sheet6:[], Sheet12:[], Sheet11:[], Sheet10:[], Sheet9:[], Sheet17:[], Sheet16:[], Sheet15:[], Sheet14:[], Sheet13:[]};\n var LectureDate = [28, 21, 14, 7, 0, 49, 42, 35, 77, 70, 63, 56, 112, 105, 98, 91, 84]; //make an array of lecture start dates\n var dictPercentile = {P5:[] , P4:[] , P3:[] ,P2:[], P1:[], P8:[], P7:[], P6:[], P12:[], P11:[], P10:[], P9:[], P17:[], P16:[], P15:[], P14:[], P13:[]};\n var PercentAvgSheet1to8 = [];\n var DaysAfterLectMeanSheet1to8 = [];\n var Sheet1to8SD = [];\n var Percentile1to8SD = [];\n // for loop to check and calculate the days after lecture when students started tutorial sheet\n for (var i =0; i < students.length; i++){\n var count = -1;\n var LectureCount = 0;\n var progressKey = Object.keys(students[i])[97];\n var progressScoremaybe = students[i][progressKey];\n progressScores.push(parseFloat((progressScoremaybe/40)*100));\n for (var j =8; j <= 90; j += 5){\n var key = Object.keys(students[i])[j]; // access title of start times\n var value = students[i][key] // gives date in raw form\n // console.log(\"Raw form date\" + \" \" + value)\n //convert date string into a time object\n var date = new Date(value);\n // console.log(\"date\" + \" \" + date)\n var DayNumber = dayOfYear(date);\n // console.log(\"day number is\" + \" \" + DayNumber)\n //need to account for imperial calendar with 3rd october as week 1\n if (value !== 0){\n count ++;\n } else{\n continue\n }\n if (value === \"\"){\n DayNumber = 154\n }\n else if (dayOfYear(date) >= 286 || dayOfYear(date) < 11){\n DayNumber -= 286;\n } else if (dayOfYear(date) < 46 || dayOfYear(date) >= 11) {\n DayNumber += 52;\n } else {\n DayNumber += 45\n }\n key = Object.keys(dictSheet)[count]; //accesses tutorial sheet dictionary\n dictSheet[key][i] = Math.abs(DayNumber - LectureDate[LectureCount]);\n LectureCount ++\n }\n };\n\n //create percentiles\n for (var i =0; i < Object.keys(dictPercentile).length; i++){\n key = Object.keys(dictPercentile)[i]; //accesses tutorial sheet dictionary\n var key2 = Object.keys(dictSheet)[i]; //accesses tutorial sheet dictionary\n for (var j =0; j <= students.length; j ++){\n count = 0;\n for(var z=0; z <= students.length; z++){\n if (dictSheet[key2][z] >= dictSheet[key2][j]){\n count ++\n } \n }\n dictPercentile[key][j] = (count/students.length)*100;\n }\n };\n\n // working out Mean of sheet time after exam, standard deviation of sheet time after exam, Mean of percentiles, \n for (var i =0; i < Object.keys(dictPercentile).length; i++){\n key = Object.keys(dictPercentile)[i]; //accesses tutorial sheet dictionary\n key2 = Object.keys(dictSheet)[i]; //accesses tutorial sheet dictionary\n for (var j =0; j <= students.length; j ++){\n count = 0;\n for(var z=0; z <= students.length; z++){\n if (dictSheet[key2][z] >= dictSheet[key2][j]){\n count ++\n } \n }\n dictPercentile[key][j] = (count/students.length)*100;\n }\n };\n\n var dictSheetArray = [];\n var dictPercentileArray = [];\n // console.log(Object.values(dictPercentile.P1))\n\n // for all sheets use: Object.keys(dictSheet).length instead of 8\n for(var i=0; i < 8; i++){\n dictSheetArray.push(dictSheet[Object.keys(dictSheet)[i]])\n dictPercentileArray.push(dictPercentile[Object.keys(dictPercentile)[i]])\n }\n\n console.log(dictSheetArray)\n //Calculating mean of sheets, mean of percentiles, SD of sheets\n var dictSheetTranspose = dictSheetArray[0].map((_, colIndex) => dictSheetArray.map(row => row[colIndex]));\n var dictPercentileTranspose = dictPercentileArray[0].map((_, colIndex) => dictPercentileArray.map(row => row[colIndex]));\n for(var i=0; i<dictSheetTranspose.length; i++){\n DaysAfterLectMeanSheet1to8.push(calcAverage(dictSheetTranspose[i]))\n PercentAvgSheet1to8.push(calcAverage(dictPercentileTranspose[i]))\n Sheet1to8SD.push(getSD(dictSheetTranspose[i]))\n Percentile1to8SD.push(getSD(dictPercentileTranspose[i]))\n }\n //need to convert into single array of objects\n\n const data = progressScores.map((x, i) => {\n return {\n x: x,\n y: DaysAfterLectMeanSheet1to8[i]\n };\n });\n for (var i =0; i< data.length; i++){\n dataNeed.push(data[i])\n }\n }", "function createReportTable(data, reportId, filter_scale)\r\n{\r\n\t\t\r\n\t\tvar divHtml = \"<table id='table_\"+data.hirarchy+\"' data-scale='\"+filter_scale+\"'>\\\r\n\t\t\t<tr class='tableHead'>\";\r\n\t\tfor(key in data.head)\r\n\t\t\tdivHtml += \"<td>\" + data.head[key] + \"</td>\";\r\n\t\t\r\n\t\tdivHtml += \"</tr>\";\r\n\t\t\r\n\t\t\r\n\t\tfor(var rowid in data.body) {\r\n\t\t\tvar row = data.body[rowid];\r\n\t\t\t\r\n\t\t\tif(row.type && row.type == \"title\")\r\n\t\t\t\tdivHtml += \"<tr class='titleRow'>\";\r\n\t\t\telse if(row.type && row.type == \"midSum\")\r\n\t\t\t\tdivHtml += \"<tr class='midsumRow'>\";\r\n\t\t\telse\r\n\t\t\t\tdivHtml += \"<tr>\";\r\n\t\t\t\r\n\t\t\tfor(key in row) {\r\n\t\t\t\tif(key == \"type\")\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tvar value = 0;\r\n\t\t\t\tswitch(data.format[key])\r\n\t\t\t\t{\r\n\t\t\t\t\tcase \"int\":\r\n\t\t\t\t\t\tvalue = \"<td>\" + row[key].toString().toFaDigit() + \"</td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"char\":\r\n\t\t\t\t\t\tvalue = \"<td><span class='right'>\"+row[key]+\"</span></td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"ebcdic\":\r\n\t\t\t\t\t\t\tvalue = \"<span class='right'>\"+main2win(row[key])+\"</span>\";\r\n\t\t\t\t\t\tvalue = \"<td>\" + value + \"</td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"amount\":\r\n\t\t\t\t\t\tvalue = (row[key] >= 0)? \r\n\t\t\t\t\t\t\t\"<span class='green'> \" + (formatNumber(Math.abs(row[key]/filter_scale), 3, \",\")).toFaDigit() + \" </span>\" : \r\n\t\t\t\t\t\t\t\"<span class='red'> \" + (formatNumber(Math.abs(row[key]/filter_scale), 3, \",\")).toFaDigit() + \" </span>\";\r\n\t\t\t\t\t\tvalue = \"<td class='amount'>\" + value + \"</td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"amountsum\":\r\n\t\t\t\t\t\tvalue = (row[key] >= 0)? \r\n\t\t\t\t\t\t\t\"<span class='green'> \" + (formatNumber(Math.abs(row[key]/filter_scale), 3, \",\")).toFaDigit() + \" </span>\" : \r\n\t\t\t\t\t\t\t\"<span class='red'> \" + (formatNumber(Math.abs(row[key]/filter_scale), 3, \",\")).toFaDigit() + \" </span>\";\r\n\t\t\t\t\t\tvalue = \"<td class='amount'><strong>\"+ value +\"</strong></td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"date\":\r\n\t\t\t\t\t\tvalue = \"<td>\" + (formatNumber(row[key]%1000000, 2, \"/\")).toFaDigit() + \"</td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"zone\":\r\n\t\t\t\t\t\tvalue = \"<td>\" + zoneList[row[key]] + \"</td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"sar\":\r\n\t\t\t\t\t\tif(row.type && row.type == \"midSum\")\r\n\t\t\t\t\t\t\tvalue = \"<td><span class='right'>جمــع \"+zoneList[row[key]]+\"</span></td>\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tvalue = \"<td><span class='right'>\"+sarList[row[key]]+\"</span></td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"br\":\r\n\t\t\t\t\t\tvalue = \"<td><span class='right'>\"+row[key]+\" - \"+brList[row[key]]+\"</span></td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"fasl\":\r\n\t\t\t\t\t\tvalue = \"<td><span class='right'>\"+row[key]+\" - \"+sarfaslList[row[key]]+\"</span></td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"link\":\r\n\t\t\t\t\t\tif(row.type && row.type == \"midSum\")\r\n\t\t\t\t\t\t\tvalue = \"<td> </td>\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tvalue = \"<td><a href='javascript:loadReport(\\\"\"+reportId+\"\\\", \"+row[key][1]+\");' class='report-link'>\" + row[key][0] + \"</a></td>\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tvalue = \"<td>\" + row[key] + \"</td>\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdivHtml += value;\r\n\t\t\t}\r\n\t\t\tdivHtml += \"</tr>\";\r\n\t\t}\r\n\t\t\r\n\t\tif(data.rowsum != false)\r\n\t\t{\r\n\t\t\tvar rowSum = data.rowsum;\r\n\t\t\tvar dif = data.head.length - rowSum.length;\r\n\t\t\t\r\n\t\t\tdivHtml += \"<tr class='rowsum'>\\\r\n\t\t\t\t\t\t\t<td colspan=\"+dif+\">جمــع</td>\";\r\n\t\t\tfor(key in rowSum)\r\n\t\t\t{\r\n\t\t\t\tvar value = (rowSum[key] === \"\") ? \"\" :\r\n\t\t\t\t\t\t\t\t\t\t\t((rowSum[key] >= 0) ? \r\n\t\t\t\t\t\t\t\t\t\t\t\t(\"<span class='green'> \"+(formatNumber(Math.abs(rowSum[key]/filter_scale), 3, \",\")).toFaDigit()+\" </span>\") :\r\n\t\t\t\t\t\t\t\t\t\t\t\t(\"<span class='red'> \"+(formatNumber(Math.abs(rowSum[key]/filter_scale), 3, \",\")).toFaDigit()+\" </span>\")\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\tdivHtml += \"<td class='amount'>\" + value + \"</td>\";\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tdivHtml += \"</tr>\";\r\n\t\t}\r\n\t\tdivHtml += \"</table>\";\r\n\t\t\r\n\t\treturn divHtml;\r\n}", "function drawPaths() {\r\n\r\n removeSvg();\r\n setPaths = true;\r\n\r\n var $cell = $('table.newschart > tbody > tr.nchart1 > td.nval1');\r\n\r\n var cw = $cell.width();\r\n var ch = $cell.height();\r\n\r\n for (var chart = 1; chart < 9; chart++) {\r\n\r\n //Plot only visible charts\r\n // showScale1 = false; //hide Oxygen saturation scale 1 by default (chart 2)\r\n // showScale2 = false; //hide Oxygen saturation scale 2 by defaultt (chart 3)\r\n\r\n if ((chart != 4) && (chart != 2 || showScale1) && (chart != 3 || showScale2)) {\r\n\r\n // svg positioning\r\n var $firstCell = $('table.newschart > tbody > tr.nchart' + chart + ' > td.nval1');\r\n if ($firstCell.is(\":visible\")) {\r\n var svgtop = $firstCell.position().top - 15;\r\n var svgleft = $firstCell.position().left;\r\n var sh = $('table.newschart > tbody > tr.nchart' + chart).height() * $('table.newschart > tbody > tr.nchart' + chart).length + 15;\r\n var sw = $(\"#newschartcontainer\").width() - svgleft;\r\n\r\n var svg = d3.select(\"#newschartcontainer\").append(\"svg\")\r\n .attr(\"width\", sw)\r\n .attr(\"height\", sh)\r\n .attr(\"id\", \"svg\" + chart)\r\n\r\n $(\"#newschartcontainer > #svg\" + chart).css({ top: svgtop, left: svgleft, position: 'absolute' });\r\n\r\n var data = [];\r\n\r\n for (var col = 1; col < 21; col++) {\r\n $cell = $('table.newschart > tbody > tr.nchart' + chart + ' > td.nval' + col + '.plotted');\r\n if ($cell.length > 0) {\r\n $cell.addClass(\"hideborder\");\r\n var pos = $cell.position();\r\n var text = $cell.text();\r\n var xval = Math.round(pos.left + (cw / 2) + 2) - svgleft;\r\n var yval = Math.round(pos.top + (ch / 2) + 1) - svgtop;\r\n var y2val = yval;\r\n var $cell2 = $('table.newschart > tbody > tr.nchart' + chart + ' > td.nval' + col + '.diastolic');\r\n if ($cell2.length > 0) {\r\n var pos2 = $cell2.position();\r\n var y2val = Math.round(pos2.top + (ch / 2) - ch + 2) - svgtop;\r\n $('table.newschart > tbody > tr.nchart' + chart + ' > td.nval' + col).addClass(\"hideborder\");\r\n }\r\n storeCoordinate(xval, yval, text, y2val, data);\r\n }\r\n }\r\n\r\n //datajson = JSON.stringify(data)\r\n //console.log(datajson)\r\n //data = JSON.parse(datajson)\r\n //console.log(data);\r\n drawD3(chart, data, svg)\r\n\r\n\r\n }\r\n }\r\n\r\n }\r\n\r\n}", "function renderReport(result) {\n // Initialize an Empty Array to use as a template\n let monthArray = {\n Jan: 0,\n Feb: 0,\n Mar: 0,\n Apr: 0,\n May: 0,\n Jun: 0,\n Jul: 0,\n Aug: 0,\n Sep: 0,\n Oct: 0,\n Nov: 0,\n Dec: 0\n };\n // Loop through every month keys in the array\n for (let key in monthArray) {\n // For every index in result\n for (let i = 0; i < result.length; i++) {\n // If the index month matches the key in month array\n if (moment.monthsShort(result[i]._id.month - 1) == key) {\n // Then the value of the key is the total value in result\n monthArray[key] = result[i].total;\n }\n }\n }\n // Grab element to render the chart to\n let ctx = document.getElementById(\"myChart\").getContext(\"2d\");\n let myChart = new Chart(ctx, {\n type: \"bar\",\n data: {\n labels: Object.keys(monthArray),\n datasets: [\n {\n label: \" Amount of Donations per Month (US$)\",\n data: Object.values(monthArray),\n backgroundColor: [\"rgba(57, 62, 70, 0.2)\"],\n borderColor: [\"rgba(57, 62, 70, 1)\"],\n borderWidth: 1\n }\n ]\n }\n });\n}", "function generateReportPDF(absentWorkers, lateWorkers, activeHoursForWorkers, inactiveHoursForWorkers, siteName, clientName) {\n\tabsentWorkers.map(e => delete e.siteDetail);//no needed\n\tlet data = { absentWorkers, lateWorkers, activeHoursForWorkers, inactiveHoursForWorkers };\n\n\tlet day = new Date();\n\tlet fileName = day.getDate() + \"-\" + monthNames[(day.getMonth())] + \"-\" + day.getFullYear();\n\tconst dir = `${global.__base}/reports/${clientName}`;\n\tconst fullPath = `${dir}/${siteName}-${fileName}.json`\n\tif (!fs.existsSync(dir)) {\n\t\tfs.mkdirSync(dir, { recursive: true });\n\t}\n\tfs.writeFile(fullPath, JSON.stringify(data, null, 4), (err) => {\n\t\tif (err) console.log(err);\n\t\telse console.log(`Report Generated ${global.__base}/reports/${siteName}-${fileName}.json`);\n\t}); //enhancemt for JasperReport PDF\n}", "function createGraph(weekNum) {\n\t//Remove all elements of previous graph\n\tg.selectAll(\"g\").remove();\n \tg.selectAll(\"path\").remove();\n \tg.selectAll(\"circle\").remove();\n\n \t//Get subset of data for new graph\n \tvar weekSubset = subset.slice(0,weekNum + 1);\n\tx.domain(d3.extent(weekSubset, function(d) { return d.date; }));\n\ty.domain(d3.extent(weekSubset, function(d) { return d.pctClose; }));\n\n\t//Set y-Axis\n \tvar yAxis = d3.axisLeft(y);\n \tyAxis.tickFormat(function(d) { return d + \"%\"; });\n\n \t//Add data to graph\n \tg.append(\"g\")\n \t\t.call(yAxis)\n\t .append(\"text\")\n\t .transition()\n\n\tg.append(\"path\")\n\t \t.datum(weekSubset)\n\t .attr(\"fill\", \"none\")\n\t .attr(\"stroke\", \"black\")\n\t .attr(\"stroke-linejoin\", \"round\")\n\t .attr(\"stroke-linecap\", \"round\")\n\t .attr(\"stroke-width\", 1.75)\n\t .attr(\"d\", line)\n\n\tg.selectAll(\"dot\")\n \t.data(weekSubset)\n \t.enter().append(\"circle\")\n \t.attr(\"r\", 7)\n \t.style(\"fill\", function(d) {\n \tif (d.sold > d.bought) {return \"#F5811F\"}\n \tif (d.bought > d.sold) {return \"#008D97\"}\n \tif (d.bought > 0 && d.sold > 0 && d.bought === d.sold) {return \"black\"}\n \t;})\n \t.style(\"display\", function(d) {\n \tif (d.bought === 0 && d.sold === 0) {return \"none\"}\n \t;})\n \t.attr(\"cx\", function(d) { return x(d.date); })\n \t.attr(\"cy\", function(d) { return y(d.pctClose); });\n}", "async generateReportData() {\n try {\n const date = new Date();\n const currentMonth =\n date.getMonth() < 9 ? `0${(date.getMonth() + 1)}` : `${(date.getMonth() + 1)}`;\n const currentDate = date.getDate() < 10 ? `0${date.getDate()}` : `${date.getDate()}`;\n const start = `${date.getFullYear()}-01-01 00:00:00+00`;\n // const start = `${date.getFullYear()}-${currentMonth}-01 00:00:00+00`;\n this.fileDate = `${date.getFullYear()}-${currentMonth}-${currentDate}`;\n const query = `select\n to_char(lead.created_at + interval '5 hours 30 min', 'DD-MM-YYYY') as date,\n to_char(lead.created_at + interval '5 hours 30 min', 'HH:MI:SSAM') as created_time,\n ( select name from zones where id = lead.zone_id ) as zone,\n ( select name from states where id = lead.state_id ) as state,\n ( select name from cities where id = lead.city_id ) as city,\n ( select name from dealer_categories dc where dc.id = lead.dealer_category_id ) as dealer_category,\n ( select name from dealers d where d.id = lead.dealer_id ) as name_of_the_dealer,\n lead.source_of_enquiry as source_of_enquiry,\n ( select first_name from users u where u.id = lead.assigned_to ) as name_of_the_dse,\n lead.pincode as pincode,\n ( CASE WHEN (lead.gender = 'male') THEN 'Mr.' ELSE 'Ms.' END ) as title_of_the_prospect,\n lead.name as name_of_the_prospect, lead.mobile_number as phone_number,\n ( select count(1) from lead_details where lead_id = lead.id and is_deleted = false ) as number_of_enquiries,\n ( select name from vehicles where id = ld.vehicle_id ) as product_enquired,\n (select color from variant_colours where id=ld.variant_colour_id ) as Product_Color,\n ( CASE WHEN (lead.category = 'NEW' and lead.is_lost = false and lead.is_invoiced = false\n and lead.is_booked = false ) THEN 'yes' ELSE 'no' END ) as new,\n ( CASE WHEN (lead.category = 'HOT' and lead.is_lost = false and lead.is_invoiced = false\n and lead.is_booked = false ) THEN 'yes' ELSE 'no' END ) as hot,\n ( CASE WHEN (lead.category = 'WARM' and lead.is_lost = false and lead.is_invoiced = false\n and lead.is_booked = false ) THEN 'yes' ELSE 'no' END ) as warm,\n ( CASE WHEN (lead.category = 'COLD' and lead.is_lost = false and lead.is_invoiced = false\n and lead.is_booked = false ) THEN 'yes' ELSE 'no' END ) as cold,\n ( CASE WHEN (ld.booked_on IS NOT NULL) THEN 'yes'\n ELSE 'no' END ) as is_booked,\n ( CASE WHEN (ld.invoiced_on IS NOT NULL) THEN 'yes'\n ELSE 'no' END ) as is_invoiced,\n ( CASE WHEN (lead.is_lost = true) THEN 'yes' ELSE 'no' END ) as lost,\n ( CASE WHEN (lead.lost_reason_text is NULL OR lead.lost_reason_text = '')\n THEN ( select reason from lost_reasons where id = lead.lost_reason_id )\n ELSE lead.lost_reason_text END ) as lost_reason,\n(CASE WHEN(lead.lost_reason_id is not NULL )Then\n(select category from lost_reasons where id = lead.lost_reason_id )\nElse '' END) as Lost_Category,\n lead.category as last_status,\n to_char(ld.booked_on + interval '5 hours 30 min', 'DD-MM-YYYY') as booked_date,\n to_char(ld.invoiced_on + interval '5 hours 30 min', 'DD-MM-YYYY') as invoiced_date,\n to_char(cast(lead.lost_on as timestamp with time zone) + interval '5 hours 30 min', 'DD-MM-YYYY') as Lost_Date,\n ( CASE WHEN (ld.test_ride_status is not null) THEN 'yes' ELSE 'no' END ) as test_ride_availed,\n (case ld.test_ride_status when 200 then 'Booked'\n when 300 then 'Ongoing' when 400 then 'Completed'\n when 500 then 'Cancelled' end) \"Test Ride Status\",\n ( CASE WHEN ( (select count(1) from exchange_vehicles where lead_id = lead.id ) = 0)\n THEN 'no' ELSE 'yes' END ) as exchange_vehicle_opted,\n ( select manufacturer from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as vehicle_make,\n ( select vehicle from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as vehicle_model,\n ( select variant_year from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as year_of_manufacturer,\n ( select condition from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as vehicle_condition,\n ( select remarks from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as vehicle_remarks,\n ( select quoted_value from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as exchange_value,\n ( CASE WHEN ( lead.income_status = 1 AND fl.id is not null) THEN 'self-employed'\n WHEN ( lead.income_status = 0 AND fl.id is not null) THEN 'salaried'\n ELSE '' END ) as income_status,\n ( CASE WHEN (fl.id is not null) THEN 'yes' ELSE 'no' END ) as finance_opted,\n ( select name from financiers f where f.id = fl.financier_id ) as financier_name,\n fl.loan_amount as loan_amount,\n fl.tenure as tenure,\n ( CASE WHEN (fl.status = 500) THEN 'active'\n WHEN (fl.status = 510) THEN 'disbursement-pending'\n WHEN (fl.status = 520) THEN 'converted'\n WHEN (fl.status = 930) THEN 'lost' END ) as finance_status,\n ( CASE WHEN ( (select count(1) from follow_ups where lead_id = lead.id ) = 0) THEN 'no' ELSE 'yes' END )\n as follow_up_scheduled,\n to_char(lead.next_followup_on + interval '5 hours 30 min', 'DD-MM-YYYY') as next_follow_up_date,\n to_char(lead.next_followup_on + interval '5 hours 30 min', 'HH:MI:SSAM') as next_follow_up_time,\n ( select to_char(completed_at + interval '5 hours 30 min', 'DD-MM-YYYY')\n from follow_ups where lead_id = lead.id and is_completed = true\n order by created_at DESC limit 1 ) as last_follow_up_date,\n ( select to_char(completed_at + interval '5 hours 30 min', 'HH:MI:SSAM')\n from follow_ups where lead_id = lead.id and is_completed = true\n order by created_at DESC limit 1 ) as last_follow_up_time,\n ( select comment from follow_ups where lead_id = lead.id and is_completed = true\n order by created_at DESC limit 1 ) as follow_up_comment,\n ( select count(1) from follow_ups where lead_id = lead.id and is_completed = true ) as number_of_follow_up_done,\n (SELECT string_agg(comment, '; ')\nFROM lead_activities where lead_id=lead.id and type='Comments Added') AS General_Comments\n from leads lead\n left join lead_details ld ON ld.lead_id = lead.id and ld.is_deleted = false\n left join financier_leads fl ON fl.lead_detail_id = ld.id and\n fl.created_at=(select max(created_at) from financier_leads fl_temp\n where fl_temp.lead_detail_id = ld.id)\n where\n ( lead.created_at between $1 and (select now()) ) or\n ( lead.invoiced_on between $1 and (select now()) ) or\n ( lead.lost_on between $1 and (select now()) )\n order by lead.created_at ASC, lead.name ASC`;\n const params = [start];\n this.result = await new Promise((resolve, reject) => {\n postgresDsConnector.query(query, params, (err, res) => {\n if (err) {\n logger.info('Error in preparing report data');\n reject(new InstabikeError(err));\n }\n return resolve(res);\n });\n });\n let csv = [];\n if (this.result.length) {\n const items = this.result;\n // specify how you want to handle null values here\n const replacer = (key, value) => (value === null ? '' : value);\n const header = Object.keys(items[0]);\n await Promise.all(items.map((row) => {\n const eachRow = header.map(fieldName => JSON.stringify(row[fieldName], replacer)).join(',');\n csv.push(eachRow);\n }));\n csv.unshift(header.join(','));\n csv = csv.join('\\r\\n');\n } else {\n csv = constants.MIS_REPORT.DEFAULT_TITLE;\n }\n await this.saveReportAsCSV(csv);\n } catch (e) {\n logger.info(e);\n throw new InstabikeError(e);\n }\n }", "convertReport(report) {\n // Report model\n const reportView = {\n id: report._id,\n title: `${report.pipeline} (${report.stage})`,\n subtitle: report.job\n };\n if (report.cucumber) {\n // Create chart history data \n reportView.history = report.cucumber\n // Sort by time ascending\n .sort((a, b) => {\n return a.timestamp > b.timestamp ? 1 : -1;\n })\n // Filter reports that are not in defined interval\n .filter((report, idx, arr) => {\n // Latest test case = last in list\n const latestTestTime = moment(arr[arr.length - 1].timestamp);\n const currTestTime = moment(report.timestamp);\n return latestTestTime.diff(currTestTime, 'days') <= daysInterval;\n })\n .reduce((acc, c) => {\n const errors = [];\n let passed = 0;\n let failed = 0;\n c.features.forEach((feature) => {\n feature.scenarios.forEach((scenario) => {\n scenario.steps.forEach((step) => {\n if (step.result === 'passed') {\n passed++;\n } else {\n failed++;\n errors.push({\n test: scenario.name,\n message: step.error,\n });\n }\n })\n })\n })\n acc.push({\n passed: passed,\n failed: failed,\n errors: errors,\n when: c.timestamp\n });\n return acc;\n }, []);\n\n }\n return reportView;\n }", "function singleClickWeeklyWeeklyGraphRenderer(){\n\n\t\trunReportAnimation(90); //of Step 10 which takes 14 units\n\n\t\tif(fromDate != toDate){\n\t\t\t//Skip and go to next step\n\t\t\tsingleClickGenerateAllReports();\n\t\t\treturn '';\n\t\t}\n\t\telse{\n\t\t\twindow.localStorage.graphImageDataWeekly = '';\n\t\t\twindow.localStorage.graphImageDataWeeklyBW = '';\n\t\t\tweeklyGraphBW();\n\t\t}\n\n\t\tfunction weeklyGraphBW(){\n\n\t\t\tvar graph_labels = [];\n\t\t\tvar graph_data = [];\n\n\t\t\tvar graph_border = [\"rgba(0, 0, 0, 1)\"];\n\t\t\tvar graph_border_last = [\"rgba(144, 144, 144, 1)\"];\n\n\t\t\t//This Weeks data\n\t\t\tvar n = 0;\n\t\t\twhile(weeklyProgressThisWeek[n]){\n\t\t\t\tgraph_labels.push(weeklyProgressThisWeek[n].name);\n\t\t\t\tgraph_data.push(parseInt(weeklyProgressThisWeek[n].value));\n\n\t\t\t\tn++;\n\t\t\t}\n\n\t\t\t//Last Weeks (exclude labels)\n\t\t\tvar graph_data_last = [];\n\t\t\tvar k = 0;\n\t\t\twhile(weeklyProgressLastWeek[k]){\n\t\t\t\tgraph_data_last.push(parseInt(weeklyProgressLastWeek[k].value));\n\t\t\t\t\n\t\t\t\tk++;\n\t\t\t}\n\n\t\t\tvar ctx = document.getElementById(\"weeklyTrendLineChartBW\").getContext('2d');\n\t\t\tvar myChart = new Chart(ctx, {\n\t\t\t type: 'line',\n\t\t\t data: {\n\t\t\t labels: graph_labels,\n\t\t\t datasets: [{\n\t\t\t label: 'This Week',\n\t\t\t data: graph_data,\n\t\t\t fill: false,\n\t\t\t borderColor: graph_border,\n\t\t\t borderWidth: 2\n\t\t\t \n\t\t\t },{\n\t\t\t label: 'Last Week',\n\t\t\t data: graph_data_last,\n\t\t\t fill: false,\n\t\t\t borderColor: graph_border_last,\n\t\t\t borderWidth: 2,\n\t\t\t borderDash: [10,5]\n\t\t\t }]\n\t\t\t },\n\t\t\t options: {\t \t\n\t\t\t scales: {\n\t\t\t yAxes: [{\n\t\t\t \tdisplay:true,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: true\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:true\n\t\t \t}\n\t\t\t }],\n\t\t\t xAxes: [{\n\t\t\t \tdisplay:true,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: true\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:false\n\t\t \t}\n\t\t\t }]\n\t\t\t },\n\t\t\t animation: {\n\t\t onComplete: convertGraph\n\t\t }\n\t\t\t }\n\t\t\t});\t\n\n\t\t\tfunction convertGraph(){\n\t\t\t\tvar temp_graph = myChart.toBase64Image();\n\t\t\t\twindow.localStorage.graphImageDataWeeklyBW = temp_graph;\n\n\t\t\t\tweeklyGraphColored();\t\t\t\n\t\t\t}\n\t\t}\n\n\n\n\t\tfunction weeklyGraphColored(){ //Colorfull Graph!\n\n\t\t\tvar graph_labels = [];\n\t\t\tvar graph_data = [];\n\n\t\t\tvar graph_background = [\"rgba(103, 210, 131, 0.2)\"];\n\t\t\tvar graph_background_last = [\"rgba(255, 177, 0, 0.2)\"];\n\n\t\t\tvar graph_border = [\"rgba(103, 210, 131, 1)\"];\n\t\t\tvar graph_border_last = [\"rgba(255, 177, 0, 1)\"];\n\n\t\t\t//This Weeks data\n\t\t\tvar n = 0;\n\t\t\twhile(weeklyProgressThisWeek[n]){\n\t\t\t\tgraph_labels.push(weeklyProgressThisWeek[n].name);\n\t\t\t\tgraph_data.push(parseInt(weeklyProgressThisWeek[n].value));\n\n\t\t\t\tn++;\n\t\t\t}\n\n\n\t\t\t//Last Weeks (exclude labels)\n\t\t\tvar graph_data_last = [];\n\t\t\tvar k = 0;\n\t\t\twhile(weeklyProgressLastWeek[k]){\n\t\t\t\tgraph_data_last.push(parseInt(weeklyProgressLastWeek[k].value));\n\t\t\t\t\n\t\t\t\tk++;\n\t\t\t}\n\n\t\t\tvar ctx = document.getElementById(\"weeklyTrendLineChart\").getContext('2d');\n\t\t\tvar myChart = new Chart(ctx, {\n\t\t\t type: 'line',\n\t\t\t data: {\n\t\t\t labels: graph_labels,\n\t\t\t datasets: [{\n\t\t\t label: 'This Week',\n\t\t\t data: graph_data,\n\t\t\t borderColor: graph_border,\n\t\t\t backgroundColor: graph_background,\n\t\t\t borderWidth: 2\n\t\t\t \n\t\t\t },{\n\t\t\t label: 'Last Week',\n\t\t\t data: graph_data_last,\n\t\t\t backgroundColor: graph_background_last,\n\t\t\t borderColor: graph_border_last,\n\t\t\t borderWidth: 2,\n\t\t\t borderDash: [10,5]\n\t\t\t }]\n\t\t\t },\n\t\t\t options: {\t \t\n\t\t\t scales: {\n\t\t\t yAxes: [{\n\t\t\t \tdisplay:true,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: true\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:true\n\t\t \t}\n\t\t\t }],\n\t\t\t xAxes: [{\n\t\t\t \tdisplay:true,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: true\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:false\n\t\t \t}\n\t\t\t }]\n\t\t\t },\n\t\t\t animation: {\n\t\t onComplete: convertGraph\n\t\t }\n\t\t\t }\n\t\t\t});\t\n\n\t\t\tfunction convertGraph(){\n\t\t\t\tvar temp_graph = myChart.toBase64Image();\n\t\t\t\twindow.localStorage.graphImageDataWeekly = temp_graph;\n\n\t\t\t\tsingleClickGenerateAllReports();\n\t\t\t}\n\t\t}\n\t}", "function generateReport (data, outputPdfPath) {\n return webServer.start(webServerPortNo, data)\n .then(server => {\n const urlToCapture = \"http://localhost:\" + webServerPortNo;\n return captureReport(urlToCapture, \"svg\", outputPdfPath)\n .then(() => server.close());\n });\n}", "makeChart(name) {\n let data = [];\n let datadict = {};\n const keys = CSRankings.topTierAreas;\n const uname = unescape(name);\n for (let key in keys) { // i = 0; i < keys.length; i++) {\n //\t let key = keys[i];\n if (!(uname in this.authorAreas)) {\n // Defensive programming.\n // This should only happen if we have an error in the aliases file.\n return;\n }\n //\t if (key in CSRankings.nextTier) {\n //\t\tcontinue;\n //\t }\n let value = this.authorAreas[uname][key];\n // Use adjusted count if this is for a department.\n /*\n DISABLED so department charts are invariant.\n \n if (uname in this.stats) {\n value = this.areaDeptAdjustedCount[key+uname] + 1;\n if (value == 1) {\n value = 0;\n }\n }\n */\n // Round it to the nearest 0.1.\n value = Math.round(value * 10) / 10;\n if (value > 0) {\n if (key in CSRankings.parentMap) {\n key = CSRankings.parentMap[key];\n }\n if (!(key in datadict)) {\n datadict[key] = 0;\n }\n datadict[key] += value;\n }\n }\n for (let key in datadict) {\n let newSlice = {\n \"label\": this.areaDict[key],\n \"value\": Math.round(datadict[key] * 10) / 10,\n \"color\": this.color[CSRankings.parentIndex[key]]\n };\n data.push(newSlice);\n }\n new d3pie(name + \"-chart\", {\n \"header\": {\n \"title\": {\n \"text\": uname,\n \"fontSize\": 24,\n \"font\": \"open sans\"\n },\n \"subtitle\": {\n \"text\": \"Publication Profile\",\n \"color\": \"#999999\",\n \"fontSize\": 14,\n \"font\": \"open sans\"\n },\n \"titleSubtitlePadding\": 9\n },\n \"size\": {\n \"canvasHeight\": 500,\n \"canvasWidth\": 500,\n \"pieInnerRadius\": \"38%\",\n \"pieOuterRadius\": \"83%\"\n },\n \"data\": {\n \"content\": data,\n \"smallSegmentGrouping\": {\n \"enabled\": true,\n \"value\": 1\n },\n },\n \"labels\": {\n \"outer\": {\n \"pieDistance\": 32\n },\n \"inner\": {\n //\"format\": \"percentage\", // \"value\",\n //\"hideWhenLessThanPercentage\": 0 // 2 // 100 // 2\n \"format\": \"value\",\n \"hideWhenLessThanPercentage\": 5 // 100 // 2\n },\n \"mainLabel\": {\n \"fontSize\": 10.5\n },\n \"percentage\": {\n \"color\": \"#ffffff\",\n \"decimalPlaces\": 0\n },\n \"value\": {\n \"color\": \"#ffffff\",\n \"fontSize\": 10\n },\n \"lines\": {\n \"enabled\": true\n },\n \"truncation\": {\n \"enabled\": true\n }\n },\n \"effects\": {\n \"load\": {\n \"effect\": \"none\"\n },\n \"pullOutSegmentOnClick\": {\n \"effect\": \"linear\",\n \"speed\": 400,\n \"size\": 8\n }\n },\n \"misc\": {\n \"gradient\": {\n \"enabled\": true,\n \"percentage\": 100\n }\n }\n });\n }", "function drawChart(arr) {\n drawSleepChart(arr);\n drawStepsChart(arr);\n drawCalorieChart(arr);\n drawHeartRateChart(arr);\n}" ]
[ "0.6571701", "0.6333574", "0.630047", "0.62503386", "0.621513", "0.62101257", "0.61687285", "0.6150619", "0.6135054", "0.61107767", "0.61055577", "0.61012805", "0.6077987", "0.606655", "0.6055672", "0.6044861", "0.6041029", "0.6030964", "0.6013327", "0.599888", "0.5989515", "0.59318364", "0.59111696", "0.5888807", "0.58780587", "0.58755726", "0.5871464", "0.58659095", "0.5845721", "0.58325535", "0.58297926", "0.58157253", "0.5813179", "0.5806501", "0.5804346", "0.5794518", "0.5783384", "0.57831544", "0.5782232", "0.5782087", "0.5766099", "0.57463473", "0.5741819", "0.5740753", "0.5736684", "0.57365143", "0.57283235", "0.5721667", "0.57188636", "0.57167065", "0.5712997", "0.570257", "0.57018024", "0.56992143", "0.56842107", "0.56775606", "0.5667345", "0.5665392", "0.5664889", "0.5643436", "0.5633472", "0.56295043", "0.56241727", "0.5618996", "0.56170154", "0.561541", "0.5614476", "0.56108415", "0.5601047", "0.55994195", "0.55989414", "0.5590969", "0.5584649", "0.55835253", "0.55722934", "0.55720854", "0.5571809", "0.55581", "0.55516994", "0.55492246", "0.554889", "0.5544591", "0.55330145", "0.5532707", "0.55308676", "0.5527701", "0.5525586", "0.5517891", "0.5512122", "0.55095387", "0.550875", "0.55077803", "0.5507157", "0.5505106", "0.5501624", "0.54965717", "0.54947716", "0.5492958", "0.5487798", "0.54869133" ]
0.62552667
3
This function shows lead count and total deal amount in pipeline on mouseover
function showLeadAmount(leadAmount) { var getdiv = document.getElementById("hoverLead"); getdiv.innerText = ""; var leadAmtLabel = document.createElement("DIV"); leadAmtLabel.className = "chartBarLabel"; leadAmtLabel.appendChild(document.createTextNode("$" + leadAmount.toLocaleString())); $('#hoverLead').append(leadAmtLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElement(\"DIV\");\n wonCountLabel.className = \"wonLostLabel\";\n wonCountLabel.appendChild(document.createTextNode(saleCount));\n $('#wonOpp').append(wonCountLabel); \n}", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function link_onMouseOver(e,d,i) {\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = \"$\" + d3.format(\",.0f\")(viz.value()(d.data));\n var date = d.data.Month + \"/\" + d.data.Day + \"/\" + d.data.Year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Received: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function showOppCount(oppCount) { \n var getDiv = document.getElementById(\"hoverOpp\");\n getDiv.innerText = oppCount; \n}", "function arc_onMouseOver(e,d,i) {\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n links.each(function (d) {\n total+= viz.value()(d.data);\n });\n\n total = \"$\" + d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"POLITICAL ACTION COMMITTEE\", d.data.values[0].CMTE_NM,\"Total Donated: \" + total);\n}", "function displayTotal() {\n\tscreen1.bugCount.html(prettyNumber(Math.round(state.larvae)));\n\tscreen1.larvaePerSec.html(prettyNumber(state.lps));\n}", "function link_onMouseOver(e,d,i) {\n stopAnnimation();\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = d3.format(\",.0f\")(viz.value()(d.data));\n var date = '';\n // var date = d.data.month + \"/\" + d.data.day + \"/\" + d.data.year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Sentiment index: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function handleMouseOver(d, i) {\n\nd3.selectAll(\".visualCircle\").transition()\n .duration(200)\n .style(\"opacity\", 1)\n .attr(\"fill\", \"rgba(255,255,255,0.8)\")\n .attr(\"r\", circleRBefore);\n\nd3.selectAll(\".visualLabel\").transition()\n .duration(200)\n .style(\"opacity\", 0);\n\nd3.select(\"#circle_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 0.2)\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .attr(\"r\", circleRAfter);\n\nd3.select(\"#text_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 1);\n \ndocument.getElementById(\"type680target\").innerHTML = \"<h4>\" + itemTitles[this.id] + \"</h4><hr class='light' style='margin-left: 0px;'><p class='text-justify'>\" + itemDescriptions[this.id] + \"</p>\";\n\n}", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function handleMouseover(d,i) {\n var placeNames = []\n for(n=0;n<adminLabelLvls.length;n++) {\n placeNames.push( toTitleCase( d.properties[adminLabelLvls[n]] ) );\n }\n var tooltipText = \"<small><span class='place-name'>\" + placeNames.join(\", \") + \"</span>\";\n var dataKey = d3.select(this).attr('data-response'); \n if(dataKey !== null) {\n d.properties.response.forEach(function(item,itemIndex){\n if(item.key == dataKey) {\n tooltipText += \" <br> Distributions: \" + commas(item.value.count) +\n \" <br> Items distributed: \" + commas(item.value.total_number);\n }\n });\n } \n tooltipText += \"</small>\";\n $('#tooltip').html(tooltipText);\n}", "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "function showOppAmount(oppAmount) {\n var getdiv = document.getElementById(\"hoverOpp\");\n getdiv.innerText = \"\";\n var oppAmtLabel = document.createElement(\"DIV\");\n oppAmtLabel.className = \"chartBarLabel\";\n oppAmtLabel.appendChild(document.createTextNode(\"$\" + oppAmount.toLocaleString()));\n $('#hoverOpp').append(oppAmtLabel);\n}", "function node_onMouseOver(e,d,i) {\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = \"$\" + d3.format(\",.2f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n createDataTip(x + d.r, y + d.r + 25,congress, d.values[0].CAND_NAME,\"Total Received: \" + total);\n}", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "function drillTable(orgName, contactPerson, contactNumber, email, amount, type, total) {\n // Check if some of the non required fields are blank\n if (contactPerson == \"null\") {\n contactPerson = \"-\";\n }\n if (contactNumber == \"null\") {\n contactNumber = \"-\";\n }\n if (email == \"null\") {\n email = \"-\";\n }\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeSummary\").hide();\n // Shows the pipeline summary\n $(\"#pipeDrillDown\").fadeIn(500, function () {\n var getDiv = document.getElementById(\"pipeSummary\");\n getDiv.innerText = \"Total \" + type + \" amount is : $\" + total.toLocaleString();\n $(\"#pipeSummary\").show();\n }); \n $(\"#drillTable\").show();\n $(\"#drillTable\").append(\"<div class='clear'>&nbsp;</div> <div class='reportLabel'>\" + orgName + \"</div> <div class='reportLabel'> \" + contactPerson + \"</div> <div class='reportLabel'> \" + contactNumber + \"</div> <div class='reportLabel'> \" + email + \"</div> <div class='amountLabel' > $\" + amount.toLocaleString() + \"</div>\");\n \n}", "function showDataPointCount() {\n $('.dataPoints').html('<span class=\"bold\">' + dataPointCounter + ' p/s</span>');\n dataPointCounter = 0;\n}", "function showDetails() {\n\n var z = wrap.style('zoom') || 1\n\n if (z === 'normal') {\n z = 1\n } else if (/%/.test(z)) {\n z = parseFloat(z) / 100\n }\n\n var x = d3.mouse(this)[0] / z\n var tx = Math.max(0, Math.min(options.width + options.margin.left, x))\n\n var i = d3.bisect(lineData.map(function(d) {\n return d.startTime\n }), xScale.invert(tx - options.margin.left))\n var d = lineData[i]\n var open\n var high\n var low\n var close\n var volume\n var vwap\n\n if (d) {\n open = d.open.toPrecision(5)\n high = d.high.toPrecision(5)\n low = d.low.toPrecision(5)\n close = d.close.toPrecision(5)\n vwap = d.vwap.toPrecision(5)\n volume = d.baseVolume.toFixed(2)\n\n var baseCurrency = base.currency\n var chartDetails = div.select('.chartDetails')\n chartDetails.html('<span class=\"date\">' +\n parseDate(d.startTime.local(), chartInterval) +\n '</span><span><small>O:</small><b>' + open + '</b></span>' +\n '<span class=\"high\"><small>H:</small><b>' + high + '</b></span>' +\n '<span class=\"low\"><small>L:</small><b>' + low + '</b></span>' +\n '<span><small>C:</small><b>' + close + '</b></span>' +\n '<span class=\"vwap\"><small>VWAP:</small><b>' + vwap + '</b></span>' +\n '<span class=\"volume\"><small>Vol:</small><b>' + volume +\n ' ' + baseCurrency + '</b></span>' +\n '<span><small>Ct:</small><b>' + d.count + '</b></span>')\n .style('opacity', 1)\n\n hover.transition().duration(50)\n .attr('transform', 'translate(' + xScale(d.startTime) + ')')\n focus.transition().duration(50)\n .attr('transform', 'translate(' +\n xScale(d.startTime) + ',' +\n priceScale(d.close) + ')')\n horizontal.transition().duration(50)\n .attr('x1', xScale(d.startTime))\n .attr('x2', options.width)\n .attr('y1', priceScale(d.close))\n .attr('y2', priceScale(d.close))\n\n hover.style('opacity', 1)\n horizontal.style('opacity', 1)\n focus.style('opacity', 1)\n }\n }", "function addCount() {\n count++;\n $('.count').html(count);\n }", "function node_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n var strSyntax = d.values[0].PTY == 'positive' ? 'Sentiment index: +' : 'Sentiment index: -'\n\n createDataTip(x + d.r, y + d.r + 25, d.values[0].CAND_ID, d.values[0].CAND_NAME, strSyntax + total);\n}", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "function showTotalPassengerCount(){\n\t$('.passenger-count').html(passenger_count)\n}", "function getpanierItemsCount(){\n\n\ttotal=calculertotal();\n\t(document.querySelector(\"#total\")).innerHTML=(\"Total a payer \"+total+\" DH\");\n}", "function onMouseOver(d, i) {\n\t d3.select(this).attr('class', 'highlight');\n\t d3.select(this)\n\t .transition()\n\t .duration(400)\n\t .attr('width', xScale.bandwidth() + 5)\n\t .attr(\"y\", function(d) { return yScale(d.popularity) - 10; })\n\t .attr(\"height\", function(d) { return innerHeight1 - yScale(d.popularity) + 10; });\n\n\t g.append(\"text\")\n\t .attr('class', 'val') // add class to text label\n\t .attr('x', function() {\n\t return xScale(d.artists);\n\t })\n\t .attr('y', function() {\n\t return yScale(d.popularity) - 15;\n\t })\n\t .text(function() {\n\t return d.popularity; // Value of the text\n\t });\n\t}", "function mouseover(d) {\n\n var percentage = (100 * d.value / totalSize).toPrecision(3);\n var percentageString = \" (\" + formatNumber(percentage) + \"%)\";\n var priceString = \"$\" + formatNumberNoDec(Math.round(d.value,2));\n if (percentage < 0.1) {\n percentageString = \"< 0.1%\";\n }\n\n d3.select(\"#percentage\")\n .text(percentageString);\n \n var detail = \" \" ;\n if (d.parent.name != \"root\"){\n\n var l2 = d.parent;\n if (l2.parent.name != \"root\"){\n var l1 = l2.parent;\n\n if (l1.parent.name != \"root\"){\n var l3 = l1.parent;\n detail += \" fue adquirido mediante \"+ toTitleCase(l1.name) + \" en \" + toTitleCase(l2.name) + \" a \" + l3.name + \" para \" + d.name ;\n }\n else {\n //tipo de compra de un proveedor para un item.\n detail += \" fue adquirido mediante \"+ toTitleCase(l1.name) + \" en \" + toTitleCase(l2.name) + \" a \" + d.name ;\n }\n }else {\n //tipo de compra de un proveedor.\n detail += \" adquirido mediante \"+ toTitleCase(l2.name) + \" en \" + toTitleCase(d.name); \n }\n \n }else {\n //tipo de compra.\n detail += \"fue adquirido mediante \"+ toTitleCase(d.name);\n }\n \n insertLinebreaks(d3.select('svg text.label'), detail);\n d3.select('svg text.price').text(priceString);\n d3.select('svg text.percentage').text(percentageString);\n \n\n var sequenceArray = getAncestors(d);\n //updateBreadcrumbs(sequenceArray, percentageString);\n\n // Fade all the segments.\n d3.selectAll(\"path\")\n .style(\"opacity\", 0.3);\n\n // Then highlight only those that are an ancestor of the current segment.\n vis.selectAll(\"path\")\n .filter(function(node) {\n return (sequenceArray.indexOf(node) >= 0);\n })\n .style(\"opacity\", 1);\n\n $('#chart').animate({ \n scrollLeft: 200\n }, 800);\n}", "function handleHoverEnter(){\n $(\".likeBtn\").html(likes + \" Likes\");\n }", "function mouseover(d)\r\n\t\t\t{\r\n\t\t\t\t$(\"#col2\").text(\"\");\r\n\t\t\t\tcontent.append(\"div\").attr(\"id\",\"iw-container\").append(\"div\").attr(\"class\",\"iw-title\").append(\"i\").attr(\"class\",\"fa fa-info-circle\")\r\n\t\t\t\t.attr(\"style\",\"padding-right:20px;font-weight:bold;\")\r\n \t\t\t.text(\"\t\"+d.name)// + \" - 2013 appropriations: \" + d.appropriation13 + \" - Which was a \" + d.percentChange13 + \"% change of the previous year.\")\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Orders: \" + format(d.appropriation14/10))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" New Customers: \" + format((d.appropriation13)))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Product Lines: \" + format((d.appropriation12)))\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.attr(\"id\", \"annotate\")\r\n\t\t\t\t.text(d.annotation)\r\n\t\t\t\tif (d.annotation2 != null)\r\n\t\t\t\t{\r\n\t\t\t\tcontent1.append(\"br\")\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.text(d.annotation2);\r\n\t\t\t\t}\r\n\r\n \t\t\t}", "function updateTally(outcome) {\n totalPoints += parseInt(outcome);\n \n // Draw tally using HTML\n tally = display_element.querySelector(\".tally\");\n tally.innerHTML = `Total Points: ${totalPoints}`\n \n }", "function showDetail(event, key, amount, count, percent) {\n\n // show tooltip with information from the __data__ property of the element\n var x_hover = 0;\n var y_hover = 0;\n\n var content = \"<b>\" + key + \"</b><br/>\";\n\n if (amount != null) content += \"<b>Amount: </b>\" + amount + \"<br/>\";\n if (count != null) content += \"<b>Count: </b>\" + count + \"<br/>\";\n if (percent != null) content += \"<b>Percent: </b>\" + percent + \"<br/>\";\n\n var tooltipWidth = parseInt(tooltip.style('width'));\n var tooltipHeight = parseInt(tooltip.style('height'));\n var classed,notClassed;\n \n if (event.pageX > document.body.clientWidth / 2) {\n x_hover = tooltipWidth + 30;\n classed = 'right';\n notClassed = 'left';\n } else {\n x_hover = -30;\n classed = 'left';\n notClassed = 'right';\n }\n \n // y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight + 4) : event.pageY - tooltipHeight / 2;\n y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight - 40) : event.pageY - tooltipHeight - 40;\n\n return tooltip\n .classed(classed,true)\n .classed(notClassed,false)\n .style({\n \"visibility\": \"visible\",\n \"top\": y_hover + \"px\",\n \"left\": (event.pageX - x_hover) + \"px\"\n })\n .html(content);\n}", "function arc_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n var num = 0;\n var average = 0;\n links.each(function (d) {\n num ++;\n total+= viz.value()(d.data);\n });\n\n total = d3.format(\",.0f\")(total);\n\n average = d3.format(\",.0f\")(total / num);\n // console.log('number: ' + num);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"NEWS SOURCE\", d.data.values[0].CMTE_NM,\"Sentiment index: \" + total);\n}", "mouseover(d) {\n var conType = _.has(d.data, \"conversion_type\") ? d.data.conversion_type : \"\";\n\n var percentage = (100 * d.value / this.totalSize).toPrecision(3);\n var percentageString = percentage + \"%\" + ' - ' + d.value;\n if (percentage < 0.5) {\n percentageString = \"< 1.00 %\";\n }\n var sequenceArray = d.ancestors().reverse();\n sequenceArray.shift();\n var last = typeof (sequenceArray[sequenceArray.length - 1]) !== \"undefined\" ? sequenceArray[sequenceArray.length - 1] : {};\n var converted = 0;\n var convertedAmmount = 0;\n //console.log(sequenceArray, d.value, percentage);\n if (typeof (last.children) !== \"undefined\") {\n last.children.forEach(function (co) {\n if (co.data.name == \"Conversion\") {//TODO: Adjust to nwe conversion\n converted = (100 * co.value / last.value).toPrecision(2);\n convertedAmmount = co.value;\n }\n });\n }\n this.updateDescription(sequenceArray, d.value, percentage, converted, convertedAmmount);\n this.updateBreadcrumbs(sequenceArray, d.value, percentage);\n // Fade all the segments.\n d3.selectAll(\"path\")\n .style(\"opacity\", 0.7);\n // Then highlight only those that are an ancestor of the current segment.\n d3.selectAll(\"path\")\n .filter(function (node) {\n return (sequenceArray.indexOf(node) >= 0);\n })\n .style(\"opacity\", 1);\n }", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n if(row.votecount != \"\") {\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\" (\"+row.percentage+\")\" + \"</li>\"\n }\n\t });\n\t return text;\n\t}", "function handleMouseOverBubble(d, i) {\n d3.select(this).attr(\"r\", d.radius * 1.2);\n\n document.getElementById(\"team-details\").classList.remove(\"closed\");\n document.getElementById(\"td-team-name\").innerHTML = d.Team;\n document.getElementById(\"td-test-status-year\").innerHTML =\n \"Started in \" + d.StartYear;\n\n document.getElementById(\"td-team-matches\").innerHTML = d.Mat.toLocaleString();\n document.getElementById(\"td-team-won\").innerHTML = d.Won.toLocaleString();\n document.getElementById(\"td-team-lost\").innerHTML = d.Lost.toLocaleString();\n document.getElementById(\"td-team-undecided\").innerHTML =\n d.Undecided.toLocaleString();\n document.getElementById(\"row-runs\").style.display = \"none\";\n}", "function handleMouseOver(d, i) { // Add interactivity\n\n // Specify where to put label of text\n svg.append(\"text\")\n .attr(\"id\", \"t\" + d.date.getTime() + \"-\" + d.time + \"-\" + i)\n .attr(\"x\", function() { return x(d.date) + left; })\n .attr(\"y\", function() { return y(d.time) + top - 5; })\n .attr(\"font-size\", \"12px\")\n .text(function() {\n var month = d.date.getMonth() + 1;\n var day = d.date.getDate();\n var year = d.date.getFullYear();\n var toPrintDate = month + \"/\" + day + \"/\" + year;\n return d.name + \": \" + toPrintDate + \", \" + ticks(d.time); // Value of the text\n });\n }", "function showLostSaleCount(lostCount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostCountLabel = document.createElement(\"DIV\");\n lostCountLabel.className = \"wonLostLabel\";\n lostCountLabel.appendChild(document.createTextNode(lostCount));\n $('#lostOpp').append(lostCountLabel);\n}", "function hoverPanelRelated () {\n $('.browseview .relatedContainer .panel').on({\n mouseenter: function () {\n $(this).children().css({'background-color': '#68C3A3', 'color': 'black', 'transition': 'all 0.3s ease', '-webkit-transform': 'scale(1.05)', '-ms-transform': 'scale(1.05)', 'transform': 'scale(1.05)'})\n },\n mouseleave: function () {\n $(this).children().css({'background-color': '#f5f5f5', 'color': '#717f86', 'transition': 'all 0.3s ease', '-webkit-transform': 'scale(1.0)', '-ms-transform': 'scale(1.0)', 'transform': 'scale(1.0)'})\n },\n click: function () {\n window.location = $(this).children('.viewbutton').attr('href')\n }\n })\n }", "function handle_mouseover(d, $this, show_click_directive=false) {\n // Setting all country wage groups to translucent\n $(\".country-wage-group\").attr(\"opacity\", 0.2);\n // Resetting the group currently being hovered over to opaque\n d3.select($this).attr(\"opacity\", 1);\n\n var tooltip = d3.select(\"#wageGapTooltip\");\n\n // Setting the position for tooltip\n tooltip.style(\"top\", (event.pageY+10)+\"px\").style(\"left\", (event.pageX+10)+\"px\");\n\n // Setting the content for tooltip\n $(\"#wageGapTooltip .meta\").hide();\n if (show_click_directive) {\n $(\"#wageGapTooltip .country-name\").show();\n tooltip.select(\".country-name-text\").html(d[\"Country\"]);\n $(\"#wageGapTooltip .click-directive\").show();\n } else {\n $(\"#wageGapTooltip .occupation-name\").show();\n tooltip.select(\".occupation-name-text\").html(d[\"Occupation\"]);\n $(\"#wageGapTooltip .click-directive\").hide();\n }\n tooltip.select(\".male-wage-text\").html(\"$\" + d[\"Male\"].toFixed(2));\n tooltip.select(\".female-wage-text\").html(\"$\" + d[\"Female\"].toFixed(2));\n tooltip.select(\".difference-text\").html(\"$\" + (d[\"Female\"] - d[\"Male\"]).toFixed(2));\n\n // Displaying the relevant indicator\n $(\"#wageGapTooltip .wage-gap .indicator\").hide();\n if(d[\"Female\"] - d[\"Male\"] > 0){\n $(\"#wageGapTooltip .wage-gap .increase\").show();\n } else {\n $(\"#wageGapTooltip .wage-gap .decrease\").show();\n }\n\n // Setting the tooltip as visible\n return tooltip.style(\"visibility\", \"visible\");\n }", "function printTotalCost() {\n $(\".totalCost span\").append(\"<p> $\"+totalCost+ \"</p>\");\n }", "function handleMouseover(d) {\n div.style(\"opacity\", 0.9)\n .style(\"left\", (d3.event.pageX + padding/2) + \"px\")\n .style(\"top\", d3.event.pageY + \"px\")\n .html(\"<p>\" + d.Name + \",&nbsp;\" + d.Nationality + \"</p><p>Year:\" + d.Year + \"&nbsp;&nbsp;&nbsp;Time:\" + timeFormat(d.Time) + \"&nbsp;&nbsp;&nbsp;Place:\" + d.Place + \"</p>\" + (d.Doping ? (\"<br><p>\" + d.Doping +\"</p\") : \"\"));\n}", "function mouseoverNode(d){\n\t\n\tvar disVal;\n\tif(showFlowIn){\n\t\tdisVal = \"Flow In Value: \"+d.flowInto;\n\t}\n\telse{\n\t\tdisVal = \"Flow Out Value: \"+d.flowOut;\n\t}\n\n\tdocument.getElementById(\"nodeval\").textContent = disVal;\n}", "function MemberReview(){\n $('.progress-rv').each(function (index,value){\n var datavalue=$(this).attr('data-value'),\n point=datavalue*10;\n $(this).append(\"<div style='width:\"+point+\"%'><span>\"+datavalue+\"</span></div>\")\n })\n }", "function render_total(data){\n\t return '<a href=\"\">'+data+' pessoa(s)</a>';\n\t}", "displayLives() {\r\n console.log(`\\nLives left: ${this.lives}`);\r\n }", "function calc(e){\n $el = $(this).find(' > .wrap');\n el = $el[0];\n $carousel = $el.parent();\n $indicator = $el.prev('.indicator');\n\n nextMore = prevMore = false; // reset\n\n containerWidth = el.clientWidth;\n scrollWidth = el.scrollWidth; // the \"<ul>\"\" width\n padding = 0.2 * containerWidth; // padding in percentage of the area which the mouse movement affects\n posFromLeft = $el.offset().left;\n stripePos = e.pageX - padding - posFromLeft;\n pos = stripePos / (containerWidth - padding*2);\n scrollPos = (scrollWidth - containerWidth ) * pos;\n \n if( scrollPos < 0 )\n scrollPos = 0;\n if( scrollPos > (scrollWidth - containerWidth) )\n scrollPos = scrollWidth - containerWidth;\n \n $el.animate({scrollLeft:scrollPos}, 200, 'swing');\n \n if( $indicator.length )\n $indicator.css({\n width: (containerWidth / scrollWidth) * 100 + '%',\n left: (scrollPos / scrollWidth ) * 100 + '%'\n });\n\n clearTimeout(animated);\n animated = setTimeout(function(){\n animated = null;\n }, 200);\n\n return this;\n }", "handleMouseOver (vis, event, d) {\n // console.log(\"hover over\", d);\n let leftPosition = event.pageX + 10 + \"px\";\n if (window.innerWidth - event.pageX < 500) {\n leftPosition = event.pageX - 300 + \"px\";\n }\n let census = vis.insights[d.count];\n let censusCount = d.count;\n let peopleCount = census ? census.total : 0;\n let censusPercent = vis.legendData.find(c => c.censusCount == d.count);\n censusPercent = censusPercent? censusPercent.censusPercent : 0;\n if ((d.count === 0 && vis.filters.length === 0) || !census) {\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n </div>`\n );\n } else if (d.count === 0) {\n let tipText = `<div>${peopleCount.toLocaleString(\"en\")} people with filter attribute</div> `;\n vis.filters.forEach(f => {\n tipText += `<div>${v2CheckBoxGuide[f].title}.</div> `;\n })\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n ${tipText}\n </div>`\n );\n } else {\n // They show up in a census\n let topPob = d3.greatest(census.pobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topAgeGroup = d3.greatest(census.ageMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCensus = d3.greatest(census.censusMap, (a, b) => d3.ascending(a[1], b[1]));\n let topGender = d3.greatest(census.genderMap, (a, b) => d3.ascending(a[1], b[1]));\n let topColor = d3.greatest(census.colorMap, (a, b) => d3.ascending(a[1], b[1]));\n let topJob = d3.greatest(census.jobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCounty = d3.greatest(census.countyMap, (a, b) => d3.ascending(a[1], b[1]));\n // console.log(topPob,topAgeGroup, topCensus );\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census</h5>\n <div> The ${peopleCount.toLocaleString(\"en\")} people in ${censusCount} census are most likely</div>\n <div> to be born in ${topPob[0]} living in ${upperCaseFirstLetters(topCounty[0])}, Nevada. </div> \n <div> Their first census was at age ${topAgeGroup[0]} in year ${topCensus[0]}. </div> \n <div> Gender \"${topGender[0]}\", \"color ${topColor[0]}\",\n and job \"${upperCaseFirstLetters(topJob[0])}\".</div> \n </div>`\n );\n }\n }", "function howManyGoals(player) {\n return player.eplGoals; // <== Highlight\n}", "function mouseover(d) {\n var shiftX = 10;\n var shiftY = 20;\n\n var mouseCoords = d3.mouse(this);\n d3.select(\"#tooltip\")\n .style(\"left\", function(d) {\n return mouseCoords[0] + shiftX + \"px\"\n })\n .style(\"top\", function(d) {\n return mouseCoords[1] + shiftY + \"px\"\n })\n .html(function() {\n if (d.energy[1990] == null || d.energy[currentYear][\"All products\"] == 0) return d.name + \": No data\";\n\n var all = d.energy[currentYear][\"All products\"];\n var renewable = d.energy[currentYear][\"Renewable energies\"];\n var per = renewable / all;\n\n hoverArrow(per);\n\n return \"<b>\" + d.name + \"</b><br/>\" + fmtPer(per) + \" renewables\"\n })\n .classed(\"hidden\", false);\n}", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n\t\tif (row.votecount.length != 0){\n\t \n\t\t\ttext += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n\t\t}\n\t });\n\n\t return text;\n\t}", "function gridOnHandler(){\r\n \r\n gridSimulatorVar.current_counter = 0\r\n paintGridOnHover(this)\r\n paintGridCounter(gridSimulatorVar.current_counter)\r\n\r\n}", "function logMouseEnter() {\n log('hover:scatterlegend', { numLabels })\n }", "function mouseover(d) {\n\t\tchart.append(\"text\")\n\t\t\t.attr(\"id\", \"interactivity\")\n\t\t\t.attr(\"y\", y(d.value) - 15)\n\t\t\t.attr(\"x\", x(d.year) + 23)\n\t\t\t.style(\"text-anchor\", \"start\")\n\t\t\t.style(\"font\", \"10px sans-serif\")\n\t\t\t.text(d.value);\n\n\t\td3.select(this)\n\t\t\t.style(\"fill\", \"darkblue\");\n\t}", "function process_count (repos) {\n var total = 0;\n repos.filter(function (r) {\n total += r.stargazers_count\n })\n \n //console.log('Total in github-starz.js : ' + total)\n user_callback(total);\n}", "tooltip_render (tooltip_data)\r\n\t{\r\n\t\t//var that=this;\r\n\t let text = \"<ul>\";\r\n\t // console.log(\"----\",tooltip_data);\r\n\t tooltip_data.forEach((row)=>{\r\n\t text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.value+\"%)\" + \"</li>\"\r\n\t });\r\n\r\n\t return text;\r\n\t}", "function getFinalSumResult() {\r\n $(document).ready(function () {\r\n $(\"#paymentSum\").mouseout(function () {\r\n if (flag) {\r\n let nds = $(\"#ndcInputFiled\").val();\r\n let finalResult = result * (1 + (+nds / 100));\r\n $(\"#resultSum\").val(parseFloat(finalResult).toFixed(2));\r\n } else {\r\n $(\"#resultSum\").val(\"\");\r\n }\r\n });\r\n });\r\n}", "function startCount(obj) {\n valueIncrease();\n valueDecrease();\n \n}", "mouseover(d) {\n\t\t\t// const percentage = (100 * d.value / this.totalSize).toPrecision(3);\n\t\t\t// let percentageString = `${percentage}%`;\n\t\t\t// if (percentage < 0.1) {\n\t\t\t// \tpercentageString = '< 0.1%';\n\t\t\t// }\n\n\t\t\t// const sequenceArray = this.getAncestors(d);\n\t\t\t// this.updateBreadcrumbs(sequenceArray, percentageString);\n\n\t\t\t// Fade all the segments.\n\t\t\t// d3.selectAll('.icicleNode')\n\t\t\t// \t.style('opacity', 0.3);\n\n\t\t\t// Then highlight only those that are an ancestor of the current segment.\n\t\t\t// this.hierarchy.selectAll('.icicleNode')\n\t\t\t// \t.filter(node => (sequenceArray.indexOf(node) >= 0))\n\t\t\t// \t.style('opacity', 1)\n\n\t\t\t// this.drawGuides(d)\n\t\t\tthis.$refs.ToolTip.render(d);\n\t\t}", "function display() {\n\t\tlet totFilteredRecs = ndx.groupAll().value();\n\t\tlet end = ofs + pag > totFilteredRecs ? totFilteredRecs : ofs + pag;\n\t\td3.select('#begin').text(end === 0 ? ofs : ofs + 1);\n\t\td3.select('#end').text(end);\n\t\td3.select('#last').attr('disabled', ofs - pag < 0 ? 'true' : null);\n\t\td3.select('#next').attr(\n\t\t\t'disabled',\n\t\t\tofs + pag >= totFilteredRecs ? 'true' : null\n\t\t);\n\t\td3.select('#size').text(totFilteredRecs);\n\t\tif (totFilteredRecs != ndx.size()) {\n\t\t\td3.select('#totalsize').text('(Unfiltered Total: ' + ndx.size() + ')');\n\t\t} else {\n\t\t\td3.select('#totalsize').text('');\n\t\t}\n\t}", "function mouseover(d) {\n const percentageString = `${d.value}`;\n const textForClosed = ' of them have been ';\n const textForOpen = ' of them are still ';\n\n const percentageStr = ' issues have been created by ';\n\n switch (d.name) {\n case 'open':\n d3.select('#percentage')\n .text(d.value);\n d3.select('#info-text-nbIssues')\n .text(textForOpen)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(`${d.name}ed`);\n break;\n case 'closed':\n d3.select('#percentage')\n .text(d.value);\n d3.select('#info-text-nbIssues')\n .text(textForClosed)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(d.name);\n break;\n default:\n d3.select('#percentage')\n .text(percentageString);\n d3.select('#info-text-nbIssues')\n .text(percentageStr)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(`${d.name}.`);\n }\n\n d3.select('#explanation')\n .style('top', '240px');\n\n const sequenceArray = getAncestors(d);\n updateBreadcrumbs(sequenceArray, percentageString);\n\n // Fade all the segments.\n d3.selectAll('path')\n .style('opacity', 0.3);\n\n // Then highlight only those that are an ancestor of the current segment.\n vis.selectAll('path')\n .filter(node => (sequenceArray.indexOf(node) >= 0))\n .style('opacity', 1);\n}", "function onMouseoverChart(e) {\n if (e['target'] === 'node') {\n var nodeSplit = e['targetid'].split('-');\n var nodeId = nodeSplit[nodeSplit.length - 1];\n if (Number.isInteger(parseInt(nodeId)) && parseInt(nodeId) < globalEnergyData['values'].length) {\n renderPieChart(parseInt(nodeId));\n }\n } \n }", "tooltip_render (tooltip_data) {\n let text = \"<ul>\";\n tooltip_data.result.forEach((row)=>{\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n });\n\n return text;\n }", "function calcTotal (){\n totalLabel.innerHTML = 'Total: $' + value;\n}", "render() {\n // Define this vis\n const vis = this;\n\n // Bind and modify - using 'datum' method to bind a single datum\n vis.topCounterEl.datum(vis.resultsCount)\n .text('Results Count: ')\n .append('span')\n .text(d => d);\n }", "function handle_mouseover (a, geojson_data) {\n const lan_name = geojson_data.properties.LnNamn\n const lan_kod = geojson_data.properties.LnKod\n const lan_cases = get_age_data_by_county_and_age_group(lan_name, agespan)\n d3.select('#data_div')\n .html(\n '<div class=\"lan\">' + lan_name + ' </div>' +\n '<br/>' +\n 'Sjukdomsfall: ' + lan_cases +\n '<br/>'\n )\n const this_path = d3.select(this)\n tmp_colour = this_path.attr('fill')\n this_path.attr('fill', '#f00')\n}", "update() {\n this.shadow.innerHTML = `<div> <b> Count: </b> ${this.currentCount} </div>`;\n }", "function updateBagCount($ul) {\n\t\tvar parentDiv = $ul.parent().prev();\n\t\t//alert( parentDiv.html ())\n\t\tvar $countHold = $(\" small span\" ,parentDiv);\n\t\tvar count = $ul.find(\"li\").length;\n\t\t$countHold.text(count)\n\t}", "function incrementCount(params) {\n\t// increase count by 1 per each 'next' arrow click\n\tcardCount++;\n\tif (cardCount > energetics.length) {\n\t\tcardCount = 1;\n\t}\n\tcurCard.innerText = cardCount;\n}", "function addexptototal()\n {\n const expobj={};\n //read the value of inputamt\n const textamt=inputele.value;\n\n const textdesc=inputele2.value;\n \n //convert it to number\n const exp=parseInt(textamt,10);\n\n expobj.desc=textdesc;\n expobj.amt=textamt;\n expobj.moment=new Date();\n\n allexp.push(expobj);\n \n \n //add that value to totalvalue\n totalexp=totalexp+exp;\n \n hele.textContent=totalexp;\n\n const headingtext=`Total :: ${totalexp}`;\n hele.textContent=headingtext;\n\n renderlist(allexp);\n \n }", "function handleMouseOverPie() {\n // remove old mouse event elements\n svg.selectAll(\".percentage\").remove();\n\n // get margins from container\n var margins = getMargins(\".containerGraph3\")\n\n // select this item\n d3.select(this)\n .attr(\"stroke\", \"white\")\n .style(\"stroke-width\", \"3px\")\n .style(\"stroke-opacity\", 0.6)\n\n // append text to the side of the pie with the percentages\n svg.append(\"text\")\n .attr(\"class\", \"percentage\")\n .text(\"Geslaagd: \" + percentagePassed + \"%\")\n .attr(\"x\", margins.width / 5)\n .attr(\"y\", -margins.height / 2.3)\n .attr(\"font-size\", 24)\n .attr(\"font-family\", \"Arial\")\n .attr(\"fill\", \"white\")\n .transition().duration(200)\n .attr(\"opacity\", 0.9)\n\n // append text\n svg.append(\"text\")\n .attr(\"class\", \"percentage\")\n .text(\"Gezakt: \" + percentageFailed + \"%\")\n .attr(\"x\", margins.width / 5)\n .attr(\"y\", -margins.height / 2.3+ 30)\n .attr(\"font-size\", 24)\n .attr(\"font-family\", \"Arial\")\n .attr(\"fill\", \"white\")\n .transition().duration(200)\n .attr(\"opacity\", 0.9)\n }", "function getDuracaoTotal(lead) {\n return new Date() - lead.dataOrigemLead;\n}", "function setTopoPetsCaught(){\n\tdocument.getElementById(\"topoPetsFoundTitle\").innerHTML = \"<p> Recorder: \" + topoPetsCaught.total() + \"/\" + getTotalAmountTopoPets() + \" <br/><progress id='health' value=\" + topoPetsCaught.total() + \" max=\" + getTotalAmountTopoPets() + \" style='height:1vh;width:60%;'>\";\n}", "function scoreCount(bullet) {\n if (d[bullet].style.backgroundColor == blockColor) {\n d[bullet].style.backgroundColor = bulletColor;\n score = score + 1;\n document.getElementById(\"points\").innerText = score;\n } else {\n d[bullet].style.backgroundColor = bulletColor;\n }\n}", "function mouseover(p) {\n tooltip.style(\"visibility\", \"visible\");\n tooltip.html(names[p.y] + \" vs \" + names[p.x] + \" - Total Meetings: \" + (matrix[p.x][p.y].z + matrix[p.y][p.x].z) + \". <br/>\" + names[p.y] + \" has won \" + p.z + \" of them.\");\n d3.selectAll(\".row text\").classed(\"active\", function(d, i) {\n return i == p.y;\n });\n d3.selectAll(\".column text\").classed(\"active\", function(d, i) {\n return i == p.x;\n });\n }", "display_agent(agent){\n this.single_agent.selectAll(\"p\")\n\t\t .data(build_string(agent).split(\"\\n\"))\n\t \t .transition()\n .duration(100)\n .text((d)=>{return (d);});\n\n }", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function sum(){\n setCount(count+1)\n }", "function IndicadorTotal () {}", "function handleMouseOver(d) { // Add interactivity\r\n\t// while (d3.select(\".detail_text_title\").empty() != true) {\r\n\t// d3.select(\".detail_text_title\").remove(); // Remove text location\r\n\t// }\r\n\t// while (d3.select(\".detail_text_sentence\").empty() != true) {\r\n\t// d3.select(\".detail_text_sentence\").remove(); // Remove text location\r\n\t// }\r\n\twhile (d3.select(\".detail_text_no_event\").empty() != true) {\r\n\t d3.select(\".detail_text_no_event\").remove(); // Remove text location\r\n\t}\r\n\twhile (d3.select(\".detail_div\").empty() != true) {\r\n\t d3.select(\".detail_div\").remove(); // Remove text location\r\n\t}\r\n\r\n\t// DETAIL PART\r\n var match_event = []\r\n x = d3.mouse(this)[0] + 20\r\n // y_hover = d3.mouse(this)[1] - \r\n\ty_hover = y(d.subscriber_gain) - 50\r\n\td3.tsv('data/event.txt', function(data) {\r\n\t\tfor (id in data) {\r\n\t\t\t// console.log(data[id])\r\n\t\t\tif (d.year == data[id].year) {\r\n\t\t\t\tif (d.month == data[id].month) {\r\n\t\t\t\t\tmatch_event.push(data[id])\r\n\t\t\t\t\t// console.log(match_event)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// selecting\r\n\t detail_text_div = d3.select(\".hover_info_div\").append(\"div\").attr(\"class\", \"detail_div\")\r\n\r\n\t console.log(\"AAA\" )\r\n\r\n\t detail_text_div.append(\"p\").attr(\"class\", \"month_year_name\").text(monthNames[parseInt(d.month)-1] + ' ' + d.year)\r\n\r\n \t\tdetail_text_div.append(\"ol\")\r\n \t\tid_show = 1\r\n\t \tfor (id_event in match_event) {\r\n\t \t\tdetail_text_div.append(\"b\").attr(\"class\", \"detail_text_title\").text(id_show+\". \"+match_event[id_event].ttitle)\r\n\t \t\tdetail_text_div.append(\"div\").attr(\"class\", \"detail_text_sentence\").text(match_event[id_event].detail)\r\n\t \t\tdetail_text_div.append(\"br\")\r\n\t \t\tid_show+=1\r\n\t \t}\r\n\t \tif (d3.select(\".detail_text_sentence\").empty()) {\r\n\t \t\tdetail_text_div.append(\"p\").attr(\"class\", \"detail_text_no_event\").text(\"No special event in this month\")\r\n\t \t}\r\n\t})\r\n\r\n\t// BOX PART\r\n var match_event = []\r\n x = d3.mouse(this)[0] + 20\r\n // y_hover = d3.mouse(this)[1] - \r\n\ty_hover = y(d.subscriber_gain) - 50\r\n\r\n var text = svg.append(\"text\")\r\n .attr(\"id\", \"hover_bar\")\r\n .attr(\"fill\", \"white\")\r\n .attr(\"font-size\", \"15\")\r\n .attr(\"x\", function(d) {\r\n \treturn x;\r\n }).attr(\"y\", function(d) {\r\n \treturn y_hover; // - count_line*20;\r\n })\r\n\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Month/Year : \" + d.month + '-' + d.year)\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Subcriber gain : \" + d.subscriber_gain)\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Subcriber total : \" + d.subscriber_total)\r\n\r\n\tvar bbox = text.node().getBBox();\r\n\r\n\tvar rect = svg.append(\"rect\")\r\n\t .attr(\"id\", \"hover_bar_box\")\r\n\t .attr(\"x\", bbox.x - 5)\r\n\t .attr(\"y\", bbox.y - 5)\r\n\t .attr(\"width\", bbox.width + 10)\r\n\t .attr(\"height\", bbox.height + 10)\r\n\t .style(\"fill\", \"#000\")\r\n\t .style(\"fill-opacity\", \"0.2\")\r\n\t .style(\"stroke\", \"#fff\")\r\n\t .style(\"stroke-width\", \"1.5px\");\r\n }", "function onMouseMove(obj, e)\n {\n //trace(\"onMouseMove\", obj, e);\n var snumber = obj._id;\n var seriesInfo = pThis.series[snumber];\n var seriesObj;\n\n if (seriesInfo && seriesInfo.keyData != 0)\n {\n seriesObj = {\n datapoint: [seriesInfo.percent, seriesInfo.data],\n dataIndex: 0,\n series: seriesInfo,\n seriesIndex: snumber\n }\n pThis._checkPieHighlight(obj, seriesObj);\n pThis._moveTooltip(obj, e);\n }\n }", "showTotals() {\n //const infectious2 = this.chart.chart.data.datasets[0].data\n const infectious1 = this.chart.chart.data.datasets[1].data\n const infectious1Val = infectious1[infectious1.length-1]\n\n const susceptible = this.chart.chart.data.datasets[2].data\n const susceptibleVal = susceptible[susceptible.length-1]\n const nSusceptible = susceptibleVal-infectious1Val\n\n const vaccinated = this.chart.chart.data.datasets[3].data\n const vaccinatedVal = vaccinated[vaccinated.length-1]\n const nVaccinated = vaccinatedVal-susceptibleVal\n\n const removed = this.chart.chart.data.datasets[4].data\n const removedVal = removed[removed.length-1]\n const nRemoved = removedVal-vaccinatedVal\n\n const dead = this.chart.chart.data.datasets[5].data\n const deadVal = dead[dead.length-1]\n const nDead = deadVal-removedVal\n\n let hospitalDeaths = 0\n this.sender.q1.pts.forEach(pt => hospitalDeaths += pt.status==Point.DEAD ? 1 : 0)\n\n const yDiff = TEXT_SIZE_TOTALS+15\n\n strokeWeight(0)\n stroke(0)\n fill(\"#000000dd\")\n rect(RECT_X_TOTALS, RECT_Y_TOTALS, RECT_W_TOTALS, RECT_H_TOTALS, RECT_RADIUS_TOTALS)\n textSize(TEXT_SIZE_TOTALS)\n textAlign(LEFT, TOP)\n fill(COLOR_LIGHT_GRAY)\n text(`Simulation Complete!`, TEXT_X_TOTALS+80, TEXT_Y_TOTALS)\n text(`Total Unaffected: ${nSusceptible+nVaccinated}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff)\n text(`Total Infected: ${dead[dead.length-1]-nSusceptible-nVaccinated}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*2)\n text(`Total Recovered: ${nRemoved}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*3)\n text(`Total Dead: ${nDead}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*4)\n text(`Deaths due hospital overcrowding: ${hospitalDeaths}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*5)\n this.drawResetArrow()\n }", "function mouseoverHandler (d) {\n tooltip.transition().style('opacity', .9)\n tooltip.html('<p>' + d[\"attribute\"] + '</p>' );\n }", "function calculateTip(amount, service, people) {\n const totalTip = (amount * service)/people;\n console.log(totalTip); \n renderTip(totalTip);\n}", "function createMousoverHtml(d) {\n\n var html = \"\";\n html += \"<div class=\\\"tooltip_kv\\\">\";\n html += \"<span class=\\\"tooltip_key\\\">\";\n html += d['Item'];\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Total Accidents: \"\n try {\n html += (d[\"Total_Accidents\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: \"\n html += (d[\"Fatal\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: \"\n html += (d[\"Serious\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: \"\n html += (d[\"Minor\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: \"\n html += (d[\"Uninjured\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>VMC: \"\n html += (d[\"VMC\"]);\n html += \" IMC: \"\n html += (d[\"IMC\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Destroyed: \"\n html += (d[\"Destroyed_Damage\"]);\n html += \" Substantial: \"\n html += (d[\"Substantial_Damage\"]);\n html += \" Minor: \"\n html += (d[\"Minor_Damage\"]);\n }\n catch (error) {\n html = html.replace(\"<a>Total Accidents: \", \"\")\n html += \"<a>Total Accidents: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: 0\"\n }\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"</div>\";\n $(\"#tooltip-container-scatter\").html(html);\n $(this).attr(\"fill-opacity\", \"0.8\");\n $(\"#tooltip-container-scatter\").show();\n\n //quello commentato ha senso, ma scaja\n //var map_width = document.getElementById('scatter').getBoundingClientRect().width;\n var map_width = $('scatter')[0].getBoundingClientRect().width;\n //console.log($('scatter'))\n\n //console.log('LAYER X ' + d3.event.layerX)\n //console.log('LAYER Y ' + d3.event.layerY)\n\n if (d3.event.layerX < map_width / 2) {\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX + 15) + \"px\");\n } else {\n var tooltip_width = $(\"#tooltip-container-scatter\").width();\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX - tooltip_width - 30) + \"px\");\n }\n}", "function Summary(container_id) {\n var m_data_source = null;\n var m_panel = new JSPanel(container_id);\n var m_rpt_shipping_fee = new JSRepeater('rep_shipping_fee_real');\n var m_rpt_dangdang_money = new JSRepeater('rep_dangdang_money');\n var m_rep_collection_promotion = new JSRepeater('rep_collection_promotion');\n var m_rep_order_promotion = new JSRepeater('rep_order_promotion');\n\tvar m_rpt_overseas_tax = new JSRepeater('rep_overseas_tax_real');\n\n var promo_expand_status = true;\n var shipping_fee_expand_status = true;\n var coupon_expand_status = true;\n var giftcard_expand_status = true;\n\tvar overseas_tax_expand_status = true;\n\n var obj_coupon_money_real = null;\n var obj_rep_dangdang_money = null;\n var obj_rep_order_promotion = null;\n var obj_rep_collection_promotion = null;\n var obj_rep_shipping_fee_real = null;\n\tvar obj_rep_overseas_tax_real = null;\n\t\n\tvar order_count = 0;\n\t\n\tvar is_show_free_oversea = false;\n\t\n\tvar deposit_presale_type = 0; //1代表全款支付,2代表定金和尾款分开支付\n\n this.show = function (result) {\n bindTemplate();\n addEvents();\n\n // get_order_submit_tips(m_data_source[\"is_agree\"]);\n\n //验证码\n yzmInit();\n\n //支付密码\n payPasswordInit();\n\n $1('btn_change_yzm').onclick = function () { changeYZMMarked(); };\n\n $1('ck_protocol').onclick = function () { check_protocol(); };\n }\n\n this.setDataSource = function (data_source) {\n m_data_source = data_source;\n m_panel.DataSource = data_source;\n\n m_rpt_shipping_fee.DataSource = data_source['order_list'];\n m_rpt_dangdang_money.DataSource = data_source['order_list'];\n m_rep_collection_promotion.DataSource = data_source['collection_deduct_info'];\n\n m_rep_order_promotion.DataSource = data_source['order_promotion'];\n m_rpt_overseas_tax.DataSource = data_source['order_list'];\n\n if (m_data_source[\"presale_type\"] == null) {\n deposit_presale_type = 0;\n } else {\n deposit_presale_type = m_data_source[\"presale_type\"];\n }\n }\n\n this.setSubmit = function (order_flow_submit) {\n m_order_flow_submit = order_flow_submit;\n }\n\n this.setYzmStatus = function (is_no_safe_ip) {\n m_data_source['is_no_safe_ip'] = is_no_safe_ip;\n }\n\n this.isNoSafeIp = function () {\n return m_data_source['is_no_safe_ip'];\n }\n\n var get_order_submit_tips = function (is_agree) {\n var order_submit_tips = $1('order_submit_tips');\n if (order_submit_tips != null) {\n if (!is_agree) {\n order_submit_tips.innerHTML = P_ORDER_SUBMIT_PROTOCOL_TIPS;\n $1('order_submit_tips').className = \"\";\n }\n else\n $1('order_submit_tips').className = \"objhide\";\n }\n }\n\n\n this.setSubmitErrorTips = function (submit_error_tips) {\n if (submit_error_tips)\n $s($1('order_submit_error_tips_bar'));\n else\n $h($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = submit_error_tips;\n }\n\n //点了提交按钮后的按钮变化\n this.setDisabled = function () {\n $disabled('submit');\n $wait('submit');\n }\n this.setEnabled = function () {\n $enabled('submit');\n $1('submit').style.cursor = 'pointer';\n }\n\n var check_protocol = function () {\n if ($1('ck_protocol').checked)\n $1('submit').className = \"btn btn-super-orange\";\n else\n $1('submit').className = \"btn btn-super-orange btn-super-disabled\";\n }\n\n var ipt_yzm_keyup = function (o, e) {\n var k = null;\n if (e) {\n k = e.keyCode;\n }\n else if (event) {\n k = event.keyCode;\n }\n\n if (k == 9)\n return;\n\n var ov = o.value;\n var lisi = null;\n var j = 0;\n for (var i = 0; i < yzm_array_len; i++) {\n lisi = obj_ipt_yzm_lis[i];\n if (lisi.innerHTML.startsWith(ov)) {\n $s(lisi);\n j++;\n }\n else $h(lisi);\n }\n\n if (j < 2) {\n $h(obj_ipt_yzm);\n }\n else if (j < 10) {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = 'auto';\n }\n else {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = '100px';\n }\n };\n\n var li_c = function (t) { t.className = 'li_bg'; };\n var li_r = function (t) { t.className = ''; }\n var ipt_yzm_focus = function (o) {\n\n clearYzmTips(o);\n var li_ck = function (t) { o.value = t.innerHTML; $h(obj_ipt_yzm); o.style.color = '#404040'; };\n var sb = new StringBuilder();\n for (var i = 0; i < yzm_array_len; i++) {\n sb.append(\"<li>\");\n sb.append(i);\n sb.append('</li>');\n }\n obj_ipt_yzm.innerHTML = sb.toString();\n obj_ipt_yzm_lis = obj_ipt_yzm.childNodes;\n for (var i = 0; i < yzm_array_len; i++) {\n obj_ipt_yzm_lis[i].onmouseover = function () { li_c(this); };\n obj_ipt_yzm_lis[i].onmouseout = function () { li_r(this); };\n obj_ipt_yzm_lis[i].onclick = function () { li_ck(this); };\n }\n var pos = getposOffset_c(o);\n setLocation(obj_ipt_yzm, pos[0] + 3, pos[1] + 20);\n setDimension(obj_ipt_yzm, 85, 100);\n\n if (yzm_array_len < 8)\n obj_ipt_yzm.style.height = 'auto';\n\n\n show_ipt_yzm(obj_ipt_yzm, o);\n };\n\n var show_ipt_yzm = function (z, o) {\n $s(z);\n if (document.addEventListener) {\n document.addEventListener('click', documentonclick, false);\n }\n else {\n document.attachEvent('onclick', function (e) { documentonclick(); });\n }\n\n function documentonclick() {\n var evt = arguments[0] || window.event;\n var sender = evt.srcElement || evt.target;\n\n if (!contains(z, sender) && sender != o) {\n $h(z);\n if (document.addEventListener) {\n document.removeEventListener('click', documentonclick, false);\n }\n else {\n document.detachEvent('onclick', function (e) { documentonclick(); });\n }\n }\n };\n };\n\n // show error\n function showError(error) {\n SubmitData.error = error;\n }\n // show bind error\n function showSubmitError(errorCode) {\n var error;\n switch (errorCode) {\n case 1:\n case 5:\n case 6:\n case 9:\n case 10:\n case 11:\n error = \"请填写正确的卡号\";\n break;\n case 7:\n error = \"请填写正确的密码\";\n break;\n case 12:\n error = \"激活失败\";\n break;\n default:\n error = \"礼券绑定失败\";\n }\n showError(error);\n }\n\n // clear error\n function clearError() {\n couponData.error = null;\n }\n\n function yzmInit() {\n changeYZMMarked();\n // obj_ipt_yzm = $1('ul_ipt_yzm');\n //\t $1('ipt_yzm').onkeyup=function(e){ipt_yzm_keyup(this,e);};\n\n if (m_data_source['is_no_safe_ip'] == 0) {\n $h($1('div_yzm_word'));\n }\n\n }\n\n function payPasswordInit() {\n\n var isEnable = m_data_source['payment_password_enabled'] == 1;\n isEnable = isEnable \n \t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']));\n if (isEnable) {\n if (m_data_source['is_set_payment_password']) {\n ShowOrClosePayPassWord(3);\n }\n else {\n ShowOrClosePayPassWord(0);\n }\n }\n else {\n ShowOrClosePayPassWord(2);\n }\n }\n\n function bindTemplate() {\n if (m_data_source['order_list'] != null && m_data_source['order_list'].length > 0) {\n order_count = m_data_source['order_list'].length;\n }\n m_panel.Template = ORDER_SUMMARY_TEMPLATE;\n m_data_source['bargin_total'] = formatFloat(m_data_source['bargin_total']);\n m_data_source['shipping_fee'] = formatFloat(m_data_source['shipping_fee']);\n m_data_source['promo_discount_amount'] = formatFloat(m_data_source['promo_discount_amount']);\n m_data_source['coupon_amount'] = formatFloat(m_data_source['coupon_amount']);\n m_data_source['cust_cash_used'] = formatFloat(m_data_source['cust_cash_used']);\n m_data_source['payable_amount'] = formatFloat(m_data_source['payable_amount']);\n m_data_source['gift_card_charge'] = formatFloat(m_data_source['gift_card_charge']);\n m_data_source['total_gift_package_price'] = formatFloat(m_data_source['total_gift_package_price']);\n m_data_source['gift_package_price'] = formatFloat(m_data_source['gift_package_price']);\n m_data_source['gift_package_price_tips'] = formatFloat(m_data_source['gift_package_price_tips']);\n m_data_source['greetingcard_price'] = formatFloat(m_data_source['greetingcard_price']);\n m_data_source['privilege_code_discount_amount'] = formatFloat(m_data_source['privilege_code_discount_amount']);\n m_data_source['point_deduction_amount'] = formatFloat(m_data_source['point_deduction_amount']);\n //定金和尾款金额格式化\n m_data_source['deposit_amount'] = formatFloat(m_data_source['deposit_amount']);\n m_data_source['balance_amount'] = formatFloat(m_data_source['balance_amount']);\n\t\t\n //礼品卡和礼券总金额\n m_data_source[\"coupon_and_giftcard_money_used\"]=formatFloat((+m_data_source[\"gift_card_money_used\"])+(+m_data_source[\"coupon_amount\"]));\n m_data_source[\"gift_card_money_used\"]=formatFloat(m_data_source[\"gift_card_money_used\"]);\n m_data_source[\"coupon_used\"]=formatFloat(m_data_source[\"coupon_amount\"]);\n\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['overseas_tax']);\n\t\tif(parseFloat(m_data_source['overseas_tax']) == 0){\n\t\t\tis_show_free_oversea = true;\n\t\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['free_overseas_tax']);\n\t\t} \n\t\t\n\t\t\n if (m_data_source['payable_amount'] >= 1000) {\n m_data_source['payable_amount_style'] = \"f14\";\n }\n else {\n m_data_source['payable_amount_style'] = \"f18\";\n }\n //先取值,防止设置设置支付密码后,给输入框赋了值,但重新绑定后丢失。\n var payment_password = $F(\"input_pay_password\");\n m_panel.DataBind();\n if (payment_password)\n $1(\"input_pay_password\").value = payment_password;\n\n obj_coupon_money_real = $1(\"coupon_money_real\");\n obj_rep_dangdang_money = $1(\"rep_dangdang_money\");\n obj_rep_order_promotion = $1(\"rep_order_promotion\");\n obj_rep_collection_promotion = $1(\"rep_collection_promotion\");\n obj_rep_shipping_fee_real = $1(\"rep_shipping_fee_real\");\n\t\tobj_rep_overseas_tax_real = $1(\"rep_overseas_tax_real\");\n\n\t\tif (deposit_presale_type == 1) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else if (deposit_presale_type == 2) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else {\n\t\t $1(\"div_deposit_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"div_agree_pay_deposit\").className = 'hide';\n\t\t}\n $1(\"total_shipping_fee_real\").className = 'hide';\n $1(\"total_promo_amount_real\").className = 'hide';\n $1(\"total_coupon_real\").className = 'hide';\n $1(\"total_gift_card_charge\").className = 'hide';\n $1(\"total_cust_cash_real\").className = 'hide';\n $1(\"total_cust_point_real\").className = 'hide';\n $1(\"rep_collection_promotion\").className = 'hide';\n $1(\"total_discount_code_real\").className = 'hide';\n $1(\"total_gift_package_price\").className = 'hide';\n $1(\"gift_package_price\").className = 'hide';\n $1(\"total_privilege_code_discount_amount\").className = 'hide';\n $1(\"greetingcard_price\").className = 'hide';\n\t\t$1(\"total_overseas_tax_real\").className = 'hide';\n\t\t$1(\"total_energy_saving_subsiby_amout\").className = 'hide';\n if (m_data_source['shipping_fee'] > 0) {\n $1(\"total_shipping_fee_real\").className = '';\n m_rpt_shipping_fee.ItemTemplate = RPT_SHIPPING_FEE_ITEM_TEMPLATE;\n m_rpt_shipping_fee.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_shipping_fee'] > 0) {\n dataItem['order_shipping_fee'] = formatFloat(dataItem['order_shipping_fee']);\n }\n else {\n dataItem['shipping_fee_display'] = 'hide';\n }\n }\n m_rpt_shipping_fee.DataBind();\n }\n\t\tif(m_data_source['energy_saving'] == true) {\n\t\t\t$1(\"total_energy_saving_subsiby_amout\").className = \"\";\n\t\t}\n\t\tif (m_data_source['is_overseas'] == true) {\n\t\t\t\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"default\";\n\t\t\t} else {\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"\";\n\t\t\t}\n $1(\"total_overseas_tax_real\").className = '';\n m_rpt_overseas_tax.ItemTemplate = RPT_OVERSEAS_TAX_ITEM_TEMPLATE;\n m_rpt_overseas_tax.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['is_overseas'] == true) {\n\t\t\t\t\tif(formatFloat(dataItem['overseas_tax']) == 0){\n\t\t\t\t\t\tdataItem['default_class'] = \"default\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['free_overseas_tax']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdataItem['default_class'] = \"\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['overseas_tax']);\n\t\t\t\t\t}\n }\n else {\n dataItem['overseas_tax_display'] = 'hide';\n }\n }\n m_rpt_overseas_tax.DataBind();\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$(\"#oversea_icon_free\").show();\n\t\t\t} else {\n\t\t\t\t$(\"#oversea_icon_free\").hide();\n\t\t\t}\n\t\t\tif(order_count == 1){\n\t\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t\t}\n }\n if (m_data_source['promo_discount_amount'] > 0) {\n $1(\"total_promo_amount_real\").className = '';\n if (m_data_source['collection_deduct_info']!=undefined && m_data_source['collection_deduct_info'].length > 0) {\n $1(\"rep_collection_promotion\").className = '';\n m_rep_collection_promotion.ItemTemplate = RPT_PROMOTION_ITEM_TEMPLATE;\n m_rep_collection_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_direct_discount_amount'] > 0) {\n dataItem['order_direct_discount_amount'] = formatFloat(dataItem['order_direct_discount_amount']);\n }\n else {\n dataItem['order_direct_discount_amount'] = 'hide';\n }\n dataItem['collection_promotion_desc_tips'] = dataItem['collection_promotion_desc'];\n dataItem['collection_promotion_desc'] = nTruncate(dataItem['collection_promotion_desc'], 10);\n }\n m_rep_collection_promotion.DataBind();\n }\n\n m_rep_order_promotion.ItemTemplate = RPT_ORDER_PROMOTION_ITEM_TEMPLATE;\n m_rep_order_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n\n if (dataItem['order_prom_subtract'] > 0) {\n $s($1(\"rep_order_promotion\"));\n dataItem['order_prom_subtract'] = formatFloat(dataItem['order_prom_subtract']);\n }\n else {\n dataItem['order_promotion_display'] = 'hide';\n }\n dataItem['shop_promo_msg_tips'] = dataItem['shop_promo_msg'];\n dataItem['shop_promo_msg'] = nTruncate(dataItem['shop_promo_msg'], 10);\n }\n m_rep_order_promotion.DataBind();\n }\n \n //if(+m_data_source[\"coupon_and_giftcard_money_used\"]>0){ \n \t //礼品卡显示\n $1(\"total_giftcard_real\").className = 'hide';\n if(+m_data_source[\"gift_card_money_used\"]>0){ \t \n \t$1(\"total_giftcard_real\").className = '';\n m_rpt_dangdang_money.ItemTemplate = RPT_COUPON_ITEM_TEMPLATE;\n m_rpt_dangdang_money.onItemDataBind = function (dataItem) {\n if (+dataItem['cust_gift_card_used'] > 0) {\n \t dataItem['cust_gift_card_used'] = formatFloat(dataItem['cust_gift_card_used']);\n }\n else {\n dataItem['coupon_amount_display'] = 'hide';\n }\n };\n m_rpt_dangdang_money.DataBind(); \n }\n \n if (m_data_source['coupon_used'] > 0) {\n \t$1(\"total_coupon_real\").className = '';\n switch (+m_data_source['coupon_type']) {\n case 1:\n case 9: \n obj_coupon_money_real.className = 'p-child';\n break; \n case 4:\n $1(\"total_discount_code_real\").className = '';\n $1(\"total_coupon_real\").className = 'hide';\n break;\n default:\n break;\n }\n \n }\n \n\n\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"total_gift_package_price\");\n }\n\n if (m_data_source['gift_package_price'] == 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"greetingcard_price\");\n }\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] == 0) {\n $S(\"gift_package_price\");\n }\n\n\n if (+m_data_source['gift_card_charge'] > 0) {\n $1(\"total_gift_card_charge\").className = '';\n }\n\n if (m_data_source['cust_cash_used'] > 0) {\n $S(\"total_cust_cash_real\");\n }\n if (m_data_source['point_deduction_amount'] > 0) {\n $S(\"total_cust_point_real\");\n }\n if (!m_data_source['is_agree']) {\n $s($1('div_ck_protocol'));\n }\n if (+m_data_source['privilege_code_discount_amount'] > 0) {\n $1(\"total_privilege_code_discount_amount\").className = '';\n }\n }\n\n\n function getEvent() {\n if (document.all) {\n return window.event; //for ie\n }\n func = getEvent.caller;\n while (func != null) {\n var arg0 = func.arguments[0];\n if (arg0) {\n if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof (arg0) == \"object\" && arg0.preventDefault && arg0.stopPropagation)) {\n return arg0;\n }\n }\n func = func.caller;\n }\n return null;\n }\n\n // events\n function addEvents() {\n if (deposit_presale_type == 2) {\n $1('presale_mobile').onkeydown = function () {\n $1('presale_mobile').className = \"input-w87\";\n $h($1('order_submit_error_tips_bar'));\n var ev = getEvent();\n if (ev.keyCode >= 48 && ev.keyCode <= 57) { return; }\n if (ev.keyCode >= 96 && ev.keyCode <= 105) { return; }\n if (ev.keyCode == 8 || ev.keyCode == 46 || ev.keyCode == 37 || ev.keyCode == 39) { return; }\n return false;\n }\n }\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n $1('agree_pay_deposit').onclick = function () {\n if ($1('agree_pay_deposit').checked == true) {\n $1(\"submit\").className = ' btn btn-super-orange';\n } else {\n $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n }\n }\n }\n $1('shipping_fee_detail_link').onclick = function () {\n if (shipping_fee_expand_status) {\n $h(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-open';\n shipping_fee_expand_status = false;\n }\n else {\n $s(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-close';\n shipping_fee_expand_status = true;\n }\n }\n\t\tif(order_count == 1){\n\t\t\t$(\"#shipping_fee_detail_link\").click();\n\t\t}\n\n $1('promo_detail_link').onclick = function () {\n if (promo_expand_status) {\n $h(obj_rep_collection_promotion);\n $h(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-open';\n promo_expand_status = false;\n }\n else {\n $s(obj_rep_collection_promotion);\n $s(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-close';\n promo_expand_status = true;\n }\n }\n\n $1('giftcard_detail_link').onclick = function () {\n if (giftcard_expand_status) {\n $h(obj_rep_dangdang_money);\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-open';\n giftcard_expand_status = false;\n }\n else {\n \tvar isUseGiftcard=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.GiftCard);//if m_data_source['coupon_type'] == 1\n if (isUseGiftcard) {\n $s(obj_rep_dangdang_money);\n }\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-close';\n giftcard_expand_status = true;\n }\n }\n $1('coupon_detail_link').onclick = function () {\n if (coupon_expand_status) {\n $h(obj_coupon_money_real);\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-open';\n coupon_expand_status = false;\n }\n else {\n \tvar isUseCoupon=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.Coupon);//if m_data_source['coupon_type'] == 1\n if (isUseCoupon) {\n $s(obj_coupon_money_real);\n }\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-close';\n coupon_expand_status = true;\n }\n }\n\n\n $1('submit').onclick = function () {\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n if ($1('submit').className.indexOf(\"disabled\") > 0) {\n return;\n }\n }\n var presale_mobile = \"\";\n\t\t\tif (deposit_presale_type == 2) {\n\t\t\t\tvar reg = /^((14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0-9])|(17[0-9]))\\d{8}$/;\n\t\t\t\tpresale_mobile = $1(\"presale_mobile\").value;\n\t\t\t\tif (presale_mobile == null || !reg.test(presale_mobile)) {\n\t\t\t\t\t$s($1('order_submit_error_tips_bar'));\n\t\t\t\t\t$1('order_submit_error_tips').innerHTML = '手机号码格式错误';\n\t\t\t\t\t$1('presale_mobile').className = \"input-w87 input-red\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n //虚拟礼品卡密钥验证\n var orders = m_data_source[\"order_list\"];\n var firtKey;\n var mobileNumber;\n for (var i = 0; i < orders.length; i++) {\n if (orders[i][\"order_type\"] == 50) {\n var success = VirtualGiftCard.submitCheckVirtualKey();\n if (!success) {\n window.location.hash = \"#GiftCardUserKey\";\n return false;\n } else {\n firtKey = $1('txt_first_key').value;\n mobileNumber = $F('txt_mobile_number');\n }\n \n }\n }\n if (!m_data_source['is_agree'] && !$1('ck_protocol').checked)\n return;\n\n var s_pay_password = \"\";\n\n if (m_data_source['payment_password_enabled'] == 1 \n \t\t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']))) {\n if (!m_data_source['is_set_payment_password'] && $1('div_pay_password').style.display == \"none\") //新增 \n {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请设置支付密码';\n return;\n }\n\n s_pay_password = $F('input_pay_password');\n if (s_pay_password == null || s_pay_password == '') {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入支付密码';\n return;\n }\n var paypwdlen = getLength(s_pay_password);\n if (paypwdlen < 6 || paypwdlen > 20) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入正确的支付密码';\n return;\n }\n }\n\n var s_sign = \"\";\n\n if (m_data_source[\"is_no_safe_ip\"] == 1) {\n s_sign = $F('ipt_yzm');\n if (s_sign == null || s_sign == '' || s_sign.indexOf(\"&\") >= 0) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请填写验证码';\n return;\n }\n }\n m_order_flow_submit(s_sign, m_data_source['shop_id'], encodeURIComponent(s_pay_password), firtKey, mobileNumber, m_data_source['product_ids'], m_data_source['sk_action_id'], presale_mobile);\n return false;\n }\n\t\t\n\t\t$1('overseas_tax_detail_link').onclick = function () {\n if (overseas_tax_expand_status) {\n $h(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-open';\n overseas_tax_expand_status = false;\n }\n else {\n $s(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-close';\n overseas_tax_expand_status = true;\n }\n }\n\t\t\n\t\tif(order_count == 1){\n\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t}\n }\n}", "function handleMouseOver(d, i) { // Add interactivity\n // console.log(i);\n const index =findWithAttr(selected,\"Institution\",i.Institution);\n if (index <= -1) {\n d3.select(this).style(\"fill\",palette_divergent_map[1]);\n }\n /*g.append(\"text\")\n .attr(\"id\", \"t\" + i.Institution )\n .attr(\"transform\", this.attributes.transform.value)//\"translate(\" + projection([d.Longitude,d.Latitude]) + \")\")\n .text(i.Institution)*/\n\n div.transition()\t\t\n .duration(200)\t\t\n .style(\"opacity\", .9);\t\t\n div\t.html(i.Institution + \"<br/> Rank =\" +i[\"CurrentRank\"]+\"<br/>\")\t\n .style(\"left\", (d.pageX) + \"px\")\t\t\n .style(\"top\", (d.pageY - 28) + \"px\");\n }", "function triggerCount(element) {\n\n }", "tooltip_render (tooltip_data) {\n let text = \"<ul>\";\n tooltip_data.forEach((row)=>{\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n });\n text += \"</ul>\"\n\n return text;\n }", "function show_services_number(ndx){\n var servicesDim = ndx.dimension(dc.pluck('type'));\n \n var numberOfServicesGroup = servicesDim.group().reduce(add_item, remove_item, initialise);\n\n function add_item(p, v) {\n p.count++;\n p.total += v.departments;\n p.average = p.total / p.count;\n return p;\n }\n\n function remove_item(p, v) {\n p.count--;\n if (p.count == 0) {\n p.total = 0;\n p.average = 0;\n } else {\n p.total -= v.departments;\n p.average = p.total / p.count;\n }\n return p;\n }\n\n function initialise() {\n return {\n count: 0,\n total: 0,\n average: 0\n };\n }\n\n dc.rowChart(\"#departments\")\n \n .margins({top: 10, left: 10, right: 10, bottom: 20})\n .valueAccessor(function (d) {\n return d.value.average;\n })\n .x(d3.scale.ordinal())\n .elasticX(true)\n .dimension(servicesDim)\n .group(numberOfServicesGroup); \n\n}", "function mouseOverFunction() {\n // Highlight circle\n var circle = d3.select(this);\n circle\n .style(\"fill\", \"#B3F29D\")\n .style(\"fill-opacity\", 0.5);\n\n // Find links which have circle as source and highlight\n svg.selectAll(\".link\")\n .filter(function(d) {\n return d.source.name === circle[0][0].__data__.name;\n })\n .style(\"stroke\", \"#B3F29D\");\n\n // Find labels which have circle as source and highlight\n svg.selectAll(\".label\")\n .filter(function(d) {\n if (d.name) {\n return d.name === circle[0][0].__data__.name;\n } else {\n return d.source.name === circle[0][0].__data__.name;\n }\n })\n .style(\"fill\",\"#B3F29D\");\n }", "function handlesumWeath() {\n const weath = data.reduce((total, d) => total + d.weath, 0);\n\n const totalWeathEl = document.createElement('li');\n totalWeathEl.innerHTML = `<h3 class=\"total\">Total Weath: <strong>${formatMoney(\n weath\n )}</strong></h3>`;\n personInfo.appendChild(totalWeathEl);\n}", "function mouseOver(d){\n\t\t\t// d3.select(this).attr(\"stroke\",\"black\");\n\t\t\ttooltip.html(\"<strong>Frequency</strong>\" + \"<br/>\" + d.data.label);\n\t\t\treturn tooltip.transition()\n\t\t\t\t.duration(10)\n\t\t\t\t.style(\"position\", \"absolute\")\n\t\t\t\t.style({\"left\": (d3.event.pageX + 30) + \"px\", \"top\": (d3.event.pageY ) +\"px\" })\n\t\t\t\t.style(\"opacity\", \"1\")\n\t\t\t\t.style(\"display\", \"block\");\n\t\t}", "function handleMouseOver(d, i) { // Add interactivity\n // Use D3 to select element, change color and size\n d3.select(this).style(\"fill\",\"orange\")\n .attr(\"r\", radius*2)\n\n // Specify where to put label of text\n svg.append(\"text\").attr(\"id\", \"t1337\")\n .attr(\"x\", x(d.x) - 30)\n .attr(\"y\", y(d.y) - 15)\n .text([d.x, d.y]);\n}", "function handleMouseOver(d, i) {\n d3.select(this).style('opacity', 1);\n var x = event.clientX;\n var y = event.clientY;\n\n // Display tooltip div containing the score\n // and position it according to mouse coordinates\n if (d.data.value !== undefined) {\n tooltip.style('display', 'block').style('top', y - 80 + 'px').style('left', x - 80 + 'px').html('<strong>Score<br>' + d.data.value + ' %</strong>');\n }\n }", "function RepoCount(data){\n\t// alert(data.total_count);\n\treturn data.total_count\n}", "function hover(d) {\n \n //Update position of dataView div\n var dataDiv = d3.select(\"#dataView\")\n .style(\"left\", d3.event.pageX+100 + \"px\")\n .style(\"top\", d3.event.pageY - 25 + \"px\");\n \n //Style the selected facility\n prevColor = d3.select(this).style(\"fill\");\n d3.select(this)\n .style(\"fill\", \"white\");\n// .attr(\"r\", function(d) {\n// console.log(d);\n// return this.r.animVal.value/scaleFactor} //rather than nodeSize\n// );\n \n lineGraph(d);\n \n showData(dataDiv, d);\n}", "function updateTotalAlertCount() {\n //Sum up the counts in the accordion heading spans\n var alertCountSpans = $(\"[id^='alertCount-']\");\n var alertSum = 0;\n\n if (typeof alertCountSpans != 'undefined') {\n alertCountSpans.each(function(index) {\n alertSum += parseInt(this.innerHTML);\n });\n }\n\n alertCountLabel.text(alertSum);\n setCountBubbleColor(alertSum);\n }", "function doCounter(e) {\n $.label.text = parseInt($.label.text) + 1;\n }", "function update_total_count_summary() {\r\n\t\t\t$('#flight_search_result').show();\r\n\t\t\tvar _visible_records = parseInt($('.r-r-i:visible').length);\r\n\t\t\tvar _total_records = $('.r-r-i').length;\r\n\t\t\t// alert(_total_records);\r\n\t\t\tif (isNaN(_visible_records) == true || _visible_records == 0) {\r\n\t\t\t\t_visible_records = 0;\r\n\t\t\t\t//display warning\r\n\t\t\t\t$('#flight_search_result').hide();\r\n\t\t\t\t$('#empty_flight_search_result').show();\r\n\t\t\t} else {\r\n\t\t\t\t$('#flight_search_result').show();\r\n\t\t\t\t$('#empty_flight_search_result').hide();\r\n\t\t\t}\r\n\t\t\t$('#total_records').text(_visible_records);\r\n\t\t\tif(_visible_records == 1){\r\n\t\t\t\t$('#flights_text').text('Flight');\r\n\t\t\t}\r\n\t\t\t$('.visible-row-record-count').text(_visible_records);\r\n\t\t\t$('.total-row-record-count').text(_total_records);\r\n\t\t\t\r\n\t\t}" ]
[ "0.67282546", "0.67143846", "0.58398664", "0.5573118", "0.5561016", "0.5490889", "0.5467163", "0.537842", "0.5371907", "0.53241843", "0.5315588", "0.5302775", "0.52802175", "0.52729136", "0.5270246", "0.5262978", "0.5258699", "0.5251025", "0.5248389", "0.52119786", "0.51939577", "0.51785725", "0.5177409", "0.51564676", "0.5155514", "0.5149962", "0.51448584", "0.51415074", "0.51143473", "0.51051354", "0.5092746", "0.50887716", "0.5085281", "0.50842285", "0.5077221", "0.5075498", "0.50712466", "0.5070617", "0.50701106", "0.50670934", "0.50664157", "0.50602263", "0.505981", "0.505219", "0.50515324", "0.50496453", "0.5030106", "0.5027208", "0.5025749", "0.50244176", "0.5022603", "0.5017026", "0.5016985", "0.5016907", "0.50164175", "0.5014037", "0.5013251", "0.5002561", "0.49998415", "0.49988785", "0.49939173", "0.4993119", "0.49892217", "0.4988212", "0.49873796", "0.49838436", "0.49797392", "0.49747565", "0.49716732", "0.49713153", "0.4970927", "0.49702033", "0.4966343", "0.49512398", "0.49506348", "0.49422148", "0.49381748", "0.4938006", "0.4937638", "0.49354103", "0.49320847", "0.49275815", "0.49267787", "0.4924715", "0.4920738", "0.4912632", "0.4906802", "0.49020424", "0.4901199", "0.4882844", "0.4875898", "0.48745775", "0.4872512", "0.4871585", "0.48706633", "0.48682275", "0.48668477", "0.48600683", "0.48589605", "0.48567173" ]
0.6231987
2
This function shows opportunities count and total deal amount in pipeline on mouseover
function showOppAmount(oppAmount) { var getdiv = document.getElementById("hoverOpp"); getdiv.innerText = ""; var oppAmtLabel = document.createElement("DIV"); oppAmtLabel.className = "chartBarLabel"; oppAmtLabel.appendChild(document.createTextNode("$" + oppAmount.toLocaleString())); $('#hoverOpp').append(oppAmtLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElement(\"DIV\");\n wonCountLabel.className = \"wonLostLabel\";\n wonCountLabel.appendChild(document.createTextNode(saleCount));\n $('#wonOpp').append(wonCountLabel); \n}", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function showOppCount(oppCount) { \n var getDiv = document.getElementById(\"hoverOpp\");\n getDiv.innerText = oppCount; \n}", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "function displayTotal() {\n\tscreen1.bugCount.html(prettyNumber(Math.round(state.larvae)));\n\tscreen1.larvaePerSec.html(prettyNumber(state.lps));\n}", "function updateTally(outcome) {\n totalPoints += parseInt(outcome);\n \n // Draw tally using HTML\n tally = display_element.querySelector(\".tally\");\n tally.innerHTML = `Total Points: ${totalPoints}`\n \n }", "function howManyGoals(player) {\n return player.eplGoals; // <== Highlight\n}", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function handleMouseover(d,i) {\n var placeNames = []\n for(n=0;n<adminLabelLvls.length;n++) {\n placeNames.push( toTitleCase( d.properties[adminLabelLvls[n]] ) );\n }\n var tooltipText = \"<small><span class='place-name'>\" + placeNames.join(\", \") + \"</span>\";\n var dataKey = d3.select(this).attr('data-response'); \n if(dataKey !== null) {\n d.properties.response.forEach(function(item,itemIndex){\n if(item.key == dataKey) {\n tooltipText += \" <br> Distributions: \" + commas(item.value.count) +\n \" <br> Items distributed: \" + commas(item.value.total_number);\n }\n });\n } \n tooltipText += \"</small>\";\n $('#tooltip').html(tooltipText);\n}", "function arc_onMouseOver(e,d,i) {\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n links.each(function (d) {\n total+= viz.value()(d.data);\n });\n\n total = \"$\" + d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"POLITICAL ACTION COMMITTEE\", d.data.values[0].CMTE_NM,\"Total Donated: \" + total);\n}", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function mouseover(p) {\n tooltip.style(\"visibility\", \"visible\");\n tooltip.html(names[p.y] + \" vs \" + names[p.x] + \" - Total Meetings: \" + (matrix[p.x][p.y].z + matrix[p.y][p.x].z) + \". <br/>\" + names[p.y] + \" has won \" + p.z + \" of them.\");\n d3.selectAll(\".row text\").classed(\"active\", function(d, i) {\n return i == p.y;\n });\n d3.selectAll(\".column text\").classed(\"active\", function(d, i) {\n return i == p.x;\n });\n }", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function process_count (repos) {\n var total = 0;\n repos.filter(function (r) {\n total += r.stargazers_count\n })\n \n //console.log('Total in github-starz.js : ' + total)\n user_callback(total);\n}", "function link_onMouseOver(e,d,i) {\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = \"$\" + d3.format(\",.0f\")(viz.value()(d.data));\n var date = d.data.Month + \"/\" + d.data.Day + \"/\" + d.data.Year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Received: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function displayTotalcalories() {\n //Get total calories\n const totalCalories = ItemCtr.getTotalCalories();\n //add total calories to UI\n UICtrl.showTotalCalories(totalCalories);\n }", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function link_onMouseOver(e,d,i) {\n stopAnnimation();\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = d3.format(\",.0f\")(viz.value()(d.data));\n var date = '';\n // var date = d.data.month + \"/\" + d.data.day + \"/\" + d.data.year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Sentiment index: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function onMouseoverChart(e) {\n if (e['target'] === 'node') {\n var nodeSplit = e['targetid'].split('-');\n var nodeId = nodeSplit[nodeSplit.length - 1];\n if (Number.isInteger(parseInt(nodeId)) && parseInt(nodeId) < globalEnergyData['values'].length) {\n renderPieChart(parseInt(nodeId));\n }\n } \n }", "function printTotalCost() {\n $(\".totalCost span\").append(\"<p> $\"+totalCost+ \"</p>\");\n }", "function showLeadAmount(leadAmount) {\n var getdiv = document.getElementById(\"hoverLead\");\n getdiv.innerText = \"\";\n var leadAmtLabel = document.createElement(\"DIV\");\n leadAmtLabel.className = \"chartBarLabel\";\n leadAmtLabel.appendChild(document.createTextNode(\"$\" + leadAmount.toLocaleString()));\n $('#hoverLead').append(leadAmtLabel);\n}", "function mouseover(d)\r\n\t\t\t{\r\n\t\t\t\t$(\"#col2\").text(\"\");\r\n\t\t\t\tcontent.append(\"div\").attr(\"id\",\"iw-container\").append(\"div\").attr(\"class\",\"iw-title\").append(\"i\").attr(\"class\",\"fa fa-info-circle\")\r\n\t\t\t\t.attr(\"style\",\"padding-right:20px;font-weight:bold;\")\r\n \t\t\t.text(\"\t\"+d.name)// + \" - 2013 appropriations: \" + d.appropriation13 + \" - Which was a \" + d.percentChange13 + \"% change of the previous year.\")\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Orders: \" + format(d.appropriation14/10))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" New Customers: \" + format((d.appropriation13)))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Product Lines: \" + format((d.appropriation12)))\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.attr(\"id\", \"annotate\")\r\n\t\t\t\t.text(d.annotation)\r\n\t\t\t\tif (d.annotation2 != null)\r\n\t\t\t\t{\r\n\t\t\t\tcontent1.append(\"br\")\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.text(d.annotation2);\r\n\t\t\t\t}\r\n\r\n \t\t\t}", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "function render_total(data){\n\t return '<a href=\"\">'+data+' pessoa(s)</a>';\n\t}", "function RepoCount(data){\n\t// alert(data.total_count);\n\treturn data.total_count\n}", "function getpanierItemsCount(){\n\n\ttotal=calculertotal();\n\t(document.querySelector(\"#total\")).innerHTML=(\"Total a payer \"+total+\" DH\");\n}", "function showTotalPassengerCount(){\n\t$('.passenger-count').html(passenger_count)\n}", "handleMouseOver (vis, event, d) {\n // console.log(\"hover over\", d);\n let leftPosition = event.pageX + 10 + \"px\";\n if (window.innerWidth - event.pageX < 500) {\n leftPosition = event.pageX - 300 + \"px\";\n }\n let census = vis.insights[d.count];\n let censusCount = d.count;\n let peopleCount = census ? census.total : 0;\n let censusPercent = vis.legendData.find(c => c.censusCount == d.count);\n censusPercent = censusPercent? censusPercent.censusPercent : 0;\n if ((d.count === 0 && vis.filters.length === 0) || !census) {\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n </div>`\n );\n } else if (d.count === 0) {\n let tipText = `<div>${peopleCount.toLocaleString(\"en\")} people with filter attribute</div> `;\n vis.filters.forEach(f => {\n tipText += `<div>${v2CheckBoxGuide[f].title}.</div> `;\n })\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n ${tipText}\n </div>`\n );\n } else {\n // They show up in a census\n let topPob = d3.greatest(census.pobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topAgeGroup = d3.greatest(census.ageMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCensus = d3.greatest(census.censusMap, (a, b) => d3.ascending(a[1], b[1]));\n let topGender = d3.greatest(census.genderMap, (a, b) => d3.ascending(a[1], b[1]));\n let topColor = d3.greatest(census.colorMap, (a, b) => d3.ascending(a[1], b[1]));\n let topJob = d3.greatest(census.jobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCounty = d3.greatest(census.countyMap, (a, b) => d3.ascending(a[1], b[1]));\n // console.log(topPob,topAgeGroup, topCensus );\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census</h5>\n <div> The ${peopleCount.toLocaleString(\"en\")} people in ${censusCount} census are most likely</div>\n <div> to be born in ${topPob[0]} living in ${upperCaseFirstLetters(topCounty[0])}, Nevada. </div> \n <div> Their first census was at age ${topAgeGroup[0]} in year ${topCensus[0]}. </div> \n <div> Gender \"${topGender[0]}\", \"color ${topColor[0]}\",\n and job \"${upperCaseFirstLetters(topJob[0])}\".</div> \n </div>`\n );\n }\n }", "mouseOver(panel) {\n\t}", "function addEvents() {\n total = 0;\n let activities = document.querySelectorAll(\"[type='radio']:checked ~ .activity-cost\");\n\n for (i=0; i < activities.length; i++) {\n total+= +(activities[i].innerText.substring(1))\n }\n renderTotal(total);\n}", "function onMouseOver(evt) {\n $('#event-diagnostic').text('Mouse over fired.');\n }", "function setTopoPetsCaught(){\n\tdocument.getElementById(\"topoPetsFoundTitle\").innerHTML = \"<p> Recorder: \" + topoPetsCaught.total() + \"/\" + getTotalAmountTopoPets() + \" <br/><progress id='health' value=\" + topoPetsCaught.total() + \" max=\" + getTotalAmountTopoPets() + \" style='height:1vh;width:60%;'>\";\n}", "function calculateOverview(value, overviewer, summatoryName) {\r\n if (value < overviewer.min)\r\n overviewer.min = value;\r\n if (value > overviewer.max)\r\n overviewer.max = value;\r\n summatory[`${summatoryName}`] += value;\r\n }", "function showLostSaleCount(lostCount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostCountLabel = document.createElement(\"DIV\");\n lostCountLabel.className = \"wonLostLabel\";\n lostCountLabel.appendChild(document.createTextNode(lostCount));\n $('#lostOpp').append(lostCountLabel);\n}", "getDamageAmount() {\n return 0.1 + this.operators.reduce((acc, o) => (acc + o.experience), 0);\n }", "function updatePopperDisplay (name, count, cost, display, countDisplay, costDisplay, sellDisplay) {\n\tcountDisplay.innerHTML = name + \": \" + count;\n\tcostDisplay.innerHTML = \"Cost: \" + commas(cost);\n\tif (Game.popcorn - cost >= 0) {\n\t\tdisplay.style.backgroundColor = \"blue\";\n\t\tdisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tdisplay.style.backgroundColor = \"#000066\";\n\t\tdisplay.style.cursor = \"default\";\n\t}\n\tif (count > 0) {\n\t\tsellDisplay.style.backgroundColor = \"red\";\n\t\tsellDisplay.style.color = \"white\";\n\t\tsellDisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tsellDisplay.style.backgroundColor = \"#990000\";\n\t\tsellDisplay.style.color = \"#999999\";\n\t\tsellDisplay.style.cursor = \"default\";\n\t}\n}", "function handleMouseover(d) {\n div.style(\"opacity\", 0.9)\n .style(\"left\", (d3.event.pageX + padding/2) + \"px\")\n .style(\"top\", d3.event.pageY + \"px\")\n .html(\"<p>\" + d.Name + \",&nbsp;\" + d.Nationality + \"</p><p>Year:\" + d.Year + \"&nbsp;&nbsp;&nbsp;Time:\" + timeFormat(d.Time) + \"&nbsp;&nbsp;&nbsp;Place:\" + d.Place + \"</p>\" + (d.Doping ? (\"<br><p>\" + d.Doping +\"</p\") : \"\"));\n}", "function node_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n var strSyntax = d.values[0].PTY == 'positive' ? 'Sentiment index: +' : 'Sentiment index: -'\n\n createDataTip(x + d.r, y + d.r + 25, d.values[0].CAND_ID, d.values[0].CAND_NAME, strSyntax + total);\n}", "total(){\n return operations.incomes() + operations.expenses()\n }", "function node_onMouseOver(e,d,i) {\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = \"$\" + d3.format(\",.2f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n createDataTip(x + d.r, y + d.r + 25,congress, d.values[0].CAND_NAME,\"Total Received: \" + total);\n}", "function Summary(container_id) {\n var m_data_source = null;\n var m_panel = new JSPanel(container_id);\n var m_rpt_shipping_fee = new JSRepeater('rep_shipping_fee_real');\n var m_rpt_dangdang_money = new JSRepeater('rep_dangdang_money');\n var m_rep_collection_promotion = new JSRepeater('rep_collection_promotion');\n var m_rep_order_promotion = new JSRepeater('rep_order_promotion');\n\tvar m_rpt_overseas_tax = new JSRepeater('rep_overseas_tax_real');\n\n var promo_expand_status = true;\n var shipping_fee_expand_status = true;\n var coupon_expand_status = true;\n var giftcard_expand_status = true;\n\tvar overseas_tax_expand_status = true;\n\n var obj_coupon_money_real = null;\n var obj_rep_dangdang_money = null;\n var obj_rep_order_promotion = null;\n var obj_rep_collection_promotion = null;\n var obj_rep_shipping_fee_real = null;\n\tvar obj_rep_overseas_tax_real = null;\n\t\n\tvar order_count = 0;\n\t\n\tvar is_show_free_oversea = false;\n\t\n\tvar deposit_presale_type = 0; //1代表全款支付,2代表定金和尾款分开支付\n\n this.show = function (result) {\n bindTemplate();\n addEvents();\n\n // get_order_submit_tips(m_data_source[\"is_agree\"]);\n\n //验证码\n yzmInit();\n\n //支付密码\n payPasswordInit();\n\n $1('btn_change_yzm').onclick = function () { changeYZMMarked(); };\n\n $1('ck_protocol').onclick = function () { check_protocol(); };\n }\n\n this.setDataSource = function (data_source) {\n m_data_source = data_source;\n m_panel.DataSource = data_source;\n\n m_rpt_shipping_fee.DataSource = data_source['order_list'];\n m_rpt_dangdang_money.DataSource = data_source['order_list'];\n m_rep_collection_promotion.DataSource = data_source['collection_deduct_info'];\n\n m_rep_order_promotion.DataSource = data_source['order_promotion'];\n m_rpt_overseas_tax.DataSource = data_source['order_list'];\n\n if (m_data_source[\"presale_type\"] == null) {\n deposit_presale_type = 0;\n } else {\n deposit_presale_type = m_data_source[\"presale_type\"];\n }\n }\n\n this.setSubmit = function (order_flow_submit) {\n m_order_flow_submit = order_flow_submit;\n }\n\n this.setYzmStatus = function (is_no_safe_ip) {\n m_data_source['is_no_safe_ip'] = is_no_safe_ip;\n }\n\n this.isNoSafeIp = function () {\n return m_data_source['is_no_safe_ip'];\n }\n\n var get_order_submit_tips = function (is_agree) {\n var order_submit_tips = $1('order_submit_tips');\n if (order_submit_tips != null) {\n if (!is_agree) {\n order_submit_tips.innerHTML = P_ORDER_SUBMIT_PROTOCOL_TIPS;\n $1('order_submit_tips').className = \"\";\n }\n else\n $1('order_submit_tips').className = \"objhide\";\n }\n }\n\n\n this.setSubmitErrorTips = function (submit_error_tips) {\n if (submit_error_tips)\n $s($1('order_submit_error_tips_bar'));\n else\n $h($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = submit_error_tips;\n }\n\n //点了提交按钮后的按钮变化\n this.setDisabled = function () {\n $disabled('submit');\n $wait('submit');\n }\n this.setEnabled = function () {\n $enabled('submit');\n $1('submit').style.cursor = 'pointer';\n }\n\n var check_protocol = function () {\n if ($1('ck_protocol').checked)\n $1('submit').className = \"btn btn-super-orange\";\n else\n $1('submit').className = \"btn btn-super-orange btn-super-disabled\";\n }\n\n var ipt_yzm_keyup = function (o, e) {\n var k = null;\n if (e) {\n k = e.keyCode;\n }\n else if (event) {\n k = event.keyCode;\n }\n\n if (k == 9)\n return;\n\n var ov = o.value;\n var lisi = null;\n var j = 0;\n for (var i = 0; i < yzm_array_len; i++) {\n lisi = obj_ipt_yzm_lis[i];\n if (lisi.innerHTML.startsWith(ov)) {\n $s(lisi);\n j++;\n }\n else $h(lisi);\n }\n\n if (j < 2) {\n $h(obj_ipt_yzm);\n }\n else if (j < 10) {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = 'auto';\n }\n else {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = '100px';\n }\n };\n\n var li_c = function (t) { t.className = 'li_bg'; };\n var li_r = function (t) { t.className = ''; }\n var ipt_yzm_focus = function (o) {\n\n clearYzmTips(o);\n var li_ck = function (t) { o.value = t.innerHTML; $h(obj_ipt_yzm); o.style.color = '#404040'; };\n var sb = new StringBuilder();\n for (var i = 0; i < yzm_array_len; i++) {\n sb.append(\"<li>\");\n sb.append(i);\n sb.append('</li>');\n }\n obj_ipt_yzm.innerHTML = sb.toString();\n obj_ipt_yzm_lis = obj_ipt_yzm.childNodes;\n for (var i = 0; i < yzm_array_len; i++) {\n obj_ipt_yzm_lis[i].onmouseover = function () { li_c(this); };\n obj_ipt_yzm_lis[i].onmouseout = function () { li_r(this); };\n obj_ipt_yzm_lis[i].onclick = function () { li_ck(this); };\n }\n var pos = getposOffset_c(o);\n setLocation(obj_ipt_yzm, pos[0] + 3, pos[1] + 20);\n setDimension(obj_ipt_yzm, 85, 100);\n\n if (yzm_array_len < 8)\n obj_ipt_yzm.style.height = 'auto';\n\n\n show_ipt_yzm(obj_ipt_yzm, o);\n };\n\n var show_ipt_yzm = function (z, o) {\n $s(z);\n if (document.addEventListener) {\n document.addEventListener('click', documentonclick, false);\n }\n else {\n document.attachEvent('onclick', function (e) { documentonclick(); });\n }\n\n function documentonclick() {\n var evt = arguments[0] || window.event;\n var sender = evt.srcElement || evt.target;\n\n if (!contains(z, sender) && sender != o) {\n $h(z);\n if (document.addEventListener) {\n document.removeEventListener('click', documentonclick, false);\n }\n else {\n document.detachEvent('onclick', function (e) { documentonclick(); });\n }\n }\n };\n };\n\n // show error\n function showError(error) {\n SubmitData.error = error;\n }\n // show bind error\n function showSubmitError(errorCode) {\n var error;\n switch (errorCode) {\n case 1:\n case 5:\n case 6:\n case 9:\n case 10:\n case 11:\n error = \"请填写正确的卡号\";\n break;\n case 7:\n error = \"请填写正确的密码\";\n break;\n case 12:\n error = \"激活失败\";\n break;\n default:\n error = \"礼券绑定失败\";\n }\n showError(error);\n }\n\n // clear error\n function clearError() {\n couponData.error = null;\n }\n\n function yzmInit() {\n changeYZMMarked();\n // obj_ipt_yzm = $1('ul_ipt_yzm');\n //\t $1('ipt_yzm').onkeyup=function(e){ipt_yzm_keyup(this,e);};\n\n if (m_data_source['is_no_safe_ip'] == 0) {\n $h($1('div_yzm_word'));\n }\n\n }\n\n function payPasswordInit() {\n\n var isEnable = m_data_source['payment_password_enabled'] == 1;\n isEnable = isEnable \n \t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']));\n if (isEnable) {\n if (m_data_source['is_set_payment_password']) {\n ShowOrClosePayPassWord(3);\n }\n else {\n ShowOrClosePayPassWord(0);\n }\n }\n else {\n ShowOrClosePayPassWord(2);\n }\n }\n\n function bindTemplate() {\n if (m_data_source['order_list'] != null && m_data_source['order_list'].length > 0) {\n order_count = m_data_source['order_list'].length;\n }\n m_panel.Template = ORDER_SUMMARY_TEMPLATE;\n m_data_source['bargin_total'] = formatFloat(m_data_source['bargin_total']);\n m_data_source['shipping_fee'] = formatFloat(m_data_source['shipping_fee']);\n m_data_source['promo_discount_amount'] = formatFloat(m_data_source['promo_discount_amount']);\n m_data_source['coupon_amount'] = formatFloat(m_data_source['coupon_amount']);\n m_data_source['cust_cash_used'] = formatFloat(m_data_source['cust_cash_used']);\n m_data_source['payable_amount'] = formatFloat(m_data_source['payable_amount']);\n m_data_source['gift_card_charge'] = formatFloat(m_data_source['gift_card_charge']);\n m_data_source['total_gift_package_price'] = formatFloat(m_data_source['total_gift_package_price']);\n m_data_source['gift_package_price'] = formatFloat(m_data_source['gift_package_price']);\n m_data_source['gift_package_price_tips'] = formatFloat(m_data_source['gift_package_price_tips']);\n m_data_source['greetingcard_price'] = formatFloat(m_data_source['greetingcard_price']);\n m_data_source['privilege_code_discount_amount'] = formatFloat(m_data_source['privilege_code_discount_amount']);\n m_data_source['point_deduction_amount'] = formatFloat(m_data_source['point_deduction_amount']);\n //定金和尾款金额格式化\n m_data_source['deposit_amount'] = formatFloat(m_data_source['deposit_amount']);\n m_data_source['balance_amount'] = formatFloat(m_data_source['balance_amount']);\n\t\t\n //礼品卡和礼券总金额\n m_data_source[\"coupon_and_giftcard_money_used\"]=formatFloat((+m_data_source[\"gift_card_money_used\"])+(+m_data_source[\"coupon_amount\"]));\n m_data_source[\"gift_card_money_used\"]=formatFloat(m_data_source[\"gift_card_money_used\"]);\n m_data_source[\"coupon_used\"]=formatFloat(m_data_source[\"coupon_amount\"]);\n\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['overseas_tax']);\n\t\tif(parseFloat(m_data_source['overseas_tax']) == 0){\n\t\t\tis_show_free_oversea = true;\n\t\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['free_overseas_tax']);\n\t\t} \n\t\t\n\t\t\n if (m_data_source['payable_amount'] >= 1000) {\n m_data_source['payable_amount_style'] = \"f14\";\n }\n else {\n m_data_source['payable_amount_style'] = \"f18\";\n }\n //先取值,防止设置设置支付密码后,给输入框赋了值,但重新绑定后丢失。\n var payment_password = $F(\"input_pay_password\");\n m_panel.DataBind();\n if (payment_password)\n $1(\"input_pay_password\").value = payment_password;\n\n obj_coupon_money_real = $1(\"coupon_money_real\");\n obj_rep_dangdang_money = $1(\"rep_dangdang_money\");\n obj_rep_order_promotion = $1(\"rep_order_promotion\");\n obj_rep_collection_promotion = $1(\"rep_collection_promotion\");\n obj_rep_shipping_fee_real = $1(\"rep_shipping_fee_real\");\n\t\tobj_rep_overseas_tax_real = $1(\"rep_overseas_tax_real\");\n\n\t\tif (deposit_presale_type == 1) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else if (deposit_presale_type == 2) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else {\n\t\t $1(\"div_deposit_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"div_agree_pay_deposit\").className = 'hide';\n\t\t}\n $1(\"total_shipping_fee_real\").className = 'hide';\n $1(\"total_promo_amount_real\").className = 'hide';\n $1(\"total_coupon_real\").className = 'hide';\n $1(\"total_gift_card_charge\").className = 'hide';\n $1(\"total_cust_cash_real\").className = 'hide';\n $1(\"total_cust_point_real\").className = 'hide';\n $1(\"rep_collection_promotion\").className = 'hide';\n $1(\"total_discount_code_real\").className = 'hide';\n $1(\"total_gift_package_price\").className = 'hide';\n $1(\"gift_package_price\").className = 'hide';\n $1(\"total_privilege_code_discount_amount\").className = 'hide';\n $1(\"greetingcard_price\").className = 'hide';\n\t\t$1(\"total_overseas_tax_real\").className = 'hide';\n\t\t$1(\"total_energy_saving_subsiby_amout\").className = 'hide';\n if (m_data_source['shipping_fee'] > 0) {\n $1(\"total_shipping_fee_real\").className = '';\n m_rpt_shipping_fee.ItemTemplate = RPT_SHIPPING_FEE_ITEM_TEMPLATE;\n m_rpt_shipping_fee.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_shipping_fee'] > 0) {\n dataItem['order_shipping_fee'] = formatFloat(dataItem['order_shipping_fee']);\n }\n else {\n dataItem['shipping_fee_display'] = 'hide';\n }\n }\n m_rpt_shipping_fee.DataBind();\n }\n\t\tif(m_data_source['energy_saving'] == true) {\n\t\t\t$1(\"total_energy_saving_subsiby_amout\").className = \"\";\n\t\t}\n\t\tif (m_data_source['is_overseas'] == true) {\n\t\t\t\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"default\";\n\t\t\t} else {\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"\";\n\t\t\t}\n $1(\"total_overseas_tax_real\").className = '';\n m_rpt_overseas_tax.ItemTemplate = RPT_OVERSEAS_TAX_ITEM_TEMPLATE;\n m_rpt_overseas_tax.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['is_overseas'] == true) {\n\t\t\t\t\tif(formatFloat(dataItem['overseas_tax']) == 0){\n\t\t\t\t\t\tdataItem['default_class'] = \"default\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['free_overseas_tax']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdataItem['default_class'] = \"\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['overseas_tax']);\n\t\t\t\t\t}\n }\n else {\n dataItem['overseas_tax_display'] = 'hide';\n }\n }\n m_rpt_overseas_tax.DataBind();\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$(\"#oversea_icon_free\").show();\n\t\t\t} else {\n\t\t\t\t$(\"#oversea_icon_free\").hide();\n\t\t\t}\n\t\t\tif(order_count == 1){\n\t\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t\t}\n }\n if (m_data_source['promo_discount_amount'] > 0) {\n $1(\"total_promo_amount_real\").className = '';\n if (m_data_source['collection_deduct_info']!=undefined && m_data_source['collection_deduct_info'].length > 0) {\n $1(\"rep_collection_promotion\").className = '';\n m_rep_collection_promotion.ItemTemplate = RPT_PROMOTION_ITEM_TEMPLATE;\n m_rep_collection_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_direct_discount_amount'] > 0) {\n dataItem['order_direct_discount_amount'] = formatFloat(dataItem['order_direct_discount_amount']);\n }\n else {\n dataItem['order_direct_discount_amount'] = 'hide';\n }\n dataItem['collection_promotion_desc_tips'] = dataItem['collection_promotion_desc'];\n dataItem['collection_promotion_desc'] = nTruncate(dataItem['collection_promotion_desc'], 10);\n }\n m_rep_collection_promotion.DataBind();\n }\n\n m_rep_order_promotion.ItemTemplate = RPT_ORDER_PROMOTION_ITEM_TEMPLATE;\n m_rep_order_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n\n if (dataItem['order_prom_subtract'] > 0) {\n $s($1(\"rep_order_promotion\"));\n dataItem['order_prom_subtract'] = formatFloat(dataItem['order_prom_subtract']);\n }\n else {\n dataItem['order_promotion_display'] = 'hide';\n }\n dataItem['shop_promo_msg_tips'] = dataItem['shop_promo_msg'];\n dataItem['shop_promo_msg'] = nTruncate(dataItem['shop_promo_msg'], 10);\n }\n m_rep_order_promotion.DataBind();\n }\n \n //if(+m_data_source[\"coupon_and_giftcard_money_used\"]>0){ \n \t //礼品卡显示\n $1(\"total_giftcard_real\").className = 'hide';\n if(+m_data_source[\"gift_card_money_used\"]>0){ \t \n \t$1(\"total_giftcard_real\").className = '';\n m_rpt_dangdang_money.ItemTemplate = RPT_COUPON_ITEM_TEMPLATE;\n m_rpt_dangdang_money.onItemDataBind = function (dataItem) {\n if (+dataItem['cust_gift_card_used'] > 0) {\n \t dataItem['cust_gift_card_used'] = formatFloat(dataItem['cust_gift_card_used']);\n }\n else {\n dataItem['coupon_amount_display'] = 'hide';\n }\n };\n m_rpt_dangdang_money.DataBind(); \n }\n \n if (m_data_source['coupon_used'] > 0) {\n \t$1(\"total_coupon_real\").className = '';\n switch (+m_data_source['coupon_type']) {\n case 1:\n case 9: \n obj_coupon_money_real.className = 'p-child';\n break; \n case 4:\n $1(\"total_discount_code_real\").className = '';\n $1(\"total_coupon_real\").className = 'hide';\n break;\n default:\n break;\n }\n \n }\n \n\n\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"total_gift_package_price\");\n }\n\n if (m_data_source['gift_package_price'] == 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"greetingcard_price\");\n }\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] == 0) {\n $S(\"gift_package_price\");\n }\n\n\n if (+m_data_source['gift_card_charge'] > 0) {\n $1(\"total_gift_card_charge\").className = '';\n }\n\n if (m_data_source['cust_cash_used'] > 0) {\n $S(\"total_cust_cash_real\");\n }\n if (m_data_source['point_deduction_amount'] > 0) {\n $S(\"total_cust_point_real\");\n }\n if (!m_data_source['is_agree']) {\n $s($1('div_ck_protocol'));\n }\n if (+m_data_source['privilege_code_discount_amount'] > 0) {\n $1(\"total_privilege_code_discount_amount\").className = '';\n }\n }\n\n\n function getEvent() {\n if (document.all) {\n return window.event; //for ie\n }\n func = getEvent.caller;\n while (func != null) {\n var arg0 = func.arguments[0];\n if (arg0) {\n if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof (arg0) == \"object\" && arg0.preventDefault && arg0.stopPropagation)) {\n return arg0;\n }\n }\n func = func.caller;\n }\n return null;\n }\n\n // events\n function addEvents() {\n if (deposit_presale_type == 2) {\n $1('presale_mobile').onkeydown = function () {\n $1('presale_mobile').className = \"input-w87\";\n $h($1('order_submit_error_tips_bar'));\n var ev = getEvent();\n if (ev.keyCode >= 48 && ev.keyCode <= 57) { return; }\n if (ev.keyCode >= 96 && ev.keyCode <= 105) { return; }\n if (ev.keyCode == 8 || ev.keyCode == 46 || ev.keyCode == 37 || ev.keyCode == 39) { return; }\n return false;\n }\n }\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n $1('agree_pay_deposit').onclick = function () {\n if ($1('agree_pay_deposit').checked == true) {\n $1(\"submit\").className = ' btn btn-super-orange';\n } else {\n $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n }\n }\n }\n $1('shipping_fee_detail_link').onclick = function () {\n if (shipping_fee_expand_status) {\n $h(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-open';\n shipping_fee_expand_status = false;\n }\n else {\n $s(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-close';\n shipping_fee_expand_status = true;\n }\n }\n\t\tif(order_count == 1){\n\t\t\t$(\"#shipping_fee_detail_link\").click();\n\t\t}\n\n $1('promo_detail_link').onclick = function () {\n if (promo_expand_status) {\n $h(obj_rep_collection_promotion);\n $h(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-open';\n promo_expand_status = false;\n }\n else {\n $s(obj_rep_collection_promotion);\n $s(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-close';\n promo_expand_status = true;\n }\n }\n\n $1('giftcard_detail_link').onclick = function () {\n if (giftcard_expand_status) {\n $h(obj_rep_dangdang_money);\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-open';\n giftcard_expand_status = false;\n }\n else {\n \tvar isUseGiftcard=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.GiftCard);//if m_data_source['coupon_type'] == 1\n if (isUseGiftcard) {\n $s(obj_rep_dangdang_money);\n }\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-close';\n giftcard_expand_status = true;\n }\n }\n $1('coupon_detail_link').onclick = function () {\n if (coupon_expand_status) {\n $h(obj_coupon_money_real);\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-open';\n coupon_expand_status = false;\n }\n else {\n \tvar isUseCoupon=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.Coupon);//if m_data_source['coupon_type'] == 1\n if (isUseCoupon) {\n $s(obj_coupon_money_real);\n }\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-close';\n coupon_expand_status = true;\n }\n }\n\n\n $1('submit').onclick = function () {\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n if ($1('submit').className.indexOf(\"disabled\") > 0) {\n return;\n }\n }\n var presale_mobile = \"\";\n\t\t\tif (deposit_presale_type == 2) {\n\t\t\t\tvar reg = /^((14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0-9])|(17[0-9]))\\d{8}$/;\n\t\t\t\tpresale_mobile = $1(\"presale_mobile\").value;\n\t\t\t\tif (presale_mobile == null || !reg.test(presale_mobile)) {\n\t\t\t\t\t$s($1('order_submit_error_tips_bar'));\n\t\t\t\t\t$1('order_submit_error_tips').innerHTML = '手机号码格式错误';\n\t\t\t\t\t$1('presale_mobile').className = \"input-w87 input-red\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n //虚拟礼品卡密钥验证\n var orders = m_data_source[\"order_list\"];\n var firtKey;\n var mobileNumber;\n for (var i = 0; i < orders.length; i++) {\n if (orders[i][\"order_type\"] == 50) {\n var success = VirtualGiftCard.submitCheckVirtualKey();\n if (!success) {\n window.location.hash = \"#GiftCardUserKey\";\n return false;\n } else {\n firtKey = $1('txt_first_key').value;\n mobileNumber = $F('txt_mobile_number');\n }\n \n }\n }\n if (!m_data_source['is_agree'] && !$1('ck_protocol').checked)\n return;\n\n var s_pay_password = \"\";\n\n if (m_data_source['payment_password_enabled'] == 1 \n \t\t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']))) {\n if (!m_data_source['is_set_payment_password'] && $1('div_pay_password').style.display == \"none\") //新增 \n {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请设置支付密码';\n return;\n }\n\n s_pay_password = $F('input_pay_password');\n if (s_pay_password == null || s_pay_password == '') {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入支付密码';\n return;\n }\n var paypwdlen = getLength(s_pay_password);\n if (paypwdlen < 6 || paypwdlen > 20) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入正确的支付密码';\n return;\n }\n }\n\n var s_sign = \"\";\n\n if (m_data_source[\"is_no_safe_ip\"] == 1) {\n s_sign = $F('ipt_yzm');\n if (s_sign == null || s_sign == '' || s_sign.indexOf(\"&\") >= 0) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请填写验证码';\n return;\n }\n }\n m_order_flow_submit(s_sign, m_data_source['shop_id'], encodeURIComponent(s_pay_password), firtKey, mobileNumber, m_data_source['product_ids'], m_data_source['sk_action_id'], presale_mobile);\n return false;\n }\n\t\t\n\t\t$1('overseas_tax_detail_link').onclick = function () {\n if (overseas_tax_expand_status) {\n $h(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-open';\n overseas_tax_expand_status = false;\n }\n else {\n $s(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-close';\n overseas_tax_expand_status = true;\n }\n }\n\t\t\n\t\tif(order_count == 1){\n\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t}\n }\n}", "function addexptototal()\n {\n const expobj={};\n //read the value of inputamt\n const textamt=inputele.value;\n\n const textdesc=inputele2.value;\n \n //convert it to number\n const exp=parseInt(textamt,10);\n\n expobj.desc=textdesc;\n expobj.amt=textamt;\n expobj.moment=new Date();\n\n allexp.push(expobj);\n \n \n //add that value to totalvalue\n totalexp=totalexp+exp;\n \n hele.textContent=totalexp;\n\n const headingtext=`Total :: ${totalexp}`;\n hele.textContent=headingtext;\n\n renderlist(allexp);\n \n }", "function showTotalIncident(transport) {\n let total = data.dataModified.get(\"1960\")[transport].length;\n let years = document.getElementById(\"selectYear\").value;\n\n document.getElementById(\"showTotalIncident\").innerHTML = total;\n document.getElementById(\"percent1\").innerHTML = \"Aire = \" + data.percent(years).percentair + \" %\";\n document.getElementById(\"percent2\").innerHTML = \"Tierra = \" + data.percent(years).percentland + \" %\";\n document.getElementById(\"percent3\").innerHTML = \"Agua = \" + data.percent(years).percentWater + \" %\";\n\n}", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function details_on_demand(d) {\n\t\n\tvar sp_dot = document.getElementById(\"sp\"+d.Team);\n\tvar tm_node = document.getElementById(\"tm\"+d.Team);\n\t\n\t// Save old state of dot\n\told_dot = sp_dot.getAttribute(\"r\");\n\told_opacity = sp_dot.getAttribute(\"opacity\");\n\t\n\t// Make team's dot bigger \n\tsp_dot.setAttribute(\"r\", big_dot); \n\t// Make team's node \"brighter\"\n\ttm_node.style.opacity = \".7\";\n\t\n\t\n\tteams.forEach(function(team) {\n\t\tdocument.getElementById(\"sp\"+team).setAttribute(\"opacity\", .1);\n\t});\n\tsp_dot.setAttribute(\"opacity\", 1);\n\t\n\ttooltip.transition()\n\t .duration(100)\n\t .style(\"opacity\", .85)\n\t .style(\"background\", \"#0b0b0d\")\n\t .style(\"border\", \"2px solid black\")\n\t .style(\"color\", \"#FFFFFF\")\n\t .style(\"max-width\", \"auto\")\n\t .style(\"height\", \"auto\");\n\t \n\t \n\ttooltip.html(\n\t \"<img src='\" + logos[d.Team] + \"' width='50' height='50' style='float: left; padding-right: 10px; vertical-align: middle'>\" +\n\t\t \"<b>\" + d[\"Team\"] + \"<b><br/><br/>\\t Salary: <b>\" + curr_fmt(xValue(d)*1000000) + \"</b><br/>\\t Wins: <b>\" + yValue(d) + \n\t\t \"</b>; Losses: <b>\" + d[season+\"Loss\"] + \"</b>\")\n\t .style(\"left\", d[\"Team\"] ? (d3.event.x + document.body.scrollLeft - 90) + \"px\": null)\n\t .style(\"top\", d[\"Team\"] ? (d3.event.y + document.body.scrollTop - 70) + \"px\": null)\n\t .style(\"padding\", \"5px\")\n\t .style(\"padding-left\", \"10px\")\n\t .style(\"font-size\", \"11px\");\n}", "function showDataPointCount() {\n $('.dataPoints').html('<span class=\"bold\">' + dataPointCounter + ' p/s</span>');\n dataPointCounter = 0;\n}", "function calculateTip(amount, service, people) {\n const totalTip = (amount * service)/people;\n console.log(totalTip); \n renderTip(totalTip);\n}", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "incomeOverTime() {\n return `Your weekly income will be Ksh ${this.totalProduction() * 7}\nYour yearly income will be Ksh ${this.totalProduction() * 366}`;\n }", "getTotalMenuPrice() {\n return this.menu.reduce((a,b) => a+b.pricePerServing, \" \") * this.getNumberOfGuests();\n }", "function arc_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n var num = 0;\n var average = 0;\n links.each(function (d) {\n num ++;\n total+= viz.value()(d.data);\n });\n\n total = d3.format(\",.0f\")(total);\n\n average = d3.format(\",.0f\")(total / num);\n // console.log('number: ' + num);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"NEWS SOURCE\", d.data.values[0].CMTE_NM,\"Sentiment index: \" + total);\n}", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n if(row.votecount != \"\") {\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\" (\"+row.percentage+\")\" + \"</li>\"\n }\n\t });\n\t return text;\n\t}", "function createMousoverHtml(d) {\n\n var html = \"\";\n html += \"<div class=\\\"tooltip_kv\\\">\";\n html += \"<span class=\\\"tooltip_key\\\">\";\n html += d['Item'];\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Total Accidents: \"\n try {\n html += (d[\"Total_Accidents\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: \"\n html += (d[\"Fatal\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: \"\n html += (d[\"Serious\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: \"\n html += (d[\"Minor\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: \"\n html += (d[\"Uninjured\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>VMC: \"\n html += (d[\"VMC\"]);\n html += \" IMC: \"\n html += (d[\"IMC\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Destroyed: \"\n html += (d[\"Destroyed_Damage\"]);\n html += \" Substantial: \"\n html += (d[\"Substantial_Damage\"]);\n html += \" Minor: \"\n html += (d[\"Minor_Damage\"]);\n }\n catch (error) {\n html = html.replace(\"<a>Total Accidents: \", \"\")\n html += \"<a>Total Accidents: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: 0\"\n }\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"</div>\";\n $(\"#tooltip-container-scatter\").html(html);\n $(this).attr(\"fill-opacity\", \"0.8\");\n $(\"#tooltip-container-scatter\").show();\n\n //quello commentato ha senso, ma scaja\n //var map_width = document.getElementById('scatter').getBoundingClientRect().width;\n var map_width = $('scatter')[0].getBoundingClientRect().width;\n //console.log($('scatter'))\n\n //console.log('LAYER X ' + d3.event.layerX)\n //console.log('LAYER Y ' + d3.event.layerY)\n\n if (d3.event.layerX < map_width / 2) {\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX + 15) + \"px\");\n } else {\n var tooltip_width = $(\"#tooltip-container-scatter\").width();\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX - tooltip_width - 30) + \"px\");\n }\n}", "function mouseover() {\n\ttiptool_div.style(\"display\", \"inline\");\n\t}", "function overSkill0() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = skillsDescArray[0]\r\n}", "function _displayTotalRevenueOfOwner(list) {\n totalRevenue = list.reduce((prevVal, currVal) => {\n const val = currVal.cost;\n return {\n subTotal: prevVal.subTotal + val.subTotal,\n serviceTax: prevVal.serviceTax + val.serviceTax,\n swachhBharatCess: prevVal.swachhBharatCess + val.swachhBharatCess,\n krishiKalyanCess: prevVal.krishiKalyanCess + val.krishiKalyanCess,\n total: prevVal.total + val.total,\n tax: currVal.tax,\n }\n }, {\n subTotal: 0,\n serviceTax: 0,\n swachhBharatCess: 0,\n krishiKalyanCess: 0,\n total: 0,\n });\n console.log('Total Revenue');\n _displayLog(totalRevenue);\n }", "function mouseover(d) {\n var shiftX = 10;\n var shiftY = 20;\n\n var mouseCoords = d3.mouse(this);\n d3.select(\"#tooltip\")\n .style(\"left\", function(d) {\n return mouseCoords[0] + shiftX + \"px\"\n })\n .style(\"top\", function(d) {\n return mouseCoords[1] + shiftY + \"px\"\n })\n .html(function() {\n if (d.energy[1990] == null || d.energy[currentYear][\"All products\"] == 0) return d.name + \": No data\";\n\n var all = d.energy[currentYear][\"All products\"];\n var renewable = d.energy[currentYear][\"Renewable energies\"];\n var per = renewable / all;\n\n hoverArrow(per);\n\n return \"<b>\" + d.name + \"</b><br/>\" + fmtPer(per) + \" renewables\"\n })\n .classed(\"hidden\", false);\n}", "function handleMouseOver(d, i) {\n\nd3.selectAll(\".visualCircle\").transition()\n .duration(200)\n .style(\"opacity\", 1)\n .attr(\"fill\", \"rgba(255,255,255,0.8)\")\n .attr(\"r\", circleRBefore);\n\nd3.selectAll(\".visualLabel\").transition()\n .duration(200)\n .style(\"opacity\", 0);\n\nd3.select(\"#circle_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 0.2)\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .attr(\"r\", circleRAfter);\n\nd3.select(\"#text_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 1);\n \ndocument.getElementById(\"type680target\").innerHTML = \"<h4>\" + itemTitles[this.id] + \"</h4><hr class='light' style='margin-left: 0px;'><p class='text-justify'>\" + itemDescriptions[this.id] + \"</p>\";\n\n}", "function rect_mouseover() {\n\t\t\tpercentText.style(\"opacity\", 1)\n\t\t\tapproveText.style(\"opacity\", 1)\n\t\t\tfocusDate.style(\"opacity\", 1)\n\t\t}", "function onMouseOver(d, i) {\n\t d3.select(this).attr('class', 'highlight');\n\t d3.select(this)\n\t .transition()\n\t .duration(400)\n\t .attr('width', xScale.bandwidth() + 5)\n\t .attr(\"y\", function(d) { return yScale(d.popularity) - 10; })\n\t .attr(\"height\", function(d) { return innerHeight1 - yScale(d.popularity) + 10; });\n\n\t g.append(\"text\")\n\t .attr('class', 'val') // add class to text label\n\t .attr('x', function() {\n\t return xScale(d.artists);\n\t })\n\t .attr('y', function() {\n\t return yScale(d.popularity) - 15;\n\t })\n\t .text(function() {\n\t return d.popularity; // Value of the text\n\t });\n\t}", "function mouseover() {\n //convert the slider value to the correct index of time in mapData\n spot = d3.select(this);\n if (!spot.classed('hidden-spot')) {\n index = rangeslider.value - 5\n let occupant = mapData[spot.attr(\"id\")][index];\n tooltip\n .html(mapData[spot.attr(\"id\")][0] + ': ' + (occupant === \"\" ? \"Unoccupied\" : occupant))\n .style(\"opacity\", 1);\n }\n}", "function addCount() {\n count++;\n $('.count').html(count);\n }", "function feedTotalHitCount(totalHitCount){\r\n var totalHitCountSelector = document.getElementById(\"total-hit-count\");\r\n totalHitCountSelector.innerHTML = totalHitCount;\r\n $(\"#total-hit-spinner\").hide();\r\n }", "function mouseoverNode(d){\n\t\n\tvar disVal;\n\tif(showFlowIn){\n\t\tdisVal = \"Flow In Value: \"+d.flowInto;\n\t}\n\telse{\n\t\tdisVal = \"Flow Out Value: \"+d.flowOut;\n\t}\n\n\tdocument.getElementById(\"nodeval\").textContent = disVal;\n}", "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "displayResult(tip, total) {\r\n this.tipAmount.innerText = this.tipAmount.innerText.replace(/[^$].+/, tip);\r\n this.totalAmount.innerText = this.totalAmount.innerText.replace(/[^$].+/, total);\r\n }", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n\t\tif (row.votecount.length != 0){\n\t \n\t\t\ttext += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n\t\t}\n\t });\n\n\t return text;\n\t}", "function calcTotal (){\n totalLabel.innerHTML = 'Total: $' + value;\n}", "function counter(){\n // console.log(\"counter is working\",data);\n for(let i=0; i< data.length; i++){\n if(data[i].eco == \"1\"){\n plasticCounter = plasticCounter + 100;\n }\n else if(data[i].average == \"2\"){\n plasticCounter = plasticCounter + 200;\n console.log(plasticCounter);\n }\n else if(data[i].bad == \"3\"){\n plasticCounter = plasticCounter + 300;\n }\n };\n document.getElementById(\"myText\").innerHTML = plasticCounter;\n}", "function updateEpidemicStats(agentmap) {\n var infected_display = document.getElementById(\"infected_value\");\n // infected_display.textContent = agentmap.infected_count;\n\n var healthy_display = document.getElementById(\"healthy_value\");\n // healthy_display.textContent =\n // agentmap.agents.count() - agentmap.infected_count;\n}", "function showTotal(start,end){\n $.ajax({\n type: \"GET\",\n async:false,\n url: 'https://'+BALLERINA_URL+'/pmt-dashboard-serives/loaddashboard/'+start+'/'+end,\n success: function(jsonResponse){\n document.getElementById('proactive').innerHTML = jsonResponse.proactiveCount;\n document.getElementById('reactive').innerHTML = jsonResponse.reactiveCount;\n document.getElementById('unCategory').innerHTML = jsonResponse.uncategorizedCount;\n document.getElementById('queuedPatchCount').innerHTML = jsonResponse.yetToStartCount;\n document.getElementById('completePatchCount').innerHTML = jsonResponse.completedCount;\n document.getElementById('partiallyCompletePatchCount').innerHTML = jsonResponse.partiallyCompletedCount;\n document.getElementById('inProcessPatchCount').innerHTML = jsonResponse.inProgressCount;\n document.getElementById('overETAcount').innerHTML = '('+jsonResponse.ETACount+'<span style=\"font-size:12px;\"> over ETA</span>)';\n totalProducts = jsonResponse.menuDetails.allProducts.length;\n menuDrillDown = jsonResponse.menuDetails.allProducts;\n versionCount = jsonResponse.menuDetails.allVersions.length;\n menuVersionDrillDown = jsonResponse.menuDetails.allVersions;\n\n }\n });\n}", "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "refreshTotalCalories() {\n UISelectors.totalCaloriesDisplay.textContent = ItemCtrl.getTotalCalories();\n }", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "getTotalCalories() {\n return this.state.breakfast.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.lunch.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.dinner.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.snacks.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0);\n }", "function showDetail(event, key, amount, count, percent) {\n\n // show tooltip with information from the __data__ property of the element\n var x_hover = 0;\n var y_hover = 0;\n\n var content = \"<b>\" + key + \"</b><br/>\";\n\n if (amount != null) content += \"<b>Amount: </b>\" + amount + \"<br/>\";\n if (count != null) content += \"<b>Count: </b>\" + count + \"<br/>\";\n if (percent != null) content += \"<b>Percent: </b>\" + percent + \"<br/>\";\n\n var tooltipWidth = parseInt(tooltip.style('width'));\n var tooltipHeight = parseInt(tooltip.style('height'));\n var classed,notClassed;\n \n if (event.pageX > document.body.clientWidth / 2) {\n x_hover = tooltipWidth + 30;\n classed = 'right';\n notClassed = 'left';\n } else {\n x_hover = -30;\n classed = 'left';\n notClassed = 'right';\n }\n \n // y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight + 4) : event.pageY - tooltipHeight / 2;\n y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight - 40) : event.pageY - tooltipHeight - 40;\n\n return tooltip\n .classed(classed,true)\n .classed(notClassed,false)\n .style({\n \"visibility\": \"visible\",\n \"top\": y_hover + \"px\",\n \"left\": (event.pageX - x_hover) + \"px\"\n })\n .html(content);\n}", "function visualizeExtraRunsConcededByEachTeam(extraRunsConcededByEachTeam) {\n let seriesData = [];\n for (let key in extraRunsConcededByEachTeam) {\n seriesData.push([key, extraRunsConcededByEachTeam[key]]);\n }\n console.log(seriesData);\n Highcharts.chart(\"extra-runs-conceded-by-each-team\", {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: 0,\n plotShadow: false,\n },\n title: {\n text: \"Extra Runs Conceded<br>by Each Team<br>2016\",\n align: \"center\",\n verticalAlign: \"middle\",\n y: 75,\n },\n tooltip: {\n pointFormat: \"{series.name}: <b>{point.percentage:.1f}</b>\",\n },\n accessibility: {\n point: {\n valueSuffix: \"%\",\n },\n },\n plotOptions: {\n pie: {\n dataLabels: {\n enabled: true,\n distance: -90,\n style: {\n fontWeight: \"bold\",\n color: \"grey\",\n },\n },\n startAngle: -90,\n endAngle: 90,\n center: [\"50%\", \"75%\"],\n size: \"150%\",\n },\n },\n series: [\n {\n type: \"pie\",\n name: \"Browser share\",\n innerSize: \"75%\",\n data: seriesData,\n },\n ],\n });\n}", "function showSeatPrice (container, unitDetailHtml) {\n // $(document).on('mouseover', '.asiento', function (e) {\n if (!$(container).hasClass('ocupado') && !$(container).hasClass('asignado')) {\n var specialTooltipFix = false\n $('.tooltip-asiento').remove()\n var position = 'En medio'\n var newCopy = 'Cambia tu asiento por'\n var evalPos = $(container).attr('name')\n evalPos = evalPos.split(' ')\n if (evalPos[1] == 'C' || evalPos[1] == 'D') {\n position = 'Pasillo'\n }\n if (evalPos[1] == 'A' || evalPos[1] == 'F') {\n position = 'Ventana'\n }\n var precio = '<span class=\"seat-price\">$489 MXN</span>'\n var specialSeat = '<span class=\"exit-row\">Fila de salida de emergencia</span>'\n var asientoID = '<span class=\"seat-num\">' + ($(container).attr('name')).replace('-', '') + '</span>'\n var addHover = '<div style=\"position:absolute; height:250%; width:700%;\" class=\"tooltip-asiento\"><p>'\n if ($(container).hasClass('especial')) {\n addHover += '' + asientoID + ' ' + newCopy + ' ' + specialSeat + ' ' + precio + ''\n specialTooltipFix = true\n }else {\n addHover += '' + asientoID + ' ' + newCopy + ' ' + precio + ''\n specialTooltipFix = false\n }\n // addHover += '</p></div>'\n addHover = unitDetailHtml\n $(container).append(addHover)\n\n // If tooltip is too close to left, right or bottom edges this adds the classes that change the styles\n var popUpOffset = $($(container).find('.tooltip-asiento')[0]).offset()\n\n if (popUpOffset.top > $(window).height() - 160) {\n $($(container).find('.tooltip-asiento')[0]).addClass('bottom-margin')\n if (specialTooltipFix) {\n $($(this).find('.tooltip-asiento')[0]).css('margin-top', '-145px')\n }else {\n $($(this).find('.tooltip-asiento')[0]).css('margin-top', '-105px')\n }\n }else {\n $($(container).find('.tooltip-asiento')[0]).removeClass('bottom-margin')\n }\n if (popUpOffset.left < 0) {\n $($(container).find('.tooltip-asiento')[0]).addClass('left-margin')\n }else {\n $($(container).find('.tooltip-asiento')[0]).removeClass('left-margin')\n }\n if (popUpOffset.left > $(window).width() - 190) {\n $($(container).find('.tooltip-asiento')[0]).addClass('right-margin')\n }else {\n $($(container).find('.tooltip-asiento')[0]).removeClass('right-margin')\n }\n\n // on Internet Explorer there is an issue with positioning after styles, this solves the issue\n if (msieversion()) {\n var thisLeft = $($(container).find('.tooltip-asiento')[0]).position().left\n var thisStringLeft = (thisLeft - 125).toString()\n $($(this).find('.tooltip-asiento')[0]).css('left', thisStringLeft + 'px')\n }\n }\n // on Safari there is an issue regarding scrolling of seats, this solves the issue\n if (is_safari) {\n $('#asientos-en-avion-filas').click()\n $('#asientos-en-avion-filas').focus()\n }\n // })\n // Once you stop hovering over a seat, the tooltip is removed\n $(document).on('mouseleave', '.asiento', function (e) {\n $('.tooltip-asiento').remove()\n })\n}", "function treeCuttingTotal() {\nvar total_number_tree = {\nonStatisticField: \"CommonName\",\noutStatisticFieldName: \"total_number_tree\",\nstatisticType: \"count\"\n};\n\nvar query = treeLayer.createQuery();\nquery.outStatistics = [total_number_tree];\n\nreturn treeLayer.queryFeatures(query).then(function(response) {\nvar stats = response.features[0].attributes;\nconst totalNumber = stats.total_number_tree;\n//const LOT_HANDOVER_PERC = (handedOver/affected)*100;\nreturn totalNumber;\n});\n}", "function GetSummary() {\n var YearQuery = '';\n if (FilterList.DashboardFilterYear === '') {\n YearQuery =\n ' business_year = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('YYYY') +\n \"'\";\n } else {\n YearQuery =\n ' business_year = ' + \"'\" + FilterList.DashboardFilterYear + \"'\";\n }\n\n var MonthQuery = '';\n if (FilterList.DashboardFilterMonth === '') {\n MonthQuery =\n ' and business_month = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('MMMM') +\n \"'\";\n } else {\n MonthQuery =\n ' and business_month = ' + \"'\" + FilterList.DashboardFilterMonth + \"'\";\n }\n\n var TeamQuery = '';\n if (\n FilterList.DashboardFilterTeam === '' ||\n FilterList.DashboardFilterTeam === 'ALL'\n ) {\n TeamQuery = ' and team IN ' + global.TeamAccessList;\n } else {\n TeamQuery = ' and team = ' + \"'\" + FilterList.DashboardFilterTeam + \"'\";\n }\n\n var VendorQuery = '';\n if (\n FilterList.DashboardFilterVendor === '' ||\n FilterList.DashboardFilterVendor === 'ALL'\n ) {\n VendorQuery = ' and principal_name like ' + \"'%%' \";\n } else {\n VendorQuery =\n ' and principal_name = ' + \"'\" + FilterList.DashboardFilterVendor + \"'\";\n }\n\n dbperymtsat.transaction((tx) => {\n tx.executeSql(\n 'SELECT SUM(amount) as amount , SUM(target) as target FROM perymtsat_tbl where ' +\n YearQuery +\n MonthQuery +\n TeamQuery +\n VendorQuery +\n ' order by invoice_date asc ',\n [],\n (tx, results) => {\n var len = results.rows.length;\n if (len > 0) {\n // console.log(results.rows.item(0).target);\n //console.log(results.rows.item(0).amount);\n //setTotalSales();\n setTotalTarget(parseInt(results.rows.item(0).target));\n setTotalSales(parseInt(results.rows.item(0).amount));\n settotalSalesAnimation(true);\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n\n // console.log(\n // 'Successfully got summary of ' +\n // FilterList.DashboardFilterMonth +\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n // );\n }\n },\n SQLerror,\n );\n });\n }", "function gridOnHandler(){\r\n \r\n gridSimulatorVar.current_counter = 0\r\n paintGridOnHover(this)\r\n paintGridCounter(gridSimulatorVar.current_counter)\r\n\r\n}", "function hoverPanelRelated () {\n $('.browseview .relatedContainer .panel').on({\n mouseenter: function () {\n $(this).children().css({'background-color': '#68C3A3', 'color': 'black', 'transition': 'all 0.3s ease', '-webkit-transform': 'scale(1.05)', '-ms-transform': 'scale(1.05)', 'transform': 'scale(1.05)'})\n },\n mouseleave: function () {\n $(this).children().css({'background-color': '#f5f5f5', 'color': '#717f86', 'transition': 'all 0.3s ease', '-webkit-transform': 'scale(1.0)', '-ms-transform': 'scale(1.0)', 'transform': 'scale(1.0)'})\n },\n click: function () {\n window.location = $(this).children('.viewbutton').attr('href')\n }\n })\n }", "function update_total_count_summary() {\r\n\t\t\t$('#flight_search_result').show();\r\n\t\t\tvar _visible_records = parseInt($('.r-r-i:visible').length);\r\n\t\t\tvar _total_records = $('.r-r-i').length;\r\n\t\t\t// alert(_total_records);\r\n\t\t\tif (isNaN(_visible_records) == true || _visible_records == 0) {\r\n\t\t\t\t_visible_records = 0;\r\n\t\t\t\t//display warning\r\n\t\t\t\t$('#flight_search_result').hide();\r\n\t\t\t\t$('#empty_flight_search_result').show();\r\n\t\t\t} else {\r\n\t\t\t\t$('#flight_search_result').show();\r\n\t\t\t\t$('#empty_flight_search_result').hide();\r\n\t\t\t}\r\n\t\t\t$('#total_records').text(_visible_records);\r\n\t\t\tif(_visible_records == 1){\r\n\t\t\t\t$('#flights_text').text('Flight');\r\n\t\t\t}\r\n\t\t\t$('.visible-row-record-count').text(_visible_records);\r\n\t\t\t$('.total-row-record-count').text(_total_records);\r\n\t\t\t\r\n\t\t}", "function lotTotalArea() {\nvar total_affected_area = {\nonStatisticField: \"AffectedArea\",\noutStatisticFieldName: \"total_affected_area\",\nstatisticType: \"sum\"\n}\n\nvar total_handover_area = {\nonStatisticField: \"HandOverArea\",\noutStatisticFieldName: \"total_handover_area\",\nstatisticType: \"sum\"\n};\n\nvar query = lotLayer.createQuery();\nquery.outStatistics = [total_affected_area, total_handover_area];\n\nreturn lotLayer.queryFeatures(query).then(function(response) {\nvar stats = response.features[0].attributes;\n\nconst totalAffected = stats.total_affected_area;\nconst totalHandedOver = stats.total_handover_area;\n//const LOT_HANDOVER_PERC = (handedOver/affected)*100;\nreturn totalAffected;\n});\n}", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "function pop_Edmonton_Centre_2016_Census_Median_Income_Poll_DA_Unions_2(feature, layer) {\n layer.on({\n mouseout: function(e) {\n for (i in e.target._eventParents) {\n e.target._eventParents[i].resetStyle(e.target);\n }\n },\n mouseover: highlightFeature,\n });\n var popupContent = '<table>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Name'] !== null ? autolinker.link(feature.properties['Name'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Descriptio'] !== null ? autolinker.link(feature.properties['Descriptio'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Descript_1'] !== null ? autolinker.link(feature.properties['Descript_1'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Descript_2'] !== null ? autolinker.link(feature.properties['Descript_2'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PollNum'] !== null ? autolinker.link(feature.properties['PollNum'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['DAUID'] !== null ? autolinker.link(feature.properties['DAUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PRUID'] !== null ? autolinker.link(feature.properties['PRUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PRNAME'] !== null ? autolinker.link(feature.properties['PRNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CDUID'] !== null ? autolinker.link(feature.properties['CDUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CDNAME'] !== null ? autolinker.link(feature.properties['CDNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CDTYPE'] !== null ? autolinker.link(feature.properties['CDTYPE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CCSUID'] !== null ? autolinker.link(feature.properties['CCSUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CCSNAME'] !== null ? autolinker.link(feature.properties['CCSNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CSDUID'] !== null ? autolinker.link(feature.properties['CSDUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CSDNAME'] !== null ? autolinker.link(feature.properties['CSDNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CSDTYPE'] !== null ? autolinker.link(feature.properties['CSDTYPE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['ERUID'] !== null ? autolinker.link(feature.properties['ERUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['ERNAME'] !== null ? autolinker.link(feature.properties['ERNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['SACCODE'] !== null ? autolinker.link(feature.properties['SACCODE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['SACTYPE'] !== null ? autolinker.link(feature.properties['SACTYPE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CMAUID'] !== null ? autolinker.link(feature.properties['CMAUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CMAPUID'] !== null ? autolinker.link(feature.properties['CMAPUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CMANAME'] !== null ? autolinker.link(feature.properties['CMANAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CMATYPE'] !== null ? autolinker.link(feature.properties['CMATYPE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CTUID'] !== null ? autolinker.link(feature.properties['CTUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CTNAME'] !== null ? autolinker.link(feature.properties['CTNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['ADAUID'] !== null ? autolinker.link(feature.properties['ADAUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Area km2'] !== null ? autolinker.link(feature.properties['Area km2'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PercAreaDA'] !== null ? autolinker.link(feature.properties['PercAreaDA'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PopApprox'] !== null ? autolinker.link(feature.properties['PopApprox'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Liberal'] !== null ? autolinker.link(feature.properties['Liberal'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Conservative'] !== null ? autolinker.link(feature.properties['Conservative'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['NDP'] !== null ? autolinker.link(feature.properties['NDP'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Total Votes'] !== null ? autolinker.link(feature.properties['Total Votes'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Total Electors'] !== null ? autolinker.link(feature.properties['Total Electors'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['First Place Votes'] !== null ? autolinker.link(feature.properties['First Place Votes'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['First Place'] !== null ? autolinker.link(feature.properties['First Place'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Second Place Votes'] !== null ? autolinker.link(feature.properties['Second Place Votes'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Second Place'] !== null ? autolinker.link(feature.properties['Second Place'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Third Place Votes'] !== null ? autolinker.link(feature.properties['Third Place Votes'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Third Place'] !== null ? autolinker.link(feature.properties['Third Place'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Margin: First - Second'] !== null ? autolinker.link(feature.properties['Margin: First - Second'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Margin: First - Liberal'] !== null ? autolinker.link(feature.properties['Margin: First - Liberal'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Turnout'] !== null ? autolinker.link(feature.properties['Turnout'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['% of Additional Votes Needed'] !== null ? autolinker.link(feature.properties['% of Additional Votes Needed'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['663T'] !== null ? autolinker.link(feature.properties['663T'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['663M'] !== null ? autolinker.link(feature.properties['663M'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['663F'] !== null ? autolinker.link(feature.properties['663F'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['AreaDA Km2'] !== null ? autolinker.link(feature.properties['AreaDA Km2'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1T'] !== null ? autolinker.link(feature.properties['1T'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1683T'] !== null ? autolinker.link(feature.properties['1683T'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1683M'] !== null ? autolinker.link(feature.properties['1683M'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1683F'] !== null ? autolinker.link(feature.properties['1683F'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686T'] !== null ? autolinker.link(feature.properties['1686T'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686M'] !== null ? autolinker.link(feature.properties['1686M'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686F'] !== null ? autolinker.link(feature.properties['1686F'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686T_R'] !== null ? autolinker.link(feature.properties['1686T_R'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686M_R'] !== null ? autolinker.link(feature.properties['1686M_R'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686F_R'] !== null ? autolinker.link(feature.properties['1686F_R'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n </table>';\n layer.bindPopup(popupContent, {maxHeight: 400});\n }", "function mouseoverFunction(e) {\n var layer = e.target;\n\n layer.setStyle({\n weight: 3,\n color: 'blue',\n dashArray: '',\n fillOpacity: 1\n });\n\n if (!L.Browser.ie && !L.Browser.opera) {\n layer.bringToFront();\n }\n\n //update the text in the infowindow with whatever was in the data\n //console.log(layer.feature.properties.NTAName);\n $('#infoWindow').html(layer.feature.properties.ntaname+'<br />REDI Score: '+Math.round(layer.feature.properties[redi_column]));\n}", "tooltip_render (tooltip_data)\r\n\t{\r\n\t\t//var that=this;\r\n\t let text = \"<ul>\";\r\n\t // console.log(\"----\",tooltip_data);\r\n\t tooltip_data.forEach((row)=>{\r\n\t text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.value+\"%)\" + \"</li>\"\r\n\t });\r\n\r\n\t return text;\r\n\t}", "function calcOPEX() {\n var expenses = 0.0;\n var current;\n for (var i=0; i<agileModel.SITES.length; i++) {\n for (var j=0; j<agileModel.SITES[i].siteBuild.length; j++) {\n current = agileModel.SITES[i].siteBuild[j];\n if (current.built) {\n for (var l=0; l<current.labor.length; l++) {\n expenses += current.labor[l].cost;\n }\n }\n }\n }\n return expenses;\n}", "function totalnoinhousehold () {\n var totalno =\n parseInt($(editemployer + '#adult').val(), 10) +\n parseInt($(editemployer + '#teenager').val(), 10) +\n parseInt($(editemployer + '#children').val(), 10) +\n parseInt($(editemployer + '#infant').val(), 10) +\n parseInt($(editemployer + '#elderly').val(), 10) +\n parseInt($(editemployer + '#disabled').val(), 10)\n $('.totalnoinhousehold').text(totalno)\n }", "displayToolTip(item) {\n console.log(\"Hovering Over Item: \", item.name);\n }", "updateTotals() {\n this.total = this.getTotalUsers(this.act_counts);\n\n // Total Customers\n this.element.dispatchEvent(\n new CustomEvent(\"pingpong.total\", {\n bubbles: true,\n composed: true,\n detail: {\n total_cust: this.total\n }\n })\n );\n\n if (this.element.querySelector(\"span\").innerHTML != this.total) {\n this.element.querySelector(\"span\").innerHTML = this.total;\n }\n\n // Update percentages\n this.label.selectAll(\"tspan.actpct\").text(d => {\n let count = this.act_counts[d.id] || 0;\n let percentage = this.readablePercent(\n this.act_counts[d.id],\n this.total\n );\n\n return this.foci[d.id].showTotal ? count + \"|\" + percentage : \"\";\n });\n }", "function displayTotals() {\r\n const totalPrice = SeatData.getTotalHeldPrice(seats);\r\n const heldSeatLabels = SeatData.getHeldSeats(seats).map(seat => seat.label);\r\n\r\n const priceSpan = document.querySelector(\"#selected-seat-price\");\r\n const labelSpan = document.querySelector(\"#selected-seat-labels\");\r\n\r\n priceSpan.innerText = totalPrice.toFixed(2);\r\n labelSpan.innerText = heldSeatLabels.length > 0 ? heldSeatLabels.join(\", \") : \"None\";\r\n }", "function opacityIncrease(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n opa = 0.1\n $('.square').css(\"opacity\", opa);\n $('.square').css(\"background-color\", \"black\");\n $('.square').mouseenter(function(){\n opaval = $(this).css(\"opacity\");\n if (opaval < 1){\n $(this).css(\"opacity\", opaval*1.3);\n }\n });\n}", "tooltip_render (tooltip_data) {\n let text = \"<ul>\";\n tooltip_data.result.forEach((row)=>{\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n });\n\n return text;\n }", "function sumarTotal(){\n let boxTotal = document.getElementById(`reduce`)\n let sumaReduce = carrito.reduce((acc, item)=> {return acc + item.precio},0)\n\n boxTotal.innerHTML=`<h2>Total: $${sumaReduce}</h2>`\n\n console.log(sumaReduce)\n}", "function onEachFeatureINCOME(feature, layer) {\n layer.on({\n mouseover: highlightFeature,\n mouseout: resetHighlightINCOME,\n click: zoomToFeature\n });\n layer.bindPopup('<h3>' + feature.properties.COUNTY + '</h3>');\n\n}", "function getFinalSumResult() {\r\n $(document).ready(function () {\r\n $(\"#paymentSum\").mouseout(function () {\r\n if (flag) {\r\n let nds = $(\"#ndcInputFiled\").val();\r\n let finalResult = result * (1 + (+nds / 100));\r\n $(\"#resultSum\").val(parseFloat(finalResult).toFixed(2));\r\n } else {\r\n $(\"#resultSum\").val(\"\");\r\n }\r\n });\r\n });\r\n}", "function totalPoints(stage) {\n var totalPoints = 0;\n stage.forEach((item2, te) => {\n var search = item2.split(\"\");\n search.forEach((item1, s) => {\n if(item1 === 'd')\n {\n totalPoints += 1;\n }\n });\n });\n //*********************RETURN ************************\n return totalPoints;\n }", "function myAgendaMouseoverHandler(eventObj) {\n var agendaId = eventObj.data.agendaId;\n var agendaItem = jfcalplugin.getAgendaItemById(\"#mycal\", agendaId);\n //alert(\"You moused over agenda item \" + agendaItem.title + \" at location (X=\" + eventObj.pageX + \", Y=\" + eventObj.pageY + \")\");\n }" ]
[ "0.649632", "0.59669816", "0.5820691", "0.55538", "0.5489368", "0.54846215", "0.5401589", "0.5399341", "0.5374675", "0.5359719", "0.5353452", "0.52864295", "0.5269863", "0.523301", "0.52233297", "0.5223235", "0.5219091", "0.5156936", "0.514597", "0.5143204", "0.51423156", "0.5136868", "0.51218444", "0.5115101", "0.5087103", "0.5074999", "0.50697434", "0.5066922", "0.50589126", "0.5055837", "0.504047", "0.5039812", "0.50350744", "0.5026824", "0.5019491", "0.50137043", "0.49954242", "0.49900594", "0.49841887", "0.49736857", "0.49686468", "0.49642584", "0.49635586", "0.49633545", "0.49434727", "0.4937119", "0.4928001", "0.49267066", "0.49168918", "0.49163342", "0.49012077", "0.4897267", "0.4891142", "0.4888514", "0.48843455", "0.48759753", "0.48702458", "0.48659948", "0.48643273", "0.4860995", "0.4852559", "0.484887", "0.48461378", "0.48407808", "0.48404095", "0.48355696", "0.4833408", "0.48326275", "0.48272634", "0.48266932", "0.48239386", "0.48227325", "0.48215255", "0.482107", "0.48208374", "0.48206937", "0.48154214", "0.4814476", "0.48118752", "0.48078722", "0.4806875", "0.48006165", "0.48005587", "0.47998524", "0.47994956", "0.4797955", "0.47967687", "0.47938228", "0.47937468", "0.47789145", "0.4776217", "0.47744656", "0.47717333", "0.4765193", "0.47629339", "0.47534072", "0.4752936", "0.47463685", "0.47450846", "0.47442675" ]
0.5184354
17
This function shows customer count and total deal amount in pipeline on mouseover
function showSaleAmount(saleAmount) { var saleAmtLabel = document.createElement("DIV"); saleAmtLabel.className = "chartBarLabel"; saleAmtLabel.appendChild(document.createTextNode("$" + saleAmount.toLocaleString())); var getdiv = document.getElementById("hoverSale"); getdiv.innerText = ""; $('#hoverSale').append(saleAmtLabel); var getwondiv = document.getElementById("wonOpp"); getwondiv.innerText = ""; var wonAmtLabel = document.createElement("DIV"); wonAmtLabel.className = "wonLostLabel"; wonAmtLabel.appendChild(document.createTextNode("$" + saleAmount.toLocaleString())); $('#wonOpp').append(wonAmtLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElement(\"DIV\");\n wonCountLabel.className = \"wonLostLabel\";\n wonCountLabel.appendChild(document.createTextNode(saleCount));\n $('#wonOpp').append(wonCountLabel); \n}", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function printTotalCost() {\n $(\".totalCost span\").append(\"<p> $\"+totalCost+ \"</p>\");\n }", "function showLeadAmount(leadAmount) {\n var getdiv = document.getElementById(\"hoverLead\");\n getdiv.innerText = \"\";\n var leadAmtLabel = document.createElement(\"DIV\");\n leadAmtLabel.className = \"chartBarLabel\";\n leadAmtLabel.appendChild(document.createTextNode(\"$\" + leadAmount.toLocaleString()));\n $('#hoverLead').append(leadAmtLabel);\n}", "function displayTotalcalories() {\n //Get total calories\n const totalCalories = ItemCtr.getTotalCalories();\n //add total calories to UI\n UICtrl.showTotalCalories(totalCalories);\n }", "updateTotals() {\n this.total = this.getTotalUsers(this.act_counts);\n\n // Total Customers\n this.element.dispatchEvent(\n new CustomEvent(\"pingpong.total\", {\n bubbles: true,\n composed: true,\n detail: {\n total_cust: this.total\n }\n })\n );\n\n if (this.element.querySelector(\"span\").innerHTML != this.total) {\n this.element.querySelector(\"span\").innerHTML = this.total;\n }\n\n // Update percentages\n this.label.selectAll(\"tspan.actpct\").text(d => {\n let count = this.act_counts[d.id] || 0;\n let percentage = this.readablePercent(\n this.act_counts[d.id],\n this.total\n );\n\n return this.foci[d.id].showTotal ? count + \"|\" + percentage : \"\";\n });\n }", "function showTotalPassengerCount(){\n\t$('.passenger-count').html(passenger_count)\n}", "function getpanierItemsCount(){\n\n\ttotal=calculertotal();\n\t(document.querySelector(\"#total\")).innerHTML=(\"Total a payer \"+total+\" DH\");\n}", "function _displayTotalRevenueOfOwner(list) {\n totalRevenue = list.reduce((prevVal, currVal) => {\n const val = currVal.cost;\n return {\n subTotal: prevVal.subTotal + val.subTotal,\n serviceTax: prevVal.serviceTax + val.serviceTax,\n swachhBharatCess: prevVal.swachhBharatCess + val.swachhBharatCess,\n krishiKalyanCess: prevVal.krishiKalyanCess + val.krishiKalyanCess,\n total: prevVal.total + val.total,\n tax: currVal.tax,\n }\n }, {\n subTotal: 0,\n serviceTax: 0,\n swachhBharatCess: 0,\n krishiKalyanCess: 0,\n total: 0,\n });\n console.log('Total Revenue');\n _displayLog(totalRevenue);\n }", "function calcTotal (){\n totalLabel.innerHTML = 'Total: $' + value;\n}", "getCartTotal (total) {\n document.getElementsByClassName('grandTotal')[0].innerText = \" # \"+ total\n \t\n }", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "function displayTotal() {\n\tscreen1.bugCount.html(prettyNumber(Math.round(state.larvae)));\n\tscreen1.larvaePerSec.html(prettyNumber(state.lps));\n}", "function displayTotal() {\n //get total and store in variable\n let total = getTotal();\n // chnage total in navbar\n $(\"#nav-total\").text(`Total: $${total}`)\n // change total in cart\n $(\"#cart-total\").text(`$${total}`)\n}", "function fastClassBookingHandler(increase)\n {\n const bookingnumber = document.getElementById(\"bookingNumber\");\n const bookingCount = parseInt(bookingnumber.value);\n let bookingNewCount = 0;\n if(increase==true){\n bookingNewCount = bookingCount + 1;\n }\n if(increase == false && bookingCount>0){\n bookingNewCount = bookingCount - 1;\n }\n bookingNumber.value = bookingNewCount; \n const nettotal = bookingNewCount *150;\n document.getElementById(\"netPrice\").innerText = '$'+nettotal;\n subtotal();\n }", "function showOppCount(oppCount) { \n var getDiv = document.getElementById(\"hoverOpp\");\n getDiv.innerText = oppCount; \n}", "function showOppAmount(oppAmount) {\n var getdiv = document.getElementById(\"hoverOpp\");\n getdiv.innerText = \"\";\n var oppAmtLabel = document.createElement(\"DIV\");\n oppAmtLabel.className = \"chartBarLabel\";\n oppAmtLabel.appendChild(document.createTextNode(\"$\" + oppAmount.toLocaleString()));\n $('#hoverOpp').append(oppAmtLabel);\n}", "function economyClassHandler(increase) \n {\n const bookingnumber = document.getElementById(\"ebookingNumber\");\n const bookingCount = parseInt(bookingnumber.value);\n let bookingNewCount = 0;\n if(increase==true){\n bookingNewCount = bookingCount + 1;\n }\n if(increase == false && bookingCount>0){\n bookingNewCount = bookingCount - 1;\n }\n ebookingNumber.value = bookingNewCount; \n const nettotal = bookingNewCount *100;\n document.getElementById(\"netPrice\").innerText = '$'+nettotal;\n subtotal();\n }", "function totalSales(products, lineItems){\n //TODO\n\n}", "function mostrarTotal (){\n $(\"#total\").html(`Total: $${total}`);\n}", "function process_count (repos) {\n var total = 0;\n repos.filter(function (r) {\n total += r.stargazers_count\n })\n \n //console.log('Total in github-starz.js : ' + total)\n user_callback(total);\n}", "function arc_onMouseOver(e,d,i) {\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n links.each(function (d) {\n total+= viz.value()(d.data);\n });\n\n total = \"$\" + d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"POLITICAL ACTION COMMITTEE\", d.data.values[0].CMTE_NM,\"Total Donated: \" + total);\n}", "function Summary(container_id) {\n var m_data_source = null;\n var m_panel = new JSPanel(container_id);\n var m_rpt_shipping_fee = new JSRepeater('rep_shipping_fee_real');\n var m_rpt_dangdang_money = new JSRepeater('rep_dangdang_money');\n var m_rep_collection_promotion = new JSRepeater('rep_collection_promotion');\n var m_rep_order_promotion = new JSRepeater('rep_order_promotion');\n\tvar m_rpt_overseas_tax = new JSRepeater('rep_overseas_tax_real');\n\n var promo_expand_status = true;\n var shipping_fee_expand_status = true;\n var coupon_expand_status = true;\n var giftcard_expand_status = true;\n\tvar overseas_tax_expand_status = true;\n\n var obj_coupon_money_real = null;\n var obj_rep_dangdang_money = null;\n var obj_rep_order_promotion = null;\n var obj_rep_collection_promotion = null;\n var obj_rep_shipping_fee_real = null;\n\tvar obj_rep_overseas_tax_real = null;\n\t\n\tvar order_count = 0;\n\t\n\tvar is_show_free_oversea = false;\n\t\n\tvar deposit_presale_type = 0; //1代表全款支付,2代表定金和尾款分开支付\n\n this.show = function (result) {\n bindTemplate();\n addEvents();\n\n // get_order_submit_tips(m_data_source[\"is_agree\"]);\n\n //验证码\n yzmInit();\n\n //支付密码\n payPasswordInit();\n\n $1('btn_change_yzm').onclick = function () { changeYZMMarked(); };\n\n $1('ck_protocol').onclick = function () { check_protocol(); };\n }\n\n this.setDataSource = function (data_source) {\n m_data_source = data_source;\n m_panel.DataSource = data_source;\n\n m_rpt_shipping_fee.DataSource = data_source['order_list'];\n m_rpt_dangdang_money.DataSource = data_source['order_list'];\n m_rep_collection_promotion.DataSource = data_source['collection_deduct_info'];\n\n m_rep_order_promotion.DataSource = data_source['order_promotion'];\n m_rpt_overseas_tax.DataSource = data_source['order_list'];\n\n if (m_data_source[\"presale_type\"] == null) {\n deposit_presale_type = 0;\n } else {\n deposit_presale_type = m_data_source[\"presale_type\"];\n }\n }\n\n this.setSubmit = function (order_flow_submit) {\n m_order_flow_submit = order_flow_submit;\n }\n\n this.setYzmStatus = function (is_no_safe_ip) {\n m_data_source['is_no_safe_ip'] = is_no_safe_ip;\n }\n\n this.isNoSafeIp = function () {\n return m_data_source['is_no_safe_ip'];\n }\n\n var get_order_submit_tips = function (is_agree) {\n var order_submit_tips = $1('order_submit_tips');\n if (order_submit_tips != null) {\n if (!is_agree) {\n order_submit_tips.innerHTML = P_ORDER_SUBMIT_PROTOCOL_TIPS;\n $1('order_submit_tips').className = \"\";\n }\n else\n $1('order_submit_tips').className = \"objhide\";\n }\n }\n\n\n this.setSubmitErrorTips = function (submit_error_tips) {\n if (submit_error_tips)\n $s($1('order_submit_error_tips_bar'));\n else\n $h($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = submit_error_tips;\n }\n\n //点了提交按钮后的按钮变化\n this.setDisabled = function () {\n $disabled('submit');\n $wait('submit');\n }\n this.setEnabled = function () {\n $enabled('submit');\n $1('submit').style.cursor = 'pointer';\n }\n\n var check_protocol = function () {\n if ($1('ck_protocol').checked)\n $1('submit').className = \"btn btn-super-orange\";\n else\n $1('submit').className = \"btn btn-super-orange btn-super-disabled\";\n }\n\n var ipt_yzm_keyup = function (o, e) {\n var k = null;\n if (e) {\n k = e.keyCode;\n }\n else if (event) {\n k = event.keyCode;\n }\n\n if (k == 9)\n return;\n\n var ov = o.value;\n var lisi = null;\n var j = 0;\n for (var i = 0; i < yzm_array_len; i++) {\n lisi = obj_ipt_yzm_lis[i];\n if (lisi.innerHTML.startsWith(ov)) {\n $s(lisi);\n j++;\n }\n else $h(lisi);\n }\n\n if (j < 2) {\n $h(obj_ipt_yzm);\n }\n else if (j < 10) {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = 'auto';\n }\n else {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = '100px';\n }\n };\n\n var li_c = function (t) { t.className = 'li_bg'; };\n var li_r = function (t) { t.className = ''; }\n var ipt_yzm_focus = function (o) {\n\n clearYzmTips(o);\n var li_ck = function (t) { o.value = t.innerHTML; $h(obj_ipt_yzm); o.style.color = '#404040'; };\n var sb = new StringBuilder();\n for (var i = 0; i < yzm_array_len; i++) {\n sb.append(\"<li>\");\n sb.append(i);\n sb.append('</li>');\n }\n obj_ipt_yzm.innerHTML = sb.toString();\n obj_ipt_yzm_lis = obj_ipt_yzm.childNodes;\n for (var i = 0; i < yzm_array_len; i++) {\n obj_ipt_yzm_lis[i].onmouseover = function () { li_c(this); };\n obj_ipt_yzm_lis[i].onmouseout = function () { li_r(this); };\n obj_ipt_yzm_lis[i].onclick = function () { li_ck(this); };\n }\n var pos = getposOffset_c(o);\n setLocation(obj_ipt_yzm, pos[0] + 3, pos[1] + 20);\n setDimension(obj_ipt_yzm, 85, 100);\n\n if (yzm_array_len < 8)\n obj_ipt_yzm.style.height = 'auto';\n\n\n show_ipt_yzm(obj_ipt_yzm, o);\n };\n\n var show_ipt_yzm = function (z, o) {\n $s(z);\n if (document.addEventListener) {\n document.addEventListener('click', documentonclick, false);\n }\n else {\n document.attachEvent('onclick', function (e) { documentonclick(); });\n }\n\n function documentonclick() {\n var evt = arguments[0] || window.event;\n var sender = evt.srcElement || evt.target;\n\n if (!contains(z, sender) && sender != o) {\n $h(z);\n if (document.addEventListener) {\n document.removeEventListener('click', documentonclick, false);\n }\n else {\n document.detachEvent('onclick', function (e) { documentonclick(); });\n }\n }\n };\n };\n\n // show error\n function showError(error) {\n SubmitData.error = error;\n }\n // show bind error\n function showSubmitError(errorCode) {\n var error;\n switch (errorCode) {\n case 1:\n case 5:\n case 6:\n case 9:\n case 10:\n case 11:\n error = \"请填写正确的卡号\";\n break;\n case 7:\n error = \"请填写正确的密码\";\n break;\n case 12:\n error = \"激活失败\";\n break;\n default:\n error = \"礼券绑定失败\";\n }\n showError(error);\n }\n\n // clear error\n function clearError() {\n couponData.error = null;\n }\n\n function yzmInit() {\n changeYZMMarked();\n // obj_ipt_yzm = $1('ul_ipt_yzm');\n //\t $1('ipt_yzm').onkeyup=function(e){ipt_yzm_keyup(this,e);};\n\n if (m_data_source['is_no_safe_ip'] == 0) {\n $h($1('div_yzm_word'));\n }\n\n }\n\n function payPasswordInit() {\n\n var isEnable = m_data_source['payment_password_enabled'] == 1;\n isEnable = isEnable \n \t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']));\n if (isEnable) {\n if (m_data_source['is_set_payment_password']) {\n ShowOrClosePayPassWord(3);\n }\n else {\n ShowOrClosePayPassWord(0);\n }\n }\n else {\n ShowOrClosePayPassWord(2);\n }\n }\n\n function bindTemplate() {\n if (m_data_source['order_list'] != null && m_data_source['order_list'].length > 0) {\n order_count = m_data_source['order_list'].length;\n }\n m_panel.Template = ORDER_SUMMARY_TEMPLATE;\n m_data_source['bargin_total'] = formatFloat(m_data_source['bargin_total']);\n m_data_source['shipping_fee'] = formatFloat(m_data_source['shipping_fee']);\n m_data_source['promo_discount_amount'] = formatFloat(m_data_source['promo_discount_amount']);\n m_data_source['coupon_amount'] = formatFloat(m_data_source['coupon_amount']);\n m_data_source['cust_cash_used'] = formatFloat(m_data_source['cust_cash_used']);\n m_data_source['payable_amount'] = formatFloat(m_data_source['payable_amount']);\n m_data_source['gift_card_charge'] = formatFloat(m_data_source['gift_card_charge']);\n m_data_source['total_gift_package_price'] = formatFloat(m_data_source['total_gift_package_price']);\n m_data_source['gift_package_price'] = formatFloat(m_data_source['gift_package_price']);\n m_data_source['gift_package_price_tips'] = formatFloat(m_data_source['gift_package_price_tips']);\n m_data_source['greetingcard_price'] = formatFloat(m_data_source['greetingcard_price']);\n m_data_source['privilege_code_discount_amount'] = formatFloat(m_data_source['privilege_code_discount_amount']);\n m_data_source['point_deduction_amount'] = formatFloat(m_data_source['point_deduction_amount']);\n //定金和尾款金额格式化\n m_data_source['deposit_amount'] = formatFloat(m_data_source['deposit_amount']);\n m_data_source['balance_amount'] = formatFloat(m_data_source['balance_amount']);\n\t\t\n //礼品卡和礼券总金额\n m_data_source[\"coupon_and_giftcard_money_used\"]=formatFloat((+m_data_source[\"gift_card_money_used\"])+(+m_data_source[\"coupon_amount\"]));\n m_data_source[\"gift_card_money_used\"]=formatFloat(m_data_source[\"gift_card_money_used\"]);\n m_data_source[\"coupon_used\"]=formatFloat(m_data_source[\"coupon_amount\"]);\n\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['overseas_tax']);\n\t\tif(parseFloat(m_data_source['overseas_tax']) == 0){\n\t\t\tis_show_free_oversea = true;\n\t\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['free_overseas_tax']);\n\t\t} \n\t\t\n\t\t\n if (m_data_source['payable_amount'] >= 1000) {\n m_data_source['payable_amount_style'] = \"f14\";\n }\n else {\n m_data_source['payable_amount_style'] = \"f18\";\n }\n //先取值,防止设置设置支付密码后,给输入框赋了值,但重新绑定后丢失。\n var payment_password = $F(\"input_pay_password\");\n m_panel.DataBind();\n if (payment_password)\n $1(\"input_pay_password\").value = payment_password;\n\n obj_coupon_money_real = $1(\"coupon_money_real\");\n obj_rep_dangdang_money = $1(\"rep_dangdang_money\");\n obj_rep_order_promotion = $1(\"rep_order_promotion\");\n obj_rep_collection_promotion = $1(\"rep_collection_promotion\");\n obj_rep_shipping_fee_real = $1(\"rep_shipping_fee_real\");\n\t\tobj_rep_overseas_tax_real = $1(\"rep_overseas_tax_real\");\n\n\t\tif (deposit_presale_type == 1) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else if (deposit_presale_type == 2) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else {\n\t\t $1(\"div_deposit_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"div_agree_pay_deposit\").className = 'hide';\n\t\t}\n $1(\"total_shipping_fee_real\").className = 'hide';\n $1(\"total_promo_amount_real\").className = 'hide';\n $1(\"total_coupon_real\").className = 'hide';\n $1(\"total_gift_card_charge\").className = 'hide';\n $1(\"total_cust_cash_real\").className = 'hide';\n $1(\"total_cust_point_real\").className = 'hide';\n $1(\"rep_collection_promotion\").className = 'hide';\n $1(\"total_discount_code_real\").className = 'hide';\n $1(\"total_gift_package_price\").className = 'hide';\n $1(\"gift_package_price\").className = 'hide';\n $1(\"total_privilege_code_discount_amount\").className = 'hide';\n $1(\"greetingcard_price\").className = 'hide';\n\t\t$1(\"total_overseas_tax_real\").className = 'hide';\n\t\t$1(\"total_energy_saving_subsiby_amout\").className = 'hide';\n if (m_data_source['shipping_fee'] > 0) {\n $1(\"total_shipping_fee_real\").className = '';\n m_rpt_shipping_fee.ItemTemplate = RPT_SHIPPING_FEE_ITEM_TEMPLATE;\n m_rpt_shipping_fee.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_shipping_fee'] > 0) {\n dataItem['order_shipping_fee'] = formatFloat(dataItem['order_shipping_fee']);\n }\n else {\n dataItem['shipping_fee_display'] = 'hide';\n }\n }\n m_rpt_shipping_fee.DataBind();\n }\n\t\tif(m_data_source['energy_saving'] == true) {\n\t\t\t$1(\"total_energy_saving_subsiby_amout\").className = \"\";\n\t\t}\n\t\tif (m_data_source['is_overseas'] == true) {\n\t\t\t\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"default\";\n\t\t\t} else {\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"\";\n\t\t\t}\n $1(\"total_overseas_tax_real\").className = '';\n m_rpt_overseas_tax.ItemTemplate = RPT_OVERSEAS_TAX_ITEM_TEMPLATE;\n m_rpt_overseas_tax.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['is_overseas'] == true) {\n\t\t\t\t\tif(formatFloat(dataItem['overseas_tax']) == 0){\n\t\t\t\t\t\tdataItem['default_class'] = \"default\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['free_overseas_tax']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdataItem['default_class'] = \"\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['overseas_tax']);\n\t\t\t\t\t}\n }\n else {\n dataItem['overseas_tax_display'] = 'hide';\n }\n }\n m_rpt_overseas_tax.DataBind();\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$(\"#oversea_icon_free\").show();\n\t\t\t} else {\n\t\t\t\t$(\"#oversea_icon_free\").hide();\n\t\t\t}\n\t\t\tif(order_count == 1){\n\t\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t\t}\n }\n if (m_data_source['promo_discount_amount'] > 0) {\n $1(\"total_promo_amount_real\").className = '';\n if (m_data_source['collection_deduct_info']!=undefined && m_data_source['collection_deduct_info'].length > 0) {\n $1(\"rep_collection_promotion\").className = '';\n m_rep_collection_promotion.ItemTemplate = RPT_PROMOTION_ITEM_TEMPLATE;\n m_rep_collection_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_direct_discount_amount'] > 0) {\n dataItem['order_direct_discount_amount'] = formatFloat(dataItem['order_direct_discount_amount']);\n }\n else {\n dataItem['order_direct_discount_amount'] = 'hide';\n }\n dataItem['collection_promotion_desc_tips'] = dataItem['collection_promotion_desc'];\n dataItem['collection_promotion_desc'] = nTruncate(dataItem['collection_promotion_desc'], 10);\n }\n m_rep_collection_promotion.DataBind();\n }\n\n m_rep_order_promotion.ItemTemplate = RPT_ORDER_PROMOTION_ITEM_TEMPLATE;\n m_rep_order_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n\n if (dataItem['order_prom_subtract'] > 0) {\n $s($1(\"rep_order_promotion\"));\n dataItem['order_prom_subtract'] = formatFloat(dataItem['order_prom_subtract']);\n }\n else {\n dataItem['order_promotion_display'] = 'hide';\n }\n dataItem['shop_promo_msg_tips'] = dataItem['shop_promo_msg'];\n dataItem['shop_promo_msg'] = nTruncate(dataItem['shop_promo_msg'], 10);\n }\n m_rep_order_promotion.DataBind();\n }\n \n //if(+m_data_source[\"coupon_and_giftcard_money_used\"]>0){ \n \t //礼品卡显示\n $1(\"total_giftcard_real\").className = 'hide';\n if(+m_data_source[\"gift_card_money_used\"]>0){ \t \n \t$1(\"total_giftcard_real\").className = '';\n m_rpt_dangdang_money.ItemTemplate = RPT_COUPON_ITEM_TEMPLATE;\n m_rpt_dangdang_money.onItemDataBind = function (dataItem) {\n if (+dataItem['cust_gift_card_used'] > 0) {\n \t dataItem['cust_gift_card_used'] = formatFloat(dataItem['cust_gift_card_used']);\n }\n else {\n dataItem['coupon_amount_display'] = 'hide';\n }\n };\n m_rpt_dangdang_money.DataBind(); \n }\n \n if (m_data_source['coupon_used'] > 0) {\n \t$1(\"total_coupon_real\").className = '';\n switch (+m_data_source['coupon_type']) {\n case 1:\n case 9: \n obj_coupon_money_real.className = 'p-child';\n break; \n case 4:\n $1(\"total_discount_code_real\").className = '';\n $1(\"total_coupon_real\").className = 'hide';\n break;\n default:\n break;\n }\n \n }\n \n\n\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"total_gift_package_price\");\n }\n\n if (m_data_source['gift_package_price'] == 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"greetingcard_price\");\n }\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] == 0) {\n $S(\"gift_package_price\");\n }\n\n\n if (+m_data_source['gift_card_charge'] > 0) {\n $1(\"total_gift_card_charge\").className = '';\n }\n\n if (m_data_source['cust_cash_used'] > 0) {\n $S(\"total_cust_cash_real\");\n }\n if (m_data_source['point_deduction_amount'] > 0) {\n $S(\"total_cust_point_real\");\n }\n if (!m_data_source['is_agree']) {\n $s($1('div_ck_protocol'));\n }\n if (+m_data_source['privilege_code_discount_amount'] > 0) {\n $1(\"total_privilege_code_discount_amount\").className = '';\n }\n }\n\n\n function getEvent() {\n if (document.all) {\n return window.event; //for ie\n }\n func = getEvent.caller;\n while (func != null) {\n var arg0 = func.arguments[0];\n if (arg0) {\n if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof (arg0) == \"object\" && arg0.preventDefault && arg0.stopPropagation)) {\n return arg0;\n }\n }\n func = func.caller;\n }\n return null;\n }\n\n // events\n function addEvents() {\n if (deposit_presale_type == 2) {\n $1('presale_mobile').onkeydown = function () {\n $1('presale_mobile').className = \"input-w87\";\n $h($1('order_submit_error_tips_bar'));\n var ev = getEvent();\n if (ev.keyCode >= 48 && ev.keyCode <= 57) { return; }\n if (ev.keyCode >= 96 && ev.keyCode <= 105) { return; }\n if (ev.keyCode == 8 || ev.keyCode == 46 || ev.keyCode == 37 || ev.keyCode == 39) { return; }\n return false;\n }\n }\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n $1('agree_pay_deposit').onclick = function () {\n if ($1('agree_pay_deposit').checked == true) {\n $1(\"submit\").className = ' btn btn-super-orange';\n } else {\n $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n }\n }\n }\n $1('shipping_fee_detail_link').onclick = function () {\n if (shipping_fee_expand_status) {\n $h(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-open';\n shipping_fee_expand_status = false;\n }\n else {\n $s(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-close';\n shipping_fee_expand_status = true;\n }\n }\n\t\tif(order_count == 1){\n\t\t\t$(\"#shipping_fee_detail_link\").click();\n\t\t}\n\n $1('promo_detail_link').onclick = function () {\n if (promo_expand_status) {\n $h(obj_rep_collection_promotion);\n $h(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-open';\n promo_expand_status = false;\n }\n else {\n $s(obj_rep_collection_promotion);\n $s(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-close';\n promo_expand_status = true;\n }\n }\n\n $1('giftcard_detail_link').onclick = function () {\n if (giftcard_expand_status) {\n $h(obj_rep_dangdang_money);\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-open';\n giftcard_expand_status = false;\n }\n else {\n \tvar isUseGiftcard=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.GiftCard);//if m_data_source['coupon_type'] == 1\n if (isUseGiftcard) {\n $s(obj_rep_dangdang_money);\n }\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-close';\n giftcard_expand_status = true;\n }\n }\n $1('coupon_detail_link').onclick = function () {\n if (coupon_expand_status) {\n $h(obj_coupon_money_real);\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-open';\n coupon_expand_status = false;\n }\n else {\n \tvar isUseCoupon=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.Coupon);//if m_data_source['coupon_type'] == 1\n if (isUseCoupon) {\n $s(obj_coupon_money_real);\n }\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-close';\n coupon_expand_status = true;\n }\n }\n\n\n $1('submit').onclick = function () {\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n if ($1('submit').className.indexOf(\"disabled\") > 0) {\n return;\n }\n }\n var presale_mobile = \"\";\n\t\t\tif (deposit_presale_type == 2) {\n\t\t\t\tvar reg = /^((14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0-9])|(17[0-9]))\\d{8}$/;\n\t\t\t\tpresale_mobile = $1(\"presale_mobile\").value;\n\t\t\t\tif (presale_mobile == null || !reg.test(presale_mobile)) {\n\t\t\t\t\t$s($1('order_submit_error_tips_bar'));\n\t\t\t\t\t$1('order_submit_error_tips').innerHTML = '手机号码格式错误';\n\t\t\t\t\t$1('presale_mobile').className = \"input-w87 input-red\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n //虚拟礼品卡密钥验证\n var orders = m_data_source[\"order_list\"];\n var firtKey;\n var mobileNumber;\n for (var i = 0; i < orders.length; i++) {\n if (orders[i][\"order_type\"] == 50) {\n var success = VirtualGiftCard.submitCheckVirtualKey();\n if (!success) {\n window.location.hash = \"#GiftCardUserKey\";\n return false;\n } else {\n firtKey = $1('txt_first_key').value;\n mobileNumber = $F('txt_mobile_number');\n }\n \n }\n }\n if (!m_data_source['is_agree'] && !$1('ck_protocol').checked)\n return;\n\n var s_pay_password = \"\";\n\n if (m_data_source['payment_password_enabled'] == 1 \n \t\t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']))) {\n if (!m_data_source['is_set_payment_password'] && $1('div_pay_password').style.display == \"none\") //新增 \n {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请设置支付密码';\n return;\n }\n\n s_pay_password = $F('input_pay_password');\n if (s_pay_password == null || s_pay_password == '') {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入支付密码';\n return;\n }\n var paypwdlen = getLength(s_pay_password);\n if (paypwdlen < 6 || paypwdlen > 20) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入正确的支付密码';\n return;\n }\n }\n\n var s_sign = \"\";\n\n if (m_data_source[\"is_no_safe_ip\"] == 1) {\n s_sign = $F('ipt_yzm');\n if (s_sign == null || s_sign == '' || s_sign.indexOf(\"&\") >= 0) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请填写验证码';\n return;\n }\n }\n m_order_flow_submit(s_sign, m_data_source['shop_id'], encodeURIComponent(s_pay_password), firtKey, mobileNumber, m_data_source['product_ids'], m_data_source['sk_action_id'], presale_mobile);\n return false;\n }\n\t\t\n\t\t$1('overseas_tax_detail_link').onclick = function () {\n if (overseas_tax_expand_status) {\n $h(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-open';\n overseas_tax_expand_status = false;\n }\n else {\n $s(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-close';\n overseas_tax_expand_status = true;\n }\n }\n\t\t\n\t\tif(order_count == 1){\n\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t}\n }\n}", "function IndicadorTotal () {}", "function show_services_number(ndx){\n var servicesDim = ndx.dimension(dc.pluck('type'));\n \n var numberOfServicesGroup = servicesDim.group().reduce(add_item, remove_item, initialise);\n\n function add_item(p, v) {\n p.count++;\n p.total += v.departments;\n p.average = p.total / p.count;\n return p;\n }\n\n function remove_item(p, v) {\n p.count--;\n if (p.count == 0) {\n p.total = 0;\n p.average = 0;\n } else {\n p.total -= v.departments;\n p.average = p.total / p.count;\n }\n return p;\n }\n\n function initialise() {\n return {\n count: 0,\n total: 0,\n average: 0\n };\n }\n\n dc.rowChart(\"#departments\")\n \n .margins({top: 10, left: 10, right: 10, bottom: 20})\n .valueAccessor(function (d) {\n return d.value.average;\n })\n .x(d3.scale.ordinal())\n .elasticX(true)\n .dimension(servicesDim)\n .group(numberOfServicesGroup); \n\n}", "function calculateTotal() {\r\n\t\tvar Amount =getPrice() *getPages();\r\n\t\t//display cost.\r\n\t\tvar obj =document.getElementById('totalPrice');\r\n\t\tobj.style.display='block';\r\n\t\tobj.innerHTML =\" Cost of the paper: \\t $\"+ Amount;\r\n\t}", "function totalSale(){\n\n console.log(sale.name);\n}", "function handleMouseover(e){\n\t\t\t\tlet code = e.currentTarget.getAttribute(\"data-code\"),\n\t\t\t\t\tcountryData = csvData.filter(c => c.Country_Code === code)[0],\n\t\t\t\t\tcountryName = countryData.Name,\n countryIndex = countryData[dataset];\n\t\t\t\toutput.innerHTML = countryName + \"<br /> \" + countryIndex;\n\t\t\t\tdocument.querySelectorAll(`[data-code=${code}]`).forEach(el => {\n\t\t\t\t\tel.setAttribute(\"stroke\", \"red\");\n\t\t\t\t\tel.setAttribute(\"stroke-width\", 2.75);\n\t\t\t\t});\n\t\t\t}", "function displayAccumulatedCountyData(total_male,total_female,total_population)\n{\n const total_male_area = document.querySelector(\"#total-male b\");\n const total_female_area = document.querySelector(\"#total-female b\");\n const total_population_per_county = document.querySelector(\"#total-population b\");\n total_male_area.innerHTML = total_male;\n total_female_area.innerHTML = total_female;\n total_population_per_county.innerHTML = total_population;\n}", "function addCount() {\n count++;\n $('.count').html(count);\n }", "function showIncome(n) {\n console.log(\"\\n\"+archive[n].name+\" has generated: \"+(archive[n].price*archive[n].Clients.length)+\" USD\"+\"\\n\");\n}", "function total(){\n\tvar TotalPrice=CakeSizePrice() + FlavorPrice()+ FillingPrice()+ ColorPrice() ;\n\n\t//final result\n\tdocument.getElementById(\"display\").innerHTML=\"Total Price: $\"+TotalPrice;\n}", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "function handleMouseover(d,i) {\n var placeNames = []\n for(n=0;n<adminLabelLvls.length;n++) {\n placeNames.push( toTitleCase( d.properties[adminLabelLvls[n]] ) );\n }\n var tooltipText = \"<small><span class='place-name'>\" + placeNames.join(\", \") + \"</span>\";\n var dataKey = d3.select(this).attr('data-response'); \n if(dataKey !== null) {\n d.properties.response.forEach(function(item,itemIndex){\n if(item.key == dataKey) {\n tooltipText += \" <br> Distributions: \" + commas(item.value.count) +\n \" <br> Items distributed: \" + commas(item.value.total_number);\n }\n });\n } \n tooltipText += \"</small>\";\n $('#tooltip').html(tooltipText);\n}", "function summary(){\n const phonePrice = parseFloat(document.getElementById('phn-price').innerText);\n const casePrice = parseFloat(document.getElementById('case-price').innerText);\n\n const tax = parseFloat(document.getElementById('tax-price').innerText);\n document.getElementById('sub-total').innerText = phonePrice + casePrice;\n document.getElementById('total').innerText = phonePrice + casePrice + tax;\n\n \n}", "displayResult(tip, total) {\r\n this.tipAmount.innerText = this.tipAmount.innerText.replace(/[^$].+/, tip);\r\n this.totalAmount.innerText = this.totalAmount.innerText.replace(/[^$].+/, total);\r\n }", "function calculateTotal() {\n const firstCount = getInputValue('first');\n const economyCount = getInputValue('economy');\n\n const totalPrice = firstCount * 150 + economyCount * 100;\n document.getElementById('total-price').innerText = totalPrice;\n\n const tax = totalPrice * 0.1;\n document.getElementById('tax-amount').innerText = tax;\n\n const finalTotal = totalPrice + tax;\n document.getElementById('final-total').innerText = finalTotal\n}", "function render() {\n $totalAmountOfItemCost.html( ( parseFloat( $totalAmountOfItemCost.html() ).toFixed(2) - $deletedItemTotalCost ).toFixed(2) );\n $amountOfItemsOnCart.html($amount-1);\n }", "function render_total(data){\n\t return '<a href=\"\">'+data+' pessoa(s)</a>';\n\t}", "function mouseover(d)\r\n\t\t\t{\r\n\t\t\t\t$(\"#col2\").text(\"\");\r\n\t\t\t\tcontent.append(\"div\").attr(\"id\",\"iw-container\").append(\"div\").attr(\"class\",\"iw-title\").append(\"i\").attr(\"class\",\"fa fa-info-circle\")\r\n\t\t\t\t.attr(\"style\",\"padding-right:20px;font-weight:bold;\")\r\n \t\t\t.text(\"\t\"+d.name)// + \" - 2013 appropriations: \" + d.appropriation13 + \" - Which was a \" + d.percentChange13 + \"% change of the previous year.\")\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Orders: \" + format(d.appropriation14/10))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" New Customers: \" + format((d.appropriation13)))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Product Lines: \" + format((d.appropriation12)))\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.attr(\"id\", \"annotate\")\r\n\t\t\t\t.text(d.annotation)\r\n\t\t\t\tif (d.annotation2 != null)\r\n\t\t\t\t{\r\n\t\t\t\tcontent1.append(\"br\")\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.text(d.annotation2);\r\n\t\t\t\t}\r\n\r\n \t\t\t}", "function total(){\n\tvar TotalPrice=CakeSizePrice() +FilingPrice()+ CandlePrice()+InscriptionPrice() ;\n\n\t//final result\n\tdocument.getElementById(\"display\").innerHTML=\"total price $\"+TotalPrice;\n}", "function renderSaleTotal(currency, value, sharesToSell) {\n value = [...document.getElementsByClassName(\"blink\")].find(e => {\n return e.parentElement.id === currency;\n });\n value = value.innerText;\n // calls on a function that multiplies sharesToSell by value\n let total = parseFloat(value * sharesToSell).toFixed(2);\n // renders the return of that function on the page\n document.getElementsByClassName(\"total-sale\")[0].innerHTML = `\n Sale Value: <strong>$${total}</strong>\n `;\n}", "function update_total_count_summary() {\r\n\t\t\t$('#flight_search_result').show();\r\n\t\t\tvar _visible_records = parseInt($('.r-r-i:visible').length);\r\n\t\t\tvar _total_records = $('.r-r-i').length;\r\n\t\t\t// alert(_total_records);\r\n\t\t\tif (isNaN(_visible_records) == true || _visible_records == 0) {\r\n\t\t\t\t_visible_records = 0;\r\n\t\t\t\t//display warning\r\n\t\t\t\t$('#flight_search_result').hide();\r\n\t\t\t\t$('#empty_flight_search_result').show();\r\n\t\t\t} else {\r\n\t\t\t\t$('#flight_search_result').show();\r\n\t\t\t\t$('#empty_flight_search_result').hide();\r\n\t\t\t}\r\n\t\t\t$('#total_records').text(_visible_records);\r\n\t\t\tif(_visible_records == 1){\r\n\t\t\t\t$('#flights_text').text('Flight');\r\n\t\t\t}\r\n\t\t\t$('.visible-row-record-count').text(_visible_records);\r\n\t\t\t$('.total-row-record-count').text(_total_records);\r\n\t\t\t\r\n\t\t}", "refreshTotalCalories() {\n UISelectors.totalCaloriesDisplay.textContent = ItemCtrl.getTotalCalories();\n }", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function display() {\n\t\tlet totFilteredRecs = ndx.groupAll().value();\n\t\tlet end = ofs + pag > totFilteredRecs ? totFilteredRecs : ofs + pag;\n\t\td3.select('#begin').text(end === 0 ? ofs : ofs + 1);\n\t\td3.select('#end').text(end);\n\t\td3.select('#last').attr('disabled', ofs - pag < 0 ? 'true' : null);\n\t\td3.select('#next').attr(\n\t\t\t'disabled',\n\t\t\tofs + pag >= totFilteredRecs ? 'true' : null\n\t\t);\n\t\td3.select('#size').text(totFilteredRecs);\n\t\tif (totFilteredRecs != ndx.size()) {\n\t\t\td3.select('#totalsize').text('(Unfiltered Total: ' + ndx.size() + ')');\n\t\t} else {\n\t\t\td3.select('#totalsize').text('');\n\t\t}\n\t}", "getCartTotal () {\n return 0;\n }", "function showCardAmount(){\n $(\"#total-cards\").html(model.getCardObjArr().length);\n }", "function showCustomerSale(customerId,product_id){\n $(\".shopInfo\").css(\"display\", \"block\");\n custModule.queryCustomerRecord(customerId,product_id,function(responseData) {\n var httpResponse = JSON.parse(responseData.response);\n if (responseData.ack == 1 && httpResponse.retcode ==200) {\n var retData = httpResponse.retbody;\n $(\"#sale_dt\").html(common.isNotnull(retData.sale_dt) ? retData.sale_dt : '-');\n $(\"#last_sale_price\").html(common.isNotnull(retData.sale_price) ?'¥'+ retData.sale_price : '-');\n $(\"#last_sale_num\").html(common.isNotnull(retData.sale_num) ? retData.sale_num + retData.unit: '-');\n if(retData.sale_price){\n $(\".product_price\").val(retData.sale_price);\n }\n } else {\n $.toast(\"本地网络连接有误\", 2000, 'error');\n }\n });\n }", "function handleMouseOverC(d, i) { // Add interactivity\n\n // Use D3 to select element, change color and size\n d3.select(this)\n .style(\"fill\", \"#FFCC00\")\n\n // .attr(\"r\", radius * 2);\n div.transition() \n .duration(150) \n .style(\"opacity\", .9); \n div .html(\"Plant: \"+ d.id + \"<br/>\" +\n \"Country: \"+ d.name + \"<br/>\" +\n \"Sub-region: \" + d.sub_region + \"<br/>\" +\n \"Number of Parts: \"+ d.mat_number+ \"<br/>\" +\n \"Total Stock value: \"+ Math.round(d.stock_value) + \"<br/>\"\n ) \n .style(\"left\", (d3.event.pageX) + \"px\") \n .style(\"top\", (d3.event.pageY - 28) + \"px\")\n .attr(\"height\", 200) //200\n .attr(\"width\", 80); //80\n \n \n // div.transition() \n // .duration(200) \n // .style(\"opacity\", .9); \n // div .html(d.id) \n // .style(\"left\", (d3.event.pageX) + \"px\") \n // .style(\"top\", (d3.event.pageY - 28) + \"px\"); \n \n }", "function renderValue() {\n dealerTotalEl.innerHTML = `<div id=\"dealer-total\">${dealerTotal}</div>`;\n playerTotalEl.innerHTML = `<div id=\"player-total\">${playerTotal}</div>`;\n potTotalEl.innerHTML = `<div id=\"player-total\">$${potTotal}</div>`;\n playerWalletEl.innerHTML = `<div id=\"player-total\">Wallet : $${wallet}</div>`;\n}", "function node_onMouseOver(e,d,i) {\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = \"$\" + d3.format(\",.2f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n createDataTip(x + d.r, y + d.r + 25,congress, d.values[0].CAND_NAME,\"Total Received: \" + total);\n}", "function addexptototal()\n {\n const expobj={};\n //read the value of inputamt\n const textamt=inputele.value;\n\n const textdesc=inputele2.value;\n \n //convert it to number\n const exp=parseInt(textamt,10);\n\n expobj.desc=textdesc;\n expobj.amt=textamt;\n expobj.moment=new Date();\n\n allexp.push(expobj);\n \n \n //add that value to totalvalue\n totalexp=totalexp+exp;\n \n hele.textContent=totalexp;\n\n const headingtext=`Total :: ${totalexp}`;\n hele.textContent=headingtext;\n\n renderlist(allexp);\n \n }", "function incrementCount(){\n\tcount++;\n\tnumber = number + parseInt(z); //convert z from string to integer \n\t//document.getElementById(\"demo3\").innerHTML = \"Number of items in your cart: \" + count;\n\tvar w = document.getElementById(\"cart-number\");\n\tw.innerHTML = \"(\" + number + \")\"; //paste actual item count\n\t//document.getElementById(\"cart-number\").innerHTML = \"(\" + number +\")\";\n}", "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "function calculateTotal()\n {\n\n var kPrice = keychainsQuantity() + secondkeychainsQuantity();\n \n document.getElementById('totalPrice').innerHTML =\n \"Total Price For Keychain is $\"+kPrice;\n \n }", "function showDataPointCount() {\n $('.dataPoints').html('<span class=\"bold\">' + dataPointCounter + ' p/s</span>');\n dataPointCounter = 0;\n}", "function show_number_of_staff(ndx) {\n var dim = ndx.dimension(dc.pluck('Rank'));\n\n function add_item(p, v) {\n if (v.Rank == \"Manager\") {\n p.manager_count++;\n }\n else if (v.Rank == \"MIT\") {\n p.mit_count++;\n }\n else if (v.Rank == \"Instore\") {\n p.instore_count++;\n }\n return p;\n }\n\n function remove_item(p, v) {\n if (v.Rank == \"Manager\") {\n p.manager_count--;\n }\n else if (v.Rank == \"MIT\") {\n p.mit_count--;\n }\n else if (v.Rank == \"Instore\") {\n p.instore_count--;\n }\n return p;\n }\n\n function initialise(p, v) {\n return { manager_count: 0, mit_count: 0, instore_count: 0 };\n\n }\n\n var staffCounter = ndx.groupAll().reduce(add_item, remove_item, initialise);\n\n dc.numberDisplay(\"#managerCount\")\n .formatNumber(d3.format(\".0\"))\n .valueAccessor(function(d) {\n return d.manager_count; // no .value here\n })\n .group(staffCounter);\n\n dc.numberDisplay(\"#mitCount\")\n .formatNumber(d3.format(\".0\"))\n .valueAccessor(function(d) {\n return d.mit_count; // no .value here\n })\n .group(staffCounter);\n\n dc.numberDisplay(\"#instoreCount\")\n .formatNumber(d3.format(\".0\"))\n .valueAccessor(function(d) {\n return d.instore_count; // no .value here\n })\n .group(staffCounter);\n}", "function customerInfo() {\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let customerInfoElement = document.getElementById(\"CUSTOMER_INFO\").children;\n customerInfoElement[1].innerText = currentCustomer.name;\n customerInfoElement[4].innerText = currentCustomer.age;\n customerInfoElement[7].innerText = currentCustomer.email;\n customerInfoElement[10].innerText = currentCustomer.phone;\n customerInfoElement[13].innerText = currentCustomer.address;\n customerInfoElement[16].innerText = currentCustomer.registered;\n customerInfoElement[19].innerText = currentCustomer.about;\n }", "function renderTotalQuantityAndPrice(items) {\n var totalQuantity = getTotalQuantity(items);\n\n // show bag count when quantity is positive\n if (totalQuantity > 0) {\n $bagCount.addClass('visible');\n } else {\n $bagCount.removeClass('visible');\n }\n\n $bagCount.text(totalQuantity);\n $bagTotal.text('$' + getTotalPrice(items) + '.00');\n }", "function displayTotals() {\r\n const totalPrice = SeatData.getTotalHeldPrice(seats);\r\n const heldSeatLabels = SeatData.getHeldSeats(seats).map(seat => seat.label);\r\n\r\n const priceSpan = document.querySelector(\"#selected-seat-price\");\r\n const labelSpan = document.querySelector(\"#selected-seat-labels\");\r\n\r\n priceSpan.innerText = totalPrice.toFixed(2);\r\n labelSpan.innerText = heldSeatLabels.length > 0 ? heldSeatLabels.join(\", \") : \"None\";\r\n }", "function totalSales(){\r\n let totalSalesVar =0;\r\n \r\n\r\nfor(var i = 0; i <= hSaleTotal.length-1; i++){\r\n \r\n totalSalesVar += hSaleTotal[i];\r\n console.log(totalSalesVar)\r\n\r\n}\r\n\r\ndocument.getElementById('prueba').innerHTML= `Total Sales were: ${totalSalesVar} <br>`;\r\n\r\n\r\n}", "function showTotalIncident(transport) {\n let total = data.dataModified.get(\"1960\")[transport].length;\n let years = document.getElementById(\"selectYear\").value;\n\n document.getElementById(\"showTotalIncident\").innerHTML = total;\n document.getElementById(\"percent1\").innerHTML = \"Aire = \" + data.percent(years).percentair + \" %\";\n document.getElementById(\"percent2\").innerHTML = \"Tierra = \" + data.percent(years).percentland + \" %\";\n document.getElementById(\"percent3\").innerHTML = \"Agua = \" + data.percent(years).percentWater + \" %\";\n\n}", "function showDetail(event, key, amount, count, percent) {\n\n // show tooltip with information from the __data__ property of the element\n var x_hover = 0;\n var y_hover = 0;\n\n var content = \"<b>\" + key + \"</b><br/>\";\n\n if (amount != null) content += \"<b>Amount: </b>\" + amount + \"<br/>\";\n if (count != null) content += \"<b>Count: </b>\" + count + \"<br/>\";\n if (percent != null) content += \"<b>Percent: </b>\" + percent + \"<br/>\";\n\n var tooltipWidth = parseInt(tooltip.style('width'));\n var tooltipHeight = parseInt(tooltip.style('height'));\n var classed,notClassed;\n \n if (event.pageX > document.body.clientWidth / 2) {\n x_hover = tooltipWidth + 30;\n classed = 'right';\n notClassed = 'left';\n } else {\n x_hover = -30;\n classed = 'left';\n notClassed = 'right';\n }\n \n // y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight + 4) : event.pageY - tooltipHeight / 2;\n y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight - 40) : event.pageY - tooltipHeight - 40;\n\n return tooltip\n .classed(classed,true)\n .classed(notClassed,false)\n .style({\n \"visibility\": \"visible\",\n \"top\": y_hover + \"px\",\n \"left\": (event.pageX - x_hover) + \"px\"\n })\n .html(content);\n}", "function mouseOnC(CityName, info){\n $(tooltip).html(CityName + ' ' +info);\n $(tooltip).css('background', '#ddd');\n}", "function updateCounts(){\r\n let filterData = ndx.allFiltered();\r\n let filterNoOfCases = 0 ;\r\n let filterNoOfDeaths = 0;\r\n filterData.forEach(function(d){ filterNoOfCases +=d.new_cases; });\r\n filterData.forEach(function(d){ filterNoOfDeaths +=d.new_deaths; });\r\n $(\"#filterCases\").html(readNumberFormat(filterNoOfCases));\r\n $(\"#filterDeaths\").html(readNumberFormat(filterNoOfDeaths));\r\n}", "function RepoCount(data){\n\t// alert(data.total_count);\n\treturn data.total_count\n}", "function amountCovered(claim){\n\tvar paidOutPerClient = '';\n\tvar percent = percentageCovered(claim);\n\t//Amount paid out rounded to the nearest dollar amount.\n\tvar amount = Math.round(claim.visitCost * (percent / 100));\n\t//Add to the total money paid out. Logged at the end.\n\ttotalPayedOut += amount;\n\tpaidOutPerClient += ('Paid out $<mark>' + amount + '</mark> for ' + claim.patientName);\n\t//Add new ol item for each client's details\n\t$('table').append('<tr><td>' + paidOutPerClient + '</td></tr>');\n\tconsole.log('Paid out $' + amount + ' for ' + claim.patientName);\n}", "function onMouseoverChart(e) {\n if (e['target'] === 'node') {\n var nodeSplit = e['targetid'].split('-');\n var nodeId = nodeSplit[nodeSplit.length - 1];\n if (Number.isInteger(parseInt(nodeId)) && parseInt(nodeId) < globalEnergyData['values'].length) {\n renderPieChart(parseInt(nodeId));\n }\n } \n }", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function show_Results() {\n var total = vOne + vTwo;\n console.log('FInished. Total = ' + total);\n\n var seeTotal = document.getElementById('total');\n seeTotal.innerHTML = total;\n seeTotal.style.fontSize = '5vh';\n seeTotal.style.margin = '7.5vh';\n\n rolls++;\n}", "function showLostSaleCount(lostCount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostCountLabel = document.createElement(\"DIV\");\n lostCountLabel.className = \"wonLostLabel\";\n lostCountLabel.appendChild(document.createTextNode(lostCount));\n $('#lostOpp').append(lostCountLabel);\n}", "function getTotal() {\n const firstClassCount = getInputValue('firstClass');\n const economyCount = getInputValue('economy');\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('subTotalAmount').innerText = subTotal;\n\n const vat = subTotal * 0.1;\n const total = subTotal + vat;\n document.getElementById('vatAmount').innerText = vat;\n document.getElementById('totalAmount').innerText = total;\n}", "function total(event) {\n console.log(event.target);\n let changedIndex = products.indexOf(event.target.name);\n let ourtarget = document.getElementById(event.target.name);\n let value = itemNo.value * products[i].price;\n console.log(value);\n ourtarget.textContent = value + ' JOD';\n products[i].total = value;\n products[i].purshaceNo = itemNo.value;\n console.log('The total quantity', products[i].purshaceNo);\n megaTotal = megaSum();\n all.innerHTML = `Total: ${megaTotal} JOD`;\n }", "function calculateTotal() {\n const firstClassCount = getInputValue('first-class');\n const economyCount = getInputValue('economy');\n\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('sub-total').innerText = '$' + subTotal;\n\n const vat = subTotal * 0.1;\n document.getElementById('vat').innerText = '$' + vat;\n\n const total = subTotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "function updateTotal() {\n\n}", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "getSellerTotal() {\n\t\treturn (this.props.listing.transactionTotal - this.props.listing.chargesTotal);\n\t}", "function elementMouseOverClosure() {\n\tvar elementMouseOver = function(d, i) {\n\t\tif (d.data.datum.state == global.activeStateFilter \n\t\t\t\t|| global.activeStateFilter == 'None') {\n\t\t\tvar senator = d.data;\n\t\t\thighlightSenator(senator);\n\n\t\t\tif(senator.datum.state != global.activeStateFilter){\n\t\t\t\thighlightState(\"#\" + senator.datum.state + \"_state\");\n\t\t\t}\n\t\t\t//fill in the information bar at the side\n\t\t\tvar sideBarTop = d3.select('#sideBar1')\n\t\t\t\t.attr('class','simpleBorder infoBox')\n\t\t\t\t.attr(\"align\", \"center\");\n\t\t\tdocument.getElementById('sideBar1').innerHTML = \n\t\t\t\t'<h3>' + d.data.name + '</h3><h3>' +\n\t\t\t\td.data.datum.state + '</h3><h3>' +\n\t\t\t\td.data.id + '</h3><br/>Total Debates:' +\n\t\t\t\td.data.debateIDs.length;\n\n\t\t\t//Highlight all tickmarks on currently active debates\n\t\t\tfor(var j = 0; j < senator.activeDebateTicks.length; j++){\n\t\t\t\td3.select(senator.activeDebateTicks[j]).transition()\n\t\t\t\t\t.style('stroke-width', 2)\n\t\t\t\t\t.attr('r', function(d){\n\t\t\t\t\t\td3.select('#debateSvg' + d.debateSvgNdx).transition()\n\t\t\t\t\t\t\t.style('border-color', d.strokeC);\n\t\t\t\t\t\treturn 3;});\n\t\t\t}\n\t\t}\n\t};\n\treturn elementMouseOver;\n}", "function MemberReview(){\n $('.progress-rv').each(function (index,value){\n var datavalue=$(this).attr('data-value'),\n point=datavalue*10;\n $(this).append(\"<div style='width:\"+point+\"%'><span>\"+datavalue+\"</span></div>\")\n })\n }", "function updateSelectedCount(){\n const selectedSeats=document.querySelectorAll('.row .seat.selected');\n const selectedSeatscount=selectedSeats.length;\n count.innerText=selectedSeatscount;\n total.innerText=selectedSeatscount*ticketPrice;\n\n }", "function populateCounters() {\r\n circulating = minted - burned;\r\n $(\"#minted\").html(thousands_separators(minted));\r\n $(\"#transactions\").html(thousands_separators(transactions));\r\n $(\"#holders\").html(thousands_separators(holders));\r\n $(\"#burned\").html(thousands_separators(burned));\r\n $(\"#circulating\").html(thousands_separators(circulating.toFixed(2)));\r\n }", "getTotalMenuPrice() {\n return this.menu.reduce((a,b) => a+b.pricePerServing, \" \") * this.getNumberOfGuests();\n }", "function totals_row_maker(datasets) {\n var total_cost = $scope.total_order_cost;\n var total_quant = 0;\n var total_scrap = $scope.total_order_scrap + '\\\"';\n for (var prop in datasets) {\n total_quant += datasets[prop][1];\n }\n $('#summary').append('<tfoot class=\"totals-row\"><tr><th class=\"total-cell\">Totals:</th><td class=\"total-cell\">' + total_quant + '</td><td class=\"total-cell\">' + total_cost + '</td><td class=\"total-cell\">' + total_scrap + '</td></tr></tfoot>');\n }", "function updateCountAndTotal() {\n selectedSeats = document.querySelectorAll('.row .selected');\n const selectedSeatsAmount = selectedSeats.length;\n\n count.innerText = selectedSeatsAmount;\n total.innerText = selectedSeatsAmount * ticketPrice;\n}", "function treeCuttingTotal() {\nvar total_number_tree = {\nonStatisticField: \"CommonName\",\noutStatisticFieldName: \"total_number_tree\",\nstatisticType: \"count\"\n};\n\nvar query = treeLayer.createQuery();\nquery.outStatistics = [total_number_tree];\n\nreturn treeLayer.queryFeatures(query).then(function(response) {\nvar stats = response.features[0].attributes;\nconst totalNumber = stats.total_number_tree;\n//const LOT_HANDOVER_PERC = (handedOver/affected)*100;\nreturn totalNumber;\n});\n}", "function updateTotals(index) {\nif (!isNaN(index)) {\nvar di = covid_cc_total_timeline[index];\nvar date = new Date(di.date);\ncurrentDate = date;\n\nupdateCountryName();\n\nvar position = dateAxis.dateToPosition(date);\nposition = dateAxis.toGlobalPosition(position);\nvar x = dateAxis.positionToCoordinate(position);\n\nif (lineChart.cursor) {\nlineChart.cursor.triggerMove({ x: x, y: 0 }, \"soft\", true);\n}\nfor (var key in buttons) {\nvar count = Number(lineChart.data[index][key])\nif (!isNaN(count)) {\nbuttons[key].label.text = capitalizeFirstLetter(key) + \": \" + numberFormatter.format(count, '#,###');\n}\n}\ncurrentIndex = index;\n}\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function displayTotal(total) {\n document.querySelector(\"#count-total\").textContent += total / 100;\n}", "function calculateTotal() {\n let tipPerPerson = (billObj._billAmount * billObj._tipAmount) / billObj._numOfPeople;\n let billPerPerson = billObj._billAmount / billObj._numOfPeople;\n let totalAmount = tipPerPerson + billPerPerson;\n if (isNaN(tipPerPerson) && isNaN(billPerPerson)) {\n return;\n }\n else {\n //This should output to DOM;\n document.querySelector(\".display_tip_value\").innerHTML = tipPerPerson.toFixed(2).toString();\n document.querySelector(\".display_total_value\").innerHTML = totalAmount.toFixed(2).toString();\n }\n ;\n}", "total () {\n\t\treturn this.subtotal() - this.discounts();\n\t}", "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "function totalTicketAmount(){\n const subTotalAmount = TicketName('firstClass') * 150 + TicketName('economy') * 100;\n document.getElementById('subtotal').innerText ='$' + subTotalAmount;\n const totalTaxAmount = Math.round(subTotalAmount * 0.1);\n document.getElementById('tax-amount').innerText ='$' + totalTaxAmount;\n const totalBookingCost = subTotalAmount + totalTaxAmount;\n document.getElementById('total-cost').innerText ='$' + totalBookingCost;\n}", "function feedTotalHitCount(totalHitCount){\r\n var totalHitCountSelector = document.getElementById(\"total-hit-count\");\r\n totalHitCountSelector.innerHTML = totalHitCount;\r\n $(\"#total-hit-spinner\").hide();\r\n }", "function cartCheckoutButton() {\r\n // Get Checkout button; Get total checkout amount\r\n var checkoutBtn = document.querySelector(\"#cart-checkout\");\r\n var total = checkoutBtn.querySelector('#total')\r\n var valid = checkoutBtn.querySelector('#checkoutValid')\r\n var invalid = checkoutBtn.querySelector('#checkoutInvalid')\r\n\r\n // Show cart totals when hovering\r\n checkoutBtn.addEventListener(\"mouseenter\", function () {\r\n var cartItems = document.querySelectorAll('.cart-item');\r\n total.style.display = 'none'\r\n if (cartItems.length == 0) {\r\n invalid.style.display = 'inline-block';\r\n } else if (cartItems.length > 0) {\r\n valid.style.display = 'inline-block'\r\n }\r\n })\r\n\r\n // Show 'Checkout' text when not hovering\r\n checkoutBtn.addEventListener(\"mouseleave\", function () {\r\n invalid.style.display = 'none'\r\n valid.style.display = 'none'\r\n total.style.display = 'inline-block'\r\n })\r\n}", "function caclulateWealth(){\r\n\tconst wealth = data.reduce( (acc, person) => (acc += person.money), 0);\r\n\tconst wealthEl = document.createElement('div');\r\n\twealthEl.innerHTML = `<h3>Total Wealth: <strong>${formatMoney(wealth)}</strong></h3>`;\r\n\tmain.appendChild(wealthEl);\r\n\tconsole.log();\r\n}", "function link_onMouseOver(e,d,i) {\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = \"$\" + d3.format(\",.0f\")(viz.value()(d.data));\n var date = d.data.Month + \"/\" + d.data.Day + \"/\" + d.data.Year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Received: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function getFinalSumResult() {\r\n $(document).ready(function () {\r\n $(\"#paymentSum\").mouseout(function () {\r\n if (flag) {\r\n let nds = $(\"#ndcInputFiled\").val();\r\n let finalResult = result * (1 + (+nds / 100));\r\n $(\"#resultSum\").val(parseFloat(finalResult).toFixed(2));\r\n } else {\r\n $(\"#resultSum\").val(\"\");\r\n }\r\n });\r\n });\r\n}", "function mouseover(d) {\n var shiftX = 10;\n var shiftY = 20;\n\n var mouseCoords = d3.mouse(this);\n d3.select(\"#tooltip\")\n .style(\"left\", function(d) {\n return mouseCoords[0] + shiftX + \"px\"\n })\n .style(\"top\", function(d) {\n return mouseCoords[1] + shiftY + \"px\"\n })\n .html(function() {\n if (d.energy[1990] == null || d.energy[currentYear][\"All products\"] == 0) return d.name + \": No data\";\n\n var all = d.energy[currentYear][\"All products\"];\n var renewable = d.energy[currentYear][\"Renewable energies\"];\n var per = renewable / all;\n\n hoverArrow(per);\n\n return \"<b>\" + d.name + \"</b><br/>\" + fmtPer(per) + \" renewables\"\n })\n .classed(\"hidden\", false);\n}", "function updatePopperDisplay (name, count, cost, display, countDisplay, costDisplay, sellDisplay) {\n\tcountDisplay.innerHTML = name + \": \" + count;\n\tcostDisplay.innerHTML = \"Cost: \" + commas(cost);\n\tif (Game.popcorn - cost >= 0) {\n\t\tdisplay.style.backgroundColor = \"blue\";\n\t\tdisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tdisplay.style.backgroundColor = \"#000066\";\n\t\tdisplay.style.cursor = \"default\";\n\t}\n\tif (count > 0) {\n\t\tsellDisplay.style.backgroundColor = \"red\";\n\t\tsellDisplay.style.color = \"white\";\n\t\tsellDisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tsellDisplay.style.backgroundColor = \"#990000\";\n\t\tsellDisplay.style.color = \"#999999\";\n\t\tsellDisplay.style.cursor = \"default\";\n\t}\n}" ]
[ "0.65691406", "0.5912847", "0.5752698", "0.57207483", "0.5499622", "0.5450888", "0.5372179", "0.5365616", "0.5365435", "0.53644097", "0.53138584", "0.53135705", "0.53110814", "0.5297435", "0.5279137", "0.5278823", "0.5276103", "0.5268961", "0.52617824", "0.5257476", "0.5238532", "0.5225468", "0.5204101", "0.52024585", "0.5202104", "0.51776844", "0.5172714", "0.5161271", "0.5157144", "0.51567924", "0.51364166", "0.51344174", "0.5118736", "0.5112573", "0.5112252", "0.51013345", "0.51010704", "0.50986207", "0.5097001", "0.50873554", "0.50744236", "0.5068086", "0.5057058", "0.5049677", "0.5039082", "0.5026411", "0.5021066", "0.5019077", "0.50141484", "0.50120926", "0.5007838", "0.49990693", "0.49869043", "0.49863315", "0.49851173", "0.4976387", "0.4974234", "0.49740052", "0.49701458", "0.49698406", "0.49672732", "0.49563202", "0.49535167", "0.49518394", "0.49508667", "0.4948675", "0.4946133", "0.4942884", "0.49396792", "0.49364576", "0.4935075", "0.49218878", "0.49218565", "0.49194744", "0.4918099", "0.4916473", "0.4910801", "0.4908163", "0.49070916", "0.49070892", "0.4906821", "0.4906262", "0.4906101", "0.49006882", "0.48961908", "0.4887942", "0.48851562", "0.48803464", "0.48704278", "0.48704162", "0.48684034", "0.48681262", "0.48680633", "0.48656082", "0.48630086", "0.48628873", "0.4861227", "0.4861029", "0.48606122", "0.48586732" ]
0.59686136
1
This function shows lost opportunity count and total deal amount in graph on mouseover
function showLostAmount(lostAmount) { var getdiv = document.getElementById("lostOpp"); getdiv.innerText = ""; var lostAmtLabel = document.createElement("DIV"); lostAmtLabel.className = "wonLostLabel"; lostAmtLabel.appendChild(document.createTextNode("$" + lostAmount.toLocaleString())); $('#lostOpp').append(lostAmtLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElement(\"DIV\");\n wonCountLabel.className = \"wonLostLabel\";\n wonCountLabel.appendChild(document.createTextNode(saleCount));\n $('#wonOpp').append(wonCountLabel); \n}", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function onMouseoverChart(e) {\n if (e['target'] === 'node') {\n var nodeSplit = e['targetid'].split('-');\n var nodeId = nodeSplit[nodeSplit.length - 1];\n if (Number.isInteger(parseInt(nodeId)) && parseInt(nodeId) < globalEnergyData['values'].length) {\n renderPieChart(parseInt(nodeId));\n }\n } \n }", "function showOppAmount(oppAmount) {\n var getdiv = document.getElementById(\"hoverOpp\");\n getdiv.innerText = \"\";\n var oppAmtLabel = document.createElement(\"DIV\");\n oppAmtLabel.className = \"chartBarLabel\";\n oppAmtLabel.appendChild(document.createTextNode(\"$\" + oppAmount.toLocaleString()));\n $('#hoverOpp').append(oppAmtLabel);\n}", "showTotals() {\n //const infectious2 = this.chart.chart.data.datasets[0].data\n const infectious1 = this.chart.chart.data.datasets[1].data\n const infectious1Val = infectious1[infectious1.length-1]\n\n const susceptible = this.chart.chart.data.datasets[2].data\n const susceptibleVal = susceptible[susceptible.length-1]\n const nSusceptible = susceptibleVal-infectious1Val\n\n const vaccinated = this.chart.chart.data.datasets[3].data\n const vaccinatedVal = vaccinated[vaccinated.length-1]\n const nVaccinated = vaccinatedVal-susceptibleVal\n\n const removed = this.chart.chart.data.datasets[4].data\n const removedVal = removed[removed.length-1]\n const nRemoved = removedVal-vaccinatedVal\n\n const dead = this.chart.chart.data.datasets[5].data\n const deadVal = dead[dead.length-1]\n const nDead = deadVal-removedVal\n\n let hospitalDeaths = 0\n this.sender.q1.pts.forEach(pt => hospitalDeaths += pt.status==Point.DEAD ? 1 : 0)\n\n const yDiff = TEXT_SIZE_TOTALS+15\n\n strokeWeight(0)\n stroke(0)\n fill(\"#000000dd\")\n rect(RECT_X_TOTALS, RECT_Y_TOTALS, RECT_W_TOTALS, RECT_H_TOTALS, RECT_RADIUS_TOTALS)\n textSize(TEXT_SIZE_TOTALS)\n textAlign(LEFT, TOP)\n fill(COLOR_LIGHT_GRAY)\n text(`Simulation Complete!`, TEXT_X_TOTALS+80, TEXT_Y_TOTALS)\n text(`Total Unaffected: ${nSusceptible+nVaccinated}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff)\n text(`Total Infected: ${dead[dead.length-1]-nSusceptible-nVaccinated}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*2)\n text(`Total Recovered: ${nRemoved}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*3)\n text(`Total Dead: ${nDead}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*4)\n text(`Deaths due hospital overcrowding: ${hospitalDeaths}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*5)\n this.drawResetArrow()\n }", "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "function mouseout(d) {\n // update frecuency in bar \n leg.update(tF);\n\n } //final de mouse Out", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "function showLeadAmount(leadAmount) {\n var getdiv = document.getElementById(\"hoverLead\");\n getdiv.innerText = \"\";\n var leadAmtLabel = document.createElement(\"DIV\");\n leadAmtLabel.className = \"chartBarLabel\";\n leadAmtLabel.appendChild(document.createTextNode(\"$\" + leadAmount.toLocaleString()));\n $('#hoverLead').append(leadAmtLabel);\n}", "function showLostSaleCount(lostCount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostCountLabel = document.createElement(\"DIV\");\n lostCountLabel.className = \"wonLostLabel\";\n lostCountLabel.appendChild(document.createTextNode(lostCount));\n $('#lostOpp').append(lostCountLabel);\n}", "function updateTally(outcome) {\n totalPoints += parseInt(outcome);\n \n // Draw tally using HTML\n tally = display_element.querySelector(\".tally\");\n tally.innerHTML = `Total Points: ${totalPoints}`\n \n }", "function handleMouseOverPie() {\n // remove old mouse event elements\n svg.selectAll(\".percentage\").remove();\n\n // get margins from container\n var margins = getMargins(\".containerGraph3\")\n\n // select this item\n d3.select(this)\n .attr(\"stroke\", \"white\")\n .style(\"stroke-width\", \"3px\")\n .style(\"stroke-opacity\", 0.6)\n\n // append text to the side of the pie with the percentages\n svg.append(\"text\")\n .attr(\"class\", \"percentage\")\n .text(\"Geslaagd: \" + percentagePassed + \"%\")\n .attr(\"x\", margins.width / 5)\n .attr(\"y\", -margins.height / 2.3)\n .attr(\"font-size\", 24)\n .attr(\"font-family\", \"Arial\")\n .attr(\"fill\", \"white\")\n .transition().duration(200)\n .attr(\"opacity\", 0.9)\n\n // append text\n svg.append(\"text\")\n .attr(\"class\", \"percentage\")\n .text(\"Gezakt: \" + percentageFailed + \"%\")\n .attr(\"x\", margins.width / 5)\n .attr(\"y\", -margins.height / 2.3+ 30)\n .attr(\"font-size\", 24)\n .attr(\"font-family\", \"Arial\")\n .attr(\"fill\", \"white\")\n .transition().duration(200)\n .attr(\"opacity\", 0.9)\n }", "function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.Designation,v.total];}), barColor);\n }", "function details_on_demand(d) {\n\t\n\tvar sp_dot = document.getElementById(\"sp\"+d.Team);\n\tvar tm_node = document.getElementById(\"tm\"+d.Team);\n\t\n\t// Save old state of dot\n\told_dot = sp_dot.getAttribute(\"r\");\n\told_opacity = sp_dot.getAttribute(\"opacity\");\n\t\n\t// Make team's dot bigger \n\tsp_dot.setAttribute(\"r\", big_dot); \n\t// Make team's node \"brighter\"\n\ttm_node.style.opacity = \".7\";\n\t\n\t\n\tteams.forEach(function(team) {\n\t\tdocument.getElementById(\"sp\"+team).setAttribute(\"opacity\", .1);\n\t});\n\tsp_dot.setAttribute(\"opacity\", 1);\n\t\n\ttooltip.transition()\n\t .duration(100)\n\t .style(\"opacity\", .85)\n\t .style(\"background\", \"#0b0b0d\")\n\t .style(\"border\", \"2px solid black\")\n\t .style(\"color\", \"#FFFFFF\")\n\t .style(\"max-width\", \"auto\")\n\t .style(\"height\", \"auto\");\n\t \n\t \n\ttooltip.html(\n\t \"<img src='\" + logos[d.Team] + \"' width='50' height='50' style='float: left; padding-right: 10px; vertical-align: middle'>\" +\n\t\t \"<b>\" + d[\"Team\"] + \"<b><br/><br/>\\t Salary: <b>\" + curr_fmt(xValue(d)*1000000) + \"</b><br/>\\t Wins: <b>\" + yValue(d) + \n\t\t \"</b>; Losses: <b>\" + d[season+\"Loss\"] + \"</b>\")\n\t .style(\"left\", d[\"Team\"] ? (d3.event.x + document.body.scrollLeft - 90) + \"px\": null)\n\t .style(\"top\", d[\"Team\"] ? (d3.event.y + document.body.scrollTop - 70) + \"px\": null)\n\t .style(\"padding\", \"5px\")\n\t .style(\"padding-left\", \"10px\")\n\t .style(\"font-size\", \"11px\");\n}", "function node_onMouseOver(e,d,i) {\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = \"$\" + d3.format(\",.2f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n createDataTip(x + d.r, y + d.r + 25,congress, d.values[0].CAND_NAME,\"Total Received: \" + total);\n}", "function arc_onMouseOver(e,d,i) {\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n links.each(function (d) {\n total+= viz.value()(d.data);\n });\n\n total = \"$\" + d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"POLITICAL ACTION COMMITTEE\", d.data.values[0].CMTE_NM,\"Total Donated: \" + total);\n}", "function mouseout(d){\n \n// call an update in the bar chart refering to the dataset and return the previous data and color\n bC.update(myData.map(function(v){\n return [v.year,v.total];}), \"#8DD4F4\");\n }", "function mouseover(d) {\n\t\tchart.append(\"text\")\n\t\t\t.attr(\"id\", \"interactivity\")\n\t\t\t.attr(\"y\", y(d.value) - 15)\n\t\t\t.attr(\"x\", x(d.year) + 23)\n\t\t\t.style(\"text-anchor\", \"start\")\n\t\t\t.style(\"font\", \"10px sans-serif\")\n\t\t\t.text(d.value);\n\n\t\td3.select(this)\n\t\t\t.style(\"fill\", \"darkblue\");\n\t}", "function handle_mouseout(d, $this) {\n $(\".country-wage-group\").attr(\"opacity\", 1);\n d3.select(\"#wageGapTooltip\").style(\"visibility\", \"hidden\");\n }", "function node_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n var strSyntax = d.values[0].PTY == 'positive' ? 'Sentiment index: +' : 'Sentiment index: -'\n\n createDataTip(x + d.r, y + d.r + 25, d.values[0].CAND_ID, d.values[0].CAND_NAME, strSyntax + total);\n}", "function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.Month,v.total];}), barColor);\n }", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function handleMouseover(d,i) {\n var placeNames = []\n for(n=0;n<adminLabelLvls.length;n++) {\n placeNames.push( toTitleCase( d.properties[adminLabelLvls[n]] ) );\n }\n var tooltipText = \"<small><span class='place-name'>\" + placeNames.join(\", \") + \"</span>\";\n var dataKey = d3.select(this).attr('data-response'); \n if(dataKey !== null) {\n d.properties.response.forEach(function(item,itemIndex){\n if(item.key == dataKey) {\n tooltipText += \" <br> Distributions: \" + commas(item.value.count) +\n \" <br> Items distributed: \" + commas(item.value.total_number);\n }\n });\n } \n tooltipText += \"</small>\";\n $('#tooltip').html(tooltipText);\n}", "function showOppCount(oppCount) { \n var getDiv = document.getElementById(\"hoverOpp\");\n getDiv.innerText = oppCount; \n}", "function showLosses() {\n losses++;\n $(\"#losses\").text(losses);\n}", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function link_onMouseOver(e,d,i) {\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = \"$\" + d3.format(\",.0f\")(viz.value()(d.data));\n var date = d.data.Month + \"/\" + d.data.Day + \"/\" + d.data.Year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Received: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "function mouseover(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){\n return [v.Month,v.freq[d.data.type]];}),segColor(d.data.type));\n }", "function handleMouseover(d) {\n div.style(\"opacity\", 0.9)\n .style(\"left\", (d3.event.pageX + padding/2) + \"px\")\n .style(\"top\", d3.event.pageY + \"px\")\n .html(\"<p>\" + d.Name + \",&nbsp;\" + d.Nationality + \"</p><p>Year:\" + d.Year + \"&nbsp;&nbsp;&nbsp;Time:\" + timeFormat(d.Time) + \"&nbsp;&nbsp;&nbsp;Place:\" + d.Place + \"</p>\" + (d.Doping ? (\"<br><p>\" + d.Doping +\"</p\") : \"\"));\n}", "function mouseover(d){ \n var selectedYear = myData.filter(function(s){ \n return s.year == d[0]\n ;})[0];\n var yearSentiment = d3\n .keys(selectedYear.sentiment)\n .map(function(s){ \n return {type:s, sentiment:selectedYear.sentiment[s]};\n });\n \n// call the functions that update the pie chart and legend, to connect this to the mouseover of bar chart\n// refer to the yearSentiment, becaue this new variable tells what data is selected \n pC.update(yearSentiment);\n leg.update(yearSentiment);\n }", "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function (v) {\n return [v.month, v.total];\n }), barColor);\n }", "function infoTurnover() {\n var title = 'Turnover Rate';\n var msg = 'This measure refers to the average quantity sold per day over the last 30 days. ' +\n 'This helps to show the number of days worth of inventory is on hand.';\n app.showMessage(msg, title, ['Ok']);\n }", "handleMouseOver (vis, event, d) {\n // console.log(\"hover over\", d);\n let leftPosition = event.pageX + 10 + \"px\";\n if (window.innerWidth - event.pageX < 500) {\n leftPosition = event.pageX - 300 + \"px\";\n }\n let census = vis.insights[d.count];\n let censusCount = d.count;\n let peopleCount = census ? census.total : 0;\n let censusPercent = vis.legendData.find(c => c.censusCount == d.count);\n censusPercent = censusPercent? censusPercent.censusPercent : 0;\n if ((d.count === 0 && vis.filters.length === 0) || !census) {\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n </div>`\n );\n } else if (d.count === 0) {\n let tipText = `<div>${peopleCount.toLocaleString(\"en\")} people with filter attribute</div> `;\n vis.filters.forEach(f => {\n tipText += `<div>${v2CheckBoxGuide[f].title}.</div> `;\n })\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n ${tipText}\n </div>`\n );\n } else {\n // They show up in a census\n let topPob = d3.greatest(census.pobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topAgeGroup = d3.greatest(census.ageMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCensus = d3.greatest(census.censusMap, (a, b) => d3.ascending(a[1], b[1]));\n let topGender = d3.greatest(census.genderMap, (a, b) => d3.ascending(a[1], b[1]));\n let topColor = d3.greatest(census.colorMap, (a, b) => d3.ascending(a[1], b[1]));\n let topJob = d3.greatest(census.jobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCounty = d3.greatest(census.countyMap, (a, b) => d3.ascending(a[1], b[1]));\n // console.log(topPob,topAgeGroup, topCensus );\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census</h5>\n <div> The ${peopleCount.toLocaleString(\"en\")} people in ${censusCount} census are most likely</div>\n <div> to be born in ${topPob[0]} living in ${upperCaseFirstLetters(topCounty[0])}, Nevada. </div> \n <div> Their first census was at age ${topAgeGroup[0]} in year ${topCensus[0]}. </div> \n <div> Gender \"${topGender[0]}\", \"color ${topColor[0]}\",\n and job \"${upperCaseFirstLetters(topJob[0])}\".</div> \n </div>`\n );\n }\n }", "function mouseover() {\n //convert the slider value to the correct index of time in mapData\n spot = d3.select(this);\n if (!spot.classed('hidden-spot')) {\n index = rangeslider.value - 5\n let occupant = mapData[spot.attr(\"id\")][index];\n tooltip\n .html(mapData[spot.attr(\"id\")][0] + ': ' + (occupant === \"\" ? \"Unoccupied\" : occupant))\n .style(\"opacity\", 1);\n }\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function mouseover(d){\n // call the update function of histogram with new data.\n hGW.update(fData.map(function(v){ \n return [v.State,v.freq[d.data.type]];}),segColor(d.data.type));\n hGR.update(fData.map(function(v){ \n return [v.State,v.rate[d.data.type]];}),segColor(d.data.type));\n hGC.update(fData.map(function(v){ \n return [v.State,v.count[d.data.type]];}),segColor(d.data.type));\n }", "function cost_over_time(ndx) {\n var cost_over_time_dim = ndx.dimension(dc.pluck(\"PaymentDate\"));\n var cost_over_time_group = cost_over_time_dim.group().reduceSum(dc.pluck('Sum'));\n\n var minDate = cost_over_time_dim.bottom(1)[0].PaymentDate;\n var maxDate = cost_over_time_dim.top(1)[0].PaymentDate;\n\n dc.lineChart('.Cost-Over-Time')\n .width(1000)\n .height(500)\n .useViewBoxResizing(true)\n .margins({top: 10, right: 150, bottom: 55, left: 150})\n .dimension(cost_over_time_dim)\n .elasticY(true)\n .group(cost_over_time_group)\n .transitionDuration(500)\n .x(d3.time.scale().domain([minDate,maxDate]))\n .yAxis().ticks(15);\n}", "function mousemovepayoff() {\n // Get the number and the index of that number\n var mouseNum = x3.invert(d3.mouse(this)[0]),\n i2 = Math.round(mouseNum+30-thisPrice[k]);\n\n // Only show tooltip if there is a line\n if (payoffData[k].length !== 0) {\n\n // Only one line, so profit doesn't get calculated\n if (payoffData[k].length === 1) {\n var d = payoffData[k][payoffData[k].length-1][i2];}\n // More lines, there is a profit variable\n else { var d = profit[i2]}\n\n // move the circle\n toolTip2.select(\"circle.y\") \n .attr(\"transform\", \n \"translate(\" + x3(d.key) + \",\" + \n y3(d.price) + \")\");\n\n // Place the profit and price above of the circle\n toolTip2.select(\"text.y2\")\n .attr(\"transform\",\n \"translate(\" + x3(d.key) + \",\" +\n y3(d.price) + \")\")\n .text(\"Profit: \"+formatCurrency(d.price)); \n\n toolTip2.select(\"text.y3\")\n .attr(\"transform\",\n \"translate(\" + x3(d.key) + \",\" +\n y3(d.price) + \")\")\n .text(\"Price: \"+formatCurrency(Math.round(d.key)));\n // No tooltip if there is no investment in the stock\n } else {toolTip2.style(\"display\", \"none\");}\n }", "function createMousoverHtml(d) {\n\n var html = \"\";\n html += \"<div class=\\\"tooltip_kv\\\">\";\n html += \"<span class=\\\"tooltip_key\\\">\";\n html += d['Item'];\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Total Accidents: \"\n try {\n html += (d[\"Total_Accidents\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: \"\n html += (d[\"Fatal\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: \"\n html += (d[\"Serious\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: \"\n html += (d[\"Minor\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: \"\n html += (d[\"Uninjured\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>VMC: \"\n html += (d[\"VMC\"]);\n html += \" IMC: \"\n html += (d[\"IMC\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Destroyed: \"\n html += (d[\"Destroyed_Damage\"]);\n html += \" Substantial: \"\n html += (d[\"Substantial_Damage\"]);\n html += \" Minor: \"\n html += (d[\"Minor_Damage\"]);\n }\n catch (error) {\n html = html.replace(\"<a>Total Accidents: \", \"\")\n html += \"<a>Total Accidents: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: 0\"\n }\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"</div>\";\n $(\"#tooltip-container-scatter\").html(html);\n $(this).attr(\"fill-opacity\", \"0.8\");\n $(\"#tooltip-container-scatter\").show();\n\n //quello commentato ha senso, ma scaja\n //var map_width = document.getElementById('scatter').getBoundingClientRect().width;\n var map_width = $('scatter')[0].getBoundingClientRect().width;\n //console.log($('scatter'))\n\n //console.log('LAYER X ' + d3.event.layerX)\n //console.log('LAYER Y ' + d3.event.layerY)\n\n if (d3.event.layerX < map_width / 2) {\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX + 15) + \"px\");\n } else {\n var tooltip_width = $(\"#tooltip-container-scatter\").width();\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX - tooltip_width - 30) + \"px\");\n }\n}", "function mouseover(p) {\n tooltip.style(\"visibility\", \"visible\");\n tooltip.html(names[p.y] + \" vs \" + names[p.x] + \" - Total Meetings: \" + (matrix[p.x][p.y].z + matrix[p.y][p.x].z) + \". <br/>\" + names[p.y] + \" has won \" + p.z + \" of them.\");\n d3.selectAll(\".row text\").classed(\"active\", function(d, i) {\n return i == p.y;\n });\n d3.selectAll(\".column text\").classed(\"active\", function(d, i) {\n return i == p.x;\n });\n }", "function handleMouseOver(d, i) {\n\nd3.selectAll(\".visualCircle\").transition()\n .duration(200)\n .style(\"opacity\", 1)\n .attr(\"fill\", \"rgba(255,255,255,0.8)\")\n .attr(\"r\", circleRBefore);\n\nd3.selectAll(\".visualLabel\").transition()\n .duration(200)\n .style(\"opacity\", 0);\n\nd3.select(\"#circle_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 0.2)\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .attr(\"r\", circleRAfter);\n\nd3.select(\"#text_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 1);\n \ndocument.getElementById(\"type680target\").innerHTML = \"<h4>\" + itemTitles[this.id] + \"</h4><hr class='light' style='margin-left: 0px;'><p class='text-justify'>\" + itemDescriptions[this.id] + \"</p>\";\n\n}", "function handleMouseOver(d) { // Add interactivity\r\n\t// while (d3.select(\".detail_text_title\").empty() != true) {\r\n\t// d3.select(\".detail_text_title\").remove(); // Remove text location\r\n\t// }\r\n\t// while (d3.select(\".detail_text_sentence\").empty() != true) {\r\n\t// d3.select(\".detail_text_sentence\").remove(); // Remove text location\r\n\t// }\r\n\twhile (d3.select(\".detail_text_no_event\").empty() != true) {\r\n\t d3.select(\".detail_text_no_event\").remove(); // Remove text location\r\n\t}\r\n\twhile (d3.select(\".detail_div\").empty() != true) {\r\n\t d3.select(\".detail_div\").remove(); // Remove text location\r\n\t}\r\n\r\n\t// DETAIL PART\r\n var match_event = []\r\n x = d3.mouse(this)[0] + 20\r\n // y_hover = d3.mouse(this)[1] - \r\n\ty_hover = y(d.subscriber_gain) - 50\r\n\td3.tsv('data/event.txt', function(data) {\r\n\t\tfor (id in data) {\r\n\t\t\t// console.log(data[id])\r\n\t\t\tif (d.year == data[id].year) {\r\n\t\t\t\tif (d.month == data[id].month) {\r\n\t\t\t\t\tmatch_event.push(data[id])\r\n\t\t\t\t\t// console.log(match_event)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// selecting\r\n\t detail_text_div = d3.select(\".hover_info_div\").append(\"div\").attr(\"class\", \"detail_div\")\r\n\r\n\t console.log(\"AAA\" )\r\n\r\n\t detail_text_div.append(\"p\").attr(\"class\", \"month_year_name\").text(monthNames[parseInt(d.month)-1] + ' ' + d.year)\r\n\r\n \t\tdetail_text_div.append(\"ol\")\r\n \t\tid_show = 1\r\n\t \tfor (id_event in match_event) {\r\n\t \t\tdetail_text_div.append(\"b\").attr(\"class\", \"detail_text_title\").text(id_show+\". \"+match_event[id_event].ttitle)\r\n\t \t\tdetail_text_div.append(\"div\").attr(\"class\", \"detail_text_sentence\").text(match_event[id_event].detail)\r\n\t \t\tdetail_text_div.append(\"br\")\r\n\t \t\tid_show+=1\r\n\t \t}\r\n\t \tif (d3.select(\".detail_text_sentence\").empty()) {\r\n\t \t\tdetail_text_div.append(\"p\").attr(\"class\", \"detail_text_no_event\").text(\"No special event in this month\")\r\n\t \t}\r\n\t})\r\n\r\n\t// BOX PART\r\n var match_event = []\r\n x = d3.mouse(this)[0] + 20\r\n // y_hover = d3.mouse(this)[1] - \r\n\ty_hover = y(d.subscriber_gain) - 50\r\n\r\n var text = svg.append(\"text\")\r\n .attr(\"id\", \"hover_bar\")\r\n .attr(\"fill\", \"white\")\r\n .attr(\"font-size\", \"15\")\r\n .attr(\"x\", function(d) {\r\n \treturn x;\r\n }).attr(\"y\", function(d) {\r\n \treturn y_hover; // - count_line*20;\r\n })\r\n\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Month/Year : \" + d.month + '-' + d.year)\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Subcriber gain : \" + d.subscriber_gain)\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Subcriber total : \" + d.subscriber_total)\r\n\r\n\tvar bbox = text.node().getBBox();\r\n\r\n\tvar rect = svg.append(\"rect\")\r\n\t .attr(\"id\", \"hover_bar_box\")\r\n\t .attr(\"x\", bbox.x - 5)\r\n\t .attr(\"y\", bbox.y - 5)\r\n\t .attr(\"width\", bbox.width + 10)\r\n\t .attr(\"height\", bbox.height + 10)\r\n\t .style(\"fill\", \"#000\")\r\n\t .style(\"fill-opacity\", \"0.2\")\r\n\t .style(\"stroke\", \"#fff\")\r\n\t .style(\"stroke-width\", \"1.5px\");\r\n }", "function handleMouseOverBubble(d, i) {\n d3.select(this).attr(\"r\", d.radius * 1.2);\n\n document.getElementById(\"team-details\").classList.remove(\"closed\");\n document.getElementById(\"td-team-name\").innerHTML = d.Team;\n document.getElementById(\"td-test-status-year\").innerHTML =\n \"Started in \" + d.StartYear;\n\n document.getElementById(\"td-team-matches\").innerHTML = d.Mat.toLocaleString();\n document.getElementById(\"td-team-won\").innerHTML = d.Won.toLocaleString();\n document.getElementById(\"td-team-lost\").innerHTML = d.Lost.toLocaleString();\n document.getElementById(\"td-team-undecided\").innerHTML =\n d.Undecided.toLocaleString();\n document.getElementById(\"row-runs\").style.display = \"none\";\n}", "function arc_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n var num = 0;\n var average = 0;\n links.each(function (d) {\n num ++;\n total+= viz.value()(d.data);\n });\n\n total = d3.format(\",.0f\")(total);\n\n average = d3.format(\",.0f\")(total / num);\n // console.log('number: ' + num);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"NEWS SOURCE\", d.data.values[0].CMTE_NM,\"Sentiment index: \" + total);\n}", "function handleMouseOut(d){\r\n d3.select(this)\r\n .transition(\"mouse\")\r\n .attr(\"fill\",(d) => color(d.properties.avgprice))\r\n .attr(\"stroke\", \"#641E16\")\r\n .attr(\"stroke-width\", 1)\r\n .style(\"cursor\", \"default\")\r\n }", "function onMouseOut(d,i) {\n scheduleAnnimation();\n d3.selectAll(\".vz-halo-label\").remove();\n}", "function mouseleave() {\n // Hide the breadcrumb trail\n d3.select('#trail')\n .style('visibility', 'hidden');\n\n // Deactivate all segments during transition.\n d3.selectAll('path').on('mouseover', null);\n\n // Transition each segment to full opacity and then reactivate it.\n d3.selectAll('path')\n .transition()\n .duration(1000)\n .style('opacity', 1)\n .each('end', function over() {\n d3.select(this).on('mouseover', mouseover);\n });\n\n d3.select('#percentage')\n .text('');\n\n d3.select('#info-text-nbIssues')\n .text('Touch me !')\n .style('font-size', '2.5em');\n\n d3.select('#info-text-info-repo')\n .text('');\n\n d3.select('#explanation')\n .style('top', '210px');\n}", "function mouseoverDeputy(d) {\n\t\t\tsvg.select('#deputy-'+d.record.deputyID).attr(\"r\",radiusHover)\n\t\n\t\t\tdispatch.hover(d.record,true);\n\n\t\t\ttooltip.html(d.record.name +' ('+d.record.party+'-'+d.record.district+')'+\"<br /><em>Click to select</em>\");\n\t\t\treturn tooltip\n\t\t\t\t\t.style(\"visibility\", \"visible\")\n\t\t\t\t\t.style(\"opacity\", 1);\n\t\t}", "function handleMouseOutPie() {\n // removes stroke\n d3.select(this)\n .attr(\"stroke\", \"none\")\n\n // fade out text\n svg.selectAll(\".percentage\")\n .transition().duration(500)\n .attr(\"opacity\", 0)\n .remove()\n }", "onMouseleave(e) {\n this.tooltip.remove();\n this.tooltipLine.remove();\n this.tooltipCircle.remove();\n\n // Actualiza el precio (al no llevar argumentos, price es false y se pone el último valor de la criptomoneda mostrada)\n this.setPrice();\n }", "function drawChartListing(livelist,livesale,liverent,pendinglist,pendsale,pendrent,lesspics,lesspicssale,lesspicsrent)\n\n\t\t\t{\n\n\t\t\t\tvar portalsArray = [];\n\n\t\t\t\tvar salesArray = [];\n\n\t\t\t\tvar rentalsArray = [];\n\n\t\t\t\tvar itemsCount = 0;\n\n\t\t\t\t//$.each(portalData, function( index, value ) {\n\n\t\t\t\t portalsArray.push([1,livelist]);\n\n\t\t\t\t salesArray.push([1,livesale]);\n\n\t\t\t\t rentalsArray.push([1,liverent]);\n\n\t\t\t\t // itemsCount++;\n\n\t\t\t\t//});\n\n\t\t\t\t portalsArray.push([2,pendinglist]);\n\n\t\t\t\t salesArray.push([2,pendsale]);\n\n\t\t\t\t rentalsArray.push([2,pendrent]);\n\n\t\t\t\t portalsArray.push([3,lesspics]);\n\n\t\t\t\t salesArray.push([3,lesspicssale]);\n\n\t\t\t\t rentalsArray.push([3,lesspicsrent]);\n\n\t\t\t\t itemsCount = 3;\n\n\t\t\t\t plotDataMe(salesArray,rentalsArray,portalsArray,itemsCount);\n\n\t\t\n\n\t\t\t\t\n\n\t\t\t}", "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(data.map(function(v) {\n return [v.Range, v.total];\n }), barColor);\n }", "function link_onMouseOver(e,d,i) {\n stopAnnimation();\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = d3.format(\",.0f\")(viz.value()(d.data));\n var date = '';\n // var date = d.data.month + \"/\" + d.data.day + \"/\" + d.data.year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Sentiment index: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v) {\n return [v.State, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }", "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v) {\n return [v.State, v.total];\n }), barColor);\n }", "function mouseover(d) {\n var shiftX = 10;\n var shiftY = 20;\n\n var mouseCoords = d3.mouse(this);\n d3.select(\"#tooltip\")\n .style(\"left\", function(d) {\n return mouseCoords[0] + shiftX + \"px\"\n })\n .style(\"top\", function(d) {\n return mouseCoords[1] + shiftY + \"px\"\n })\n .html(function() {\n if (d.energy[1990] == null || d.energy[currentYear][\"All products\"] == 0) return d.name + \": No data\";\n\n var all = d.energy[currentYear][\"All products\"];\n var renewable = d.energy[currentYear][\"Renewable energies\"];\n var per = renewable / all;\n\n hoverArrow(per);\n\n return \"<b>\" + d.name + \"</b><br/>\" + fmtPer(per) + \" renewables\"\n })\n .classed(\"hidden\", false);\n}", "function mouseover(d)\r\n\t\t\t{\r\n\t\t\t\t$(\"#col2\").text(\"\");\r\n\t\t\t\tcontent.append(\"div\").attr(\"id\",\"iw-container\").append(\"div\").attr(\"class\",\"iw-title\").append(\"i\").attr(\"class\",\"fa fa-info-circle\")\r\n\t\t\t\t.attr(\"style\",\"padding-right:20px;font-weight:bold;\")\r\n \t\t\t.text(\"\t\"+d.name)// + \" - 2013 appropriations: \" + d.appropriation13 + \" - Which was a \" + d.percentChange13 + \"% change of the previous year.\")\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Orders: \" + format(d.appropriation14/10))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" New Customers: \" + format((d.appropriation13)))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Product Lines: \" + format((d.appropriation12)))\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.attr(\"id\", \"annotate\")\r\n\t\t\t\t.text(d.annotation)\r\n\t\t\t\tif (d.annotation2 != null)\r\n\t\t\t\t{\r\n\t\t\t\tcontent1.append(\"br\")\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.text(d.annotation2);\r\n\t\t\t\t}\r\n\r\n \t\t\t}", "function displayIndicators() {\n // Indicator formulas\n var totalPopInd = upgrade.ship.number * upgrade.ship.rate;\n var redCoatInd = (((population.colonist.number * population.colonist.rate) - event.FIW.fundRate) + (((population.colonist.number * population.colonist.rate) - event.FIW.fundRate) / 10) + (upgrade.military.warShipGB.number * upgrade.military.warShipGB.rate)) * upgrade.military.allies.nativeAmerican.multiplier;\n var SDInd = (population.merchant.rate2 * population.merchant.mult2 * (1 - taxRate));\n var CNInd = currency.colonialNotes.rate;\n var goodsInd0 = (((population.colonist.number * population.colonist.rate) + ((population.slave.number / population.slave.increment) * population.slave.rate)) - (population.merchant.rate1 * population.merchant.mult1));\n var goodsInd1 = (((population.slave.number / population.slave.increment) * population.slave.rate) - (population.merchant.rate1 * population.merchant.mult1));\n var silverInd1 = (population.colonist.number * population.colonist.rate) - event.FIW.fundRate;\n var silverInd2 = population.colonist.number * population.colonist.rate;\n var goldInd1 = (population.colonist.number * population.colonist.rate) - event.FIW.fundRate;\n var goldInd2 = population.colonist.number * population.colonist.rate;\n \n // Population indicators\n if ((totalPopInd > 0) && (periodCount !== 3)) {\n document.getElementById(\"popInd\").innerHTML = \"(+\" + totalPopInd + \")\";\n $(\"#popInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n if (document.getElementById(\"redCoatDiv\") !== null) {\n if (redCoatInd > 0) {\n document.getElementById(\"redCoatInd\").innerHTML = \"(+\" + numFormat(redCoatInd) + \")\";\n $(\"#redCoatInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (redCoatInd < 0) {\n document.getElementById(\"redCoatInd\").innerHTML = \"(\" + numFormat(redCoatInd) + \")\";\n $(\"#redCoatInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"redCoatInd\").innerHTML = \"(\" + numFormat(redCoatInd) + \")\";\n $(\"#redCoatInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n \n // Currency indicators\n if (document.getElementById(\"SDDiv\") !== null) {\n if (SDInd > 0) {\n document.getElementById(\"SDInd\").innerHTML = \"(+\" + numFormat(SDInd) + \")\";\n $(\"#SDInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (SDInd < 0) {\n document.getElementById(\"SDInd\").innerHTML = \"(\" + numFormat(SDInd) + \")\";\n $(\"#SDInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"SDInd\").innerHTML = \"(\" + numFormat(SDInd) + \")\";\n $(\"#SDInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n \n if (document.getElementById(\"CNDiv\") !== null) {\n if (CNInd > 0) {\n document.getElementById(\"CNInd\").innerHTML = \"(+\" + CNInd.toLocaleString() + \")\";\n $(\"#CNInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (CNInd < 0) {\n document.getElementById(\"CNInd\").innerHTML = \"(\" + CNInd.toLocaleString() + \")\";\n $(\"#CNInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"CNInd\").innerHTML = \"(\" + CNInd.toLocaleString() + \")\";\n $(\"#CNInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n \n // Goods indicator\n if (periodCount === 0) {\n if (goodsInd0 > 0) {\n document.getElementById(\"goodsInd\").innerHTML = \"(+\" + numFormat(goodsInd0) + \")\";\n $(\"#goodsInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (goodsInd0 < 0) {\n document.getElementById(\"goodsInd\").innerHTML = \"(\" + numFormat(goodsInd0) + \")\";\n $(\"#goodsInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"goodsInd\").innerHTML = \"(\" + numFormat(goodsInd0) + \")\";\n $(\"#goodsInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n else if ((periodCount > 0) && (periodCount !== 3)) {\n if (goodsInd1 > 0) {\n document.getElementById(\"goodsInd\").innerHTML = \"(+\" + numFormat(goodsInd1) + \")\";\n $(\"#goodsInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (goodsInd1 < 0) {\n document.getElementById(\"goodsInd\").innerHTML = \"(\" + numFormat(goodsInd1) + \")\";\n $(\"#goodsInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"goodsInd\").innerHTML = \"(\" + numFormat(goodsInd1) + \")\";\n $(\"#goodsInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n \n // Silver indicator\n if (periodCount > 0) {\n if (document.getElementById(\"FIW\") !== null) {\n if (silverInd1 > 0) {\n document.getElementById(\"silverInd\").innerHTML = \"(+\" + numFormat(silverInd1) + \")\";\n $(\"#silverInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (silverInd1 < 0) {\n document.getElementById(\"silverInd\").innerHTML = \"(\" + numFormat(silverInd1) + \")\";\n $(\"#silverInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"silverInd\").innerHTML = \"(\" + numFormat(silverInd1) + \")\";\n $(\"#silverInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n else if (periodCount !== 3) {\n if (silverInd2 > 0) {\n document.getElementById(\"silverInd\").innerHTML = \"(+\" + numFormat(silverInd2) + \")\";\n $(\"#silverInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (silverInd2 < 0) {\n document.getElementById(\"silverInd\").innerHTML = \"(\" + numFormat(silverInd2) + \")\";\n $(\"#silverInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"silverInd\").innerHTML = \"(\" + numFormat(silverInd2) + \")\";\n $(\"#silverInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n } \n \n // Gold indicator\n if (periodCount > 0) {\n if (document.getElementById(\"FIW\") !== null) {\n if (goldInd1 > 0) {\n document.getElementById(\"goldInd\").innerHTML = \"(+\" + numFormat(goldInd1) + \")\";\n $(\"#goldInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (goldInd1 < 0) {\n document.getElementById(\"goldInd\").innerHTML = \"(\" + numFormat(goldInd1) + \")\";\n $(\"#goldInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"goldInd\").innerHTML = \"(\" + numFormat(goldInd1) + \")\";\n $(\"#goldInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n else if (periodCount !== 3) {\n if (goldInd2 > 0) {\n document.getElementById(\"goldInd\").innerHTML = \"(+\" + numFormat(goldInd2) + \")\";\n $(\"#goldInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (goldInd2 < 0) {\n document.getElementById(\"goldInd\").innerHTML = \"(\" + numFormat(goldInd2) + \")\";\n $(\"#goldInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"goldInd\").innerHTML = \"(\" + numFormat(goldInd2) + \")\";\n $(\"#goldInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n }\n}", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(data.map(function(v) {\n return [v.Range, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }", "function drawOutdoorDiffTotal() {\n\tvar data = google.visualization.arrayToDataTable([\n\t ['Rating', 'Number of Pitches'],\n\t ['5-', 29],\n\t ['5.4', 31],\n\t ['5.5', 43],\n\t ['5.6', 122],\n\t ['5.7', 104],\n\t ['5.8', 84],\n\t ['5.9', 44],\n\t ['5.10a', 24],\n\t ['5.10b', 13],\n\t ['5.10c', 4],\n\t ['5.10d', 1],\n\t ['5.11a', 1]\n\t]);\n\n\tvar options = {\n\t title: 'Difficulty of All Outdoor Climbing Pitches',\n\t titleTextStyle: {\n\t\tcolor: '#000000',\n\t\tfontSize: 14,\n\t\tfontName: 'Arial',\n\t\tbold: true\n\t},\n\t pieHole: 0.3,\n\t width: 375,\n\t height: 200,\n\t backgroundColor: 'transparent'\n\t};\n\n\tvar chart = new google.visualization.PieChart(document.getElementById('outdoorDiffPieTotal'));\n\tchart.draw(data, options);\n}", "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "function nightPriceBar() {\n var nightPrice = []\n var availability = []\n tbody.html(\"\")\n\n create_thead(hotels[\"New York City\"])\n Object.entries(hotels).forEach(function([key, value]) {\n if (key != \"timestamp\") {\n var price = parseFloat(value['Price Per Night ($)'])\n nightPrice.push(price)\n\n var available = parseFloat(value['Availability (%)'])\n availability.push(available)\n\n data_to_table(value)\n }\n\n });\n\n var trace_price = {\n x: Ticks,\n y: nightPrice,\n name: \"Avg Price per Night ($) \",\n text: nightPrice.map(value=>\"<b>$\"+value+\"</b>\"),\n textposition: 'auto',\n textfont: {\n color: 'black'\n },\n hoverinfo: 'none',\n type: 'bar',\n marker: { color: '#2eb8b8' },\n width: 0.5\n };\n\n var trace_availability = {\n x: Ticks,\n y: availability,\n mode: 'markers+text+lines',\n text: availability.map(value=>\"<b>\"+value+\" %</b>\"),\n textposition: 'bottom center',\n textfont: {\n color: 'black'\n },\n hoverinfo: 'none',\n name: \"Avg Availability (%)\",\n type: 'scatter'\n };\n\n var layout_bar = {\n // title: { text: `Average AirBnb Price per Night`, font: { color: \"white\" } },\n xaxis: {\n color: 'white',\n tickfont:{\n size:16\n }\n },\n yaxis: {\n align: \"left\",\n color: 'black'\n },\n legend: {\n font: {\n color: 'white'\n },\n x:0,\n y:-0.15,\n orientation: \"h\"\n },\n plot_bgcolor: \"black\",\n paper_bgcolor: \"black\",\n margin: {\n l: 10,\n r: 10,\n b: 0,\n t: 50,\n pad: 4\n }\n };\n var bar_chart = [trace_price, trace_availability];\n Plotly.newPlot('bar', bar_chart, layout_bar);\n\n d3.select('#chartTitle').text(\"Average AirBnb Price per Night and Availability\")\n\n}", "function computeAvg() {\n var chart = this,\n series = chart.series,\n yAxis = chart.yAxis[0],\n xAxis = chart.xAxis[0],\n extremes = xAxis.getExtremes(),\n min = extremes.min,\n max = extremes.max,\n plotLine = chart.get('avgLine'),\n sum = 0,\n count = 0;\n Highcharts.each(series, function(serie, i) {\n if (serie.name !== 'Navigator') {\n Highcharts.each(serie.data, function(point, j) {\n if (point.x >= min && point.x <= max) {\n sum += point.y;\n count++;\n }\n });\n }\n });\n var avg = (sum / count).toFixed(2);\n // console.log(\"avg hours :\" + sum/count);\n // console.log(\"count \" + count);\n if (!isNaN(avg)) {chart.setTitle(null, {\n text: 'Avg hours : ' + avg\n });}\n yAxis.removePlotLine('avgLine');\n yAxis.addPlotLine({\n value: (avg),\n color: 'red',\n width: 2,\n id: 'avgLine'\n });\n}", "function showDetails() {\n\n var z = wrap.style('zoom') || 1\n\n if (z === 'normal') {\n z = 1\n } else if (/%/.test(z)) {\n z = parseFloat(z) / 100\n }\n\n var x = d3.mouse(this)[0] / z\n var tx = Math.max(0, Math.min(options.width + options.margin.left, x))\n\n var i = d3.bisect(lineData.map(function(d) {\n return d.startTime\n }), xScale.invert(tx - options.margin.left))\n var d = lineData[i]\n var open\n var high\n var low\n var close\n var volume\n var vwap\n\n if (d) {\n open = d.open.toPrecision(5)\n high = d.high.toPrecision(5)\n low = d.low.toPrecision(5)\n close = d.close.toPrecision(5)\n vwap = d.vwap.toPrecision(5)\n volume = d.baseVolume.toFixed(2)\n\n var baseCurrency = base.currency\n var chartDetails = div.select('.chartDetails')\n chartDetails.html('<span class=\"date\">' +\n parseDate(d.startTime.local(), chartInterval) +\n '</span><span><small>O:</small><b>' + open + '</b></span>' +\n '<span class=\"high\"><small>H:</small><b>' + high + '</b></span>' +\n '<span class=\"low\"><small>L:</small><b>' + low + '</b></span>' +\n '<span><small>C:</small><b>' + close + '</b></span>' +\n '<span class=\"vwap\"><small>VWAP:</small><b>' + vwap + '</b></span>' +\n '<span class=\"volume\"><small>Vol:</small><b>' + volume +\n ' ' + baseCurrency + '</b></span>' +\n '<span><small>Ct:</small><b>' + d.count + '</b></span>')\n .style('opacity', 1)\n\n hover.transition().duration(50)\n .attr('transform', 'translate(' + xScale(d.startTime) + ')')\n focus.transition().duration(50)\n .attr('transform', 'translate(' +\n xScale(d.startTime) + ',' +\n priceScale(d.close) + ')')\n horizontal.transition().duration(50)\n .attr('x1', xScale(d.startTime))\n .attr('x2', options.width)\n .attr('y1', priceScale(d.close))\n .attr('y2', priceScale(d.close))\n\n hover.style('opacity', 1)\n horizontal.style('opacity', 1)\n focus.style('opacity', 1)\n }\n }", "function showDalcAndWalc() {\n\n\t// calculate the average workday and weekend alcohol \n\t// consumption arrays for each age\n\tvar avgDalcConsumption = calculateAvgOf(\"Dalc\"),\n\t\tavgWalcConsumption = calculateAvgOf(\"Walc\");\n\n\t// we give \"dalcWalcLabel\" to both lines so that we can remove them together\n\tshowLine(avgDalcConsumption, \"avgDalcLine\");\n \taddPointsToLine(avgDalcConsumption, \"dalcWalc\");\t\t\t\n \taddLabelToLine(avgDalcConsumption, \"Workday Average\", \"dalcWalcLabel\");\n\n \tshowLine(avgWalcConsumption, \"avgWalcLine\");\n \taddPointsToLine(avgWalcConsumption, \"dalcWalc\");\t\t\t\n \taddLabelToLine(avgWalcConsumption, \"Weekend Average\", \"dalcWalcLabel\");\n}", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function mouseoverf(d,i){\n d.region = region.get(d.id) || \"-\";\n if (d.region != \"-\") {\n d3.select(this).attr(\"stroke-width\",2);\n d3.selectAll(\"path\")\n .attr('fill-opacity', 0.6);\n d3.selectAll(\"#\" + d.region)\n .transition().duration(100)\n .attr('fill-opacity', 1);\n return tooltip.style(\"hidden\", false).html(d.waste+\"1\");\n } else {\n d3.select(this).attr(\"stroke-width\",1);\n d3.selectAll(\"path\")\n .attr('fill-opacity', 1);\n }\n}", "function mouseover(d){\n// call another function to update the bar chart with new data, selected by the bar chart slice\n// use a variable and return to give back the right color of the selected bar chart slice to the bar chart rects\n bC.update(myData.map(function(v){ \n return [v.year,v.sentiment[d.data.type]];})\n ,sentimentColor(d.data.type));\n }", "function redrawTotalLoanAmountChart() {\n nv.addGraph(function() {\n var chart = nv.models.lineChart()\n .useInteractiveGuideline(true);\n chart.width(700);\n chart.margin({left:100});\n chart.color(['#2ca02c', 'darkred','darkblue']);\n chart.x(function(d,i) { return i });\n chart.xAxis\n .axisLabel('Date')\n .tickFormat(function(d) {\n var label = scope.totalLoanAmountData[0].values[d].label1;\n return label;\n });\n chart.yAxis\n .axisLabel('Loan Value')\n .tickFormat(function(d){\n return d3.format(',f')(d);\n });\n d3.select('#totalLoanAmountchart svg')\n .datum(scope.totalLoanAmountData)\n .transition().duration(500)\n .call(chart);;\n nv.utils.windowResize(chart.update);;\n return chart;\n });\n }", "function mouseout(d){\n // call the update function of histogram with all data.\n hGW.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n hGR.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n hGC.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n }", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "function mouseoverNode(d){\n\t\n\tvar disVal;\n\tif(showFlowIn){\n\t\tdisVal = \"Flow In Value: \"+d.flowInto;\n\t}\n\telse{\n\t\tdisVal = \"Flow Out Value: \"+d.flowOut;\n\t}\n\n\tdocument.getElementById(\"nodeval\").textContent = disVal;\n}", "function mouseOver(d){\n\t\t\t// d3.select(this).attr(\"stroke\",\"black\");\n\t\t\ttooltip.html(\"<strong>Frequency</strong>\" + \"<br/>\" + d.data.label);\n\t\t\treturn tooltip.transition()\n\t\t\t\t.duration(10)\n\t\t\t\t.style(\"position\", \"absolute\")\n\t\t\t\t.style({\"left\": (d3.event.pageX + 30) + \"px\", \"top\": (d3.event.pageY ) +\"px\" })\n\t\t\t\t.style(\"opacity\", \"1\")\n\t\t\t\t.style(\"display\", \"block\");\n\t\t}", "function bubbleChart() {\r\n // Constants for sizing\r\n var width = 940; //940\r\n var height = 1200; //900\r\n\r\n // tooltip for mouseover functionality\r\n var tooltip = floatingTooltip('gates_tooltip', 240);\r\n\r\n // Locations to move bubbles towards, depending\r\n // on which view mode is selected.\r\n var center = { x: width / 2, y: height / 4};\r\n\r\n var formDiscCenters = {\r\n Formula: { x: width / 4 - 50, y: height / 2 },\r\n Discretionary: { x: width / 2 + 160, y: height / 2 -30 }\r\n };\r\n\r\n var prinOffCenters = {\r\n IES: { x: 495, y: 495},\r\n OCTAE: { x: 495, y: 280 },\r\n /*ODS: { x: 679, y: 210 },*/\r\n OELA: { x: 679, y: 265},\r\n OESE: { x: 165, y: 300},\r\n OII: { x: 310, y: 300},\r\n OPE: { x: 330, y: 487},\r\n OSERS: { x: 170, y: 470}\r\n };\r\n\r\n var formDiscsTitleX = {\r\n Formula: 180,\r\n Discretionary: 670,\r\n //2010: width - 160\r\n };\r\n\r\n var prinOffTitleX = {\r\n IES: 565,\r\n OCTAE: 565,\r\n /*ODS: 740,*/\r\n OELA: 740,\r\n OESE: 150,\r\n OII: 375,\r\n OPE: 375,\r\n OSERS: 150\r\n };\r\n // Y locations of the year titles\r\n\r\n var prinOffTitleY = {\r\n IES: 410,\r\n OCTAE: 130,\r\n /*ODS: 90,*/\r\n OELA: 130,\r\n OESE: 130,\r\n OII: 130,\r\n OPE: 410,\r\n OSERS: 410\r\n};\r\n\r\nvar prinOffPopUp = {\r\n IES: \"Institute of Education Sciences\",\r\n OCTAE: \"Office of Career, Technical, and Adult Education\",\r\n /*ODS: \"Office of the Deputy Secretary\",*/\r\n OELA: \"Office of English Language Acquisition\",\r\n OESE: \"Office of Elementary and Secondary Education\",\r\n OII: \"Office of Innovation and Improvement\",\r\n OPE: \"Office of Postsecondary Education\",\r\n OSERS: \"Office of Special Education and Rehabilitative Services\"\r\n };\r\n\r\n // @v4 strength to apply to the position forces\r\n var forceStrength = 0.03;\r\n\r\n // These will be set in create_nodes and create_vis\r\n var svg = null;\r\n var bubbles = null;\r\n var nodes = [];\r\n var nodes2 = [];\r\n\r\n // Charge function that is called for each node.\r\n // As part of the ManyBody force.\r\n // This is what creates the repulsion between nodes.\r\n //\r\n // Charge is proportional to the diameter of the\r\n // circle (which is stored in the radius attribute\r\n // of the circle's associated data.\r\n //\r\n // This is done to allow for accurate collision\r\n // detection with nodes of different sizes.\r\n //\r\n // Charge is negative because we want nodes to repel.\r\n // @v4 Before the charge was a stand-alone attribute\r\n // of the force layout. Now we can use it as a separate force!\r\n function charge(d) {\r\n return -Math.pow(d.radius, 2.0) * forceStrength;\r\n }\r\n\r\n // Here we create a force layout and\r\n // @v4 We create a force simulation now and\r\n // add forces to it.\r\n var simulation = d3.forceSimulation()\r\n .velocityDecay(0.2)\r\n .force('x', d3.forceX().strength(forceStrength).x(center.x))\r\n .force('y', d3.forceY().strength(forceStrength).y(center.y))\r\n .force('charge', d3.forceManyBody().strength(charge))\r\n .on('tick', ticked);\r\n\r\n // @v4 Force starts up automatically,\r\n // which we don't want as there aren't any nodes yet.\r\n simulation.stop();\r\n\r\n var simulationForChanges = d3.forceSimulation()\r\n .velocityDecay(0.2)\r\n .force('x', d3.forceX().strength(forceStrength).x(center.x))\r\n .force('y', d3.forceY().strength(forceStrength).y(center.y))\r\n //.force('charge', d3.forceManyBody().strength(charge))\r\n .on('tick', ticked);\r\n\r\n simulationForChanges.stop();\r\n\r\n // Nice looking colors - no reason to buck the trend\r\n // @v4 scales now have a flattened naming scheme\r\n var fillColor = d3.scaleOrdinal()\r\n .domain(['bottomQuint','lowerQuint','midQuint','upperQuint','topQuint'])\r\n .range(['#C2D6D0', '#A7BFB8', '#8DA7A0','#729088','#587970']);\r\n\r\n\r\n /*\r\n * This data manipulation function takes the raw data from\r\n * the CSV file and converts it into an array of node objects.\r\n * Each node will store data and visualization values to visualize\r\n * a bubble.\r\n *\r\n * rawData is expected to be an array of data objects, read in from\r\n * one of d3's loading functions like d3.csv.\r\n *\r\n * This function returns the new node array, with a node in that\r\n * array for each element in the rawData input.\r\n */\r\n function createNodes(rawData) {\r\n // Use the max in the data as the max in the scale's domain\r\n // note we have to ensure the total_amount is a number.\r\n var maxAmount = d3.max(rawData, function (d) { return +d.amount; });\r\n // Sizes bubbles based on area.\r\n // @v4: new flattened scale names.\r\n var radiusScale = d3.scalePow()\r\n .exponent(0.5)\r\n .range([2, 85])\r\n .domain([0, maxAmount]);\r\n\r\n // Use map() to convert raw data into node data.\r\n // Checkout http://learnjsdata.com/ for more on\r\n // working with data.\r\n var myNodes = rawData.map(function (d) {\r\n return {\r\n radius: radiusScale(+d.amount),\r\n value: +d.amount,\r\n balance: +d.balance,\r\n count: d.count,\r\n name: d.name,\r\n color: d.color,\r\n year: d.year,\r\n grantType: d.type,\r\n grantOff:d.office,\r\n x: Math.random() * 900,\r\n y: Math.random() * 800\r\n };\r\n });\r\n // sort them to prevent occlusion of smaller nodes.\r\n //circle algorithm\r\n myNodes.sort(function (a, b) { return b.value - a.value; });\r\n\r\n return myNodes;\r\n }\r\n\r\n function createTotalNodes(rawData) {\r\n var myNodesTotal = rawData.map(function (d) {\r\n return {\r\n office: d.name,\r\n total: +d.total,\r\n };\r\n });\r\n return myNodesTotal;\r\n }\r\n\r\n\r\n /*\r\n * Main entry point to the bubble chart. This function is returned\r\n * by the parent closure. It prepares the rawData for visualization\r\n * and adds an svg element to the provided selector and starts the\r\n * visualization creation process.\r\n *\r\n * selector is expected to be a DOM element or CSS selector that\r\n * points to the parent element of the bubble chart. Inside this\r\n * element, the code will add the SVG continer for the visualization.\r\n *\r\n * rawData is expected to be an array of data objects as provided by\r\n * a d3 loading function like d3.csv.\r\n */\r\n var chart = function chart(selector, rawData) {\r\n // convert raw data into nodes data\r\n nodes = createNodes(rawData[0]); \r\n nodes2 = createTotalNodes(rawData[1]); \r\n // console.log(nodes2)*********\r\n // Create a SVG element inside the provided selector\r\n // with desired size.\r\n svg = d3.select(selector)\r\n .append('svg')\r\n .attr('width', width)\r\n .attr('height', height)\r\n .attr('id', 'svgContainer');\r\n\r\n // Bind nodes data to what will become DOM elements to represent them.\r\n bubbles = svg.selectAll('.bubble')\r\n //.data(nodes, function (d) { return d.id; });\r\n .data(nodes);\r\n // Create new circle elements each with class `bubble`.\r\n // There will be one circle.bubble for each object in the nodes array.\r\n // Initially, their radius (r attribute) will be 0.\r\n // @v4 Selections are immutable, so lets capture the\r\n // enter selection to apply our transtition to below.\r\n var bubblesE = bubbles.enter().append('circle')\r\n .classed('bubble', true)\r\n .attr('r', 0)\r\n .attr('fill', function (d) { return fillColor(d.color); })\r\n .attr('stroke', function (d) { return d3.rgb(fillColor(d.color)).darker(); })\r\n .attr('stroke-width', 2)\r\n .on('mouseover', showDetail)\r\n .on('mouseout', hideDetail);\r\n\r\n // @v4 Merge the original empty selection and the enter selection\r\n bubbles = bubbles.merge(bubblesE);\r\n\r\n // Fancy transition to make bubbles appear, ending with the\r\n // correct radius\r\n bubbles.transition()\r\n .duration(2000)\r\n .attr('r', function (d) { return d.radius; });\r\n\r\n // Set the simulation's nodes to our newly created nodes array.\r\n // @v4 Once we set the nodes, the simulation will start running automatically!\r\n simulation.nodes(nodes);\r\n simulationForChanges.nodes(nodes);\r\n\r\n // Set initial layout to single group.\r\n \r\n showPrinOffTitles(nodes2);\r\n //hideTypePrinOff();\r\n splitBubblesPrinOff(nodes2)\r\n groupBubbles();\r\n \r\n\r\n };\r\n\r\n /*\r\n * Callback function that is called after every tick of the\r\n * force simulation.\r\n * Here we do the acutal repositioning of the SVG circles\r\n * based on the current x and y values of their bound node data.\r\n * These x and y values are modified by the force simulation.\r\n */\r\n function ticked() {\r\n bubbles\r\n .attr('cx', function (d) { return d.x; })\r\n .attr('cy', function (d) { return d.y; });\r\n }\r\n\r\n /*\r\n * Provides a x value for each node to be used with the split by year\r\n * x force.\r\n */\r\n /*function nodeYearPosX(d) {\r\n //var stringXYear = d.colorprop.toString();\r\n return yearCenters[d.colorprop].x;\r\n } */\r\n /* function nodeYearPosY(d) {\r\n //var stringYYear = d.colorprop.toString();\r\n return yearCenters[d.colorprop].y;\r\n } */\r\n\r\nfunction nodeFormDiscPos(d) {\r\n return formDiscCenters[d.grantType].x;\r\n }\r\n\r\n function nodePrinOffPosX(d) {\r\n return prinOffCenters[d.grantOff].x;\r\n }\r\n function nodePrinOffPosY(d) {\r\n return prinOffCenters[d.grantOff].y;\r\n }\r\n /*\r\n * Sets visualization in \"single group mode\".\r\n * The year labels are hidden and the force layout\r\n * tick function is set to move all nodes to the\r\n * center of the visualization.\r\n */\r\n\r\n function groupBubbles() {\r\n\r\n hideTypeTitles();\r\n hideTypePrinOff();\r\n drawAllLegendCircle();\r\n\r\n // @v4 Reset the 'x' force to draw the bubbles to the center.\r\n simulation.force('x', d3.forceX().strength(forceStrength).x(center.x));\r\n simulation.force('y', d3.forceY().strength(forceStrength).y(300));\r\n // @v4 We can reset the alpha value and restart the simulation\r\n simulation.alpha(1).restart();\r\n }\r\n\r\n function splitBubblesFormDisc(){\r\n\r\n hideTypePrinOff();\r\n showFormDiscTitles();\r\n drawTypeLegendCircle();\r\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\r\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodeFormDiscPos));\r\n simulation.force('y', d3.forceY().strength(forceStrength).y(260));\r\n\r\n // @v4 We can reset the alpha value and restart the simulation\r\n simulation.alpha(1).restart();\r\n }\r\n\r\nfunction splitBubblesPrinOff(data2){\r\n hideTypeTitles();\r\n drawOffLegendCircle(); \r\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\r\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodePrinOffPosX));\r\n simulation.force('y', d3.forceY().strength(forceStrength).y(nodePrinOffPosY));\r\n // @v4 We can reset the alpha value and restart the simulation\r\n simulation.alpha(1).restart();\r\n\r\n showPrinOffTitles(data2);\r\n \r\n}\r\n\r\n\r\n function hideTypeTitles() {\r\n svg.selectAll('.formdisc').remove();\r\n }\r\n\r\n function hideTypePrinOff() {\r\n svg.selectAll('.prinoff').remove();\r\n }\r\n\r\n function showFormDiscTitles() {\r\n // Another way to do this would be to create\r\n // the year texts once and then just hide them.\r\n var discsData = d3.keys(formDiscsTitleX);\r\n var discs = svg.selectAll('.formdisc')\r\n .data(discsData);\r\n\r\n discs.enter().append('text')\r\n .attr('class', 'formdisc')\r\n .attr('x', function (d) { return formDiscsTitleX[d]; })\r\n .attr('y', 250)\r\n .attr('text-anchor', 'middle')\r\n .text(function (d) { return d; });\r\n }\r\n\r\n function showPrinOffTitles(rawData) {\r\n // Another way to do this would be to create\r\n // the year texts once and then just hide them.\r\n\r\n var totalAmtLabel = {\r\n IES: rawData[0].total,\r\n OCTAE: rawData[1].total,\r\n OELA: rawData[2].total,\r\n OESE: rawData[3].total,\r\n OII: rawData[4].total,\r\n OPE: rawData[5].total,\r\n OSERS: rawData[6].total,\r\n };\r\n //console.log(rawData[6].total)\r\n\r\n /* for (var i = 0; i < rawData.length; i++) {\r\n var totalObj = {};\r\n totalObj.office = rawData[i].office;\r\n totalObj.total = rawData[i].total;\r\n console.log(totalObj); */\r\n\r\n var discsData = d3.keys(prinOffPopUp);\r\n var discs = svg.selectAll('.prinoff')\r\n .data(discsData);\r\n \r\n discs.enter().append('text')\r\n .attr('class', 'prinoff')\r\n .attr('x', function (d) { return prinOffTitleX[d]; })\r\n .attr('y', function (d) { return prinOffTitleY[d]; })\r\n .attr('text-anchor', 'middle')\r\n .text(function (d) { return d; })\r\n .append('svg:title')\r\n .text(function (d) { return 'Office: ' + prinOffPopUp[d] + '\\n' + 'Total Amount: $' + addCommas(totalAmtLabel[d]); });\r\n }\r\n \r\n function showTotalDetail(d) {\r\n // change outline to indicate hover state.\r\n //d3.select(this)\r\n\r\n var content = '<span class=\"name\">Office: </span><span class=\"value\">' +\r\n d.name +\r\n '</span><br/>' +\r\n '<span class=\"name\">Total: </span><span class=\"value\">$' +\r\n addCommas(d.value) +\r\n '</span><br/>';\r\n\r\n tooltip.showTooltip(content, d3.event);\r\n }\r\n\r\n /*\r\n * Hides tooltip\r\n */\r\n function hideTotalDetail(d) {\r\n // reset outline\r\n //d3.select(this)\r\n //.attr('stroke', d3.rgb(fillColor(d.color)).darker());\r\n tooltip.hideTooltip();\r\n }\r\n \r\n /*\r\n * Function called on mouseover to display the\r\n * details of a bubble in the tooltip.\r\n */\r\n function showDetail(d) {\r\n // change outline to indicate hover state.\r\n d3.select(this).attr('stroke', 'black');\r\n\r\n var content = '<span class=\"name\">Title: </span><span class=\"value\">' +\r\n d.name +\r\n '</span><br/>' +\r\n '<span class=\"name\">Amount Awarded: </span><span class=\"value\">$' +\r\n addCommas(d.value) +\r\n '</span><br/>' +\r\n '<span class=\"name\">Funds Available: </span><span class=\"value\">$' +\r\n addCommas(d.balance) +\r\n '</span><br/>' +\r\n '<span class=\"name\">Number of Grants: </span><span class=\"value\">' +\r\n d.count +\r\n '</span><br/>' +\r\n '<span class=\"name\">Avg Life: </span><span class=\"value\">' +\r\n d.year +\r\n ' yrs</span><br/>';\r\n\r\n tooltip.showTooltip(content, d3.event);\r\n }\r\n\r\n /*\r\n * Hides tooltip\r\n */\r\n function hideDetail(d) {\r\n // reset outline\r\n d3.select(this)\r\n .attr('stroke', d3.rgb(fillColor(d.color)).darker());\r\n tooltip.hideTooltip();\r\n }\r\n\r\n\r\n\r\n/********Legend**********/\r\n\r\nfunction drawAllLegendCircle(){\r\nsvg.selectAll('.legendcircle').remove();\r\n//10 Billion\r\nvar xLargeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclexlg')\r\n .attr(\"cx\", 65)\r\n .attr(\"cy\",502)\r\n .attr(\"r\", 55);\r\n\r\n//1 Billion\r\nvar largeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclelg')\r\n .attr(\"cx\", 65)\r\n .attr(\"cy\", 532)\r\n .attr(\"r\", 25);\r\n// 500 Million\r\nvar medCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclemd')\r\n .attr(\"cx\", 65)\r\n .attr(\"cy\", 541)\r\n .attr(\"r\", 17);\r\n// 50 Million\r\nvar smallCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclesm')\r\n .attr(\"cx\", 65)\r\n .attr(\"cy\", 551)\r\n .attr(\"r\", 7);\r\n}\r\n\r\nfunction drawTypeLegendCircle(){\r\nsvg.selectAll('.legendcircle').remove();\r\n\r\n//10 Billion\r\nvar xLargeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclexlg')\r\n .attr(\"cx\", 375)\r\n .attr(\"cy\", 485)\r\n .attr(\"r\", 55);\r\n//1 Billion\r\nvar largeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclelg')\r\n .attr(\"cx\", 375)\r\n .attr(\"cy\", 515)\r\n .attr(\"r\", 25);\r\n// 500 Million\r\nvar medCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclemd')\r\n .attr(\"cx\", 375)\r\n .attr(\"cy\", 524)\r\n .attr(\"r\", 17);\r\n// 50 Million\r\nvar smallCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclesm')\r\n .attr(\"cx\", 375)\r\n .attr(\"cy\", 534)\r\n .attr(\"r\", 7);\r\n}\r\n\r\nfunction drawOffLegendCircle(){\r\n//1 Billion\r\nsvg.selectAll('.legendcircle').remove();\r\n\r\n\r\n//10 Billion\r\nvar xLargeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclexlg')\r\n .attr(\"cx\", 716)\r\n .attr(\"cy\", 484)\r\n .attr(\"r\", 55);\r\n\r\nvar largeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclelg')\r\n .attr(\"cx\", 716)\r\n .attr(\"cy\", 514)\r\n .attr(\"r\", 25);\r\n// 500 Million\r\nvar medCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclemd')\r\n .attr(\"cx\", 716)\r\n .attr(\"cy\", 523)\r\n .attr(\"r\", 17);\r\n// 50 Million\r\nvar smallCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclesm')\r\n .attr(\"cx\",716)\r\n .attr(\"cy\", 533)\r\n .attr(\"r\", 7);\r\n}\r\n\r\n\r\n\r\n /*\r\n * Externally accessible function (this is attached to the\r\n * returned chart function). Allows the visualization to toggle\r\n * between \"single group\" and \"split by year\" modes.\r\n *\r\n * displayName is expected to be a string and either 'formdisc','prinoff' or 'all'.\r\n */\r\n chart.toggleDisplay = function (displayName) {\r\n if(displayName === 'formdisc') {\r\n splitBubblesFormDisc();\r\n } else if(displayName === 'prinoff') {\r\n splitBubblesPrinOff(nodes2);\r\n } else {\r\n groupBubbles();\r\n }\r\n };\r\n\r\n // return the chart function from closure.\r\n return chart;\r\n}", "function mouseover() {\n tooltip\n .style('opacity', 1)\n d3.select(this)\n .style('stroke', 'black')\n .style('opacity', 1)\n }", "function mouseOverGraph(e,ix,node){\n stopDwellTimer(); // Mouse movement: reset the dwell timer.\n var ownTooltip = // Check if the hovered element already has the tooltip.\n (ix>=0 && ix==tooltipInfo.ixActive) ||\n (ix==-2 && tooltipInfo.idNodeActive==node.id);\n if(ownTooltip) stopCloseTimer(); // ownTooltip: clear the close timer.\n else resumeCloseTimer(); // !ownTooltip: resume the close timer.\n tooltipInfo.ixHover = ix;\n tooltipInfo.nodeHover = node;\n tooltipInfo.posX = e.clientX;\n tooltipInfo.posY = e.clientY;\n if(ix!=-1 && !ownTooltip && tooltipInfo.dwellTimeout>0){ // Go dwell timer.\n tooltipInfo.idTimer = setTimeout(function(){\n tooltipInfo.idTimer = 0;\n stopCloseTimer();\n showGraphTooltip();\n },tooltipInfo.dwellTimeout);\n }\n }", "function mouseoutC() {\r\n d3.select(this)\r\n .transition()\r\n .attr(\"r\", config.radius)\r\n .style(\"stroke\",\"powderblue\")\r\n .style(\"stroke-width\", 3);\r\n\r\n svg_dep.selectAll(\".bar-dep\")\r\n .transition()\r\n .style(\"fill\",\"powderblue\");\r\n\r\n d3.select(\"#tooltip-dep\").classed(\"hidden\", true);\r\n\r\n svg_dep.selectAll(\".label\")\r\n .transition()\r\n .attr(\"font-weight\", \"normal\");\r\n }", "function handlePointHoverLeave (e) {\n var point = $(this).data(\"point\");\n point.style = pointStyleDefault;\n point.redraw();\n }", "function handlePointHoverLeave (e) {\n var point = $(this).data(\"point\");\n point.style = pointStyleDefault;\n point.redraw();\n }", "function loss() {\n \n userLoss++;\n $('#loss').text(userLoss);\n $('#winLossAlert').text(\"You Lost!!!\")\n reset();\n }", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "function loser() {\n alert(\"You went over and lost\");\n losses++;\n $(\"#numberLosses\").html(losses);\n reset()\n }", "function mouseOver(){\n d3.select(this)\n \t.classed(\"mouseover\",true)\n \t.attr(\"r\", 6);\n console.log(\"Mouse Over!\");\n\n var data = this.__data__; \n//Setting parameters for bar chart display\n bar_svg.style(\"display\",\"block\");\n var bar_xScale = d3.scaleLinear()\n .range([0, width])\n .domain([0, d3.max(data.value.occ, function(d){return parseInt(d.count);})]);\n var bar_yScale = d3.scaleBand()\n .range([height, 0])\n .domain(data.value.occ.map(function(d){return d.state;}));\n bar_svg.append(\"g\")\n .attr(\"class\", \"xAxis\")\n .attr(\"transform\", \"translate(80,\"+height+\")\");\n\n bar_svg.select(\".xAxis\")\n .style(\"font-size\",\"10px\")\n .call(d3.axisBottom(bar_xScale)\n .tickSizeInner([-height]));\n\n bar_svg.append(\"g\")\n .attr(\"class\",\"yAxis\")\n .attr(\"transform\",\"translate(80,0)\");\n bar_svg.select(\".yAxis\")\n .style(\"font-size\",\"10px\")\n .call(d3.axisLeft(bar_yScale));\n\n var bars = bar_svg.selectAll(\".bar\")\n .data(data.value.occ); \n bars.exit()\n \t.remove();\n\n bars.enter()\n \t.append(\"rect\")\n .merge(bars)\n .attr(\"class\",\"bar\")\n .attr(\"x\",0)\n .attr(\"height\", function(d){\n \treturn bar_yScale.bandwidth();})\n .attr(\"transform\",\"translate(80,0)\")\n .attr(\"y\", function(d){return bar_yScale(d.state);})\n .attr(\"width\", function(d){return bar_xScale(d.count);})\n .attr(\"fill\",\"steelblue\")\n .attr(\"stroke\",\"white\")\n .attr(\"stroke-width\",0.8);\n\n const this_region = data.value.region;\n const this_year = data.key;\n \n var title = bar_svg.append(\"g\")\n .attr(\"class\",\"barTitle\")\n .attr(\"id\",\"barTitle\")\n .append(\"text\")\n .attr(\"transform\", \"translate(480,-10)\")\n .text(this_region.toString()+\"ern\"+\" Region Earthquakes \"+this_year.toString());\n }", "function mouseoutDeputy(d){ \n\t\t\t\tsvg.select('#deputy-'+d.record.deputyID).attr(\"r\",radius);\n\t\t\t\t\n\t\t\t\tdispatch.hover(d.record,false);\n\t\t\t\t\n\t\t\t\treturn tooltip.style(\"visibility\", \"hidden\");\n\t\t}", "function over(data,flag){\n //var stateData = usdaAtlas.get(d.id);\n if (data != null){\n // load data \n svg2.selectAll(\".histogram-lable\").remove();\n var obesity = data.obesity;\n var poverty = data.poverty;\n var stateName = data.state;\n var fastfood = data.PCH_FFRPTH_07_12;\n var farmmarket = data.PCH_FMRKTPTH_09_13;\n var grocery = data.PCH_GROCPTH_07_12;\n var convenience = data.ConvenienceStores;\n var position = projection([data.lat,data.lon]);\n \n var output = document.getElementById(\"obesity-result\");\n var stateoutput = document.getElementById(\"state-result\");\n var povertyoutput = document.getElementById(\"poverty-result\");\n output.innerHTML = obesity + \"%\";\n stateoutput.innerHTML = stateName;\n povertyoutput.innerHTML = poverty + \"%\";\n\n svg2.append(\"text\")\n\n .text(function(d){\n if (flag == \"obesity\") {return obesity;}//xScale21(0.45) + xScale21(w/100);}\n if (flag == \"poverty\") {return poverty;}\n })\n //.attr(\"x\",100)\n //.attr(\"y\",200)\n .attr(\"x\", function(d){\n //var stateData = usdaAtlas.get(d.id);\n if (data != null){\n var w = data.obesity;\n console.log(\"width is: \" + w);\n if (flag == \"obesity\") {return (xScale21(0.0) + padding2 + 5);}//xScale21(0.45) + xScale21(w/100);}\n if (flag == \"poverty\") {return xScale22(0.075);}//xScale22(0.22) + xScale21(w/100);}\n } else return null;\n })\n .attr(\"y\", function(d){\n //var stateData = usdaAtlas.get(d.id);\n if (data != null) {\n var name = data.state;\n console.log(\"name is: \" + name);\n return (yScale2(name) + rectwidth +7);\n }else return null;\n })\n .attr(\"class\",\"histogram-lable\");\n // .attr(\"font-size\",\"12px\")\n // .attr(\"color\",\"red\")\n // .attr(\"text-align\",\"center\");\n \n}}", "function Greenhouse() {\r\n const opts = {\r\n options: {\r\n chart: {\r\n fontFamily: chartFont,\r\n zoom: {\r\n enabled: false,\r\n },\r\n },\r\n dataLabels: {\r\n enabled: false\r\n },\r\n stroke: {\r\n width: 2,\r\n curve: 'smooth',\r\n },\r\n title: {\r\n text: 'Methane vs N₂O concentration growth',\r\n style: titleStyle\r\n },\r\n subtitle: {\r\n text: 'Source: Global Warming API',\r\n },\r\n colors: ['#008FFB', '#FF4560'],\r\n xaxis: {\r\n type: 'category',\r\n categories: res_df.greenhouse.category,\r\n tickAmount: 8,\r\n },\r\n yaxis: {\r\n title: {\r\n text: 'Concentration growth, %'\r\n },\r\n min: 100,\r\n max: Math.max(...res_df.greenhouse.methane.data.filter(filterNaN),\r\n ...res_df.greenhouse.nitrous.data.filter(filterNaN)) + 2,\r\n labels: {\r\n formatter: function (val) {\r\n return round(val);\r\n }\r\n }\r\n },\r\n annotations: {\r\n yaxis: [{\r\n y: 100,\r\n borderColor: '#000',\r\n label: {\r\n borderColor: '#000',\r\n style: {\r\n color: '#fff',\r\n background: '#000',\r\n },\r\n text: 'Minimal level',\r\n }\r\n }]\r\n },\r\n fill: {\r\n opacity: 1\r\n },\r\n tooltip: {\r\n y: {\r\n formatter: function (val, {dataPointIndex, series, seriesIndex, w}) {\r\n const v = w.config.series[seriesIndex].level[dataPointIndex],\r\n m = round(v - w.config.series[seriesIndex].min);\r\n\r\n return !filterNaN(val) ? 'No data' : `${val}% (${m}/${v} ppm)`;\r\n }\r\n }\r\n }\r\n },\r\n series: [{\r\n name: 'Methane growth',\r\n data: res_df.greenhouse.methane.data,\r\n level: res_df.greenhouse.methane.level,\r\n min: res_df.greenhouse.methane.min,\r\n }, {\r\n name: 'N₂O growth',\r\n data: res_df.greenhouse.nitrous.data,\r\n level: res_df.greenhouse.nitrous.level,\r\n min: res_df.greenhouse.nitrous.min,\r\n }]\r\n };\r\n\r\n return (\r\n <ReactApexChart options={opts.options} series={opts.series} type='line' height={400} />\r\n );\r\n}", "function youLost(){\r\nalert (\"You lost!\");\r\n losses++;\r\n $('#numLosses').text(losses);\r\n reset();\r\n}", "function mouseover( d ) {\n\t\t// set x and y location\n\t\tvar dotX = iepX( parseYear( d.data.year ) ),\n\t\t\tdotY = iepY( d.data.value ),\n\t\t\tdotBtu = d3.format( \".2f\" )( d.data.value ),\n\t\t\tdotYear = d.data.year,\n\t\t\tdotSource = d.data.name;\n\n\t\t// console.log( \"SOURCE:\", dotSource, index( lineColors( dotSource ) ) );\n\n\t\t// add content to tooltip text element\n\t\t/*tooltip.select( \".tooltip_text\" )\n\t\t\t.style( \"border-color\", lineColors( [ dotSource ] - 2 ) );*/\n\n\t\ttooltip.select( \".tooltip_title\" )\n\t\t\t.text( dotYear )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\ttooltip.select( \".tooltip_data\" )\n\t\t\t.text( dotBtu + \" \" + yUnitsAbbr );\n\n\t\ttooltip.select( \".tooltip_marker\" )\n\t\t\t.text( \"▼\" )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\t//Change position of tooltip and text of tooltip\n\t\ttooltip.style( \"visibility\", \"visible\" )\n\t\t\t.style( \"left\", dotX + ( chart_margins.left / 2 ) + \"px\" )\n\t\t\t.style( \"top\", dotY + ( chart_margins.top / 2 ) + \"px\" );\n\t} //mouseover", "function rawChart() {\r\n\tvar chart_title = \"VLMO\";\r\n\t$('#container').highcharts(\r\n\t\t\t{\r\n\t\t\t\tchart : {\r\n\t\t\t\t\tzoomType : 'xy'\r\n\t\t\t\t},\r\n\t\t\t\ttitle : {\r\n\t\t\t\t\ttext : chart_title\r\n\t\t\t\t},\r\n\t\t\t\tsubtitle : {\r\n\t\t\t\t\ttext : 'From ' + selectStartDate.format('yyyy-mm-dd')\r\n\t\t\t\t\t\t\t+ ' To ' + selectEndDate.format('yyyy-mm-dd')\r\n\t\t\t\t},\r\n\t\t\t\tcredits : {\r\n\t\t\t\t\thref : 'http://www.vervemobile.com',\r\n\t\t\t\t\ttext : 'vervemobile.com'\r\n\t\t\t\t},\r\n\t\t\t\txAxis : [ {\r\n\t\t\t\t\tcategories : categories,\r\n\t\t\t\t\t// tickmarkPlacement: 'on',\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\tenabled : false\r\n\t\t\t\t\t},\r\n\t\t\t\t\t// gridLineWidth: 1,\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\trotation : -45,\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\tvar value = this.value;\r\n\t\t\t\t\t\t\tvar now = new Date(value);\r\n\t\t\t\t\t\t\treturn now.format(\"mmm dd\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} ],\r\n\t\t\t\tyAxis : [ { // Primary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB '\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Clicks',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\topposite : true\r\n\r\n\t\t\t\t}, { // Tertiary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Impressions',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} ],\r\n\t\t\t\ttooltip : {\r\n\t\t\t\t\tshared : true,\r\n\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\tvar date_Value = new Date(this.x);\r\n\t\t\t\t\t\tvar s = '<b>' + date_Value.format('mmm d, yyyy')\r\n\t\t\t\t\t\t\t\t+ '</b>';\r\n\t\t\t\t\t\t$.each(this.points, function(i, point) {\r\n\t\t\t\t\t\t\tif (point.series.name == 'Impressions') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #DBA901;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Clicks') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #01A9DB;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Cta any') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #80FF00;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\ts += '<br/>' + point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatMoney(point.y);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn s;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tlegend : {\r\n\t\t\t\t\t// layout: 'vertical',\r\n\t\t\t\t\t// align: 'left',\r\n\t\t\t\t\t// x: 100,\r\n\t\t\t\t\t// verticalAlign: 'top',\r\n\t\t\t\t\t// y: 0,\r\n\t\t\t\t\t// floating: true,\r\n\t\t\t\t\tbackgroundColor : '#FFFFFF'\r\n\t\t\t\t},\r\n\t\t\t\tseries : [ {\r\n\t\t\t\t\tname : 'Clicks',\r\n\t\t\t\t\tcolor : '#01A9DB',\r\n\t\t\t\t\ttype : 'areaspline',\r\n\t\t\t\t\tyAxis : 1,\r\n\t\t\t\t\tdata : secondData\r\n\t\t\t\t}, {\r\n\t\t\t\t\tname : 'Impressions',\r\n\t\t\t\t\tcolor : '#DBA901',\r\n\t\t\t\t\ttype : 'column',\t\t\t\t\t\r\n\t\t\t\t\tdata : firstData\r\n\t\t\t\t} ]\r\n\t\t\t});\r\n\tchart = $('#container').highcharts();\r\n}", "function onMouseOut(d,i) {\n d3.selectAll(\".vz-halo-label\").remove();\n}", "function draw(account) {\r\n let htmlText = '';\r\n let analysisArea = document.getElementById('analysis');\r\n\r\n // First, remove all previous added data, \"2\" here saves div 'donotdeletetags'\r\n while (analysisArea.childNodes.length > 2){\r\n analysisArea.removeChild(analysisArea.childNodes[analysisArea.childNodes.length -1]);\r\n }\r\n\r\n // If there are no analysis data (ie no transactions), show error message\r\n if (account.analysis.length === 0){\r\n $('#linechart').hide(); // Hide the chart\r\n htmlText = '<h4>' + 'There are no transactions to analyze' + '<br />' +\r\n 'Enter your transactions to see your budget analysis'+ '</h4>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n // exit the funcation since there is nothing more to do\r\n return;\r\n }\r\n //Show the chart div since there are transactions to show\r\n $('#linechart').show();\r\n\r\n // Go over every analysis month group\r\n account.analysis.forEach( monthStat => {\r\n tempDateObj = new Date(monthStat.yymm+'-15');\r\n // Set the month title [Month name, Year. E.g April 2019]\r\n let monthTitle = getMonthName(tempDateObj.getMonth()) +\r\n ' ' + tempDateObj.getFullYear();\r\n\r\n // Add the title to the HTML page\r\n htmlText = '<h4>' + monthTitle + '</h4>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // Add the month's analysis data to the HTML page\r\n htmlText = '<p> Expense: ' + account.currency + monthStat.expense +'<br />'+\r\n 'income: ' + account.currency + monthStat.income + '<br />' +\r\n 'Month&apos;s balance: ' + account.currency +monthStat.balance + '<br />' +\r\n 'Numbrt of transactions: ' + monthStat.num + '<br />'+\r\n '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // Now we show the month's category analysis\r\n htmlText = '<h5>' + 'Expense' + '</h5>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // If there are no expense transactions, show error message\r\n if (Object.keys(monthStat.cat.expense).length === 0) {\r\n htmlText = '<p>' + 'No transactions under this type' + '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n }\r\n\r\n // Go over all expense transactions to draw the bar charts\r\n Object.keys(monthStat.cat.expense).forEach(category => {\r\n drawCategroy(monthStat, 'expense', category, analysisArea);\r\n });\r\n\r\n htmlText = '<h5>' + 'Income' + '</h5>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // If there are no income transactions, show error message\r\n if (Object.keys(monthStat.cat.income).length === 0) {\r\n htmlText = '<p>' + 'No transactions under this type' + '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n }\r\n\r\n // Go over all income transactions to draw the bar charts\r\n Object.keys(monthStat.cat.income).forEach(category => {\r\n drawCategroy(monthStat, 'income', category, analysisArea);\r\n });\r\n\r\n // Close the month's analysis data by adding a horizontal ruler\r\n htmlText = '<br /><hr />';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n });\r\n\r\n\r\n}", "function onMouseOver(d, i) {\n\n var fontSize = Math.round(viz.outerRadius() / 20);\n\n // Get the SVG defs tag\n var defs = viz.selection().selectAll(\"defs\");\n // Get the svg plot\n var plot = viz.selection().selectAll(\".vz-plot\");\n\n // Remove any elements left from last datatip in case mouseout didn't get them.\n defs.selectAll(\".vz-tip-path\").remove();\n plot.selectAll(\".my-tip\").remove();\n\n // Add the arc we need to show the page views\n defs.append(\"path\")\n .attr(\"class\", \"vz-tip-path\")\n .attr(\"id\", function (d, i) {\n return viz.id() + \"_tip_path_arc_1\";\n })\n .attr(\"d\", function () {\n return vizuly.svg.text.arcPath(viz.radiusScale()(d.y + d.y0) * 1.05, viz.thetaScale()(viz.x()(d)));\n });\n\n // Show the hour\n plot.append(\"text\")\n .attr(\"class\", \"my-tip\")\n .style(\"font-size\", (fontSize * .95) + \"px\")\n .style(\"text-transform\", \"uppercase\")\n .style(\"font-family\", \"Open Sans\")\n .style(\"fill-opacity\", .75)\n .style(\"fill\", function () {\n return theme.skin().labelColor\n })\n .append(\"textPath\")\n .attr(\"startOffset\", \"50%\")\n .style(\"overflow\", \"visible\")\n .attr(\"xlink:href\", function (d, i) {\n return \"#\" + viz.id() + \"_tip_path_arc_1\";\n })\n .text(function () {\n return viz.xAxis().tickFormat()(viz.x()(d));\n });\n\n // Show the page views\n plot.append(\"text\")\n .attr(\"class\", \"my-tip\")\n .attr(\"y\", -fontSize * 1.5)\n .style(\"font-size\", fontSize + \"px\")\n .style(\"fill\", function () {\n return theme.skin().labelColor\n })\n .text(function () {\n return viz.yAxis().tickFormat()(viz.y()(d))\n });\n\n //Show the page\n plot.append(\"text\")\n .attr(\"class\", \"my-tip\")\n .style(\"font-size\", fontSize + \"px\")\n .style(\"fill-opacity\", .75)\n .style(\"fill\", function () {\n return theme.skin().labelColor\n })\n .text(function () {\n return d.key;\n });\n}", "function mouseover(d) {\n const percentageString = `${d.value}`;\n const textForClosed = ' of them have been ';\n const textForOpen = ' of them are still ';\n\n const percentageStr = ' issues have been created by ';\n\n switch (d.name) {\n case 'open':\n d3.select('#percentage')\n .text(d.value);\n d3.select('#info-text-nbIssues')\n .text(textForOpen)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(`${d.name}ed`);\n break;\n case 'closed':\n d3.select('#percentage')\n .text(d.value);\n d3.select('#info-text-nbIssues')\n .text(textForClosed)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(d.name);\n break;\n default:\n d3.select('#percentage')\n .text(percentageString);\n d3.select('#info-text-nbIssues')\n .text(percentageStr)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(`${d.name}.`);\n }\n\n d3.select('#explanation')\n .style('top', '240px');\n\n const sequenceArray = getAncestors(d);\n updateBreadcrumbs(sequenceArray, percentageString);\n\n // Fade all the segments.\n d3.selectAll('path')\n .style('opacity', 0.3);\n\n // Then highlight only those that are an ancestor of the current segment.\n vis.selectAll('path')\n .filter(node => (sequenceArray.indexOf(node) >= 0))\n .style('opacity', 1);\n}", "function displayLosses() {\n $('#losses').text(\"Losses: \" + losses);\n}", "function handle_mouseover(d, $this, show_click_directive=false) {\n // Setting all country wage groups to translucent\n $(\".country-wage-group\").attr(\"opacity\", 0.2);\n // Resetting the group currently being hovered over to opaque\n d3.select($this).attr(\"opacity\", 1);\n\n var tooltip = d3.select(\"#wageGapTooltip\");\n\n // Setting the position for tooltip\n tooltip.style(\"top\", (event.pageY+10)+\"px\").style(\"left\", (event.pageX+10)+\"px\");\n\n // Setting the content for tooltip\n $(\"#wageGapTooltip .meta\").hide();\n if (show_click_directive) {\n $(\"#wageGapTooltip .country-name\").show();\n tooltip.select(\".country-name-text\").html(d[\"Country\"]);\n $(\"#wageGapTooltip .click-directive\").show();\n } else {\n $(\"#wageGapTooltip .occupation-name\").show();\n tooltip.select(\".occupation-name-text\").html(d[\"Occupation\"]);\n $(\"#wageGapTooltip .click-directive\").hide();\n }\n tooltip.select(\".male-wage-text\").html(\"$\" + d[\"Male\"].toFixed(2));\n tooltip.select(\".female-wage-text\").html(\"$\" + d[\"Female\"].toFixed(2));\n tooltip.select(\".difference-text\").html(\"$\" + (d[\"Female\"] - d[\"Male\"]).toFixed(2));\n\n // Displaying the relevant indicator\n $(\"#wageGapTooltip .wage-gap .indicator\").hide();\n if(d[\"Female\"] - d[\"Male\"] > 0){\n $(\"#wageGapTooltip .wage-gap .increase\").show();\n } else {\n $(\"#wageGapTooltip .wage-gap .decrease\").show();\n }\n\n // Setting the tooltip as visible\n return tooltip.style(\"visibility\", \"visible\");\n }", "function drawTooltip() {\n \n console.log(d3.mouse(this));\n \n \n //console.log(Math.floor(xScale.invert(d3.mouse(this)[0])))\n mYear = Math.floor(xScale.invert(d3.mouse(this)[0])) + 1;\n\n cYear = dataset.year[0];\n for (i = 0; i < dataset.year.length; i++) {\n if (Math.abs(cYear - mYear) > Math.abs(dataset.year[i] - mYear)) {\n cYear = dataset.year[i];\n }\n\n //console.log(\"myear \" + Math.floor(xScale.invert(d3.mouse(this)[0])))\n //console.log(\"cyear \" + cYear);\n\n\n }\n\n\n\n\n tooltipLine.attr('stroke', 'black')\n .attr('x1', xScale(cYear))\n .attr('x2', xScale(cYear))\n .attr('y1', 0)\n .attr('y2', height);\n\n\n\n var f2s = d3.format('.2s');\n var index = dataset.year.indexOf(cYear);\n console.log(\"x: \"+ d3.event.pageX + \"y: \" + d3.event.pageY);\n tooltipBox\n .style('display', 'inline')\n .html(\"Year : \" + cYear + \" <br/>\" + \"Total: \" + f2s(data[index].population) + \"<br/>\" + \"Non Local: \" + f2s(dataNLocal[index].population) + \"<br/>\" + \"Local: \" + f2s(dataLocal[index].population))\n //.style('left', d3.event.pageX - 34)\n //.style('top', d3.event.pageY - 12)\n .style('left', d3.mouse(this)[0] -34 )\n .style('top', d3.mouse(this)[1] -12)\n }", "function loss(){\n losses ++;\n alert('You did not win, loser!');\n $('.loss-score').text(losses);\n reset();\n}", "function show(totalSale,totalTarget){\n var body = d3.select('body')\n .style('text-align', 'center')\n .style('font-weight', 'normal');\n\n mod1 = d3.select('#compare')\n .append('svg')\n .attr('width', width)\n .attr('height', height)\n .style('background-color', '#E5E5E5');\n\n // Show the main and sub title\n var ltTitle1 = mod1.append('text')\n .style('font-size', '25px')\n .style('text-anchor', 'start')\n .style('font-weight', 'bold')\n .attr('transform', 'translate(5,20)')\n .text(mainTitle);\n\t\n var ltTitle2 = mod1.append('text')\n .style('font-size', '15px')\n .style('text-anchor', 'start')\n .attr('transform', 'translate(140,20)')\n .style('font-weight', 'normal')\n .text(subTitle);\t\n\n // Show the totalSale\n var title = mod1.append('text')\n .attr('class', 'title')\n .attr('transform', 'translate('+ 300 +', '+ 160 + ')')\n .style('font-size', '75px')\n .style('text-anchor', 'middle')\n .text('$'+toThousands(totalSale));\n\n //set the rect\t\t\n var rect = mod1.append('rect')\n .attr('height',60)\n .attr('width',340)\n .attr('x',130)\n .attr('y',200);\n\t\t\t\n //Judge the color of the rect\t\n if (totalSale < totalTarget) {\n\trect.attr('fill', 'red');\n } else {\n\trect.attr('fill', 'green');\n }\t\n\n //caluation of the difference\n var contract = totalSale - totalTarget;\t\n\t\n //show the difference\n var countTitle = mod1.append('text')\n .attr('class', 'title')\n .attr('transform', 'translate('+ 300 +', '+ 240 + ')')\n .style('font-size', '35px')\n .style('text-anchor', 'middle')\n .style('fill', 'white');\t\n\t\t\t\t\n //caluation of the percent\t\t\t\t\n var percent = Math.round((Math.abs(contract)/totalTarget).toFixed(2) * 100);\t\n if (contract < 0) {\n\tcountTitle.text('\\u25BC'+'$'+toThousands(Math.abs(totalTarget - totalSale))+'('+ percent +'%)');\n }\n else {\n\tcountTitle.text('\\u25B2'+'$'+toThousands(Math.abs(totalTarget - totalSale))+'('+ percent+'%)');\n }\t\n}", "function addSpentText(pnode,total,income,transacts) {\n var x = document.createElement('p');\n pnode.parentNode.appendChild(x);\n\n var link=document.createElement('a');\n x = document.createTextNode('Total spent: '+makeThousands(String(total))+' Meat ');\n link.appendChild(x);\n link.setAttribute(\"title\", 'over '+transacts+' transaction'+((transacts==1)? '': 's'));\n pnode.parentNode.appendChild(link);\n var link=document.createElement('a');\n link.addEventListener(\"click\", resetSpent, true);\n link.setAttribute(\"total\", total);\n link.setAttribute(\"title\", 'wipe history and set spent amount');\n x = document.createTextNode('[reset]');\n link.appendChild(x);\n pnode.parentNode.appendChild(link);\n\n x = document.createTextNode(' ');\n pnode.parentNode.appendChild(x);\n link=document.createElement('a');\n link.addEventListener(\"click\", addSpent, true);\n link.setAttribute(\"title\", 'add an additional expense');\n x = document.createTextNode('[add]');\n link.appendChild(x);\n pnode.parentNode.appendChild(link);\n\n x = document.createTextNode(' ');\n pnode.parentNode.appendChild(x);\n link=document.createElement('a');\n link.addEventListener(\"click\", removeSpent, true);\n link.setAttribute(\"title\", 'remove the last added expense');\n x = document.createTextNode('[remove]');\n link.appendChild(x);\n pnode.parentNode.appendChild(link);\n\n //figure out profit\n var profit = income-total;\n // figure out ratio\n var ratio = (total==0) ? 0 : profit*100/total;\n if (ratio==0)\n ratio=' Meat';\n else\n ratio=' Meat ('+ratio.toFixed(1)+'%)';\n\n x = document.createElement('p');\n pnode.parentNode.appendChild(x);\n x = document.createTextNode('Profit: ');\n pnode.parentNode.appendChild(x);\n\n x = document.createElement('b');\n if (profit<0) {\n profit=makeThousands(String(-profit));\n x.appendChild(document.createTextNode('-'+profit+ratio));\n var y = document.createElement('font');\n y.setAttribute('color','red');\n y.appendChild(x);\n x=y;\n } else {\n profit=makeThousands(String(profit));\n x.appendChild(document.createTextNode(profit+ratio));\n }\n pnode.parentNode.appendChild(x);\n}" ]
[ "0.6426414", "0.61706126", "0.60711235", "0.5904209", "0.58985", "0.5892405", "0.5852378", "0.5817237", "0.572569", "0.57182544", "0.5711737", "0.5648951", "0.56489205", "0.5621979", "0.5607887", "0.5598327", "0.55813", "0.55786043", "0.5571478", "0.5550848", "0.5549257", "0.5513899", "0.55120164", "0.5504874", "0.5498576", "0.5485454", "0.5480908", "0.54793054", "0.54649585", "0.54580945", "0.5455714", "0.5440312", "0.5425287", "0.54195", "0.5418124", "0.54140604", "0.53881454", "0.5387967", "0.5385948", "0.5375709", "0.5372688", "0.53668296", "0.5360145", "0.53598577", "0.5342242", "0.5340253", "0.5337527", "0.53333753", "0.53279006", "0.5327877", "0.5325605", "0.532122", "0.5314949", "0.53127176", "0.53121394", "0.53018785", "0.52978694", "0.5291781", "0.5287595", "0.52859294", "0.52853864", "0.52817065", "0.528128", "0.52757597", "0.5272257", "0.5269506", "0.5268564", "0.5267866", "0.5261097", "0.5259992", "0.5259403", "0.5258931", "0.52486724", "0.5246154", "0.5240367", "0.5239837", "0.5233516", "0.5224295", "0.52211183", "0.52205914", "0.52205914", "0.5213902", "0.5194793", "0.5190122", "0.51840645", "0.517887", "0.5176192", "0.5175478", "0.51743895", "0.51701957", "0.51637954", "0.5162355", "0.5150738", "0.5150235", "0.51491445", "0.51450485", "0.5143657", "0.51361966", "0.51361316", "0.512928", "0.51289415" ]
0.0
-1
This function shows lead count and total deal amount in pipeline on mouseover
function showLeadCount(leadCount) { var getDiv = document.getElementById("hoverLead"); getDiv.innerText = leadCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElement(\"DIV\");\n wonCountLabel.className = \"wonLostLabel\";\n wonCountLabel.appendChild(document.createTextNode(saleCount));\n $('#wonOpp').append(wonCountLabel); \n}", "function showLeadAmount(leadAmount) {\n var getdiv = document.getElementById(\"hoverLead\");\n getdiv.innerText = \"\";\n var leadAmtLabel = document.createElement(\"DIV\");\n leadAmtLabel.className = \"chartBarLabel\";\n leadAmtLabel.appendChild(document.createTextNode(\"$\" + leadAmount.toLocaleString()));\n $('#hoverLead').append(leadAmtLabel);\n}", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function link_onMouseOver(e,d,i) {\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = \"$\" + d3.format(\",.0f\")(viz.value()(d.data));\n var date = d.data.Month + \"/\" + d.data.Day + \"/\" + d.data.Year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Received: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function showOppCount(oppCount) { \n var getDiv = document.getElementById(\"hoverOpp\");\n getDiv.innerText = oppCount; \n}", "function arc_onMouseOver(e,d,i) {\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n links.each(function (d) {\n total+= viz.value()(d.data);\n });\n\n total = \"$\" + d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"POLITICAL ACTION COMMITTEE\", d.data.values[0].CMTE_NM,\"Total Donated: \" + total);\n}", "function displayTotal() {\n\tscreen1.bugCount.html(prettyNumber(Math.round(state.larvae)));\n\tscreen1.larvaePerSec.html(prettyNumber(state.lps));\n}", "function link_onMouseOver(e,d,i) {\n stopAnnimation();\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = d3.format(\",.0f\")(viz.value()(d.data));\n var date = '';\n // var date = d.data.month + \"/\" + d.data.day + \"/\" + d.data.year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Sentiment index: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function handleMouseOver(d, i) {\n\nd3.selectAll(\".visualCircle\").transition()\n .duration(200)\n .style(\"opacity\", 1)\n .attr(\"fill\", \"rgba(255,255,255,0.8)\")\n .attr(\"r\", circleRBefore);\n\nd3.selectAll(\".visualLabel\").transition()\n .duration(200)\n .style(\"opacity\", 0);\n\nd3.select(\"#circle_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 0.2)\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .attr(\"r\", circleRAfter);\n\nd3.select(\"#text_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 1);\n \ndocument.getElementById(\"type680target\").innerHTML = \"<h4>\" + itemTitles[this.id] + \"</h4><hr class='light' style='margin-left: 0px;'><p class='text-justify'>\" + itemDescriptions[this.id] + \"</p>\";\n\n}", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function handleMouseover(d,i) {\n var placeNames = []\n for(n=0;n<adminLabelLvls.length;n++) {\n placeNames.push( toTitleCase( d.properties[adminLabelLvls[n]] ) );\n }\n var tooltipText = \"<small><span class='place-name'>\" + placeNames.join(\", \") + \"</span>\";\n var dataKey = d3.select(this).attr('data-response'); \n if(dataKey !== null) {\n d.properties.response.forEach(function(item,itemIndex){\n if(item.key == dataKey) {\n tooltipText += \" <br> Distributions: \" + commas(item.value.count) +\n \" <br> Items distributed: \" + commas(item.value.total_number);\n }\n });\n } \n tooltipText += \"</small>\";\n $('#tooltip').html(tooltipText);\n}", "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "function showOppAmount(oppAmount) {\n var getdiv = document.getElementById(\"hoverOpp\");\n getdiv.innerText = \"\";\n var oppAmtLabel = document.createElement(\"DIV\");\n oppAmtLabel.className = \"chartBarLabel\";\n oppAmtLabel.appendChild(document.createTextNode(\"$\" + oppAmount.toLocaleString()));\n $('#hoverOpp').append(oppAmtLabel);\n}", "function node_onMouseOver(e,d,i) {\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = \"$\" + d3.format(\",.2f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n createDataTip(x + d.r, y + d.r + 25,congress, d.values[0].CAND_NAME,\"Total Received: \" + total);\n}", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "function drillTable(orgName, contactPerson, contactNumber, email, amount, type, total) {\n // Check if some of the non required fields are blank\n if (contactPerson == \"null\") {\n contactPerson = \"-\";\n }\n if (contactNumber == \"null\") {\n contactNumber = \"-\";\n }\n if (email == \"null\") {\n email = \"-\";\n }\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeSummary\").hide();\n // Shows the pipeline summary\n $(\"#pipeDrillDown\").fadeIn(500, function () {\n var getDiv = document.getElementById(\"pipeSummary\");\n getDiv.innerText = \"Total \" + type + \" amount is : $\" + total.toLocaleString();\n $(\"#pipeSummary\").show();\n }); \n $(\"#drillTable\").show();\n $(\"#drillTable\").append(\"<div class='clear'>&nbsp;</div> <div class='reportLabel'>\" + orgName + \"</div> <div class='reportLabel'> \" + contactPerson + \"</div> <div class='reportLabel'> \" + contactNumber + \"</div> <div class='reportLabel'> \" + email + \"</div> <div class='amountLabel' > $\" + amount.toLocaleString() + \"</div>\");\n \n}", "function showDataPointCount() {\n $('.dataPoints').html('<span class=\"bold\">' + dataPointCounter + ' p/s</span>');\n dataPointCounter = 0;\n}", "function showDetails() {\n\n var z = wrap.style('zoom') || 1\n\n if (z === 'normal') {\n z = 1\n } else if (/%/.test(z)) {\n z = parseFloat(z) / 100\n }\n\n var x = d3.mouse(this)[0] / z\n var tx = Math.max(0, Math.min(options.width + options.margin.left, x))\n\n var i = d3.bisect(lineData.map(function(d) {\n return d.startTime\n }), xScale.invert(tx - options.margin.left))\n var d = lineData[i]\n var open\n var high\n var low\n var close\n var volume\n var vwap\n\n if (d) {\n open = d.open.toPrecision(5)\n high = d.high.toPrecision(5)\n low = d.low.toPrecision(5)\n close = d.close.toPrecision(5)\n vwap = d.vwap.toPrecision(5)\n volume = d.baseVolume.toFixed(2)\n\n var baseCurrency = base.currency\n var chartDetails = div.select('.chartDetails')\n chartDetails.html('<span class=\"date\">' +\n parseDate(d.startTime.local(), chartInterval) +\n '</span><span><small>O:</small><b>' + open + '</b></span>' +\n '<span class=\"high\"><small>H:</small><b>' + high + '</b></span>' +\n '<span class=\"low\"><small>L:</small><b>' + low + '</b></span>' +\n '<span><small>C:</small><b>' + close + '</b></span>' +\n '<span class=\"vwap\"><small>VWAP:</small><b>' + vwap + '</b></span>' +\n '<span class=\"volume\"><small>Vol:</small><b>' + volume +\n ' ' + baseCurrency + '</b></span>' +\n '<span><small>Ct:</small><b>' + d.count + '</b></span>')\n .style('opacity', 1)\n\n hover.transition().duration(50)\n .attr('transform', 'translate(' + xScale(d.startTime) + ')')\n focus.transition().duration(50)\n .attr('transform', 'translate(' +\n xScale(d.startTime) + ',' +\n priceScale(d.close) + ')')\n horizontal.transition().duration(50)\n .attr('x1', xScale(d.startTime))\n .attr('x2', options.width)\n .attr('y1', priceScale(d.close))\n .attr('y2', priceScale(d.close))\n\n hover.style('opacity', 1)\n horizontal.style('opacity', 1)\n focus.style('opacity', 1)\n }\n }", "function addCount() {\n count++;\n $('.count').html(count);\n }", "function node_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n var strSyntax = d.values[0].PTY == 'positive' ? 'Sentiment index: +' : 'Sentiment index: -'\n\n createDataTip(x + d.r, y + d.r + 25, d.values[0].CAND_ID, d.values[0].CAND_NAME, strSyntax + total);\n}", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "function showTotalPassengerCount(){\n\t$('.passenger-count').html(passenger_count)\n}", "function getpanierItemsCount(){\n\n\ttotal=calculertotal();\n\t(document.querySelector(\"#total\")).innerHTML=(\"Total a payer \"+total+\" DH\");\n}", "function onMouseOver(d, i) {\n\t d3.select(this).attr('class', 'highlight');\n\t d3.select(this)\n\t .transition()\n\t .duration(400)\n\t .attr('width', xScale.bandwidth() + 5)\n\t .attr(\"y\", function(d) { return yScale(d.popularity) - 10; })\n\t .attr(\"height\", function(d) { return innerHeight1 - yScale(d.popularity) + 10; });\n\n\t g.append(\"text\")\n\t .attr('class', 'val') // add class to text label\n\t .attr('x', function() {\n\t return xScale(d.artists);\n\t })\n\t .attr('y', function() {\n\t return yScale(d.popularity) - 15;\n\t })\n\t .text(function() {\n\t return d.popularity; // Value of the text\n\t });\n\t}", "function mouseover(d) {\n\n var percentage = (100 * d.value / totalSize).toPrecision(3);\n var percentageString = \" (\" + formatNumber(percentage) + \"%)\";\n var priceString = \"$\" + formatNumberNoDec(Math.round(d.value,2));\n if (percentage < 0.1) {\n percentageString = \"< 0.1%\";\n }\n\n d3.select(\"#percentage\")\n .text(percentageString);\n \n var detail = \" \" ;\n if (d.parent.name != \"root\"){\n\n var l2 = d.parent;\n if (l2.parent.name != \"root\"){\n var l1 = l2.parent;\n\n if (l1.parent.name != \"root\"){\n var l3 = l1.parent;\n detail += \" fue adquirido mediante \"+ toTitleCase(l1.name) + \" en \" + toTitleCase(l2.name) + \" a \" + l3.name + \" para \" + d.name ;\n }\n else {\n //tipo de compra de un proveedor para un item.\n detail += \" fue adquirido mediante \"+ toTitleCase(l1.name) + \" en \" + toTitleCase(l2.name) + \" a \" + d.name ;\n }\n }else {\n //tipo de compra de un proveedor.\n detail += \" adquirido mediante \"+ toTitleCase(l2.name) + \" en \" + toTitleCase(d.name); \n }\n \n }else {\n //tipo de compra.\n detail += \"fue adquirido mediante \"+ toTitleCase(d.name);\n }\n \n insertLinebreaks(d3.select('svg text.label'), detail);\n d3.select('svg text.price').text(priceString);\n d3.select('svg text.percentage').text(percentageString);\n \n\n var sequenceArray = getAncestors(d);\n //updateBreadcrumbs(sequenceArray, percentageString);\n\n // Fade all the segments.\n d3.selectAll(\"path\")\n .style(\"opacity\", 0.3);\n\n // Then highlight only those that are an ancestor of the current segment.\n vis.selectAll(\"path\")\n .filter(function(node) {\n return (sequenceArray.indexOf(node) >= 0);\n })\n .style(\"opacity\", 1);\n\n $('#chart').animate({ \n scrollLeft: 200\n }, 800);\n}", "function handleHoverEnter(){\n $(\".likeBtn\").html(likes + \" Likes\");\n }", "function mouseover(d)\r\n\t\t\t{\r\n\t\t\t\t$(\"#col2\").text(\"\");\r\n\t\t\t\tcontent.append(\"div\").attr(\"id\",\"iw-container\").append(\"div\").attr(\"class\",\"iw-title\").append(\"i\").attr(\"class\",\"fa fa-info-circle\")\r\n\t\t\t\t.attr(\"style\",\"padding-right:20px;font-weight:bold;\")\r\n \t\t\t.text(\"\t\"+d.name)// + \" - 2013 appropriations: \" + d.appropriation13 + \" - Which was a \" + d.percentChange13 + \"% change of the previous year.\")\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Orders: \" + format(d.appropriation14/10))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" New Customers: \" + format((d.appropriation13)))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Product Lines: \" + format((d.appropriation12)))\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.attr(\"id\", \"annotate\")\r\n\t\t\t\t.text(d.annotation)\r\n\t\t\t\tif (d.annotation2 != null)\r\n\t\t\t\t{\r\n\t\t\t\tcontent1.append(\"br\")\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.text(d.annotation2);\r\n\t\t\t\t}\r\n\r\n \t\t\t}", "function updateTally(outcome) {\n totalPoints += parseInt(outcome);\n \n // Draw tally using HTML\n tally = display_element.querySelector(\".tally\");\n tally.innerHTML = `Total Points: ${totalPoints}`\n \n }", "function showDetail(event, key, amount, count, percent) {\n\n // show tooltip with information from the __data__ property of the element\n var x_hover = 0;\n var y_hover = 0;\n\n var content = \"<b>\" + key + \"</b><br/>\";\n\n if (amount != null) content += \"<b>Amount: </b>\" + amount + \"<br/>\";\n if (count != null) content += \"<b>Count: </b>\" + count + \"<br/>\";\n if (percent != null) content += \"<b>Percent: </b>\" + percent + \"<br/>\";\n\n var tooltipWidth = parseInt(tooltip.style('width'));\n var tooltipHeight = parseInt(tooltip.style('height'));\n var classed,notClassed;\n \n if (event.pageX > document.body.clientWidth / 2) {\n x_hover = tooltipWidth + 30;\n classed = 'right';\n notClassed = 'left';\n } else {\n x_hover = -30;\n classed = 'left';\n notClassed = 'right';\n }\n \n // y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight + 4) : event.pageY - tooltipHeight / 2;\n y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight - 40) : event.pageY - tooltipHeight - 40;\n\n return tooltip\n .classed(classed,true)\n .classed(notClassed,false)\n .style({\n \"visibility\": \"visible\",\n \"top\": y_hover + \"px\",\n \"left\": (event.pageX - x_hover) + \"px\"\n })\n .html(content);\n}", "function arc_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n var num = 0;\n var average = 0;\n links.each(function (d) {\n num ++;\n total+= viz.value()(d.data);\n });\n\n total = d3.format(\",.0f\")(total);\n\n average = d3.format(\",.0f\")(total / num);\n // console.log('number: ' + num);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"NEWS SOURCE\", d.data.values[0].CMTE_NM,\"Sentiment index: \" + total);\n}", "mouseover(d) {\n var conType = _.has(d.data, \"conversion_type\") ? d.data.conversion_type : \"\";\n\n var percentage = (100 * d.value / this.totalSize).toPrecision(3);\n var percentageString = percentage + \"%\" + ' - ' + d.value;\n if (percentage < 0.5) {\n percentageString = \"< 1.00 %\";\n }\n var sequenceArray = d.ancestors().reverse();\n sequenceArray.shift();\n var last = typeof (sequenceArray[sequenceArray.length - 1]) !== \"undefined\" ? sequenceArray[sequenceArray.length - 1] : {};\n var converted = 0;\n var convertedAmmount = 0;\n //console.log(sequenceArray, d.value, percentage);\n if (typeof (last.children) !== \"undefined\") {\n last.children.forEach(function (co) {\n if (co.data.name == \"Conversion\") {//TODO: Adjust to nwe conversion\n converted = (100 * co.value / last.value).toPrecision(2);\n convertedAmmount = co.value;\n }\n });\n }\n this.updateDescription(sequenceArray, d.value, percentage, converted, convertedAmmount);\n this.updateBreadcrumbs(sequenceArray, d.value, percentage);\n // Fade all the segments.\n d3.selectAll(\"path\")\n .style(\"opacity\", 0.7);\n // Then highlight only those that are an ancestor of the current segment.\n d3.selectAll(\"path\")\n .filter(function (node) {\n return (sequenceArray.indexOf(node) >= 0);\n })\n .style(\"opacity\", 1);\n }", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n if(row.votecount != \"\") {\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\" (\"+row.percentage+\")\" + \"</li>\"\n }\n\t });\n\t return text;\n\t}", "function handleMouseOverBubble(d, i) {\n d3.select(this).attr(\"r\", d.radius * 1.2);\n\n document.getElementById(\"team-details\").classList.remove(\"closed\");\n document.getElementById(\"td-team-name\").innerHTML = d.Team;\n document.getElementById(\"td-test-status-year\").innerHTML =\n \"Started in \" + d.StartYear;\n\n document.getElementById(\"td-team-matches\").innerHTML = d.Mat.toLocaleString();\n document.getElementById(\"td-team-won\").innerHTML = d.Won.toLocaleString();\n document.getElementById(\"td-team-lost\").innerHTML = d.Lost.toLocaleString();\n document.getElementById(\"td-team-undecided\").innerHTML =\n d.Undecided.toLocaleString();\n document.getElementById(\"row-runs\").style.display = \"none\";\n}", "function handleMouseOver(d, i) { // Add interactivity\n\n // Specify where to put label of text\n svg.append(\"text\")\n .attr(\"id\", \"t\" + d.date.getTime() + \"-\" + d.time + \"-\" + i)\n .attr(\"x\", function() { return x(d.date) + left; })\n .attr(\"y\", function() { return y(d.time) + top - 5; })\n .attr(\"font-size\", \"12px\")\n .text(function() {\n var month = d.date.getMonth() + 1;\n var day = d.date.getDate();\n var year = d.date.getFullYear();\n var toPrintDate = month + \"/\" + day + \"/\" + year;\n return d.name + \": \" + toPrintDate + \", \" + ticks(d.time); // Value of the text\n });\n }", "function showLostSaleCount(lostCount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostCountLabel = document.createElement(\"DIV\");\n lostCountLabel.className = \"wonLostLabel\";\n lostCountLabel.appendChild(document.createTextNode(lostCount));\n $('#lostOpp').append(lostCountLabel);\n}", "function hoverPanelRelated () {\n $('.browseview .relatedContainer .panel').on({\n mouseenter: function () {\n $(this).children().css({'background-color': '#68C3A3', 'color': 'black', 'transition': 'all 0.3s ease', '-webkit-transform': 'scale(1.05)', '-ms-transform': 'scale(1.05)', 'transform': 'scale(1.05)'})\n },\n mouseleave: function () {\n $(this).children().css({'background-color': '#f5f5f5', 'color': '#717f86', 'transition': 'all 0.3s ease', '-webkit-transform': 'scale(1.0)', '-ms-transform': 'scale(1.0)', 'transform': 'scale(1.0)'})\n },\n click: function () {\n window.location = $(this).children('.viewbutton').attr('href')\n }\n })\n }", "function handle_mouseover(d, $this, show_click_directive=false) {\n // Setting all country wage groups to translucent\n $(\".country-wage-group\").attr(\"opacity\", 0.2);\n // Resetting the group currently being hovered over to opaque\n d3.select($this).attr(\"opacity\", 1);\n\n var tooltip = d3.select(\"#wageGapTooltip\");\n\n // Setting the position for tooltip\n tooltip.style(\"top\", (event.pageY+10)+\"px\").style(\"left\", (event.pageX+10)+\"px\");\n\n // Setting the content for tooltip\n $(\"#wageGapTooltip .meta\").hide();\n if (show_click_directive) {\n $(\"#wageGapTooltip .country-name\").show();\n tooltip.select(\".country-name-text\").html(d[\"Country\"]);\n $(\"#wageGapTooltip .click-directive\").show();\n } else {\n $(\"#wageGapTooltip .occupation-name\").show();\n tooltip.select(\".occupation-name-text\").html(d[\"Occupation\"]);\n $(\"#wageGapTooltip .click-directive\").hide();\n }\n tooltip.select(\".male-wage-text\").html(\"$\" + d[\"Male\"].toFixed(2));\n tooltip.select(\".female-wage-text\").html(\"$\" + d[\"Female\"].toFixed(2));\n tooltip.select(\".difference-text\").html(\"$\" + (d[\"Female\"] - d[\"Male\"]).toFixed(2));\n\n // Displaying the relevant indicator\n $(\"#wageGapTooltip .wage-gap .indicator\").hide();\n if(d[\"Female\"] - d[\"Male\"] > 0){\n $(\"#wageGapTooltip .wage-gap .increase\").show();\n } else {\n $(\"#wageGapTooltip .wage-gap .decrease\").show();\n }\n\n // Setting the tooltip as visible\n return tooltip.style(\"visibility\", \"visible\");\n }", "function printTotalCost() {\n $(\".totalCost span\").append(\"<p> $\"+totalCost+ \"</p>\");\n }", "function handleMouseover(d) {\n div.style(\"opacity\", 0.9)\n .style(\"left\", (d3.event.pageX + padding/2) + \"px\")\n .style(\"top\", d3.event.pageY + \"px\")\n .html(\"<p>\" + d.Name + \",&nbsp;\" + d.Nationality + \"</p><p>Year:\" + d.Year + \"&nbsp;&nbsp;&nbsp;Time:\" + timeFormat(d.Time) + \"&nbsp;&nbsp;&nbsp;Place:\" + d.Place + \"</p>\" + (d.Doping ? (\"<br><p>\" + d.Doping +\"</p\") : \"\"));\n}", "function mouseoverNode(d){\n\t\n\tvar disVal;\n\tif(showFlowIn){\n\t\tdisVal = \"Flow In Value: \"+d.flowInto;\n\t}\n\telse{\n\t\tdisVal = \"Flow Out Value: \"+d.flowOut;\n\t}\n\n\tdocument.getElementById(\"nodeval\").textContent = disVal;\n}", "function MemberReview(){\n $('.progress-rv').each(function (index,value){\n var datavalue=$(this).attr('data-value'),\n point=datavalue*10;\n $(this).append(\"<div style='width:\"+point+\"%'><span>\"+datavalue+\"</span></div>\")\n })\n }", "function render_total(data){\n\t return '<a href=\"\">'+data+' pessoa(s)</a>';\n\t}", "displayLives() {\r\n console.log(`\\nLives left: ${this.lives}`);\r\n }", "function calc(e){\n $el = $(this).find(' > .wrap');\n el = $el[0];\n $carousel = $el.parent();\n $indicator = $el.prev('.indicator');\n\n nextMore = prevMore = false; // reset\n\n containerWidth = el.clientWidth;\n scrollWidth = el.scrollWidth; // the \"<ul>\"\" width\n padding = 0.2 * containerWidth; // padding in percentage of the area which the mouse movement affects\n posFromLeft = $el.offset().left;\n stripePos = e.pageX - padding - posFromLeft;\n pos = stripePos / (containerWidth - padding*2);\n scrollPos = (scrollWidth - containerWidth ) * pos;\n \n if( scrollPos < 0 )\n scrollPos = 0;\n if( scrollPos > (scrollWidth - containerWidth) )\n scrollPos = scrollWidth - containerWidth;\n \n $el.animate({scrollLeft:scrollPos}, 200, 'swing');\n \n if( $indicator.length )\n $indicator.css({\n width: (containerWidth / scrollWidth) * 100 + '%',\n left: (scrollPos / scrollWidth ) * 100 + '%'\n });\n\n clearTimeout(animated);\n animated = setTimeout(function(){\n animated = null;\n }, 200);\n\n return this;\n }", "handleMouseOver (vis, event, d) {\n // console.log(\"hover over\", d);\n let leftPosition = event.pageX + 10 + \"px\";\n if (window.innerWidth - event.pageX < 500) {\n leftPosition = event.pageX - 300 + \"px\";\n }\n let census = vis.insights[d.count];\n let censusCount = d.count;\n let peopleCount = census ? census.total : 0;\n let censusPercent = vis.legendData.find(c => c.censusCount == d.count);\n censusPercent = censusPercent? censusPercent.censusPercent : 0;\n if ((d.count === 0 && vis.filters.length === 0) || !census) {\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n </div>`\n );\n } else if (d.count === 0) {\n let tipText = `<div>${peopleCount.toLocaleString(\"en\")} people with filter attribute</div> `;\n vis.filters.forEach(f => {\n tipText += `<div>${v2CheckBoxGuide[f].title}.</div> `;\n })\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n ${tipText}\n </div>`\n );\n } else {\n // They show up in a census\n let topPob = d3.greatest(census.pobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topAgeGroup = d3.greatest(census.ageMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCensus = d3.greatest(census.censusMap, (a, b) => d3.ascending(a[1], b[1]));\n let topGender = d3.greatest(census.genderMap, (a, b) => d3.ascending(a[1], b[1]));\n let topColor = d3.greatest(census.colorMap, (a, b) => d3.ascending(a[1], b[1]));\n let topJob = d3.greatest(census.jobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCounty = d3.greatest(census.countyMap, (a, b) => d3.ascending(a[1], b[1]));\n // console.log(topPob,topAgeGroup, topCensus );\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census</h5>\n <div> The ${peopleCount.toLocaleString(\"en\")} people in ${censusCount} census are most likely</div>\n <div> to be born in ${topPob[0]} living in ${upperCaseFirstLetters(topCounty[0])}, Nevada. </div> \n <div> Their first census was at age ${topAgeGroup[0]} in year ${topCensus[0]}. </div> \n <div> Gender \"${topGender[0]}\", \"color ${topColor[0]}\",\n and job \"${upperCaseFirstLetters(topJob[0])}\".</div> \n </div>`\n );\n }\n }", "function howManyGoals(player) {\n return player.eplGoals; // <== Highlight\n}", "function mouseover(d) {\n var shiftX = 10;\n var shiftY = 20;\n\n var mouseCoords = d3.mouse(this);\n d3.select(\"#tooltip\")\n .style(\"left\", function(d) {\n return mouseCoords[0] + shiftX + \"px\"\n })\n .style(\"top\", function(d) {\n return mouseCoords[1] + shiftY + \"px\"\n })\n .html(function() {\n if (d.energy[1990] == null || d.energy[currentYear][\"All products\"] == 0) return d.name + \": No data\";\n\n var all = d.energy[currentYear][\"All products\"];\n var renewable = d.energy[currentYear][\"Renewable energies\"];\n var per = renewable / all;\n\n hoverArrow(per);\n\n return \"<b>\" + d.name + \"</b><br/>\" + fmtPer(per) + \" renewables\"\n })\n .classed(\"hidden\", false);\n}", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n\t\tif (row.votecount.length != 0){\n\t \n\t\t\ttext += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n\t\t}\n\t });\n\n\t return text;\n\t}", "function gridOnHandler(){\r\n \r\n gridSimulatorVar.current_counter = 0\r\n paintGridOnHover(this)\r\n paintGridCounter(gridSimulatorVar.current_counter)\r\n\r\n}", "function logMouseEnter() {\n log('hover:scatterlegend', { numLabels })\n }", "function mouseover(d) {\n\t\tchart.append(\"text\")\n\t\t\t.attr(\"id\", \"interactivity\")\n\t\t\t.attr(\"y\", y(d.value) - 15)\n\t\t\t.attr(\"x\", x(d.year) + 23)\n\t\t\t.style(\"text-anchor\", \"start\")\n\t\t\t.style(\"font\", \"10px sans-serif\")\n\t\t\t.text(d.value);\n\n\t\td3.select(this)\n\t\t\t.style(\"fill\", \"darkblue\");\n\t}", "function process_count (repos) {\n var total = 0;\n repos.filter(function (r) {\n total += r.stargazers_count\n })\n \n //console.log('Total in github-starz.js : ' + total)\n user_callback(total);\n}", "tooltip_render (tooltip_data)\r\n\t{\r\n\t\t//var that=this;\r\n\t let text = \"<ul>\";\r\n\t // console.log(\"----\",tooltip_data);\r\n\t tooltip_data.forEach((row)=>{\r\n\t text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.value+\"%)\" + \"</li>\"\r\n\t });\r\n\r\n\t return text;\r\n\t}", "function getFinalSumResult() {\r\n $(document).ready(function () {\r\n $(\"#paymentSum\").mouseout(function () {\r\n if (flag) {\r\n let nds = $(\"#ndcInputFiled\").val();\r\n let finalResult = result * (1 + (+nds / 100));\r\n $(\"#resultSum\").val(parseFloat(finalResult).toFixed(2));\r\n } else {\r\n $(\"#resultSum\").val(\"\");\r\n }\r\n });\r\n });\r\n}", "function startCount(obj) {\n valueIncrease();\n valueDecrease();\n \n}", "mouseover(d) {\n\t\t\t// const percentage = (100 * d.value / this.totalSize).toPrecision(3);\n\t\t\t// let percentageString = `${percentage}%`;\n\t\t\t// if (percentage < 0.1) {\n\t\t\t// \tpercentageString = '< 0.1%';\n\t\t\t// }\n\n\t\t\t// const sequenceArray = this.getAncestors(d);\n\t\t\t// this.updateBreadcrumbs(sequenceArray, percentageString);\n\n\t\t\t// Fade all the segments.\n\t\t\t// d3.selectAll('.icicleNode')\n\t\t\t// \t.style('opacity', 0.3);\n\n\t\t\t// Then highlight only those that are an ancestor of the current segment.\n\t\t\t// this.hierarchy.selectAll('.icicleNode')\n\t\t\t// \t.filter(node => (sequenceArray.indexOf(node) >= 0))\n\t\t\t// \t.style('opacity', 1)\n\n\t\t\t// this.drawGuides(d)\n\t\t\tthis.$refs.ToolTip.render(d);\n\t\t}", "function display() {\n\t\tlet totFilteredRecs = ndx.groupAll().value();\n\t\tlet end = ofs + pag > totFilteredRecs ? totFilteredRecs : ofs + pag;\n\t\td3.select('#begin').text(end === 0 ? ofs : ofs + 1);\n\t\td3.select('#end').text(end);\n\t\td3.select('#last').attr('disabled', ofs - pag < 0 ? 'true' : null);\n\t\td3.select('#next').attr(\n\t\t\t'disabled',\n\t\t\tofs + pag >= totFilteredRecs ? 'true' : null\n\t\t);\n\t\td3.select('#size').text(totFilteredRecs);\n\t\tif (totFilteredRecs != ndx.size()) {\n\t\t\td3.select('#totalsize').text('(Unfiltered Total: ' + ndx.size() + ')');\n\t\t} else {\n\t\t\td3.select('#totalsize').text('');\n\t\t}\n\t}", "function mouseover(d) {\n const percentageString = `${d.value}`;\n const textForClosed = ' of them have been ';\n const textForOpen = ' of them are still ';\n\n const percentageStr = ' issues have been created by ';\n\n switch (d.name) {\n case 'open':\n d3.select('#percentage')\n .text(d.value);\n d3.select('#info-text-nbIssues')\n .text(textForOpen)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(`${d.name}ed`);\n break;\n case 'closed':\n d3.select('#percentage')\n .text(d.value);\n d3.select('#info-text-nbIssues')\n .text(textForClosed)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(d.name);\n break;\n default:\n d3.select('#percentage')\n .text(percentageString);\n d3.select('#info-text-nbIssues')\n .text(percentageStr)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(`${d.name}.`);\n }\n\n d3.select('#explanation')\n .style('top', '240px');\n\n const sequenceArray = getAncestors(d);\n updateBreadcrumbs(sequenceArray, percentageString);\n\n // Fade all the segments.\n d3.selectAll('path')\n .style('opacity', 0.3);\n\n // Then highlight only those that are an ancestor of the current segment.\n vis.selectAll('path')\n .filter(node => (sequenceArray.indexOf(node) >= 0))\n .style('opacity', 1);\n}", "function onMouseoverChart(e) {\n if (e['target'] === 'node') {\n var nodeSplit = e['targetid'].split('-');\n var nodeId = nodeSplit[nodeSplit.length - 1];\n if (Number.isInteger(parseInt(nodeId)) && parseInt(nodeId) < globalEnergyData['values'].length) {\n renderPieChart(parseInt(nodeId));\n }\n } \n }", "tooltip_render (tooltip_data) {\n let text = \"<ul>\";\n tooltip_data.result.forEach((row)=>{\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n });\n\n return text;\n }", "function calcTotal (){\n totalLabel.innerHTML = 'Total: $' + value;\n}", "render() {\n // Define this vis\n const vis = this;\n\n // Bind and modify - using 'datum' method to bind a single datum\n vis.topCounterEl.datum(vis.resultsCount)\n .text('Results Count: ')\n .append('span')\n .text(d => d);\n }", "function handle_mouseover (a, geojson_data) {\n const lan_name = geojson_data.properties.LnNamn\n const lan_kod = geojson_data.properties.LnKod\n const lan_cases = get_age_data_by_county_and_age_group(lan_name, agespan)\n d3.select('#data_div')\n .html(\n '<div class=\"lan\">' + lan_name + ' </div>' +\n '<br/>' +\n 'Sjukdomsfall: ' + lan_cases +\n '<br/>'\n )\n const this_path = d3.select(this)\n tmp_colour = this_path.attr('fill')\n this_path.attr('fill', '#f00')\n}", "update() {\n this.shadow.innerHTML = `<div> <b> Count: </b> ${this.currentCount} </div>`;\n }", "function updateBagCount($ul) {\n\t\tvar parentDiv = $ul.parent().prev();\n\t\t//alert( parentDiv.html ())\n\t\tvar $countHold = $(\" small span\" ,parentDiv);\n\t\tvar count = $ul.find(\"li\").length;\n\t\t$countHold.text(count)\n\t}", "function incrementCount(params) {\n\t// increase count by 1 per each 'next' arrow click\n\tcardCount++;\n\tif (cardCount > energetics.length) {\n\t\tcardCount = 1;\n\t}\n\tcurCard.innerText = cardCount;\n}", "function addexptototal()\n {\n const expobj={};\n //read the value of inputamt\n const textamt=inputele.value;\n\n const textdesc=inputele2.value;\n \n //convert it to number\n const exp=parseInt(textamt,10);\n\n expobj.desc=textdesc;\n expobj.amt=textamt;\n expobj.moment=new Date();\n\n allexp.push(expobj);\n \n \n //add that value to totalvalue\n totalexp=totalexp+exp;\n \n hele.textContent=totalexp;\n\n const headingtext=`Total :: ${totalexp}`;\n hele.textContent=headingtext;\n\n renderlist(allexp);\n \n }", "function handleMouseOverPie() {\n // remove old mouse event elements\n svg.selectAll(\".percentage\").remove();\n\n // get margins from container\n var margins = getMargins(\".containerGraph3\")\n\n // select this item\n d3.select(this)\n .attr(\"stroke\", \"white\")\n .style(\"stroke-width\", \"3px\")\n .style(\"stroke-opacity\", 0.6)\n\n // append text to the side of the pie with the percentages\n svg.append(\"text\")\n .attr(\"class\", \"percentage\")\n .text(\"Geslaagd: \" + percentagePassed + \"%\")\n .attr(\"x\", margins.width / 5)\n .attr(\"y\", -margins.height / 2.3)\n .attr(\"font-size\", 24)\n .attr(\"font-family\", \"Arial\")\n .attr(\"fill\", \"white\")\n .transition().duration(200)\n .attr(\"opacity\", 0.9)\n\n // append text\n svg.append(\"text\")\n .attr(\"class\", \"percentage\")\n .text(\"Gezakt: \" + percentageFailed + \"%\")\n .attr(\"x\", margins.width / 5)\n .attr(\"y\", -margins.height / 2.3+ 30)\n .attr(\"font-size\", 24)\n .attr(\"font-family\", \"Arial\")\n .attr(\"fill\", \"white\")\n .transition().duration(200)\n .attr(\"opacity\", 0.9)\n }", "function getDuracaoTotal(lead) {\n return new Date() - lead.dataOrigemLead;\n}", "function setTopoPetsCaught(){\n\tdocument.getElementById(\"topoPetsFoundTitle\").innerHTML = \"<p> Recorder: \" + topoPetsCaught.total() + \"/\" + getTotalAmountTopoPets() + \" <br/><progress id='health' value=\" + topoPetsCaught.total() + \" max=\" + getTotalAmountTopoPets() + \" style='height:1vh;width:60%;'>\";\n}", "function scoreCount(bullet) {\n if (d[bullet].style.backgroundColor == blockColor) {\n d[bullet].style.backgroundColor = bulletColor;\n score = score + 1;\n document.getElementById(\"points\").innerText = score;\n } else {\n d[bullet].style.backgroundColor = bulletColor;\n }\n}", "function mouseover(p) {\n tooltip.style(\"visibility\", \"visible\");\n tooltip.html(names[p.y] + \" vs \" + names[p.x] + \" - Total Meetings: \" + (matrix[p.x][p.y].z + matrix[p.y][p.x].z) + \". <br/>\" + names[p.y] + \" has won \" + p.z + \" of them.\");\n d3.selectAll(\".row text\").classed(\"active\", function(d, i) {\n return i == p.y;\n });\n d3.selectAll(\".column text\").classed(\"active\", function(d, i) {\n return i == p.x;\n });\n }", "display_agent(agent){\n this.single_agent.selectAll(\"p\")\n\t\t .data(build_string(agent).split(\"\\n\"))\n\t \t .transition()\n .duration(100)\n .text((d)=>{return (d);});\n\n }", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function sum(){\n setCount(count+1)\n }", "function IndicadorTotal () {}", "function handleMouseOver(d) { // Add interactivity\r\n\t// while (d3.select(\".detail_text_title\").empty() != true) {\r\n\t// d3.select(\".detail_text_title\").remove(); // Remove text location\r\n\t// }\r\n\t// while (d3.select(\".detail_text_sentence\").empty() != true) {\r\n\t// d3.select(\".detail_text_sentence\").remove(); // Remove text location\r\n\t// }\r\n\twhile (d3.select(\".detail_text_no_event\").empty() != true) {\r\n\t d3.select(\".detail_text_no_event\").remove(); // Remove text location\r\n\t}\r\n\twhile (d3.select(\".detail_div\").empty() != true) {\r\n\t d3.select(\".detail_div\").remove(); // Remove text location\r\n\t}\r\n\r\n\t// DETAIL PART\r\n var match_event = []\r\n x = d3.mouse(this)[0] + 20\r\n // y_hover = d3.mouse(this)[1] - \r\n\ty_hover = y(d.subscriber_gain) - 50\r\n\td3.tsv('data/event.txt', function(data) {\r\n\t\tfor (id in data) {\r\n\t\t\t// console.log(data[id])\r\n\t\t\tif (d.year == data[id].year) {\r\n\t\t\t\tif (d.month == data[id].month) {\r\n\t\t\t\t\tmatch_event.push(data[id])\r\n\t\t\t\t\t// console.log(match_event)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// selecting\r\n\t detail_text_div = d3.select(\".hover_info_div\").append(\"div\").attr(\"class\", \"detail_div\")\r\n\r\n\t console.log(\"AAA\" )\r\n\r\n\t detail_text_div.append(\"p\").attr(\"class\", \"month_year_name\").text(monthNames[parseInt(d.month)-1] + ' ' + d.year)\r\n\r\n \t\tdetail_text_div.append(\"ol\")\r\n \t\tid_show = 1\r\n\t \tfor (id_event in match_event) {\r\n\t \t\tdetail_text_div.append(\"b\").attr(\"class\", \"detail_text_title\").text(id_show+\". \"+match_event[id_event].ttitle)\r\n\t \t\tdetail_text_div.append(\"div\").attr(\"class\", \"detail_text_sentence\").text(match_event[id_event].detail)\r\n\t \t\tdetail_text_div.append(\"br\")\r\n\t \t\tid_show+=1\r\n\t \t}\r\n\t \tif (d3.select(\".detail_text_sentence\").empty()) {\r\n\t \t\tdetail_text_div.append(\"p\").attr(\"class\", \"detail_text_no_event\").text(\"No special event in this month\")\r\n\t \t}\r\n\t})\r\n\r\n\t// BOX PART\r\n var match_event = []\r\n x = d3.mouse(this)[0] + 20\r\n // y_hover = d3.mouse(this)[1] - \r\n\ty_hover = y(d.subscriber_gain) - 50\r\n\r\n var text = svg.append(\"text\")\r\n .attr(\"id\", \"hover_bar\")\r\n .attr(\"fill\", \"white\")\r\n .attr(\"font-size\", \"15\")\r\n .attr(\"x\", function(d) {\r\n \treturn x;\r\n }).attr(\"y\", function(d) {\r\n \treturn y_hover; // - count_line*20;\r\n })\r\n\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Month/Year : \" + d.month + '-' + d.year)\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Subcriber gain : \" + d.subscriber_gain)\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Subcriber total : \" + d.subscriber_total)\r\n\r\n\tvar bbox = text.node().getBBox();\r\n\r\n\tvar rect = svg.append(\"rect\")\r\n\t .attr(\"id\", \"hover_bar_box\")\r\n\t .attr(\"x\", bbox.x - 5)\r\n\t .attr(\"y\", bbox.y - 5)\r\n\t .attr(\"width\", bbox.width + 10)\r\n\t .attr(\"height\", bbox.height + 10)\r\n\t .style(\"fill\", \"#000\")\r\n\t .style(\"fill-opacity\", \"0.2\")\r\n\t .style(\"stroke\", \"#fff\")\r\n\t .style(\"stroke-width\", \"1.5px\");\r\n }", "function onMouseMove(obj, e)\n {\n //trace(\"onMouseMove\", obj, e);\n var snumber = obj._id;\n var seriesInfo = pThis.series[snumber];\n var seriesObj;\n\n if (seriesInfo && seriesInfo.keyData != 0)\n {\n seriesObj = {\n datapoint: [seriesInfo.percent, seriesInfo.data],\n dataIndex: 0,\n series: seriesInfo,\n seriesIndex: snumber\n }\n pThis._checkPieHighlight(obj, seriesObj);\n pThis._moveTooltip(obj, e);\n }\n }", "showTotals() {\n //const infectious2 = this.chart.chart.data.datasets[0].data\n const infectious1 = this.chart.chart.data.datasets[1].data\n const infectious1Val = infectious1[infectious1.length-1]\n\n const susceptible = this.chart.chart.data.datasets[2].data\n const susceptibleVal = susceptible[susceptible.length-1]\n const nSusceptible = susceptibleVal-infectious1Val\n\n const vaccinated = this.chart.chart.data.datasets[3].data\n const vaccinatedVal = vaccinated[vaccinated.length-1]\n const nVaccinated = vaccinatedVal-susceptibleVal\n\n const removed = this.chart.chart.data.datasets[4].data\n const removedVal = removed[removed.length-1]\n const nRemoved = removedVal-vaccinatedVal\n\n const dead = this.chart.chart.data.datasets[5].data\n const deadVal = dead[dead.length-1]\n const nDead = deadVal-removedVal\n\n let hospitalDeaths = 0\n this.sender.q1.pts.forEach(pt => hospitalDeaths += pt.status==Point.DEAD ? 1 : 0)\n\n const yDiff = TEXT_SIZE_TOTALS+15\n\n strokeWeight(0)\n stroke(0)\n fill(\"#000000dd\")\n rect(RECT_X_TOTALS, RECT_Y_TOTALS, RECT_W_TOTALS, RECT_H_TOTALS, RECT_RADIUS_TOTALS)\n textSize(TEXT_SIZE_TOTALS)\n textAlign(LEFT, TOP)\n fill(COLOR_LIGHT_GRAY)\n text(`Simulation Complete!`, TEXT_X_TOTALS+80, TEXT_Y_TOTALS)\n text(`Total Unaffected: ${nSusceptible+nVaccinated}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff)\n text(`Total Infected: ${dead[dead.length-1]-nSusceptible-nVaccinated}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*2)\n text(`Total Recovered: ${nRemoved}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*3)\n text(`Total Dead: ${nDead}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*4)\n text(`Deaths due hospital overcrowding: ${hospitalDeaths}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*5)\n this.drawResetArrow()\n }", "function mouseoverHandler (d) {\n tooltip.transition().style('opacity', .9)\n tooltip.html('<p>' + d[\"attribute\"] + '</p>' );\n }", "function calculateTip(amount, service, people) {\n const totalTip = (amount * service)/people;\n console.log(totalTip); \n renderTip(totalTip);\n}", "function createMousoverHtml(d) {\n\n var html = \"\";\n html += \"<div class=\\\"tooltip_kv\\\">\";\n html += \"<span class=\\\"tooltip_key\\\">\";\n html += d['Item'];\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Total Accidents: \"\n try {\n html += (d[\"Total_Accidents\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: \"\n html += (d[\"Fatal\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: \"\n html += (d[\"Serious\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: \"\n html += (d[\"Minor\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: \"\n html += (d[\"Uninjured\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>VMC: \"\n html += (d[\"VMC\"]);\n html += \" IMC: \"\n html += (d[\"IMC\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Destroyed: \"\n html += (d[\"Destroyed_Damage\"]);\n html += \" Substantial: \"\n html += (d[\"Substantial_Damage\"]);\n html += \" Minor: \"\n html += (d[\"Minor_Damage\"]);\n }\n catch (error) {\n html = html.replace(\"<a>Total Accidents: \", \"\")\n html += \"<a>Total Accidents: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: 0\"\n }\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"</div>\";\n $(\"#tooltip-container-scatter\").html(html);\n $(this).attr(\"fill-opacity\", \"0.8\");\n $(\"#tooltip-container-scatter\").show();\n\n //quello commentato ha senso, ma scaja\n //var map_width = document.getElementById('scatter').getBoundingClientRect().width;\n var map_width = $('scatter')[0].getBoundingClientRect().width;\n //console.log($('scatter'))\n\n //console.log('LAYER X ' + d3.event.layerX)\n //console.log('LAYER Y ' + d3.event.layerY)\n\n if (d3.event.layerX < map_width / 2) {\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX + 15) + \"px\");\n } else {\n var tooltip_width = $(\"#tooltip-container-scatter\").width();\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX - tooltip_width - 30) + \"px\");\n }\n}", "function Summary(container_id) {\n var m_data_source = null;\n var m_panel = new JSPanel(container_id);\n var m_rpt_shipping_fee = new JSRepeater('rep_shipping_fee_real');\n var m_rpt_dangdang_money = new JSRepeater('rep_dangdang_money');\n var m_rep_collection_promotion = new JSRepeater('rep_collection_promotion');\n var m_rep_order_promotion = new JSRepeater('rep_order_promotion');\n\tvar m_rpt_overseas_tax = new JSRepeater('rep_overseas_tax_real');\n\n var promo_expand_status = true;\n var shipping_fee_expand_status = true;\n var coupon_expand_status = true;\n var giftcard_expand_status = true;\n\tvar overseas_tax_expand_status = true;\n\n var obj_coupon_money_real = null;\n var obj_rep_dangdang_money = null;\n var obj_rep_order_promotion = null;\n var obj_rep_collection_promotion = null;\n var obj_rep_shipping_fee_real = null;\n\tvar obj_rep_overseas_tax_real = null;\n\t\n\tvar order_count = 0;\n\t\n\tvar is_show_free_oversea = false;\n\t\n\tvar deposit_presale_type = 0; //1代表全款支付,2代表定金和尾款分开支付\n\n this.show = function (result) {\n bindTemplate();\n addEvents();\n\n // get_order_submit_tips(m_data_source[\"is_agree\"]);\n\n //验证码\n yzmInit();\n\n //支付密码\n payPasswordInit();\n\n $1('btn_change_yzm').onclick = function () { changeYZMMarked(); };\n\n $1('ck_protocol').onclick = function () { check_protocol(); };\n }\n\n this.setDataSource = function (data_source) {\n m_data_source = data_source;\n m_panel.DataSource = data_source;\n\n m_rpt_shipping_fee.DataSource = data_source['order_list'];\n m_rpt_dangdang_money.DataSource = data_source['order_list'];\n m_rep_collection_promotion.DataSource = data_source['collection_deduct_info'];\n\n m_rep_order_promotion.DataSource = data_source['order_promotion'];\n m_rpt_overseas_tax.DataSource = data_source['order_list'];\n\n if (m_data_source[\"presale_type\"] == null) {\n deposit_presale_type = 0;\n } else {\n deposit_presale_type = m_data_source[\"presale_type\"];\n }\n }\n\n this.setSubmit = function (order_flow_submit) {\n m_order_flow_submit = order_flow_submit;\n }\n\n this.setYzmStatus = function (is_no_safe_ip) {\n m_data_source['is_no_safe_ip'] = is_no_safe_ip;\n }\n\n this.isNoSafeIp = function () {\n return m_data_source['is_no_safe_ip'];\n }\n\n var get_order_submit_tips = function (is_agree) {\n var order_submit_tips = $1('order_submit_tips');\n if (order_submit_tips != null) {\n if (!is_agree) {\n order_submit_tips.innerHTML = P_ORDER_SUBMIT_PROTOCOL_TIPS;\n $1('order_submit_tips').className = \"\";\n }\n else\n $1('order_submit_tips').className = \"objhide\";\n }\n }\n\n\n this.setSubmitErrorTips = function (submit_error_tips) {\n if (submit_error_tips)\n $s($1('order_submit_error_tips_bar'));\n else\n $h($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = submit_error_tips;\n }\n\n //点了提交按钮后的按钮变化\n this.setDisabled = function () {\n $disabled('submit');\n $wait('submit');\n }\n this.setEnabled = function () {\n $enabled('submit');\n $1('submit').style.cursor = 'pointer';\n }\n\n var check_protocol = function () {\n if ($1('ck_protocol').checked)\n $1('submit').className = \"btn btn-super-orange\";\n else\n $1('submit').className = \"btn btn-super-orange btn-super-disabled\";\n }\n\n var ipt_yzm_keyup = function (o, e) {\n var k = null;\n if (e) {\n k = e.keyCode;\n }\n else if (event) {\n k = event.keyCode;\n }\n\n if (k == 9)\n return;\n\n var ov = o.value;\n var lisi = null;\n var j = 0;\n for (var i = 0; i < yzm_array_len; i++) {\n lisi = obj_ipt_yzm_lis[i];\n if (lisi.innerHTML.startsWith(ov)) {\n $s(lisi);\n j++;\n }\n else $h(lisi);\n }\n\n if (j < 2) {\n $h(obj_ipt_yzm);\n }\n else if (j < 10) {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = 'auto';\n }\n else {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = '100px';\n }\n };\n\n var li_c = function (t) { t.className = 'li_bg'; };\n var li_r = function (t) { t.className = ''; }\n var ipt_yzm_focus = function (o) {\n\n clearYzmTips(o);\n var li_ck = function (t) { o.value = t.innerHTML; $h(obj_ipt_yzm); o.style.color = '#404040'; };\n var sb = new StringBuilder();\n for (var i = 0; i < yzm_array_len; i++) {\n sb.append(\"<li>\");\n sb.append(i);\n sb.append('</li>');\n }\n obj_ipt_yzm.innerHTML = sb.toString();\n obj_ipt_yzm_lis = obj_ipt_yzm.childNodes;\n for (var i = 0; i < yzm_array_len; i++) {\n obj_ipt_yzm_lis[i].onmouseover = function () { li_c(this); };\n obj_ipt_yzm_lis[i].onmouseout = function () { li_r(this); };\n obj_ipt_yzm_lis[i].onclick = function () { li_ck(this); };\n }\n var pos = getposOffset_c(o);\n setLocation(obj_ipt_yzm, pos[0] + 3, pos[1] + 20);\n setDimension(obj_ipt_yzm, 85, 100);\n\n if (yzm_array_len < 8)\n obj_ipt_yzm.style.height = 'auto';\n\n\n show_ipt_yzm(obj_ipt_yzm, o);\n };\n\n var show_ipt_yzm = function (z, o) {\n $s(z);\n if (document.addEventListener) {\n document.addEventListener('click', documentonclick, false);\n }\n else {\n document.attachEvent('onclick', function (e) { documentonclick(); });\n }\n\n function documentonclick() {\n var evt = arguments[0] || window.event;\n var sender = evt.srcElement || evt.target;\n\n if (!contains(z, sender) && sender != o) {\n $h(z);\n if (document.addEventListener) {\n document.removeEventListener('click', documentonclick, false);\n }\n else {\n document.detachEvent('onclick', function (e) { documentonclick(); });\n }\n }\n };\n };\n\n // show error\n function showError(error) {\n SubmitData.error = error;\n }\n // show bind error\n function showSubmitError(errorCode) {\n var error;\n switch (errorCode) {\n case 1:\n case 5:\n case 6:\n case 9:\n case 10:\n case 11:\n error = \"请填写正确的卡号\";\n break;\n case 7:\n error = \"请填写正确的密码\";\n break;\n case 12:\n error = \"激活失败\";\n break;\n default:\n error = \"礼券绑定失败\";\n }\n showError(error);\n }\n\n // clear error\n function clearError() {\n couponData.error = null;\n }\n\n function yzmInit() {\n changeYZMMarked();\n // obj_ipt_yzm = $1('ul_ipt_yzm');\n //\t $1('ipt_yzm').onkeyup=function(e){ipt_yzm_keyup(this,e);};\n\n if (m_data_source['is_no_safe_ip'] == 0) {\n $h($1('div_yzm_word'));\n }\n\n }\n\n function payPasswordInit() {\n\n var isEnable = m_data_source['payment_password_enabled'] == 1;\n isEnable = isEnable \n \t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']));\n if (isEnable) {\n if (m_data_source['is_set_payment_password']) {\n ShowOrClosePayPassWord(3);\n }\n else {\n ShowOrClosePayPassWord(0);\n }\n }\n else {\n ShowOrClosePayPassWord(2);\n }\n }\n\n function bindTemplate() {\n if (m_data_source['order_list'] != null && m_data_source['order_list'].length > 0) {\n order_count = m_data_source['order_list'].length;\n }\n m_panel.Template = ORDER_SUMMARY_TEMPLATE;\n m_data_source['bargin_total'] = formatFloat(m_data_source['bargin_total']);\n m_data_source['shipping_fee'] = formatFloat(m_data_source['shipping_fee']);\n m_data_source['promo_discount_amount'] = formatFloat(m_data_source['promo_discount_amount']);\n m_data_source['coupon_amount'] = formatFloat(m_data_source['coupon_amount']);\n m_data_source['cust_cash_used'] = formatFloat(m_data_source['cust_cash_used']);\n m_data_source['payable_amount'] = formatFloat(m_data_source['payable_amount']);\n m_data_source['gift_card_charge'] = formatFloat(m_data_source['gift_card_charge']);\n m_data_source['total_gift_package_price'] = formatFloat(m_data_source['total_gift_package_price']);\n m_data_source['gift_package_price'] = formatFloat(m_data_source['gift_package_price']);\n m_data_source['gift_package_price_tips'] = formatFloat(m_data_source['gift_package_price_tips']);\n m_data_source['greetingcard_price'] = formatFloat(m_data_source['greetingcard_price']);\n m_data_source['privilege_code_discount_amount'] = formatFloat(m_data_source['privilege_code_discount_amount']);\n m_data_source['point_deduction_amount'] = formatFloat(m_data_source['point_deduction_amount']);\n //定金和尾款金额格式化\n m_data_source['deposit_amount'] = formatFloat(m_data_source['deposit_amount']);\n m_data_source['balance_amount'] = formatFloat(m_data_source['balance_amount']);\n\t\t\n //礼品卡和礼券总金额\n m_data_source[\"coupon_and_giftcard_money_used\"]=formatFloat((+m_data_source[\"gift_card_money_used\"])+(+m_data_source[\"coupon_amount\"]));\n m_data_source[\"gift_card_money_used\"]=formatFloat(m_data_source[\"gift_card_money_used\"]);\n m_data_source[\"coupon_used\"]=formatFloat(m_data_source[\"coupon_amount\"]);\n\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['overseas_tax']);\n\t\tif(parseFloat(m_data_source['overseas_tax']) == 0){\n\t\t\tis_show_free_oversea = true;\n\t\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['free_overseas_tax']);\n\t\t} \n\t\t\n\t\t\n if (m_data_source['payable_amount'] >= 1000) {\n m_data_source['payable_amount_style'] = \"f14\";\n }\n else {\n m_data_source['payable_amount_style'] = \"f18\";\n }\n //先取值,防止设置设置支付密码后,给输入框赋了值,但重新绑定后丢失。\n var payment_password = $F(\"input_pay_password\");\n m_panel.DataBind();\n if (payment_password)\n $1(\"input_pay_password\").value = payment_password;\n\n obj_coupon_money_real = $1(\"coupon_money_real\");\n obj_rep_dangdang_money = $1(\"rep_dangdang_money\");\n obj_rep_order_promotion = $1(\"rep_order_promotion\");\n obj_rep_collection_promotion = $1(\"rep_collection_promotion\");\n obj_rep_shipping_fee_real = $1(\"rep_shipping_fee_real\");\n\t\tobj_rep_overseas_tax_real = $1(\"rep_overseas_tax_real\");\n\n\t\tif (deposit_presale_type == 1) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else if (deposit_presale_type == 2) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else {\n\t\t $1(\"div_deposit_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"div_agree_pay_deposit\").className = 'hide';\n\t\t}\n $1(\"total_shipping_fee_real\").className = 'hide';\n $1(\"total_promo_amount_real\").className = 'hide';\n $1(\"total_coupon_real\").className = 'hide';\n $1(\"total_gift_card_charge\").className = 'hide';\n $1(\"total_cust_cash_real\").className = 'hide';\n $1(\"total_cust_point_real\").className = 'hide';\n $1(\"rep_collection_promotion\").className = 'hide';\n $1(\"total_discount_code_real\").className = 'hide';\n $1(\"total_gift_package_price\").className = 'hide';\n $1(\"gift_package_price\").className = 'hide';\n $1(\"total_privilege_code_discount_amount\").className = 'hide';\n $1(\"greetingcard_price\").className = 'hide';\n\t\t$1(\"total_overseas_tax_real\").className = 'hide';\n\t\t$1(\"total_energy_saving_subsiby_amout\").className = 'hide';\n if (m_data_source['shipping_fee'] > 0) {\n $1(\"total_shipping_fee_real\").className = '';\n m_rpt_shipping_fee.ItemTemplate = RPT_SHIPPING_FEE_ITEM_TEMPLATE;\n m_rpt_shipping_fee.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_shipping_fee'] > 0) {\n dataItem['order_shipping_fee'] = formatFloat(dataItem['order_shipping_fee']);\n }\n else {\n dataItem['shipping_fee_display'] = 'hide';\n }\n }\n m_rpt_shipping_fee.DataBind();\n }\n\t\tif(m_data_source['energy_saving'] == true) {\n\t\t\t$1(\"total_energy_saving_subsiby_amout\").className = \"\";\n\t\t}\n\t\tif (m_data_source['is_overseas'] == true) {\n\t\t\t\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"default\";\n\t\t\t} else {\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"\";\n\t\t\t}\n $1(\"total_overseas_tax_real\").className = '';\n m_rpt_overseas_tax.ItemTemplate = RPT_OVERSEAS_TAX_ITEM_TEMPLATE;\n m_rpt_overseas_tax.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['is_overseas'] == true) {\n\t\t\t\t\tif(formatFloat(dataItem['overseas_tax']) == 0){\n\t\t\t\t\t\tdataItem['default_class'] = \"default\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['free_overseas_tax']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdataItem['default_class'] = \"\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['overseas_tax']);\n\t\t\t\t\t}\n }\n else {\n dataItem['overseas_tax_display'] = 'hide';\n }\n }\n m_rpt_overseas_tax.DataBind();\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$(\"#oversea_icon_free\").show();\n\t\t\t} else {\n\t\t\t\t$(\"#oversea_icon_free\").hide();\n\t\t\t}\n\t\t\tif(order_count == 1){\n\t\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t\t}\n }\n if (m_data_source['promo_discount_amount'] > 0) {\n $1(\"total_promo_amount_real\").className = '';\n if (m_data_source['collection_deduct_info']!=undefined && m_data_source['collection_deduct_info'].length > 0) {\n $1(\"rep_collection_promotion\").className = '';\n m_rep_collection_promotion.ItemTemplate = RPT_PROMOTION_ITEM_TEMPLATE;\n m_rep_collection_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_direct_discount_amount'] > 0) {\n dataItem['order_direct_discount_amount'] = formatFloat(dataItem['order_direct_discount_amount']);\n }\n else {\n dataItem['order_direct_discount_amount'] = 'hide';\n }\n dataItem['collection_promotion_desc_tips'] = dataItem['collection_promotion_desc'];\n dataItem['collection_promotion_desc'] = nTruncate(dataItem['collection_promotion_desc'], 10);\n }\n m_rep_collection_promotion.DataBind();\n }\n\n m_rep_order_promotion.ItemTemplate = RPT_ORDER_PROMOTION_ITEM_TEMPLATE;\n m_rep_order_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n\n if (dataItem['order_prom_subtract'] > 0) {\n $s($1(\"rep_order_promotion\"));\n dataItem['order_prom_subtract'] = formatFloat(dataItem['order_prom_subtract']);\n }\n else {\n dataItem['order_promotion_display'] = 'hide';\n }\n dataItem['shop_promo_msg_tips'] = dataItem['shop_promo_msg'];\n dataItem['shop_promo_msg'] = nTruncate(dataItem['shop_promo_msg'], 10);\n }\n m_rep_order_promotion.DataBind();\n }\n \n //if(+m_data_source[\"coupon_and_giftcard_money_used\"]>0){ \n \t //礼品卡显示\n $1(\"total_giftcard_real\").className = 'hide';\n if(+m_data_source[\"gift_card_money_used\"]>0){ \t \n \t$1(\"total_giftcard_real\").className = '';\n m_rpt_dangdang_money.ItemTemplate = RPT_COUPON_ITEM_TEMPLATE;\n m_rpt_dangdang_money.onItemDataBind = function (dataItem) {\n if (+dataItem['cust_gift_card_used'] > 0) {\n \t dataItem['cust_gift_card_used'] = formatFloat(dataItem['cust_gift_card_used']);\n }\n else {\n dataItem['coupon_amount_display'] = 'hide';\n }\n };\n m_rpt_dangdang_money.DataBind(); \n }\n \n if (m_data_source['coupon_used'] > 0) {\n \t$1(\"total_coupon_real\").className = '';\n switch (+m_data_source['coupon_type']) {\n case 1:\n case 9: \n obj_coupon_money_real.className = 'p-child';\n break; \n case 4:\n $1(\"total_discount_code_real\").className = '';\n $1(\"total_coupon_real\").className = 'hide';\n break;\n default:\n break;\n }\n \n }\n \n\n\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"total_gift_package_price\");\n }\n\n if (m_data_source['gift_package_price'] == 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"greetingcard_price\");\n }\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] == 0) {\n $S(\"gift_package_price\");\n }\n\n\n if (+m_data_source['gift_card_charge'] > 0) {\n $1(\"total_gift_card_charge\").className = '';\n }\n\n if (m_data_source['cust_cash_used'] > 0) {\n $S(\"total_cust_cash_real\");\n }\n if (m_data_source['point_deduction_amount'] > 0) {\n $S(\"total_cust_point_real\");\n }\n if (!m_data_source['is_agree']) {\n $s($1('div_ck_protocol'));\n }\n if (+m_data_source['privilege_code_discount_amount'] > 0) {\n $1(\"total_privilege_code_discount_amount\").className = '';\n }\n }\n\n\n function getEvent() {\n if (document.all) {\n return window.event; //for ie\n }\n func = getEvent.caller;\n while (func != null) {\n var arg0 = func.arguments[0];\n if (arg0) {\n if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof (arg0) == \"object\" && arg0.preventDefault && arg0.stopPropagation)) {\n return arg0;\n }\n }\n func = func.caller;\n }\n return null;\n }\n\n // events\n function addEvents() {\n if (deposit_presale_type == 2) {\n $1('presale_mobile').onkeydown = function () {\n $1('presale_mobile').className = \"input-w87\";\n $h($1('order_submit_error_tips_bar'));\n var ev = getEvent();\n if (ev.keyCode >= 48 && ev.keyCode <= 57) { return; }\n if (ev.keyCode >= 96 && ev.keyCode <= 105) { return; }\n if (ev.keyCode == 8 || ev.keyCode == 46 || ev.keyCode == 37 || ev.keyCode == 39) { return; }\n return false;\n }\n }\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n $1('agree_pay_deposit').onclick = function () {\n if ($1('agree_pay_deposit').checked == true) {\n $1(\"submit\").className = ' btn btn-super-orange';\n } else {\n $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n }\n }\n }\n $1('shipping_fee_detail_link').onclick = function () {\n if (shipping_fee_expand_status) {\n $h(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-open';\n shipping_fee_expand_status = false;\n }\n else {\n $s(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-close';\n shipping_fee_expand_status = true;\n }\n }\n\t\tif(order_count == 1){\n\t\t\t$(\"#shipping_fee_detail_link\").click();\n\t\t}\n\n $1('promo_detail_link').onclick = function () {\n if (promo_expand_status) {\n $h(obj_rep_collection_promotion);\n $h(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-open';\n promo_expand_status = false;\n }\n else {\n $s(obj_rep_collection_promotion);\n $s(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-close';\n promo_expand_status = true;\n }\n }\n\n $1('giftcard_detail_link').onclick = function () {\n if (giftcard_expand_status) {\n $h(obj_rep_dangdang_money);\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-open';\n giftcard_expand_status = false;\n }\n else {\n \tvar isUseGiftcard=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.GiftCard);//if m_data_source['coupon_type'] == 1\n if (isUseGiftcard) {\n $s(obj_rep_dangdang_money);\n }\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-close';\n giftcard_expand_status = true;\n }\n }\n $1('coupon_detail_link').onclick = function () {\n if (coupon_expand_status) {\n $h(obj_coupon_money_real);\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-open';\n coupon_expand_status = false;\n }\n else {\n \tvar isUseCoupon=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.Coupon);//if m_data_source['coupon_type'] == 1\n if (isUseCoupon) {\n $s(obj_coupon_money_real);\n }\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-close';\n coupon_expand_status = true;\n }\n }\n\n\n $1('submit').onclick = function () {\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n if ($1('submit').className.indexOf(\"disabled\") > 0) {\n return;\n }\n }\n var presale_mobile = \"\";\n\t\t\tif (deposit_presale_type == 2) {\n\t\t\t\tvar reg = /^((14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0-9])|(17[0-9]))\\d{8}$/;\n\t\t\t\tpresale_mobile = $1(\"presale_mobile\").value;\n\t\t\t\tif (presale_mobile == null || !reg.test(presale_mobile)) {\n\t\t\t\t\t$s($1('order_submit_error_tips_bar'));\n\t\t\t\t\t$1('order_submit_error_tips').innerHTML = '手机号码格式错误';\n\t\t\t\t\t$1('presale_mobile').className = \"input-w87 input-red\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n //虚拟礼品卡密钥验证\n var orders = m_data_source[\"order_list\"];\n var firtKey;\n var mobileNumber;\n for (var i = 0; i < orders.length; i++) {\n if (orders[i][\"order_type\"] == 50) {\n var success = VirtualGiftCard.submitCheckVirtualKey();\n if (!success) {\n window.location.hash = \"#GiftCardUserKey\";\n return false;\n } else {\n firtKey = $1('txt_first_key').value;\n mobileNumber = $F('txt_mobile_number');\n }\n \n }\n }\n if (!m_data_source['is_agree'] && !$1('ck_protocol').checked)\n return;\n\n var s_pay_password = \"\";\n\n if (m_data_source['payment_password_enabled'] == 1 \n \t\t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']))) {\n if (!m_data_source['is_set_payment_password'] && $1('div_pay_password').style.display == \"none\") //新增 \n {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请设置支付密码';\n return;\n }\n\n s_pay_password = $F('input_pay_password');\n if (s_pay_password == null || s_pay_password == '') {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入支付密码';\n return;\n }\n var paypwdlen = getLength(s_pay_password);\n if (paypwdlen < 6 || paypwdlen > 20) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入正确的支付密码';\n return;\n }\n }\n\n var s_sign = \"\";\n\n if (m_data_source[\"is_no_safe_ip\"] == 1) {\n s_sign = $F('ipt_yzm');\n if (s_sign == null || s_sign == '' || s_sign.indexOf(\"&\") >= 0) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请填写验证码';\n return;\n }\n }\n m_order_flow_submit(s_sign, m_data_source['shop_id'], encodeURIComponent(s_pay_password), firtKey, mobileNumber, m_data_source['product_ids'], m_data_source['sk_action_id'], presale_mobile);\n return false;\n }\n\t\t\n\t\t$1('overseas_tax_detail_link').onclick = function () {\n if (overseas_tax_expand_status) {\n $h(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-open';\n overseas_tax_expand_status = false;\n }\n else {\n $s(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-close';\n overseas_tax_expand_status = true;\n }\n }\n\t\t\n\t\tif(order_count == 1){\n\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t}\n }\n}", "function handleMouseOver(d, i) { // Add interactivity\n // console.log(i);\n const index =findWithAttr(selected,\"Institution\",i.Institution);\n if (index <= -1) {\n d3.select(this).style(\"fill\",palette_divergent_map[1]);\n }\n /*g.append(\"text\")\n .attr(\"id\", \"t\" + i.Institution )\n .attr(\"transform\", this.attributes.transform.value)//\"translate(\" + projection([d.Longitude,d.Latitude]) + \")\")\n .text(i.Institution)*/\n\n div.transition()\t\t\n .duration(200)\t\t\n .style(\"opacity\", .9);\t\t\n div\t.html(i.Institution + \"<br/> Rank =\" +i[\"CurrentRank\"]+\"<br/>\")\t\n .style(\"left\", (d.pageX) + \"px\")\t\t\n .style(\"top\", (d.pageY - 28) + \"px\");\n }", "function triggerCount(element) {\n\n }", "tooltip_render (tooltip_data) {\n let text = \"<ul>\";\n tooltip_data.forEach((row)=>{\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n });\n text += \"</ul>\"\n\n return text;\n }", "function show_services_number(ndx){\n var servicesDim = ndx.dimension(dc.pluck('type'));\n \n var numberOfServicesGroup = servicesDim.group().reduce(add_item, remove_item, initialise);\n\n function add_item(p, v) {\n p.count++;\n p.total += v.departments;\n p.average = p.total / p.count;\n return p;\n }\n\n function remove_item(p, v) {\n p.count--;\n if (p.count == 0) {\n p.total = 0;\n p.average = 0;\n } else {\n p.total -= v.departments;\n p.average = p.total / p.count;\n }\n return p;\n }\n\n function initialise() {\n return {\n count: 0,\n total: 0,\n average: 0\n };\n }\n\n dc.rowChart(\"#departments\")\n \n .margins({top: 10, left: 10, right: 10, bottom: 20})\n .valueAccessor(function (d) {\n return d.value.average;\n })\n .x(d3.scale.ordinal())\n .elasticX(true)\n .dimension(servicesDim)\n .group(numberOfServicesGroup); \n\n}", "function mouseOverFunction() {\n // Highlight circle\n var circle = d3.select(this);\n circle\n .style(\"fill\", \"#B3F29D\")\n .style(\"fill-opacity\", 0.5);\n\n // Find links which have circle as source and highlight\n svg.selectAll(\".link\")\n .filter(function(d) {\n return d.source.name === circle[0][0].__data__.name;\n })\n .style(\"stroke\", \"#B3F29D\");\n\n // Find labels which have circle as source and highlight\n svg.selectAll(\".label\")\n .filter(function(d) {\n if (d.name) {\n return d.name === circle[0][0].__data__.name;\n } else {\n return d.source.name === circle[0][0].__data__.name;\n }\n })\n .style(\"fill\",\"#B3F29D\");\n }", "function handlesumWeath() {\n const weath = data.reduce((total, d) => total + d.weath, 0);\n\n const totalWeathEl = document.createElement('li');\n totalWeathEl.innerHTML = `<h3 class=\"total\">Total Weath: <strong>${formatMoney(\n weath\n )}</strong></h3>`;\n personInfo.appendChild(totalWeathEl);\n}", "function mouseOver(d){\n\t\t\t// d3.select(this).attr(\"stroke\",\"black\");\n\t\t\ttooltip.html(\"<strong>Frequency</strong>\" + \"<br/>\" + d.data.label);\n\t\t\treturn tooltip.transition()\n\t\t\t\t.duration(10)\n\t\t\t\t.style(\"position\", \"absolute\")\n\t\t\t\t.style({\"left\": (d3.event.pageX + 30) + \"px\", \"top\": (d3.event.pageY ) +\"px\" })\n\t\t\t\t.style(\"opacity\", \"1\")\n\t\t\t\t.style(\"display\", \"block\");\n\t\t}", "function handleMouseOver(d, i) { // Add interactivity\n // Use D3 to select element, change color and size\n d3.select(this).style(\"fill\",\"orange\")\n .attr(\"r\", radius*2)\n\n // Specify where to put label of text\n svg.append(\"text\").attr(\"id\", \"t1337\")\n .attr(\"x\", x(d.x) - 30)\n .attr(\"y\", y(d.y) - 15)\n .text([d.x, d.y]);\n}", "function handleMouseOver(d, i) {\n d3.select(this).style('opacity', 1);\n var x = event.clientX;\n var y = event.clientY;\n\n // Display tooltip div containing the score\n // and position it according to mouse coordinates\n if (d.data.value !== undefined) {\n tooltip.style('display', 'block').style('top', y - 80 + 'px').style('left', x - 80 + 'px').html('<strong>Score<br>' + d.data.value + ' %</strong>');\n }\n }", "function RepoCount(data){\n\t// alert(data.total_count);\n\treturn data.total_count\n}", "function hover(d) {\n \n //Update position of dataView div\n var dataDiv = d3.select(\"#dataView\")\n .style(\"left\", d3.event.pageX+100 + \"px\")\n .style(\"top\", d3.event.pageY - 25 + \"px\");\n \n //Style the selected facility\n prevColor = d3.select(this).style(\"fill\");\n d3.select(this)\n .style(\"fill\", \"white\");\n// .attr(\"r\", function(d) {\n// console.log(d);\n// return this.r.animVal.value/scaleFactor} //rather than nodeSize\n// );\n \n lineGraph(d);\n \n showData(dataDiv, d);\n}", "function updateTotalAlertCount() {\n //Sum up the counts in the accordion heading spans\n var alertCountSpans = $(\"[id^='alertCount-']\");\n var alertSum = 0;\n\n if (typeof alertCountSpans != 'undefined') {\n alertCountSpans.each(function(index) {\n alertSum += parseInt(this.innerHTML);\n });\n }\n\n alertCountLabel.text(alertSum);\n setCountBubbleColor(alertSum);\n }", "function doCounter(e) {\n $.label.text = parseInt($.label.text) + 1;\n }", "function update_total_count_summary() {\r\n\t\t\t$('#flight_search_result').show();\r\n\t\t\tvar _visible_records = parseInt($('.r-r-i:visible').length);\r\n\t\t\tvar _total_records = $('.r-r-i').length;\r\n\t\t\t// alert(_total_records);\r\n\t\t\tif (isNaN(_visible_records) == true || _visible_records == 0) {\r\n\t\t\t\t_visible_records = 0;\r\n\t\t\t\t//display warning\r\n\t\t\t\t$('#flight_search_result').hide();\r\n\t\t\t\t$('#empty_flight_search_result').show();\r\n\t\t\t} else {\r\n\t\t\t\t$('#flight_search_result').show();\r\n\t\t\t\t$('#empty_flight_search_result').hide();\r\n\t\t\t}\r\n\t\t\t$('#total_records').text(_visible_records);\r\n\t\t\tif(_visible_records == 1){\r\n\t\t\t\t$('#flights_text').text('Flight');\r\n\t\t\t}\r\n\t\t\t$('.visible-row-record-count').text(_visible_records);\r\n\t\t\t$('.total-row-record-count').text(_total_records);\r\n\t\t\t\r\n\t\t}" ]
[ "0.67282546", "0.6231987", "0.58398664", "0.5573118", "0.5561016", "0.5490889", "0.5467163", "0.537842", "0.5371907", "0.53241843", "0.5315588", "0.5302775", "0.52802175", "0.52729136", "0.5270246", "0.5262978", "0.5258699", "0.5251025", "0.5248389", "0.52119786", "0.51939577", "0.51785725", "0.5177409", "0.51564676", "0.5155514", "0.5149962", "0.51448584", "0.51415074", "0.51143473", "0.51051354", "0.5092746", "0.50887716", "0.5085281", "0.50842285", "0.5077221", "0.5075498", "0.50712466", "0.5070617", "0.50701106", "0.50670934", "0.50664157", "0.50602263", "0.505981", "0.505219", "0.50515324", "0.50496453", "0.5030106", "0.5027208", "0.5025749", "0.50244176", "0.5022603", "0.5017026", "0.5016985", "0.5016907", "0.50164175", "0.5014037", "0.5013251", "0.5002561", "0.49998415", "0.49988785", "0.49939173", "0.4993119", "0.49892217", "0.4988212", "0.49873796", "0.49838436", "0.49797392", "0.49747565", "0.49716732", "0.49713153", "0.4970927", "0.49702033", "0.4966343", "0.49512398", "0.49506348", "0.49422148", "0.49381748", "0.4938006", "0.4937638", "0.49354103", "0.49320847", "0.49275815", "0.49267787", "0.4924715", "0.4920738", "0.4912632", "0.4906802", "0.49020424", "0.4901199", "0.4882844", "0.4875898", "0.48745775", "0.4872512", "0.4871585", "0.48706633", "0.48682275", "0.48668477", "0.48600683", "0.48589605", "0.48567173" ]
0.67143846
1
This function shows opportunities count and total deal amount in pipeline on mouseover
function showOppCount(oppCount) { var getDiv = document.getElementById("hoverOpp"); getDiv.innerText = oppCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElement(\"DIV\");\n wonCountLabel.className = \"wonLostLabel\";\n wonCountLabel.appendChild(document.createTextNode(saleCount));\n $('#wonOpp').append(wonCountLabel); \n}", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "function displayTotal() {\n\tscreen1.bugCount.html(prettyNumber(Math.round(state.larvae)));\n\tscreen1.larvaePerSec.html(prettyNumber(state.lps));\n}", "function updateTally(outcome) {\n totalPoints += parseInt(outcome);\n \n // Draw tally using HTML\n tally = display_element.querySelector(\".tally\");\n tally.innerHTML = `Total Points: ${totalPoints}`\n \n }", "function howManyGoals(player) {\n return player.eplGoals; // <== Highlight\n}", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function handleMouseover(d,i) {\n var placeNames = []\n for(n=0;n<adminLabelLvls.length;n++) {\n placeNames.push( toTitleCase( d.properties[adminLabelLvls[n]] ) );\n }\n var tooltipText = \"<small><span class='place-name'>\" + placeNames.join(\", \") + \"</span>\";\n var dataKey = d3.select(this).attr('data-response'); \n if(dataKey !== null) {\n d.properties.response.forEach(function(item,itemIndex){\n if(item.key == dataKey) {\n tooltipText += \" <br> Distributions: \" + commas(item.value.count) +\n \" <br> Items distributed: \" + commas(item.value.total_number);\n }\n });\n } \n tooltipText += \"</small>\";\n $('#tooltip').html(tooltipText);\n}", "function arc_onMouseOver(e,d,i) {\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n links.each(function (d) {\n total+= viz.value()(d.data);\n });\n\n total = \"$\" + d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"POLITICAL ACTION COMMITTEE\", d.data.values[0].CMTE_NM,\"Total Donated: \" + total);\n}", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function mouseover(p) {\n tooltip.style(\"visibility\", \"visible\");\n tooltip.html(names[p.y] + \" vs \" + names[p.x] + \" - Total Meetings: \" + (matrix[p.x][p.y].z + matrix[p.y][p.x].z) + \". <br/>\" + names[p.y] + \" has won \" + p.z + \" of them.\");\n d3.selectAll(\".row text\").classed(\"active\", function(d, i) {\n return i == p.y;\n });\n d3.selectAll(\".column text\").classed(\"active\", function(d, i) {\n return i == p.x;\n });\n }", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function process_count (repos) {\n var total = 0;\n repos.filter(function (r) {\n total += r.stargazers_count\n })\n \n //console.log('Total in github-starz.js : ' + total)\n user_callback(total);\n}", "function link_onMouseOver(e,d,i) {\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = \"$\" + d3.format(\",.0f\")(viz.value()(d.data));\n var date = d.data.Month + \"/\" + d.data.Day + \"/\" + d.data.Year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Received: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function displayTotalcalories() {\n //Get total calories\n const totalCalories = ItemCtr.getTotalCalories();\n //add total calories to UI\n UICtrl.showTotalCalories(totalCalories);\n }", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function showOppAmount(oppAmount) {\n var getdiv = document.getElementById(\"hoverOpp\");\n getdiv.innerText = \"\";\n var oppAmtLabel = document.createElement(\"DIV\");\n oppAmtLabel.className = \"chartBarLabel\";\n oppAmtLabel.appendChild(document.createTextNode(\"$\" + oppAmount.toLocaleString()));\n $('#hoverOpp').append(oppAmtLabel);\n}", "function link_onMouseOver(e,d,i) {\n stopAnnimation();\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = d3.format(\",.0f\")(viz.value()(d.data));\n var date = '';\n // var date = d.data.month + \"/\" + d.data.day + \"/\" + d.data.year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Sentiment index: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function onMouseoverChart(e) {\n if (e['target'] === 'node') {\n var nodeSplit = e['targetid'].split('-');\n var nodeId = nodeSplit[nodeSplit.length - 1];\n if (Number.isInteger(parseInt(nodeId)) && parseInt(nodeId) < globalEnergyData['values'].length) {\n renderPieChart(parseInt(nodeId));\n }\n } \n }", "function printTotalCost() {\n $(\".totalCost span\").append(\"<p> $\"+totalCost+ \"</p>\");\n }", "function showLeadAmount(leadAmount) {\n var getdiv = document.getElementById(\"hoverLead\");\n getdiv.innerText = \"\";\n var leadAmtLabel = document.createElement(\"DIV\");\n leadAmtLabel.className = \"chartBarLabel\";\n leadAmtLabel.appendChild(document.createTextNode(\"$\" + leadAmount.toLocaleString()));\n $('#hoverLead').append(leadAmtLabel);\n}", "function mouseover(d)\r\n\t\t\t{\r\n\t\t\t\t$(\"#col2\").text(\"\");\r\n\t\t\t\tcontent.append(\"div\").attr(\"id\",\"iw-container\").append(\"div\").attr(\"class\",\"iw-title\").append(\"i\").attr(\"class\",\"fa fa-info-circle\")\r\n\t\t\t\t.attr(\"style\",\"padding-right:20px;font-weight:bold;\")\r\n \t\t\t.text(\"\t\"+d.name)// + \" - 2013 appropriations: \" + d.appropriation13 + \" - Which was a \" + d.percentChange13 + \"% change of the previous year.\")\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Orders: \" + format(d.appropriation14/10))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" New Customers: \" + format((d.appropriation13)))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Product Lines: \" + format((d.appropriation12)))\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.attr(\"id\", \"annotate\")\r\n\t\t\t\t.text(d.annotation)\r\n\t\t\t\tif (d.annotation2 != null)\r\n\t\t\t\t{\r\n\t\t\t\tcontent1.append(\"br\")\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.text(d.annotation2);\r\n\t\t\t\t}\r\n\r\n \t\t\t}", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "function render_total(data){\n\t return '<a href=\"\">'+data+' pessoa(s)</a>';\n\t}", "function RepoCount(data){\n\t// alert(data.total_count);\n\treturn data.total_count\n}", "function getpanierItemsCount(){\n\n\ttotal=calculertotal();\n\t(document.querySelector(\"#total\")).innerHTML=(\"Total a payer \"+total+\" DH\");\n}", "function showTotalPassengerCount(){\n\t$('.passenger-count').html(passenger_count)\n}", "handleMouseOver (vis, event, d) {\n // console.log(\"hover over\", d);\n let leftPosition = event.pageX + 10 + \"px\";\n if (window.innerWidth - event.pageX < 500) {\n leftPosition = event.pageX - 300 + \"px\";\n }\n let census = vis.insights[d.count];\n let censusCount = d.count;\n let peopleCount = census ? census.total : 0;\n let censusPercent = vis.legendData.find(c => c.censusCount == d.count);\n censusPercent = censusPercent? censusPercent.censusPercent : 0;\n if ((d.count === 0 && vis.filters.length === 0) || !census) {\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n </div>`\n );\n } else if (d.count === 0) {\n let tipText = `<div>${peopleCount.toLocaleString(\"en\")} people with filter attribute</div> `;\n vis.filters.forEach(f => {\n tipText += `<div>${v2CheckBoxGuide[f].title}.</div> `;\n })\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n ${tipText}\n </div>`\n );\n } else {\n // They show up in a census\n let topPob = d3.greatest(census.pobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topAgeGroup = d3.greatest(census.ageMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCensus = d3.greatest(census.censusMap, (a, b) => d3.ascending(a[1], b[1]));\n let topGender = d3.greatest(census.genderMap, (a, b) => d3.ascending(a[1], b[1]));\n let topColor = d3.greatest(census.colorMap, (a, b) => d3.ascending(a[1], b[1]));\n let topJob = d3.greatest(census.jobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCounty = d3.greatest(census.countyMap, (a, b) => d3.ascending(a[1], b[1]));\n // console.log(topPob,topAgeGroup, topCensus );\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census</h5>\n <div> The ${peopleCount.toLocaleString(\"en\")} people in ${censusCount} census are most likely</div>\n <div> to be born in ${topPob[0]} living in ${upperCaseFirstLetters(topCounty[0])}, Nevada. </div> \n <div> Their first census was at age ${topAgeGroup[0]} in year ${topCensus[0]}. </div> \n <div> Gender \"${topGender[0]}\", \"color ${topColor[0]}\",\n and job \"${upperCaseFirstLetters(topJob[0])}\".</div> \n </div>`\n );\n }\n }", "mouseOver(panel) {\n\t}", "function addEvents() {\n total = 0;\n let activities = document.querySelectorAll(\"[type='radio']:checked ~ .activity-cost\");\n\n for (i=0; i < activities.length; i++) {\n total+= +(activities[i].innerText.substring(1))\n }\n renderTotal(total);\n}", "function onMouseOver(evt) {\n $('#event-diagnostic').text('Mouse over fired.');\n }", "function setTopoPetsCaught(){\n\tdocument.getElementById(\"topoPetsFoundTitle\").innerHTML = \"<p> Recorder: \" + topoPetsCaught.total() + \"/\" + getTotalAmountTopoPets() + \" <br/><progress id='health' value=\" + topoPetsCaught.total() + \" max=\" + getTotalAmountTopoPets() + \" style='height:1vh;width:60%;'>\";\n}", "function calculateOverview(value, overviewer, summatoryName) {\r\n if (value < overviewer.min)\r\n overviewer.min = value;\r\n if (value > overviewer.max)\r\n overviewer.max = value;\r\n summatory[`${summatoryName}`] += value;\r\n }", "function showLostSaleCount(lostCount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostCountLabel = document.createElement(\"DIV\");\n lostCountLabel.className = \"wonLostLabel\";\n lostCountLabel.appendChild(document.createTextNode(lostCount));\n $('#lostOpp').append(lostCountLabel);\n}", "getDamageAmount() {\n return 0.1 + this.operators.reduce((acc, o) => (acc + o.experience), 0);\n }", "function updatePopperDisplay (name, count, cost, display, countDisplay, costDisplay, sellDisplay) {\n\tcountDisplay.innerHTML = name + \": \" + count;\n\tcostDisplay.innerHTML = \"Cost: \" + commas(cost);\n\tif (Game.popcorn - cost >= 0) {\n\t\tdisplay.style.backgroundColor = \"blue\";\n\t\tdisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tdisplay.style.backgroundColor = \"#000066\";\n\t\tdisplay.style.cursor = \"default\";\n\t}\n\tif (count > 0) {\n\t\tsellDisplay.style.backgroundColor = \"red\";\n\t\tsellDisplay.style.color = \"white\";\n\t\tsellDisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tsellDisplay.style.backgroundColor = \"#990000\";\n\t\tsellDisplay.style.color = \"#999999\";\n\t\tsellDisplay.style.cursor = \"default\";\n\t}\n}", "function handleMouseover(d) {\n div.style(\"opacity\", 0.9)\n .style(\"left\", (d3.event.pageX + padding/2) + \"px\")\n .style(\"top\", d3.event.pageY + \"px\")\n .html(\"<p>\" + d.Name + \",&nbsp;\" + d.Nationality + \"</p><p>Year:\" + d.Year + \"&nbsp;&nbsp;&nbsp;Time:\" + timeFormat(d.Time) + \"&nbsp;&nbsp;&nbsp;Place:\" + d.Place + \"</p>\" + (d.Doping ? (\"<br><p>\" + d.Doping +\"</p\") : \"\"));\n}", "function node_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n var strSyntax = d.values[0].PTY == 'positive' ? 'Sentiment index: +' : 'Sentiment index: -'\n\n createDataTip(x + d.r, y + d.r + 25, d.values[0].CAND_ID, d.values[0].CAND_NAME, strSyntax + total);\n}", "total(){\n return operations.incomes() + operations.expenses()\n }", "function node_onMouseOver(e,d,i) {\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = \"$\" + d3.format(\",.2f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n createDataTip(x + d.r, y + d.r + 25,congress, d.values[0].CAND_NAME,\"Total Received: \" + total);\n}", "function Summary(container_id) {\n var m_data_source = null;\n var m_panel = new JSPanel(container_id);\n var m_rpt_shipping_fee = new JSRepeater('rep_shipping_fee_real');\n var m_rpt_dangdang_money = new JSRepeater('rep_dangdang_money');\n var m_rep_collection_promotion = new JSRepeater('rep_collection_promotion');\n var m_rep_order_promotion = new JSRepeater('rep_order_promotion');\n\tvar m_rpt_overseas_tax = new JSRepeater('rep_overseas_tax_real');\n\n var promo_expand_status = true;\n var shipping_fee_expand_status = true;\n var coupon_expand_status = true;\n var giftcard_expand_status = true;\n\tvar overseas_tax_expand_status = true;\n\n var obj_coupon_money_real = null;\n var obj_rep_dangdang_money = null;\n var obj_rep_order_promotion = null;\n var obj_rep_collection_promotion = null;\n var obj_rep_shipping_fee_real = null;\n\tvar obj_rep_overseas_tax_real = null;\n\t\n\tvar order_count = 0;\n\t\n\tvar is_show_free_oversea = false;\n\t\n\tvar deposit_presale_type = 0; //1代表全款支付,2代表定金和尾款分开支付\n\n this.show = function (result) {\n bindTemplate();\n addEvents();\n\n // get_order_submit_tips(m_data_source[\"is_agree\"]);\n\n //验证码\n yzmInit();\n\n //支付密码\n payPasswordInit();\n\n $1('btn_change_yzm').onclick = function () { changeYZMMarked(); };\n\n $1('ck_protocol').onclick = function () { check_protocol(); };\n }\n\n this.setDataSource = function (data_source) {\n m_data_source = data_source;\n m_panel.DataSource = data_source;\n\n m_rpt_shipping_fee.DataSource = data_source['order_list'];\n m_rpt_dangdang_money.DataSource = data_source['order_list'];\n m_rep_collection_promotion.DataSource = data_source['collection_deduct_info'];\n\n m_rep_order_promotion.DataSource = data_source['order_promotion'];\n m_rpt_overseas_tax.DataSource = data_source['order_list'];\n\n if (m_data_source[\"presale_type\"] == null) {\n deposit_presale_type = 0;\n } else {\n deposit_presale_type = m_data_source[\"presale_type\"];\n }\n }\n\n this.setSubmit = function (order_flow_submit) {\n m_order_flow_submit = order_flow_submit;\n }\n\n this.setYzmStatus = function (is_no_safe_ip) {\n m_data_source['is_no_safe_ip'] = is_no_safe_ip;\n }\n\n this.isNoSafeIp = function () {\n return m_data_source['is_no_safe_ip'];\n }\n\n var get_order_submit_tips = function (is_agree) {\n var order_submit_tips = $1('order_submit_tips');\n if (order_submit_tips != null) {\n if (!is_agree) {\n order_submit_tips.innerHTML = P_ORDER_SUBMIT_PROTOCOL_TIPS;\n $1('order_submit_tips').className = \"\";\n }\n else\n $1('order_submit_tips').className = \"objhide\";\n }\n }\n\n\n this.setSubmitErrorTips = function (submit_error_tips) {\n if (submit_error_tips)\n $s($1('order_submit_error_tips_bar'));\n else\n $h($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = submit_error_tips;\n }\n\n //点了提交按钮后的按钮变化\n this.setDisabled = function () {\n $disabled('submit');\n $wait('submit');\n }\n this.setEnabled = function () {\n $enabled('submit');\n $1('submit').style.cursor = 'pointer';\n }\n\n var check_protocol = function () {\n if ($1('ck_protocol').checked)\n $1('submit').className = \"btn btn-super-orange\";\n else\n $1('submit').className = \"btn btn-super-orange btn-super-disabled\";\n }\n\n var ipt_yzm_keyup = function (o, e) {\n var k = null;\n if (e) {\n k = e.keyCode;\n }\n else if (event) {\n k = event.keyCode;\n }\n\n if (k == 9)\n return;\n\n var ov = o.value;\n var lisi = null;\n var j = 0;\n for (var i = 0; i < yzm_array_len; i++) {\n lisi = obj_ipt_yzm_lis[i];\n if (lisi.innerHTML.startsWith(ov)) {\n $s(lisi);\n j++;\n }\n else $h(lisi);\n }\n\n if (j < 2) {\n $h(obj_ipt_yzm);\n }\n else if (j < 10) {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = 'auto';\n }\n else {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = '100px';\n }\n };\n\n var li_c = function (t) { t.className = 'li_bg'; };\n var li_r = function (t) { t.className = ''; }\n var ipt_yzm_focus = function (o) {\n\n clearYzmTips(o);\n var li_ck = function (t) { o.value = t.innerHTML; $h(obj_ipt_yzm); o.style.color = '#404040'; };\n var sb = new StringBuilder();\n for (var i = 0; i < yzm_array_len; i++) {\n sb.append(\"<li>\");\n sb.append(i);\n sb.append('</li>');\n }\n obj_ipt_yzm.innerHTML = sb.toString();\n obj_ipt_yzm_lis = obj_ipt_yzm.childNodes;\n for (var i = 0; i < yzm_array_len; i++) {\n obj_ipt_yzm_lis[i].onmouseover = function () { li_c(this); };\n obj_ipt_yzm_lis[i].onmouseout = function () { li_r(this); };\n obj_ipt_yzm_lis[i].onclick = function () { li_ck(this); };\n }\n var pos = getposOffset_c(o);\n setLocation(obj_ipt_yzm, pos[0] + 3, pos[1] + 20);\n setDimension(obj_ipt_yzm, 85, 100);\n\n if (yzm_array_len < 8)\n obj_ipt_yzm.style.height = 'auto';\n\n\n show_ipt_yzm(obj_ipt_yzm, o);\n };\n\n var show_ipt_yzm = function (z, o) {\n $s(z);\n if (document.addEventListener) {\n document.addEventListener('click', documentonclick, false);\n }\n else {\n document.attachEvent('onclick', function (e) { documentonclick(); });\n }\n\n function documentonclick() {\n var evt = arguments[0] || window.event;\n var sender = evt.srcElement || evt.target;\n\n if (!contains(z, sender) && sender != o) {\n $h(z);\n if (document.addEventListener) {\n document.removeEventListener('click', documentonclick, false);\n }\n else {\n document.detachEvent('onclick', function (e) { documentonclick(); });\n }\n }\n };\n };\n\n // show error\n function showError(error) {\n SubmitData.error = error;\n }\n // show bind error\n function showSubmitError(errorCode) {\n var error;\n switch (errorCode) {\n case 1:\n case 5:\n case 6:\n case 9:\n case 10:\n case 11:\n error = \"请填写正确的卡号\";\n break;\n case 7:\n error = \"请填写正确的密码\";\n break;\n case 12:\n error = \"激活失败\";\n break;\n default:\n error = \"礼券绑定失败\";\n }\n showError(error);\n }\n\n // clear error\n function clearError() {\n couponData.error = null;\n }\n\n function yzmInit() {\n changeYZMMarked();\n // obj_ipt_yzm = $1('ul_ipt_yzm');\n //\t $1('ipt_yzm').onkeyup=function(e){ipt_yzm_keyup(this,e);};\n\n if (m_data_source['is_no_safe_ip'] == 0) {\n $h($1('div_yzm_word'));\n }\n\n }\n\n function payPasswordInit() {\n\n var isEnable = m_data_source['payment_password_enabled'] == 1;\n isEnable = isEnable \n \t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']));\n if (isEnable) {\n if (m_data_source['is_set_payment_password']) {\n ShowOrClosePayPassWord(3);\n }\n else {\n ShowOrClosePayPassWord(0);\n }\n }\n else {\n ShowOrClosePayPassWord(2);\n }\n }\n\n function bindTemplate() {\n if (m_data_source['order_list'] != null && m_data_source['order_list'].length > 0) {\n order_count = m_data_source['order_list'].length;\n }\n m_panel.Template = ORDER_SUMMARY_TEMPLATE;\n m_data_source['bargin_total'] = formatFloat(m_data_source['bargin_total']);\n m_data_source['shipping_fee'] = formatFloat(m_data_source['shipping_fee']);\n m_data_source['promo_discount_amount'] = formatFloat(m_data_source['promo_discount_amount']);\n m_data_source['coupon_amount'] = formatFloat(m_data_source['coupon_amount']);\n m_data_source['cust_cash_used'] = formatFloat(m_data_source['cust_cash_used']);\n m_data_source['payable_amount'] = formatFloat(m_data_source['payable_amount']);\n m_data_source['gift_card_charge'] = formatFloat(m_data_source['gift_card_charge']);\n m_data_source['total_gift_package_price'] = formatFloat(m_data_source['total_gift_package_price']);\n m_data_source['gift_package_price'] = formatFloat(m_data_source['gift_package_price']);\n m_data_source['gift_package_price_tips'] = formatFloat(m_data_source['gift_package_price_tips']);\n m_data_source['greetingcard_price'] = formatFloat(m_data_source['greetingcard_price']);\n m_data_source['privilege_code_discount_amount'] = formatFloat(m_data_source['privilege_code_discount_amount']);\n m_data_source['point_deduction_amount'] = formatFloat(m_data_source['point_deduction_amount']);\n //定金和尾款金额格式化\n m_data_source['deposit_amount'] = formatFloat(m_data_source['deposit_amount']);\n m_data_source['balance_amount'] = formatFloat(m_data_source['balance_amount']);\n\t\t\n //礼品卡和礼券总金额\n m_data_source[\"coupon_and_giftcard_money_used\"]=formatFloat((+m_data_source[\"gift_card_money_used\"])+(+m_data_source[\"coupon_amount\"]));\n m_data_source[\"gift_card_money_used\"]=formatFloat(m_data_source[\"gift_card_money_used\"]);\n m_data_source[\"coupon_used\"]=formatFloat(m_data_source[\"coupon_amount\"]);\n\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['overseas_tax']);\n\t\tif(parseFloat(m_data_source['overseas_tax']) == 0){\n\t\t\tis_show_free_oversea = true;\n\t\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['free_overseas_tax']);\n\t\t} \n\t\t\n\t\t\n if (m_data_source['payable_amount'] >= 1000) {\n m_data_source['payable_amount_style'] = \"f14\";\n }\n else {\n m_data_source['payable_amount_style'] = \"f18\";\n }\n //先取值,防止设置设置支付密码后,给输入框赋了值,但重新绑定后丢失。\n var payment_password = $F(\"input_pay_password\");\n m_panel.DataBind();\n if (payment_password)\n $1(\"input_pay_password\").value = payment_password;\n\n obj_coupon_money_real = $1(\"coupon_money_real\");\n obj_rep_dangdang_money = $1(\"rep_dangdang_money\");\n obj_rep_order_promotion = $1(\"rep_order_promotion\");\n obj_rep_collection_promotion = $1(\"rep_collection_promotion\");\n obj_rep_shipping_fee_real = $1(\"rep_shipping_fee_real\");\n\t\tobj_rep_overseas_tax_real = $1(\"rep_overseas_tax_real\");\n\n\t\tif (deposit_presale_type == 1) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else if (deposit_presale_type == 2) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else {\n\t\t $1(\"div_deposit_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"div_agree_pay_deposit\").className = 'hide';\n\t\t}\n $1(\"total_shipping_fee_real\").className = 'hide';\n $1(\"total_promo_amount_real\").className = 'hide';\n $1(\"total_coupon_real\").className = 'hide';\n $1(\"total_gift_card_charge\").className = 'hide';\n $1(\"total_cust_cash_real\").className = 'hide';\n $1(\"total_cust_point_real\").className = 'hide';\n $1(\"rep_collection_promotion\").className = 'hide';\n $1(\"total_discount_code_real\").className = 'hide';\n $1(\"total_gift_package_price\").className = 'hide';\n $1(\"gift_package_price\").className = 'hide';\n $1(\"total_privilege_code_discount_amount\").className = 'hide';\n $1(\"greetingcard_price\").className = 'hide';\n\t\t$1(\"total_overseas_tax_real\").className = 'hide';\n\t\t$1(\"total_energy_saving_subsiby_amout\").className = 'hide';\n if (m_data_source['shipping_fee'] > 0) {\n $1(\"total_shipping_fee_real\").className = '';\n m_rpt_shipping_fee.ItemTemplate = RPT_SHIPPING_FEE_ITEM_TEMPLATE;\n m_rpt_shipping_fee.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_shipping_fee'] > 0) {\n dataItem['order_shipping_fee'] = formatFloat(dataItem['order_shipping_fee']);\n }\n else {\n dataItem['shipping_fee_display'] = 'hide';\n }\n }\n m_rpt_shipping_fee.DataBind();\n }\n\t\tif(m_data_source['energy_saving'] == true) {\n\t\t\t$1(\"total_energy_saving_subsiby_amout\").className = \"\";\n\t\t}\n\t\tif (m_data_source['is_overseas'] == true) {\n\t\t\t\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"default\";\n\t\t\t} else {\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"\";\n\t\t\t}\n $1(\"total_overseas_tax_real\").className = '';\n m_rpt_overseas_tax.ItemTemplate = RPT_OVERSEAS_TAX_ITEM_TEMPLATE;\n m_rpt_overseas_tax.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['is_overseas'] == true) {\n\t\t\t\t\tif(formatFloat(dataItem['overseas_tax']) == 0){\n\t\t\t\t\t\tdataItem['default_class'] = \"default\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['free_overseas_tax']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdataItem['default_class'] = \"\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['overseas_tax']);\n\t\t\t\t\t}\n }\n else {\n dataItem['overseas_tax_display'] = 'hide';\n }\n }\n m_rpt_overseas_tax.DataBind();\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$(\"#oversea_icon_free\").show();\n\t\t\t} else {\n\t\t\t\t$(\"#oversea_icon_free\").hide();\n\t\t\t}\n\t\t\tif(order_count == 1){\n\t\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t\t}\n }\n if (m_data_source['promo_discount_amount'] > 0) {\n $1(\"total_promo_amount_real\").className = '';\n if (m_data_source['collection_deduct_info']!=undefined && m_data_source['collection_deduct_info'].length > 0) {\n $1(\"rep_collection_promotion\").className = '';\n m_rep_collection_promotion.ItemTemplate = RPT_PROMOTION_ITEM_TEMPLATE;\n m_rep_collection_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_direct_discount_amount'] > 0) {\n dataItem['order_direct_discount_amount'] = formatFloat(dataItem['order_direct_discount_amount']);\n }\n else {\n dataItem['order_direct_discount_amount'] = 'hide';\n }\n dataItem['collection_promotion_desc_tips'] = dataItem['collection_promotion_desc'];\n dataItem['collection_promotion_desc'] = nTruncate(dataItem['collection_promotion_desc'], 10);\n }\n m_rep_collection_promotion.DataBind();\n }\n\n m_rep_order_promotion.ItemTemplate = RPT_ORDER_PROMOTION_ITEM_TEMPLATE;\n m_rep_order_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n\n if (dataItem['order_prom_subtract'] > 0) {\n $s($1(\"rep_order_promotion\"));\n dataItem['order_prom_subtract'] = formatFloat(dataItem['order_prom_subtract']);\n }\n else {\n dataItem['order_promotion_display'] = 'hide';\n }\n dataItem['shop_promo_msg_tips'] = dataItem['shop_promo_msg'];\n dataItem['shop_promo_msg'] = nTruncate(dataItem['shop_promo_msg'], 10);\n }\n m_rep_order_promotion.DataBind();\n }\n \n //if(+m_data_source[\"coupon_and_giftcard_money_used\"]>0){ \n \t //礼品卡显示\n $1(\"total_giftcard_real\").className = 'hide';\n if(+m_data_source[\"gift_card_money_used\"]>0){ \t \n \t$1(\"total_giftcard_real\").className = '';\n m_rpt_dangdang_money.ItemTemplate = RPT_COUPON_ITEM_TEMPLATE;\n m_rpt_dangdang_money.onItemDataBind = function (dataItem) {\n if (+dataItem['cust_gift_card_used'] > 0) {\n \t dataItem['cust_gift_card_used'] = formatFloat(dataItem['cust_gift_card_used']);\n }\n else {\n dataItem['coupon_amount_display'] = 'hide';\n }\n };\n m_rpt_dangdang_money.DataBind(); \n }\n \n if (m_data_source['coupon_used'] > 0) {\n \t$1(\"total_coupon_real\").className = '';\n switch (+m_data_source['coupon_type']) {\n case 1:\n case 9: \n obj_coupon_money_real.className = 'p-child';\n break; \n case 4:\n $1(\"total_discount_code_real\").className = '';\n $1(\"total_coupon_real\").className = 'hide';\n break;\n default:\n break;\n }\n \n }\n \n\n\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"total_gift_package_price\");\n }\n\n if (m_data_source['gift_package_price'] == 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"greetingcard_price\");\n }\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] == 0) {\n $S(\"gift_package_price\");\n }\n\n\n if (+m_data_source['gift_card_charge'] > 0) {\n $1(\"total_gift_card_charge\").className = '';\n }\n\n if (m_data_source['cust_cash_used'] > 0) {\n $S(\"total_cust_cash_real\");\n }\n if (m_data_source['point_deduction_amount'] > 0) {\n $S(\"total_cust_point_real\");\n }\n if (!m_data_source['is_agree']) {\n $s($1('div_ck_protocol'));\n }\n if (+m_data_source['privilege_code_discount_amount'] > 0) {\n $1(\"total_privilege_code_discount_amount\").className = '';\n }\n }\n\n\n function getEvent() {\n if (document.all) {\n return window.event; //for ie\n }\n func = getEvent.caller;\n while (func != null) {\n var arg0 = func.arguments[0];\n if (arg0) {\n if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof (arg0) == \"object\" && arg0.preventDefault && arg0.stopPropagation)) {\n return arg0;\n }\n }\n func = func.caller;\n }\n return null;\n }\n\n // events\n function addEvents() {\n if (deposit_presale_type == 2) {\n $1('presale_mobile').onkeydown = function () {\n $1('presale_mobile').className = \"input-w87\";\n $h($1('order_submit_error_tips_bar'));\n var ev = getEvent();\n if (ev.keyCode >= 48 && ev.keyCode <= 57) { return; }\n if (ev.keyCode >= 96 && ev.keyCode <= 105) { return; }\n if (ev.keyCode == 8 || ev.keyCode == 46 || ev.keyCode == 37 || ev.keyCode == 39) { return; }\n return false;\n }\n }\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n $1('agree_pay_deposit').onclick = function () {\n if ($1('agree_pay_deposit').checked == true) {\n $1(\"submit\").className = ' btn btn-super-orange';\n } else {\n $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n }\n }\n }\n $1('shipping_fee_detail_link').onclick = function () {\n if (shipping_fee_expand_status) {\n $h(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-open';\n shipping_fee_expand_status = false;\n }\n else {\n $s(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-close';\n shipping_fee_expand_status = true;\n }\n }\n\t\tif(order_count == 1){\n\t\t\t$(\"#shipping_fee_detail_link\").click();\n\t\t}\n\n $1('promo_detail_link').onclick = function () {\n if (promo_expand_status) {\n $h(obj_rep_collection_promotion);\n $h(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-open';\n promo_expand_status = false;\n }\n else {\n $s(obj_rep_collection_promotion);\n $s(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-close';\n promo_expand_status = true;\n }\n }\n\n $1('giftcard_detail_link').onclick = function () {\n if (giftcard_expand_status) {\n $h(obj_rep_dangdang_money);\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-open';\n giftcard_expand_status = false;\n }\n else {\n \tvar isUseGiftcard=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.GiftCard);//if m_data_source['coupon_type'] == 1\n if (isUseGiftcard) {\n $s(obj_rep_dangdang_money);\n }\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-close';\n giftcard_expand_status = true;\n }\n }\n $1('coupon_detail_link').onclick = function () {\n if (coupon_expand_status) {\n $h(obj_coupon_money_real);\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-open';\n coupon_expand_status = false;\n }\n else {\n \tvar isUseCoupon=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.Coupon);//if m_data_source['coupon_type'] == 1\n if (isUseCoupon) {\n $s(obj_coupon_money_real);\n }\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-close';\n coupon_expand_status = true;\n }\n }\n\n\n $1('submit').onclick = function () {\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n if ($1('submit').className.indexOf(\"disabled\") > 0) {\n return;\n }\n }\n var presale_mobile = \"\";\n\t\t\tif (deposit_presale_type == 2) {\n\t\t\t\tvar reg = /^((14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0-9])|(17[0-9]))\\d{8}$/;\n\t\t\t\tpresale_mobile = $1(\"presale_mobile\").value;\n\t\t\t\tif (presale_mobile == null || !reg.test(presale_mobile)) {\n\t\t\t\t\t$s($1('order_submit_error_tips_bar'));\n\t\t\t\t\t$1('order_submit_error_tips').innerHTML = '手机号码格式错误';\n\t\t\t\t\t$1('presale_mobile').className = \"input-w87 input-red\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n //虚拟礼品卡密钥验证\n var orders = m_data_source[\"order_list\"];\n var firtKey;\n var mobileNumber;\n for (var i = 0; i < orders.length; i++) {\n if (orders[i][\"order_type\"] == 50) {\n var success = VirtualGiftCard.submitCheckVirtualKey();\n if (!success) {\n window.location.hash = \"#GiftCardUserKey\";\n return false;\n } else {\n firtKey = $1('txt_first_key').value;\n mobileNumber = $F('txt_mobile_number');\n }\n \n }\n }\n if (!m_data_source['is_agree'] && !$1('ck_protocol').checked)\n return;\n\n var s_pay_password = \"\";\n\n if (m_data_source['payment_password_enabled'] == 1 \n \t\t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']))) {\n if (!m_data_source['is_set_payment_password'] && $1('div_pay_password').style.display == \"none\") //新增 \n {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请设置支付密码';\n return;\n }\n\n s_pay_password = $F('input_pay_password');\n if (s_pay_password == null || s_pay_password == '') {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入支付密码';\n return;\n }\n var paypwdlen = getLength(s_pay_password);\n if (paypwdlen < 6 || paypwdlen > 20) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入正确的支付密码';\n return;\n }\n }\n\n var s_sign = \"\";\n\n if (m_data_source[\"is_no_safe_ip\"] == 1) {\n s_sign = $F('ipt_yzm');\n if (s_sign == null || s_sign == '' || s_sign.indexOf(\"&\") >= 0) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请填写验证码';\n return;\n }\n }\n m_order_flow_submit(s_sign, m_data_source['shop_id'], encodeURIComponent(s_pay_password), firtKey, mobileNumber, m_data_source['product_ids'], m_data_source['sk_action_id'], presale_mobile);\n return false;\n }\n\t\t\n\t\t$1('overseas_tax_detail_link').onclick = function () {\n if (overseas_tax_expand_status) {\n $h(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-open';\n overseas_tax_expand_status = false;\n }\n else {\n $s(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-close';\n overseas_tax_expand_status = true;\n }\n }\n\t\t\n\t\tif(order_count == 1){\n\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t}\n }\n}", "function addexptototal()\n {\n const expobj={};\n //read the value of inputamt\n const textamt=inputele.value;\n\n const textdesc=inputele2.value;\n \n //convert it to number\n const exp=parseInt(textamt,10);\n\n expobj.desc=textdesc;\n expobj.amt=textamt;\n expobj.moment=new Date();\n\n allexp.push(expobj);\n \n \n //add that value to totalvalue\n totalexp=totalexp+exp;\n \n hele.textContent=totalexp;\n\n const headingtext=`Total :: ${totalexp}`;\n hele.textContent=headingtext;\n\n renderlist(allexp);\n \n }", "function showTotalIncident(transport) {\n let total = data.dataModified.get(\"1960\")[transport].length;\n let years = document.getElementById(\"selectYear\").value;\n\n document.getElementById(\"showTotalIncident\").innerHTML = total;\n document.getElementById(\"percent1\").innerHTML = \"Aire = \" + data.percent(years).percentair + \" %\";\n document.getElementById(\"percent2\").innerHTML = \"Tierra = \" + data.percent(years).percentland + \" %\";\n document.getElementById(\"percent3\").innerHTML = \"Agua = \" + data.percent(years).percentWater + \" %\";\n\n}", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function details_on_demand(d) {\n\t\n\tvar sp_dot = document.getElementById(\"sp\"+d.Team);\n\tvar tm_node = document.getElementById(\"tm\"+d.Team);\n\t\n\t// Save old state of dot\n\told_dot = sp_dot.getAttribute(\"r\");\n\told_opacity = sp_dot.getAttribute(\"opacity\");\n\t\n\t// Make team's dot bigger \n\tsp_dot.setAttribute(\"r\", big_dot); \n\t// Make team's node \"brighter\"\n\ttm_node.style.opacity = \".7\";\n\t\n\t\n\tteams.forEach(function(team) {\n\t\tdocument.getElementById(\"sp\"+team).setAttribute(\"opacity\", .1);\n\t});\n\tsp_dot.setAttribute(\"opacity\", 1);\n\t\n\ttooltip.transition()\n\t .duration(100)\n\t .style(\"opacity\", .85)\n\t .style(\"background\", \"#0b0b0d\")\n\t .style(\"border\", \"2px solid black\")\n\t .style(\"color\", \"#FFFFFF\")\n\t .style(\"max-width\", \"auto\")\n\t .style(\"height\", \"auto\");\n\t \n\t \n\ttooltip.html(\n\t \"<img src='\" + logos[d.Team] + \"' width='50' height='50' style='float: left; padding-right: 10px; vertical-align: middle'>\" +\n\t\t \"<b>\" + d[\"Team\"] + \"<b><br/><br/>\\t Salary: <b>\" + curr_fmt(xValue(d)*1000000) + \"</b><br/>\\t Wins: <b>\" + yValue(d) + \n\t\t \"</b>; Losses: <b>\" + d[season+\"Loss\"] + \"</b>\")\n\t .style(\"left\", d[\"Team\"] ? (d3.event.x + document.body.scrollLeft - 90) + \"px\": null)\n\t .style(\"top\", d[\"Team\"] ? (d3.event.y + document.body.scrollTop - 70) + \"px\": null)\n\t .style(\"padding\", \"5px\")\n\t .style(\"padding-left\", \"10px\")\n\t .style(\"font-size\", \"11px\");\n}", "function showDataPointCount() {\n $('.dataPoints').html('<span class=\"bold\">' + dataPointCounter + ' p/s</span>');\n dataPointCounter = 0;\n}", "function calculateTip(amount, service, people) {\n const totalTip = (amount * service)/people;\n console.log(totalTip); \n renderTip(totalTip);\n}", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "incomeOverTime() {\n return `Your weekly income will be Ksh ${this.totalProduction() * 7}\nYour yearly income will be Ksh ${this.totalProduction() * 366}`;\n }", "getTotalMenuPrice() {\n return this.menu.reduce((a,b) => a+b.pricePerServing, \" \") * this.getNumberOfGuests();\n }", "function arc_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n var num = 0;\n var average = 0;\n links.each(function (d) {\n num ++;\n total+= viz.value()(d.data);\n });\n\n total = d3.format(\",.0f\")(total);\n\n average = d3.format(\",.0f\")(total / num);\n // console.log('number: ' + num);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"NEWS SOURCE\", d.data.values[0].CMTE_NM,\"Sentiment index: \" + total);\n}", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n if(row.votecount != \"\") {\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\" (\"+row.percentage+\")\" + \"</li>\"\n }\n\t });\n\t return text;\n\t}", "function createMousoverHtml(d) {\n\n var html = \"\";\n html += \"<div class=\\\"tooltip_kv\\\">\";\n html += \"<span class=\\\"tooltip_key\\\">\";\n html += d['Item'];\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Total Accidents: \"\n try {\n html += (d[\"Total_Accidents\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: \"\n html += (d[\"Fatal\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: \"\n html += (d[\"Serious\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: \"\n html += (d[\"Minor\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: \"\n html += (d[\"Uninjured\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>VMC: \"\n html += (d[\"VMC\"]);\n html += \" IMC: \"\n html += (d[\"IMC\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Destroyed: \"\n html += (d[\"Destroyed_Damage\"]);\n html += \" Substantial: \"\n html += (d[\"Substantial_Damage\"]);\n html += \" Minor: \"\n html += (d[\"Minor_Damage\"]);\n }\n catch (error) {\n html = html.replace(\"<a>Total Accidents: \", \"\")\n html += \"<a>Total Accidents: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: 0\"\n }\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"</div>\";\n $(\"#tooltip-container-scatter\").html(html);\n $(this).attr(\"fill-opacity\", \"0.8\");\n $(\"#tooltip-container-scatter\").show();\n\n //quello commentato ha senso, ma scaja\n //var map_width = document.getElementById('scatter').getBoundingClientRect().width;\n var map_width = $('scatter')[0].getBoundingClientRect().width;\n //console.log($('scatter'))\n\n //console.log('LAYER X ' + d3.event.layerX)\n //console.log('LAYER Y ' + d3.event.layerY)\n\n if (d3.event.layerX < map_width / 2) {\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX + 15) + \"px\");\n } else {\n var tooltip_width = $(\"#tooltip-container-scatter\").width();\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX - tooltip_width - 30) + \"px\");\n }\n}", "function mouseover() {\n\ttiptool_div.style(\"display\", \"inline\");\n\t}", "function overSkill0() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = skillsDescArray[0]\r\n}", "function _displayTotalRevenueOfOwner(list) {\n totalRevenue = list.reduce((prevVal, currVal) => {\n const val = currVal.cost;\n return {\n subTotal: prevVal.subTotal + val.subTotal,\n serviceTax: prevVal.serviceTax + val.serviceTax,\n swachhBharatCess: prevVal.swachhBharatCess + val.swachhBharatCess,\n krishiKalyanCess: prevVal.krishiKalyanCess + val.krishiKalyanCess,\n total: prevVal.total + val.total,\n tax: currVal.tax,\n }\n }, {\n subTotal: 0,\n serviceTax: 0,\n swachhBharatCess: 0,\n krishiKalyanCess: 0,\n total: 0,\n });\n console.log('Total Revenue');\n _displayLog(totalRevenue);\n }", "function mouseover(d) {\n var shiftX = 10;\n var shiftY = 20;\n\n var mouseCoords = d3.mouse(this);\n d3.select(\"#tooltip\")\n .style(\"left\", function(d) {\n return mouseCoords[0] + shiftX + \"px\"\n })\n .style(\"top\", function(d) {\n return mouseCoords[1] + shiftY + \"px\"\n })\n .html(function() {\n if (d.energy[1990] == null || d.energy[currentYear][\"All products\"] == 0) return d.name + \": No data\";\n\n var all = d.energy[currentYear][\"All products\"];\n var renewable = d.energy[currentYear][\"Renewable energies\"];\n var per = renewable / all;\n\n hoverArrow(per);\n\n return \"<b>\" + d.name + \"</b><br/>\" + fmtPer(per) + \" renewables\"\n })\n .classed(\"hidden\", false);\n}", "function handleMouseOver(d, i) {\n\nd3.selectAll(\".visualCircle\").transition()\n .duration(200)\n .style(\"opacity\", 1)\n .attr(\"fill\", \"rgba(255,255,255,0.8)\")\n .attr(\"r\", circleRBefore);\n\nd3.selectAll(\".visualLabel\").transition()\n .duration(200)\n .style(\"opacity\", 0);\n\nd3.select(\"#circle_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 0.2)\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .attr(\"r\", circleRAfter);\n\nd3.select(\"#text_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 1);\n \ndocument.getElementById(\"type680target\").innerHTML = \"<h4>\" + itemTitles[this.id] + \"</h4><hr class='light' style='margin-left: 0px;'><p class='text-justify'>\" + itemDescriptions[this.id] + \"</p>\";\n\n}", "function rect_mouseover() {\n\t\t\tpercentText.style(\"opacity\", 1)\n\t\t\tapproveText.style(\"opacity\", 1)\n\t\t\tfocusDate.style(\"opacity\", 1)\n\t\t}", "function onMouseOver(d, i) {\n\t d3.select(this).attr('class', 'highlight');\n\t d3.select(this)\n\t .transition()\n\t .duration(400)\n\t .attr('width', xScale.bandwidth() + 5)\n\t .attr(\"y\", function(d) { return yScale(d.popularity) - 10; })\n\t .attr(\"height\", function(d) { return innerHeight1 - yScale(d.popularity) + 10; });\n\n\t g.append(\"text\")\n\t .attr('class', 'val') // add class to text label\n\t .attr('x', function() {\n\t return xScale(d.artists);\n\t })\n\t .attr('y', function() {\n\t return yScale(d.popularity) - 15;\n\t })\n\t .text(function() {\n\t return d.popularity; // Value of the text\n\t });\n\t}", "function mouseover() {\n //convert the slider value to the correct index of time in mapData\n spot = d3.select(this);\n if (!spot.classed('hidden-spot')) {\n index = rangeslider.value - 5\n let occupant = mapData[spot.attr(\"id\")][index];\n tooltip\n .html(mapData[spot.attr(\"id\")][0] + ': ' + (occupant === \"\" ? \"Unoccupied\" : occupant))\n .style(\"opacity\", 1);\n }\n}", "function addCount() {\n count++;\n $('.count').html(count);\n }", "function feedTotalHitCount(totalHitCount){\r\n var totalHitCountSelector = document.getElementById(\"total-hit-count\");\r\n totalHitCountSelector.innerHTML = totalHitCount;\r\n $(\"#total-hit-spinner\").hide();\r\n }", "function mouseoverNode(d){\n\t\n\tvar disVal;\n\tif(showFlowIn){\n\t\tdisVal = \"Flow In Value: \"+d.flowInto;\n\t}\n\telse{\n\t\tdisVal = \"Flow Out Value: \"+d.flowOut;\n\t}\n\n\tdocument.getElementById(\"nodeval\").textContent = disVal;\n}", "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "displayResult(tip, total) {\r\n this.tipAmount.innerText = this.tipAmount.innerText.replace(/[^$].+/, tip);\r\n this.totalAmount.innerText = this.totalAmount.innerText.replace(/[^$].+/, total);\r\n }", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n\t\tif (row.votecount.length != 0){\n\t \n\t\t\ttext += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n\t\t}\n\t });\n\n\t return text;\n\t}", "function calcTotal (){\n totalLabel.innerHTML = 'Total: $' + value;\n}", "function counter(){\n // console.log(\"counter is working\",data);\n for(let i=0; i< data.length; i++){\n if(data[i].eco == \"1\"){\n plasticCounter = plasticCounter + 100;\n }\n else if(data[i].average == \"2\"){\n plasticCounter = plasticCounter + 200;\n console.log(plasticCounter);\n }\n else if(data[i].bad == \"3\"){\n plasticCounter = plasticCounter + 300;\n }\n };\n document.getElementById(\"myText\").innerHTML = plasticCounter;\n}", "function updateEpidemicStats(agentmap) {\n var infected_display = document.getElementById(\"infected_value\");\n // infected_display.textContent = agentmap.infected_count;\n\n var healthy_display = document.getElementById(\"healthy_value\");\n // healthy_display.textContent =\n // agentmap.agents.count() - agentmap.infected_count;\n}", "function showTotal(start,end){\n $.ajax({\n type: \"GET\",\n async:false,\n url: 'https://'+BALLERINA_URL+'/pmt-dashboard-serives/loaddashboard/'+start+'/'+end,\n success: function(jsonResponse){\n document.getElementById('proactive').innerHTML = jsonResponse.proactiveCount;\n document.getElementById('reactive').innerHTML = jsonResponse.reactiveCount;\n document.getElementById('unCategory').innerHTML = jsonResponse.uncategorizedCount;\n document.getElementById('queuedPatchCount').innerHTML = jsonResponse.yetToStartCount;\n document.getElementById('completePatchCount').innerHTML = jsonResponse.completedCount;\n document.getElementById('partiallyCompletePatchCount').innerHTML = jsonResponse.partiallyCompletedCount;\n document.getElementById('inProcessPatchCount').innerHTML = jsonResponse.inProgressCount;\n document.getElementById('overETAcount').innerHTML = '('+jsonResponse.ETACount+'<span style=\"font-size:12px;\"> over ETA</span>)';\n totalProducts = jsonResponse.menuDetails.allProducts.length;\n menuDrillDown = jsonResponse.menuDetails.allProducts;\n versionCount = jsonResponse.menuDetails.allVersions.length;\n menuVersionDrillDown = jsonResponse.menuDetails.allVersions;\n\n }\n });\n}", "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "refreshTotalCalories() {\n UISelectors.totalCaloriesDisplay.textContent = ItemCtrl.getTotalCalories();\n }", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "getTotalCalories() {\n return this.state.breakfast.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.lunch.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.dinner.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.snacks.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0);\n }", "function showDetail(event, key, amount, count, percent) {\n\n // show tooltip with information from the __data__ property of the element\n var x_hover = 0;\n var y_hover = 0;\n\n var content = \"<b>\" + key + \"</b><br/>\";\n\n if (amount != null) content += \"<b>Amount: </b>\" + amount + \"<br/>\";\n if (count != null) content += \"<b>Count: </b>\" + count + \"<br/>\";\n if (percent != null) content += \"<b>Percent: </b>\" + percent + \"<br/>\";\n\n var tooltipWidth = parseInt(tooltip.style('width'));\n var tooltipHeight = parseInt(tooltip.style('height'));\n var classed,notClassed;\n \n if (event.pageX > document.body.clientWidth / 2) {\n x_hover = tooltipWidth + 30;\n classed = 'right';\n notClassed = 'left';\n } else {\n x_hover = -30;\n classed = 'left';\n notClassed = 'right';\n }\n \n // y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight + 4) : event.pageY - tooltipHeight / 2;\n y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight - 40) : event.pageY - tooltipHeight - 40;\n\n return tooltip\n .classed(classed,true)\n .classed(notClassed,false)\n .style({\n \"visibility\": \"visible\",\n \"top\": y_hover + \"px\",\n \"left\": (event.pageX - x_hover) + \"px\"\n })\n .html(content);\n}", "function visualizeExtraRunsConcededByEachTeam(extraRunsConcededByEachTeam) {\n let seriesData = [];\n for (let key in extraRunsConcededByEachTeam) {\n seriesData.push([key, extraRunsConcededByEachTeam[key]]);\n }\n console.log(seriesData);\n Highcharts.chart(\"extra-runs-conceded-by-each-team\", {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: 0,\n plotShadow: false,\n },\n title: {\n text: \"Extra Runs Conceded<br>by Each Team<br>2016\",\n align: \"center\",\n verticalAlign: \"middle\",\n y: 75,\n },\n tooltip: {\n pointFormat: \"{series.name}: <b>{point.percentage:.1f}</b>\",\n },\n accessibility: {\n point: {\n valueSuffix: \"%\",\n },\n },\n plotOptions: {\n pie: {\n dataLabels: {\n enabled: true,\n distance: -90,\n style: {\n fontWeight: \"bold\",\n color: \"grey\",\n },\n },\n startAngle: -90,\n endAngle: 90,\n center: [\"50%\", \"75%\"],\n size: \"150%\",\n },\n },\n series: [\n {\n type: \"pie\",\n name: \"Browser share\",\n innerSize: \"75%\",\n data: seriesData,\n },\n ],\n });\n}", "function showSeatPrice (container, unitDetailHtml) {\n // $(document).on('mouseover', '.asiento', function (e) {\n if (!$(container).hasClass('ocupado') && !$(container).hasClass('asignado')) {\n var specialTooltipFix = false\n $('.tooltip-asiento').remove()\n var position = 'En medio'\n var newCopy = 'Cambia tu asiento por'\n var evalPos = $(container).attr('name')\n evalPos = evalPos.split(' ')\n if (evalPos[1] == 'C' || evalPos[1] == 'D') {\n position = 'Pasillo'\n }\n if (evalPos[1] == 'A' || evalPos[1] == 'F') {\n position = 'Ventana'\n }\n var precio = '<span class=\"seat-price\">$489 MXN</span>'\n var specialSeat = '<span class=\"exit-row\">Fila de salida de emergencia</span>'\n var asientoID = '<span class=\"seat-num\">' + ($(container).attr('name')).replace('-', '') + '</span>'\n var addHover = '<div style=\"position:absolute; height:250%; width:700%;\" class=\"tooltip-asiento\"><p>'\n if ($(container).hasClass('especial')) {\n addHover += '' + asientoID + ' ' + newCopy + ' ' + specialSeat + ' ' + precio + ''\n specialTooltipFix = true\n }else {\n addHover += '' + asientoID + ' ' + newCopy + ' ' + precio + ''\n specialTooltipFix = false\n }\n // addHover += '</p></div>'\n addHover = unitDetailHtml\n $(container).append(addHover)\n\n // If tooltip is too close to left, right or bottom edges this adds the classes that change the styles\n var popUpOffset = $($(container).find('.tooltip-asiento')[0]).offset()\n\n if (popUpOffset.top > $(window).height() - 160) {\n $($(container).find('.tooltip-asiento')[0]).addClass('bottom-margin')\n if (specialTooltipFix) {\n $($(this).find('.tooltip-asiento')[0]).css('margin-top', '-145px')\n }else {\n $($(this).find('.tooltip-asiento')[0]).css('margin-top', '-105px')\n }\n }else {\n $($(container).find('.tooltip-asiento')[0]).removeClass('bottom-margin')\n }\n if (popUpOffset.left < 0) {\n $($(container).find('.tooltip-asiento')[0]).addClass('left-margin')\n }else {\n $($(container).find('.tooltip-asiento')[0]).removeClass('left-margin')\n }\n if (popUpOffset.left > $(window).width() - 190) {\n $($(container).find('.tooltip-asiento')[0]).addClass('right-margin')\n }else {\n $($(container).find('.tooltip-asiento')[0]).removeClass('right-margin')\n }\n\n // on Internet Explorer there is an issue with positioning after styles, this solves the issue\n if (msieversion()) {\n var thisLeft = $($(container).find('.tooltip-asiento')[0]).position().left\n var thisStringLeft = (thisLeft - 125).toString()\n $($(this).find('.tooltip-asiento')[0]).css('left', thisStringLeft + 'px')\n }\n }\n // on Safari there is an issue regarding scrolling of seats, this solves the issue\n if (is_safari) {\n $('#asientos-en-avion-filas').click()\n $('#asientos-en-avion-filas').focus()\n }\n // })\n // Once you stop hovering over a seat, the tooltip is removed\n $(document).on('mouseleave', '.asiento', function (e) {\n $('.tooltip-asiento').remove()\n })\n}", "function treeCuttingTotal() {\nvar total_number_tree = {\nonStatisticField: \"CommonName\",\noutStatisticFieldName: \"total_number_tree\",\nstatisticType: \"count\"\n};\n\nvar query = treeLayer.createQuery();\nquery.outStatistics = [total_number_tree];\n\nreturn treeLayer.queryFeatures(query).then(function(response) {\nvar stats = response.features[0].attributes;\nconst totalNumber = stats.total_number_tree;\n//const LOT_HANDOVER_PERC = (handedOver/affected)*100;\nreturn totalNumber;\n});\n}", "function GetSummary() {\n var YearQuery = '';\n if (FilterList.DashboardFilterYear === '') {\n YearQuery =\n ' business_year = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('YYYY') +\n \"'\";\n } else {\n YearQuery =\n ' business_year = ' + \"'\" + FilterList.DashboardFilterYear + \"'\";\n }\n\n var MonthQuery = '';\n if (FilterList.DashboardFilterMonth === '') {\n MonthQuery =\n ' and business_month = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('MMMM') +\n \"'\";\n } else {\n MonthQuery =\n ' and business_month = ' + \"'\" + FilterList.DashboardFilterMonth + \"'\";\n }\n\n var TeamQuery = '';\n if (\n FilterList.DashboardFilterTeam === '' ||\n FilterList.DashboardFilterTeam === 'ALL'\n ) {\n TeamQuery = ' and team IN ' + global.TeamAccessList;\n } else {\n TeamQuery = ' and team = ' + \"'\" + FilterList.DashboardFilterTeam + \"'\";\n }\n\n var VendorQuery = '';\n if (\n FilterList.DashboardFilterVendor === '' ||\n FilterList.DashboardFilterVendor === 'ALL'\n ) {\n VendorQuery = ' and principal_name like ' + \"'%%' \";\n } else {\n VendorQuery =\n ' and principal_name = ' + \"'\" + FilterList.DashboardFilterVendor + \"'\";\n }\n\n dbperymtsat.transaction((tx) => {\n tx.executeSql(\n 'SELECT SUM(amount) as amount , SUM(target) as target FROM perymtsat_tbl where ' +\n YearQuery +\n MonthQuery +\n TeamQuery +\n VendorQuery +\n ' order by invoice_date asc ',\n [],\n (tx, results) => {\n var len = results.rows.length;\n if (len > 0) {\n // console.log(results.rows.item(0).target);\n //console.log(results.rows.item(0).amount);\n //setTotalSales();\n setTotalTarget(parseInt(results.rows.item(0).target));\n setTotalSales(parseInt(results.rows.item(0).amount));\n settotalSalesAnimation(true);\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n\n // console.log(\n // 'Successfully got summary of ' +\n // FilterList.DashboardFilterMonth +\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n // );\n }\n },\n SQLerror,\n );\n });\n }", "function gridOnHandler(){\r\n \r\n gridSimulatorVar.current_counter = 0\r\n paintGridOnHover(this)\r\n paintGridCounter(gridSimulatorVar.current_counter)\r\n\r\n}", "function hoverPanelRelated () {\n $('.browseview .relatedContainer .panel').on({\n mouseenter: function () {\n $(this).children().css({'background-color': '#68C3A3', 'color': 'black', 'transition': 'all 0.3s ease', '-webkit-transform': 'scale(1.05)', '-ms-transform': 'scale(1.05)', 'transform': 'scale(1.05)'})\n },\n mouseleave: function () {\n $(this).children().css({'background-color': '#f5f5f5', 'color': '#717f86', 'transition': 'all 0.3s ease', '-webkit-transform': 'scale(1.0)', '-ms-transform': 'scale(1.0)', 'transform': 'scale(1.0)'})\n },\n click: function () {\n window.location = $(this).children('.viewbutton').attr('href')\n }\n })\n }", "function update_total_count_summary() {\r\n\t\t\t$('#flight_search_result').show();\r\n\t\t\tvar _visible_records = parseInt($('.r-r-i:visible').length);\r\n\t\t\tvar _total_records = $('.r-r-i').length;\r\n\t\t\t// alert(_total_records);\r\n\t\t\tif (isNaN(_visible_records) == true || _visible_records == 0) {\r\n\t\t\t\t_visible_records = 0;\r\n\t\t\t\t//display warning\r\n\t\t\t\t$('#flight_search_result').hide();\r\n\t\t\t\t$('#empty_flight_search_result').show();\r\n\t\t\t} else {\r\n\t\t\t\t$('#flight_search_result').show();\r\n\t\t\t\t$('#empty_flight_search_result').hide();\r\n\t\t\t}\r\n\t\t\t$('#total_records').text(_visible_records);\r\n\t\t\tif(_visible_records == 1){\r\n\t\t\t\t$('#flights_text').text('Flight');\r\n\t\t\t}\r\n\t\t\t$('.visible-row-record-count').text(_visible_records);\r\n\t\t\t$('.total-row-record-count').text(_total_records);\r\n\t\t\t\r\n\t\t}", "function lotTotalArea() {\nvar total_affected_area = {\nonStatisticField: \"AffectedArea\",\noutStatisticFieldName: \"total_affected_area\",\nstatisticType: \"sum\"\n}\n\nvar total_handover_area = {\nonStatisticField: \"HandOverArea\",\noutStatisticFieldName: \"total_handover_area\",\nstatisticType: \"sum\"\n};\n\nvar query = lotLayer.createQuery();\nquery.outStatistics = [total_affected_area, total_handover_area];\n\nreturn lotLayer.queryFeatures(query).then(function(response) {\nvar stats = response.features[0].attributes;\n\nconst totalAffected = stats.total_affected_area;\nconst totalHandedOver = stats.total_handover_area;\n//const LOT_HANDOVER_PERC = (handedOver/affected)*100;\nreturn totalAffected;\n});\n}", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "function pop_Edmonton_Centre_2016_Census_Median_Income_Poll_DA_Unions_2(feature, layer) {\n layer.on({\n mouseout: function(e) {\n for (i in e.target._eventParents) {\n e.target._eventParents[i].resetStyle(e.target);\n }\n },\n mouseover: highlightFeature,\n });\n var popupContent = '<table>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Name'] !== null ? autolinker.link(feature.properties['Name'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Descriptio'] !== null ? autolinker.link(feature.properties['Descriptio'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Descript_1'] !== null ? autolinker.link(feature.properties['Descript_1'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Descript_2'] !== null ? autolinker.link(feature.properties['Descript_2'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PollNum'] !== null ? autolinker.link(feature.properties['PollNum'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['DAUID'] !== null ? autolinker.link(feature.properties['DAUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PRUID'] !== null ? autolinker.link(feature.properties['PRUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PRNAME'] !== null ? autolinker.link(feature.properties['PRNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CDUID'] !== null ? autolinker.link(feature.properties['CDUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CDNAME'] !== null ? autolinker.link(feature.properties['CDNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CDTYPE'] !== null ? autolinker.link(feature.properties['CDTYPE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CCSUID'] !== null ? autolinker.link(feature.properties['CCSUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CCSNAME'] !== null ? autolinker.link(feature.properties['CCSNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CSDUID'] !== null ? autolinker.link(feature.properties['CSDUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CSDNAME'] !== null ? autolinker.link(feature.properties['CSDNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CSDTYPE'] !== null ? autolinker.link(feature.properties['CSDTYPE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['ERUID'] !== null ? autolinker.link(feature.properties['ERUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['ERNAME'] !== null ? autolinker.link(feature.properties['ERNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['SACCODE'] !== null ? autolinker.link(feature.properties['SACCODE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['SACTYPE'] !== null ? autolinker.link(feature.properties['SACTYPE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CMAUID'] !== null ? autolinker.link(feature.properties['CMAUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CMAPUID'] !== null ? autolinker.link(feature.properties['CMAPUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CMANAME'] !== null ? autolinker.link(feature.properties['CMANAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CMATYPE'] !== null ? autolinker.link(feature.properties['CMATYPE'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CTUID'] !== null ? autolinker.link(feature.properties['CTUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['CTNAME'] !== null ? autolinker.link(feature.properties['CTNAME'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['ADAUID'] !== null ? autolinker.link(feature.properties['ADAUID'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Area km2'] !== null ? autolinker.link(feature.properties['Area km2'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PercAreaDA'] !== null ? autolinker.link(feature.properties['PercAreaDA'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['PopApprox'] !== null ? autolinker.link(feature.properties['PopApprox'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Liberal'] !== null ? autolinker.link(feature.properties['Liberal'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Conservative'] !== null ? autolinker.link(feature.properties['Conservative'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['NDP'] !== null ? autolinker.link(feature.properties['NDP'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Total Votes'] !== null ? autolinker.link(feature.properties['Total Votes'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Total Electors'] !== null ? autolinker.link(feature.properties['Total Electors'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['First Place Votes'] !== null ? autolinker.link(feature.properties['First Place Votes'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['First Place'] !== null ? autolinker.link(feature.properties['First Place'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Second Place Votes'] !== null ? autolinker.link(feature.properties['Second Place Votes'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Second Place'] !== null ? autolinker.link(feature.properties['Second Place'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Third Place Votes'] !== null ? autolinker.link(feature.properties['Third Place Votes'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Third Place'] !== null ? autolinker.link(feature.properties['Third Place'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Margin: First - Second'] !== null ? autolinker.link(feature.properties['Margin: First - Second'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Margin: First - Liberal'] !== null ? autolinker.link(feature.properties['Margin: First - Liberal'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['Turnout'] !== null ? autolinker.link(feature.properties['Turnout'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['% of Additional Votes Needed'] !== null ? autolinker.link(feature.properties['% of Additional Votes Needed'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['663T'] !== null ? autolinker.link(feature.properties['663T'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['663M'] !== null ? autolinker.link(feature.properties['663M'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['663F'] !== null ? autolinker.link(feature.properties['663F'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['AreaDA Km2'] !== null ? autolinker.link(feature.properties['AreaDA Km2'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1T'] !== null ? autolinker.link(feature.properties['1T'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1683T'] !== null ? autolinker.link(feature.properties['1683T'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1683M'] !== null ? autolinker.link(feature.properties['1683M'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1683F'] !== null ? autolinker.link(feature.properties['1683F'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686T'] !== null ? autolinker.link(feature.properties['1686T'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686M'] !== null ? autolinker.link(feature.properties['1686M'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686F'] !== null ? autolinker.link(feature.properties['1686F'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686T_R'] !== null ? autolinker.link(feature.properties['1686T_R'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686M_R'] !== null ? autolinker.link(feature.properties['1686M_R'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n <tr>\\\n <td colspan=\"2\">' + (feature.properties['1686F_R'] !== null ? autolinker.link(feature.properties['1686F_R'].toLocaleString()) : '') + '</td>\\\n </tr>\\\n </table>';\n layer.bindPopup(popupContent, {maxHeight: 400});\n }", "function mouseoverFunction(e) {\n var layer = e.target;\n\n layer.setStyle({\n weight: 3,\n color: 'blue',\n dashArray: '',\n fillOpacity: 1\n });\n\n if (!L.Browser.ie && !L.Browser.opera) {\n layer.bringToFront();\n }\n\n //update the text in the infowindow with whatever was in the data\n //console.log(layer.feature.properties.NTAName);\n $('#infoWindow').html(layer.feature.properties.ntaname+'<br />REDI Score: '+Math.round(layer.feature.properties[redi_column]));\n}", "tooltip_render (tooltip_data)\r\n\t{\r\n\t\t//var that=this;\r\n\t let text = \"<ul>\";\r\n\t // console.log(\"----\",tooltip_data);\r\n\t tooltip_data.forEach((row)=>{\r\n\t text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.value+\"%)\" + \"</li>\"\r\n\t });\r\n\r\n\t return text;\r\n\t}", "function calcOPEX() {\n var expenses = 0.0;\n var current;\n for (var i=0; i<agileModel.SITES.length; i++) {\n for (var j=0; j<agileModel.SITES[i].siteBuild.length; j++) {\n current = agileModel.SITES[i].siteBuild[j];\n if (current.built) {\n for (var l=0; l<current.labor.length; l++) {\n expenses += current.labor[l].cost;\n }\n }\n }\n }\n return expenses;\n}", "function totalnoinhousehold () {\n var totalno =\n parseInt($(editemployer + '#adult').val(), 10) +\n parseInt($(editemployer + '#teenager').val(), 10) +\n parseInt($(editemployer + '#children').val(), 10) +\n parseInt($(editemployer + '#infant').val(), 10) +\n parseInt($(editemployer + '#elderly').val(), 10) +\n parseInt($(editemployer + '#disabled').val(), 10)\n $('.totalnoinhousehold').text(totalno)\n }", "displayToolTip(item) {\n console.log(\"Hovering Over Item: \", item.name);\n }", "updateTotals() {\n this.total = this.getTotalUsers(this.act_counts);\n\n // Total Customers\n this.element.dispatchEvent(\n new CustomEvent(\"pingpong.total\", {\n bubbles: true,\n composed: true,\n detail: {\n total_cust: this.total\n }\n })\n );\n\n if (this.element.querySelector(\"span\").innerHTML != this.total) {\n this.element.querySelector(\"span\").innerHTML = this.total;\n }\n\n // Update percentages\n this.label.selectAll(\"tspan.actpct\").text(d => {\n let count = this.act_counts[d.id] || 0;\n let percentage = this.readablePercent(\n this.act_counts[d.id],\n this.total\n );\n\n return this.foci[d.id].showTotal ? count + \"|\" + percentage : \"\";\n });\n }", "function displayTotals() {\r\n const totalPrice = SeatData.getTotalHeldPrice(seats);\r\n const heldSeatLabels = SeatData.getHeldSeats(seats).map(seat => seat.label);\r\n\r\n const priceSpan = document.querySelector(\"#selected-seat-price\");\r\n const labelSpan = document.querySelector(\"#selected-seat-labels\");\r\n\r\n priceSpan.innerText = totalPrice.toFixed(2);\r\n labelSpan.innerText = heldSeatLabels.length > 0 ? heldSeatLabels.join(\", \") : \"None\";\r\n }", "function opacityIncrease(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n opa = 0.1\n $('.square').css(\"opacity\", opa);\n $('.square').css(\"background-color\", \"black\");\n $('.square').mouseenter(function(){\n opaval = $(this).css(\"opacity\");\n if (opaval < 1){\n $(this).css(\"opacity\", opaval*1.3);\n }\n });\n}", "tooltip_render (tooltip_data) {\n let text = \"<ul>\";\n tooltip_data.result.forEach((row)=>{\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n });\n\n return text;\n }", "function sumarTotal(){\n let boxTotal = document.getElementById(`reduce`)\n let sumaReduce = carrito.reduce((acc, item)=> {return acc + item.precio},0)\n\n boxTotal.innerHTML=`<h2>Total: $${sumaReduce}</h2>`\n\n console.log(sumaReduce)\n}", "function onEachFeatureINCOME(feature, layer) {\n layer.on({\n mouseover: highlightFeature,\n mouseout: resetHighlightINCOME,\n click: zoomToFeature\n });\n layer.bindPopup('<h3>' + feature.properties.COUNTY + '</h3>');\n\n}", "function getFinalSumResult() {\r\n $(document).ready(function () {\r\n $(\"#paymentSum\").mouseout(function () {\r\n if (flag) {\r\n let nds = $(\"#ndcInputFiled\").val();\r\n let finalResult = result * (1 + (+nds / 100));\r\n $(\"#resultSum\").val(parseFloat(finalResult).toFixed(2));\r\n } else {\r\n $(\"#resultSum\").val(\"\");\r\n }\r\n });\r\n });\r\n}", "function totalPoints(stage) {\n var totalPoints = 0;\n stage.forEach((item2, te) => {\n var search = item2.split(\"\");\n search.forEach((item1, s) => {\n if(item1 === 'd')\n {\n totalPoints += 1;\n }\n });\n });\n //*********************RETURN ************************\n return totalPoints;\n }", "function myAgendaMouseoverHandler(eventObj) {\n var agendaId = eventObj.data.agendaId;\n var agendaItem = jfcalplugin.getAgendaItemById(\"#mycal\", agendaId);\n //alert(\"You moused over agenda item \" + agendaItem.title + \" at location (X=\" + eventObj.pageX + \", Y=\" + eventObj.pageY + \")\");\n }" ]
[ "0.649632", "0.59669816", "0.55538", "0.5489368", "0.54846215", "0.5401589", "0.5399341", "0.5374675", "0.5359719", "0.5353452", "0.52864295", "0.5269863", "0.523301", "0.52233297", "0.5223235", "0.5219091", "0.5184354", "0.5156936", "0.514597", "0.5143204", "0.51423156", "0.5136868", "0.51218444", "0.5115101", "0.5087103", "0.5074999", "0.50697434", "0.5066922", "0.50589126", "0.5055837", "0.504047", "0.5039812", "0.50350744", "0.5026824", "0.5019491", "0.50137043", "0.49954242", "0.49900594", "0.49841887", "0.49736857", "0.49686468", "0.49642584", "0.49635586", "0.49633545", "0.49434727", "0.4937119", "0.4928001", "0.49267066", "0.49168918", "0.49163342", "0.49012077", "0.4897267", "0.4891142", "0.4888514", "0.48843455", "0.48759753", "0.48702458", "0.48659948", "0.48643273", "0.4860995", "0.4852559", "0.484887", "0.48461378", "0.48407808", "0.48404095", "0.48355696", "0.4833408", "0.48326275", "0.48272634", "0.48266932", "0.48239386", "0.48227325", "0.48215255", "0.482107", "0.48208374", "0.48206937", "0.48154214", "0.4814476", "0.48118752", "0.48078722", "0.4806875", "0.48006165", "0.48005587", "0.47998524", "0.47994956", "0.4797955", "0.47967687", "0.47938228", "0.47937468", "0.47789145", "0.4776217", "0.47744656", "0.47717333", "0.4765193", "0.47629339", "0.47534072", "0.4752936", "0.47463685", "0.47450846", "0.47442675" ]
0.5820691
2
This function shows customer count and total deal amount in pipeline on mouseover
function showSaleCount(saleCount) { //$('#pipeSale').mouseenter(function () { var getDiv = document.getElementById("hoverSale"); getDiv.innerText = saleCount; var getwondiv = document.getElementById("wonOpp"); getwondiv.innerText = ""; var wonCountLabel = document.createElement("DIV"); wonCountLabel.className = "wonLostLabel"; wonCountLabel.appendChild(document.createTextNode(saleCount)); $('#wonOpp').append(wonCountLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function printTotalCost() {\n $(\".totalCost span\").append(\"<p> $\"+totalCost+ \"</p>\");\n }", "function showLeadAmount(leadAmount) {\n var getdiv = document.getElementById(\"hoverLead\");\n getdiv.innerText = \"\";\n var leadAmtLabel = document.createElement(\"DIV\");\n leadAmtLabel.className = \"chartBarLabel\";\n leadAmtLabel.appendChild(document.createTextNode(\"$\" + leadAmount.toLocaleString()));\n $('#hoverLead').append(leadAmtLabel);\n}", "function displayTotalcalories() {\n //Get total calories\n const totalCalories = ItemCtr.getTotalCalories();\n //add total calories to UI\n UICtrl.showTotalCalories(totalCalories);\n }", "updateTotals() {\n this.total = this.getTotalUsers(this.act_counts);\n\n // Total Customers\n this.element.dispatchEvent(\n new CustomEvent(\"pingpong.total\", {\n bubbles: true,\n composed: true,\n detail: {\n total_cust: this.total\n }\n })\n );\n\n if (this.element.querySelector(\"span\").innerHTML != this.total) {\n this.element.querySelector(\"span\").innerHTML = this.total;\n }\n\n // Update percentages\n this.label.selectAll(\"tspan.actpct\").text(d => {\n let count = this.act_counts[d.id] || 0;\n let percentage = this.readablePercent(\n this.act_counts[d.id],\n this.total\n );\n\n return this.foci[d.id].showTotal ? count + \"|\" + percentage : \"\";\n });\n }", "function showTotalPassengerCount(){\n\t$('.passenger-count').html(passenger_count)\n}", "function getpanierItemsCount(){\n\n\ttotal=calculertotal();\n\t(document.querySelector(\"#total\")).innerHTML=(\"Total a payer \"+total+\" DH\");\n}", "function _displayTotalRevenueOfOwner(list) {\n totalRevenue = list.reduce((prevVal, currVal) => {\n const val = currVal.cost;\n return {\n subTotal: prevVal.subTotal + val.subTotal,\n serviceTax: prevVal.serviceTax + val.serviceTax,\n swachhBharatCess: prevVal.swachhBharatCess + val.swachhBharatCess,\n krishiKalyanCess: prevVal.krishiKalyanCess + val.krishiKalyanCess,\n total: prevVal.total + val.total,\n tax: currVal.tax,\n }\n }, {\n subTotal: 0,\n serviceTax: 0,\n swachhBharatCess: 0,\n krishiKalyanCess: 0,\n total: 0,\n });\n console.log('Total Revenue');\n _displayLog(totalRevenue);\n }", "function calcTotal (){\n totalLabel.innerHTML = 'Total: $' + value;\n}", "getCartTotal (total) {\n document.getElementsByClassName('grandTotal')[0].innerText = \" # \"+ total\n \t\n }", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "function displayTotal() {\n\tscreen1.bugCount.html(prettyNumber(Math.round(state.larvae)));\n\tscreen1.larvaePerSec.html(prettyNumber(state.lps));\n}", "function displayTotal() {\n //get total and store in variable\n let total = getTotal();\n // chnage total in navbar\n $(\"#nav-total\").text(`Total: $${total}`)\n // change total in cart\n $(\"#cart-total\").text(`$${total}`)\n}", "function fastClassBookingHandler(increase)\n {\n const bookingnumber = document.getElementById(\"bookingNumber\");\n const bookingCount = parseInt(bookingnumber.value);\n let bookingNewCount = 0;\n if(increase==true){\n bookingNewCount = bookingCount + 1;\n }\n if(increase == false && bookingCount>0){\n bookingNewCount = bookingCount - 1;\n }\n bookingNumber.value = bookingNewCount; \n const nettotal = bookingNewCount *150;\n document.getElementById(\"netPrice\").innerText = '$'+nettotal;\n subtotal();\n }", "function showOppCount(oppCount) { \n var getDiv = document.getElementById(\"hoverOpp\");\n getDiv.innerText = oppCount; \n}", "function showOppAmount(oppAmount) {\n var getdiv = document.getElementById(\"hoverOpp\");\n getdiv.innerText = \"\";\n var oppAmtLabel = document.createElement(\"DIV\");\n oppAmtLabel.className = \"chartBarLabel\";\n oppAmtLabel.appendChild(document.createTextNode(\"$\" + oppAmount.toLocaleString()));\n $('#hoverOpp').append(oppAmtLabel);\n}", "function economyClassHandler(increase) \n {\n const bookingnumber = document.getElementById(\"ebookingNumber\");\n const bookingCount = parseInt(bookingnumber.value);\n let bookingNewCount = 0;\n if(increase==true){\n bookingNewCount = bookingCount + 1;\n }\n if(increase == false && bookingCount>0){\n bookingNewCount = bookingCount - 1;\n }\n ebookingNumber.value = bookingNewCount; \n const nettotal = bookingNewCount *100;\n document.getElementById(\"netPrice\").innerText = '$'+nettotal;\n subtotal();\n }", "function totalSales(products, lineItems){\n //TODO\n\n}", "function mostrarTotal (){\n $(\"#total\").html(`Total: $${total}`);\n}", "function process_count (repos) {\n var total = 0;\n repos.filter(function (r) {\n total += r.stargazers_count\n })\n \n //console.log('Total in github-starz.js : ' + total)\n user_callback(total);\n}", "function arc_onMouseOver(e,d,i) {\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n links.each(function (d) {\n total+= viz.value()(d.data);\n });\n\n total = \"$\" + d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"POLITICAL ACTION COMMITTEE\", d.data.values[0].CMTE_NM,\"Total Donated: \" + total);\n}", "function Summary(container_id) {\n var m_data_source = null;\n var m_panel = new JSPanel(container_id);\n var m_rpt_shipping_fee = new JSRepeater('rep_shipping_fee_real');\n var m_rpt_dangdang_money = new JSRepeater('rep_dangdang_money');\n var m_rep_collection_promotion = new JSRepeater('rep_collection_promotion');\n var m_rep_order_promotion = new JSRepeater('rep_order_promotion');\n\tvar m_rpt_overseas_tax = new JSRepeater('rep_overseas_tax_real');\n\n var promo_expand_status = true;\n var shipping_fee_expand_status = true;\n var coupon_expand_status = true;\n var giftcard_expand_status = true;\n\tvar overseas_tax_expand_status = true;\n\n var obj_coupon_money_real = null;\n var obj_rep_dangdang_money = null;\n var obj_rep_order_promotion = null;\n var obj_rep_collection_promotion = null;\n var obj_rep_shipping_fee_real = null;\n\tvar obj_rep_overseas_tax_real = null;\n\t\n\tvar order_count = 0;\n\t\n\tvar is_show_free_oversea = false;\n\t\n\tvar deposit_presale_type = 0; //1代表全款支付,2代表定金和尾款分开支付\n\n this.show = function (result) {\n bindTemplate();\n addEvents();\n\n // get_order_submit_tips(m_data_source[\"is_agree\"]);\n\n //验证码\n yzmInit();\n\n //支付密码\n payPasswordInit();\n\n $1('btn_change_yzm').onclick = function () { changeYZMMarked(); };\n\n $1('ck_protocol').onclick = function () { check_protocol(); };\n }\n\n this.setDataSource = function (data_source) {\n m_data_source = data_source;\n m_panel.DataSource = data_source;\n\n m_rpt_shipping_fee.DataSource = data_source['order_list'];\n m_rpt_dangdang_money.DataSource = data_source['order_list'];\n m_rep_collection_promotion.DataSource = data_source['collection_deduct_info'];\n\n m_rep_order_promotion.DataSource = data_source['order_promotion'];\n m_rpt_overseas_tax.DataSource = data_source['order_list'];\n\n if (m_data_source[\"presale_type\"] == null) {\n deposit_presale_type = 0;\n } else {\n deposit_presale_type = m_data_source[\"presale_type\"];\n }\n }\n\n this.setSubmit = function (order_flow_submit) {\n m_order_flow_submit = order_flow_submit;\n }\n\n this.setYzmStatus = function (is_no_safe_ip) {\n m_data_source['is_no_safe_ip'] = is_no_safe_ip;\n }\n\n this.isNoSafeIp = function () {\n return m_data_source['is_no_safe_ip'];\n }\n\n var get_order_submit_tips = function (is_agree) {\n var order_submit_tips = $1('order_submit_tips');\n if (order_submit_tips != null) {\n if (!is_agree) {\n order_submit_tips.innerHTML = P_ORDER_SUBMIT_PROTOCOL_TIPS;\n $1('order_submit_tips').className = \"\";\n }\n else\n $1('order_submit_tips').className = \"objhide\";\n }\n }\n\n\n this.setSubmitErrorTips = function (submit_error_tips) {\n if (submit_error_tips)\n $s($1('order_submit_error_tips_bar'));\n else\n $h($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = submit_error_tips;\n }\n\n //点了提交按钮后的按钮变化\n this.setDisabled = function () {\n $disabled('submit');\n $wait('submit');\n }\n this.setEnabled = function () {\n $enabled('submit');\n $1('submit').style.cursor = 'pointer';\n }\n\n var check_protocol = function () {\n if ($1('ck_protocol').checked)\n $1('submit').className = \"btn btn-super-orange\";\n else\n $1('submit').className = \"btn btn-super-orange btn-super-disabled\";\n }\n\n var ipt_yzm_keyup = function (o, e) {\n var k = null;\n if (e) {\n k = e.keyCode;\n }\n else if (event) {\n k = event.keyCode;\n }\n\n if (k == 9)\n return;\n\n var ov = o.value;\n var lisi = null;\n var j = 0;\n for (var i = 0; i < yzm_array_len; i++) {\n lisi = obj_ipt_yzm_lis[i];\n if (lisi.innerHTML.startsWith(ov)) {\n $s(lisi);\n j++;\n }\n else $h(lisi);\n }\n\n if (j < 2) {\n $h(obj_ipt_yzm);\n }\n else if (j < 10) {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = 'auto';\n }\n else {\n $s(obj_ipt_yzm);\n obj_ipt_yzm.style.height = '100px';\n }\n };\n\n var li_c = function (t) { t.className = 'li_bg'; };\n var li_r = function (t) { t.className = ''; }\n var ipt_yzm_focus = function (o) {\n\n clearYzmTips(o);\n var li_ck = function (t) { o.value = t.innerHTML; $h(obj_ipt_yzm); o.style.color = '#404040'; };\n var sb = new StringBuilder();\n for (var i = 0; i < yzm_array_len; i++) {\n sb.append(\"<li>\");\n sb.append(i);\n sb.append('</li>');\n }\n obj_ipt_yzm.innerHTML = sb.toString();\n obj_ipt_yzm_lis = obj_ipt_yzm.childNodes;\n for (var i = 0; i < yzm_array_len; i++) {\n obj_ipt_yzm_lis[i].onmouseover = function () { li_c(this); };\n obj_ipt_yzm_lis[i].onmouseout = function () { li_r(this); };\n obj_ipt_yzm_lis[i].onclick = function () { li_ck(this); };\n }\n var pos = getposOffset_c(o);\n setLocation(obj_ipt_yzm, pos[0] + 3, pos[1] + 20);\n setDimension(obj_ipt_yzm, 85, 100);\n\n if (yzm_array_len < 8)\n obj_ipt_yzm.style.height = 'auto';\n\n\n show_ipt_yzm(obj_ipt_yzm, o);\n };\n\n var show_ipt_yzm = function (z, o) {\n $s(z);\n if (document.addEventListener) {\n document.addEventListener('click', documentonclick, false);\n }\n else {\n document.attachEvent('onclick', function (e) { documentonclick(); });\n }\n\n function documentonclick() {\n var evt = arguments[0] || window.event;\n var sender = evt.srcElement || evt.target;\n\n if (!contains(z, sender) && sender != o) {\n $h(z);\n if (document.addEventListener) {\n document.removeEventListener('click', documentonclick, false);\n }\n else {\n document.detachEvent('onclick', function (e) { documentonclick(); });\n }\n }\n };\n };\n\n // show error\n function showError(error) {\n SubmitData.error = error;\n }\n // show bind error\n function showSubmitError(errorCode) {\n var error;\n switch (errorCode) {\n case 1:\n case 5:\n case 6:\n case 9:\n case 10:\n case 11:\n error = \"请填写正确的卡号\";\n break;\n case 7:\n error = \"请填写正确的密码\";\n break;\n case 12:\n error = \"激活失败\";\n break;\n default:\n error = \"礼券绑定失败\";\n }\n showError(error);\n }\n\n // clear error\n function clearError() {\n couponData.error = null;\n }\n\n function yzmInit() {\n changeYZMMarked();\n // obj_ipt_yzm = $1('ul_ipt_yzm');\n //\t $1('ipt_yzm').onkeyup=function(e){ipt_yzm_keyup(this,e);};\n\n if (m_data_source['is_no_safe_ip'] == 0) {\n $h($1('div_yzm_word'));\n }\n\n }\n\n function payPasswordInit() {\n\n var isEnable = m_data_source['payment_password_enabled'] == 1;\n isEnable = isEnable \n \t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']));\n if (isEnable) {\n if (m_data_source['is_set_payment_password']) {\n ShowOrClosePayPassWord(3);\n }\n else {\n ShowOrClosePayPassWord(0);\n }\n }\n else {\n ShowOrClosePayPassWord(2);\n }\n }\n\n function bindTemplate() {\n if (m_data_source['order_list'] != null && m_data_source['order_list'].length > 0) {\n order_count = m_data_source['order_list'].length;\n }\n m_panel.Template = ORDER_SUMMARY_TEMPLATE;\n m_data_source['bargin_total'] = formatFloat(m_data_source['bargin_total']);\n m_data_source['shipping_fee'] = formatFloat(m_data_source['shipping_fee']);\n m_data_source['promo_discount_amount'] = formatFloat(m_data_source['promo_discount_amount']);\n m_data_source['coupon_amount'] = formatFloat(m_data_source['coupon_amount']);\n m_data_source['cust_cash_used'] = formatFloat(m_data_source['cust_cash_used']);\n m_data_source['payable_amount'] = formatFloat(m_data_source['payable_amount']);\n m_data_source['gift_card_charge'] = formatFloat(m_data_source['gift_card_charge']);\n m_data_source['total_gift_package_price'] = formatFloat(m_data_source['total_gift_package_price']);\n m_data_source['gift_package_price'] = formatFloat(m_data_source['gift_package_price']);\n m_data_source['gift_package_price_tips'] = formatFloat(m_data_source['gift_package_price_tips']);\n m_data_source['greetingcard_price'] = formatFloat(m_data_source['greetingcard_price']);\n m_data_source['privilege_code_discount_amount'] = formatFloat(m_data_source['privilege_code_discount_amount']);\n m_data_source['point_deduction_amount'] = formatFloat(m_data_source['point_deduction_amount']);\n //定金和尾款金额格式化\n m_data_source['deposit_amount'] = formatFloat(m_data_source['deposit_amount']);\n m_data_source['balance_amount'] = formatFloat(m_data_source['balance_amount']);\n\t\t\n //礼品卡和礼券总金额\n m_data_source[\"coupon_and_giftcard_money_used\"]=formatFloat((+m_data_source[\"gift_card_money_used\"])+(+m_data_source[\"coupon_amount\"]));\n m_data_source[\"gift_card_money_used\"]=formatFloat(m_data_source[\"gift_card_money_used\"]);\n m_data_source[\"coupon_used\"]=formatFloat(m_data_source[\"coupon_amount\"]);\n\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['overseas_tax']);\n\t\tif(parseFloat(m_data_source['overseas_tax']) == 0){\n\t\t\tis_show_free_oversea = true;\n\t\t\tm_data_source['overseas_tax'] = formatFloat(m_data_source['free_overseas_tax']);\n\t\t} \n\t\t\n\t\t\n if (m_data_source['payable_amount'] >= 1000) {\n m_data_source['payable_amount_style'] = \"f14\";\n }\n else {\n m_data_source['payable_amount_style'] = \"f18\";\n }\n //先取值,防止设置设置支付密码后,给输入框赋了值,但重新绑定后丢失。\n var payment_password = $F(\"input_pay_password\");\n m_panel.DataBind();\n if (payment_password)\n $1(\"input_pay_password\").value = payment_password;\n\n obj_coupon_money_real = $1(\"coupon_money_real\");\n obj_rep_dangdang_money = $1(\"rep_dangdang_money\");\n obj_rep_order_promotion = $1(\"rep_order_promotion\");\n obj_rep_collection_promotion = $1(\"rep_collection_promotion\");\n obj_rep_shipping_fee_real = $1(\"rep_shipping_fee_real\");\n\t\tobj_rep_overseas_tax_real = $1(\"rep_overseas_tax_real\");\n\n\t\tif (deposit_presale_type == 1) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else if (deposit_presale_type == 2) {\n\t\t $1(\"div_product_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n\t\t} else {\n\t\t $1(\"div_deposit_total\").className = 'hide';\n\t\t $1(\"div_final_payment_total\").className = 'hide';\n\t\t $1(\"div_presale_mobile\").className = 'hide';\n\t\t $1(\"div_agree_pay_deposit\").className = 'hide';\n\t\t}\n $1(\"total_shipping_fee_real\").className = 'hide';\n $1(\"total_promo_amount_real\").className = 'hide';\n $1(\"total_coupon_real\").className = 'hide';\n $1(\"total_gift_card_charge\").className = 'hide';\n $1(\"total_cust_cash_real\").className = 'hide';\n $1(\"total_cust_point_real\").className = 'hide';\n $1(\"rep_collection_promotion\").className = 'hide';\n $1(\"total_discount_code_real\").className = 'hide';\n $1(\"total_gift_package_price\").className = 'hide';\n $1(\"gift_package_price\").className = 'hide';\n $1(\"total_privilege_code_discount_amount\").className = 'hide';\n $1(\"greetingcard_price\").className = 'hide';\n\t\t$1(\"total_overseas_tax_real\").className = 'hide';\n\t\t$1(\"total_energy_saving_subsiby_amout\").className = 'hide';\n if (m_data_source['shipping_fee'] > 0) {\n $1(\"total_shipping_fee_real\").className = '';\n m_rpt_shipping_fee.ItemTemplate = RPT_SHIPPING_FEE_ITEM_TEMPLATE;\n m_rpt_shipping_fee.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_shipping_fee'] > 0) {\n dataItem['order_shipping_fee'] = formatFloat(dataItem['order_shipping_fee']);\n }\n else {\n dataItem['shipping_fee_display'] = 'hide';\n }\n }\n m_rpt_shipping_fee.DataBind();\n }\n\t\tif(m_data_source['energy_saving'] == true) {\n\t\t\t$1(\"total_energy_saving_subsiby_amout\").className = \"\";\n\t\t}\n\t\tif (m_data_source['is_overseas'] == true) {\n\t\t\t\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"default\";\n\t\t\t} else {\n\t\t\t\t$1(\"order_flow_overseas_tax\").className = \"\";\n\t\t\t}\n $1(\"total_overseas_tax_real\").className = '';\n m_rpt_overseas_tax.ItemTemplate = RPT_OVERSEAS_TAX_ITEM_TEMPLATE;\n m_rpt_overseas_tax.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['is_overseas'] == true) {\n\t\t\t\t\tif(formatFloat(dataItem['overseas_tax']) == 0){\n\t\t\t\t\t\tdataItem['default_class'] = \"default\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['free_overseas_tax']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdataItem['default_class'] = \"\";\n\t\t\t\t\t\tdataItem['overseas_tax'] = formatFloat(dataItem['overseas_tax']);\n\t\t\t\t\t}\n }\n else {\n dataItem['overseas_tax_display'] = 'hide';\n }\n }\n m_rpt_overseas_tax.DataBind();\n\t\t\tif(is_show_free_oversea){\n\t\t\t\t$(\"#oversea_icon_free\").show();\n\t\t\t} else {\n\t\t\t\t$(\"#oversea_icon_free\").hide();\n\t\t\t}\n\t\t\tif(order_count == 1){\n\t\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t\t}\n }\n if (m_data_source['promo_discount_amount'] > 0) {\n $1(\"total_promo_amount_real\").className = '';\n if (m_data_source['collection_deduct_info']!=undefined && m_data_source['collection_deduct_info'].length > 0) {\n $1(\"rep_collection_promotion\").className = '';\n m_rep_collection_promotion.ItemTemplate = RPT_PROMOTION_ITEM_TEMPLATE;\n m_rep_collection_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n if (dataItem['order_direct_discount_amount'] > 0) {\n dataItem['order_direct_discount_amount'] = formatFloat(dataItem['order_direct_discount_amount']);\n }\n else {\n dataItem['order_direct_discount_amount'] = 'hide';\n }\n dataItem['collection_promotion_desc_tips'] = dataItem['collection_promotion_desc'];\n dataItem['collection_promotion_desc'] = nTruncate(dataItem['collection_promotion_desc'], 10);\n }\n m_rep_collection_promotion.DataBind();\n }\n\n m_rep_order_promotion.ItemTemplate = RPT_ORDER_PROMOTION_ITEM_TEMPLATE;\n m_rep_order_promotion.onItemDataBind = function (dataItem, obj_tpl) {\n\n if (dataItem['order_prom_subtract'] > 0) {\n $s($1(\"rep_order_promotion\"));\n dataItem['order_prom_subtract'] = formatFloat(dataItem['order_prom_subtract']);\n }\n else {\n dataItem['order_promotion_display'] = 'hide';\n }\n dataItem['shop_promo_msg_tips'] = dataItem['shop_promo_msg'];\n dataItem['shop_promo_msg'] = nTruncate(dataItem['shop_promo_msg'], 10);\n }\n m_rep_order_promotion.DataBind();\n }\n \n //if(+m_data_source[\"coupon_and_giftcard_money_used\"]>0){ \n \t //礼品卡显示\n $1(\"total_giftcard_real\").className = 'hide';\n if(+m_data_source[\"gift_card_money_used\"]>0){ \t \n \t$1(\"total_giftcard_real\").className = '';\n m_rpt_dangdang_money.ItemTemplate = RPT_COUPON_ITEM_TEMPLATE;\n m_rpt_dangdang_money.onItemDataBind = function (dataItem) {\n if (+dataItem['cust_gift_card_used'] > 0) {\n \t dataItem['cust_gift_card_used'] = formatFloat(dataItem['cust_gift_card_used']);\n }\n else {\n dataItem['coupon_amount_display'] = 'hide';\n }\n };\n m_rpt_dangdang_money.DataBind(); \n }\n \n if (m_data_source['coupon_used'] > 0) {\n \t$1(\"total_coupon_real\").className = '';\n switch (+m_data_source['coupon_type']) {\n case 1:\n case 9: \n obj_coupon_money_real.className = 'p-child';\n break; \n case 4:\n $1(\"total_discount_code_real\").className = '';\n $1(\"total_coupon_real\").className = 'hide';\n break;\n default:\n break;\n }\n \n }\n \n\n\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"total_gift_package_price\");\n }\n\n if (m_data_source['gift_package_price'] == 0 && m_data_source['greeting_card_price'] != 0) {\n $S(\"greetingcard_price\");\n }\n\n if (m_data_source['gift_package_price'] != 0 && m_data_source['greeting_card_price'] == 0) {\n $S(\"gift_package_price\");\n }\n\n\n if (+m_data_source['gift_card_charge'] > 0) {\n $1(\"total_gift_card_charge\").className = '';\n }\n\n if (m_data_source['cust_cash_used'] > 0) {\n $S(\"total_cust_cash_real\");\n }\n if (m_data_source['point_deduction_amount'] > 0) {\n $S(\"total_cust_point_real\");\n }\n if (!m_data_source['is_agree']) {\n $s($1('div_ck_protocol'));\n }\n if (+m_data_source['privilege_code_discount_amount'] > 0) {\n $1(\"total_privilege_code_discount_amount\").className = '';\n }\n }\n\n\n function getEvent() {\n if (document.all) {\n return window.event; //for ie\n }\n func = getEvent.caller;\n while (func != null) {\n var arg0 = func.arguments[0];\n if (arg0) {\n if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof (arg0) == \"object\" && arg0.preventDefault && arg0.stopPropagation)) {\n return arg0;\n }\n }\n func = func.caller;\n }\n return null;\n }\n\n // events\n function addEvents() {\n if (deposit_presale_type == 2) {\n $1('presale_mobile').onkeydown = function () {\n $1('presale_mobile').className = \"input-w87\";\n $h($1('order_submit_error_tips_bar'));\n var ev = getEvent();\n if (ev.keyCode >= 48 && ev.keyCode <= 57) { return; }\n if (ev.keyCode >= 96 && ev.keyCode <= 105) { return; }\n if (ev.keyCode == 8 || ev.keyCode == 46 || ev.keyCode == 37 || ev.keyCode == 39) { return; }\n return false;\n }\n }\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n $1('agree_pay_deposit').onclick = function () {\n if ($1('agree_pay_deposit').checked == true) {\n $1(\"submit\").className = ' btn btn-super-orange';\n } else {\n $1(\"submit\").className = ' btn btn-super-orange btn-super-disabled';\n }\n }\n }\n $1('shipping_fee_detail_link').onclick = function () {\n if (shipping_fee_expand_status) {\n $h(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-open';\n shipping_fee_expand_status = false;\n }\n else {\n $s(obj_rep_shipping_fee_real);\n $1(\"shipping_fee_detail_icon\").className = 'icon icon-adress-close';\n shipping_fee_expand_status = true;\n }\n }\n\t\tif(order_count == 1){\n\t\t\t$(\"#shipping_fee_detail_link\").click();\n\t\t}\n\n $1('promo_detail_link').onclick = function () {\n if (promo_expand_status) {\n $h(obj_rep_collection_promotion);\n $h(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-open';\n promo_expand_status = false;\n }\n else {\n $s(obj_rep_collection_promotion);\n $s(obj_rep_order_promotion);\n $1(\"promo_detail_icon\").className = 'icon icon-adress-close';\n promo_expand_status = true;\n }\n }\n\n $1('giftcard_detail_link').onclick = function () {\n if (giftcard_expand_status) {\n $h(obj_rep_dangdang_money);\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-open';\n giftcard_expand_status = false;\n }\n else {\n \tvar isUseGiftcard=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.GiftCard);//if m_data_source['coupon_type'] == 1\n if (isUseGiftcard) {\n $s(obj_rep_dangdang_money);\n }\n $1(\"giftcard_detail_icon\").className = 'icon icon-adress-close';\n giftcard_expand_status = true;\n }\n }\n $1('coupon_detail_link').onclick = function () {\n if (coupon_expand_status) {\n $h(obj_coupon_money_real);\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-open';\n coupon_expand_status = false;\n }\n else {\n \tvar isUseCoupon=CouponType.hasFlag(+m_data_source.coupon_type, CouponType.Coupon);//if m_data_source['coupon_type'] == 1\n if (isUseCoupon) {\n $s(obj_coupon_money_real);\n }\n $1(\"coupon_detail_icon\").className = 'icon icon-adress-close';\n coupon_expand_status = true;\n }\n }\n\n\n $1('submit').onclick = function () {\n if (deposit_presale_type == 1 || deposit_presale_type == 2) {\n if ($1('submit').className.indexOf(\"disabled\") > 0) {\n return;\n }\n }\n var presale_mobile = \"\";\n\t\t\tif (deposit_presale_type == 2) {\n\t\t\t\tvar reg = /^((14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0-9])|(17[0-9]))\\d{8}$/;\n\t\t\t\tpresale_mobile = $1(\"presale_mobile\").value;\n\t\t\t\tif (presale_mobile == null || !reg.test(presale_mobile)) {\n\t\t\t\t\t$s($1('order_submit_error_tips_bar'));\n\t\t\t\t\t$1('order_submit_error_tips').innerHTML = '手机号码格式错误';\n\t\t\t\t\t$1('presale_mobile').className = \"input-w87 input-red\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n //虚拟礼品卡密钥验证\n var orders = m_data_source[\"order_list\"];\n var firtKey;\n var mobileNumber;\n for (var i = 0; i < orders.length; i++) {\n if (orders[i][\"order_type\"] == 50) {\n var success = VirtualGiftCard.submitCheckVirtualKey();\n if (!success) {\n window.location.hash = \"#GiftCardUserKey\";\n return false;\n } else {\n firtKey = $1('txt_first_key').value;\n mobileNumber = $F('txt_mobile_number');\n }\n \n }\n }\n if (!m_data_source['is_agree'] && !$1('ck_protocol').checked)\n return;\n\n var s_pay_password = \"\";\n\n if (m_data_source['payment_password_enabled'] == 1 \n \t\t&& (+m_data_source['cust_cash_used'] > +m_data_source['min_cust_cash_password_limit'] \n \t\t\t|| (CouponType.hasFlag(+m_data_source['coupon_type'], CouponType.GiftCard) && +m_data_source['gift_card_money_used'] > +m_data_source['min_gift_card_password_limit']))) {\n if (!m_data_source['is_set_payment_password'] && $1('div_pay_password').style.display == \"none\") //新增 \n {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请设置支付密码';\n return;\n }\n\n s_pay_password = $F('input_pay_password');\n if (s_pay_password == null || s_pay_password == '') {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入支付密码';\n return;\n }\n var paypwdlen = getLength(s_pay_password);\n if (paypwdlen < 6 || paypwdlen > 20) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请输入正确的支付密码';\n return;\n }\n }\n\n var s_sign = \"\";\n\n if (m_data_source[\"is_no_safe_ip\"] == 1) {\n s_sign = $F('ipt_yzm');\n if (s_sign == null || s_sign == '' || s_sign.indexOf(\"&\") >= 0) {\n $s($1('order_submit_error_tips_bar'));\n $1('order_submit_error_tips').innerHTML = '请填写验证码';\n return;\n }\n }\n m_order_flow_submit(s_sign, m_data_source['shop_id'], encodeURIComponent(s_pay_password), firtKey, mobileNumber, m_data_source['product_ids'], m_data_source['sk_action_id'], presale_mobile);\n return false;\n }\n\t\t\n\t\t$1('overseas_tax_detail_link').onclick = function () {\n if (overseas_tax_expand_status) {\n $h(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-open';\n overseas_tax_expand_status = false;\n }\n else {\n $s(obj_rep_overseas_tax_real);\n $1(\"overseas_tax_detail_icon\").className = 'icon icon-adress-close';\n overseas_tax_expand_status = true;\n }\n }\n\t\t\n\t\tif(order_count == 1){\n\t\t\t$(\"#overseas_tax_detail_link\").click();\n\t\t}\n }\n}", "function IndicadorTotal () {}", "function show_services_number(ndx){\n var servicesDim = ndx.dimension(dc.pluck('type'));\n \n var numberOfServicesGroup = servicesDim.group().reduce(add_item, remove_item, initialise);\n\n function add_item(p, v) {\n p.count++;\n p.total += v.departments;\n p.average = p.total / p.count;\n return p;\n }\n\n function remove_item(p, v) {\n p.count--;\n if (p.count == 0) {\n p.total = 0;\n p.average = 0;\n } else {\n p.total -= v.departments;\n p.average = p.total / p.count;\n }\n return p;\n }\n\n function initialise() {\n return {\n count: 0,\n total: 0,\n average: 0\n };\n }\n\n dc.rowChart(\"#departments\")\n \n .margins({top: 10, left: 10, right: 10, bottom: 20})\n .valueAccessor(function (d) {\n return d.value.average;\n })\n .x(d3.scale.ordinal())\n .elasticX(true)\n .dimension(servicesDim)\n .group(numberOfServicesGroup); \n\n}", "function calculateTotal() {\r\n\t\tvar Amount =getPrice() *getPages();\r\n\t\t//display cost.\r\n\t\tvar obj =document.getElementById('totalPrice');\r\n\t\tobj.style.display='block';\r\n\t\tobj.innerHTML =\" Cost of the paper: \\t $\"+ Amount;\r\n\t}", "function totalSale(){\n\n console.log(sale.name);\n}", "function handleMouseover(e){\n\t\t\t\tlet code = e.currentTarget.getAttribute(\"data-code\"),\n\t\t\t\t\tcountryData = csvData.filter(c => c.Country_Code === code)[0],\n\t\t\t\t\tcountryName = countryData.Name,\n countryIndex = countryData[dataset];\n\t\t\t\toutput.innerHTML = countryName + \"<br /> \" + countryIndex;\n\t\t\t\tdocument.querySelectorAll(`[data-code=${code}]`).forEach(el => {\n\t\t\t\t\tel.setAttribute(\"stroke\", \"red\");\n\t\t\t\t\tel.setAttribute(\"stroke-width\", 2.75);\n\t\t\t\t});\n\t\t\t}", "function displayAccumulatedCountyData(total_male,total_female,total_population)\n{\n const total_male_area = document.querySelector(\"#total-male b\");\n const total_female_area = document.querySelector(\"#total-female b\");\n const total_population_per_county = document.querySelector(\"#total-population b\");\n total_male_area.innerHTML = total_male;\n total_female_area.innerHTML = total_female;\n total_population_per_county.innerHTML = total_population;\n}", "function addCount() {\n count++;\n $('.count').html(count);\n }", "function showIncome(n) {\n console.log(\"\\n\"+archive[n].name+\" has generated: \"+(archive[n].price*archive[n].Clients.length)+\" USD\"+\"\\n\");\n}", "function total(){\n\tvar TotalPrice=CakeSizePrice() + FlavorPrice()+ FillingPrice()+ ColorPrice() ;\n\n\t//final result\n\tdocument.getElementById(\"display\").innerHTML=\"Total Price: $\"+TotalPrice;\n}", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "function handleMouseover(d,i) {\n var placeNames = []\n for(n=0;n<adminLabelLvls.length;n++) {\n placeNames.push( toTitleCase( d.properties[adminLabelLvls[n]] ) );\n }\n var tooltipText = \"<small><span class='place-name'>\" + placeNames.join(\", \") + \"</span>\";\n var dataKey = d3.select(this).attr('data-response'); \n if(dataKey !== null) {\n d.properties.response.forEach(function(item,itemIndex){\n if(item.key == dataKey) {\n tooltipText += \" <br> Distributions: \" + commas(item.value.count) +\n \" <br> Items distributed: \" + commas(item.value.total_number);\n }\n });\n } \n tooltipText += \"</small>\";\n $('#tooltip').html(tooltipText);\n}", "function summary(){\n const phonePrice = parseFloat(document.getElementById('phn-price').innerText);\n const casePrice = parseFloat(document.getElementById('case-price').innerText);\n\n const tax = parseFloat(document.getElementById('tax-price').innerText);\n document.getElementById('sub-total').innerText = phonePrice + casePrice;\n document.getElementById('total').innerText = phonePrice + casePrice + tax;\n\n \n}", "displayResult(tip, total) {\r\n this.tipAmount.innerText = this.tipAmount.innerText.replace(/[^$].+/, tip);\r\n this.totalAmount.innerText = this.totalAmount.innerText.replace(/[^$].+/, total);\r\n }", "function calculateTotal() {\n const firstCount = getInputValue('first');\n const economyCount = getInputValue('economy');\n\n const totalPrice = firstCount * 150 + economyCount * 100;\n document.getElementById('total-price').innerText = totalPrice;\n\n const tax = totalPrice * 0.1;\n document.getElementById('tax-amount').innerText = tax;\n\n const finalTotal = totalPrice + tax;\n document.getElementById('final-total').innerText = finalTotal\n}", "function render() {\n $totalAmountOfItemCost.html( ( parseFloat( $totalAmountOfItemCost.html() ).toFixed(2) - $deletedItemTotalCost ).toFixed(2) );\n $amountOfItemsOnCart.html($amount-1);\n }", "function render_total(data){\n\t return '<a href=\"\">'+data+' pessoa(s)</a>';\n\t}", "function mouseover(d)\r\n\t\t\t{\r\n\t\t\t\t$(\"#col2\").text(\"\");\r\n\t\t\t\tcontent.append(\"div\").attr(\"id\",\"iw-container\").append(\"div\").attr(\"class\",\"iw-title\").append(\"i\").attr(\"class\",\"fa fa-info-circle\")\r\n\t\t\t\t.attr(\"style\",\"padding-right:20px;font-weight:bold;\")\r\n \t\t\t.text(\"\t\"+d.name)// + \" - 2013 appropriations: \" + d.appropriation13 + \" - Which was a \" + d.percentChange13 + \"% change of the previous year.\")\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Orders: \" + format(d.appropriation14/10))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" New Customers: \" + format((d.appropriation13)))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Product Lines: \" + format((d.appropriation12)))\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.attr(\"id\", \"annotate\")\r\n\t\t\t\t.text(d.annotation)\r\n\t\t\t\tif (d.annotation2 != null)\r\n\t\t\t\t{\r\n\t\t\t\tcontent1.append(\"br\")\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.text(d.annotation2);\r\n\t\t\t\t}\r\n\r\n \t\t\t}", "function total(){\n\tvar TotalPrice=CakeSizePrice() +FilingPrice()+ CandlePrice()+InscriptionPrice() ;\n\n\t//final result\n\tdocument.getElementById(\"display\").innerHTML=\"total price $\"+TotalPrice;\n}", "function renderSaleTotal(currency, value, sharesToSell) {\n value = [...document.getElementsByClassName(\"blink\")].find(e => {\n return e.parentElement.id === currency;\n });\n value = value.innerText;\n // calls on a function that multiplies sharesToSell by value\n let total = parseFloat(value * sharesToSell).toFixed(2);\n // renders the return of that function on the page\n document.getElementsByClassName(\"total-sale\")[0].innerHTML = `\n Sale Value: <strong>$${total}</strong>\n `;\n}", "function update_total_count_summary() {\r\n\t\t\t$('#flight_search_result').show();\r\n\t\t\tvar _visible_records = parseInt($('.r-r-i:visible').length);\r\n\t\t\tvar _total_records = $('.r-r-i').length;\r\n\t\t\t// alert(_total_records);\r\n\t\t\tif (isNaN(_visible_records) == true || _visible_records == 0) {\r\n\t\t\t\t_visible_records = 0;\r\n\t\t\t\t//display warning\r\n\t\t\t\t$('#flight_search_result').hide();\r\n\t\t\t\t$('#empty_flight_search_result').show();\r\n\t\t\t} else {\r\n\t\t\t\t$('#flight_search_result').show();\r\n\t\t\t\t$('#empty_flight_search_result').hide();\r\n\t\t\t}\r\n\t\t\t$('#total_records').text(_visible_records);\r\n\t\t\tif(_visible_records == 1){\r\n\t\t\t\t$('#flights_text').text('Flight');\r\n\t\t\t}\r\n\t\t\t$('.visible-row-record-count').text(_visible_records);\r\n\t\t\t$('.total-row-record-count').text(_total_records);\r\n\t\t\t\r\n\t\t}", "refreshTotalCalories() {\n UISelectors.totalCaloriesDisplay.textContent = ItemCtrl.getTotalCalories();\n }", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function display() {\n\t\tlet totFilteredRecs = ndx.groupAll().value();\n\t\tlet end = ofs + pag > totFilteredRecs ? totFilteredRecs : ofs + pag;\n\t\td3.select('#begin').text(end === 0 ? ofs : ofs + 1);\n\t\td3.select('#end').text(end);\n\t\td3.select('#last').attr('disabled', ofs - pag < 0 ? 'true' : null);\n\t\td3.select('#next').attr(\n\t\t\t'disabled',\n\t\t\tofs + pag >= totFilteredRecs ? 'true' : null\n\t\t);\n\t\td3.select('#size').text(totFilteredRecs);\n\t\tif (totFilteredRecs != ndx.size()) {\n\t\t\td3.select('#totalsize').text('(Unfiltered Total: ' + ndx.size() + ')');\n\t\t} else {\n\t\t\td3.select('#totalsize').text('');\n\t\t}\n\t}", "getCartTotal () {\n return 0;\n }", "function showCardAmount(){\n $(\"#total-cards\").html(model.getCardObjArr().length);\n }", "function showCustomerSale(customerId,product_id){\n $(\".shopInfo\").css(\"display\", \"block\");\n custModule.queryCustomerRecord(customerId,product_id,function(responseData) {\n var httpResponse = JSON.parse(responseData.response);\n if (responseData.ack == 1 && httpResponse.retcode ==200) {\n var retData = httpResponse.retbody;\n $(\"#sale_dt\").html(common.isNotnull(retData.sale_dt) ? retData.sale_dt : '-');\n $(\"#last_sale_price\").html(common.isNotnull(retData.sale_price) ?'¥'+ retData.sale_price : '-');\n $(\"#last_sale_num\").html(common.isNotnull(retData.sale_num) ? retData.sale_num + retData.unit: '-');\n if(retData.sale_price){\n $(\".product_price\").val(retData.sale_price);\n }\n } else {\n $.toast(\"本地网络连接有误\", 2000, 'error');\n }\n });\n }", "function handleMouseOverC(d, i) { // Add interactivity\n\n // Use D3 to select element, change color and size\n d3.select(this)\n .style(\"fill\", \"#FFCC00\")\n\n // .attr(\"r\", radius * 2);\n div.transition() \n .duration(150) \n .style(\"opacity\", .9); \n div .html(\"Plant: \"+ d.id + \"<br/>\" +\n \"Country: \"+ d.name + \"<br/>\" +\n \"Sub-region: \" + d.sub_region + \"<br/>\" +\n \"Number of Parts: \"+ d.mat_number+ \"<br/>\" +\n \"Total Stock value: \"+ Math.round(d.stock_value) + \"<br/>\"\n ) \n .style(\"left\", (d3.event.pageX) + \"px\") \n .style(\"top\", (d3.event.pageY - 28) + \"px\")\n .attr(\"height\", 200) //200\n .attr(\"width\", 80); //80\n \n \n // div.transition() \n // .duration(200) \n // .style(\"opacity\", .9); \n // div .html(d.id) \n // .style(\"left\", (d3.event.pageX) + \"px\") \n // .style(\"top\", (d3.event.pageY - 28) + \"px\"); \n \n }", "function renderValue() {\n dealerTotalEl.innerHTML = `<div id=\"dealer-total\">${dealerTotal}</div>`;\n playerTotalEl.innerHTML = `<div id=\"player-total\">${playerTotal}</div>`;\n potTotalEl.innerHTML = `<div id=\"player-total\">$${potTotal}</div>`;\n playerWalletEl.innerHTML = `<div id=\"player-total\">Wallet : $${wallet}</div>`;\n}", "function node_onMouseOver(e,d,i) {\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = \"$\" + d3.format(\",.2f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n createDataTip(x + d.r, y + d.r + 25,congress, d.values[0].CAND_NAME,\"Total Received: \" + total);\n}", "function addexptototal()\n {\n const expobj={};\n //read the value of inputamt\n const textamt=inputele.value;\n\n const textdesc=inputele2.value;\n \n //convert it to number\n const exp=parseInt(textamt,10);\n\n expobj.desc=textdesc;\n expobj.amt=textamt;\n expobj.moment=new Date();\n\n allexp.push(expobj);\n \n \n //add that value to totalvalue\n totalexp=totalexp+exp;\n \n hele.textContent=totalexp;\n\n const headingtext=`Total :: ${totalexp}`;\n hele.textContent=headingtext;\n\n renderlist(allexp);\n \n }", "function incrementCount(){\n\tcount++;\n\tnumber = number + parseInt(z); //convert z from string to integer \n\t//document.getElementById(\"demo3\").innerHTML = \"Number of items in your cart: \" + count;\n\tvar w = document.getElementById(\"cart-number\");\n\tw.innerHTML = \"(\" + number + \")\"; //paste actual item count\n\t//document.getElementById(\"cart-number\").innerHTML = \"(\" + number +\")\";\n}", "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "function calculateTotal()\n {\n\n var kPrice = keychainsQuantity() + secondkeychainsQuantity();\n \n document.getElementById('totalPrice').innerHTML =\n \"Total Price For Keychain is $\"+kPrice;\n \n }", "function showDataPointCount() {\n $('.dataPoints').html('<span class=\"bold\">' + dataPointCounter + ' p/s</span>');\n dataPointCounter = 0;\n}", "function show_number_of_staff(ndx) {\n var dim = ndx.dimension(dc.pluck('Rank'));\n\n function add_item(p, v) {\n if (v.Rank == \"Manager\") {\n p.manager_count++;\n }\n else if (v.Rank == \"MIT\") {\n p.mit_count++;\n }\n else if (v.Rank == \"Instore\") {\n p.instore_count++;\n }\n return p;\n }\n\n function remove_item(p, v) {\n if (v.Rank == \"Manager\") {\n p.manager_count--;\n }\n else if (v.Rank == \"MIT\") {\n p.mit_count--;\n }\n else if (v.Rank == \"Instore\") {\n p.instore_count--;\n }\n return p;\n }\n\n function initialise(p, v) {\n return { manager_count: 0, mit_count: 0, instore_count: 0 };\n\n }\n\n var staffCounter = ndx.groupAll().reduce(add_item, remove_item, initialise);\n\n dc.numberDisplay(\"#managerCount\")\n .formatNumber(d3.format(\".0\"))\n .valueAccessor(function(d) {\n return d.manager_count; // no .value here\n })\n .group(staffCounter);\n\n dc.numberDisplay(\"#mitCount\")\n .formatNumber(d3.format(\".0\"))\n .valueAccessor(function(d) {\n return d.mit_count; // no .value here\n })\n .group(staffCounter);\n\n dc.numberDisplay(\"#instoreCount\")\n .formatNumber(d3.format(\".0\"))\n .valueAccessor(function(d) {\n return d.instore_count; // no .value here\n })\n .group(staffCounter);\n}", "function customerInfo() {\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let customerInfoElement = document.getElementById(\"CUSTOMER_INFO\").children;\n customerInfoElement[1].innerText = currentCustomer.name;\n customerInfoElement[4].innerText = currentCustomer.age;\n customerInfoElement[7].innerText = currentCustomer.email;\n customerInfoElement[10].innerText = currentCustomer.phone;\n customerInfoElement[13].innerText = currentCustomer.address;\n customerInfoElement[16].innerText = currentCustomer.registered;\n customerInfoElement[19].innerText = currentCustomer.about;\n }", "function renderTotalQuantityAndPrice(items) {\n var totalQuantity = getTotalQuantity(items);\n\n // show bag count when quantity is positive\n if (totalQuantity > 0) {\n $bagCount.addClass('visible');\n } else {\n $bagCount.removeClass('visible');\n }\n\n $bagCount.text(totalQuantity);\n $bagTotal.text('$' + getTotalPrice(items) + '.00');\n }", "function displayTotals() {\r\n const totalPrice = SeatData.getTotalHeldPrice(seats);\r\n const heldSeatLabels = SeatData.getHeldSeats(seats).map(seat => seat.label);\r\n\r\n const priceSpan = document.querySelector(\"#selected-seat-price\");\r\n const labelSpan = document.querySelector(\"#selected-seat-labels\");\r\n\r\n priceSpan.innerText = totalPrice.toFixed(2);\r\n labelSpan.innerText = heldSeatLabels.length > 0 ? heldSeatLabels.join(\", \") : \"None\";\r\n }", "function totalSales(){\r\n let totalSalesVar =0;\r\n \r\n\r\nfor(var i = 0; i <= hSaleTotal.length-1; i++){\r\n \r\n totalSalesVar += hSaleTotal[i];\r\n console.log(totalSalesVar)\r\n\r\n}\r\n\r\ndocument.getElementById('prueba').innerHTML= `Total Sales were: ${totalSalesVar} <br>`;\r\n\r\n\r\n}", "function showTotalIncident(transport) {\n let total = data.dataModified.get(\"1960\")[transport].length;\n let years = document.getElementById(\"selectYear\").value;\n\n document.getElementById(\"showTotalIncident\").innerHTML = total;\n document.getElementById(\"percent1\").innerHTML = \"Aire = \" + data.percent(years).percentair + \" %\";\n document.getElementById(\"percent2\").innerHTML = \"Tierra = \" + data.percent(years).percentland + \" %\";\n document.getElementById(\"percent3\").innerHTML = \"Agua = \" + data.percent(years).percentWater + \" %\";\n\n}", "function showDetail(event, key, amount, count, percent) {\n\n // show tooltip with information from the __data__ property of the element\n var x_hover = 0;\n var y_hover = 0;\n\n var content = \"<b>\" + key + \"</b><br/>\";\n\n if (amount != null) content += \"<b>Amount: </b>\" + amount + \"<br/>\";\n if (count != null) content += \"<b>Count: </b>\" + count + \"<br/>\";\n if (percent != null) content += \"<b>Percent: </b>\" + percent + \"<br/>\";\n\n var tooltipWidth = parseInt(tooltip.style('width'));\n var tooltipHeight = parseInt(tooltip.style('height'));\n var classed,notClassed;\n \n if (event.pageX > document.body.clientWidth / 2) {\n x_hover = tooltipWidth + 30;\n classed = 'right';\n notClassed = 'left';\n } else {\n x_hover = -30;\n classed = 'left';\n notClassed = 'right';\n }\n \n // y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight + 4) : event.pageY - tooltipHeight / 2;\n y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight - 40) : event.pageY - tooltipHeight - 40;\n\n return tooltip\n .classed(classed,true)\n .classed(notClassed,false)\n .style({\n \"visibility\": \"visible\",\n \"top\": y_hover + \"px\",\n \"left\": (event.pageX - x_hover) + \"px\"\n })\n .html(content);\n}", "function mouseOnC(CityName, info){\n $(tooltip).html(CityName + ' ' +info);\n $(tooltip).css('background', '#ddd');\n}", "function updateCounts(){\r\n let filterData = ndx.allFiltered();\r\n let filterNoOfCases = 0 ;\r\n let filterNoOfDeaths = 0;\r\n filterData.forEach(function(d){ filterNoOfCases +=d.new_cases; });\r\n filterData.forEach(function(d){ filterNoOfDeaths +=d.new_deaths; });\r\n $(\"#filterCases\").html(readNumberFormat(filterNoOfCases));\r\n $(\"#filterDeaths\").html(readNumberFormat(filterNoOfDeaths));\r\n}", "function RepoCount(data){\n\t// alert(data.total_count);\n\treturn data.total_count\n}", "function amountCovered(claim){\n\tvar paidOutPerClient = '';\n\tvar percent = percentageCovered(claim);\n\t//Amount paid out rounded to the nearest dollar amount.\n\tvar amount = Math.round(claim.visitCost * (percent / 100));\n\t//Add to the total money paid out. Logged at the end.\n\ttotalPayedOut += amount;\n\tpaidOutPerClient += ('Paid out $<mark>' + amount + '</mark> for ' + claim.patientName);\n\t//Add new ol item for each client's details\n\t$('table').append('<tr><td>' + paidOutPerClient + '</td></tr>');\n\tconsole.log('Paid out $' + amount + ' for ' + claim.patientName);\n}", "function onMouseoverChart(e) {\n if (e['target'] === 'node') {\n var nodeSplit = e['targetid'].split('-');\n var nodeId = nodeSplit[nodeSplit.length - 1];\n if (Number.isInteger(parseInt(nodeId)) && parseInt(nodeId) < globalEnergyData['values'].length) {\n renderPieChart(parseInt(nodeId));\n }\n } \n }", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function show_Results() {\n var total = vOne + vTwo;\n console.log('FInished. Total = ' + total);\n\n var seeTotal = document.getElementById('total');\n seeTotal.innerHTML = total;\n seeTotal.style.fontSize = '5vh';\n seeTotal.style.margin = '7.5vh';\n\n rolls++;\n}", "function showLostSaleCount(lostCount) {\n var getdiv = document.getElementById(\"lostOpp\");\n getdiv.innerText = \"\";\n var lostCountLabel = document.createElement(\"DIV\");\n lostCountLabel.className = \"wonLostLabel\";\n lostCountLabel.appendChild(document.createTextNode(lostCount));\n $('#lostOpp').append(lostCountLabel);\n}", "function getTotal() {\n const firstClassCount = getInputValue('firstClass');\n const economyCount = getInputValue('economy');\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('subTotalAmount').innerText = subTotal;\n\n const vat = subTotal * 0.1;\n const total = subTotal + vat;\n document.getElementById('vatAmount').innerText = vat;\n document.getElementById('totalAmount').innerText = total;\n}", "function total(event) {\n console.log(event.target);\n let changedIndex = products.indexOf(event.target.name);\n let ourtarget = document.getElementById(event.target.name);\n let value = itemNo.value * products[i].price;\n console.log(value);\n ourtarget.textContent = value + ' JOD';\n products[i].total = value;\n products[i].purshaceNo = itemNo.value;\n console.log('The total quantity', products[i].purshaceNo);\n megaTotal = megaSum();\n all.innerHTML = `Total: ${megaTotal} JOD`;\n }", "function calculateTotal() {\n const firstClassCount = getInputValue('first-class');\n const economyCount = getInputValue('economy');\n\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('sub-total').innerText = '$' + subTotal;\n\n const vat = subTotal * 0.1;\n document.getElementById('vat').innerText = '$' + vat;\n\n const total = subTotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "function updateTotal() {\n\n}", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "getSellerTotal() {\n\t\treturn (this.props.listing.transactionTotal - this.props.listing.chargesTotal);\n\t}", "function elementMouseOverClosure() {\n\tvar elementMouseOver = function(d, i) {\n\t\tif (d.data.datum.state == global.activeStateFilter \n\t\t\t\t|| global.activeStateFilter == 'None') {\n\t\t\tvar senator = d.data;\n\t\t\thighlightSenator(senator);\n\n\t\t\tif(senator.datum.state != global.activeStateFilter){\n\t\t\t\thighlightState(\"#\" + senator.datum.state + \"_state\");\n\t\t\t}\n\t\t\t//fill in the information bar at the side\n\t\t\tvar sideBarTop = d3.select('#sideBar1')\n\t\t\t\t.attr('class','simpleBorder infoBox')\n\t\t\t\t.attr(\"align\", \"center\");\n\t\t\tdocument.getElementById('sideBar1').innerHTML = \n\t\t\t\t'<h3>' + d.data.name + '</h3><h3>' +\n\t\t\t\td.data.datum.state + '</h3><h3>' +\n\t\t\t\td.data.id + '</h3><br/>Total Debates:' +\n\t\t\t\td.data.debateIDs.length;\n\n\t\t\t//Highlight all tickmarks on currently active debates\n\t\t\tfor(var j = 0; j < senator.activeDebateTicks.length; j++){\n\t\t\t\td3.select(senator.activeDebateTicks[j]).transition()\n\t\t\t\t\t.style('stroke-width', 2)\n\t\t\t\t\t.attr('r', function(d){\n\t\t\t\t\t\td3.select('#debateSvg' + d.debateSvgNdx).transition()\n\t\t\t\t\t\t\t.style('border-color', d.strokeC);\n\t\t\t\t\t\treturn 3;});\n\t\t\t}\n\t\t}\n\t};\n\treturn elementMouseOver;\n}", "function MemberReview(){\n $('.progress-rv').each(function (index,value){\n var datavalue=$(this).attr('data-value'),\n point=datavalue*10;\n $(this).append(\"<div style='width:\"+point+\"%'><span>\"+datavalue+\"</span></div>\")\n })\n }", "function updateSelectedCount(){\n const selectedSeats=document.querySelectorAll('.row .seat.selected');\n const selectedSeatscount=selectedSeats.length;\n count.innerText=selectedSeatscount;\n total.innerText=selectedSeatscount*ticketPrice;\n\n }", "function populateCounters() {\r\n circulating = minted - burned;\r\n $(\"#minted\").html(thousands_separators(minted));\r\n $(\"#transactions\").html(thousands_separators(transactions));\r\n $(\"#holders\").html(thousands_separators(holders));\r\n $(\"#burned\").html(thousands_separators(burned));\r\n $(\"#circulating\").html(thousands_separators(circulating.toFixed(2)));\r\n }", "getTotalMenuPrice() {\n return this.menu.reduce((a,b) => a+b.pricePerServing, \" \") * this.getNumberOfGuests();\n }", "function totals_row_maker(datasets) {\n var total_cost = $scope.total_order_cost;\n var total_quant = 0;\n var total_scrap = $scope.total_order_scrap + '\\\"';\n for (var prop in datasets) {\n total_quant += datasets[prop][1];\n }\n $('#summary').append('<tfoot class=\"totals-row\"><tr><th class=\"total-cell\">Totals:</th><td class=\"total-cell\">' + total_quant + '</td><td class=\"total-cell\">' + total_cost + '</td><td class=\"total-cell\">' + total_scrap + '</td></tr></tfoot>');\n }", "function updateCountAndTotal() {\n selectedSeats = document.querySelectorAll('.row .selected');\n const selectedSeatsAmount = selectedSeats.length;\n\n count.innerText = selectedSeatsAmount;\n total.innerText = selectedSeatsAmount * ticketPrice;\n}", "function treeCuttingTotal() {\nvar total_number_tree = {\nonStatisticField: \"CommonName\",\noutStatisticFieldName: \"total_number_tree\",\nstatisticType: \"count\"\n};\n\nvar query = treeLayer.createQuery();\nquery.outStatistics = [total_number_tree];\n\nreturn treeLayer.queryFeatures(query).then(function(response) {\nvar stats = response.features[0].attributes;\nconst totalNumber = stats.total_number_tree;\n//const LOT_HANDOVER_PERC = (handedOver/affected)*100;\nreturn totalNumber;\n});\n}", "function updateTotals(index) {\nif (!isNaN(index)) {\nvar di = covid_cc_total_timeline[index];\nvar date = new Date(di.date);\ncurrentDate = date;\n\nupdateCountryName();\n\nvar position = dateAxis.dateToPosition(date);\nposition = dateAxis.toGlobalPosition(position);\nvar x = dateAxis.positionToCoordinate(position);\n\nif (lineChart.cursor) {\nlineChart.cursor.triggerMove({ x: x, y: 0 }, \"soft\", true);\n}\nfor (var key in buttons) {\nvar count = Number(lineChart.data[index][key])\nif (!isNaN(count)) {\nbuttons[key].label.text = capitalizeFirstLetter(key) + \": \" + numberFormatter.format(count, '#,###');\n}\n}\ncurrentIndex = index;\n}\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function displayTotal(total) {\n document.querySelector(\"#count-total\").textContent += total / 100;\n}", "function calculateTotal() {\n let tipPerPerson = (billObj._billAmount * billObj._tipAmount) / billObj._numOfPeople;\n let billPerPerson = billObj._billAmount / billObj._numOfPeople;\n let totalAmount = tipPerPerson + billPerPerson;\n if (isNaN(tipPerPerson) && isNaN(billPerPerson)) {\n return;\n }\n else {\n //This should output to DOM;\n document.querySelector(\".display_tip_value\").innerHTML = tipPerPerson.toFixed(2).toString();\n document.querySelector(\".display_total_value\").innerHTML = totalAmount.toFixed(2).toString();\n }\n ;\n}", "total () {\n\t\treturn this.subtotal() - this.discounts();\n\t}", "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "function totalTicketAmount(){\n const subTotalAmount = TicketName('firstClass') * 150 + TicketName('economy') * 100;\n document.getElementById('subtotal').innerText ='$' + subTotalAmount;\n const totalTaxAmount = Math.round(subTotalAmount * 0.1);\n document.getElementById('tax-amount').innerText ='$' + totalTaxAmount;\n const totalBookingCost = subTotalAmount + totalTaxAmount;\n document.getElementById('total-cost').innerText ='$' + totalBookingCost;\n}", "function feedTotalHitCount(totalHitCount){\r\n var totalHitCountSelector = document.getElementById(\"total-hit-count\");\r\n totalHitCountSelector.innerHTML = totalHitCount;\r\n $(\"#total-hit-spinner\").hide();\r\n }", "function cartCheckoutButton() {\r\n // Get Checkout button; Get total checkout amount\r\n var checkoutBtn = document.querySelector(\"#cart-checkout\");\r\n var total = checkoutBtn.querySelector('#total')\r\n var valid = checkoutBtn.querySelector('#checkoutValid')\r\n var invalid = checkoutBtn.querySelector('#checkoutInvalid')\r\n\r\n // Show cart totals when hovering\r\n checkoutBtn.addEventListener(\"mouseenter\", function () {\r\n var cartItems = document.querySelectorAll('.cart-item');\r\n total.style.display = 'none'\r\n if (cartItems.length == 0) {\r\n invalid.style.display = 'inline-block';\r\n } else if (cartItems.length > 0) {\r\n valid.style.display = 'inline-block'\r\n }\r\n })\r\n\r\n // Show 'Checkout' text when not hovering\r\n checkoutBtn.addEventListener(\"mouseleave\", function () {\r\n invalid.style.display = 'none'\r\n valid.style.display = 'none'\r\n total.style.display = 'inline-block'\r\n })\r\n}", "function caclulateWealth(){\r\n\tconst wealth = data.reduce( (acc, person) => (acc += person.money), 0);\r\n\tconst wealthEl = document.createElement('div');\r\n\twealthEl.innerHTML = `<h3>Total Wealth: <strong>${formatMoney(wealth)}</strong></h3>`;\r\n\tmain.appendChild(wealthEl);\r\n\tconsole.log();\r\n}", "function link_onMouseOver(e,d,i) {\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = \"$\" + d3.format(\",.0f\")(viz.value()(d.data));\n var date = d.data.Month + \"/\" + d.data.Day + \"/\" + d.data.Year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Received: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function getFinalSumResult() {\r\n $(document).ready(function () {\r\n $(\"#paymentSum\").mouseout(function () {\r\n if (flag) {\r\n let nds = $(\"#ndcInputFiled\").val();\r\n let finalResult = result * (1 + (+nds / 100));\r\n $(\"#resultSum\").val(parseFloat(finalResult).toFixed(2));\r\n } else {\r\n $(\"#resultSum\").val(\"\");\r\n }\r\n });\r\n });\r\n}", "function mouseover(d) {\n var shiftX = 10;\n var shiftY = 20;\n\n var mouseCoords = d3.mouse(this);\n d3.select(\"#tooltip\")\n .style(\"left\", function(d) {\n return mouseCoords[0] + shiftX + \"px\"\n })\n .style(\"top\", function(d) {\n return mouseCoords[1] + shiftY + \"px\"\n })\n .html(function() {\n if (d.energy[1990] == null || d.energy[currentYear][\"All products\"] == 0) return d.name + \": No data\";\n\n var all = d.energy[currentYear][\"All products\"];\n var renewable = d.energy[currentYear][\"Renewable energies\"];\n var per = renewable / all;\n\n hoverArrow(per);\n\n return \"<b>\" + d.name + \"</b><br/>\" + fmtPer(per) + \" renewables\"\n })\n .classed(\"hidden\", false);\n}", "function updatePopperDisplay (name, count, cost, display, countDisplay, costDisplay, sellDisplay) {\n\tcountDisplay.innerHTML = name + \": \" + count;\n\tcostDisplay.innerHTML = \"Cost: \" + commas(cost);\n\tif (Game.popcorn - cost >= 0) {\n\t\tdisplay.style.backgroundColor = \"blue\";\n\t\tdisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tdisplay.style.backgroundColor = \"#000066\";\n\t\tdisplay.style.cursor = \"default\";\n\t}\n\tif (count > 0) {\n\t\tsellDisplay.style.backgroundColor = \"red\";\n\t\tsellDisplay.style.color = \"white\";\n\t\tsellDisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tsellDisplay.style.backgroundColor = \"#990000\";\n\t\tsellDisplay.style.color = \"#999999\";\n\t\tsellDisplay.style.cursor = \"default\";\n\t}\n}" ]
[ "0.59686136", "0.5912847", "0.5752698", "0.57207483", "0.5499622", "0.5450888", "0.5372179", "0.5365616", "0.5365435", "0.53644097", "0.53138584", "0.53135705", "0.53110814", "0.5297435", "0.5279137", "0.5278823", "0.5276103", "0.5268961", "0.52617824", "0.5257476", "0.5238532", "0.5225468", "0.5204101", "0.52024585", "0.5202104", "0.51776844", "0.5172714", "0.5161271", "0.5157144", "0.51567924", "0.51364166", "0.51344174", "0.5118736", "0.5112573", "0.5112252", "0.51013345", "0.51010704", "0.50986207", "0.5097001", "0.50873554", "0.50744236", "0.5068086", "0.5057058", "0.5049677", "0.5039082", "0.5026411", "0.5021066", "0.5019077", "0.50141484", "0.50120926", "0.5007838", "0.49990693", "0.49869043", "0.49863315", "0.49851173", "0.4976387", "0.4974234", "0.49740052", "0.49701458", "0.49698406", "0.49672732", "0.49563202", "0.49535167", "0.49518394", "0.49508667", "0.4948675", "0.4946133", "0.4942884", "0.49396792", "0.49364576", "0.4935075", "0.49218878", "0.49218565", "0.49194744", "0.4918099", "0.4916473", "0.4910801", "0.4908163", "0.49070916", "0.49070892", "0.4906821", "0.4906262", "0.4906101", "0.49006882", "0.48961908", "0.4887942", "0.48851562", "0.48803464", "0.48704278", "0.48704162", "0.48684034", "0.48681262", "0.48680633", "0.48656082", "0.48630086", "0.48628873", "0.4861227", "0.4861029", "0.48606122", "0.48586732" ]
0.65691406
0
This function shows lost opportunity count and total deal amount in graph on mouseover
function showLostSaleCount(lostCount) { var getdiv = document.getElementById("lostOpp"); getdiv.innerText = ""; var lostCountLabel = document.createElement("DIV"); lostCountLabel.className = "wonLostLabel"; lostCountLabel.appendChild(document.createTextNode(lostCount)); $('#lostOpp').append(lostCountLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElement(\"DIV\");\n wonCountLabel.className = \"wonLostLabel\";\n wonCountLabel.appendChild(document.createTextNode(saleCount));\n $('#wonOpp').append(wonCountLabel); \n}", "function showSaleAmount(saleAmount) {\n var saleAmtLabel = document.createElement(\"DIV\");\n saleAmtLabel.className = \"chartBarLabel\";\n saleAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n var getdiv = document.getElementById(\"hoverSale\");\n getdiv.innerText = \"\";\n $('#hoverSale').append(saleAmtLabel);\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonAmtLabel = document.createElement(\"DIV\");\n wonAmtLabel.className = \"wonLostLabel\";\n wonAmtLabel.appendChild(document.createTextNode(\"$\" + saleAmount.toLocaleString()));\n $('#wonOpp').append(wonAmtLabel);\n}", "function onMouseoverChart(e) {\n if (e['target'] === 'node') {\n var nodeSplit = e['targetid'].split('-');\n var nodeId = nodeSplit[nodeSplit.length - 1];\n if (Number.isInteger(parseInt(nodeId)) && parseInt(nodeId) < globalEnergyData['values'].length) {\n renderPieChart(parseInt(nodeId));\n }\n } \n }", "function showOppAmount(oppAmount) {\n var getdiv = document.getElementById(\"hoverOpp\");\n getdiv.innerText = \"\";\n var oppAmtLabel = document.createElement(\"DIV\");\n oppAmtLabel.className = \"chartBarLabel\";\n oppAmtLabel.appendChild(document.createTextNode(\"$\" + oppAmount.toLocaleString()));\n $('#hoverOpp').append(oppAmtLabel);\n}", "showTotals() {\n //const infectious2 = this.chart.chart.data.datasets[0].data\n const infectious1 = this.chart.chart.data.datasets[1].data\n const infectious1Val = infectious1[infectious1.length-1]\n\n const susceptible = this.chart.chart.data.datasets[2].data\n const susceptibleVal = susceptible[susceptible.length-1]\n const nSusceptible = susceptibleVal-infectious1Val\n\n const vaccinated = this.chart.chart.data.datasets[3].data\n const vaccinatedVal = vaccinated[vaccinated.length-1]\n const nVaccinated = vaccinatedVal-susceptibleVal\n\n const removed = this.chart.chart.data.datasets[4].data\n const removedVal = removed[removed.length-1]\n const nRemoved = removedVal-vaccinatedVal\n\n const dead = this.chart.chart.data.datasets[5].data\n const deadVal = dead[dead.length-1]\n const nDead = deadVal-removedVal\n\n let hospitalDeaths = 0\n this.sender.q1.pts.forEach(pt => hospitalDeaths += pt.status==Point.DEAD ? 1 : 0)\n\n const yDiff = TEXT_SIZE_TOTALS+15\n\n strokeWeight(0)\n stroke(0)\n fill(\"#000000dd\")\n rect(RECT_X_TOTALS, RECT_Y_TOTALS, RECT_W_TOTALS, RECT_H_TOTALS, RECT_RADIUS_TOTALS)\n textSize(TEXT_SIZE_TOTALS)\n textAlign(LEFT, TOP)\n fill(COLOR_LIGHT_GRAY)\n text(`Simulation Complete!`, TEXT_X_TOTALS+80, TEXT_Y_TOTALS)\n text(`Total Unaffected: ${nSusceptible+nVaccinated}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff)\n text(`Total Infected: ${dead[dead.length-1]-nSusceptible-nVaccinated}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*2)\n text(`Total Recovered: ${nRemoved}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*3)\n text(`Total Dead: ${nDead}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*4)\n text(`Deaths due hospital overcrowding: ${hospitalDeaths}`, TEXT_X_TOTALS, TEXT_Y_TOTALS+yDiff*5)\n this.drawResetArrow()\n }", "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n .attr('opacity',0);\n }", "function mouseout(d) {\n // update frecuency in bar \n leg.update(tF);\n\n } //final de mouse Out", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "function showLeadAmount(leadAmount) {\n var getdiv = document.getElementById(\"hoverLead\");\n getdiv.innerText = \"\";\n var leadAmtLabel = document.createElement(\"DIV\");\n leadAmtLabel.className = \"chartBarLabel\";\n leadAmtLabel.appendChild(document.createTextNode(\"$\" + leadAmount.toLocaleString()));\n $('#hoverLead').append(leadAmtLabel);\n}", "function updateTally(outcome) {\n totalPoints += parseInt(outcome);\n \n // Draw tally using HTML\n tally = display_element.querySelector(\".tally\");\n tally.innerHTML = `Total Points: ${totalPoints}`\n \n }", "function handleMouseOverPie() {\n // remove old mouse event elements\n svg.selectAll(\".percentage\").remove();\n\n // get margins from container\n var margins = getMargins(\".containerGraph3\")\n\n // select this item\n d3.select(this)\n .attr(\"stroke\", \"white\")\n .style(\"stroke-width\", \"3px\")\n .style(\"stroke-opacity\", 0.6)\n\n // append text to the side of the pie with the percentages\n svg.append(\"text\")\n .attr(\"class\", \"percentage\")\n .text(\"Geslaagd: \" + percentagePassed + \"%\")\n .attr(\"x\", margins.width / 5)\n .attr(\"y\", -margins.height / 2.3)\n .attr(\"font-size\", 24)\n .attr(\"font-family\", \"Arial\")\n .attr(\"fill\", \"white\")\n .transition().duration(200)\n .attr(\"opacity\", 0.9)\n\n // append text\n svg.append(\"text\")\n .attr(\"class\", \"percentage\")\n .text(\"Gezakt: \" + percentageFailed + \"%\")\n .attr(\"x\", margins.width / 5)\n .attr(\"y\", -margins.height / 2.3+ 30)\n .attr(\"font-size\", 24)\n .attr(\"font-family\", \"Arial\")\n .attr(\"fill\", \"white\")\n .transition().duration(200)\n .attr(\"opacity\", 0.9)\n }", "function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.Designation,v.total];}), barColor);\n }", "function details_on_demand(d) {\n\t\n\tvar sp_dot = document.getElementById(\"sp\"+d.Team);\n\tvar tm_node = document.getElementById(\"tm\"+d.Team);\n\t\n\t// Save old state of dot\n\told_dot = sp_dot.getAttribute(\"r\");\n\told_opacity = sp_dot.getAttribute(\"opacity\");\n\t\n\t// Make team's dot bigger \n\tsp_dot.setAttribute(\"r\", big_dot); \n\t// Make team's node \"brighter\"\n\ttm_node.style.opacity = \".7\";\n\t\n\t\n\tteams.forEach(function(team) {\n\t\tdocument.getElementById(\"sp\"+team).setAttribute(\"opacity\", .1);\n\t});\n\tsp_dot.setAttribute(\"opacity\", 1);\n\t\n\ttooltip.transition()\n\t .duration(100)\n\t .style(\"opacity\", .85)\n\t .style(\"background\", \"#0b0b0d\")\n\t .style(\"border\", \"2px solid black\")\n\t .style(\"color\", \"#FFFFFF\")\n\t .style(\"max-width\", \"auto\")\n\t .style(\"height\", \"auto\");\n\t \n\t \n\ttooltip.html(\n\t \"<img src='\" + logos[d.Team] + \"' width='50' height='50' style='float: left; padding-right: 10px; vertical-align: middle'>\" +\n\t\t \"<b>\" + d[\"Team\"] + \"<b><br/><br/>\\t Salary: <b>\" + curr_fmt(xValue(d)*1000000) + \"</b><br/>\\t Wins: <b>\" + yValue(d) + \n\t\t \"</b>; Losses: <b>\" + d[season+\"Loss\"] + \"</b>\")\n\t .style(\"left\", d[\"Team\"] ? (d3.event.x + document.body.scrollLeft - 90) + \"px\": null)\n\t .style(\"top\", d[\"Team\"] ? (d3.event.y + document.body.scrollTop - 70) + \"px\": null)\n\t .style(\"padding\", \"5px\")\n\t .style(\"padding-left\", \"10px\")\n\t .style(\"font-size\", \"11px\");\n}", "function node_onMouseOver(e,d,i) {\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = \"$\" + d3.format(\",.2f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n createDataTip(x + d.r, y + d.r + 25,congress, d.values[0].CAND_NAME,\"Total Received: \" + total);\n}", "function arc_onMouseOver(e,d,i) {\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n links.each(function (d) {\n total+= viz.value()(d.data);\n });\n\n total = \"$\" + d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"POLITICAL ACTION COMMITTEE\", d.data.values[0].CMTE_NM,\"Total Donated: \" + total);\n}", "function mouseout(d){\n \n// call an update in the bar chart refering to the dataset and return the previous data and color\n bC.update(myData.map(function(v){\n return [v.year,v.total];}), \"#8DD4F4\");\n }", "function mouseover(d) {\n\t\tchart.append(\"text\")\n\t\t\t.attr(\"id\", \"interactivity\")\n\t\t\t.attr(\"y\", y(d.value) - 15)\n\t\t\t.attr(\"x\", x(d.year) + 23)\n\t\t\t.style(\"text-anchor\", \"start\")\n\t\t\t.style(\"font\", \"10px sans-serif\")\n\t\t\t.text(d.value);\n\n\t\td3.select(this)\n\t\t\t.style(\"fill\", \"darkblue\");\n\t}", "function handle_mouseout(d, $this) {\n $(\".country-wage-group\").attr(\"opacity\", 1);\n d3.select(\"#wageGapTooltip\").style(\"visibility\", \"hidden\");\n }", "function node_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all node links (candidates) and create a label for each arc\n var haloLabels={};\n var links=viz.selection().selectAll(\".vz-halo-link-path.node-key_\" + d.key);\n var total=0;\n\n //For each link we want to dynamically total the transactions to display them on the datatip.\n links.each(function (d) {\n total+= viz.value()(d.data);\n var halos=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n halos.each(function (d) {\n if (!haloLabels[d.data.key]) {\n haloLabels[d.data.key]=1;\n createPacLabel(d.x, d.y,d.data.values[0].CMTE_NM);\n }\n })\n });\n\n //Format the label for the datatip.\n total = d3.format(\",.0f\")(total);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n\n var node = viz.selection().selectAll(\".vz-halo-node.node-key_\" + d.key);\n\n //Create and position the datatip\n var rect = node[0][0].getBoundingClientRect();\n\n var x = rect.left;\n var y = rect.top + document.body.scrollTop;\n\n var strSyntax = d.values[0].PTY == 'positive' ? 'Sentiment index: +' : 'Sentiment index: -'\n\n createDataTip(x + d.r, y + d.r + 25, d.values[0].CAND_ID, d.values[0].CAND_NAME, strSyntax + total);\n}", "function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.Month,v.total];}), barColor);\n }", "function showLeadCount(leadCount) { \n var getDiv = document.getElementById(\"hoverLead\");\n getDiv.innerText = leadCount;\n}", "function handleMouseover(d,i) {\n var placeNames = []\n for(n=0;n<adminLabelLvls.length;n++) {\n placeNames.push( toTitleCase( d.properties[adminLabelLvls[n]] ) );\n }\n var tooltipText = \"<small><span class='place-name'>\" + placeNames.join(\", \") + \"</span>\";\n var dataKey = d3.select(this).attr('data-response'); \n if(dataKey !== null) {\n d.properties.response.forEach(function(item,itemIndex){\n if(item.key == dataKey) {\n tooltipText += \" <br> Distributions: \" + commas(item.value.count) +\n \" <br> Items distributed: \" + commas(item.value.total_number);\n }\n });\n } \n tooltipText += \"</small>\";\n $('#tooltip').html(tooltipText);\n}", "function showOppCount(oppCount) { \n var getDiv = document.getElementById(\"hoverOpp\");\n getDiv.innerText = oppCount; \n}", "function showLosses() {\n losses++;\n $(\"#losses\").text(losses);\n}", "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div')\n .attr('id', 'tooltip')\n .html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery/100 + '%')\n .style('opacity', 0.8)\n .style('top', yPosition + 'px')\n .style('left', xPosition + 'px');\n\n d3.select(this)\n .style('fill', '#ffffff');\n }", "function link_onMouseOver(e,d,i) {\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = \"$\" + d3.format(\",.0f\")(viz.value()(d.data));\n var date = d.data.Month + \"/\" + d.data.Day + \"/\" + d.data.Year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Received: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "function mouseover(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){\n return [v.Month,v.freq[d.data.type]];}),segColor(d.data.type));\n }", "function handleMouseover(d) {\n div.style(\"opacity\", 0.9)\n .style(\"left\", (d3.event.pageX + padding/2) + \"px\")\n .style(\"top\", d3.event.pageY + \"px\")\n .html(\"<p>\" + d.Name + \",&nbsp;\" + d.Nationality + \"</p><p>Year:\" + d.Year + \"&nbsp;&nbsp;&nbsp;Time:\" + timeFormat(d.Time) + \"&nbsp;&nbsp;&nbsp;Place:\" + d.Place + \"</p>\" + (d.Doping ? (\"<br><p>\" + d.Doping +\"</p\") : \"\"));\n}", "function mouseover(d){ \n var selectedYear = myData.filter(function(s){ \n return s.year == d[0]\n ;})[0];\n var yearSentiment = d3\n .keys(selectedYear.sentiment)\n .map(function(s){ \n return {type:s, sentiment:selectedYear.sentiment[s]};\n });\n \n// call the functions that update the pie chart and legend, to connect this to the mouseover of bar chart\n// refer to the yearSentiment, becaue this new variable tells what data is selected \n pC.update(yearSentiment);\n leg.update(yearSentiment);\n }", "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function (v) {\n return [v.month, v.total];\n }), barColor);\n }", "function infoTurnover() {\n var title = 'Turnover Rate';\n var msg = 'This measure refers to the average quantity sold per day over the last 30 days. ' +\n 'This helps to show the number of days worth of inventory is on hand.';\n app.showMessage(msg, title, ['Ok']);\n }", "handleMouseOver (vis, event, d) {\n // console.log(\"hover over\", d);\n let leftPosition = event.pageX + 10 + \"px\";\n if (window.innerWidth - event.pageX < 500) {\n leftPosition = event.pageX - 300 + \"px\";\n }\n let census = vis.insights[d.count];\n let censusCount = d.count;\n let peopleCount = census ? census.total : 0;\n let censusPercent = vis.legendData.find(c => c.censusCount == d.count);\n censusPercent = censusPercent? censusPercent.censusPercent : 0;\n if ((d.count === 0 && vis.filters.length === 0) || !census) {\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n </div>`\n );\n } else if (d.count === 0) {\n let tipText = `<div>${peopleCount.toLocaleString(\"en\")} people with filter attribute</div> `;\n vis.filters.forEach(f => {\n tipText += `<div>${v2CheckBoxGuide[f].title}.</div> `;\n })\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n ${tipText}\n </div>`\n );\n } else {\n // They show up in a census\n let topPob = d3.greatest(census.pobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topAgeGroup = d3.greatest(census.ageMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCensus = d3.greatest(census.censusMap, (a, b) => d3.ascending(a[1], b[1]));\n let topGender = d3.greatest(census.genderMap, (a, b) => d3.ascending(a[1], b[1]));\n let topColor = d3.greatest(census.colorMap, (a, b) => d3.ascending(a[1], b[1]));\n let topJob = d3.greatest(census.jobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCounty = d3.greatest(census.countyMap, (a, b) => d3.ascending(a[1], b[1]));\n // console.log(topPob,topAgeGroup, topCensus );\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census</h5>\n <div> The ${peopleCount.toLocaleString(\"en\")} people in ${censusCount} census are most likely</div>\n <div> to be born in ${topPob[0]} living in ${upperCaseFirstLetters(topCounty[0])}, Nevada. </div> \n <div> Their first census was at age ${topAgeGroup[0]} in year ${topCensus[0]}. </div> \n <div> Gender \"${topGender[0]}\", \"color ${topColor[0]}\",\n and job \"${upperCaseFirstLetters(topJob[0])}\".</div> \n </div>`\n );\n }\n }", "function mouseover() {\n //convert the slider value to the correct index of time in mapData\n spot = d3.select(this);\n if (!spot.classed('hidden-spot')) {\n index = rangeslider.value - 5\n let occupant = mapData[spot.attr(\"id\")][index];\n tooltip\n .html(mapData[spot.attr(\"id\")][0] + ': ' + (occupant === \"\" ? \"Unoccupied\" : occupant))\n .style(\"opacity\", 1);\n }\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function mouseover(d){\n // call the update function of histogram with new data.\n hGW.update(fData.map(function(v){ \n return [v.State,v.freq[d.data.type]];}),segColor(d.data.type));\n hGR.update(fData.map(function(v){ \n return [v.State,v.rate[d.data.type]];}),segColor(d.data.type));\n hGC.update(fData.map(function(v){ \n return [v.State,v.count[d.data.type]];}),segColor(d.data.type));\n }", "function cost_over_time(ndx) {\n var cost_over_time_dim = ndx.dimension(dc.pluck(\"PaymentDate\"));\n var cost_over_time_group = cost_over_time_dim.group().reduceSum(dc.pluck('Sum'));\n\n var minDate = cost_over_time_dim.bottom(1)[0].PaymentDate;\n var maxDate = cost_over_time_dim.top(1)[0].PaymentDate;\n\n dc.lineChart('.Cost-Over-Time')\n .width(1000)\n .height(500)\n .useViewBoxResizing(true)\n .margins({top: 10, right: 150, bottom: 55, left: 150})\n .dimension(cost_over_time_dim)\n .elasticY(true)\n .group(cost_over_time_group)\n .transitionDuration(500)\n .x(d3.time.scale().domain([minDate,maxDate]))\n .yAxis().ticks(15);\n}", "function mousemovepayoff() {\n // Get the number and the index of that number\n var mouseNum = x3.invert(d3.mouse(this)[0]),\n i2 = Math.round(mouseNum+30-thisPrice[k]);\n\n // Only show tooltip if there is a line\n if (payoffData[k].length !== 0) {\n\n // Only one line, so profit doesn't get calculated\n if (payoffData[k].length === 1) {\n var d = payoffData[k][payoffData[k].length-1][i2];}\n // More lines, there is a profit variable\n else { var d = profit[i2]}\n\n // move the circle\n toolTip2.select(\"circle.y\") \n .attr(\"transform\", \n \"translate(\" + x3(d.key) + \",\" + \n y3(d.price) + \")\");\n\n // Place the profit and price above of the circle\n toolTip2.select(\"text.y2\")\n .attr(\"transform\",\n \"translate(\" + x3(d.key) + \",\" +\n y3(d.price) + \")\")\n .text(\"Profit: \"+formatCurrency(d.price)); \n\n toolTip2.select(\"text.y3\")\n .attr(\"transform\",\n \"translate(\" + x3(d.key) + \",\" +\n y3(d.price) + \")\")\n .text(\"Price: \"+formatCurrency(Math.round(d.key)));\n // No tooltip if there is no investment in the stock\n } else {toolTip2.style(\"display\", \"none\");}\n }", "function createMousoverHtml(d) {\n\n var html = \"\";\n html += \"<div class=\\\"tooltip_kv\\\">\";\n html += \"<span class=\\\"tooltip_key\\\">\";\n html += d['Item'];\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Total Accidents: \"\n try {\n html += (d[\"Total_Accidents\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: \"\n html += (d[\"Fatal\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: \"\n html += (d[\"Serious\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: \"\n html += (d[\"Minor\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: \"\n html += (d[\"Uninjured\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>VMC: \"\n html += (d[\"VMC\"]);\n html += \" IMC: \"\n html += (d[\"IMC\"]);\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Destroyed: \"\n html += (d[\"Destroyed_Damage\"]);\n html += \" Substantial: \"\n html += (d[\"Substantial_Damage\"]);\n html += \" Minor: \"\n html += (d[\"Minor_Damage\"]);\n }\n catch (error) {\n html = html.replace(\"<a>Total Accidents: \", \"\")\n html += \"<a>Total Accidents: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Fatalities: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Serious Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Minor Injuries: 0\"\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"<span class=\\\"tooltip_value\\\">\";\n html += \"<a>Uninjured: 0\"\n }\n html += \"</a>\";\n html += \"</span><br>\";\n html += \"</div>\";\n $(\"#tooltip-container-scatter\").html(html);\n $(this).attr(\"fill-opacity\", \"0.8\");\n $(\"#tooltip-container-scatter\").show();\n\n //quello commentato ha senso, ma scaja\n //var map_width = document.getElementById('scatter').getBoundingClientRect().width;\n var map_width = $('scatter')[0].getBoundingClientRect().width;\n //console.log($('scatter'))\n\n //console.log('LAYER X ' + d3.event.layerX)\n //console.log('LAYER Y ' + d3.event.layerY)\n\n if (d3.event.layerX < map_width / 2) {\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX + 15) + \"px\");\n } else {\n var tooltip_width = $(\"#tooltip-container-scatter\").width();\n d3.select(\"#tooltip-container-scatter\")\n .style(\"top\", (d3.event.layerY + 15) + \"px\")\n .style(\"left\", (d3.event.layerX - tooltip_width - 30) + \"px\");\n }\n}", "function mouseover(p) {\n tooltip.style(\"visibility\", \"visible\");\n tooltip.html(names[p.y] + \" vs \" + names[p.x] + \" - Total Meetings: \" + (matrix[p.x][p.y].z + matrix[p.y][p.x].z) + \". <br/>\" + names[p.y] + \" has won \" + p.z + \" of them.\");\n d3.selectAll(\".row text\").classed(\"active\", function(d, i) {\n return i == p.y;\n });\n d3.selectAll(\".column text\").classed(\"active\", function(d, i) {\n return i == p.x;\n });\n }", "function handleMouseOver(d, i) {\n\nd3.selectAll(\".visualCircle\").transition()\n .duration(200)\n .style(\"opacity\", 1)\n .attr(\"fill\", \"rgba(255,255,255,0.8)\")\n .attr(\"r\", circleRBefore);\n\nd3.selectAll(\".visualLabel\").transition()\n .duration(200)\n .style(\"opacity\", 0);\n\nd3.select(\"#circle_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 0.2)\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .attr(\"r\", circleRAfter);\n\nd3.select(\"#text_\" + this.id).transition()\n .duration(200)\n .style(\"opacity\", 1);\n \ndocument.getElementById(\"type680target\").innerHTML = \"<h4>\" + itemTitles[this.id] + \"</h4><hr class='light' style='margin-left: 0px;'><p class='text-justify'>\" + itemDescriptions[this.id] + \"</p>\";\n\n}", "function handleMouseOver(d) { // Add interactivity\r\n\t// while (d3.select(\".detail_text_title\").empty() != true) {\r\n\t// d3.select(\".detail_text_title\").remove(); // Remove text location\r\n\t// }\r\n\t// while (d3.select(\".detail_text_sentence\").empty() != true) {\r\n\t// d3.select(\".detail_text_sentence\").remove(); // Remove text location\r\n\t// }\r\n\twhile (d3.select(\".detail_text_no_event\").empty() != true) {\r\n\t d3.select(\".detail_text_no_event\").remove(); // Remove text location\r\n\t}\r\n\twhile (d3.select(\".detail_div\").empty() != true) {\r\n\t d3.select(\".detail_div\").remove(); // Remove text location\r\n\t}\r\n\r\n\t// DETAIL PART\r\n var match_event = []\r\n x = d3.mouse(this)[0] + 20\r\n // y_hover = d3.mouse(this)[1] - \r\n\ty_hover = y(d.subscriber_gain) - 50\r\n\td3.tsv('data/event.txt', function(data) {\r\n\t\tfor (id in data) {\r\n\t\t\t// console.log(data[id])\r\n\t\t\tif (d.year == data[id].year) {\r\n\t\t\t\tif (d.month == data[id].month) {\r\n\t\t\t\t\tmatch_event.push(data[id])\r\n\t\t\t\t\t// console.log(match_event)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// selecting\r\n\t detail_text_div = d3.select(\".hover_info_div\").append(\"div\").attr(\"class\", \"detail_div\")\r\n\r\n\t console.log(\"AAA\" )\r\n\r\n\t detail_text_div.append(\"p\").attr(\"class\", \"month_year_name\").text(monthNames[parseInt(d.month)-1] + ' ' + d.year)\r\n\r\n \t\tdetail_text_div.append(\"ol\")\r\n \t\tid_show = 1\r\n\t \tfor (id_event in match_event) {\r\n\t \t\tdetail_text_div.append(\"b\").attr(\"class\", \"detail_text_title\").text(id_show+\". \"+match_event[id_event].ttitle)\r\n\t \t\tdetail_text_div.append(\"div\").attr(\"class\", \"detail_text_sentence\").text(match_event[id_event].detail)\r\n\t \t\tdetail_text_div.append(\"br\")\r\n\t \t\tid_show+=1\r\n\t \t}\r\n\t \tif (d3.select(\".detail_text_sentence\").empty()) {\r\n\t \t\tdetail_text_div.append(\"p\").attr(\"class\", \"detail_text_no_event\").text(\"No special event in this month\")\r\n\t \t}\r\n\t})\r\n\r\n\t// BOX PART\r\n var match_event = []\r\n x = d3.mouse(this)[0] + 20\r\n // y_hover = d3.mouse(this)[1] - \r\n\ty_hover = y(d.subscriber_gain) - 50\r\n\r\n var text = svg.append(\"text\")\r\n .attr(\"id\", \"hover_bar\")\r\n .attr(\"fill\", \"white\")\r\n .attr(\"font-size\", \"15\")\r\n .attr(\"x\", function(d) {\r\n \treturn x;\r\n }).attr(\"y\", function(d) {\r\n \treturn y_hover; // - count_line*20;\r\n })\r\n\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Month/Year : \" + d.month + '-' + d.year)\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Subcriber gain : \" + d.subscriber_gain)\r\n text.append(\"tspan\").attr(\"x\", x+5).attr(\"dy\",\"1.2em\").text(\"Subcriber total : \" + d.subscriber_total)\r\n\r\n\tvar bbox = text.node().getBBox();\r\n\r\n\tvar rect = svg.append(\"rect\")\r\n\t .attr(\"id\", \"hover_bar_box\")\r\n\t .attr(\"x\", bbox.x - 5)\r\n\t .attr(\"y\", bbox.y - 5)\r\n\t .attr(\"width\", bbox.width + 10)\r\n\t .attr(\"height\", bbox.height + 10)\r\n\t .style(\"fill\", \"#000\")\r\n\t .style(\"fill-opacity\", \"0.2\")\r\n\t .style(\"stroke\", \"#fff\")\r\n\t .style(\"stroke-width\", \"1.5px\");\r\n }", "function handleMouseOverBubble(d, i) {\n d3.select(this).attr(\"r\", d.radius * 1.2);\n\n document.getElementById(\"team-details\").classList.remove(\"closed\");\n document.getElementById(\"td-team-name\").innerHTML = d.Team;\n document.getElementById(\"td-test-status-year\").innerHTML =\n \"Started in \" + d.StartYear;\n\n document.getElementById(\"td-team-matches\").innerHTML = d.Mat.toLocaleString();\n document.getElementById(\"td-team-won\").innerHTML = d.Won.toLocaleString();\n document.getElementById(\"td-team-lost\").innerHTML = d.Lost.toLocaleString();\n document.getElementById(\"td-team-undecided\").innerHTML =\n d.Undecided.toLocaleString();\n document.getElementById(\"row-runs\").style.display = \"none\";\n}", "function arc_onMouseOver(e,d,i) {\n stopAnnimation();\n\n //Find all links from a PAC and create totals\n var links=viz.selection().selectAll(\".vz-halo-link-path.halo-key_\" + d.data.key);\n var total=0;\n var num = 0;\n var average = 0;\n links.each(function (d) {\n num ++;\n total+= viz.value()(d.data);\n });\n\n total = d3.format(\",.0f\")(total);\n\n average = d3.format(\",.0f\")(total / num);\n // console.log('number: ' + num);\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-node-plot\")[0][0].getBoundingClientRect();\n createDataTip(d.x + rect.left + rect.width/2, (d.y + rect.top + 100),\"NEWS SOURCE\", d.data.values[0].CMTE_NM,\"Sentiment index: \" + total);\n}", "function handleMouseOut(d){\r\n d3.select(this)\r\n .transition(\"mouse\")\r\n .attr(\"fill\",(d) => color(d.properties.avgprice))\r\n .attr(\"stroke\", \"#641E16\")\r\n .attr(\"stroke-width\", 1)\r\n .style(\"cursor\", \"default\")\r\n }", "function onMouseOut(d,i) {\n scheduleAnnimation();\n d3.selectAll(\".vz-halo-label\").remove();\n}", "function mouseleave() {\n // Hide the breadcrumb trail\n d3.select('#trail')\n .style('visibility', 'hidden');\n\n // Deactivate all segments during transition.\n d3.selectAll('path').on('mouseover', null);\n\n // Transition each segment to full opacity and then reactivate it.\n d3.selectAll('path')\n .transition()\n .duration(1000)\n .style('opacity', 1)\n .each('end', function over() {\n d3.select(this).on('mouseover', mouseover);\n });\n\n d3.select('#percentage')\n .text('');\n\n d3.select('#info-text-nbIssues')\n .text('Touch me !')\n .style('font-size', '2.5em');\n\n d3.select('#info-text-info-repo')\n .text('');\n\n d3.select('#explanation')\n .style('top', '210px');\n}", "function mouseoverDeputy(d) {\n\t\t\tsvg.select('#deputy-'+d.record.deputyID).attr(\"r\",radiusHover)\n\t\n\t\t\tdispatch.hover(d.record,true);\n\n\t\t\ttooltip.html(d.record.name +' ('+d.record.party+'-'+d.record.district+')'+\"<br /><em>Click to select</em>\");\n\t\t\treturn tooltip\n\t\t\t\t\t.style(\"visibility\", \"visible\")\n\t\t\t\t\t.style(\"opacity\", 1);\n\t\t}", "function handleMouseOutPie() {\n // removes stroke\n d3.select(this)\n .attr(\"stroke\", \"none\")\n\n // fade out text\n svg.selectAll(\".percentage\")\n .transition().duration(500)\n .attr(\"opacity\", 0)\n .remove()\n }", "onMouseleave(e) {\n this.tooltip.remove();\n this.tooltipLine.remove();\n this.tooltipCircle.remove();\n\n // Actualiza el precio (al no llevar argumentos, price es false y se pone el último valor de la criptomoneda mostrada)\n this.setPrice();\n }", "function drawChartListing(livelist,livesale,liverent,pendinglist,pendsale,pendrent,lesspics,lesspicssale,lesspicsrent)\n\n\t\t\t{\n\n\t\t\t\tvar portalsArray = [];\n\n\t\t\t\tvar salesArray = [];\n\n\t\t\t\tvar rentalsArray = [];\n\n\t\t\t\tvar itemsCount = 0;\n\n\t\t\t\t//$.each(portalData, function( index, value ) {\n\n\t\t\t\t portalsArray.push([1,livelist]);\n\n\t\t\t\t salesArray.push([1,livesale]);\n\n\t\t\t\t rentalsArray.push([1,liverent]);\n\n\t\t\t\t // itemsCount++;\n\n\t\t\t\t//});\n\n\t\t\t\t portalsArray.push([2,pendinglist]);\n\n\t\t\t\t salesArray.push([2,pendsale]);\n\n\t\t\t\t rentalsArray.push([2,pendrent]);\n\n\t\t\t\t portalsArray.push([3,lesspics]);\n\n\t\t\t\t salesArray.push([3,lesspicssale]);\n\n\t\t\t\t rentalsArray.push([3,lesspicsrent]);\n\n\t\t\t\t itemsCount = 3;\n\n\t\t\t\t plotDataMe(salesArray,rentalsArray,portalsArray,itemsCount);\n\n\t\t\n\n\t\t\t\t\n\n\t\t\t}", "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(data.map(function(v) {\n return [v.Range, v.total];\n }), barColor);\n }", "function link_onMouseOver(e,d,i) {\n stopAnnimation();\n\n // find the associated candidate and get values for the datatip\n var cand=viz.selection().selectAll(\".vz-halo-node.node-key_\" + viz.nodeKey()(d.data));\n var datum=cand.datum();\n var total = d3.format(\",.0f\")(viz.value()(d.data));\n var date = '';\n // var date = d.data.month + \"/\" + d.data.day + \"/\" + d.data.year;\n\n //Create and position the datatip\n var rect = d3.selectAll(\".vz-halo-arc-plot\")[0][0].getBoundingClientRect();\n createDataTip(datum.x + rect.left + datum.r, datum.y + datum.r + 25 + rect.top, date, d.data.CAND_NAME,\"Sentiment index: \" + total);\n\n //find the pac and create a label for it.\n var pac=viz.selection().selectAll(\".vz-halo-arc.halo-key_\" + viz.haloKey()(d.data));\n datum=pac.datum();\n createPacLabel(datum.x, datum.y,datum.data.values[0].CMTE_NM);\n}", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v) {\n return [v.State, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }", "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v) {\n return [v.State, v.total];\n }), barColor);\n }", "function mouseover(d) {\n var shiftX = 10;\n var shiftY = 20;\n\n var mouseCoords = d3.mouse(this);\n d3.select(\"#tooltip\")\n .style(\"left\", function(d) {\n return mouseCoords[0] + shiftX + \"px\"\n })\n .style(\"top\", function(d) {\n return mouseCoords[1] + shiftY + \"px\"\n })\n .html(function() {\n if (d.energy[1990] == null || d.energy[currentYear][\"All products\"] == 0) return d.name + \": No data\";\n\n var all = d.energy[currentYear][\"All products\"];\n var renewable = d.energy[currentYear][\"Renewable energies\"];\n var per = renewable / all;\n\n hoverArrow(per);\n\n return \"<b>\" + d.name + \"</b><br/>\" + fmtPer(per) + \" renewables\"\n })\n .classed(\"hidden\", false);\n}", "function mouseover(d)\r\n\t\t\t{\r\n\t\t\t\t$(\"#col2\").text(\"\");\r\n\t\t\t\tcontent.append(\"div\").attr(\"id\",\"iw-container\").append(\"div\").attr(\"class\",\"iw-title\").append(\"i\").attr(\"class\",\"fa fa-info-circle\")\r\n\t\t\t\t.attr(\"style\",\"padding-right:20px;font-weight:bold;\")\r\n \t\t\t.text(\"\t\"+d.name)// + \" - 2013 appropriations: \" + d.appropriation13 + \" - Which was a \" + d.percentChange13 + \"% change of the previous year.\")\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Orders: \" + format(d.appropriation14/10))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" New Customers: \" + format((d.appropriation13)))\r\n\t\t\t\tcontent.append(\"p\").attr(\"style\",\"padding-left:10px !important;\")\r\n\t\t\t\t.text(\" Total Product Lines: \" + format((d.appropriation12)))\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.attr(\"id\", \"annotate\")\r\n\t\t\t\t.text(d.annotation)\r\n\t\t\t\tif (d.annotation2 != null)\r\n\t\t\t\t{\r\n\t\t\t\tcontent1.append(\"br\")\r\n\t\t\t\tcontent1.append(\"p\")\r\n\t\t\t\t.text(d.annotation2);\r\n\t\t\t\t}\r\n\r\n \t\t\t}", "function displayIndicators() {\n // Indicator formulas\n var totalPopInd = upgrade.ship.number * upgrade.ship.rate;\n var redCoatInd = (((population.colonist.number * population.colonist.rate) - event.FIW.fundRate) + (((population.colonist.number * population.colonist.rate) - event.FIW.fundRate) / 10) + (upgrade.military.warShipGB.number * upgrade.military.warShipGB.rate)) * upgrade.military.allies.nativeAmerican.multiplier;\n var SDInd = (population.merchant.rate2 * population.merchant.mult2 * (1 - taxRate));\n var CNInd = currency.colonialNotes.rate;\n var goodsInd0 = (((population.colonist.number * population.colonist.rate) + ((population.slave.number / population.slave.increment) * population.slave.rate)) - (population.merchant.rate1 * population.merchant.mult1));\n var goodsInd1 = (((population.slave.number / population.slave.increment) * population.slave.rate) - (population.merchant.rate1 * population.merchant.mult1));\n var silverInd1 = (population.colonist.number * population.colonist.rate) - event.FIW.fundRate;\n var silverInd2 = population.colonist.number * population.colonist.rate;\n var goldInd1 = (population.colonist.number * population.colonist.rate) - event.FIW.fundRate;\n var goldInd2 = population.colonist.number * population.colonist.rate;\n \n // Population indicators\n if ((totalPopInd > 0) && (periodCount !== 3)) {\n document.getElementById(\"popInd\").innerHTML = \"(+\" + totalPopInd + \")\";\n $(\"#popInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n if (document.getElementById(\"redCoatDiv\") !== null) {\n if (redCoatInd > 0) {\n document.getElementById(\"redCoatInd\").innerHTML = \"(+\" + numFormat(redCoatInd) + \")\";\n $(\"#redCoatInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (redCoatInd < 0) {\n document.getElementById(\"redCoatInd\").innerHTML = \"(\" + numFormat(redCoatInd) + \")\";\n $(\"#redCoatInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"redCoatInd\").innerHTML = \"(\" + numFormat(redCoatInd) + \")\";\n $(\"#redCoatInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n \n // Currency indicators\n if (document.getElementById(\"SDDiv\") !== null) {\n if (SDInd > 0) {\n document.getElementById(\"SDInd\").innerHTML = \"(+\" + numFormat(SDInd) + \")\";\n $(\"#SDInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (SDInd < 0) {\n document.getElementById(\"SDInd\").innerHTML = \"(\" + numFormat(SDInd) + \")\";\n $(\"#SDInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"SDInd\").innerHTML = \"(\" + numFormat(SDInd) + \")\";\n $(\"#SDInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n \n if (document.getElementById(\"CNDiv\") !== null) {\n if (CNInd > 0) {\n document.getElementById(\"CNInd\").innerHTML = \"(+\" + CNInd.toLocaleString() + \")\";\n $(\"#CNInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (CNInd < 0) {\n document.getElementById(\"CNInd\").innerHTML = \"(\" + CNInd.toLocaleString() + \")\";\n $(\"#CNInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"CNInd\").innerHTML = \"(\" + CNInd.toLocaleString() + \")\";\n $(\"#CNInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n \n // Goods indicator\n if (periodCount === 0) {\n if (goodsInd0 > 0) {\n document.getElementById(\"goodsInd\").innerHTML = \"(+\" + numFormat(goodsInd0) + \")\";\n $(\"#goodsInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (goodsInd0 < 0) {\n document.getElementById(\"goodsInd\").innerHTML = \"(\" + numFormat(goodsInd0) + \")\";\n $(\"#goodsInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"goodsInd\").innerHTML = \"(\" + numFormat(goodsInd0) + \")\";\n $(\"#goodsInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n else if ((periodCount > 0) && (periodCount !== 3)) {\n if (goodsInd1 > 0) {\n document.getElementById(\"goodsInd\").innerHTML = \"(+\" + numFormat(goodsInd1) + \")\";\n $(\"#goodsInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (goodsInd1 < 0) {\n document.getElementById(\"goodsInd\").innerHTML = \"(\" + numFormat(goodsInd1) + \")\";\n $(\"#goodsInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"goodsInd\").innerHTML = \"(\" + numFormat(goodsInd1) + \")\";\n $(\"#goodsInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n \n // Silver indicator\n if (periodCount > 0) {\n if (document.getElementById(\"FIW\") !== null) {\n if (silverInd1 > 0) {\n document.getElementById(\"silverInd\").innerHTML = \"(+\" + numFormat(silverInd1) + \")\";\n $(\"#silverInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (silverInd1 < 0) {\n document.getElementById(\"silverInd\").innerHTML = \"(\" + numFormat(silverInd1) + \")\";\n $(\"#silverInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"silverInd\").innerHTML = \"(\" + numFormat(silverInd1) + \")\";\n $(\"#silverInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n else if (periodCount !== 3) {\n if (silverInd2 > 0) {\n document.getElementById(\"silverInd\").innerHTML = \"(+\" + numFormat(silverInd2) + \")\";\n $(\"#silverInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (silverInd2 < 0) {\n document.getElementById(\"silverInd\").innerHTML = \"(\" + numFormat(silverInd2) + \")\";\n $(\"#silverInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"silverInd\").innerHTML = \"(\" + numFormat(silverInd2) + \")\";\n $(\"#silverInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n } \n \n // Gold indicator\n if (periodCount > 0) {\n if (document.getElementById(\"FIW\") !== null) {\n if (goldInd1 > 0) {\n document.getElementById(\"goldInd\").innerHTML = \"(+\" + numFormat(goldInd1) + \")\";\n $(\"#goldInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (goldInd1 < 0) {\n document.getElementById(\"goldInd\").innerHTML = \"(\" + numFormat(goldInd1) + \")\";\n $(\"#goldInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"goldInd\").innerHTML = \"(\" + numFormat(goldInd1) + \")\";\n $(\"#goldInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n else if (periodCount !== 3) {\n if (goldInd2 > 0) {\n document.getElementById(\"goldInd\").innerHTML = \"(+\" + numFormat(goldInd2) + \")\";\n $(\"#goldInd\").removeClass(\"negative\").addClass(\"positive\");\n }\n else if (goldInd2 < 0) {\n document.getElementById(\"goldInd\").innerHTML = \"(\" + numFormat(goldInd2) + \")\";\n $(\"#goldInd\").removeClass(\"positive\").addClass(\"negative\");\n }\n else {\n document.getElementById(\"goldInd\").innerHTML = \"(\" + numFormat(goldInd2) + \")\";\n $(\"#goldInd\").removeClass(\"positive\").removeClass(\"negative\");\n }\n }\n }\n}", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(data.map(function(v) {\n return [v.Range, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }", "function drawOutdoorDiffTotal() {\n\tvar data = google.visualization.arrayToDataTable([\n\t ['Rating', 'Number of Pitches'],\n\t ['5-', 29],\n\t ['5.4', 31],\n\t ['5.5', 43],\n\t ['5.6', 122],\n\t ['5.7', 104],\n\t ['5.8', 84],\n\t ['5.9', 44],\n\t ['5.10a', 24],\n\t ['5.10b', 13],\n\t ['5.10c', 4],\n\t ['5.10d', 1],\n\t ['5.11a', 1]\n\t]);\n\n\tvar options = {\n\t title: 'Difficulty of All Outdoor Climbing Pitches',\n\t titleTextStyle: {\n\t\tcolor: '#000000',\n\t\tfontSize: 14,\n\t\tfontName: 'Arial',\n\t\tbold: true\n\t},\n\t pieHole: 0.3,\n\t width: 375,\n\t height: 200,\n\t backgroundColor: 'transparent'\n\t};\n\n\tvar chart = new google.visualization.PieChart(document.getElementById('outdoorDiffPieTotal'));\n\tchart.draw(data, options);\n}", "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "function nightPriceBar() {\n var nightPrice = []\n var availability = []\n tbody.html(\"\")\n\n create_thead(hotels[\"New York City\"])\n Object.entries(hotels).forEach(function([key, value]) {\n if (key != \"timestamp\") {\n var price = parseFloat(value['Price Per Night ($)'])\n nightPrice.push(price)\n\n var available = parseFloat(value['Availability (%)'])\n availability.push(available)\n\n data_to_table(value)\n }\n\n });\n\n var trace_price = {\n x: Ticks,\n y: nightPrice,\n name: \"Avg Price per Night ($) \",\n text: nightPrice.map(value=>\"<b>$\"+value+\"</b>\"),\n textposition: 'auto',\n textfont: {\n color: 'black'\n },\n hoverinfo: 'none',\n type: 'bar',\n marker: { color: '#2eb8b8' },\n width: 0.5\n };\n\n var trace_availability = {\n x: Ticks,\n y: availability,\n mode: 'markers+text+lines',\n text: availability.map(value=>\"<b>\"+value+\" %</b>\"),\n textposition: 'bottom center',\n textfont: {\n color: 'black'\n },\n hoverinfo: 'none',\n name: \"Avg Availability (%)\",\n type: 'scatter'\n };\n\n var layout_bar = {\n // title: { text: `Average AirBnb Price per Night`, font: { color: \"white\" } },\n xaxis: {\n color: 'white',\n tickfont:{\n size:16\n }\n },\n yaxis: {\n align: \"left\",\n color: 'black'\n },\n legend: {\n font: {\n color: 'white'\n },\n x:0,\n y:-0.15,\n orientation: \"h\"\n },\n plot_bgcolor: \"black\",\n paper_bgcolor: \"black\",\n margin: {\n l: 10,\n r: 10,\n b: 0,\n t: 50,\n pad: 4\n }\n };\n var bar_chart = [trace_price, trace_availability];\n Plotly.newPlot('bar', bar_chart, layout_bar);\n\n d3.select('#chartTitle').text(\"Average AirBnb Price per Night and Availability\")\n\n}", "function computeAvg() {\n var chart = this,\n series = chart.series,\n yAxis = chart.yAxis[0],\n xAxis = chart.xAxis[0],\n extremes = xAxis.getExtremes(),\n min = extremes.min,\n max = extremes.max,\n plotLine = chart.get('avgLine'),\n sum = 0,\n count = 0;\n Highcharts.each(series, function(serie, i) {\n if (serie.name !== 'Navigator') {\n Highcharts.each(serie.data, function(point, j) {\n if (point.x >= min && point.x <= max) {\n sum += point.y;\n count++;\n }\n });\n }\n });\n var avg = (sum / count).toFixed(2);\n // console.log(\"avg hours :\" + sum/count);\n // console.log(\"count \" + count);\n if (!isNaN(avg)) {chart.setTitle(null, {\n text: 'Avg hours : ' + avg\n });}\n yAxis.removePlotLine('avgLine');\n yAxis.addPlotLine({\n value: (avg),\n color: 'red',\n width: 2,\n id: 'avgLine'\n });\n}", "function showDetails() {\n\n var z = wrap.style('zoom') || 1\n\n if (z === 'normal') {\n z = 1\n } else if (/%/.test(z)) {\n z = parseFloat(z) / 100\n }\n\n var x = d3.mouse(this)[0] / z\n var tx = Math.max(0, Math.min(options.width + options.margin.left, x))\n\n var i = d3.bisect(lineData.map(function(d) {\n return d.startTime\n }), xScale.invert(tx - options.margin.left))\n var d = lineData[i]\n var open\n var high\n var low\n var close\n var volume\n var vwap\n\n if (d) {\n open = d.open.toPrecision(5)\n high = d.high.toPrecision(5)\n low = d.low.toPrecision(5)\n close = d.close.toPrecision(5)\n vwap = d.vwap.toPrecision(5)\n volume = d.baseVolume.toFixed(2)\n\n var baseCurrency = base.currency\n var chartDetails = div.select('.chartDetails')\n chartDetails.html('<span class=\"date\">' +\n parseDate(d.startTime.local(), chartInterval) +\n '</span><span><small>O:</small><b>' + open + '</b></span>' +\n '<span class=\"high\"><small>H:</small><b>' + high + '</b></span>' +\n '<span class=\"low\"><small>L:</small><b>' + low + '</b></span>' +\n '<span><small>C:</small><b>' + close + '</b></span>' +\n '<span class=\"vwap\"><small>VWAP:</small><b>' + vwap + '</b></span>' +\n '<span class=\"volume\"><small>Vol:</small><b>' + volume +\n ' ' + baseCurrency + '</b></span>' +\n '<span><small>Ct:</small><b>' + d.count + '</b></span>')\n .style('opacity', 1)\n\n hover.transition().duration(50)\n .attr('transform', 'translate(' + xScale(d.startTime) + ')')\n focus.transition().duration(50)\n .attr('transform', 'translate(' +\n xScale(d.startTime) + ',' +\n priceScale(d.close) + ')')\n horizontal.transition().duration(50)\n .attr('x1', xScale(d.startTime))\n .attr('x2', options.width)\n .attr('y1', priceScale(d.close))\n .attr('y2', priceScale(d.close))\n\n hover.style('opacity', 1)\n horizontal.style('opacity', 1)\n focus.style('opacity', 1)\n }\n }", "function showDalcAndWalc() {\n\n\t// calculate the average workday and weekend alcohol \n\t// consumption arrays for each age\n\tvar avgDalcConsumption = calculateAvgOf(\"Dalc\"),\n\t\tavgWalcConsumption = calculateAvgOf(\"Walc\");\n\n\t// we give \"dalcWalcLabel\" to both lines so that we can remove them together\n\tshowLine(avgDalcConsumption, \"avgDalcLine\");\n \taddPointsToLine(avgDalcConsumption, \"dalcWalc\");\t\t\t\n \taddLabelToLine(avgDalcConsumption, \"Workday Average\", \"dalcWalcLabel\");\n\n \tshowLine(avgWalcConsumption, \"avgWalcLine\");\n \taddPointsToLine(avgWalcConsumption, \"dalcWalc\");\t\t\t\n \taddLabelToLine(avgWalcConsumption, \"Weekend Average\", \"dalcWalcLabel\");\n}", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function mouseoverf(d,i){\n d.region = region.get(d.id) || \"-\";\n if (d.region != \"-\") {\n d3.select(this).attr(\"stroke-width\",2);\n d3.selectAll(\"path\")\n .attr('fill-opacity', 0.6);\n d3.selectAll(\"#\" + d.region)\n .transition().duration(100)\n .attr('fill-opacity', 1);\n return tooltip.style(\"hidden\", false).html(d.waste+\"1\");\n } else {\n d3.select(this).attr(\"stroke-width\",1);\n d3.selectAll(\"path\")\n .attr('fill-opacity', 1);\n }\n}", "function mouseover(d){\n// call another function to update the bar chart with new data, selected by the bar chart slice\n// use a variable and return to give back the right color of the selected bar chart slice to the bar chart rects\n bC.update(myData.map(function(v){ \n return [v.year,v.sentiment[d.data.type]];})\n ,sentimentColor(d.data.type));\n }", "function redrawTotalLoanAmountChart() {\n nv.addGraph(function() {\n var chart = nv.models.lineChart()\n .useInteractiveGuideline(true);\n chart.width(700);\n chart.margin({left:100});\n chart.color(['#2ca02c', 'darkred','darkblue']);\n chart.x(function(d,i) { return i });\n chart.xAxis\n .axisLabel('Date')\n .tickFormat(function(d) {\n var label = scope.totalLoanAmountData[0].values[d].label1;\n return label;\n });\n chart.yAxis\n .axisLabel('Loan Value')\n .tickFormat(function(d){\n return d3.format(',f')(d);\n });\n d3.select('#totalLoanAmountchart svg')\n .datum(scope.totalLoanAmountData)\n .transition().duration(500)\n .call(chart);;\n nv.utils.windowResize(chart.update);;\n return chart;\n });\n }", "function mouseout(d){\n // call the update function of histogram with all data.\n hGW.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n hGR.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n hGC.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n }", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "function mouseoverNode(d){\n\t\n\tvar disVal;\n\tif(showFlowIn){\n\t\tdisVal = \"Flow In Value: \"+d.flowInto;\n\t}\n\telse{\n\t\tdisVal = \"Flow Out Value: \"+d.flowOut;\n\t}\n\n\tdocument.getElementById(\"nodeval\").textContent = disVal;\n}", "function mouseOver(d){\n\t\t\t// d3.select(this).attr(\"stroke\",\"black\");\n\t\t\ttooltip.html(\"<strong>Frequency</strong>\" + \"<br/>\" + d.data.label);\n\t\t\treturn tooltip.transition()\n\t\t\t\t.duration(10)\n\t\t\t\t.style(\"position\", \"absolute\")\n\t\t\t\t.style({\"left\": (d3.event.pageX + 30) + \"px\", \"top\": (d3.event.pageY ) +\"px\" })\n\t\t\t\t.style(\"opacity\", \"1\")\n\t\t\t\t.style(\"display\", \"block\");\n\t\t}", "function bubbleChart() {\r\n // Constants for sizing\r\n var width = 940; //940\r\n var height = 1200; //900\r\n\r\n // tooltip for mouseover functionality\r\n var tooltip = floatingTooltip('gates_tooltip', 240);\r\n\r\n // Locations to move bubbles towards, depending\r\n // on which view mode is selected.\r\n var center = { x: width / 2, y: height / 4};\r\n\r\n var formDiscCenters = {\r\n Formula: { x: width / 4 - 50, y: height / 2 },\r\n Discretionary: { x: width / 2 + 160, y: height / 2 -30 }\r\n };\r\n\r\n var prinOffCenters = {\r\n IES: { x: 495, y: 495},\r\n OCTAE: { x: 495, y: 280 },\r\n /*ODS: { x: 679, y: 210 },*/\r\n OELA: { x: 679, y: 265},\r\n OESE: { x: 165, y: 300},\r\n OII: { x: 310, y: 300},\r\n OPE: { x: 330, y: 487},\r\n OSERS: { x: 170, y: 470}\r\n };\r\n\r\n var formDiscsTitleX = {\r\n Formula: 180,\r\n Discretionary: 670,\r\n //2010: width - 160\r\n };\r\n\r\n var prinOffTitleX = {\r\n IES: 565,\r\n OCTAE: 565,\r\n /*ODS: 740,*/\r\n OELA: 740,\r\n OESE: 150,\r\n OII: 375,\r\n OPE: 375,\r\n OSERS: 150\r\n };\r\n // Y locations of the year titles\r\n\r\n var prinOffTitleY = {\r\n IES: 410,\r\n OCTAE: 130,\r\n /*ODS: 90,*/\r\n OELA: 130,\r\n OESE: 130,\r\n OII: 130,\r\n OPE: 410,\r\n OSERS: 410\r\n};\r\n\r\nvar prinOffPopUp = {\r\n IES: \"Institute of Education Sciences\",\r\n OCTAE: \"Office of Career, Technical, and Adult Education\",\r\n /*ODS: \"Office of the Deputy Secretary\",*/\r\n OELA: \"Office of English Language Acquisition\",\r\n OESE: \"Office of Elementary and Secondary Education\",\r\n OII: \"Office of Innovation and Improvement\",\r\n OPE: \"Office of Postsecondary Education\",\r\n OSERS: \"Office of Special Education and Rehabilitative Services\"\r\n };\r\n\r\n // @v4 strength to apply to the position forces\r\n var forceStrength = 0.03;\r\n\r\n // These will be set in create_nodes and create_vis\r\n var svg = null;\r\n var bubbles = null;\r\n var nodes = [];\r\n var nodes2 = [];\r\n\r\n // Charge function that is called for each node.\r\n // As part of the ManyBody force.\r\n // This is what creates the repulsion between nodes.\r\n //\r\n // Charge is proportional to the diameter of the\r\n // circle (which is stored in the radius attribute\r\n // of the circle's associated data.\r\n //\r\n // This is done to allow for accurate collision\r\n // detection with nodes of different sizes.\r\n //\r\n // Charge is negative because we want nodes to repel.\r\n // @v4 Before the charge was a stand-alone attribute\r\n // of the force layout. Now we can use it as a separate force!\r\n function charge(d) {\r\n return -Math.pow(d.radius, 2.0) * forceStrength;\r\n }\r\n\r\n // Here we create a force layout and\r\n // @v4 We create a force simulation now and\r\n // add forces to it.\r\n var simulation = d3.forceSimulation()\r\n .velocityDecay(0.2)\r\n .force('x', d3.forceX().strength(forceStrength).x(center.x))\r\n .force('y', d3.forceY().strength(forceStrength).y(center.y))\r\n .force('charge', d3.forceManyBody().strength(charge))\r\n .on('tick', ticked);\r\n\r\n // @v4 Force starts up automatically,\r\n // which we don't want as there aren't any nodes yet.\r\n simulation.stop();\r\n\r\n var simulationForChanges = d3.forceSimulation()\r\n .velocityDecay(0.2)\r\n .force('x', d3.forceX().strength(forceStrength).x(center.x))\r\n .force('y', d3.forceY().strength(forceStrength).y(center.y))\r\n //.force('charge', d3.forceManyBody().strength(charge))\r\n .on('tick', ticked);\r\n\r\n simulationForChanges.stop();\r\n\r\n // Nice looking colors - no reason to buck the trend\r\n // @v4 scales now have a flattened naming scheme\r\n var fillColor = d3.scaleOrdinal()\r\n .domain(['bottomQuint','lowerQuint','midQuint','upperQuint','topQuint'])\r\n .range(['#C2D6D0', '#A7BFB8', '#8DA7A0','#729088','#587970']);\r\n\r\n\r\n /*\r\n * This data manipulation function takes the raw data from\r\n * the CSV file and converts it into an array of node objects.\r\n * Each node will store data and visualization values to visualize\r\n * a bubble.\r\n *\r\n * rawData is expected to be an array of data objects, read in from\r\n * one of d3's loading functions like d3.csv.\r\n *\r\n * This function returns the new node array, with a node in that\r\n * array for each element in the rawData input.\r\n */\r\n function createNodes(rawData) {\r\n // Use the max in the data as the max in the scale's domain\r\n // note we have to ensure the total_amount is a number.\r\n var maxAmount = d3.max(rawData, function (d) { return +d.amount; });\r\n // Sizes bubbles based on area.\r\n // @v4: new flattened scale names.\r\n var radiusScale = d3.scalePow()\r\n .exponent(0.5)\r\n .range([2, 85])\r\n .domain([0, maxAmount]);\r\n\r\n // Use map() to convert raw data into node data.\r\n // Checkout http://learnjsdata.com/ for more on\r\n // working with data.\r\n var myNodes = rawData.map(function (d) {\r\n return {\r\n radius: radiusScale(+d.amount),\r\n value: +d.amount,\r\n balance: +d.balance,\r\n count: d.count,\r\n name: d.name,\r\n color: d.color,\r\n year: d.year,\r\n grantType: d.type,\r\n grantOff:d.office,\r\n x: Math.random() * 900,\r\n y: Math.random() * 800\r\n };\r\n });\r\n // sort them to prevent occlusion of smaller nodes.\r\n //circle algorithm\r\n myNodes.sort(function (a, b) { return b.value - a.value; });\r\n\r\n return myNodes;\r\n }\r\n\r\n function createTotalNodes(rawData) {\r\n var myNodesTotal = rawData.map(function (d) {\r\n return {\r\n office: d.name,\r\n total: +d.total,\r\n };\r\n });\r\n return myNodesTotal;\r\n }\r\n\r\n\r\n /*\r\n * Main entry point to the bubble chart. This function is returned\r\n * by the parent closure. It prepares the rawData for visualization\r\n * and adds an svg element to the provided selector and starts the\r\n * visualization creation process.\r\n *\r\n * selector is expected to be a DOM element or CSS selector that\r\n * points to the parent element of the bubble chart. Inside this\r\n * element, the code will add the SVG continer for the visualization.\r\n *\r\n * rawData is expected to be an array of data objects as provided by\r\n * a d3 loading function like d3.csv.\r\n */\r\n var chart = function chart(selector, rawData) {\r\n // convert raw data into nodes data\r\n nodes = createNodes(rawData[0]); \r\n nodes2 = createTotalNodes(rawData[1]); \r\n // console.log(nodes2)*********\r\n // Create a SVG element inside the provided selector\r\n // with desired size.\r\n svg = d3.select(selector)\r\n .append('svg')\r\n .attr('width', width)\r\n .attr('height', height)\r\n .attr('id', 'svgContainer');\r\n\r\n // Bind nodes data to what will become DOM elements to represent them.\r\n bubbles = svg.selectAll('.bubble')\r\n //.data(nodes, function (d) { return d.id; });\r\n .data(nodes);\r\n // Create new circle elements each with class `bubble`.\r\n // There will be one circle.bubble for each object in the nodes array.\r\n // Initially, their radius (r attribute) will be 0.\r\n // @v4 Selections are immutable, so lets capture the\r\n // enter selection to apply our transtition to below.\r\n var bubblesE = bubbles.enter().append('circle')\r\n .classed('bubble', true)\r\n .attr('r', 0)\r\n .attr('fill', function (d) { return fillColor(d.color); })\r\n .attr('stroke', function (d) { return d3.rgb(fillColor(d.color)).darker(); })\r\n .attr('stroke-width', 2)\r\n .on('mouseover', showDetail)\r\n .on('mouseout', hideDetail);\r\n\r\n // @v4 Merge the original empty selection and the enter selection\r\n bubbles = bubbles.merge(bubblesE);\r\n\r\n // Fancy transition to make bubbles appear, ending with the\r\n // correct radius\r\n bubbles.transition()\r\n .duration(2000)\r\n .attr('r', function (d) { return d.radius; });\r\n\r\n // Set the simulation's nodes to our newly created nodes array.\r\n // @v4 Once we set the nodes, the simulation will start running automatically!\r\n simulation.nodes(nodes);\r\n simulationForChanges.nodes(nodes);\r\n\r\n // Set initial layout to single group.\r\n \r\n showPrinOffTitles(nodes2);\r\n //hideTypePrinOff();\r\n splitBubblesPrinOff(nodes2)\r\n groupBubbles();\r\n \r\n\r\n };\r\n\r\n /*\r\n * Callback function that is called after every tick of the\r\n * force simulation.\r\n * Here we do the acutal repositioning of the SVG circles\r\n * based on the current x and y values of their bound node data.\r\n * These x and y values are modified by the force simulation.\r\n */\r\n function ticked() {\r\n bubbles\r\n .attr('cx', function (d) { return d.x; })\r\n .attr('cy', function (d) { return d.y; });\r\n }\r\n\r\n /*\r\n * Provides a x value for each node to be used with the split by year\r\n * x force.\r\n */\r\n /*function nodeYearPosX(d) {\r\n //var stringXYear = d.colorprop.toString();\r\n return yearCenters[d.colorprop].x;\r\n } */\r\n /* function nodeYearPosY(d) {\r\n //var stringYYear = d.colorprop.toString();\r\n return yearCenters[d.colorprop].y;\r\n } */\r\n\r\nfunction nodeFormDiscPos(d) {\r\n return formDiscCenters[d.grantType].x;\r\n }\r\n\r\n function nodePrinOffPosX(d) {\r\n return prinOffCenters[d.grantOff].x;\r\n }\r\n function nodePrinOffPosY(d) {\r\n return prinOffCenters[d.grantOff].y;\r\n }\r\n /*\r\n * Sets visualization in \"single group mode\".\r\n * The year labels are hidden and the force layout\r\n * tick function is set to move all nodes to the\r\n * center of the visualization.\r\n */\r\n\r\n function groupBubbles() {\r\n\r\n hideTypeTitles();\r\n hideTypePrinOff();\r\n drawAllLegendCircle();\r\n\r\n // @v4 Reset the 'x' force to draw the bubbles to the center.\r\n simulation.force('x', d3.forceX().strength(forceStrength).x(center.x));\r\n simulation.force('y', d3.forceY().strength(forceStrength).y(300));\r\n // @v4 We can reset the alpha value and restart the simulation\r\n simulation.alpha(1).restart();\r\n }\r\n\r\n function splitBubblesFormDisc(){\r\n\r\n hideTypePrinOff();\r\n showFormDiscTitles();\r\n drawTypeLegendCircle();\r\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\r\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodeFormDiscPos));\r\n simulation.force('y', d3.forceY().strength(forceStrength).y(260));\r\n\r\n // @v4 We can reset the alpha value and restart the simulation\r\n simulation.alpha(1).restart();\r\n }\r\n\r\nfunction splitBubblesPrinOff(data2){\r\n hideTypeTitles();\r\n drawOffLegendCircle(); \r\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\r\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodePrinOffPosX));\r\n simulation.force('y', d3.forceY().strength(forceStrength).y(nodePrinOffPosY));\r\n // @v4 We can reset the alpha value and restart the simulation\r\n simulation.alpha(1).restart();\r\n\r\n showPrinOffTitles(data2);\r\n \r\n}\r\n\r\n\r\n function hideTypeTitles() {\r\n svg.selectAll('.formdisc').remove();\r\n }\r\n\r\n function hideTypePrinOff() {\r\n svg.selectAll('.prinoff').remove();\r\n }\r\n\r\n function showFormDiscTitles() {\r\n // Another way to do this would be to create\r\n // the year texts once and then just hide them.\r\n var discsData = d3.keys(formDiscsTitleX);\r\n var discs = svg.selectAll('.formdisc')\r\n .data(discsData);\r\n\r\n discs.enter().append('text')\r\n .attr('class', 'formdisc')\r\n .attr('x', function (d) { return formDiscsTitleX[d]; })\r\n .attr('y', 250)\r\n .attr('text-anchor', 'middle')\r\n .text(function (d) { return d; });\r\n }\r\n\r\n function showPrinOffTitles(rawData) {\r\n // Another way to do this would be to create\r\n // the year texts once and then just hide them.\r\n\r\n var totalAmtLabel = {\r\n IES: rawData[0].total,\r\n OCTAE: rawData[1].total,\r\n OELA: rawData[2].total,\r\n OESE: rawData[3].total,\r\n OII: rawData[4].total,\r\n OPE: rawData[5].total,\r\n OSERS: rawData[6].total,\r\n };\r\n //console.log(rawData[6].total)\r\n\r\n /* for (var i = 0; i < rawData.length; i++) {\r\n var totalObj = {};\r\n totalObj.office = rawData[i].office;\r\n totalObj.total = rawData[i].total;\r\n console.log(totalObj); */\r\n\r\n var discsData = d3.keys(prinOffPopUp);\r\n var discs = svg.selectAll('.prinoff')\r\n .data(discsData);\r\n \r\n discs.enter().append('text')\r\n .attr('class', 'prinoff')\r\n .attr('x', function (d) { return prinOffTitleX[d]; })\r\n .attr('y', function (d) { return prinOffTitleY[d]; })\r\n .attr('text-anchor', 'middle')\r\n .text(function (d) { return d; })\r\n .append('svg:title')\r\n .text(function (d) { return 'Office: ' + prinOffPopUp[d] + '\\n' + 'Total Amount: $' + addCommas(totalAmtLabel[d]); });\r\n }\r\n \r\n function showTotalDetail(d) {\r\n // change outline to indicate hover state.\r\n //d3.select(this)\r\n\r\n var content = '<span class=\"name\">Office: </span><span class=\"value\">' +\r\n d.name +\r\n '</span><br/>' +\r\n '<span class=\"name\">Total: </span><span class=\"value\">$' +\r\n addCommas(d.value) +\r\n '</span><br/>';\r\n\r\n tooltip.showTooltip(content, d3.event);\r\n }\r\n\r\n /*\r\n * Hides tooltip\r\n */\r\n function hideTotalDetail(d) {\r\n // reset outline\r\n //d3.select(this)\r\n //.attr('stroke', d3.rgb(fillColor(d.color)).darker());\r\n tooltip.hideTooltip();\r\n }\r\n \r\n /*\r\n * Function called on mouseover to display the\r\n * details of a bubble in the tooltip.\r\n */\r\n function showDetail(d) {\r\n // change outline to indicate hover state.\r\n d3.select(this).attr('stroke', 'black');\r\n\r\n var content = '<span class=\"name\">Title: </span><span class=\"value\">' +\r\n d.name +\r\n '</span><br/>' +\r\n '<span class=\"name\">Amount Awarded: </span><span class=\"value\">$' +\r\n addCommas(d.value) +\r\n '</span><br/>' +\r\n '<span class=\"name\">Funds Available: </span><span class=\"value\">$' +\r\n addCommas(d.balance) +\r\n '</span><br/>' +\r\n '<span class=\"name\">Number of Grants: </span><span class=\"value\">' +\r\n d.count +\r\n '</span><br/>' +\r\n '<span class=\"name\">Avg Life: </span><span class=\"value\">' +\r\n d.year +\r\n ' yrs</span><br/>';\r\n\r\n tooltip.showTooltip(content, d3.event);\r\n }\r\n\r\n /*\r\n * Hides tooltip\r\n */\r\n function hideDetail(d) {\r\n // reset outline\r\n d3.select(this)\r\n .attr('stroke', d3.rgb(fillColor(d.color)).darker());\r\n tooltip.hideTooltip();\r\n }\r\n\r\n\r\n\r\n/********Legend**********/\r\n\r\nfunction drawAllLegendCircle(){\r\nsvg.selectAll('.legendcircle').remove();\r\n//10 Billion\r\nvar xLargeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclexlg')\r\n .attr(\"cx\", 65)\r\n .attr(\"cy\",502)\r\n .attr(\"r\", 55);\r\n\r\n//1 Billion\r\nvar largeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclelg')\r\n .attr(\"cx\", 65)\r\n .attr(\"cy\", 532)\r\n .attr(\"r\", 25);\r\n// 500 Million\r\nvar medCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclemd')\r\n .attr(\"cx\", 65)\r\n .attr(\"cy\", 541)\r\n .attr(\"r\", 17);\r\n// 50 Million\r\nvar smallCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclesm')\r\n .attr(\"cx\", 65)\r\n .attr(\"cy\", 551)\r\n .attr(\"r\", 7);\r\n}\r\n\r\nfunction drawTypeLegendCircle(){\r\nsvg.selectAll('.legendcircle').remove();\r\n\r\n//10 Billion\r\nvar xLargeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclexlg')\r\n .attr(\"cx\", 375)\r\n .attr(\"cy\", 485)\r\n .attr(\"r\", 55);\r\n//1 Billion\r\nvar largeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclelg')\r\n .attr(\"cx\", 375)\r\n .attr(\"cy\", 515)\r\n .attr(\"r\", 25);\r\n// 500 Million\r\nvar medCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclemd')\r\n .attr(\"cx\", 375)\r\n .attr(\"cy\", 524)\r\n .attr(\"r\", 17);\r\n// 50 Million\r\nvar smallCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclesm')\r\n .attr(\"cx\", 375)\r\n .attr(\"cy\", 534)\r\n .attr(\"r\", 7);\r\n}\r\n\r\nfunction drawOffLegendCircle(){\r\n//1 Billion\r\nsvg.selectAll('.legendcircle').remove();\r\n\r\n\r\n//10 Billion\r\nvar xLargeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclexlg')\r\n .attr(\"cx\", 716)\r\n .attr(\"cy\", 484)\r\n .attr(\"r\", 55);\r\n\r\nvar largeCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclelg')\r\n .attr(\"cx\", 716)\r\n .attr(\"cy\", 514)\r\n .attr(\"r\", 25);\r\n// 500 Million\r\nvar medCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclemd')\r\n .attr(\"cx\", 716)\r\n .attr(\"cy\", 523)\r\n .attr(\"r\", 17);\r\n// 50 Million\r\nvar smallCircle = svg.append(\"circle\")\r\n .attr('class', 'legendcircle')\r\n .attr('id', 'legendcirclesm')\r\n .attr(\"cx\",716)\r\n .attr(\"cy\", 533)\r\n .attr(\"r\", 7);\r\n}\r\n\r\n\r\n\r\n /*\r\n * Externally accessible function (this is attached to the\r\n * returned chart function). Allows the visualization to toggle\r\n * between \"single group\" and \"split by year\" modes.\r\n *\r\n * displayName is expected to be a string and either 'formdisc','prinoff' or 'all'.\r\n */\r\n chart.toggleDisplay = function (displayName) {\r\n if(displayName === 'formdisc') {\r\n splitBubblesFormDisc();\r\n } else if(displayName === 'prinoff') {\r\n splitBubblesPrinOff(nodes2);\r\n } else {\r\n groupBubbles();\r\n }\r\n };\r\n\r\n // return the chart function from closure.\r\n return chart;\r\n}", "function mouseover() {\n tooltip\n .style('opacity', 1)\n d3.select(this)\n .style('stroke', 'black')\n .style('opacity', 1)\n }", "function mouseOverGraph(e,ix,node){\n stopDwellTimer(); // Mouse movement: reset the dwell timer.\n var ownTooltip = // Check if the hovered element already has the tooltip.\n (ix>=0 && ix==tooltipInfo.ixActive) ||\n (ix==-2 && tooltipInfo.idNodeActive==node.id);\n if(ownTooltip) stopCloseTimer(); // ownTooltip: clear the close timer.\n else resumeCloseTimer(); // !ownTooltip: resume the close timer.\n tooltipInfo.ixHover = ix;\n tooltipInfo.nodeHover = node;\n tooltipInfo.posX = e.clientX;\n tooltipInfo.posY = e.clientY;\n if(ix!=-1 && !ownTooltip && tooltipInfo.dwellTimeout>0){ // Go dwell timer.\n tooltipInfo.idTimer = setTimeout(function(){\n tooltipInfo.idTimer = 0;\n stopCloseTimer();\n showGraphTooltip();\n },tooltipInfo.dwellTimeout);\n }\n }", "function mouseoutC() {\r\n d3.select(this)\r\n .transition()\r\n .attr(\"r\", config.radius)\r\n .style(\"stroke\",\"powderblue\")\r\n .style(\"stroke-width\", 3);\r\n\r\n svg_dep.selectAll(\".bar-dep\")\r\n .transition()\r\n .style(\"fill\",\"powderblue\");\r\n\r\n d3.select(\"#tooltip-dep\").classed(\"hidden\", true);\r\n\r\n svg_dep.selectAll(\".label\")\r\n .transition()\r\n .attr(\"font-weight\", \"normal\");\r\n }", "function handlePointHoverLeave (e) {\n var point = $(this).data(\"point\");\n point.style = pointStyleDefault;\n point.redraw();\n }", "function handlePointHoverLeave (e) {\n var point = $(this).data(\"point\");\n point.style = pointStyleDefault;\n point.redraw();\n }", "function loss() {\n \n userLoss++;\n $('#loss').text(userLoss);\n $('#winLossAlert').text(\"You Lost!!!\")\n reset();\n }", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "function loser() {\n alert(\"You went over and lost\");\n losses++;\n $(\"#numberLosses\").html(losses);\n reset()\n }", "function mouseOver(){\n d3.select(this)\n \t.classed(\"mouseover\",true)\n \t.attr(\"r\", 6);\n console.log(\"Mouse Over!\");\n\n var data = this.__data__; \n//Setting parameters for bar chart display\n bar_svg.style(\"display\",\"block\");\n var bar_xScale = d3.scaleLinear()\n .range([0, width])\n .domain([0, d3.max(data.value.occ, function(d){return parseInt(d.count);})]);\n var bar_yScale = d3.scaleBand()\n .range([height, 0])\n .domain(data.value.occ.map(function(d){return d.state;}));\n bar_svg.append(\"g\")\n .attr(\"class\", \"xAxis\")\n .attr(\"transform\", \"translate(80,\"+height+\")\");\n\n bar_svg.select(\".xAxis\")\n .style(\"font-size\",\"10px\")\n .call(d3.axisBottom(bar_xScale)\n .tickSizeInner([-height]));\n\n bar_svg.append(\"g\")\n .attr(\"class\",\"yAxis\")\n .attr(\"transform\",\"translate(80,0)\");\n bar_svg.select(\".yAxis\")\n .style(\"font-size\",\"10px\")\n .call(d3.axisLeft(bar_yScale));\n\n var bars = bar_svg.selectAll(\".bar\")\n .data(data.value.occ); \n bars.exit()\n \t.remove();\n\n bars.enter()\n \t.append(\"rect\")\n .merge(bars)\n .attr(\"class\",\"bar\")\n .attr(\"x\",0)\n .attr(\"height\", function(d){\n \treturn bar_yScale.bandwidth();})\n .attr(\"transform\",\"translate(80,0)\")\n .attr(\"y\", function(d){return bar_yScale(d.state);})\n .attr(\"width\", function(d){return bar_xScale(d.count);})\n .attr(\"fill\",\"steelblue\")\n .attr(\"stroke\",\"white\")\n .attr(\"stroke-width\",0.8);\n\n const this_region = data.value.region;\n const this_year = data.key;\n \n var title = bar_svg.append(\"g\")\n .attr(\"class\",\"barTitle\")\n .attr(\"id\",\"barTitle\")\n .append(\"text\")\n .attr(\"transform\", \"translate(480,-10)\")\n .text(this_region.toString()+\"ern\"+\" Region Earthquakes \"+this_year.toString());\n }", "function mouseoutDeputy(d){ \n\t\t\t\tsvg.select('#deputy-'+d.record.deputyID).attr(\"r\",radius);\n\t\t\t\t\n\t\t\t\tdispatch.hover(d.record,false);\n\t\t\t\t\n\t\t\t\treturn tooltip.style(\"visibility\", \"hidden\");\n\t\t}", "function over(data,flag){\n //var stateData = usdaAtlas.get(d.id);\n if (data != null){\n // load data \n svg2.selectAll(\".histogram-lable\").remove();\n var obesity = data.obesity;\n var poverty = data.poverty;\n var stateName = data.state;\n var fastfood = data.PCH_FFRPTH_07_12;\n var farmmarket = data.PCH_FMRKTPTH_09_13;\n var grocery = data.PCH_GROCPTH_07_12;\n var convenience = data.ConvenienceStores;\n var position = projection([data.lat,data.lon]);\n \n var output = document.getElementById(\"obesity-result\");\n var stateoutput = document.getElementById(\"state-result\");\n var povertyoutput = document.getElementById(\"poverty-result\");\n output.innerHTML = obesity + \"%\";\n stateoutput.innerHTML = stateName;\n povertyoutput.innerHTML = poverty + \"%\";\n\n svg2.append(\"text\")\n\n .text(function(d){\n if (flag == \"obesity\") {return obesity;}//xScale21(0.45) + xScale21(w/100);}\n if (flag == \"poverty\") {return poverty;}\n })\n //.attr(\"x\",100)\n //.attr(\"y\",200)\n .attr(\"x\", function(d){\n //var stateData = usdaAtlas.get(d.id);\n if (data != null){\n var w = data.obesity;\n console.log(\"width is: \" + w);\n if (flag == \"obesity\") {return (xScale21(0.0) + padding2 + 5);}//xScale21(0.45) + xScale21(w/100);}\n if (flag == \"poverty\") {return xScale22(0.075);}//xScale22(0.22) + xScale21(w/100);}\n } else return null;\n })\n .attr(\"y\", function(d){\n //var stateData = usdaAtlas.get(d.id);\n if (data != null) {\n var name = data.state;\n console.log(\"name is: \" + name);\n return (yScale2(name) + rectwidth +7);\n }else return null;\n })\n .attr(\"class\",\"histogram-lable\");\n // .attr(\"font-size\",\"12px\")\n // .attr(\"color\",\"red\")\n // .attr(\"text-align\",\"center\");\n \n}}", "function Greenhouse() {\r\n const opts = {\r\n options: {\r\n chart: {\r\n fontFamily: chartFont,\r\n zoom: {\r\n enabled: false,\r\n },\r\n },\r\n dataLabels: {\r\n enabled: false\r\n },\r\n stroke: {\r\n width: 2,\r\n curve: 'smooth',\r\n },\r\n title: {\r\n text: 'Methane vs N₂O concentration growth',\r\n style: titleStyle\r\n },\r\n subtitle: {\r\n text: 'Source: Global Warming API',\r\n },\r\n colors: ['#008FFB', '#FF4560'],\r\n xaxis: {\r\n type: 'category',\r\n categories: res_df.greenhouse.category,\r\n tickAmount: 8,\r\n },\r\n yaxis: {\r\n title: {\r\n text: 'Concentration growth, %'\r\n },\r\n min: 100,\r\n max: Math.max(...res_df.greenhouse.methane.data.filter(filterNaN),\r\n ...res_df.greenhouse.nitrous.data.filter(filterNaN)) + 2,\r\n labels: {\r\n formatter: function (val) {\r\n return round(val);\r\n }\r\n }\r\n },\r\n annotations: {\r\n yaxis: [{\r\n y: 100,\r\n borderColor: '#000',\r\n label: {\r\n borderColor: '#000',\r\n style: {\r\n color: '#fff',\r\n background: '#000',\r\n },\r\n text: 'Minimal level',\r\n }\r\n }]\r\n },\r\n fill: {\r\n opacity: 1\r\n },\r\n tooltip: {\r\n y: {\r\n formatter: function (val, {dataPointIndex, series, seriesIndex, w}) {\r\n const v = w.config.series[seriesIndex].level[dataPointIndex],\r\n m = round(v - w.config.series[seriesIndex].min);\r\n\r\n return !filterNaN(val) ? 'No data' : `${val}% (${m}/${v} ppm)`;\r\n }\r\n }\r\n }\r\n },\r\n series: [{\r\n name: 'Methane growth',\r\n data: res_df.greenhouse.methane.data,\r\n level: res_df.greenhouse.methane.level,\r\n min: res_df.greenhouse.methane.min,\r\n }, {\r\n name: 'N₂O growth',\r\n data: res_df.greenhouse.nitrous.data,\r\n level: res_df.greenhouse.nitrous.level,\r\n min: res_df.greenhouse.nitrous.min,\r\n }]\r\n };\r\n\r\n return (\r\n <ReactApexChart options={opts.options} series={opts.series} type='line' height={400} />\r\n );\r\n}", "function youLost(){\r\nalert (\"You lost!\");\r\n losses++;\r\n $('#numLosses').text(losses);\r\n reset();\r\n}", "function mouseover( d ) {\n\t\t// set x and y location\n\t\tvar dotX = iepX( parseYear( d.data.year ) ),\n\t\t\tdotY = iepY( d.data.value ),\n\t\t\tdotBtu = d3.format( \".2f\" )( d.data.value ),\n\t\t\tdotYear = d.data.year,\n\t\t\tdotSource = d.data.name;\n\n\t\t// console.log( \"SOURCE:\", dotSource, index( lineColors( dotSource ) ) );\n\n\t\t// add content to tooltip text element\n\t\t/*tooltip.select( \".tooltip_text\" )\n\t\t\t.style( \"border-color\", lineColors( [ dotSource ] - 2 ) );*/\n\n\t\ttooltip.select( \".tooltip_title\" )\n\t\t\t.text( dotYear )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\ttooltip.select( \".tooltip_data\" )\n\t\t\t.text( dotBtu + \" \" + yUnitsAbbr );\n\n\t\ttooltip.select( \".tooltip_marker\" )\n\t\t\t.text( \"▼\" )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\t//Change position of tooltip and text of tooltip\n\t\ttooltip.style( \"visibility\", \"visible\" )\n\t\t\t.style( \"left\", dotX + ( chart_margins.left / 2 ) + \"px\" )\n\t\t\t.style( \"top\", dotY + ( chart_margins.top / 2 ) + \"px\" );\n\t} //mouseover", "function rawChart() {\r\n\tvar chart_title = \"VLMO\";\r\n\t$('#container').highcharts(\r\n\t\t\t{\r\n\t\t\t\tchart : {\r\n\t\t\t\t\tzoomType : 'xy'\r\n\t\t\t\t},\r\n\t\t\t\ttitle : {\r\n\t\t\t\t\ttext : chart_title\r\n\t\t\t\t},\r\n\t\t\t\tsubtitle : {\r\n\t\t\t\t\ttext : 'From ' + selectStartDate.format('yyyy-mm-dd')\r\n\t\t\t\t\t\t\t+ ' To ' + selectEndDate.format('yyyy-mm-dd')\r\n\t\t\t\t},\r\n\t\t\t\tcredits : {\r\n\t\t\t\t\thref : 'http://www.vervemobile.com',\r\n\t\t\t\t\ttext : 'vervemobile.com'\r\n\t\t\t\t},\r\n\t\t\t\txAxis : [ {\r\n\t\t\t\t\tcategories : categories,\r\n\t\t\t\t\t// tickmarkPlacement: 'on',\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\tenabled : false\r\n\t\t\t\t\t},\r\n\t\t\t\t\t// gridLineWidth: 1,\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\trotation : -45,\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\tvar value = this.value;\r\n\t\t\t\t\t\t\tvar now = new Date(value);\r\n\t\t\t\t\t\t\treturn now.format(\"mmm dd\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} ],\r\n\t\t\t\tyAxis : [ { // Primary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB '\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Clicks',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\topposite : true\r\n\r\n\t\t\t\t}, { // Tertiary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Impressions',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} ],\r\n\t\t\t\ttooltip : {\r\n\t\t\t\t\tshared : true,\r\n\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\tvar date_Value = new Date(this.x);\r\n\t\t\t\t\t\tvar s = '<b>' + date_Value.format('mmm d, yyyy')\r\n\t\t\t\t\t\t\t\t+ '</b>';\r\n\t\t\t\t\t\t$.each(this.points, function(i, point) {\r\n\t\t\t\t\t\t\tif (point.series.name == 'Impressions') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #DBA901;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Clicks') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #01A9DB;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Cta any') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #80FF00;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\ts += '<br/>' + point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatMoney(point.y);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn s;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tlegend : {\r\n\t\t\t\t\t// layout: 'vertical',\r\n\t\t\t\t\t// align: 'left',\r\n\t\t\t\t\t// x: 100,\r\n\t\t\t\t\t// verticalAlign: 'top',\r\n\t\t\t\t\t// y: 0,\r\n\t\t\t\t\t// floating: true,\r\n\t\t\t\t\tbackgroundColor : '#FFFFFF'\r\n\t\t\t\t},\r\n\t\t\t\tseries : [ {\r\n\t\t\t\t\tname : 'Clicks',\r\n\t\t\t\t\tcolor : '#01A9DB',\r\n\t\t\t\t\ttype : 'areaspline',\r\n\t\t\t\t\tyAxis : 1,\r\n\t\t\t\t\tdata : secondData\r\n\t\t\t\t}, {\r\n\t\t\t\t\tname : 'Impressions',\r\n\t\t\t\t\tcolor : '#DBA901',\r\n\t\t\t\t\ttype : 'column',\t\t\t\t\t\r\n\t\t\t\t\tdata : firstData\r\n\t\t\t\t} ]\r\n\t\t\t});\r\n\tchart = $('#container').highcharts();\r\n}", "function onMouseOut(d,i) {\n d3.selectAll(\".vz-halo-label\").remove();\n}", "function draw(account) {\r\n let htmlText = '';\r\n let analysisArea = document.getElementById('analysis');\r\n\r\n // First, remove all previous added data, \"2\" here saves div 'donotdeletetags'\r\n while (analysisArea.childNodes.length > 2){\r\n analysisArea.removeChild(analysisArea.childNodes[analysisArea.childNodes.length -1]);\r\n }\r\n\r\n // If there are no analysis data (ie no transactions), show error message\r\n if (account.analysis.length === 0){\r\n $('#linechart').hide(); // Hide the chart\r\n htmlText = '<h4>' + 'There are no transactions to analyze' + '<br />' +\r\n 'Enter your transactions to see your budget analysis'+ '</h4>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n // exit the funcation since there is nothing more to do\r\n return;\r\n }\r\n //Show the chart div since there are transactions to show\r\n $('#linechart').show();\r\n\r\n // Go over every analysis month group\r\n account.analysis.forEach( monthStat => {\r\n tempDateObj = new Date(monthStat.yymm+'-15');\r\n // Set the month title [Month name, Year. E.g April 2019]\r\n let monthTitle = getMonthName(tempDateObj.getMonth()) +\r\n ' ' + tempDateObj.getFullYear();\r\n\r\n // Add the title to the HTML page\r\n htmlText = '<h4>' + monthTitle + '</h4>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // Add the month's analysis data to the HTML page\r\n htmlText = '<p> Expense: ' + account.currency + monthStat.expense +'<br />'+\r\n 'income: ' + account.currency + monthStat.income + '<br />' +\r\n 'Month&apos;s balance: ' + account.currency +monthStat.balance + '<br />' +\r\n 'Numbrt of transactions: ' + monthStat.num + '<br />'+\r\n '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // Now we show the month's category analysis\r\n htmlText = '<h5>' + 'Expense' + '</h5>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // If there are no expense transactions, show error message\r\n if (Object.keys(monthStat.cat.expense).length === 0) {\r\n htmlText = '<p>' + 'No transactions under this type' + '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n }\r\n\r\n // Go over all expense transactions to draw the bar charts\r\n Object.keys(monthStat.cat.expense).forEach(category => {\r\n drawCategroy(monthStat, 'expense', category, analysisArea);\r\n });\r\n\r\n htmlText = '<h5>' + 'Income' + '</h5>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // If there are no income transactions, show error message\r\n if (Object.keys(monthStat.cat.income).length === 0) {\r\n htmlText = '<p>' + 'No transactions under this type' + '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n }\r\n\r\n // Go over all income transactions to draw the bar charts\r\n Object.keys(monthStat.cat.income).forEach(category => {\r\n drawCategroy(monthStat, 'income', category, analysisArea);\r\n });\r\n\r\n // Close the month's analysis data by adding a horizontal ruler\r\n htmlText = '<br /><hr />';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n });\r\n\r\n\r\n}", "function onMouseOver(d, i) {\n\n var fontSize = Math.round(viz.outerRadius() / 20);\n\n // Get the SVG defs tag\n var defs = viz.selection().selectAll(\"defs\");\n // Get the svg plot\n var plot = viz.selection().selectAll(\".vz-plot\");\n\n // Remove any elements left from last datatip in case mouseout didn't get them.\n defs.selectAll(\".vz-tip-path\").remove();\n plot.selectAll(\".my-tip\").remove();\n\n // Add the arc we need to show the page views\n defs.append(\"path\")\n .attr(\"class\", \"vz-tip-path\")\n .attr(\"id\", function (d, i) {\n return viz.id() + \"_tip_path_arc_1\";\n })\n .attr(\"d\", function () {\n return vizuly.svg.text.arcPath(viz.radiusScale()(d.y + d.y0) * 1.05, viz.thetaScale()(viz.x()(d)));\n });\n\n // Show the hour\n plot.append(\"text\")\n .attr(\"class\", \"my-tip\")\n .style(\"font-size\", (fontSize * .95) + \"px\")\n .style(\"text-transform\", \"uppercase\")\n .style(\"font-family\", \"Open Sans\")\n .style(\"fill-opacity\", .75)\n .style(\"fill\", function () {\n return theme.skin().labelColor\n })\n .append(\"textPath\")\n .attr(\"startOffset\", \"50%\")\n .style(\"overflow\", \"visible\")\n .attr(\"xlink:href\", function (d, i) {\n return \"#\" + viz.id() + \"_tip_path_arc_1\";\n })\n .text(function () {\n return viz.xAxis().tickFormat()(viz.x()(d));\n });\n\n // Show the page views\n plot.append(\"text\")\n .attr(\"class\", \"my-tip\")\n .attr(\"y\", -fontSize * 1.5)\n .style(\"font-size\", fontSize + \"px\")\n .style(\"fill\", function () {\n return theme.skin().labelColor\n })\n .text(function () {\n return viz.yAxis().tickFormat()(viz.y()(d))\n });\n\n //Show the page\n plot.append(\"text\")\n .attr(\"class\", \"my-tip\")\n .style(\"font-size\", fontSize + \"px\")\n .style(\"fill-opacity\", .75)\n .style(\"fill\", function () {\n return theme.skin().labelColor\n })\n .text(function () {\n return d.key;\n });\n}", "function mouseover(d) {\n const percentageString = `${d.value}`;\n const textForClosed = ' of them have been ';\n const textForOpen = ' of them are still ';\n\n const percentageStr = ' issues have been created by ';\n\n switch (d.name) {\n case 'open':\n d3.select('#percentage')\n .text(d.value);\n d3.select('#info-text-nbIssues')\n .text(textForOpen)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(`${d.name}ed`);\n break;\n case 'closed':\n d3.select('#percentage')\n .text(d.value);\n d3.select('#info-text-nbIssues')\n .text(textForClosed)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(d.name);\n break;\n default:\n d3.select('#percentage')\n .text(percentageString);\n d3.select('#info-text-nbIssues')\n .text(percentageStr)\n .style('font-size', '1em');\n d3.select('#info-text-info-repo')\n .text(`${d.name}.`);\n }\n\n d3.select('#explanation')\n .style('top', '240px');\n\n const sequenceArray = getAncestors(d);\n updateBreadcrumbs(sequenceArray, percentageString);\n\n // Fade all the segments.\n d3.selectAll('path')\n .style('opacity', 0.3);\n\n // Then highlight only those that are an ancestor of the current segment.\n vis.selectAll('path')\n .filter(node => (sequenceArray.indexOf(node) >= 0))\n .style('opacity', 1);\n}", "function displayLosses() {\n $('#losses').text(\"Losses: \" + losses);\n}", "function handle_mouseover(d, $this, show_click_directive=false) {\n // Setting all country wage groups to translucent\n $(\".country-wage-group\").attr(\"opacity\", 0.2);\n // Resetting the group currently being hovered over to opaque\n d3.select($this).attr(\"opacity\", 1);\n\n var tooltip = d3.select(\"#wageGapTooltip\");\n\n // Setting the position for tooltip\n tooltip.style(\"top\", (event.pageY+10)+\"px\").style(\"left\", (event.pageX+10)+\"px\");\n\n // Setting the content for tooltip\n $(\"#wageGapTooltip .meta\").hide();\n if (show_click_directive) {\n $(\"#wageGapTooltip .country-name\").show();\n tooltip.select(\".country-name-text\").html(d[\"Country\"]);\n $(\"#wageGapTooltip .click-directive\").show();\n } else {\n $(\"#wageGapTooltip .occupation-name\").show();\n tooltip.select(\".occupation-name-text\").html(d[\"Occupation\"]);\n $(\"#wageGapTooltip .click-directive\").hide();\n }\n tooltip.select(\".male-wage-text\").html(\"$\" + d[\"Male\"].toFixed(2));\n tooltip.select(\".female-wage-text\").html(\"$\" + d[\"Female\"].toFixed(2));\n tooltip.select(\".difference-text\").html(\"$\" + (d[\"Female\"] - d[\"Male\"]).toFixed(2));\n\n // Displaying the relevant indicator\n $(\"#wageGapTooltip .wage-gap .indicator\").hide();\n if(d[\"Female\"] - d[\"Male\"] > 0){\n $(\"#wageGapTooltip .wage-gap .increase\").show();\n } else {\n $(\"#wageGapTooltip .wage-gap .decrease\").show();\n }\n\n // Setting the tooltip as visible\n return tooltip.style(\"visibility\", \"visible\");\n }", "function drawTooltip() {\n \n console.log(d3.mouse(this));\n \n \n //console.log(Math.floor(xScale.invert(d3.mouse(this)[0])))\n mYear = Math.floor(xScale.invert(d3.mouse(this)[0])) + 1;\n\n cYear = dataset.year[0];\n for (i = 0; i < dataset.year.length; i++) {\n if (Math.abs(cYear - mYear) > Math.abs(dataset.year[i] - mYear)) {\n cYear = dataset.year[i];\n }\n\n //console.log(\"myear \" + Math.floor(xScale.invert(d3.mouse(this)[0])))\n //console.log(\"cyear \" + cYear);\n\n\n }\n\n\n\n\n tooltipLine.attr('stroke', 'black')\n .attr('x1', xScale(cYear))\n .attr('x2', xScale(cYear))\n .attr('y1', 0)\n .attr('y2', height);\n\n\n\n var f2s = d3.format('.2s');\n var index = dataset.year.indexOf(cYear);\n console.log(\"x: \"+ d3.event.pageX + \"y: \" + d3.event.pageY);\n tooltipBox\n .style('display', 'inline')\n .html(\"Year : \" + cYear + \" <br/>\" + \"Total: \" + f2s(data[index].population) + \"<br/>\" + \"Non Local: \" + f2s(dataNLocal[index].population) + \"<br/>\" + \"Local: \" + f2s(dataLocal[index].population))\n //.style('left', d3.event.pageX - 34)\n //.style('top', d3.event.pageY - 12)\n .style('left', d3.mouse(this)[0] -34 )\n .style('top', d3.mouse(this)[1] -12)\n }", "function loss(){\n losses ++;\n alert('You did not win, loser!');\n $('.loss-score').text(losses);\n reset();\n}", "function show(totalSale,totalTarget){\n var body = d3.select('body')\n .style('text-align', 'center')\n .style('font-weight', 'normal');\n\n mod1 = d3.select('#compare')\n .append('svg')\n .attr('width', width)\n .attr('height', height)\n .style('background-color', '#E5E5E5');\n\n // Show the main and sub title\n var ltTitle1 = mod1.append('text')\n .style('font-size', '25px')\n .style('text-anchor', 'start')\n .style('font-weight', 'bold')\n .attr('transform', 'translate(5,20)')\n .text(mainTitle);\n\t\n var ltTitle2 = mod1.append('text')\n .style('font-size', '15px')\n .style('text-anchor', 'start')\n .attr('transform', 'translate(140,20)')\n .style('font-weight', 'normal')\n .text(subTitle);\t\n\n // Show the totalSale\n var title = mod1.append('text')\n .attr('class', 'title')\n .attr('transform', 'translate('+ 300 +', '+ 160 + ')')\n .style('font-size', '75px')\n .style('text-anchor', 'middle')\n .text('$'+toThousands(totalSale));\n\n //set the rect\t\t\n var rect = mod1.append('rect')\n .attr('height',60)\n .attr('width',340)\n .attr('x',130)\n .attr('y',200);\n\t\t\t\n //Judge the color of the rect\t\n if (totalSale < totalTarget) {\n\trect.attr('fill', 'red');\n } else {\n\trect.attr('fill', 'green');\n }\t\n\n //caluation of the difference\n var contract = totalSale - totalTarget;\t\n\t\n //show the difference\n var countTitle = mod1.append('text')\n .attr('class', 'title')\n .attr('transform', 'translate('+ 300 +', '+ 240 + ')')\n .style('font-size', '35px')\n .style('text-anchor', 'middle')\n .style('fill', 'white');\t\n\t\t\t\t\n //caluation of the percent\t\t\t\t\n var percent = Math.round((Math.abs(contract)/totalTarget).toFixed(2) * 100);\t\n if (contract < 0) {\n\tcountTitle.text('\\u25BC'+'$'+toThousands(Math.abs(totalTarget - totalSale))+'('+ percent +'%)');\n }\n else {\n\tcountTitle.text('\\u25B2'+'$'+toThousands(Math.abs(totalTarget - totalSale))+'('+ percent+'%)');\n }\t\n}", "function addSpentText(pnode,total,income,transacts) {\n var x = document.createElement('p');\n pnode.parentNode.appendChild(x);\n\n var link=document.createElement('a');\n x = document.createTextNode('Total spent: '+makeThousands(String(total))+' Meat ');\n link.appendChild(x);\n link.setAttribute(\"title\", 'over '+transacts+' transaction'+((transacts==1)? '': 's'));\n pnode.parentNode.appendChild(link);\n var link=document.createElement('a');\n link.addEventListener(\"click\", resetSpent, true);\n link.setAttribute(\"total\", total);\n link.setAttribute(\"title\", 'wipe history and set spent amount');\n x = document.createTextNode('[reset]');\n link.appendChild(x);\n pnode.parentNode.appendChild(link);\n\n x = document.createTextNode(' ');\n pnode.parentNode.appendChild(x);\n link=document.createElement('a');\n link.addEventListener(\"click\", addSpent, true);\n link.setAttribute(\"title\", 'add an additional expense');\n x = document.createTextNode('[add]');\n link.appendChild(x);\n pnode.parentNode.appendChild(link);\n\n x = document.createTextNode(' ');\n pnode.parentNode.appendChild(x);\n link=document.createElement('a');\n link.addEventListener(\"click\", removeSpent, true);\n link.setAttribute(\"title\", 'remove the last added expense');\n x = document.createTextNode('[remove]');\n link.appendChild(x);\n pnode.parentNode.appendChild(link);\n\n //figure out profit\n var profit = income-total;\n // figure out ratio\n var ratio = (total==0) ? 0 : profit*100/total;\n if (ratio==0)\n ratio=' Meat';\n else\n ratio=' Meat ('+ratio.toFixed(1)+'%)';\n\n x = document.createElement('p');\n pnode.parentNode.appendChild(x);\n x = document.createTextNode('Profit: ');\n pnode.parentNode.appendChild(x);\n\n x = document.createElement('b');\n if (profit<0) {\n profit=makeThousands(String(-profit));\n x.appendChild(document.createTextNode('-'+profit+ratio));\n var y = document.createElement('font');\n y.setAttribute('color','red');\n y.appendChild(x);\n x=y;\n } else {\n profit=makeThousands(String(profit));\n x.appendChild(document.createTextNode(profit+ratio));\n }\n pnode.parentNode.appendChild(x);\n}" ]
[ "0.6426414", "0.61706126", "0.60711235", "0.5904209", "0.58985", "0.5892405", "0.5852378", "0.5817237", "0.572569", "0.5711737", "0.5648951", "0.56489205", "0.5621979", "0.5607887", "0.5598327", "0.55813", "0.55786043", "0.5571478", "0.5550848", "0.5549257", "0.5513899", "0.55120164", "0.5504874", "0.5498576", "0.5485454", "0.5480908", "0.54793054", "0.54649585", "0.54580945", "0.5455714", "0.5440312", "0.5425287", "0.54195", "0.5418124", "0.54140604", "0.53881454", "0.5387967", "0.5385948", "0.5375709", "0.5372688", "0.53668296", "0.5360145", "0.53598577", "0.5342242", "0.5340253", "0.5337527", "0.53333753", "0.53279006", "0.5327877", "0.5325605", "0.532122", "0.5314949", "0.53127176", "0.53121394", "0.53018785", "0.52978694", "0.5291781", "0.5287595", "0.52859294", "0.52853864", "0.52817065", "0.528128", "0.52757597", "0.5272257", "0.5269506", "0.5268564", "0.5267866", "0.5261097", "0.5259992", "0.5259403", "0.5258931", "0.52486724", "0.5246154", "0.5240367", "0.5239837", "0.5233516", "0.5224295", "0.52211183", "0.52205914", "0.52205914", "0.5213902", "0.5194793", "0.5190122", "0.51840645", "0.517887", "0.5176192", "0.5175478", "0.51743895", "0.51701957", "0.51637954", "0.5162355", "0.5150738", "0.5150235", "0.51491445", "0.51450485", "0.5143657", "0.51361966", "0.51361316", "0.512928", "0.51289415" ]
0.57182544
9
This function shows the conversion rate report and pipeline
function showReports() { $('#LeadsTile').css("background-color", "#0072C6"); $('#OppsTile').css("background-color", "#0072C6"); $('#SalesTile').css("background-color", "#0072C6"); $('#LostSalesTile').css("background-color", "#0072C6"); $('#ReportsTile').css("background-color", "orange"); hideAllPanels(); $('#AllReports').fadeIn(500, null); $('#amountPipeline').show(); $('#countPipeline').show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayPerf() {\n //Get all times combined\n let timeCombined = 0;\n perf.timePerClient.forEach(elem => {\n timeCombined += elem;\n });\n\n // Get the average time of all the combined times\n const averageTime = timeCombined / perf.timePerClient.length;\n\n //Calculcate percentage in relation to very fast serving of x seconds.\n perf.avgPerf = Math.floor((perf.avgT / averageTime) * 100);\n //console.log(perf.avgPerf);\n if (isNaN(perf.avgPerf)) {\n //no performance data available display N/A\n perfNumber.textContent = \"N/A\";\n } else {\n //display performance\n perfNumber.textContent = perf.avgPerf + \"%\";\n }\n updatePerfChart();\n}", "function updateReport() {\n $(\"#currentTotal\").text(Math.floor(data.totalCurrent));\n $(\"#cps\").text((data.totalCPS).toFixed(1));\n}", "function displayExchangeRate() {\n // Calc expected Rate in ETH not Wei\n expectedRateEth = expectedRate / (10 ** 18);\n // Calcualte user Exchange rate\n expectedRateHTML.innerText = `1 ${srcSymbol} = ${expectedRateEth} ${destSymbol}`;\n // expectedRate / (10 ** 18)\n}", "function jchart_rate_print_stats(_nid){\n\tvar _queue_size = jchart_list[_nid]._qsize;\n\tvar _si;\n\t// iniciar stats\n\tjchart_list[_nid]._stats = {};\n\n\t/*\n\t\tcalcular minimo, media e maximo de todas as series\n\t*/\n\tfor(_si in jchart_list[_nid].series){\n\t\t// inicializar dados estatisticos da serie\n\t\tjchart_list[_nid]._stats[_si] = {\n\t\t\t_count: 0,\t\t// total de elementos preenchidos\n\t\t\t_total: 0,\t\t// total somado de tudo\n\t\t\t_max: false,\t// valor maximo\n\t\t\t_min: false,\t// valor minimo\n\t\t\t_cur: false,\t// valor corrente\n\t\t\t_avg: false\t\t// valor medio\n\t\t};\n\t}\n\n\t// percorrer queue e coletar estatisticas\n\tvar _i;\n\tvar _si;\n\tfor(_i = 1; _i <= _queue_size; _i++){\n\t\tvar _slot = jchart_list[_nid].queue[_i];\n\t\tif(_slot===false||_slot==-1) continue;\n\n\t\tfor(_si in _slot){\n\t\t\tvar _v = _slot[_si];\n\t\t\tif(stdlib.isfalse(_v)||_v==-1) continue;\n\t\t\tjchart_list[_nid]._stats[_si]._count++;\n\t\t\t// coletar maximo\n\t\t\tif(jchart_list[_nid]._stats[_si]._max==false || _v > jchart_list[_nid]._stats[_si]._max){\n\t\t\t\tjchart_list[_nid]._stats[_si]._max = _v;\n\t\t\t}\n\t\t\t// coletar minimo\n\t\t\tif(jchart_list[_nid]._stats[_si]._min==false || _v < jchart_list[_nid]._stats[_si]._min){\n\t\t\t\tjchart_list[_nid]._stats[_si]._min = _v;\n\t\t\t}\n\n\t\t\t// calcular total\n\t\t\tjchart_list[_nid]._stats[_si]._total += _v;\n\n\t\t\t// coletar ultimo valor\n\t\t\tjchart_list[_nid]._stats[_si]._cur = _v;\n\t\t}\n\t}\n\n\t// resumir estatistica (media)\n\tvar _si;\n\tjchart_list[_nid]._max = 10;\n\tjchart_list[_nid]._min = false;\n\tfor(_si in jchart_list[_nid].series){\n\t\t// calcular media\n\t\tjchart_list[_nid]._stats[_si]._avg = 0;\n\t\tif(jchart_list[_nid]._stats[_si]._total && jchart_list[_nid]._stats[_si]._count){\n\t\t\tjchart_list[_nid]._stats[_si]._avg = jchart_list[_nid]._stats[_si]._total / jchart_list[_nid]._stats[_si]._count;\n\t\t}\n\t\t// calcular maximo\n\t\tif(jchart_list[_nid]._stats[_si]._max > jchart_list[_nid]._max) jchart_list[_nid]._max = jchart_list[_nid]._stats[_si]._max;\n\n\t\t// calcular minimo\n\t\tif(jchart_list[_nid]._min===false || jchart_list[_nid]._stats[_si]._min < jchart_list[_nid]._min) jchart_list[_nid]._min = jchart_list[_nid]._stats[_si]._min;\n\t\t\n\t\t// a quantidade de qualquer serie é o total de slots\n\t\tjchart_list[_nid]._count = jchart_list[_nid]._stats[_si]._count;\n\t}\n\t\n\t// calcular valor maximo da linha superior\n\tjchart_list[_nid]._topmax = jchart_list[_nid]._max;\n\t// buscar valores de grandeze\n\tvar _g = 10;\n\tvar _jg;\n\tfor(_jg = 100; true; _jg *= 10){\n\t\tif(jchart_list[_nid]._topmax < _jg){\n\t\t\t_g = _jg / 10;\n\t\t\tbreak;\n\t\t}\n\t}\n\t// grandeza obtida, procurar valores com intervalos de 40% até encontrar teto mais proximo\n\tvar _pc = _g * 0.4; if(_pc < 2) _pc = 2;\n\tvar _top = jchart_list[_nid]._topmax;\n\tjchart_list[_nid]._topmax = 0;\n\twhile(jchart_list[_nid]._topmax < _top) jchart_list[_nid]._topmax += _pc;\n\tif(jchart_list[_nid]._topmax==jchart_list[_nid]._max) jchart_list[_nid]._topmax+=_pc;\n\n\t// calcular relacao entre pixel e valor maximo representavel\n\tjchart_list[_nid]._perpixel = jchart_list[_nid].chart.height / jchart_list[_nid]._topmax;\n\n\t// preencher canvas de informacoes estatisticas\n\t// palco de desenho\n\tif(!jchart_list[_nid]._draw) jchart_list[_nid]._draw = stdlib.getdom(jchart_list[_nid].draw_canvas_id);\n\tif(!jchart_list[_nid]._draw){\n\t\tstdlib.debug(\"FATAL, impossivel pegar o canvas DRAW\", true);\n\t\treturn;\n\t}\n\t// criar contexto para desenhar\n\tvar _draw = jchart_list[_nid]._draw.getContext(\"2d\");\n\t\n\t// limpar\n\t// referencias locais de localizacao do convas do grafico\n\tvar _left = jchart_list[_nid].width - jchart_list[_nid].chart.width - jchart_list[_nid].chart.right;\n\tvar _top = jchart_list[_nid].chart.top+1; // incremento da borta\n\tvar _bottom = jchart_list[_nid].chart.top + jchart_list[_nid].chart.height;\n\tvar _height = _bottom - _top;\n\t// dados do canvas\n\tvar _cwidth = jchart_list[_nid].chart.width;\n\tvar _cheight = jchart_list[_nid].chart.height;\n\t// desenhar linhas divisoras e labels\n\t// obter salto entre valor base e linha superior\n\tvar _vinterval = jchart_list[_nid]._topmax / 10;\n\t// altura da linha divisoria\n\tvar _hline_height = _cheight / 10;\n\t_left-=10;\n\tvar _m = 0;\n\tvar _k;\n\tfor(_k = _top; _k < _cheight+_top+_hline_height; _k+=_hline_height){\n\t\t// calcular valor a exibir\n\t\tvar _v = (_vinterval*(10-_m));\n\t\tvar _nv = _v;\n\t\tswitch(jchart_list[_nid].dataformat){\n\t\t\tcase 'bit':\n\t\t\t\t_nv = stdlib.size_format(_v, '.', ',')+(_v<1024?' ':'')+'bit';\n\t\t\t\t//stdlib.logit(\"bit value: nv=\"+_nv+\" v=\"+_v);\n\t\t\t\tbreak;\n\t\t\tcase 'byte':\n\t\t\t\t_nv = stdlib.size_format(_v, '.', ',')+(_v<1024?' ':'')+'bit';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t_nv = _nv.toFixed(2);\n\t\t}\n\t\t_v = _nv;\n\t\tif(_v<0) continue;\n\t\t\n\t\t// desenhar linha/linha delineadora\tao lado do valor a esquerda\t\t\n\t\t_draw.beginPath();\n\t\t_draw.lineWidth = 1;\n\t\t_draw.strokeStyle = 'rgba(0,0,0,3)';\n\t\t_draw.moveTo(_left+2, _k);\n\t\t_draw.lineTo(_left+8, _k);\n\t\t_draw.stroke();\t\n\n\t\n\t\t// colocar textos nas linhas indicadores\n\t\t_draw.fillStyle = jchart_list[_nid].color;\n\t\t_draw.font = \"10pt Helvetica\";\n\t\t_draw.textAlign = \"right\";\n\t\t_draw.textBaseline = \"middle\";\n\t\tif(jchart_list[_nid].fixedsize!==false && 'number'==typeof(_v)) _v = _v.toFixed(jchart_list[_nid].fixedsize);\n\t\t\n\t\t// valor no label lateral\n\t\t_draw.fillText(_v, _left-2, _k);\n\t\t\n\t\t_m++;\n\t}\n\n\t// imprimir series com valores correntes, minimo, medio, maximo\n\tvar _n = 1;\n\tvar _y_start = _bottom+4;\t\t// distancia do topo\n\tvar _x_start = _left+10;\t// distancia da linha esquerda do grafico\n\tvar _y_distance = 22;\t\t\t// distancia entre series\n\t\n\t// imprimir cabecalho das tabelas\n\t// largura disponivel para isso\n\tvar _label_width = 60;\n\tvar _width_table = _cwidth - _label_width;\t// largura do grafico menos o usado para o label da serie\n\tvar _x_table = _x_start + _label_width;\n\tvar _y_table = _y_start + 10;\n\tvar _interval_table = (_width_table / 4)-1;\n\tvar _headers = {_cur: 'Atual', _min: 'Mínimo', _avg: 'Média', _max: 'Máximo'};\n\tvar _h = 1;\n\tfor(var _ih in _headers){\n\t\t_draw.fillStyle = jchart_list[_nid].color;\n\t\t_draw.font = \"9pt Helvetica\";\n\t\t_draw.textAlign = \"right\";\n\t\t_draw.textBaseline = \"baseline\";\n\t\t_draw.fillText(_headers[_ih], _x_table+(_interval_table*_h)+1, _y_table);\n\t\t_h++;\n\t}\n\t\n\t// imprimir series\n\tfor(var _seid in jchart_list[_nid].series){\n\t\tvar _serie = jchart_list[_nid].series[_seid];\n\t\tvar _y = _y_start + (_n*_y_distance);\n\t\tvar _x = _x_start;\n\t\tvar _type = _serie.type;\n\t\t\n\t\t// icone da serie\n\t\tswitch(_type){\n\t\t\tcase 'area':\n\t\t\t\t// quadrado\n\t\t\t\t_draw.lineWidth = 1;\n\t\t\t\t_draw.strokeStyle = _serie.linecolor;\n\t\t\t\t_draw.beginPath();\n\t\t\t\t_draw.fillStyle=_serie.areacolor;\n\t\t\t\tvar _sz = 13;\n\t\t\t\t_draw.moveTo(_x, _y);\n\t\t\t\t_draw.lineTo(_x+_sz, _y);\n\t\t\t\t_draw.lineTo(_x+_sz, _y+_sz);\n\t\t\t\t_draw.lineTo(_x, _y+_sz);\n\t\t\t\t_draw.lineTo(_x, _y);\n\t\t\t\t_draw.fill();\n\t\t\t\t_draw.closePath();\n\t\t\t\t_draw.stroke();\n\t\t\t\tbreak;\n\t\t\tcase 'line':\n\t\t\t\t// linha\n\t\t\t\tvar _lw = stdlib.toint(_serie.linewidth); if(!_lw) _lw = 1;\n\t\t\t\t_draw.lineWidth = _lw;\n\t\t\t\t_draw.strokeStyle = _serie.linecolor;\n\t\t\t\t_draw.beginPath();\n\t\t\t\tvar _sz = 13;\n\t\t\t\t_draw.moveTo(_x, _y+_sz);\n\t\t\t\t_draw.lineTo(_x+_sz/2, _y);\n\t\t\t\t_draw.lineTo(_x+_sz, _y+_sz);\n\t\t\t\t_draw.stroke();\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// label da serie\n\t\t_draw.fillStyle = jchart_list[_nid].color;\n\t\t_draw.font = \"10pt Helvetica\";\n\t\t_draw.textAlign = \"left\";\n\t\t_draw.textBaseline = \"top\";\n\t\t_draw.fillText(_serie.label, _x+18, _y);\n\n\t\t// imprimir valores\n\t\tvar _xh = 1;\n\t\tfor(var _xih in _headers){\n\t\t\tvar _sv = jchart_list[_nid]._stats[_seid][_xih];\n\n\t\t\t// calcular valor a exibir\n\t\t\tvar _nv = _sv;\n\t\t\tswitch(jchart_list[_nid].dataformat){\n\t\t\t\tcase 'bit':\n\t\t\t\t\t_nv = stdlib.size_format(_sv, '.', ',')+(_sv<1024?' ':'')+'bit';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'byte':\n\t\t\t\t\t_nv = stdlib.size_format(_sv, '.', ',')+(_sv<1024?' ':'')+'bit';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif(jchart_list[_nid].fixedsize!==false && 'number'==typeof(_nv)) _nv = _nv.toFixed(jchart_list[_nid].fixedsize);\n\t\t\t\t\t//_nv = _nv.toFixed(2);\n\t\t\t}\n\t\t\t_sv = _nv;\n\t\t\t_draw.fillStyle = jchart_list[_nid].color;\n\t\t\t_draw.font = \"10pt Helvetica\";\n\t\t\t_draw.textAlign = \"right\";\n\t\t\t_draw.textBaseline = \"baseline\";\n\t\t\t_draw.fillText(_sv, _x_table+(_interval_table*_xh), _y);\n\t\t\t_xh++;\n\t\t}\t\n\t\t_n++;\n\t}\n}", "function display() {\n // Update the display of the target rate text boxes, if needed.\n for (var i = 0; i < build_targets.length; i++) {\n build_targets[i].getRate()\n }\n var totals = globalTotals\n\n window.location.hash = \"#\" + formatSettings()\n\n if (currentTab == \"graph_tab\") {\n renderGraph(totals, spec.ignore)\n }\n recipeTable.displaySolution(totals)\n if (showDebug) {\n renderDebug()\n }\n\n timesDisplayed = timesDisplayed.add(one)\n var dc = document.getElementById(\"display_count\")\n dc.textContent = timesDisplayed.toDecimal()\n}", "function calculateConvRate(pageViews, submissions) {\n // Convert the result to percentage then round to the nearest hundredth\n var convRate = (Math.round(((submissions / pageViews) * 100) * 100) / 100) + \"%\";\n\n $(\"#answer\").text(convRate);\n}", "function PerformanceReporter() {\n }", "async function printStatus() {\n let color = \"yellow\";\n\n let data = [\n [`#`, `Symbol`, `Price (USD)`]\n // [\n // ``, // Number\n // ``, // Symbol\n // ` (USD) `\n // ]\n ];\n\n let tableHorizontalLines = [0, 1];\n\n // keys.forEach((k, i) => {\n keys = Object.keys(defines.Globals.cryptoPrices).concat(\n Object.keys(defines.Globals.stockPrices)\n );\n for (let i = 0; i < keys.length && defines.Globals.options.enable; i++) {\n const k = keys[i];\n // if (!defines.Globals.options.cryptosOfInterest.includes(k.toLowerCase())) {\n // continue;\n // }\n cmcPrice = getPrice(k);\n\n let cmcPriceFormatted =\n cmcPrice <= 0 ? \"N/A\".yellow : utility_functions.formatPrice(cmcPrice);\n\n let changes = claculateChanges(k);\n data.push([\n `${data.length}`, // Number\n `${k}`[color].bright, // Symbol\n `${cmcPriceFormatted[color]}` +\n (changes.changeFormatted\n ? \" \" +\n `${changes.changeFormatted} (${changes.percentChangeFormatted})`[\n changes.changeColor\n ]\n : ``)\n ]);\n }\n\n let options = {\n /**\n * @typedef {function} drawHorizontalLine\n * @param {number} index\n * @param {number} size\n * @return {boolean}\n */\n drawHorizontalLine: (index, size) => {\n // return tableHorizontalLines.indexOf(index) < 0;\n return true;\n }\n };\n\n // Calculate marketcap\n let mktCapFormatted = defines.Globals.globalData.total_market_cap\n ? numeral(defines.Globals.globalData.total_market_cap.usd).format(\"0.00 a\")\n : \"0 \";\n let pricePostFix = /\\S+\\s+(.*)/.exec(mktCapFormatted);\n\n pricePostFix = pricePostFix[1].toUpperCase();\n mktCapFormatted = currencyFormatter.format(mktCapFormatted, {\n code: \"USD\",\n precision: 2\n });\n\n data.push([\n `${data.length}`, // Number\n `MKTCP`[color].bright, // Symbol\n `${mktCapFormatted[color]} ${pricePostFix[color]}`\n ]);\n let output = table(data, options);\n\n let mktCapFormattedRaw = `MKTCAP` + `: ${mktCapFormatted} ${pricePostFix}`;\n\n mktCapFormatted = `MKTCAP`.bright + `: ${mktCapFormatted} ${pricePostFix}`;\n\n let notificationOutput = \"\";\n let notificationOutputRaw = \"\";\n\n let stockAndCryptosOfInterest = defines.Globals.options.cryptosOfInterest.concat(\n defines.Globals.options.stocksOfInterest\n );\n\n let lineCounter = 1;\n let linLength = 0;\n for (let i = 0; i < stockAndCryptosOfInterest.length; i++) {\n const c = stockAndCryptosOfInterest[i];\n\n let btcPrice = getPrice(c);\n\n let btcPriceFormatted =\n btcPrice <= 0 ? \"N/A\".yellow : utility_functions.formatPrice(btcPrice);\n let changes = claculateChanges(c);\n\n notificationOutput += `${\n c.bright\n }: ${btcPriceFormatted} (${changes.percentChangeFormatted})`;\n notificationOutputRaw += `${c}: ${btcPriceFormatted} (${changes.percentChangeFormatted})`;\n linLength += `${c}: ${btcPriceFormatted} (${changes.percentChangeFormatted})`.length;\n\n if (i < stockAndCryptosOfInterest.length - 1) {\n notificationOutput += `, `;\n notificationOutputRaw += `, `;\n }\n\n if (linLength > 30) {\n lineCounter++;\n linLength = 0;\n notificationOutputRaw += \"\\n\";\n notificationOutput += \"\\n\";\n }\n }\n // defines.Globals.options.cryptosOfInterest.forEach((c, i) => {\n\n // });\n\n log.info(\n \"notificationOutput: \",\n notificationOutput.yellow + \", \" + mktCapFormatted.cyan\n );\n\n // Update status bar\n if (Object.keys(defines.Globals.cryptoPrices).length > 0) {\n if (api.hasTermux) {\n log.info(output);\n } else {\n let rowsFormat = output.split(\"\\n\");\n\n let i = 1;\n rowsFormat.forEach(r => {\n if (r != \"\") {\n statusBarText[i++] = r;\n }\n });\n\n let newArray = [];\n newArray.push(statusBarText[0]);\n newArray = newArray.concat(rowsFormat);\n statusBarText = newArray;\n }\n }\n\n if (defines.Globals.options.updateValuesCallback) {\n defines.Globals.options.updateValuesCallback(\n notificationOutputRaw,\n mktCapFormattedRaw\n );\n }\n}", "function interval_stream() {\n\n var rtsp = document.getElementById('RTSPCtl');\n var fps_status = rtsp.Get_FPS();\n var bps_status = rtsp.Get_KBPS();\n\n if (fps_status >= 1)\n fps_status++;\n\n $('#fps').html('FPS: <font color=\"blue\">' + fps_status + ' fps</font>');\n $('#bps').html('BPS: <font color=\"blue\">' + bps_status + ' Kbps</font>');\n\n setTimeout('interval_stream()', 1000);\n}", "function callback(reports) {\n\n let overview = plato.getOverviewReport(reports);\n let {total, average} = overview.summary;\n\n let output = `total\n ----------------------\n eslint: ${total.eslint}\n sloc: ${total.sloc}\n maintainability: ${total.maintainability}\n average\n ----------------------\n eslint: ${average.eslint}\n sloc: ${average.sloc}\n maintainability: ${average.maintainability}`;\n\n console.log(output);\n }", "function showStats(results) {\n\n results.forEach(element => {\n //console.log(element);\n resultArr.push(element);\n //console.log(resultArr);\n if (element.type == 'remote-inbound-rtp') {\n //console.log(element);\n if (element.roundTripTime) {\n rttArr.push(parseInt(element.roundTripTime * 1000));\n // document.getElementById('audio-latency').innerHTML = element.roundTripTime * 1000 + ' ms';\n averageArray = arr => arr.reduce((prev, curr) => prev + curr) / arr.length;\n averageLatency = Math.round(averageArray(rttArr) * 100 + Number.EPSILON) / 100;\n // TODO Standard deviation\n //console.log(averageLatency);\n // document.getElementById('audio-averageLatency').innerHTML = averageLatency + ' ms';\n measurements = measurements+1;\n }\n // document.getElementById('audio-packetsLost').innerHTML = element.packetsLost;\n // TODO packet loss array and average, standard deviation\n // packetsLost = element.packetsLost;\n packetLossArray.push(element.packetsLost);\n averageArray = arr => arr.reduce((prev, curr) => prev + curr) / arr.length;\n averagePacktLoss = averageArray(packetLossArray);\n }\n });\n if(rttArr && rttArr.length){\n sumOfRTT = rttArr.reduce(reducer);\n sumOfPacketLoss = packetLossArray.reduce(reducer);\n }\n}", "report() {\n const measureKeys = Object.keys(this.measures)\n\n measureKeys.forEach(key => {\n const m = this.measures[key]\n\n this.logMeasure(key, m)\n })\n }", "async function logCompareResults(results, flags, cli) {\n const { fidelity } = flags;\n const benchmarkTable = new table_1.default('Initial Render');\n const phaseTable = new table_1.default('Sub Phase of Duration');\n const controlData = results.find(element => {\n return element.set === 'control';\n });\n const experimentData = results.find(element => {\n return element.set === 'experiment';\n });\n const valuesByPhaseControl = create_consumable_html_1.bucketPhaseValues(controlData.samples);\n const valuesByPhaseExperiment = create_consumable_html_1.bucketPhaseValues(experimentData.samples);\n const subPhases = Object.keys(valuesByPhaseControl).filter(k => k !== create_consumable_html_1.PAGE_LOAD_TIME);\n const phaseResultsFormatted = [];\n const durationStats = new stats_1.Stats({\n control: valuesByPhaseControl.duration,\n experiment: valuesByPhaseExperiment.duration,\n name: 'duration',\n });\n benchmarkTable.display.push(durationStats);\n // @ts-ignore\n phaseResultsFormatted.push(create_consumable_html_1.formatPhaseData(valuesByPhaseControl[create_consumable_html_1.PAGE_LOAD_TIME], valuesByPhaseExperiment[create_consumable_html_1.PAGE_LOAD_TIME], create_consumable_html_1.PAGE_LOAD_TIME));\n subPhases.forEach(phase => {\n phaseTable.display.push(new stats_1.Stats({\n control: valuesByPhaseControl[phase],\n experiment: valuesByPhaseExperiment[phase],\n name: phase,\n }));\n // @ts-ignore\n phaseResultsFormatted.push(create_consumable_html_1.formatPhaseData(valuesByPhaseControl[phase], valuesByPhaseExperiment[phase], phase));\n });\n let isBelowRegressionThreshold = true;\n const benchmarkTableData = benchmarkTable.getData();\n const phaseTableData = phaseTable.getData();\n const areResultsSignificant = anyResultsSignificant(fidelity, benchmarkTable.isSigArray, phaseTable.isSigArray);\n if (areResultsSignificant) {\n isBelowRegressionThreshold = allBelowRegressionThreshold(fidelity, benchmarkTable.estimatorDeltas, phaseTable.estimatorDeltas);\n }\n cli.log(`\\n\\n${benchmarkTable.render()}`);\n cli.log(`\\n\\n${phaseTable.render()}`);\n outputRunMetaMessagesAndWarnings(cli, flags, isBelowRegressionThreshold);\n outputSummaryReport(cli, phaseResultsFormatted);\n return outputJSONResults(benchmarkTableData, phaseTableData, areResultsSignificant, isBelowRegressionThreshold);\n}", "display() {\n if (this.displayedComplete) {\n return;\n }\n const transferredBytes = this.segmentOffset + this.receivedBytes;\n const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1);\n const elapsedTime = Date.now() - this.startTime;\n const downloadSpeed = (transferredBytes /\n (1024 * 1024) /\n (elapsedTime / 1000)).toFixed(1);\n core.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`);\n if (this.isDone()) {\n this.displayedComplete = true;\n }\n }", "display() {\n if (this.displayedComplete) {\n return;\n }\n const transferredBytes = this.segmentOffset + this.receivedBytes;\n const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1);\n const elapsedTime = Date.now() - this.startTime;\n const downloadSpeed = (transferredBytes /\n (1024 * 1024) /\n (elapsedTime / 1000)).toFixed(1);\n core.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`);\n if (this.isDone()) {\n this.displayedComplete = true;\n }\n }", "function callback(reports) {\n const overview = plato.getOverviewReport(reports);\n\n const { total, average } = overview.summary;\n\n const output = `total\n ----------------------\n eslint: ${total.eslint}\n sloc: ${total.sloc}\n maintainability: ${total.maintainability}\n average\n ----------------------\n eslint: ${average.eslint}\n sloc: ${average.sloc}\n maintainability: ${average.maintainability}`;\n\n console.log(output);\n}", "function UpdateProgressMetrics(){\n // Calculate percentage of module progress\n perbaspro = baspro/20*100;\n perpospro = pospro/20*100;\n perfol1pro = fol1pro/20*100;\n perfol2pro = fol2pro/20*100;\n perbashrqpro = bashrqpro/6*100;\n perposhrqpro = poshrqpro/6*100;\n perfol1hrqpro = fol1hrqpro/6*100;\n perfol2hrqpro = fol2hrqpro/6*100;\n perbasmitakpro = basmitakpro/37*100;\n perposmitakpro = posmitakpro/37*100;\n perfol1mitakpro = fol1mitakpro/37*100;\n perfol2mitakpro = fol2mitakpro/37*100;\n permipro = mipro/6*100;\n peroarspro = oarspro/58*100;\n pertarpro = tarpro/33*100;\n perevokpro = evokpro/100*100;\n perplanpro = planpro/11*100;\n perfullmipro = fullmipro/1*100;\n \n // Calculate percentage of skill acquisition based on correct items\n affirmcount = UpdateProgressResponseCorrect(oarsanswercorrect5) + UpdateProgressResponseCorrect(oarsanswercorrect6);\n peraffirm = affirmcount/15*100;\n \n reflectcount = UpdateProgressResponseCorrect(oarsanswercorrect4) + UpdateProgressResponseCorrect(targetanswercorrect2);\n perreflect = reflectcount/11*100;\n \n openclosecount = UpdateProgressResponseCorrect(oarsanswercorrect1) + UpdateProgressResponseCorrect(oarsanswercorrect2) + UpdateProgressResponseCorrect(oarsanswercorrect3);\n peropenclose = openclosecount/39*100;\n \n targetcount = UpdateProgressResponseCorrect(targetanswercorrect1);\n pertarget = targetcount/13*100;\n \n changetalkcount = UpdateProgressResponseCorrect(evokanswercorrect1) + UpdateProgressResponseCorrect(evokanswercorrect2) + UpdateProgressResponseCorrect(evokanswercorrect3) + UpdateProgressResponseCorrect(evokanswercorrect4) + UpdateProgressResponseCorrect(evokanswercorrect5);\n perchangetalk = changetalkcount/88*100;\n \n}", "function readSpeedResults() {\n callJson(function(response) {\n var json = JSON.parse(response);\n if (json.state == \"CHECKING_CONNECTION\") {\n //Draw the gauge at 0.\n if (target != 0) {\n target = 0;\n draw();\n }\n } else if (json.state == \"FINDING_SERVER\") {\n //Draw the gauge at 0.\n if (target != 0) {\n target = 0;\n draw();\n }\n } else if (json.state == \"TESTING_DOWNLOAD\") {\n //Get the text about the server from the start of download.\n if (textServer == null) {\n textServer = \"finding..\";\n setTextAboutServer(json.serverURL);\n }\n //If the download information is not set then set it.\n if (isReadResults) {\n isReadResults = false;\n for (var i = 0; i < 3; i++) {\n readSpeedResults();\n }\n timeToNextCall = 0;\n }\n //Redraw if the average download changes.\n if (avgDownload != json.avgDownloadSpeed) {\n avgDownload = json.avgDownloadSpeed;\n target = convertToMbps(avgDownload);\n draw();\n }\n } else if (json.state == \"TESTING_UPLOAD\") {\n //Set the information about the upload testing and the results of the download.\n if (!isDownloadSet) {\n isDownloadSet = true;\n var download = document.getElementById('downloadAvg');\n download.innerHTML = \"Download : \" + Math.round(convertToMbps(avgDownload) * 100) / 100 + \"Mbps\";\n }\n //Redraw if the average upload changes.\n if (avgUpload != json.avgUploadSpeed) {\n avgUpload = json.avgUploadSpeed;\n target = convertToMbps(avgUpload);\n draw();\n }\n } else if (json.state == \"FINISHED\") {\n //If the target is not 0 set it to zero and write about the upload results.\n if (target != 0) {\n document.getElementById(\"startSpeedTest\").disabled = false;\n document.getElementById(\"changeServer\").disabled = false;\n document.getElementById(\"startSpeedTest\").setAttribute('style', \" ;\");\n document.getElementById(\"changeServer\").setAttribute('style', \" ;\");\n var upload = document.getElementById('uploadAvg');\n upload.innerHTML = \"Upload : \" + Math.round(convertToMbps(avgUpload) * 100) / 100 + \"Mbps\";\n target = 0;\n draw();\n }\n if (document.getElementById(\"changeServer\").disabled || document.getElementById(\"startSpeedTest\").disabled) {\n document.getElementById(\"startSpeedTest\").disabled = false;\n document.getElementById(\"changeServer\").disabled = false;\n document.getElementById(\"startSpeedTest\").setAttribute('style', \" ;\");\n document.getElementById(\"changeServer\").setAttribute('style', \" ;\");\n }\n return;\n } else if (json.state == \"COOLDOWN\") {\n if (!isDownloadSet) {\n isDownloadSet = true;\n var download = document.getElementById('downloadAvg');\n download.innerHTML = \"Download : \" + Math.round(convertToMbps(avgDownload) * 100) / 100 + \"Mbps\";\n }\n //Draw the gauge at 0.\n if (target != 0) {\n target = 0;\n draw();\n }\n } else if (json.state == \"ERROR\") {\n if (!isError) {\n isError = true;\n setError(json.error);\n document.getElementById(\"startSpeedTest\").disabled = false;\n document.getElementById(\"changeServer\").disabled = false;\n document.getElementById(\"startSpeedTest\").setAttribute('style', \" ;\");\n document.getElementById(\"changeServer\").setAttribute('style', \" ;\");\n }\n //Draw the gauge at 0.\n if (target != 0) {\n target = 0;\n draw();\n }\n return;\n }\n\n setTimeout(readSpeedResults, timeToNextCall);\n });\n}", "function calculate() {\n \n const currone = currOnePicker.value;\n const currtwo = currTwoPicker.value;\n \n fetch(`https://v6.exchangerate-api.com/v6/e5fb6e78d4418611a6b4f55b/latest/${currone}`)\n .then( res => res.json() )\n .then( data => {\n \n const exchangeRate = data.conversion_rates[currtwo];\n //Display conversion rate\n rate.innerHTML = `1 ${currone} = ${exchangeRate} ${currtwo}`;\n });\n \n//Apply conversion rate two\n amounttwo.value = (amountone.value * exchangeRate).tofixed(2);\n}", "function rate(){\nalert(\"Rate connects quantities of different kinds eg speed(km/hr) connects distance with time.Rate is mostly connected with time.It usually refers to change of a quantity with time.\");\nalert(\"For example a bus travels 40km in 10 minutes.Find the speed in km/hr.Lets use simple proportion ie 40km:10minutes so x:60minutes(1hour).Now we cross multiply ie 40×60=10× x, x=(40×60)/10=240km/hr.\");\nalert(\"A vehicle used 30 litres of fuel to cover a distance of 300km.Find the rate of fuel consumption of the vehicle(fuel consumed per km). Again we use simple proportion ie 30litres:300km and x: 1km, now cross multiply ie 30×1=300× x, x=(30km×1litre)/300km=0.1litre hence fuel consumption is 0.1l/km.\");\nalert(\"The density of aluminium is 2.7g/cm³.Calculate the volume in cm³,of a piece of aluminium of mass 16.2g.Using simple proportion 2.7g:1cm³ and 10g:x, now lets cross multiply ie 2.7× x=16.2×1 and x=(16.2×1)/2.7=6, hence the piece of aluminium has a volume of 6cm³.\");\n}", "dnaReport() {\n /* General Info */\n console.log(this.header);\n console.log('\\n' + 'Total bases: ' + this.totalBases);\n console.log('Mega Bases: ' + this.MB.toFixed(6));\n console.log('GC content: ' + this.gcContent + '\\n');\n\n /* Base information */\n for (let base in this.nucleotides) {\n console.log(`${base} : ${(this.nucleotides[base] / this.totalBases * 100).toFixed(2)}% ${this.nucleotides[base]}`);\n }\n\n /* amino acid composition */\n console.log('\\nAmino Acid Composition:\\n----------------')\n for (let aa in this.aa) {\n console.log(`${aa} : ${(this.aa[aa] / this.totalAa * 100).toFixed(2)}% ${this.aa[aa]}`);\n }\n\n /* codon usage */\n console.log('\\nCodon Usage:\\n-----------------')\n for (let codon in this.codon) {\n console.log(`${codon} : ${this.codonTable[codon]} ${(this.codon[codon] / this.totalAa * 100).toFixed(2)}% ${this.codon[codon]}`);\n }\n }", "function speedtest(){\r\n //document.getElementById('label').innerHTML =\r\n testConnectionSpeed.run(1.5, function(mbps){console.log(\">= 1.5Mbps (\"+mbps+\"Mbps)\")}, function(mbps){console.log(\"< 1.5Mbps(\"+mbps+\"Mbps)\")} )\r\n testConnectionSpeed.run(1.5, function(mbps){document.getElementById('label').innerHTML = \">= 1.5Mbps (\"+mbps+\"Mbps)\"}, function(mbps){document.getElementById('label').innerHTML = \">= 1.5Mbps (\"+mbps+\"Mbps)\"})\r\n\r\n}", "function visualize() {\n\n canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);\n\n\n function draw() {\n requestAnimationFrame(draw);\n\n canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);\n var analyser = scope.analyser;\n var bufferLength = analyser.frequencyBinCount;\n var dataArray = new Uint8Array(bufferLength);\n\n analyser.getByteFrequencyData(dataArray);\n\n canvasCtx.fillStyle = 'rgb(0, 0, 0)';\n canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);\n\n var barWidth = (WIDTH / bufferLength);\n var barHeight;\n var x = 0;\n\n for (var i = 0; i < bufferLength; i++) {\n barHeight = dataArray[i];\n\n canvasCtx.fillStyle = 'rgb(' + (barHeight + 100) + ',50,50)';\n canvasCtx.fillRect(x, HEIGHT - barHeight / 2, barWidth, barHeight / 2);\n\n x += barWidth;\n }\n };\n\n draw();\n }", "function outputSummaryReport(cli, phaseResultsFormatted) {\n cli.log(`\\n${utils_1.chalkScheme.blackBgBlue(` ${utils_1.chalkScheme.white('Benchmark Results Summary')} `)}`);\n cli.log(`\\n${chalk_1.default.red('Red')} color means there was a regression.`);\n cli.log(`${chalk_1.default.green('Green')} color means there was an improvement.\\n`);\n phaseResultsFormatted.forEach(phaseData => {\n const { phase, hlDiff, isSignificant, ciMin, ciMax } = phaseData;\n let msg = `${chalk_1.default.bold(phase)} phase `;\n if (isSignificant && Math.abs(hlDiff)) {\n let coloredDiff;\n msg += 'estimated difference ';\n if (hlDiff < 0) {\n coloredDiff = chalk_1.default.red(`+${Math.abs(hlDiff)}ms [${ciMax * -1}ms to ${ciMin * -1}ms]`);\n }\n else {\n coloredDiff = chalk_1.default.green(`-${Math.abs(hlDiff)}ms [${ciMax * -1}ms to ${ciMin * -1}ms]`);\n }\n msg += `${coloredDiff}`;\n }\n else {\n msg += `${chalk_1.default.grey('no difference')}`;\n }\n cli.log(msg);\n });\n}", "function renderCvtPage(data) { \n // get cvt data from API call...\n $.getJSON(\"api/cvt\", function(data) {\n // generate the proper HTML...\n generateAllCvtHTML(data);\n\n var page = $('.cvt-report');\n page.addClass('visible'); \n });\n }", "async function displayUPSStatus() {\n const {\n input,\n output,\n battery\n } = await getStatus();\n \n const {\n summaryNormalMsg:normalMsg,\n summaryWarningMsg:warningMsg\n } = await getSummary();\n\n setAlerts(normalMsg, warningMsg);\n\n setHeadingStates([\n [input.state, input.stateText],\n [output.state, output.stateText],\n [battery.state, battery.stateText],\n ]);\n\n setTextValues(input, output, battery);\n setProgressValues(output, battery);\n\n return;\n // Set Values\n const values = document.getElementsByClassName('value');\n\n const endRuntime = new Date(\n new Date(\n new Date().setSeconds(\n new Date().getSeconds() + batteryRemainingSeconds\n )\n )\n ).toISOString();\n\n const batteryEndRuntimeFormatted = endRuntime.substring(\n endRuntime.indexOf('T') + 1, endRuntime.indexOf('.')\n );\n\n const inputCurrent = calculateAmperage(inputVoltage[0], outputWattage[0], 2);\n const inputWattage = inputCurrent === 0 ? 0 : inputCurrent * inputVoltage;\n\n const data = [\n inputVoltage,\n inputCurrent,\n inputWattage,\n inputFrequency,\n outputVoltage,\n outputCurrent,\n outputWattage,\n outputFrequency,\n batteryVoltage,\n batteryRemainingFormatted,\n batteryEndRuntimeFormatted,\n ];\n\n const replaceMetrics = [\n ['V'],\n ['A'],\n ['Watts'],\n ['VA'],\n ['Hz'],\n ['hr.', 'h'],\n ['min.', 'm']\n ];\n\n for (i = 0; i < data.length; i++) {\n let currentData = data[i].length === 1 ? data[i][0] : data[i];\n\n replaceMetrics.forEach(metric => {\n if (!currentData.toString().includes(metric[0])) return;\n\n currentData = currentData.replace(metric[0], metric[1] || '');\n });\n\n values[i].innerHTML = currentData;\n }\n\n // Progress Bars\n const loadBar = document.getElementById('loadBar');\n const capacityBar = document.getElementById('capacityBar');\n\n const bars = [\n outputLoad[0].replace(' ', ''),\n batteryCapacity.replace(' ', '')\n ]\n \n loadBar.style.width = bars[0];\n loadBar.innerText = bars[0];\n\n capacityBar.style.width = bars[1];\n capacityBar.innerText = bars[1];\n}", "function onComplete() {\n this.forEach(printBenchmark);\n console.log(' Fastest: ' + Color.GREEN + '%s' + Color.RESET,\n this.filter('fastest').pluck('name'));\n console.log('');\n }", "function process_chart(process) {\n\tvar name = process.name;\n\tvar execution_time = parseInt(process.execution_time);\n\tvar arrival_time = parseInt(process.arrival_time);\n\tvar burst_time = parseInt(process.burst_time);\n\n\treturn '<li class=\"title\" title=\"\">'+name+'</li><li class=\"current\" title=\"'+execution_time+'\"><span class=\"bar\" data-number=\"'+burst_time+\n\t'\"></span><span class=\"number\">'+(burst_time+execution_time)+'</span></li>';\n}", "function printTotals(){\n var endMilliseconds = new Date().getTime();\n var totalMilliseconds = endMilliseconds - pound.startMilliseconds;\n console.log('pound completed %s requests in %s ms. \\nreceived responses: %s. \\nhighest number of open connections was: %s. \\nrequest errors: %s' +\n '\\nrequests per second: %s. \\nresponses per second: %s',\n pound.requestsGenerated, totalMilliseconds,\n pound.responsesReceived,\n pound.highestOpenConnectionsAtOneTime,\n pound.requestErrorCount,\n pound.requestsPerSecond,\n pound.responsesPerSecond);\n }", "function graphStats () {\n // reset values;\n if (prevFilter !== filter) {\n perf1 = 0;\n perf2 = 0;\n sum1 = 0;\n sum2 = 0;\n avg1 = 0;\n avg2 = 0;\n counter = 0;\n };\n\n if (filter !== 'Normal') {\n perf1 = t1 - t0;\n perf2 = t3 - t2;\n sum1 += perf1;\n sum2 += perf2;\n counter += 1;\n if (counter % 5 === 0) {\n avg1 = sum1 / counter;\n avg2 = sum2 / counter;\n avgDisplay.innerText = `Average computation time WASM: ${avg1.toString().slice(0, 4)} ms, JS: ${avg2.toString().slice(0, 4)} ms`;\n line1.append(new Date().getTime(), 500 / perf1);\n line2.append(new Date().getTime(), 500 / perf2);\n }\n perfStr1 = perf1.toString().slice(0, 4);\n perfStr2 = perf2.toString().slice(0, 5);\n wasmStats = `WASM computation time: ${perfStr1} ms`;\n jsStats = ` JS computation time: ${perfStr2} ms`;\n document.getElementById(\"stats\").textContent = wasmStats + jsStats;\n percent = Math.round(((perf2 - perf1) / perf1) * 100);\n }\n if (filter !== 'Normal' && jsActive) {\n speedDiv.innerText = `Performance Comparison: WASM is currently ${percent}% faster than JS`;\n }\n else speedDiv.innerText = 'Performance Comparison';\n\n prevFilter = filter;\n setTimeout(graphStats, 500);\n}", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "getUsageStats() {\n return `Buffer: ${bytes(this.recentBuffer.length)}, lrErrors: ${this.lrErrors}`;\n }", "constructor(options) {\n this._memoryAvailable = false;\n this._cpuAvailable = false;\n this._currentMemory = 0;\n this._currentCpuPercent = 0;\n this._memoryLimit = null;\n this._units = 'B';\n this._changed = new Signal(this);\n this._values = [];\n for (let i = 0; i < N_BUFFER; i++) {\n this._values.push({ memoryPercent: 0, cpuPercent: 0 });\n }\n this._poll = new Poll({\n factory: () => Private.factory(),\n frequency: {\n interval: options.refreshRate,\n backoff: true,\n },\n name: 'jupyterlab-system-monitor:ResourceUsage#metrics',\n });\n this._poll.ticked.connect((poll) => {\n const { payload, phase } = poll.state;\n if (phase === 'resolved') {\n this._updateMetricsValues(payload);\n return;\n }\n if (phase === 'rejected') {\n const oldMemoryAvailable = this._memoryAvailable;\n const oldCpuAvailable = this._cpuAvailable;\n this._memoryAvailable = false;\n this._cpuAvailable = false;\n this._currentMemory = 0;\n this._memoryLimit = null;\n this._units = 'B';\n if (oldMemoryAvailable || oldCpuAvailable) {\n this._changed.emit();\n }\n return;\n }\n });\n }", "report() {\n console.log(this.name + \" is a \" + this.type + \" type and has \" + this.energy + \" energy.\");\n }", "function result() {\n // var charcount = samples[random].length\n var totaltime = parseInt(min) + parseInt(sec) / 60;\n var wpm = calculateWPM(samples[random], totaltime).toFixed(2);\n var cpm = calculateCPM(totalCharsInf, totaltime).toFixed(2);\n var accuracy = calculateAccuracy(samples[random], totalCharsInf).toFixed(2);\n document.querySelector(\"#timer-wpm-inf\").innerText = wpm;\n document.querySelector(\"#timer-cpm-inf\").innerText = cpm;\n document.querySelector(\"#timer-accuracy-inf\").innerText = accuracy;\n}", "toString() {\n return `Convert from: ${this.from} to: ${this.to} ratio: ${_ratio.get(this)}`;\n }", "function show_speed() {\r\n $('.label #speedstatus').html(Math.round(speed) + ' (frames/sec)');\r\n\t\tdelay = 1000.0 / speed;\r\n }", "componentDidUpdate() {\n Perf.stop()\n Perf.printInclusive()\n Perf.printWasted()\n }", "function computeOutput(event) {\n // stop the recursive change events:\n if (event) {\n switch (mode) {\n case 'amort':\n if (event.target.id == 'slider-amort') {return;}\n break;\n case 'duration':\n if (event.target.id == 'slider-duration') {return;}\n break;\n case 'capital':\n if (event.target.id == 'slider-capital') {return;}\n break;\n default:\n console.log('bad mode: '+mode )\n }\n }\n \n console.log('Compute ouput');\n \n // Grab all variables, with unit conversion\n var rate = $('#slider-rate').val()/100\n var insur = $('#slider-insur').val()/100\n var amort = $('#slider-amort').val()\n var duration = $('#slider-duration').val()\n var capital = $('#slider-capital').val()*1000\n //console.log('rate ' + rate + ' insur ' + insur)\n \n \n // Compute the appropriate output\n mode = getCalcMode()\n \n switch (mode) {\n case 'amort':\n amort = calcAmort(capital, rate, insur, duration)\n output = 'Mensualité : <strong>' + amort.toFixed(0) +'</strong> €/mois'\n output += ', dont ' + calcInsur(capital, insur).toFixed(0) + ' € d\\'assurance'\n $('#slider-amort').val(amort).slider('refresh')\n break;\n case 'duration':\n duration = calcDuration(capital, rate, insur, amort)\n output = 'Durée du prêt : <strong>'+ duration.toFixed(1)+'</strong> années'\n output += ' (' + (duration*12).toFixed(0) + ' mois)'\n $('#slider-duration').val(duration).slider('refresh')\n break;\n case 'capital':\n capital = calcCapital(amort, rate, insur, duration)\n output = 'Capital empruntable : <strong>' + (capital/1000).toFixed(1) + '<strong> k€'\n $('#slider-capital').val(capital/1000).slider('refresh')\n break;\n default:\n console.log('bad mode: '+mode )\n }\n \n // Update the detailed cost output\n // TODO: do only if visible\n costTotal = amort*duration*12 - capital\n costInsur = calcInsur(capital, insur)*duration*12\n costInter = costTotal - costInsur\n \n function costFmt(cost) {\n return Math.round(cost).toLocaleString('fr-FR') + ' €'\n }\n \n $('#cost-inter').text(costFmt(costInter))\n $('#cost-insur').text(costFmt(costInsur))\n $('#cost-total').text(costFmt(costTotal))\n \n // display\n $('#output').html(output);\n \n // save\n loan = {\n 'rate':rate,\n 'insur':insur,\n 'amort':amort,\n 'duration':duration,\n 'capital':capital\n }\n saveState(loan)\n}", "function recordSegmentDownloadRate() {\r\n\ttotalEndTime = performance.now();\r\n\tvar totalTime = totalEndTime - totalStartTime;\r\n\tdocument.getElementById(\"result\").events_textarea.value += \"TotalTime:\" + totalTime + \"\\n\";\r\n}", "function reportProductTrendSummary(year) {\n $(\"#n_p1\").html('0');\n $(\"#n_p2\").html('0');\n $(\"#n_p3\").html('0');\n $(\"#n_p4\").html('0');\n $(\"#n_p5\").html('0');\n $(\"#n_p6\").html('0');\n $(\"#n_p7\").html('0');\n $(\"#n_p8\").html('0');\n $(\"#n_p9\").html('0');\n $(\"#n_p10\").html('0');\n $(\"#n_p11\").html('0');\n $(\"#n_p12\").html('0');\n $(\"#p_c1\").html('0');\n $(\"#p_c2\").html('0');\n $(\"#p_c3\").html('0');\n $(\"#p_c4\").html('0');\n $(\"#p_c5\").html('0');\n $(\"#p_c6\").html('0');\n $(\"#p_c7\").html('0');\n $(\"#p_c8\").html('0');\n $(\"#p_c9\").html('0');\n $(\"#p_c10\").html('0');\n $(\"#p_c11\").html('0');\n $(\"#p_c12\").html('0');\n $(\"#m1\").html('0');\n $(\"#m2\").html('0');\n $(\"#m3\").html('0');\n $(\"#m4\").html('0');\n $(\"#m5\").html('0');\n $(\"#m6\").html('0');\n $(\"#m7\").html('0');\n $(\"#m8\").html('0');\n $(\"#m9\").html('0');\n $(\"#m10\").html('0');\n $(\"#m11\").html('0');\n $(\"#m12\").html('0');\n $(\"#c1\").html('0');\n $(\"#c2\").html('0');\n $(\"#c3\").html('0');\n $(\"#c4\").html('0');\n $(\"#c5\").html('0');\n $(\"#c6\").html('0');\n $(\"#c7\").html('0');\n $(\"#c8\").html('0');\n $(\"#c9\").html('0');\n $(\"#c10\").html('0');\n $(\"#c11\").html('0');\n $(\"#c12\").html('0');\n $.ajax({\n url: 'config/clientreport.php',\n data: {\n year: year,\n type: 'product'\n },\n type: \"post\",\n success: function(data) {\n var r_a_data = jQuery.parseJSON(data);\n //console.log(r_a_data);\n $.each(r_a_data[\"pro\"], function(key, value) {\n $(\"#n_p\" + value.month + \"\").html(value.cou);\n $(\"#p_c\" + value.month + \"\").html(value.pc);\n });\n $.each(r_a_data[\"map\"], function(key, value) {\n $(\"#m\" + value.month + \"\").html(value.cou);\n });\n $.each(r_a_data[\"close\"], function(key, value) {\n $(\"#c\" + value.month + \"\").html(value.cou);\n });\n }\n });\n}", "getRateHistory(){\n var rateHistory;\n\n if (this.status === true)\n {\n rateHistory = .01;\n } else {\n rateHistory = 0;\n }\n console.log(rateHistory);\n return rateHistory;\n }", "* overviewPrint (request, response) {\n const categories = yield Category.all(),\n result = yield Result.get(request.param('id')),\n user = yield request.auth.getUser(),\n type = request.input('type'),\n date = moment().format('YYYY-mm-DD hh:mm:ss')\n\n result.sortCandidates((a, b) => {\n return result.getJudgesAverage(b.id) - result.getJudgesAverage(a.id)\n })\n\n if (type == 'winner') {\n result.sliceTop(1)\n }\n\n if (type == 'top-5') {\n result.sliceTop(5)\n }\n\n yield response.sendView('dashboard/score/overview_print', {\n categories, result, user, date\n })\n }", "function calculate() {\r\n const currency_one = currencyEl_one.value;\r\n const currency_two = currencyEl_two.value;\r\n const flag_one = currency_one.charAt(0) + currency_one.charAt(1);\r\n const flag_two = currency_two.charAt(0) + currency_two.charAt(1);\r\n \r\n\r\n\r\n fetch(`https://api.exchangerate-api.com/v4/latest/${currency_one}`)\r\n .then(res => res.json())\r\n .then(data => {\r\n \r\n const rate = data.rates[currency_two];\r\n\r\n //rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\r\n //rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\r\n //rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\r\n\r\n //amountEl_two.value = (amountEl_one.value * rate).toFixed(2);\r\n\r\n amountEl_two.value = rate;\r\n \r\n rateEl.innerHTML = `<img src=\"https://www.countryflags.io/${flag_one}/shiny/64.png\"></img> <span> 1 ${currency_one} </span> = <span>${rate} ${currency_two} </span><img src=\"https://www.countryflags.io/${flag_two}/shiny/64.png\"></img>`;\r\n \r\n Array.from(document.querySelector(\"#currency-one\").options).forEach(function(option_element) {\r\n let option_text = option_element.text;\r\n let option_value = option_element.value;\r\n let is_option_selected = option_element.selected;\r\n /*\r\n console.log('Option Text : ' + option_text);\r\n console.log('Option Value : ' + option_value);\r\n console.log('Option Selected : ' + (is_option_selected === true ? 'Yes' : 'No'));\r\n \r\n console.log(\"\\n\\r\");\r\n \r\n console.log(); \r\n */\r\n // ratelistEl.innerHTML += `<img src=\"https://www.countryflags.io/${flag(option_text)}/shiny/64.png\"></img>`; \r\n \r\n\r\n });\r\n \r\n\r\n });\r\n}", "metricsFromEmbeddedReport(){\n const { file, schemas } = this.props;\n const commonProps = { 'metric' : file.quality_metric, 'tips' : object.tipsFromSchema(schemas, file.quality_metric) };\n return (\n <div className=\"overview-list-elements-container\">\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Total reads\" fallbackTitle=\"Total Reads in File\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Total Sequences\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Sequence length\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Cis reads (>20kb)\" percent />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Short cis reads (<20kb)\" percent />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Trans reads\" fallbackTitle=\"Trans Reads\" percent />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Sequence length\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"overall_quality_status\" fallbackTitle=\"Overall Quality\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"url\" fallbackTitle=\"Link to Report\" />\n </div>\n );\n }", "function calculate() {\n const currency_one = currencyEl_one.value;\n const currency_two = currencyEl_two.value;\n\n fetch(`https://v6.exchangerate-api.com/v6/(API KEY)/${currency_one}`)\n .then(res => res.json())\n .then(data => {\n //console.log(data.conversion_rates));\n const rate = data.conversion_rates[currency_two]\n \n rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n\n amount_currency2.value = (amount_currency1.value * rate).toFixed(2)\n }\n)}", "function updateOutput() { //\n\tfor (var i = 1; i <= numMonitors; i++) { //updates all output for only the monitors that are show\n\t\tcheckIfCustom(i);\n\t\tupdateResolution(i);\n\t\tdrawMonitor(i); //with animation\n\t\tdisplaySize(i);\n\t\tdisplayHeight(i);\n\t\tdisplayWidth(i);\n\t\tdisplayArea(i)\n\t\tdisplayAspectRatio(i);\n\t\tdisplayResolution(i);\n\t\tdisplayPixels(i);\n\t\tdisplayPPI(i);\n\t\tsearchMonitor(i);\n\t}\n displayTotalNumPixels();\n displayTotalWidth();\n displayTotalArea();\n \n displayTotalMonitorsCost();\n displayTotalSetupCost();\n}", "function calculateForm() {\n let clock = Number(document.getElementById(\"clock\").value);\n let CR = Number(document.getElementById(\"CR\").value);\n let output = calculateLatency(clock, CR);\n\n document.getElementById(\"output\").innerHTML = output.toString().substr( 0, 10);\n}", "function render_stats(i,n,render_speed) {\n\t d3.select(\"#rendered-count\").text(i);\n\t d3.select(\"#rendered-bar\")\n\t .style(\"width\", (100*i/n) + \"%\");\n\t d3.select(\"#render-speed\").text(render_speed);\n\t}", "function displayData() {\n //Queue text number update\n let queueNumber = data.queue.length;\n if (queueNumber < 10) {\n queueNumber = \"0\" + queueNumber;\n }\n queueP.textContent = queueNumber;\n\n //Serving text number update\n let servingNumber = data.serving.length;\n if (servingNumber < 10) {\n servingNumber = \"0\" + servingNumber;\n }\n servingP.textContent = servingNumber;\n\n //Performance text and graph update\n calcPerf();\n}", "generateCurrencyRate(currentCurrency) {\n let resultDiv = document.getElementsByClassName('search-result');\n let p = document.createElement(\"P\");\n let v = document.createTextNode(`1 BTC = ${currentCurrency.rate} ${currentCurrency.code}`); \n p.setAttribute('class', 'currency-rate');\n p.appendChild(v); \n resultDiv[0].appendChild(p);\n }", "function newresult() {\n input_data = output\n var p = input_data[0]\n var ract = input_data[1]\n var pro = input_data[2]\n var input = input_data.slice(3, input_data.length)\n // console.log(p)\n\n //Calculate monetary value of pipchange\n // dough = Math.round((dinero * p) * 100)/100\n dough = Math.round((pro * dinero) * 100)/100\n rounded = (Math.round(p * 100000)/100000).toFixed(5)\n\n var up, down\n var sym;\n\n //Format the output accordingly. Make sure right symbols for buying and selling, (buy is postive correlation, sell is negative correlation)\n //e.g. if user sells and eur-usd rate goes down then user made money.\n up = \"glyphicon glyphicon-triangle-top\"\n down = \"glyphicon glyphicon-triangle-bottom\"\n\n \n if (ract == \"Buy\") {\n dinero = Math.round((dinero + dough) * 100)/100\n rolls = dough.toFixed(2)\n if (p >= 0) {\n format = [up, up, 'green']\n sym = ['+', '+']\n }\n else if (p < 0) {\n format = [down, down, 'red']\n sym = ['-', '-']\n }\n }\n else {\n dinero = Math.round((dinero + dough) * 100)/100\n rolls = dough.toFixed(2)\n if (p <= 0) {\n format = [down, up, 'green']\n sym = ['-', '+']\n }\n else if (p > 0) {\n format = [up, down, 'red']\n sym = ['+', '-']\n }\n }\n\n\n //Format time outputs\n var bigben;\n if (input[2] < 10) {\n bigben = `${input[1]}:0${input[2]}`\n }\n else {\n bigben = `${input[1]}:${input[2]}`\n }\n\n //Use of tofixed(x) makes sure the right number of decimals are shown\n coins = dinero.toFixed(2)\n // console.log(ract, rounded, dough)\n \n // output variables to html text\n date_html.text(`Date: ${input[0]}`)\n time_html.text(`Time: ${bigben}`)\n buysell.style('font-weight', 'bold').text(`${ract}`)\n pip.style('color', format[2]).text(`${sym[0]} ${Math.abs(rounded)} `).append('i').style('color', format[2]).attr('class',format[0])\n moolah.style('color', format[2]).text(`${sym[1]}$ ${Math.abs(dough).toFixed(2)} `).append('i').style('color', format[2]).attr('class',format[1])\n\n //create array for table\n all_dict = input.concat([ract, rounded, rolls, coins])\n \n tabelizer()\n}", "function MeasureConnectionSpeed() {\n var startTime, endTime;\n var download = new Image();\n download.onload = function () {\n endTime = (new Date()).getTime();\n showResults();\n }\n \n download.onerror = function (err, msg) {\n ShowProgressMessage(\"Invalid image, or error downloading\");\n }\n \n startTime = (new Date()).getTime();\n var cacheBuster = \"?nnn=\" + startTime;\n download.src = imageURL + cacheBuster;\n \n function showResults() {\n var duration = (endTime - startTime) / 1000;\n var bitsLoaded = downloadSize * 8;\n var speedBps = (bitsLoaded / duration).toFixed(5);\n var speedbps = (downloadSize / duration).toFixed(5);\n var speedKbps = (speedBps / 1024).toFixed(5);\n var speedMbps = (speedKbps / 1024).toFixed(5);\n ShowProgressMessage([\n \"Your connection speed is:\", \n speedBps + \" bps\", \n speedbps+ \" Bps\", \n speedKbps + \" kbps\", \n speedMbps + \" Mbps\"\n ]);\n }\n getip();\n DBtest();\n}", "function report(){\n\n\tconsole.log(\"Summary of Current Session: \")\n\tfor(var url in urlDict){\n\t\tconsole.log(\"\\tURL: \" + url + \"\\tElapsed Time: \" + urlDict[url] + \"s\");\n\t}\n}", "function update(){\n\tdocument.getElementById(\"score\").innerHTML = Math.round(clicks).toLocaleString();\n\tdocument.getElementById(\"bps\").innerHTML = biscuitPerSec.toLocaleString();\n\t//.toLocaleString adds commas to the numbers\n}", "_run()\n {\n var info = this._getInfoFromPackageJson()\n\n if (Tester.is(this._output, 'function')) {\n this._output('################################################')\n this._output(info.label)\n this._output(info.labelDescription)\n this._output('################################################')\n }\n\n var start = new Date()\n\n // @todo Progress bar start.\n\n this._runTestMethods()\n\n // @todo Progress bar stop.\n\n var end = new Date()\n var time = end - start\n var formatTime = time > 1000 ? (time / 1000).toFixed(1) + ' seconds' : time + ' miliseconds'\n var memoryBytes = process.memoryUsage().heapTotal\n var trace = Tester.getBacktrace(new Error(), 3)\n\n this._resultsJson = {\n info: info,\n errors: this._errors,\n ok: this._ok,\n all: this._all,\n className: this.constructor.name,\n assertionsCounter: this._assertionsCounter,\n testsCounter: this._testsCounter,\n timeMiliseconds: time,\n formatTime: formatTime,\n memoryBytes: memoryBytes,\n formatMemory: Tester.formatBytes(memoryBytes),\n from: trace\n }\n\n if (Tester.is(this._output, 'function')) {\n var arr = this._showOk === true ? this._all : this._errors\n for (let value of arr) {\n if (this._colorize === true) {\n // reverse red\n value = value.replace(/^Error:/, '\\x1b[31m\\x1b[7mError:\\x1b[0m')\n // reverse\n value = value.replace(/^Ok:/, '\\x1b[7mOk:\\x1b[0m')\n }\n this._output(value)\n }\n\n var className = this.constructor.name + ':'\n\n this._output(className)\n this._output(' - tests ' + this._testsCounter)\n this._output(' - assertions ' + this._assertionsCounter)\n this._output(' - errors ' + this._errors.length)\n this._output(' - time ' + formatTime)\n this._output(' - memory ' + Tester.formatBytes(memoryBytes))\n this._output(' - from ' + trace)\n this._output('')\n }\n }", "async function getStatisticToPlan() {\n\n}", "function stateStats(resultStats){\n started = true;\n var today = resultStats[\"today\"]\n var cmtoday = today[\"onecup\"];\n cmtoday += today[\"double\"];\n cmtoday += today[\"strong\"];\n cmtoday += today[\"xstrong\"];\n var week = resultStats[\"week\"]\n var cmweek = week[\"onecup\"];\n cmweek += week[\"double\"];\n cmweek += week[\"strong\"];\n cmweek += week[\"xstrong\"];\n var total = resultStats[\"total\"]\n var cmtotal = total[\"onecup\"];\n cmtotal += total[\"double\"];\n cmtotal += total[\"strong\"];\n cmtotal += total[\"xstrong\"];\n trester_progress = parseInt(resultStats[\"trester\"]) / 640 * 100;\n console.log(resultStats[\"trester\"]);\n\n\n // write list\n document.querySelector('.cm-update-stats-icon').innerHTML = \"<i class=\\\"icon ion-android-sync big-icon cm-update-stats\\\" query=\\\"update\\\"></i>\";\n document.querySelector('.cm-today').innerHTML = cmtoday;\n if (!today[\"onecup\"] == 0 ){\n document.querySelector('.cm-single-today').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Normal</span> <span class=\\\"pull-right\\\">\" + today[\"onecup\"].toString()+\"</span> </li> \";\n }\n if (!today[\"double\"] == 0 ){\n document.querySelector('.cm-double-today').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Double</span> <span class=\\\"pull-right\\\">\" + today[\"double\"].toString()+\"</span> </li> \";\n }\n if (!today[\"strong\"] == 0 ){\n document.querySelector('.cm-strong-today').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Strong</span> <span class=\\\"pull-right\\\">\" + today[\"strong\"].toString()+\"</span> </li> \";\n }\n if (!today[\"xstrong\"] == 0 ){\n document.querySelector('.cm-xstrong-today').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Xtra strong</span> <span class=\\\"pull-right\\\">\" + today[\"xstrong\"].toString()+\"</span> </li> \";\n }\n if (!today[\"flushs\"] == 0 ){\n document.querySelector('.cm-flush-today').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Flushs</span> <span class=\\\"pull-right\\\">\" + today[\"flushs\"].toString()+\"</span> </li> \";\n }\n\n document.querySelector('.cm-week').innerHTML = cmweek;\n\n if (!week[\"onecup\"] == 0) {\n document.querySelector('.cm-single-week').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Normal</span> <span class=\\\"pull-right\\\">\" + week[\"onecup\"].toString()+\"</span> </li> \";\n }\n if (!week[\"double\"] == 0) {\n document.querySelector('.cm-double-week').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Double</span> <span class=\\\"pull-right\\\">\" + week[\"double\"].toString()+\"</span> </li> \";\n }\n if (!week[\"strong\"] == 0) {\n document.querySelector('.cm-strong-week').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Strong</span> <span class=\\\"pull-right\\\">\" + week[\"strong\"].toString()+\"</span> </li> \";\n }\n if (!week[\"xstrong\"] == 0) {\n document.querySelector('.cm-xstrong-week').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Xtra strong</span> <span class=\\\"pull-right\\\">\" + week[\"xstrong\"].toString()+\"</span> </li> \";\n }\n if (!week[\"flushs\"] == 0) {\n document.querySelector('.cm-flush-week').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Flushs</span> <span class=\\\"pull-right\\\">\" + week[\"flushs\"].toString()+\"</span> </li> \";\n }\n document.querySelector('.cm-total').innerHTML = cmtotal;\n document.querySelector('.cm-single-total').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Normal</span> <span class=\\\"pull-right\\\">\" + total[\"onecup\"].toString()+\"</span> </li> \";\n document.querySelector('.cm-double-total').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Double</span> <span class=\\\"pull-right\\\">\" + total[\"double\"]+\"</span> </li> \";\n document.querySelector('.cm-strong-total').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Strong</span> <span class=\\\"pull-right\\\">\" + total[\"strong\"].toString()+\"</span> </li> \";\n document.querySelector('.cm-xstrong-total').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Xtra strong</span> <span class=\\\"pull-right\\\">\" + total[\"xstrong\"].toString()+\"</span> </li> \";\n document.querySelector('.cm-flush-total').innerHTML = \"<li class=\\\"padded-list\\\"> <span class=\\\"pull-left\\\">Flushs</span> <span class=\\\"pull-right\\\">\" + total[\"flushs\"].toString()+\"</span> </li> \";\n document.querySelector('.cm-trester-progress').innerHTML = \"<div class=\\\"determinate\\\" style=\\\"width: \"+trester_progress +\"%;\\\"></div>\";\n }", "function PerformanceCollect(configs){\n console.log('配置文件');\n console.log(configs);\n resourceTiming();\n console.log('====');\n timing.getTimes();\n //\n PerformanceData.site_id = configs.site_id; //汇报前带上站点id\n console.log('打印获得到的性能数据,包含各个元素的性能和整个页面的性能时间');\n\n console.log(PerformanceData);\n\n //doPost(configs.report_url,{'data':'test'})\n //do_jsonp(configs.report_url,PerformanceData);\n}", "function activity(analyserNode, time) {\n var QuesTime = $('#Hdn_QuesTime').val();\n if (time <= QuesTime) {\n var progressbar = $('.audio-player-progress-bar');\n var percentage = (time * 100) / QuesTime;\n progressbar.css({\n width: percentage + '%'\n });\n $('.recodingStatus').html(\"Recording has started...\" + time + \" Sec / \" + QuesTime + \" Sec\");\n }\n}", "function outputDeviceSummary(){\n console.log(\"============================\");\n console.log(\"Power: \" + pCurrent);\n console.log(\"Mode: \" + mCurrent);\n console.log(\"============================\");\n}", "async function calculate () {\r\n const currency1 = select1.value;\r\n const currency2 = select2.value;\r\n\r\n const res = await fetch(`https://v6.exchangerate-api.com/v6/234fde1f86a9ac95117b1a87/latest/${currency1}`)\r\n const data = await res.json()\r\n const rates = data.conversion_rates[currency2]\r\n\r\n rate.innerText = (`1 ${currency1} = ${rates} ${currency2}`);\r\n input2.value = (input1.value * rates).toFixed(2);\r\n}", "function calculate() {\n const currencyOneCode = currOnePicker.value;\n const currencyTwoCode = currTwoPicker.value;\n \n fetch(`http://data.fixer.io/api/latest?access_key=aa9501d58a8b22906cf8423e472d9426/latest/${currencyOneCode}`)\n .then(res => res.json())\n .then( data => {\n //exchange rate \n const exchangerate = data.conversion_rates[currencyTwoCode];\n console.log(exchangeRate);\n\n rate.innerText = `1 ${currencyOneCode} = ${exchangeRate} ${currencyTwoCode}`;\n\n //Apply Conversion Rate \n currOneAmount.value = (currOneAmount.value * exchangeRate).toFixed(2);\n\n });\n }", "logMetrics() {\n logger.info(`# of files indexed: ${this._filesIndexed}`);\n logger.info(`# of directories indexed: ${this._directoriesIndexed}`);\n logger.info(`# of unknown files: ${this._unknownCount}`);\n\n const endTimer = process.hrtime(this._startTimer);\n logger.info(`Execution time: ${endTimer[0] + endTimer[1] / 1E9}s`);\n }", "function cpa(cost, conversions){\n var costConv = cost/conversions;\n return costConv.toFixed(2);\n}", "carAero() {\n console.log(\n `Added the aero package and the car's top speed changed: ${\n this.topSpeed - 5\n }`\n );\n }", "function StatsDisplay() {\n\n 'use strict';\n\n var labelContainer, label;\n\n /**\n * Frames per second.\n * @private\n */\n this._fps = 0;\n\n /**\n * The current time.\n * @private\n */\n if (Date.now) {\n this._time = Date.now();\n } else {\n this._time = 0;\n }\n\n /**\n * The time at the last frame.\n * @private\n */\n this._timeLastFrame = this._time;\n\n /**\n * The time the last second was sampled.\n * @private\n */\n this._timeLastSecond = this._time;\n\n /**\n * Holds the total number of frames\n * between seconds.\n * @private\n */\n this._frameCount = 0;\n\n /**\n * A reference to the DOM element containing the display.\n * @private\n */\n this._el = document.createElement('div');\n this._el.id = 'statsDisplay';\n this._el.className = 'statsDisplay';\n this._el.style.color = 'white';\n\n /**\n * A reference to the textNode displaying the total number of elements.\n * @private\n */\n this._totalElementsValue = null;\n\n /**\n * A reference to the textNode displaying the frame per second.\n * @private\n */\n this._fpsValue = null;\n\n // create 3dTransforms label\n labelContainer = document.createElement('span');\n labelContainer.className = 'statsDisplayLabel';\n label = document.createTextNode('trans3d: ');\n labelContainer.appendChild(label);\n this._el.appendChild(labelContainer);\n\n // create textNode for totalElements\n this._3dTransformsValue = document.createTextNode(exports.System.supportedFeatures.csstransforms3d);\n this._el.appendChild(this._3dTransformsValue);\n\n // create totol elements label\n labelContainer = document.createElement('span');\n labelContainer.className = 'statsDisplayLabel';\n label = document.createTextNode('total elements: ');\n labelContainer.appendChild(label);\n this._el.appendChild(labelContainer);\n\n // create textNode for totalElements\n this._totalElementsValue = document.createTextNode('0');\n this._el.appendChild(this._totalElementsValue);\n\n // create fps label\n labelContainer = document.createElement('span');\n labelContainer.className = 'statsDisplayLabel';\n label = document.createTextNode('fps: ');\n labelContainer.appendChild(label);\n this._el.appendChild(labelContainer);\n\n // create textNode for fps\n this._fpsValue = document.createTextNode('0');\n this._el.appendChild(this._fpsValue);\n\n document.body.appendChild(this._el);\n\n /**\n * Initiates the requestAnimFrame() loop.\n */\n this._update(this);\n}", "function updateStats(gfc) {\n var gr, ch;\n assert(0 <= gfc.bitrate_index && gfc.bitrate_index < 16);\n assert(0 <= gfc.mode_ext && gfc.mode_ext < 4);\n\n /* count bitrate indices */\n gfc.bitrate_stereoMode_Hist[gfc.bitrate_index][4]++;\n gfc.bitrate_stereoMode_Hist[15][4]++;\n\n /* count 'em for every mode extension in case of 2 channel encoding */\n if (gfc.channels_out == 2) {\n gfc.bitrate_stereoMode_Hist[gfc.bitrate_index][gfc.mode_ext]++;\n gfc.bitrate_stereoMode_Hist[15][gfc.mode_ext]++;\n }\n for (gr = 0; gr < gfc.mode_gr; ++gr) {\n for (ch = 0; ch < gfc.channels_out; ++ch) {\n var bt = gfc.l3_side.tt[gr][ch].block_type | 0;\n if (gfc.l3_side.tt[gr][ch].mixed_block_flag != 0)\n bt = 4;\n gfc.bitrate_blockType_Hist[gfc.bitrate_index][bt]++;\n gfc.bitrate_blockType_Hist[gfc.bitrate_index][5]++;\n gfc.bitrate_blockType_Hist[15][bt]++;\n gfc.bitrate_blockType_Hist[15][5]++;\n }\n }\n }", "function updateStats(gfc) {\n var gr, ch;\n assert(0 <= gfc.bitrate_index && gfc.bitrate_index < 16);\n assert(0 <= gfc.mode_ext && gfc.mode_ext < 4);\n\n /* count bitrate indices */\n gfc.bitrate_stereoMode_Hist[gfc.bitrate_index][4]++;\n gfc.bitrate_stereoMode_Hist[15][4]++;\n\n /* count 'em for every mode extension in case of 2 channel encoding */\n if (gfc.channels_out == 2) {\n gfc.bitrate_stereoMode_Hist[gfc.bitrate_index][gfc.mode_ext]++;\n gfc.bitrate_stereoMode_Hist[15][gfc.mode_ext]++;\n }\n for (gr = 0; gr < gfc.mode_gr; ++gr) {\n for (ch = 0; ch < gfc.channels_out; ++ch) {\n var bt = gfc.l3_side.tt[gr][ch].block_type | 0;\n if (gfc.l3_side.tt[gr][ch].mixed_block_flag != 0)\n bt = 4;\n gfc.bitrate_blockType_Hist[gfc.bitrate_index][bt]++;\n gfc.bitrate_blockType_Hist[gfc.bitrate_index][5]++;\n gfc.bitrate_blockType_Hist[15][bt]++;\n gfc.bitrate_blockType_Hist[15][5]++;\n }\n }\n }", "function addStats() {\r\n\r\n // Get the peak usage html element\r\n const peakUsageElem = document.evaluate(\"//span[@data-byte-format='telemeterCtrl.selectedPeriod.usage.peakUsage']\", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);\r\n // Get the exact amount used\r\n const peakUsage = parseFloat(peakUsageElem.singleNodeValue.textContent.substr(0, 6).replace(',', '.'));\r\n\r\n // Get current number of days usage\r\n const daysUsage = document.evaluate(\"count(//*[contains(@class, 'TelenetUsageDetails') and contains(@class, 'NoMobile')]//*[local-name()='g' and contains(@class, 'nv-group') and contains(@class, 'nv-series-0')]/*)\", document, null, XPathResult.NUMBER_TYPE, null).numberValue;\r\n\r\n // Get reset date\r\n const resetDateElem = document.evaluate(\"//span[@data-translate='telemeter.reset-volume']\", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.textContent.split(\" \");\r\n const resetDateString = resetDateElem[resetDateElem.length - 1];\r\n const dateParts = resetDateString.split(\"/\");\r\n const resetDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // dd/mm/yyyy\r\n\r\n // Calculate remaining days in current period\r\n const diffTime = Math.abs(resetDate - new Date());\r\n const remainingDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\r\n\r\n\r\n // Display new stats\r\n const currentPeriod = document.evaluate(\"//*[@class='currentPeriod']\", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\r\n \r\n var totalUsage = document.evaluate(\"//*[@class='currentusage']\", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\r\n totalUsage.setAttribute(\"style\", \"margin:12px\"); // extra styling :)\r\n const span = document.evaluate(\"//*[@class='currentusage']/span\", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\r\n\r\n // Get language preference\r\n const language = document.evaluate(\"//*[@class='lang-selected']/span\", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.textContent;\r\n \r\n const totalDays = daysUsage + remainingDays - 1;\r\n const peakHoursLimit = daysUsage * (750 / totalDays);\r\n displayStat(totalUsage, span, (language == \"nl\" ? \"Dag\" : \"Jour\"), daysUsage + \" / \" + totalDays);\r\n displayStat(totalUsage, span, (language == \"nl\" ? \"Piekuren\" : \"Heures pleines\"), Math.round(peakUsage) + \" GB / \" + Math.round(peakHoursLimit) + \" GB\");\r\n\r\n}", "function calc(){\r\n\"use strict\";\r\nnumPFail = (numFail/numTotalRuns)*100;\r\nnumP0 = (num0/numTotalRuns)*100;\r\nnumP1 = (num1/numTotalRuns)*100;\r\nnumP2 = (num2/numTotalRuns)*100;\r\nnumP3 = (num3/numTotalRuns)*100;\r\nnumP4 = (num4/numTotalRuns)*100;\r\nnumP5 = (num5/numTotalRuns)*100;\r\nnumRatePSB = numTotalPSB/numTotalRuns;\r\nnumRateRML = numTotalRML/numTotalRuns;\r\n}", "function calculatePrinting(order) {\n var printingCost = 0;\n var printingDescription = '';\n var li_printing = {};\n\n //Checking for simplex vs duplex. Also checking if a cover page is selected. The cover page should not be included in the sheet calculations. It is handled separately.\n if (order.printOnBothSides.enabled) {\n printingDescription += 'Duplex | ';\n if (order.frontCover.printOnCover == 'First page as cover') {\n nonCoverSheets = Math.ceil((totalPages - 1) / 2);\n } else {\n nonCoverSheets = Math.ceil(totalPages / 2);\n }\n } else {\n printingDescription += 'Simplex | ';\n nonCoverSheets = totalPages;\n if (order.frontCover.printOnCover == 'First page as cover') {\n nonCoverSheets = totalPages - 1;\n }\n }\n totalSheets = nonCoverSheets;\n\n //calculate/display color vs grayscale\n if (order.color.enabled) {\n printingDescription += 'Color Enabled | ';\n } else {\n printingDescription += 'Grayscale | ';\n colorPages = 0;\n grayscalePages = totalPages;\n }\n if (colorPages > 0) {\n printingDescription += 'Color Toner x ' + colorPages + (colorPages == 1 ? ' pg' : ' pgs') + ' [$' + (colorPages * ud_tonerColorCost).toString() + '] | ';\n printingCost += (colorPages * ud_tonerColorCost);\n }\n if (grayscalePages > 0) {\n printingDescription += 'B&W Toner x ' + grayscalePages + (grayscalePages == 1 ? ' pg' : ' pgs') + ' [$' + (grayscalePages * ud_tonerBWCost).toString() + '] | ';\n printingCost += (grayscalePages * ud_tonerBWCost);\n }\n\n //calculate/display paper stock selection\n printingDescription += order.paperStock.size + \", \" + order.paperStock.color + \", \" + order.paperStock.type + ' x ' + nonCoverSheets + (nonCoverSheets == 1 ? ' Sheet ' : ' Sheets ') + '[$' + (order.paperStock.cost * nonCoverSheets).toString() + ']' + ' | ';\n printingCost += (order.paperStock.cost * nonCoverSheets);\n\n //remove trailing '|' from printingDescription\n if (printingDescription.endsWith(' | ')) {\n printingDescription = printingDescription.slice(0, -3);\n }\n\n //Add the printing line item to items[]. Also add the printing cost to the total cost.\n li_printing = {\n name: 'Printing Costs (per copy)',\n description: printingDescription,\n cost: printingCost,\n style: 'OPTION_2'\n };\n itemsPerCopy.push(li_printing);\n perCopyTotal += printingCost;\n}", "doMath() {\n // Actual capacities\n const runningCap = this.props.workerType.runningCapacity;\n const pendingCap = this.props.workerType.pendingCapacity;\n const maxCap = this.props.workerType.maxCapacity;\n // We want to make sure that if a bar is there that it's visible\n const smallestCapUnit = maxCap * 0.05;\n // Fuzz the percentages to make sure all bars are visible. If we have a\n // state with 0%, we don't fuzz at all. If we have 1-4%, we round to 5%\n // and we don't fuzz above 5%\n const fuzzedRunning = runningCap\n ? Math.max(runningCap, smallestCapUnit)\n : 0;\n const fuzzedPending = pendingCap\n ? Math.max(pendingCap, smallestCapUnit)\n : 0;\n // Determine the number which we should use to figure out our percentages.\n // When we have less than the max configured, we use that setting. When we\n // exceed that amount, we want to sum up all the capacity units\n const count = fuzzedRunning + fuzzedPending;\n const divideBy = Math.max(maxCap, count);\n // Calculate the percentages to use for the bars. These numbers are\n // invalid for other purposes\n const runPer = fuzzedRunning / divideBy;\n const pendPer = fuzzedPending / divideBy;\n\n return {\n r: runPer * 100,\n p: pendPer * 100,\n rc: runningCap,\n pc: pendingCap\n };\n }", "function render_stats(i,n,render_speed) {\n d3.select(\"#rendered-count\").text(i);\n d3.select(\"#rendered-bar\")\n .style(\"width\", (100*i/n) + \"%\");\n d3.select(\"#render-speed\").text(render_speed);\n}", "handleCurrencyConversion() {\n let endpointURL = 'http://data.fixer.io/api/latest?access_key=b831ee4392d4f2acf242d71c8e9c0755&base=' \n + this.sellCurrencyValue + '&symbols=' + this.buyCurrencyValue;\n \n // calling apex class method to make callout\n getCurrencyData({strEndPointURL : endpointURL})\n .then(data => {\n\n window.console.log('jsonResponse ===> '+JSON.stringify(data));\n\n // retriving the response data\n let exchangeData = data['rates'];\n \n this.rate = exchangeData[this.buyCurrencyValue];\n\n if(this.rate && this.sellAmountValue){\n this.buyAmountValue = (this.sellAmountValue * this.rate).toFixed(2);\n } else {\n this.buyAmountValue = null;\n }\n\n })\n .catch(error => {\n window.console.log('callout error ===> '+JSON.stringify(error));\n })\n }", "function calculate() {\n const currency_one = currencyElOne.value;\n const currency_two = currencyElTwo.value;\n\n fetch(`https://v6.exchangerate-api.com/v6/05571b97af2fc7cf2f6ca10e/latest/${currency_one}`)\n .then(res => res.json())\n .then(data => {\n const rate = data.conversion_rates[currency_two];\n rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n\n amountElTwo.value = (amountElOne.value * rate).toFixed(2) });\n}", "function showPrintingDiagnostics() {\n showPrintingCropMarks();\n showPrintingDescription();\n showPrintingRulers();\n}", "function ReportService () {\n\tvar self = this;\n\t\n\tself.timing = 50;\n\t\n\tself.count = Game.cookiesd;\n\tself.cps = Game.cps;\n\tself.delta = 0;\n\tself.deltaBySecond = 0;\n\tself.index = 0;\n\tself.lastCount = 0;\n\tself.lastDelta = 0;\n\tself.lastCountBySecond = 0;\n\t\n\tself.subscribers = Array();\n\tself.reports = Array();\n\t\n\tself.tick = function() {\n\t\tsetTimeout(function(){\n\t\t\tself.refreshData();\n\t\t\tself.notifySubscribers();\n\t\t\tself.consoleReport();\n\t\t\tself.tick();\n\t\t}, self.timing);\n\t}\n\t\n\tself.subscribe = function(fn) {\n\t\tself.subscribers.push(fn);\n\t}\n\t\n\tself.addReport = function(fn) {\n\t\tself.reports.push(fn);\n\t}\n\t\n\tself.refreshData = function() {\n\t\tself.lastCount = self.count;\n\t\tself.count = Game.cookiesd;\n\t\tself.cps = Game.cookiesPs*(1-Game.cpsSucked);\n\t\tself.lastDelta = self.delta;\n\t\tself.delta = self.count - self.lastCount;\n\t\tself.index++;\n\t}\n\t\n\tself.notifySubscribers = function() {\n\t\tfor(var i = 0; i < self.subscribers.length; i++){\n\t\t\tself.subscribers[i]();\n\t\t}\n\t}\n\t\n\tself.getReports = function() {\n\t\tvar report = '';\n\t\tfor(var i = 0; i < self.reports.length; i++){\n\t\t\tvar curReport = self.reports[i]();\n\t\t\tif(curReport != ''){\n\t\t\t\treport = report + curReport;\n\t\t\t\tif(i < self.reports.length){\n\t\t\t\t\treport = report + '\\n';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn report;\n\t}\n\t\n\tself.consoleReport = function() {\n\t\t//Report every second\n\t\tif(self.index * self.timing % 1000 === 0){\n\t\t\tself.deltaBySecond = self.count - self.lastCountBySecond;\n\t\t\tself.lastCountBySecond = self.count;\n\t\t\tvar report = self.getReports();\n\t\t\tif(report != ''){\n\t\t\t\treport = '\\n' + report;\n\t\t\t}\n\t\t\tconsole.log('Cookies:\\t' + Beautify(self.count) + '\\nCPS:\\t\\t' + Beautify(self.cps) + '\\nDelta:\\t\\t' + Beautify(self.deltaBySecond) + report);\n\t\t}\n\t}\n\t\n\tself.tick();\n}", "function displaySpeed(speed) {\n\tlet returnSpeed = speed\n\tif(!isMetric()){\n\t\treturnSpeed = speed / 1.609\n\t}\n\t//rounding the speed\n\treturn Math.round(returnSpeed)\n}", "function genChart(){\n var colors=[\"#3366cc\",\"#dc3912\",\"#ff9900\",\"#109618\",\"#990099\",\"#0099c6\",\"#dd4477\",\"#66aa00\",\"#b82e2e\",\"#316395\",\"#994499\",\"#22aa99\",\"#aaaa11\",\"#6633cc\",\"#e67300\",\"#8b0707\",\"#651067\",\"#329262\",\"#5574a6\",\"#3b3eac\",\"#b77322\",\"#16d620\",\"#b91383\",\"#f4359e\",\"#9c5935\",\"#a9c413\",\"#2a778d\",\"#668d1c\",\"#bea413\",\"#0c5922\",\"#743411\"];\n var states=_.map($scope.data.states,function(runs,state){return state;});\n\n var session=_.map($scope.data.queries,\n function(v,key){return {\n \"name\":key,\n \"runs\":_.sortBy(v,state)\n }\n ;});\n var c=[];\n if(session.length){\n c=_.map(session[0].runs,function(run,index){\n var state=run.mode + run.factor;\n var pos=states.indexOf(state);\n // console.log(\"��\",state,pos);\n return colors[pos];\n });\n c=_.flatten(c);\n };\n var options={\n title:'BenchX: ' + $scope.benchmark.suite + \" \" + $scope.benchmark.meta.description,\n vAxis: {title: 'Time (sec)'}\n ,hAxis: {title: 'Query'}\n // ,legend: 'none'\n ,colors: c\n };\n return utils.gchart(session,options);\n\n }", "function drillConvert(orgName, contactPerson, contactNumber, email, amount, rate, type) {\n // Check if some of the non required fields are blank\n if (contactPerson == \"null\") {\n contactPerson = \"-\";\n }\n if (contactNumber == \"null\") {\n contactNumber = \"-\";\n }\n if (email == \"null\") {\n email = \"-\";\n }\n $(\"#pipeDrillDown\").hide();\n $(\"#conversionSummary\").hide();\n // Shows the won lost summary\n $(\"#wonLostDrillDown\").fadeIn(500, function () {\n var getDiv = document.getElementById(\"conversionSummary\");\n getDiv.innerText = type + \" Percentage is : \" + rate + \"%\";\n $(\"#conversionSummary\").show();\n });\n \n $(\"#drillTable\").show();\n $(\"#drillTable\").append(\"<div class='clear'>&nbsp;</div> <div class='reportLabel'>\" + orgName + \"</div> <div class='reportLabel'> \" + contactPerson + \"</div> <div class='reportLabel'> \" + contactNumber + \"</div> <div class='reportLabel'> \" + email + \"</div> <div class='amountLabel' id='drillamount'> $\" + amount.toLocaleString() + \"</div>\");\n}", "function printClickSpeed(){\n\t\n\t//////We need to load the constants file\n\tload(\"../MapReduceConstants.js\");\n\t\n\tvar db = connect(mongoPath);\n\tdb.auth(mongoUser,mongoPass);\n\n\tvar userBehaviourList = db.mouseBehaviour.find().toArray();\n\t\n\tprint(\"[\");\n\tfor (var i = 0; i < userBehaviourList.length; i++){\n\t\tmouseBehaviourItemList = userBehaviourList[i].value.clickSpeed;\n\t\t\n\t\tvar sid = userBehaviourList[i]._id.sid;\n\t\tvar url = userBehaviourList[i]._id.url;\n\n\t\tfor (var j = 0; j < mouseBehaviourItemList.length; j++){\n\t\t\tmouseBehaviourItem = mouseBehaviourItemList[j];\n\t\t\t\n\t\t\tmouseBehaviourItem.sid = sid;\n\t\t\tmouseBehaviourItem.url = url;\n\t\t\t\n\t\t\tprintjson(mouseBehaviourItem);\n\t\t\tprint(\",\");\n\t\t}\n\t}\n\tprint(\"]\");\n}", "function scanChart() {\r\n 'use strict';\r\n var i, j;\r\n if (app.documents.length < 1) { // stop if no document is opened.\r\n alert(loc_ScnChrtAlertNoDoc);\r\n return;\r\n }\r\n var origDoc = app.activeDocument;\r\n var samplerDoc = duplicateDocument(origDoc, localize(loc_ScnChrtSmplDoc), true);\r\n samplerDoc.info.source = localize(loc_ScnChrtSmplDocSrc, origDoc.name);\r\n samplerDoc.info.category = 'TextureMap';\r\n samplerDoc.flatten();\r\n if ((samplerDoc.mode === DocumentMode.BITMAP) ||\r\n (samplerDoc.mode === DocumentMode.CMYK) ||\r\n (samplerDoc.mode === DocumentMode.DUOTONE) ||\r\n (samplerDoc.mode === DocumentMode.GRAYSCALE) ||\r\n (samplerDoc.mode === DocumentMode.INDEXEDCOLOR)) {\r\n try {\r\n samplerDoc.changeMode(ChangeMode.RGB);\r\n } catch (e) {\r\n alert(localize(loc_ScnChrtAlertUnblCnv, ChangeMode.RGB));\r\n samplerDoc.close(SaveOptions.DONOTSAVECHANGES);\r\n return -1;\r\n }\r\n }\r\n app.activeDocument = samplerDoc;\r\n // stuff....\r\n var scannedValues = new Array(101);\r\n var n = 0;\r\n gLog.push(loc_ScnChrtTitleLog); //'Cell / Center / Color RGB:'\r\n\r\n var prgrsDlgTitle = localize(loc_prgsDlgAnlzTitle, gTitle);\r\n progress(scannedValues.length+1, prgrsDlgTitle); // Progress bar window\r\n for (j = 0; j < 10; j++) {\r\n for (i = 0; i < 10; i++) {\r\n scannedValues[n] = patch(i, j);\r\n progress.increment(); // update progressbar\r\n n++;\r\n }\r\n }\r\n\r\n progress.increment(); // update progressbar\r\n\r\n scannedValues[n] = patch(0, 10.0);\r\n var scannedGrayValues = grayValues(scannedValues);\r\n var normSamps = determineDynamicRange(scannedGrayValues);\r\n var curvePoints = []; // new Array();\r\n\r\n i = 0;\r\n for (j = 0; j < 14; j++) { // unfortunately PS allows only a few curve points\r\n var origPicVal = Math.floor(0.5 + (255.0 * j / 13.0));\r\n var mapToVal = findValueThatGives(origPicVal, normSamps);\r\n if (mapToVal >= 0) {\r\n curvePoints[i++] = [origPicVal, mapToVal];\r\n }\r\n }\r\n\r\n app.activeDocument = samplerDoc;\r\n if ((!gShowSamples) && (!gNoisy)) {\r\n samplerDoc.close(SaveOptions.DONOTSAVECHANGES);\r\n }\r\n\r\n app.activeDocument = origDoc;\r\n app.activeDocument.selection.deselect();\r\n if (gShowSamples) {\r\n app.activeDocument = samplerDoc;\r\n app.activeDocument.selection.deselect();\r\n }\r\n\r\n if (i < 2) {\r\n alert(loc_ScnChrtAlertNotVal);\r\n return -1;\r\n } else {\r\n if (verifyCurve(curvePoints) > 0) {\r\n if (!curveLayer(curvePoints)) {\r\n return -1;\r\n }\r\n app.activeDocument.activeLayer.name = gCurveName;\r\n app.activeDocument.activeLayer.visible = false;\r\n }\r\n }\r\n\r\n progress.close();\r\n //// progress bar\r\n return 0;\r\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 renderedStatsHTML(rcReport) {\n var stats = rcReport.stats;\n var finalHTML = \"\";\n Object.keys(stats).forEach(function(key) {\n finalHTML += STAT_RENDERERS[key](stats[key]);\n });\n return finalHTML;\n}", "function getExchangeRate() {\n const sourceCurrency = document.querySelector('.currency_convert_from').value;\n const destinationCurrency = document.querySelector('.currency_convert_to').value;\n\n const url = buildAPIUrl(sourceCurrency, destinationCurrency);\n fetchCurrencyRate(url);\n }", "getScreenshots(){\n this.conversion\n .on('filenames', filenames => console.log(`\\n ${this.fileName} Will generate 6 screenshots, ${filenames.join('\\n ')}`))\n .on('end', () =>{\n console.log(`\\n Screenshots for ${this.fileName} complete.\\n`)\n })\n .screenshots({\n count: 6,\n timestamps: [2, 5, '20%', '40%', '60%', '80%'],\n folder: this.outputPath,\n filename: `${this.fileName}-%s.png`\n })\n\n }", "function show_framerate() {\n if (timeRecords.frames.length < 2) {\n return;\n }\n var timeSpan = 5000,\n endPos = timeRecords.frames.length - 1,\n endTime = timeRecords.frames[endPos],\n startPos, startTime, fps, generate = 0, update = 0;\n for (startPos = endPos; startPos > 0; startPos -= 1) {\n if (endTime - timeRecords.frames[startPos] > timeSpan) {\n break;\n }\n generate += timeRecords.generate[startPos];\n update += timeRecords.update[startPos];\n }\n startTime = timeRecords.frames[startPos];\n timeSpan = endTime - startTime;\n fps = (endPos - startPos) * 1000 / timeSpan;\n generate /= (endPos - startPos);\n update /= (endPos - startPos);\n $('#timing-framerate').text(fps.toFixed(1));\n $('#timing-generate').text(generate.toFixed(1));\n $('#timing-update').text(update.toFixed(1));\n if (startPos > 1000) {\n timeRecords.frames.splice(0, startPos);\n timeRecords.generate.splice(0, startPos);\n timeRecords.update.splice(0, startPos);\n }\n }", "function updateBandwidth() {\n let bandwidthCoeff = bandwidthCtl.getValue() >=1 ? bandwidthCtl.getValue()/10: 1;\n bandwidth[0].value = bandwidthCoeff * 0.5;\n bandwidth[1].value = bandwidthCoeff * 4;\n bandwidthLabel.setHTML(`bandwidth: ${bandwidthCoeff}px`);\n }", "getCalculate() {\n const price = 100000 * this.#rom + 150000 * this.#ram;\n console.log(\n `The Price of Smartphone ${this.#name} with ROM ${this.#rom} GB and RAM ${\n this.#ram\n } GB is Rp ${price}`\n );\n }", "function updateStats() {\n\t$(\"#stats\").text(JSON.stringify(ozpIwc.metrics.toJson(),null,2));\n}", "function crusherGraph(obj) {\n Chart.defaults.global.animation.duration = 0;\n\n let crushers = obj.crushers;\n let crusherTotal = obj.crusherTotal;\n\n let section = document.querySelector('#crusher-sec');\n section.querySelectorAll('.chart-container canvas').forEach(x => x.remove());\n\n plotTime('#crusher-time', crushers);\n plotPerf('#crusher-perf', crushers);\n plotTime('#crusher-total-time', [crusherTotal], ['ALL CRUSHERS']);\n plotPerf('#crusher-total-perf', [crusherTotal], ['ALL CRUSHERS']);\n}", "function getRate()\r\n {\r\n return rate;\r\n }", "graph ({ width = 30 } = {}) {\n this.sample.normalize(this.adaptativePulseThreshold)\n\n const normalizedAdaptativePulseThreshold = this.sample.normalize(this.adaptativePulseThreshold)\n const graph = new Array(width).fill('').map((_, index) => {\n let char = ' '\n switch (index) {\n case Math.floor(this.normalizedValue * width): char = '█'; break\n case Math.floor(this.sample.normalizedMedian * width): char = '\\u001b[32m:\\u001b[37m'; break\n case Math.floor(normalizedAdaptativePulseThreshold * width): char = '\\u001b[31m|\\u001b[37m'; break\n }\n return char\n }).join('')\n\n const confidence = ((this.confidence * 100).toFixed(0) + '%').padStart(4, ' ')\n const ibi = (this.ibi + 'ms').padStart(11, ' ')\n const bpm = (this.bpm.toFixed(0) + 'bpm').padStart(6, ' ')\n return `${this.uid} | ${confidence} | ${ibi} | ${bpm} | ${graph} |`\n }", "function contentLiveReport() {\n\n if (arrLiveReports.length === 0) {\n $(\"#contentLiveReportPage\").html(`<div class=\"liveReportMsg\"> You must select at least one coin to receive Live Report. </div>`);\n }\n\n else {\n\n $(\"#contentLiveReportPage\").html(` <div id=\"chartContainer\" style=\"height: 300px; width: 100%;\"></div>`);\n waitLoad(\"chartContainer\");\n let arrCoinLive1 = [];\n let arrCoinLive2 = [];\n let arrCoinLive3 = [];\n let arrCoinLive4 = [];\n let arrCoinLive5 = [];\n let arrCoinNameLive = [];\n\n function getData() {\n \n $.ajax({\n\n type: \"GET\",\n url: `https://min-api.cryptocompare.com/data/pricemulti?fsyms=${arrLiveReports[0]},${arrLiveReports[1]},${arrLiveReports[2]},${arrLiveReports[3]},${arrLiveReports[4]}&tsyms=USD`,\n\n success: function (result) {\n\n let dateNow = new Date();\n let counter = 1;\n arrCoinNameLive = [];\n\n for (let key in result) {\n\n if (counter === 1) {\n arrCoinLive1.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 2) {\n arrCoinLive2.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 3) {\n arrCoinLive3.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 4) {\n arrCoinLive4.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 5) {\n arrCoinLive5.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n counter++;\n }\n\n createGraph();\n\n }\n\n })\n\n }\n \n stopIntervalId = setInterval(() => {\n getData();\n }, 2000);\n \n // function to create the graph //\n\n function createGraph() {\n\n const chart = new CanvasJS.Chart(\"chartContainer\", {\n exportEnabled: true,\n animationEnabled: false,\n\n title: {\n text: \"Favorite currencies\"\n },\n axisX: {\n valueFormatString: \"HH:mm:ss\",\n },\n axisY: {\n title: \"Coin Value\",\n suffix: \"$\",\n titleFontColor: \"#4F81BC\",\n lineColor: \"#4F81BC\",\n labelFontColor: \"#4F81BC\",\n tickColor: \"#4F81BC\",\n includeZero: true,\n },\n toolTip: {\n shared: true\n },\n legend: {\n cursor: \"pointer\",\n itemclick: toggleDataSeries,\n },\n data: [{\n type: \"spline\",\n name: arrCoinNameLive[0],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive1\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[1],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive2\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[2],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive3\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[3],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive4\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[4],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive5\n\n }]\n\n });\n\n chart.render();\n\n function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n }\n else {\n e.dataSeries.visible = true;\n }\n e.chart.render();\n }\n\n }\n\n }\n\n }", "renderSummary(ctx, data) {\n\t const { timeScale, visibleWindowTime } = globals.globals.frontendLocalState;\n\t const startPx = Math.floor(timeScale.timeToPx(visibleWindowTime.start));\n\t const bottomY = MARGIN_TOP + RECT_HEIGHT;\n\t let lastX = startPx;\n\t let lastY = bottomY;\n\t ctx.fillStyle = `hsl(${this.hue}, 50%, 60%)`;\n\t ctx.beginPath();\n\t ctx.moveTo(lastX, lastY);\n\t for (let i = 0; i < data.utilizations.length; i++) {\n\t // TODO(dproy): Investigate why utilization is > 1 sometimes.\n\t const utilization = Math.min(data.utilizations[i], 1);\n\t const startTime = i * data.bucketSizeSeconds + data.start;\n\t lastX = Math.floor(timeScale.timeToPx(startTime));\n\t ctx.lineTo(lastX, lastY);\n\t lastY = MARGIN_TOP + Math.round(RECT_HEIGHT * (1 - utilization));\n\t ctx.lineTo(lastX, lastY);\n\t }\n\t ctx.lineTo(lastX, bottomY);\n\t ctx.closePath();\n\t ctx.fill();\n\t }", "function getBufferBasedRate(r) {\n writeToLog('getBufferBasedRate() triggered!');\n var paramsObj = processQueryArgs(r);\n\n // If required args are not present in query, skip rate control\n if (!('bl' in paramsObj) || !('com.example-bmx' in paramsObj) || !('com.example-bmn' in paramsObj) || !('ot' in paramsObj)) {\n writeToLog('- missing \"bl\", \"com.example-bmx\", \"com.example-bmn\" or \"ot\" params, ignoring rate limiting..');\n return 0; // disables rate limiting\n }\n\n // If not video type, skip rate control\n if (paramsObj['ot'] != 'v' && paramsObj['ot'] != 'av') {\n writeToLog('- object is not video type, ignoring rate limiting..');\n return 0; // disables rate limiting\n }\n\n // To configure\n // var maxCapacityBitsPerS = 20 * 1000 * 1000; // bps\n\n var maxCapacityBitsPerS = 40 * 1000 * 1000; // 10c_Cascade\n // var maxCapacityBitsPerS = 80 * 1000 * 1000; // 20c_Cascade\n // var maxCapacityBitsPerS = 120 * 1000 * 1000; // 30c_Cascade\n\n // var maxCapacityBitsPerS = 25 * 1000 * 1000; // 4c_Cascade\n // var maxCapacityBitsPerS = 30 * 1000 * 1000; // 8c_Cascade_v1\n // var maxCapacityBitsPerS = 40 * 1000 * 1000; // 8c_Cascade\n // var maxCapacityBitsPerS = 60 * 1000 * 1000; // 12c_Cascade\n // var maxCapacityBitsPerS = 108 * 1000 * 1000; // 24c_Cascade\n // var maxCapacityBitsPerS = 144 * 1000 * 1000; // 32c_Cascade\n // var maxCapacityBitsPerS = 168 * 1000 * 1000; // 40c_Cascade\n // var maxCapacityBitsPerS = 180 * 1000 * 1000; // 48c_Cascade\n\n\n // Determine speed for nginx's limit_rate variable\n var speed; // bytes per s\n var maxCapacity = Math.round(maxCapacityBitsPerS / 8); // convert to bytes per s for njs limit_rate\n var cMin = maxCapacity * 0.1;\n var cMax = maxCapacity * 0.9;\n var bMin = Number(paramsObj['com.example-bmn']);\n var bMax = Number(paramsObj['com.example-bmx']);\n var bufferLength = Number(paramsObj['bl']);\n \n var bStarvation = ('bs' in paramsObj && (paramsObj['bs'].includes('true')));\n writeToLog('- Args: bufferLength: ' + bufferLength + ', bMin: ' + bMin + ', bMax: ' + bMax + ', bStarvation: ' + bStarvation);\n\n // Case 1: If client buffer is in danger\n if (bufferLength < bMin || bStarvation) {\n speed = cMax;\n writeToLog('- Case 1: Client buffer is in danger, rate control speed: ' + speed);\n }\n\n // Case 2: If client buffer is in excess\n else if (bufferLength > bMax) {\n speed = cMin;\n writeToLog('- Case 2: Client buffer is in excess, rate control speed: ' + speed);\n }\n\n // Case 3: If client buffer is in cushion zone\n else {\n var bRange = bMax - bMin;\n var cRange = cMax - cMin;\n speed = Math.round(((1 - ((bufferLength - bMin) / bRange)) * cRange) + cMin);\n writeToLog('- Case 3: Client buffer is in cushion zone, rate control speed: ' + speed);\n }\n\n return speed;\n}", "function refreshStats() {\n // const leftParity = calcParity(0, 5);\n // const middleParity = calcParity(3, 7);\n // const rightParity = calcParity(5, 10);\n // parityStatsDiv.innerText = `Left: ${leftParity} \\nMiddle: ${middleParity} \\nRight: ${rightParity}`;\n}", "function output(){\n $(\"#output-distance\").text(\"Distance: \"+tripDistance+\"km\");\n $(\"#output-vehicle\").text(\"Your Chosen Vehicle: \" + selectedVehicle.name);\n $(\"#output-days\").text(\"Days Travelling: \" + days.value);\n $(\"#output-charges\").text(\"Charges Needed: \" + chargeNumRounded);\n $(\"#output-total\").text(\"Total Cost: $\" + hireCost);\n }", "function main() {\n const allResults = [];\n fs.readdirSync(constants.OUT_PATH).forEach(siteDir => {\n const sitePath = path.resolve(constants.OUT_PATH, siteDir);\n if (!utils.isDir(sitePath)) {\n return;\n }\n allResults.push({site: siteDir, results: analyzeSite(sitePath)});\n });\n const generatedResults = groupByMetrics(allResults);\n fs.writeFileSync(\n GENERATED_RESULTS_PATH,\n `var generatedResults = ${JSON.stringify(generatedResults)}`\n );\n console.log('Opening the charts web page...'); // eslint-disable-line no-console\n opn(path.resolve(__dirname, 'index.html'));\n}", "convert() {\n return `${(this.payments.type.price[this.currencyType] / 100)}`;\n }" ]
[ "0.56859595", "0.5635288", "0.56152296", "0.55657244", "0.55223155", "0.54507864", "0.5379305", "0.53574294", "0.52907366", "0.52847356", "0.52658", "0.52355504", "0.5194467", "0.5193092", "0.5193092", "0.51879096", "0.51702565", "0.51645464", "0.5160962", "0.5138168", "0.51219827", "0.51169896", "0.50966936", "0.5089216", "0.5058393", "0.50529444", "0.50422055", "0.5041204", "0.50375754", "0.5036428", "0.5035645", "0.50334656", "0.5027909", "0.50247157", "0.5013367", "0.50120807", "0.5008107", "0.5007197", "0.5006942", "0.4996942", "0.49933973", "0.49900883", "0.49897632", "0.49845183", "0.4975137", "0.49613097", "0.49612603", "0.4960926", "0.49583808", "0.49472287", "0.494085", "0.49395484", "0.49349612", "0.49307767", "0.49271825", "0.4914351", "0.49066672", "0.49057978", "0.49021864", "0.49017498", "0.48970568", "0.489402", "0.4893482", "0.48875508", "0.48870432", "0.48845077", "0.48840263", "0.48795146", "0.48795146", "0.48779443", "0.48743072", "0.48660165", "0.48627916", "0.48506242", "0.48501194", "0.48481694", "0.48399147", "0.48334983", "0.4830564", "0.48248503", "0.4824618", "0.48231754", "0.48215488", "0.482123", "0.48171416", "0.481585", "0.4808801", "0.4807408", "0.48021084", "0.47961384", "0.4794882", "0.47929233", "0.4783648", "0.47797412", "0.47789285", "0.47757867", "0.47717127", "0.4765573", "0.47629052", "0.47624904", "0.47599813" ]
0.0
-1
This function gets deal amount for leads, opportunities, sales and lost opportunities
function getAmount() { $("#wonLostDrillDown").hide(); $("#pipeDrillDown").hide(); $("#drillTable").hide(); leadAmount = 0; oppAmount = 0; saleAmount = 0; var lostSaleAmount = 0; var allProspect = 0; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Iterate through the list items in the Invoice list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); // Sum up all deal amounts if (listItem.get_fieldValues()["_Status"] == "Lead") { leadAmount += parseFloat(listItem.get_fieldValues()["DealAmount"]); } if (listItem.get_fieldValues()["_Status"] == "Opportunity") { oppAmount += parseFloat(listItem.get_fieldValues()["DealAmount"]); } if (listItem.get_fieldValues()["_Status"] == "Sale") { saleAmount += parseFloat(listItem.get_fieldValues()["DealAmount"]); } if (listItem.get_fieldValues()["_Status"] == "Lost Sale") { lostSaleAmount += parseFloat(listItem.get_fieldValues()["DealAmount"]); } if (listItem.get_fieldValues()) { allProspect += parseFloat(listItem.get_fieldValues()["DealAmount"]); } var pipelineAmount = allProspect - lostSaleAmount; } showLeadAmount(leadAmount); showOppAmount(oppAmount); showSaleAmount(saleAmount); showLostAmount(lostSaleAmount); $('#chartArea').fadeIn(500, null); createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount); }, function () { alert("failure in get amount"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalSpent() {\n return this.meals().reduce(function(sum, meal) {\n return sum + meal.price;\n }, 0);\n }", "totalSpent() {\n return this.meals().reduce(function(sum, meal) {\n return sum + meal.price;\n }, 0);\n }", "totalSpent(){\n let sum = 0;\n for(const meal of this.meals()){\n sum += meal.price;\n }\n return sum;\n\n \n }", "function amountcommi()\n{\n for (var i=0; i<rentals.length;i++)\n {\n //Drivy take a 30% commission on the rental price to cover their costs.\n var commission= rentals[i].price *0.3;\n\n //insurance: half of commission\n rentals[i].commission.insurance = commission *0.5;\n\n //roadside assistance 1€ per day\n rentals[i].commission.assistance = getRentDays(rentals[i].pickupDate,rentals[i].returnDate) +1;\n\n //drivy takes the rest\n rentals[i].commission.drivy= commission - (rentals[i].commission.insurance + rentals[i].commission.assistance);\n }\n\n}", "forAllDays() {\n if (this.breakDown() !== 'No Information to display') {\n let totalCost = this.breakDown().reduce((acc, item) => acc += item.totalCost, 0)\n return totalCost || 0;\n }\n }", "totalSpent(){\n return this.meals().reduce((a,b)=>(a += b.price), 0);\n }", "function deductible(rentals)\n{\n for (var i = 0; i < rentals.length; i++)\n {\n if (rentals[i].options.deductibleReduction == true)\n {\n rentals[i].price += 4 * getDays(rentals[i].pickupDate, rentals[i].returnDate);\n }\n }\n}", "function totalCompensation(employees){\n return Number(employees.annualSalary) + Number(totalBonuses(employees));\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}", "getAmount(){ \n var totalAmount = (this.gallonsRequested * this.getPrice());\n\n return totalAmount;\n }", "calcTotal(){\n\t\t\tlet length = this.sales.length;\n\t\t\tthis.paidCommissionTotal = 0;\n\t\t\tthis.commissionTotal = 0;\n\t\t\tfor(let i = 0; i < length; ++i){\n\t\t\t\t\tthis.commissionTotal += this.sales[i].commission;\n\t\t\t\t\tif(this.sales[i].paid == true){\n\t\t\t\t\t\tthis.paidCommissionTotal += this.sales[i].commission;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tthis.sales.length;\n\t\t}", "function get_trades_total() {\n let total_trades = stories_data[current_story]\n .filter(x => x.PartnerISO == \"WLD\")\n .map(x => parseInt(x.Value))\n .reduce((x,y) => x + y);\n return total_trades;\n}", "totalSpent() {\n let prices = this.meals().map(\n function(meal) {\n return meal.price;\n }\n );\n\n return prices.reduce(\n function (total, price) {\n return total + price;\n }\n )\n\n }", "function customerNewSplitByDeal (closedDeals, lostDeals) {\n if (closedDeals.length > 0 && lostDeals.length > 0) {\n // Mapping all of the dealTypes into an array\n let dealArray = closedDeals.map(({ dealType }) => dealType)\n\n function removeNew (dealType) {\n return (dealType === 'Vertical Expansion' || dealType === 'Horizontal Expansion')\n }\n\n let arr = dealArray.filter(removeNew)\n\n return ((arr.length / dealArray.length) * 100).toFixed(2)\n } else {\n return 0\n }\n }", "function finalTotalAmountOfThisOrder()\n {\n return (nanCheck(parseFloat(subTotalWithoutShippingCost())) + nanCheck(parseFloat(shippingCostOfThisMainOrder()))).toFixed(2);\n }", "function amtCalc() {\n var amtExemption = Math.max( 0, getVar(federal.amt.maxExemption) - ( getVar(federal.amt.exemptionReductionRate) * (result.agi - getVar(federal.amt.exemptionPhaseOut)) ) );\n var taxableIncome = result.agi - amtExemption;\n var maxAmtLiability = (federal.amt.minRate * Math.min(federal.amt.breakpoint, taxableIncome))+(federal.amt.maxRate * Math.max(0, taxableIncome - federal.amt.breakpoint));\n return Math.max(0, maxAmtLiability - result.projected.federal);\n }", "getTournamentIncome() {\n var cnt = 0, i;\n for (i = 0; i < this.players.length; i++) \n if (this.players[i].paymentstatus == \"paid\") cnt++;\n \n return cnt * this.tournament.entryfee; \n }", "calculateOffer() {\n // reset variables\n let nOffer = 0;\n this.nCasesRemaining = 0;\n\n // iterate through all the cases and sum the values of the unopened cases\n this.casesArray.forEach(element => {\n if (!element.bOpened) {\n nOffer += element.nValue;\n this.nCasesRemaining++;\n }\n });\n\n // calculate the average of all unopened case values\n nOffer = nOffer / this.nCasesRemaining;\n\n // reduce the offer based on the number of cases remaining\n if (this.nCasesRemaining > 20 ) {\n nOffer = nOffer / 4;\n } else if (this.nCasesRemaining > 15) {\n nOffer = nOffer / 3;\n } else if (this.nCasesRemaining > 10) {\n nOffer = nOffer / 2;\n } \n\n // perform final offer calculations and return value\n nOffer *= INCENTIVE;\n nOffer = Math.round((nOffer + Number.EPSILON) * 100) / 100;\n this.nBankerOffer = nOffer;\n return nOffer;\n }", "function billsTotal(){\n totally = totalCall + totalSms;\n }", "function calculateBuy() {\n var bestTotalIndexBuy = -1;\n var bestMonthlyIndexBuy = -1;\n var bestTotalIndexLease = -1;\n var bestMonthlyIndexLease = -1;\n\n var iterLease = 0;\n var iterBuy = 0;\n\n //Process the Lease Modules in the array\n leaseModules.forEach(function(element) {\n //Initialize Parameters\n var monthlyPayment = 0;\n var total = 0;\n var downPayment = 0;\n\n //If there is no monthly payment, dont bother calculating\n if (element.monthlyPaymentInput.value == \"\") {\n element.total.innerHTML = \"-\";\n element.monthlyPayment.innerHTML = \"-\";\n return;\n }\n\n //Get monthly payment\n monthlyPayment = parseFloat(element.monthlyPaymentInput.value);\n\n //If theres a payment length, calculate the total and subtract the discounts\n if (element.paymentLength.value != \"\") {\n var total = parseFloat(element.monthlyPaymentInput.value) * parseFloat(element.paymentLength.value);\n //Subtract the discounts\n element.discounts.forEach(function(element1) {\n if (element1.value != \"\") {\n total = total - parseFloat(element1.value);\n }\n });\n\n //Check if total is negative, show an error if true\n if (total < 0) {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"LightCoral\";\n });\n element.total.innerHTML = \"Error: Discounts can't be more than total\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"white\";\n });\n }\n\n //If there is a downPayment, process it\n if (element.downPayment.value != \"\") {\n\n //If downpayment is in money\n if (element.downMoney.checked) {\n downPayment = parseFloat(element.downPayment.value);\n if ((total - downPayment) < 0) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment more than MSRP - Discounts\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n\n }\n\n //If downpayment is in percent of total\n else {\n if (parseFloat(element.downPayment.value) > 100) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n downPayment = total / 100 * parseFloat(element.downPayment.value);\n }\n }\n\n //If the three mile parameters are filled, process that\n if (element.allotedMiles.value != \"\" && element.mileCost.value != \"\" && element.averageMiles.value != \"\") {\n if (parseFloat(element.allotedMiles.value) < parseFloat(element.averageMiles.value)) {\n total = total + ((parseFloat(element.averageMiles.value) - parseFloat(element.allotedMiles.value)) * parseFloat(element.mileCost.value));\n }\n }\n\n //Calculate the monthly payment given the total and the paymentLength (instead of just monthly payment parameter)\n var monthlyPayment = total / parseFloat(element.paymentLength.value);\n }\n element.total.style.color = \"black\";\n element.monthlyPayment.style.color = \"black\";\n\n //If the total or monthlyPayment isn't 0, print it out (note total includes the down-payment where as the monthly payment does not)\n total = total + downPayment;\n if (total != 0) {\n element.total.innerHTML = \"$\" + total.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.total.innerHTML = \"-\";\n }\n if (monthlyPayment != 0) {\n element.monthlyPayment.innerHTML = \"$\" + monthlyPayment.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.monthlyPayment.innerHTML = \"-\";\n }\n\n //Determine if the current module now has the lowest total and/or monthly payment compared to other lease modules\n //If it is, store the index\n if (total != 0) {\n if (bestTotalIndexLease == -1) {\n bestTotalIndexLease = iterLease;\n } else if (total < parseFloat(leaseModules[bestTotalIndexLease].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestTotalIndexLease = iterLease;\n }\n }\n if (monthlyPayment != 0) {\n if (bestMonthlyIndexLease == -1) {\n bestMonthlyIndexLease = iterLease;\n } else if (monthlyPayment < parseFloat(leaseModules[bestMonthlyIndexLease].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestMonthlyIndexLease = iterLease;\n }\n }\n\n iterLease = iterLease + 1;\n\n });\n\n\n //Process all BUY modules\n buyModules.forEach(function(element) {\n //Initialize variables\n var total = 0.0;\n var monthlyPayment = 0.0;\n var downPayment = 0.0;\n var interest = 0.0;\n\n //If the MSRP is blank, dont bother calculating\n if (element.MSRP.value == \"\") {\n element.total.innerHTML = \"-\";\n element.monthlyPayment.innerHTML = \"-\";\n return;\n }\n\n //Get the MSRP\n var total = parseFloat(element.MSRP.value);\n\n //Subtract the discounts\n element.discounts.forEach(function(element1) {\n if (element1.value != \"\") {\n total = total - parseFloat(element1.value);\n }\n });\n\n //Check if total is negative, if it is show an error\n if (total < 0) {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"LightCoral\";\n });\n element.total.innerHTML = \"Error: Discounts can't be more than total\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"white\";\n });\n }\n\n //If there is a downpayment\n if (element.downPayment.value != \"\") {\n //If downpayment is in money\n if (element.downMoney.checked) {\n downPayment = parseFloat(element.downPayment.value);\n if ((total - downPayment) < 0) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment more than MSRP - Discounts\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n\n }\n //If downpayment is in percent of total\n else {\n if (parseFloat(element.downPayment.value) > 100) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n downPayment = total / 100 * parseFloat(element.downPayment.value);\n }\n }\n\n //If there is interest, calculate the amount of interest based on the total\n if (element.interest.value != \"\") {\n if (parseFloat(element.interest.value) > 100) {\n element.interest.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Interest cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n }\n element.interest.style.backgroundColor = \"white\";\n interest = (total / 100 * parseFloat(element.interest.value));\n }\n\n //Add the interst to the total\n total = total + interest;\n\n //If there is a payment length, calcualte the monthly payment\n if (element.paymentLength.value != \"\") {\n if (parseFloat(element.paymentLength.value) == 0) {\n element.paymentLength.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Payment length cannot be 0\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n monthlyPayment = (total - downPayment) / parseFloat(element.paymentLength.value);\n }\n }\n element.total.style.color = \"black\";\n element.monthlyPayment.style.color = \"black\";\n\n //If total/monthly payment isnt 0, display it\n if (total != 0) {\n element.total.innerHTML = \"$\" + total.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.total.innerHTML = \"-\";\n }\n if (monthlyPayment != 0) {\n element.monthlyPayment.innerHTML = \"$\" + monthlyPayment.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.monthlyPayment.innerHTML = \"-\";\n }\n\n //Compare total and monthly payment to see if it is the cheapest in the buy group\n if (total != 0) {\n if (bestTotalIndexBuy == -1) {\n bestTotalIndexBuy = iterBuy;\n } else if (total < parseFloat(buyModules[bestTotalIndexBuy].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestTotalIndexBuy = iterBuy;\n }\n }\n if (monthlyPayment != 0) {\n if (bestMonthlyIndexBuy == -1) {\n bestMonthlyIndexBuy = iterBuy;\n } else if (monthlyPayment < parseFloat(buyModules[bestMonthlyIndexBuy].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestMonthlyIndexBuy = iterBuy;\n }\n }\n\n iterBuy = iterBuy + 1;\n\n });\n //Determine if the lease or buy index is the smallest and set it to green\n //It will independently set the total and monthly payment to limegreen\n\n //Set to max int\n var bestTotalBuy = 9007199254740992;\n var bestTotalLease = 9007199254740992;\n var bestMonthlyBuy = 9007199254740992;\n var bestMonthlyLease = 9007199254740992;\n if (bestTotalIndexBuy != -1) {\n bestTotalBuy = parseFloat(buyModules[bestTotalIndexBuy].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestTotalIndexLease != -1) {\n bestTotalLease = parseFloat(leaseModules[bestTotalIndexLease].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestMonthlyIndexBuy != -1) {\n bestMonthlyBuy = parseFloat(buyModules[bestMonthlyIndexBuy].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestMonthlyIndexLease != -1) {\n bestMonthlyLease = parseFloat(leaseModules[bestMonthlyIndexLease].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n\n if (bestTotalLease < bestTotalBuy) {\n if (bestTotalIndexLease != -1) {\n leaseModules[bestTotalIndexLease].total.style.color = \"limegreen\";\n }\n } else {\n if (bestTotalIndexBuy != -1) {\n buyModules[bestTotalIndexBuy].total.style.color = \"limegreen\";\n }\n }\n\n if (bestMonthlyLease < bestMonthlyBuy) {\n if (bestMonthlyIndexLease != -1) {\n leaseModules[bestMonthlyIndexLease].monthlyPayment.style.color = \"limegreen\";\n }\n } else {\n if (bestMonthlyIndexBuy != -1) {\n buyModules[bestMonthlyIndexBuy].monthlyPayment.style.color = \"limegreen\";\n }\n }\n\n\n}", "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "getBonusAmount(){\n\t\tlet bonus = model.get('bonusDetails');\n\t\tlet amount, maxBonusAmount;\n\t\tif(bonus){\n\t\t\tamount = model.get('activeAmount') * Number(bonus.bonusFactor);\n\t\t\tmaxBonusAmount = bonus.maxDeposits * bonus.bonusFactor;\n\t\t}else{\n\t\t\treturn 'None added';\n\t\t}\n\n\t\tif(amount > maxBonusAmount){\n\t\t\treturn maxBonusAmount;\n\t\t}else{\n\t\t\treturn amount;\n\t\t}\n\n\t}", "function calculateReport()\n{\n for(var i=0; i<json.stock.length; i++)\n {\n invest[i]= json.stock[i].noofshare * json.stock[i].shareprice\n totalInvest += invest[i]\n }\n return invest;\n}", "function getFinancials(){\n let propertyValue = getPropertyValue();\n setTotal('overallSummarySoldProperties', formatCurrency(propertyValue));\n\n let goodsValue = getGoodsValue();\n setTotal('overallSummarySoldGoods', formatCurrency(goodsValue));\n\n let soldTotal = propertyValue + goodsValue;\n let formattedSoldTotal = formatCurrency(soldTotal);\n setTotal('overallSummarySoldTotal', formattedSoldTotal);\n\n let expensesValue = getTotalExpenses();\n setTotal('overallSummaryExpensesTotal', formatCurrency(expensesValue));\n\n let balance = (soldTotal - expensesValue);\n setTotal('overallSummaryBalance', formatCurrency(balance));\n}", "function calculDebitCredit () {\n for (var i = 0; i < deliveries.length; i++) {\n for (var j = 0; j < actors.length; j++) {\n if (deliveries[i].id == actors[j].deliveryId) {\n actors[j].payment[0].amount = deliveries[i].price;\n actors[j].payment[1].amount = deliveries[i].price - deliveries[i].commission.insurance - deliveries[i].commission.treasury - deliveries[i].commission.convargo;\n actors[j].payment[2].amount = deliveries[i].commission.insurance;\n actors[j].payment[3].amount = deliveries[i].commission.treasury;\n actors[j].payment[4].amount = deliveries[i].commission.convargo;\n }\n }\n }\n}", "getSellerTotal() {\n\t\treturn (this.props.listing.transactionTotal - this.props.listing.chargesTotal);\n\t}", "determineTotals(receipt) {\n let total = 0;\n receipt.inventories.forEach(inventory => {\n total += inventory.buyAmount;\n });\n return total;\n }", "calculateDenialRunningTotal(inventories) {\n let current = 0;\n return inventories.map(inventory => {\n if (inventory.isPayment) {\n current = current - inventory.amount;\n } else if (inventory.credited) {\n current = current - inventory.creditAmount;\n } else {\n current = current + inventory.rejectAmount;\n }\n inventory.rejectionRunningTotal = current;\n return inventory;\n });\n }", "function calcTotal() {\r\n // Get chosen package items\r\n var depFlight = JSON.parse(localStorage.getItem('departure'));\r\n var hotel = JSON.parse(localStorage.getItem('hotel'));\r\n var retFlight = JSON.parse(localStorage.getItem('return'));\r\n\r\n return parseInt(depFlight.price) + parseInt(hotel.price) + parseInt(retFlight.price);\r\n}", "function getDuracaoTotal(lead) {\n return new Date() - lead.dataOrigemLead;\n}", "function calLedgerTotalValues(){\n\tvar finalBillAmount=0;\n\tvar finalAmountPaid=0;\n\tvar finalCumulativeAmount=0;\n\tvar finalRecoveryAmount=0;\n\t\n\t$(\".BillAmountCls\").each(function(){\n\t\tfinalBillAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".AmountPaidCls\").each(function(){\n\t\tfinalAmountPaid+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".CumulativeAmountCls\").each(function(){\n\t\tfinalCumulativeAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".RecoveryAmountCls\").each(function(){\n\t\tfinalRecoveryAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\n\t$(\"#TotalBillAmount\").html(inrFormat(finalBillAmount.toFixed(2)));\n\t$(\"#TotalAmountPaid\").html(inrFormat(finalAmountPaid.toFixed(2)));\n\t$(\"#TotalRecoveryAmount\").html(inrFormat(finalRecoveryAmount.toFixed(2)));\n\t//$(\"#TotalCumulativeAmount\").html(finalCumulativeAmount.toFixed(2));\n}", "function calculatePaymentAmount(whom){\n\n\t\ttotkmamount = $('.total'+whom+'kmamount').val();\n\t\ttothramount = $('.total'+whom+'hramount').val();\n\t\tnoofdays=$('.daysno').val();\n\n\t\tif($('.'+whom+'kmpaymentpercentage option:selected').val()==-1){\n\t\t\tkmpaymentpercentage=0;\n\t\t}else{\n\t\t\tkmpaymentpercentage=Number($('.'+whom+'kmpaymentpercentage option:selected').text());\n\t\t}\n\n\t\tif($('.'+whom+'hrpaymentpercentage option:selected').val()==-1){\n\t\t\thrpaymentpercentage=0;\n\t\t}else{\n\t\t\thrpaymentpercentage=Number($('.'+whom+'hrpaymentpercentage option:selected').text());\n\t\t}\n\n\t\tif(totkmamount!='' && (tothramount!='' || Number(noofdays)>1) && kmpaymentpercentage!='' && hrpaymentpercentage!=''){\n\n\t\t\tkmcommsn=(Number(totkmamount)*(Number(kmpaymentpercentage)/100)).toFixed(2);\n\t\t\thrcommsn=(Number(tothramount)*(Number(hrpaymentpercentage)/100)).toFixed(2);\n\n\t\t}else{\n\t\t\tkmcommsn = 0;\n\t\t\thrcommsn = 0;\n\t\t}\n\n\t\tvar ownership = $('.ownership').val();\n\t\tvar driver_status_id = $('.driver_status').val();\n\t\tvar driverbata = $('.driverbata').val();\n\t\tvar nighthalt = $('.nighthalt').val();\n\n\t\tif(whom == 'driver'){\n\t\t\tif((ownership == OWNED_VEHICLE && driver_status_id == ATTACHED_DRIVER) || (ownership == ATTACHED_VEHICLE && driver_status_id == OWNED_DRIVER)) {\n\t\t\t\tkmcommsn = Number(kmcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\thrcommsn = Number(hrcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t}\n\t\t}else{\n\t\t\tif(ownership == ATTACHED_VEHICLE && driver_status_id == ATTACHED_DRIVER){\n\t\t\t\t//kmcommsn = Number(kmcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\t//hrcommsn = Number(hrcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\tkmcommsn = Number(kmcommsn);\n\t\t\t\thrcommsn = Number(hrcommsn);\n\t\t\t}\n\t\t}\n\t\n\t\n\n\n\t\t$('.'+whom+'paymentkmamount').val(kmcommsn);\n\t\t$('.'+whom+'paymenthramount').val(hrcommsn);\n\n\t}", "function getTotalAmount()\n {\n return ((getSubTotalByProductAmountAndQuantity() - getTotalDiscountAmount()).toFixed(2));\n }", "total() {\n return transactionObj.incomes() + transactionObj.expenses()\n }", "function calculateToBePaidTotal (currentBill) {\n var toBePaidTotal = 0;\n var paidTotal = 0;\n\n angular.forEach(currentBill.payments, function (value, key) {\n console.log(value);\n paidTotal += value.amount;\n });\n\n toBePaidTotal = parseFloat(currentBill.totalAmount) - parseFloat(paidTotal);\n\n return toBePaidTotal;\n }", "function getTotalAmountFinanced(){\n\t\treturn parseInt(localStorage.pSlider)-parseInt(localStorage.dPayment);\t\t\n\t}", "function calculateTotalExpenses(passedState) {\n console.log('calculateTotalExpenses ran.');\n // if state has been established, calculate total expenses\n if (Object.keys(passedState).length > 0) {\n let expenseTotal = 0;\n const getKeys = Object.keys(passedState);\n const getValues = Object.values(passedState);\n if (passedState[getKeys[0]][0] !== undefined) {\n for (let iterateIDs = 0; iterateIDs <= getValues.length - 1; iterateIDs++) {\n const getLengthOfExpenses = Object.keys(getValues[iterateIDs]).length;\n for (let iterateExpenses = 0; iterateExpenses <= getLengthOfExpenses - 1; iterateExpenses++) { // eslint-disable-line max-len\n expenseTotal += getValues[iterateIDs][`${iterateExpenses}`].expenseAmt;\n console.log(getValues[iterateIDs][`${iterateExpenses}`].expenseAmt);\n }\n }\n }\n return expenseTotal;\n } // else\n // if state is not yet a state array...\n return 0;\n }", "function totalExpenses(json) {\n // set total expenses variable which will be returned\n let total_expenses = 0;\n\n // Get the debit value from all transactions and add them together\n json.forEach(function (transaction) {\n if (parseFloat(transaction[\"Debit\"]) > 0){\n total_expenses += parseFloat(transaction[\"Debit\"]);\n }\n });\n\n return total_expenses;\n}", "function returnOftotals () {\n return {\n billCallTotal,\n billSMSTotal,\n billTotalTotal,\n currentValueOfCall,\n currentValueOfSMS,\n costWarning,\n costCritical,\n levels\n\n }\n }", "function totalBill()\n{\n var result = 0.00;\n\n for (var i = 0; i < outstandingBill.length; i++)\n {\n result += outstandingBill[i].cost;\n }\n\n //console.log(\"bill total = \" + result);\n return result;\n}", "function totalDeduc(monthlyIncome, insurance, dependents){\r\n \r\n var pagibig = (monthlyIncome*0.01375)*12; // calculates pagibig deduction\r\n var philhealth = (monthlyIncome* 0.035)*12; // calculates philhealth deduction\r\n \r\n var total = insurance + dependents + pagibig + philhealth + 50000; // calculates total deduction\r\n\r\nreturn total; //returns value for deductions\r\n}", "function hotelCost(numberOfDays) {\n var totalExpense = 0;\n if (numberOfDays <= 10) {\n totalExpense = numberOfDays * 100;\n }\n else if (numberOfDays <= 20) {\n var firstExpenditure = 10 * 100;\n var remainingDays = numberOfDays - 10;\n var secondExpenditure = remainingDays * 80;\n totalExpense = firstExpenditure + secondExpenditure;\n\n }\n else {\n firstExpenditure = 10 * 100;\n secondExpenditure = 10 * 80\n remainingDays = numberOfDays - 20;\n var LastExpenditure = remainingDays * 50;\n totalExpense = firstExpenditure + secondExpenditure + LastExpenditure;\n }\n\n return totalExpense;\n\n\n}", "calculateSpace()\n {\n\n return (this.getMaxBudget() - this.sumOfExpenses());\n }", "get totalDescendents() {\n let total = 0;\n\n total += this.numberOfOffspring;\n\n for (let offspring of this.offspring) {\n total += offspring.totalDescendents;\n }\n\n return total;\n }", "function getProjectExpenditure(transactions) {\n var expenses = 0;\n if (typeof transactions !== 'undefined') {\n\n if (transactions.length > 0) {\n transactions.forEach(function (transaction) {\n if ((typeof transaction['transaction-type']) !== 'undefined' && (transaction['transaction-type'].code === 'E' || transaction['transaction-type'].code == 4)) {\n expenses = expenses + parseFloat(transaction['value'].text);\n } else if ((typeof transaction['transaction-type']) !== 'undefined' && (transaction['transaction-type'].code === 'D' || transaction['transaction-type'].code == 3)) {\n expenses = expenses + parseFloat(transaction['value'].text);\n }\n });\n } else {\n if (typeof transactions === 'object') {\n if ((transactions['transaction-type'].code === 'E' || transactions['transaction-type'].code == 4))\n expenses = transactions['value'].text;\n } else {\n expenses = transactions['value'].text;\n }\n }\n }\n // console.log(expenses);\n\n return expenses;\n}", "function PO_Payment_and_billCredit_Amount(POID) {\n try {\n var Paytext = '';\n var PaidAmount = 0;\n var BillCreditAmount = 0;\n var UpdatePO = false;\n\n var POfilter = new Array();\n var POcolumn = new Array();\n\n POfilter.push(new nlobjSearchFilter('createdfrom', 'paidtransaction', 'anyOf', POID));\n\n POcolumn[0] = new nlobjSearchColumn('createdfrom', 'paidtransaction', 'group');\n POcolumn[1] = new nlobjSearchColumn('internalid', null, 'group');\n POcolumn[2] = new nlobjSearchColumn('trandate', null, 'group');\n POcolumn[3] = new nlobjSearchColumn('tranid', null, 'group');\n POcolumn[4] = new nlobjSearchColumn('paidamount', null, 'sum');\n POcolumn[5] = new nlobjSearchColumn('tranid', 'paidtransaction', 'group');\n\n var PO_BillPaymentResult = nlapiSearchRecord('transaction', 'customsearch_billpayment_withpobill', POfilter, POcolumn);\n\n if (PO_BillPaymentResult != null && PO_BillPaymentResult != '' && PO_BillPaymentResult != undefined)\n {\n for (var j = 0; j < PO_BillPaymentResult.length; j++)\n {\n var PaymentInternalId = PO_BillPaymentResult[j].getValue('internalid', null, 'group');\n nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'PaymentInternalId -->' + PaymentInternalId);\n\n var CheckNumber = PO_BillPaymentResult[j].getValue('tranid', null, 'group');\n //nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'CheckNumber -->' + CheckNumber);\n\n var TransactionDate = PO_BillPaymentResult[j].getValue('trandate', null, 'group');\n // nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'TransactionDate -->' + TransactionDate);\n\n var FinalPOID = PO_BillPaymentResult[j].getValue('createdfrom', 'paidtransaction', 'group');\n // nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'FinalPOID -->' + FinalPOID);\n\n var BillNo = PO_BillPaymentResult[j].getValue('tranid', 'paidtransaction', 'group');\n //nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'BillNo -->' + BillNo);\n\n PaidAmount = PO_BillPaymentResult[j].getValue('paidamount', null, 'sum');\n // nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'PaidAmount -->' + PaidAmount);\n\n var PaymentText = 'Paid with check ' + CheckNumber + '\\n' + 'inv. ' + BillNo + '\\n' + PaidAmount + '\\n' + TransactionDate;\n\n Paytext = Paytext + '\\n' + PaymentText;\n\n }\n UpdatePO = true;\n\n }\n\n var BillCredit_filter = new Array();\n var BillCredit_Column = new Array();\n\n BillCredit_filter.push(new nlobjSearchFilter('custbody_billcredit_linked_po', null, 'anyOf', POID));\n BillCredit_filter.push(new nlobjSearchFilter('mainline', null, 'is', 'T'));\n\n BillCredit_Column[0] = new nlobjSearchColumn('amount');\n BillCredit_Column[1] = new nlobjSearchColumn('internalid');\n BillCredit_Column[2] = new nlobjSearchColumn('memo');\n BillCredit_Column[3] = new nlobjSearchColumn('tranid');\n BillCredit_Column[4] = new nlobjSearchColumn('trandate');\n\n var PO_BillCreditResult = nlapiSearchRecord('vendorcredit', null, BillCredit_filter, BillCredit_Column);\n\n if (PO_BillCreditResult != null && PO_BillCreditResult != '' && PO_BillCreditResult != undefined) {\n for (var k = 0; k < PO_BillCreditResult.length; k++) {\n var BillCreditId = PO_BillCreditResult[k].getValue('internalid');\n nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'BillCreditId -->' + BillCreditId);\n\n var TranID = PO_BillCreditResult[k].getValue('tranid');\n //nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'TranID -->' + TranID);\n\n var trandate = PO_BillCreditResult[k].getValue('trandate');\n //nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'trandate -->' + trandate);\n\n var memo = PO_BillCreditResult[k].getValue('memo');\n // nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'memo -->' + memo);\n\n BillCreditAmount = PO_BillCreditResult[k].getValue('amount');\n // nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'BillCreditAmount -->' + BillCreditAmount);\n\n BillCreditAmount = (parseFloat(BillCreditAmount) * parseFloat((-1)))\n\n var PaymentText = 'Received ' + TranID + '-' + memo + '-' + BillCreditAmount + '-' + trandate;\n\n Paytext = Paytext + '\\n' + PaymentText;\n }\n UpdatePO = true;\n }\n\n if (UpdatePO == true) {\n var UpdatedPOID = nlapiSubmitField('purchaseorder', POID, 'custbodycheck_number', Paytext);\n nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'UpdatedPOID -->' + UpdatedPOID);\n\n }\n }\n catch (ex) {\n nlapiLogExecution('DEBUG', 'Link PO Payment Amount', 'Inner ex -->' + ex);\n\n }\n}", "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n prod3 = list[2].amount\n prod4 = list[3].amount\n\n itens = prod1 + prod2 + prod3 + prod4\n\n return itens\n }", "function getTotalThreat(){\n\t\tvar total = 0;\n\t\t/* Rate multiplier */\n\t\tswitch ( (amounts || defaultParams).rateMultiplier ){\n\t\t\tcase RateMultiplier.TIMES1:\n\t\t\t\tbreak;\n\t\t\tcase RateMultiplier.TIMES2:\n\t\t\t\ttotal += 10;\n\t\t\t\tbreak;\n\t\t\tcase RateMultiplier.TIMES4:\n\t\t\t\ttotal += 20;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn total;\n\t}", "function getDeposit() {\n return askMoney;\n }", "function findTotal() {\n monthlyTotal = 0;\n for (let employee of employeeInfo) {\n monthlyTotal += employee.annualSalary /12;\n\n }\n\n bleedingCash();\n\n}", "get saldo() {\n\t\treturn this.ingreso - this.deuda\n\t}", "function sumDealerPoints() {\n dealerPointTotal = cardsDealtDealer.reduce((pointTotal, cardParameter) => {\n return pointTotal + cardParameter.points;\n }, 0);\n console.log(dealerPointTotal);\n }", "total() {\n const rawTotal = this.rawTotal();\n const appliedDiscounts = this.getAppliedDiscounts();\n const discountTotal = this.discountSrv.total(appliedDiscounts);\n return rawTotal - discountTotal;\n }", "function getTotalDiscountAmountOfThisMainOrder()\n {\n return getDiscountAmountOfThisMainOrder(subTotalAmountOfThisOrder());\n }", "analyzeMerchantLoyalty(safetyTally){\n\n if(this.props.route.params.product.firstTranDateRange >= 365){\n safetyTally += 2;\n } \n if(this.props.route.params.product.firstTranDateRange >= 1095){\n safetyTally += 2;\n } \n\n return safetyTally;\n }", "function dispatchpartydetails_CalculateAmount()\r\n{\r\n\tvar tons = $(\"#dispatchpartydetails_tons\").val();\r\n\tvar rate = $(\"#dispatchpartydetails_rate\").val();\r\n\t/**\r\n\t * if any of one tons or rate will epty then set ammount as empty\r\n\t */\r\n\tif(common_isEmpty(tons) || common_isEmpty(rate))\r\n\t{\r\n\t\t$(\"#dispatchpartydetails_amount\").val(\"\");\r\n\t\treturn;\r\n\t}\r\n\r\n\t$(\"#dispatchpartydetails_amount\").val(parseInt(tons) * parseInt(rate));\r\n\t\r\n}", "async fetchTotalSupply() {\n const { result: { supply: { total } } } = await this.request(\n 'https://public-lcd2.akash.vitwit.com/supply/summary',\n );\n\n const record = total.find((item) => item.denom === 'uakt');\n\n return Number(record.amount) / 10 ** 6;\n }", "function get_ford_total(adtypes) {\n let breakdown = get_adtype_breakdown(adtypes);\n let total = 0;\n\n if (breakdown.classic > 0) {\n breakdown.classic = (Math.floor(breakdown.classic / 5) * 4) + (breakdown.classic % 5);\n }\n\n total += breakdown.classic * price.classic;\n total += breakdown.standout * price.standout_ford;\n\n if (breakdown.premium >= 3) \n total += breakdown.premium * price.premium_ford;\n else \n total += breakdown.premium * price.premium;\n\n return total;\n}", "total(){\n return Transaction.incomes() + Transaction.expenses();\n }", "incomes() {\n let income = 0;\n transactions.forEach(transaction => {\n if (transaction.amount > 0){\n income += transaction.amount;\n }\n })\n return income;\n }", "function indivMeal (ticket) {\n var sum = 0;\n for (var i = 0; i < ticket.length; i++){\n switch (ticket[i]) {\n case 'pasta':\n sum += 4.99;\n break;\n case 'burger':\n sum += 2.99;\n break;\n case 'pickles':\n sum += .49;\n break;\n case 'soda':\n sum += .99;\n break;\n }\n }\n mealSum += sum;\n return sum; //removes undefined from console\n}", "function calc_total(frm){\n\tvar total_cost = 0;\n\tcur_frm.doc.sold_waste_item.forEach(function(_){\n\t\ttotal_cost += _.amount\n\t});\n\tfrappe.model.set_value(cur_frm.doctype,cur_frm.docname, \"total\", total_cost)\n}", "function calulateFundingSourceTotalAmount(jqueryObject){\n\tvar $historyFundsDIV = jqueryObject.parents('div:eq(2)'); // other way use id\n\tvar amount = 0;\n\t$($historyFundsDIV).find(\".removableRow\").each(function(indexCounter){\n\t\tamount += getFormatedNumber( $(this).find(\".add_pmt_wd_d\").text() );\n\t} );\n\treturn amount;\n}", "get totalDescendents() {\n \n }", "function totalAmount(bill, service){\n switch(service){\n\n case'good':\n var tip = bill * .2;\n var total = bill + tip;\n totalAmt = total.toFixed(2)\n console.log(`Total Amount: ${totalAmt}`);\n break;\n \n case'fair':\n var tip = bill * .15;\n var total = bill + tip;\n totalAmt = total.toFixed(2)\n console.log(`Total Amount: ${totalAmt}`);\n break;\n\n case'poor':\n var tip = bill * .10;\n var total = bill + tip;\n totalAmt = total.toFixed(2)\n console.log(`Total Amount: ${totalAmt}`);\n break;\n\n default:\n console.log('That value is unknown please re-enter')\n } \n}", "function calculDeductible () {\n for (var i = 0; i < deliveries.length; i++) {\n if (deliveries[i].options.deductibleReduction == true) {\n deliveries[i].price += deliveries[i].volume\n deliveries[i].commission.convargo += deliveries[i].volume\n }\n }\n}", "function profitGenerated(days,clicks,rClick,renewingCost)\r\n{\r\n var nbo_generated = clicks * rClick;\r\n var nbo_eachDayCosts = ( (100-discountObtained()) * renewingCost / 100 ) / 30;\r\n var nbo_expenses = nbo_eachDayCosts * days;\r\n return (nbo_generated - nbo_expenses);\r\n}", "function hotelCost(daysStayed) {\n \n var bill = 0;\n\n if (daysStayed <= 10) {\n bill = daysStayed * 100;\n }\n\n else if (daysStayed <= 20) {\n var firstTenDays = 10 * 100;\n var remainingDays = daysStayed - 10;\n var secondTenDays = remainingDays * 80;\n bill = firstTenDays + secondTenDays;\n }\n\n else {\n var firstTenDays = 10 * 100;\n var secondTenDays = 10 * 80;\n var remainingDays = daysStayed - 20;\n var unlimitedDays = remainingDays * 50;\n bill = firstTenDays + secondTenDays + unlimitedDays;\n }\n\n return bill;\n}", "getTotalCalories(mealFoods) {\n let sumCalories = 0;\n for (let i = 0; i < this.state.activities.length; i++) {\n sumCalories += this.state.activities[i].calories;\n }\n return sumCalories;\n }", "function totalPay() {\n var google = 400;\n var amazon = 380;\n var facebook = 350;\n return ((google * 6) + (amazon * 4) + (facebook * 10));\n}", "total(){\n return operations.incomes() + operations.expenses()\n }", "calcAdjustedAmount(employee, expenseType, tags) {\n // log method\n logger.log(\n 4,\n 'calcAdjustedAmount',\n `Calculating adjusted budget amount for employee ${employee.id} and expense type ${expenseType.id}`\n );\n\n // compute method\n let result;\n\n if (this.hasAccess(employee, expenseType)) {\n // default budget if employee is not in a budgeted tag\n let budgetAmount = expenseType.budget;\n\n if (expenseType.tagBudgets && expenseType.tagBudgets.length > 0) {\n let foundHighestPriorityTag = false;\n _.forEach(expenseType.tagBudgets, (tagBudget) => {\n _.forEach(tagBudget.tags, (tagId) => {\n let tag = _.find(tags, (t) => t.id === tagId);\n if (tag) {\n if (tag.employees.includes(employee.id) && !foundHighestPriorityTag) {\n // employee is included in a tag with a different budget amount\n foundHighestPriorityTag = true;\n budgetAmount = tagBudget.budget;\n }\n }\n });\n });\n }\n\n if (!expenseType.proRated) {\n result = budgetAmount;\n } else {\n result = Number((budgetAmount * (employee.workStatus / 100.0)).toFixed(2));\n }\n } else {\n result = 0;\n }\n\n // log result\n logger.log(4, 'calcAdjustedAmount', `Adjusted budget amount is $${result}`);\n\n // return result\n return result;\n }", "function calculCommission () {\n for (var i = 0; i < deliveries.length; i++) {\n var commission = deliveries[i].price * 0.3;\n deliveries[i].commission.insurance = commission / 2;\n deliveries[i].commission.treasury = Math.floor(deliveries[i].distance/500) + 1\n deliveries[i].commission.convargo = commission - deliveries[i].commission.insurance - deliveries[i].commission.treasury\n }\n}", "function getAmtInWords(total, currencyId, ISOCode) {\n\tvar data = total.toString().split(\".\");\n\t//nlapiLogExecution('DEBUG','results','data ='+data[0]);\n\n\tvar str = \"\";\n\tvar str1 = \"\";\n\tvar word = \"\";\n\n\tif (currencyId == 1 && ISOCode == 'INR') //If currency is Indian Rupee & ISOCode is PKR\n\t{\n\t\t//Above Line Commented on 10th May 2017 as Decision took by Kiran Sir while Execution PDF is Going on After Visions Feedback on PDF.\n\t\tstr = \"\tIndian Rupees \" + convert_number(data[0]) + \" Only\";\n\t\tif (Number(data[1]) > 0) {\n\t\t\tstr1 = \" and Paise \" + convert_number(data[1]) + \" Only\";\n\t\t}\n\t} else if (currencyId == 2 && ISOCode == 'USD') //If currency is US Dollar & ISOCode is USD\n\t{\n\t\tstr = \"US Dollars \" + convert_number(data[0]) + \" Only\";\n\t\tif (Number(data[1]) > 0) {\n\t\t\tstr1 = \" and Cents \" + convert_number(data[1]) + \" Only\";\n\t\t}\n\t} else if (currencyId == 3 && ISOCode == 'CAD') // If currency is Canadian Dollar & ISOCode is CAD\n\t{\n\t\tstr = \"Canadian Dollars \" + convert_number(data[0]) + \" Only\";\n\t\tif (Number(data[1]) > 0) {\n\t\t\tstr1 = \" and Cents \" + convert_number(data[1]) + \" Only\";\n\t\t}\n\t} else if (currencyId == 4 && ISOCode == 'EUR') //If currency is Euro & ISOCode is EUR\n\t{\n\t\tstr = \"Euros \" + convert_number(data[0]) + \" Only\";\n\t\tif (Number(data[1]) > 0) {\n\t\t\tstr1 = \" and Cents \" + convert_number(data[1]) + \" Only\";\n\t\t}\n\t} else if (currencyId == 5 && ISOCode == 'GBP') //If currency is British pound & ISOCode is GBP\n\t{\n\t\tstr = \"British Pounds \" + convert_number(data[0]) + \" Only\";\n\t\tif (Number(data[1]) > 0) {\n\t\t\tstr1 = \" and Pence \" + convert_number(data[1]) + \" Only\";\n\t\t}\n\t} else if (currencyId == 6 && ISOCode == 'SGD') //If currency is Singapore Dollar & ISOCode is SGD\n\t{\n\t\tstr = \"Singapore Dollars \" + convert_number(data[0]) + \" Only\";\n\t\tif (Number(data[1]) > 0) {\n\t\t\tstr1 = \" and Cents \" + convert_number(data[1]) + \" Only\";\n\t\t}\n\t}\n\n\tword = str + str1;\n\n\tnlapiLogExecution('Debug', 'word==>>', word);\n\treturn word;\n} //function getAmtInWords(total, currencyId, ISOCode)", "function getDealerValue(){\n\tvar DealerValue = 0;\n\tvar amountAce = 0;\n\tfor (var i = 0; i < dealerHand.length; i++){\n\t\tif (amountAce == 0){\n\t\t\tif (dealerHand[i].number == 'ace'){\n\t\t\t\tamountAce = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tDealerValue = DealerValue + dealerHand[i].value;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tDealerValue = DealerValue + dealerHand[i].value;\n\t\t}\n\t}\n\tif(amountAce == 1){\n\t\tif(DealerValue <= 10){\n\t\t\tDealerValue = DealerValue + 11;\n\t\t}\n\t\telse{\n\t\t\tDealerValue = DealerValue + 1;\n\t\t}\n\t}\n\treturn DealerValue;\n}", "AI_ScoreTradeOffer( deal ) { \n\t\t// what they are offering us\n\t\tlet our_score = 0;\n\t\tfor ( let i of deal.offer ) {\n\t\t\ti.score = this.AI_ScoreTradeItem(i,deal.from);\n\t\t\tour_score += i.score;\n\t\t\t// console.log(`OFFERING: ${i.score} for ${i.label}`);\n\t\t\t}\n\t\t// what they are asking for\n\t\tlet their_score = 0;\n\t\tfor ( let i of deal.ask ) {\n\t\t\ti.score = this.AI_ScoreTradeItem(i,deal.from);\n\t\t\ttheir_score += i.score;\n\t\t\t// console.log(`ASKING: ${i.score} for ${i.label}`);\n\t\t\t}\n\t\t// better deals for better relationships\n\t\ttheir_score *= 0.75 + this.LoveNub(deal.from) * 0.5;\n\t\t// more likely to say yes if attention span is high\n\t\ttheir_score *= utils.Clamp( 0.25 + deal.from.diplo.contacts.get(deal.to).attspan, deal.to.diplo.focus, 1 );\n\t\t// what would it take to make us say yes?\n\t\tdeal.raw_diff = our_score - their_score;\n\t\t// the score is positive or negative depending on how it is viewed. \n\t\t// we cannot use a simple ratio which is always positive.\n\t\tlet our_score_norm = our_score / (our_score + their_score);\n\t\tlet their_score_norm = their_score / (our_score + their_score);\n\t\tlet score = our_score_norm - their_score_norm;\n\t\t// console.log(`TRADE SCORE: ${our_score_norm} - ${their_score_norm} = ${score} `);\n\t\tdeal.offer_score = our_score;\n\t\tdeal.ask_score = their_score;\n\t\tdeal.total_score = Math.abs( their_score ) + Math.abs( our_score );\n\t\tdeal.importance = Math.sqrt( deal.total_score );\n\t\tdeal.score = score;\n\t\treturn score;\n\t\t}", "sumOfExpenses()\n {\n let sum = 0;\n\n for(let b of this.getExp())\n {\n sum+=b;\n }\n\n return (Math.round(sum*100)/100);\n }", "function expBudget(){\n var expSum = 0;\n for (i=0;i<expInput.length;i++){\n expSum += parseInt(expInput[i].value);\n }\n document.querySelector('#expense-budget').innerHTML = 'Expense Budget:<br>'+ expSum + ' $';\n return expSum\n }", "updateInvestmentDetails() {\n\t\tif (\"SecurityInvestment\" === this.transaction.transaction_type) {\n\t\t\t// Base amount is the quantity multiplied by the price\n\t\t\tthis.transaction.amount = (Number(this.transaction.quantity) || 0) * (Number(this.transaction.price) || 0);\n\n\t\t\t// For a purchase, commission is added to the cost; for a sale, commission is subtracted from the proceeds\n\t\t\tif (\"inflow\" === this.transaction.direction) {\n\t\t\t\tthis.transaction.amount += Number(this.transaction.commission) || 0;\n\t\t\t} else {\n\t\t\t\tthis.transaction.amount -= Number(this.transaction.commission) || 0;\n\t\t\t}\n\t\t}\n\n\t\t// If we're adding a new buy or sell transaction, update the memo with the details\n\t\tif (!this.transaction.id && \"SecurityInvestment\" === this.transaction.transaction_type) {\n\t\t\tconst\tquantity = Number(this.transaction.quantity) > 0 ? String(this.transaction.quantity) : \"\",\n\t\t\t\t\t\tprice = Number(this.transaction.price) > 0 ? ` @ ${this.currencyFilter(this.transaction.price)}` : \"\",\n\t\t\t\t\t\tcommission = Number(this.transaction.commission) > 0 ? ` (${\"inflow\" === this.transaction.direction ? \"plus\" : \"less\"} ${this.currencyFilter(this.transaction.commission)} commission)` : \"\";\n\n\t\t\tthis.transaction.memo = quantity + price + commission;\n\t\t}\n\t}", "function calculateTravelExpense(user) {\n var beginningMileageId = \"#field_225\" ;\n var endingMileageId = \"#field_226\";\n var amountId= \"#field_222\";\n var tollsId = \"#field_252\";\n var expSourceCodeId = \"#field_250\";\n var dailyMileageDeduct = \"#field_267\";\n var maxExpense = 1000;\n var mileageDeduct = 40;\n var tolls = utils.getNum(tollsId);\n var mileageRate = user ? getMileageRateByUser() : getMileageRateUsingForm() ;\n var deduct = $(dailyMileageDeduct).val() == \"No\"? 0 : mileageRate * mileageDeduct ;\n var totalMiles = utils.getNum(endingMileageId) - utils.getNum(beginningMileageId) ;\n var total = totalMiles > 40 ? +(totalMiles * mileageRate) - deduct + tolls : tolls;\n\n total = total < 0 ? 0 : total ;\n total = total > maxExpense ? 0 : total ;\n if ( tolls > 0 || $(endingMileageId).val().length > 0) {\n $(amountId).val(total.toFixed(2) );\n $(amountId).prop('disabled', true);\n } else {\n $(amountId).prop('disabled', false);\n }\n }", "getTotalPayment() {\n let total = 0;\n this.operations.forEach(op => {\n total += op.amount;\n });\n return total;\n }", "function extractDiscountsData(obj) {\n obj = _.isDefined(obj) ? obj : $cart || {};\n var obj_discounts = Array.isArray(obj.discounts) ? obj.discounts : ( (typeof obj.discounts === \"object\") && (obj.discounts !== null) ? obj.discounts : {} );\n return _.map(obj_discounts, function (code, discount) {\n discount.display = discount.display && (discount.display == 1 && 'code') || (discount.display == 2 && 'name') || null;\n if (discount.type === 'deduction') {\n discount.applicable_value = discount.value;\n if (discount.applied_value === discount.applicable_value) {\n\n } else if (discount.applicable_value > discount.applied_value) {\n discount.remaining_value = discount.applicable_value - discount.applied_value;\n } else {\n discount.remaining_value = 0;\n }\n\n obj.discountRemaining += discount.remaining_value;\n } else {\n discount.applicable_value = discount.remaining_value = null;\n }\n\n\n return discount;\n });\n }", "function calcAmount(){\n\n var price = orig_price * parseInt( $('[name=\"quantity\"]').val() );\n var pledge_amount = price;\n var tip_amount_percent = $('#add_gift_box').val();\n\n if( tip_amount_percent === 'other' ){\n\n var tip = $('#add_gift_box2-display').val();\n\n if( tip == '' || tip == '.00' ){\n tip = 0;\n }\n \n price += parseFloat( tip );\n }\n else{\n\n price = ( ( price * parseInt(tip_amount_percent) ) / 100 ) + price; \n }\n\n $('.donation-box__title').text('$' + pledge_amount.toFixed(2));\n\n return price.toFixed(2);\n }", "function calculatePaidTotal (currentBill) {\n var paidTotal = 0;\n\n angular.forEach(currentBill.payments, function (value, key) {\n paidTotal += value.amount;\n });\n\n return paidTotal;\n }", "function investDirectly(borrowers){\n var postObj={};\n var loan=[];\n var brwrLoan;\n var totAmt = 0;\n\n for(var i in borrowers){\n brwrLoan = {};\n brwrLoan.loan_code = borrowers[i].loan_code;\n brwrLoan.invest_amount = borrowers[i].selected_amount;\n totAmt+=borrowers[i].selected_amount;\n loan.push(brwrLoan);\n }\n postObj.total_amount = totAmt;\n postObj.loans = loan;\n\n dataservice.postData(INVEST_API, postObj, config).then(function(data, status) {\n if (data) {\n if (data.status) {\n checkForUserProfile();\n }\n }\n }, function() {\n \n });\n }", "function billTotal(food,drinks){\n var price = food + drinks;\n return price + price*(15/100) + price*((9.5)/100) ;\n}", "function calcAmount(){\n\n var price = orig_price * parseInt( $('[name=\"quantity\"]').val() );\n var pledge_amount = price;\n var tip_amount_percent = $('#add_gift_box').val();\n\n if( tip_amount_percent === 'other' ){\n\n var tip = $('#add_gift_box2-display').val();\n\n if( tip == '' || tip == '.00' ){\n tip = 0;\n }\n \n price += parseFloat( tip );\n }\n else{\n\n price = ( ( price * parseInt(tip_amount_percent) ) / 100 ) + price; \n }\n\n // if( pledge_amount > orig_price || pledge_amount == 0 ){\n // $('.__per_family_or_student').text( '$' + orig_price.toFixed(2) + ' ' + orig_per_text );\n // }\n // else{\n // $('.__per_family_or_student').text( orig_per_text );\n // }\n\n $('.donation-box__title').text('$' + pledge_amount.toFixed(2));\n\n return price.toFixed(2);\n }", "function getPromoAmount() {\n\tvar promoCodeAmount = 0;\n\tif(bp_validate_promo_code_obj){\n\t\tpromoCodeAmount = bp_validate_promo_code_obj.promoCodeAmount;\t\n\t}\n\tif(promoCodeAmount) {\n\t\treturn promoCodeAmount;\n\t}\n\treturn 0;\n}", "function calculateCashLeftOverEachWeek(){\n var cashLeftoverEachWeek = weeklyIncome-weeklyExpenses; \n console.log(\"You will have $\"+cashLeftoverEachWeek+\" left over per week\");\n}", "function calculate_total(){\n total_value = 0;\n income_value =0;\n expense_value = 0;\n for (each in cookie_data){\n if(each === 'count'){\n continue;\n }\n if(cookie_data[each].type === 'income'){\n total_value += Number(cookie_data[each].amount);\n income_value += Number(cookie_data[each].amount)\n }else{\n total_value -= Number(cookie_data[each].amount);\n expense_value += Number(cookie_data[each].amount);\n }\n }\n\n transfer_value_holder.innerText = total_value;\n income_value_holder.innerText = income_value;\n expense_value_holder.innerText = expense_value;\n}", "get itemTotalAfterDiscount() {\n if (this.product && this.product.itemTotalAfterDiscount) {\n return this.product.itemTotalAfterDiscount;\n }\n return null;\n }", "amt_of(item) { }", "daysRemaining(){\n for(let booking of this._booking){\n this.holidayAllowance-=booking.numberOfDays();\n }\n return this.holidayAllowance;\n }", "function deliveryCost(totalDelivery){\n const firstHundredDeliveryCost = 100;\n const secondHundredDeliveryCost = 80;\n const overSecondHundredDeliveryCost = 50;\n if (totalDelivery <0 ){\n return \"Please enter a positive number\";\n }\n else if (totalDelivery <= 100 && totalDelivery >= 0){\n const count = totalDelivery * firstHundredDeliveryCost;\n return count;\n } else if (totalDelivery > 100 && totalDelivery <=200){\n const firstHundredDelivery = 100 * firstHundredDeliveryCost;\n const restDelivery = totalDelivery - 100;\n const secondHundredDelivery = restDelivery * secondHundredDeliveryCost;\n const finalDeliveryCost = firstHundredDelivery + secondHundredDelivery;\n return finalDeliveryCost;\n } else{\n const firstHundredDelivery = 100 * firstHundredDeliveryCost;\n const secondHundredDelivery = 100 * secondHundredDeliveryCost;\n const restDelivery = totalDelivery - 200;\n const overSecondHundredDelivery = restDelivery * overSecondHundredDeliveryCost;\n const finalDeliveryCost = firstHundredDelivery + secondHundredDelivery + overSecondHundredDelivery;\n return finalDeliveryCost;\n }\n}", "function checkout(item1, item2, coupon) {\n var subtotal = item1 + item2;\n var couponAmount = subtotal * coupon;\n var total = subtotal - couponAmount;\n var taxRate = total * 0.095;\n var total = total + taxRate;\n total = total.toFixed(2);\n return total;\n //return total;\n //console.log(\"Total amount due is \" + total);\n //return total;\n}", "getAmount() {\n let amount = document.querySelector(\n \"[name='transaction.donationAmt']:checked\"\n );\n if (amount.value == \"Other\" || amount.value == \"\") {\n let otherAmount = parseFloat(\n document.querySelector('input[name=\"transaction.donationAmt.other\"]')\n .value\n );\n return isNaN(otherAmount) ? 0 : otherAmount;\n }\n return parseFloat(amount.value);\n }", "total () {\n\t\treturn this.subtotal() - this.discounts();\n\t}", "function test_even_expense_debts() {\n\n let expense = new EvenExpense_1.EvenExpense(5, \"cat\", \"test\");\n\n let person1 = new Person_1.Person(1, \"Person 1\", \"\");\n let person2 = new Person_1.Person(2, \"Person 2\", \"\");\n let person3 = new Person_1.Person(3, \"Person 3\", \"\");\n\n let payment1 = new Payment_1.Payment(-1, person1, 2);\n let payment2 = new Payment_1.Payment(-1, person2, 4);\n let payment3 = new Payment_1.Payment(-1, person3, 9);\n\n expense.addPayment(payment1);\n expense.addPayment(payment2);\n expense.addPayment(payment3);\n\n // let payments = Array.from(expense.payments.values());\n // payments.forEach(p => console.log(p.creditor.firstName + \" payed \" + p.amount.toFixed(2)));\n\n console.log(\"Debts\");\n let debts = Array.from(expense.debts.values());\n debts.forEach(d => console.log(d.debtor.firstName + \" owes \" + d.creditor.firstName + \" \" + d.amount.toFixed(2)));\n\n console.log(expense.expenseAmount)\n\n}", "function changeExpenseValues(objectInfo) {\n switch (objectInfo.paymentmode) {\n case '1':// paid\n objectInfo.paidamount = objectInfo.expense_amount;\n objectInfo.outstandingamount = utils.isNotEmptyVal(objectInfo.expense_amount) ? 0 : null;\n break;\n case '2': // Unpaid\n objectInfo.outstandingamount = objectInfo.expense_amount;\n objectInfo.paidamount = utils.isNotEmptyVal(objectInfo.expense_amount) ? 0 : null; // \n break;\n case '3':// Partial\n if (utils.isNotEmptyVal(objectInfo.paidamount) && utils.isNotEmptyVal(objectInfo.expense_amount)) {\n // objectInfo.outstandingamount = (parseFloat(objectInfo.expense_amount) - parseFloat(objectInfo.paidamount)).toFixed(2);\n objectInfo.outstandingamount = (parseFloat(objectInfo.expense_amount) - parseFloat(objectInfo.paidamount));\n\n }\n else {\n if (utils.isNotEmptyVal(objectInfo.expense_amount)) {\n objectInfo.outstandingamount = objectInfo.expense_amount;\n }\n else {\n objectInfo.outstandingamount = utils.isNotEmptyVal(objectInfo.paidamount) ? -objectInfo.paidamount : null;\n }\n }\n break;\n }\n }", "getDamageAmount() {\n return 0.1 + this.operators.reduce((acc, o) => (acc + o.experience), 0);\n }" ]
[ "0.627752", "0.627752", "0.6138144", "0.6107445", "0.6082965", "0.6076039", "0.60117716", "0.59998304", "0.59753764", "0.5949133", "0.59258074", "0.5918761", "0.59184986", "0.59025747", "0.5894164", "0.5879869", "0.5876208", "0.58450013", "0.5844477", "0.5844288", "0.5838463", "0.5833292", "0.58284503", "0.5827362", "0.57939076", "0.5779975", "0.5777751", "0.57753783", "0.57610285", "0.5744959", "0.57365423", "0.5734291", "0.5731119", "0.5729848", "0.57268", "0.57072634", "0.5695114", "0.5681504", "0.5677089", "0.5671438", "0.56709933", "0.566123", "0.56596947", "0.56533325", "0.56381124", "0.5636945", "0.56264937", "0.5626396", "0.55934703", "0.5572917", "0.5567555", "0.55665547", "0.55620617", "0.5548349", "0.5547595", "0.5543508", "0.55340374", "0.55300015", "0.55251896", "0.5523823", "0.55164015", "0.55154663", "0.55152625", "0.5505526", "0.55017203", "0.54979795", "0.5494117", "0.549255", "0.5491718", "0.54793215", "0.5479291", "0.5472063", "0.5464365", "0.5458645", "0.54584664", "0.5449407", "0.54451454", "0.5444976", "0.54448503", "0.5442375", "0.54423106", "0.54353863", "0.5433751", "0.54220587", "0.541714", "0.5413669", "0.54112935", "0.54088765", "0.54084617", "0.54077286", "0.5406881", "0.54062676", "0.5401705", "0.5399513", "0.5396064", "0.5387957", "0.5387715", "0.5381646", "0.5381394", "0.5381362" ]
0.5770791
28
This function gets count for leads, opportunities, sales and lost opportunities
function getCount() { $("#wonLostDrillDown").hide(); $("#pipeDrillDown").hide(); $("#drillTable").hide(); var leadCount = 0; var oppCount = 0; var saleCount = 0; var lostSaleCount = 0; var allCount = 0; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); context.load(listItems); context.executeQueryAsync( function () { // Iterate through the list items in the Invoice list var listItemEnumerator = listItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); // Sum up all counts if (listItem.get_fieldValues()["_Status"] == "Lead") { leadCount = parseInt(leadCount) + 1; } if (listItem.get_fieldValues()["_Status"] == "Opportunity") { oppCount = parseInt(oppCount) + 1; } if (listItem.get_fieldValues()["_Status"] == "Sale") { saleCount = parseInt(saleCount) + 1; } if (listItem.get_fieldValues()["_Status"] == "Lost Sale") { lostSaleCount = parseInt(lostSaleCount) + 1; } if (listItem.get_fieldValues()) { allCount = parseInt(allCount) + 1; } var current = allCount - lostSaleCount; } showLeadCount(leadCount); showOppCount(oppCount); showSaleCount(saleCount); showLostSaleCount(lostSaleCount); $('#chartArea').fadeIn(500, null); createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount); }, function () { alert("failure in getCount"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBookedCountHelper(dbBookings){\n var count = 0;\n for(booking in dbBookings){\n count = count + dbBookings[booking].target_count;\n }\n console.log(\" Total Seats Booked in the Current Flight are - \" + count);\n return count;\n}", "bookingCount() {\n var s1 = Bookings_Live.find({ 'screenID': Session.get(\"SCREEN_ID\"), 'code': Session.get(\"UserLogged\").code }).count();\n var s2 = Bookings_Authorization.find({ 'screenID': Session.get(\"SCREEN_ID\"), 'code': Session.get(\"UserLogged\").code }).count();\n return s1 + s2;\n }", "getTournamentOverdueCnt() {\n var cnt = 0, i; \n var d = Date.now();\n if (this.tournament.paymentdeadline != \"0\") {\n for (i = 0; i < this.players.length; i++) {\n if (this.players[i].paymentstatus == \"open\" && d > (parseInt(this.players[i].datetime) + (24*60*60*1000 * parseInt(this.tournament.paymentdeadline)))) cnt++;\n }\n }\n return cnt; \n }", "function getExpectedToReport(rows,prd,ounit) {\n\tvar exp_count = 0;\n\t$.each(rows, function (indx, onerow){\n if(ounit==onerow[2] && prd==onerow[1] && onerow[0]=='RRnz4uPHXdl.ACTUAL_REPORTS'){ \n exp_count = exp_count + 1;\n }\t\t\t\t\t\t\t\t\n\t})\t\t\n\n\treturn exp_count;\n}", "get totalDescendents() {\n let count = this.offspring.length;\n\n for (let offspring of this.offspring) {\n count += offspring.totalDescendents;\n }\n\n return count;\n }", "organismCounts(){\n let cnt = new Map(); // org => mention count\n let resetCount = org => cnt.set( org, 0 );\n let addToCount = org => cnt.set( org, cnt.get(org) + 1 );\n let getOrg = id => Organism.fromId( id );\n let entIsAssocd = ent => ent.associated();\n let getOrgIdForEnt = ent => _.get( ent.association(), ['organism'] );\n\n Organism.ALL.forEach( resetCount );\n\n this.toggledOrganisms().forEach( addToCount );\n\n (\n this.entities()\n .filter( entIsAssocd )\n .map( getOrgIdForEnt )\n .filter( isNonNil ) // may be an entity w/o org\n .map( getOrg )\n .forEach( addToCount )\n );\n\n return cnt;\n }", "async count() {\r\n const params = {\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n distinct: true\r\n };\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.count(params);\r\n return result;\r\n }", "getHomeCount(){\n return _mm.request({\n type:'post',\n url:'/manage/statistic/base_count.do'\n })\n }", "getEmployeeCount() {\n return salesReport.employees.length;\n }", "async countNumberOfBricolsOfUser(req, res, next) {\n try {\n let userId = req.params.userId;\n let userDetails = await User.findById(userId);\n if (!userDetails)\n return res.status(404).end();\n\n //incity Bricols \n let query = {}\n query.user = userId;\n let allBricols = await Bricol.count(query);\n query.status = 'pendding'\n let penddingBricols = await Bricol.count(query);\n query.status = 'assigned';\n let assignedBricols = await Bricol.count(query);\n query.status = 'inProgress';\n let inProgressBricols = await Bricol.count(query);\n query.status = 'done';\n let doneBricols = await Bricol.count(query);\n let result = {}\n result.incityBricols = {\n allBricols,\n penddingBricols,\n assignedBricols,\n inProgressBricols,\n doneBricols\n }\n\n //between city bricols \n let btQuery = {}\n btQuery.user = userId;\n let allBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'pendding'\n let penddingBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'assigned';\n let assignedBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'inProgress';\n let inProgressBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'done';\n let doneBtBricols = await BricolBtCity.count(btQuery);\n result.betweenCityBricols = {\n allBtBricols,\n penddingBtBricols,\n assignedBtBricols,\n inProgressBtBricols,\n doneBtBricols\n }\n\n let specialRequest = await SpecialRequest.count({ user: userId });\n result.specialRequest = specialRequest;\n\n return res.status(200).json(result);\n } catch (err) {\n next(err)\n }\n }", "async countNumberOfBricolsOfUser(req, res, next) {\n try {\n let userId = req.params.userId;\n let userDetails = await User.findById(userId);\n if (!userDetails)\n return res.status(404).end();\n\n //incity Bricols \n let query = {}\n query.user = userId;\n let allBricols = await Bricol.count(query);\n query.status = 'pendding'\n let penddingBricols = await Bricol.count(query);\n query.status = 'assigned';\n let assignedBricols = await Bricol.count(query);\n query.status = 'inProgress';\n let inProgressBricols = await Bricol.count(query);\n query.status = 'done';\n let doneBricols = await Bricol.count(query);\n let result = {}\n result.incityBricols = {\n allBricols,\n penddingBricols,\n assignedBricols,\n inProgressBricols,\n doneBricols\n }\n\n //between city bricols \n let btQuery = {}\n btQuery.user = userId;\n let allBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'pendding'\n let penddingBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'assigned';\n let assignedBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'inProgress';\n let inProgressBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'done';\n let doneBtBricols = await BricolBtCity.count(btQuery);\n result.betweenCityBricols = {\n allBtBricols,\n penddingBtBricols,\n assignedBtBricols,\n inProgressBtBricols,\n doneBtBricols\n }\n\n let specialRequest = await SpecialRequest.count({ user: userId });\n result.specialRequest = specialRequest;\n return res.status(200).json(result);\n } catch (err) {\n next(err)\n }\n }", "async countNumberOfBricolsOfBricoler(req, res, next) {\n try {\n let bricolerId = req.params.bricolerId;\n let userDetails = await User.findById(bricolerId);\n if (!userDetails)\n return res.status(404).end();\n\n //incity Bricols \n let query = {}\n query.bricoler = bricolerId;\n let allBricols = await Bricol.count(query);\n query.status = 'pendding'\n let penddingBricols = await Bricol.count(query);\n query.status = 'assigned';\n let assignedBricols = await Bricol.count(query);\n query.status = 'inProgress';\n let inProgressBricols = await Bricol.count(query);\n query.status = 'done';\n let doneBricols = await Bricol.count(query);\n let result = {}\n result.incityBricols = {\n allBricols,\n assignedBricols,\n inProgressBricols,\n doneBricols\n }\n\n //between city bricols \n let btQuery = {}\n btQuery.bricoler = bricolerId;\n let allBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'pendding'\n let penddingBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'assigned';\n let assignedBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'inProgress';\n let inProgressBtBricols = await BricolBtCity.count(btQuery);\n btQuery.status = 'done';\n let doneBtBricols = await BricolBtCity.count(btQuery);\n result.betweenCityBricols = {\n allBtBricols,\n assignedBtBricols,\n inProgressBtBricols,\n doneBtBricols\n }\n\n let specialRequest = await SpecialRequest.count({ bricoler: bricolerId });\n result.specialRequest = specialRequest;\n\n return res.status(200).json(result);\n } catch (err) {\n next(err)\n }\n }", "function getCount() {\n return count;\n}", "openWeeks(weekMeetings) {\n let openWeekCount = 0;\n weekMeetings.forEach((meetingArray) => {\n if (meetingArray.length > 0) {\n return openWeekCount += 1;\n }\n });\n return openWeekCount;\n }", "function updateAttackCounts() {\n\n // console.log(\" ---- Update Attack Counts ---- \")\n // console.log(GeoMenu.getShowAttacks());\n\n data.forEach(function(country) {\n country.was_attacked_filter = 0;\n country.attacked_sb_filter = 0;\n\n country.sources.countries.forEach(function(source) {\n source.attack_types.forEach(function(attack_type) {\n if ( contains(GeoMenu.getShowAttacks(), attack_type.type_id) ) {\n country.was_attacked_filter += attack_type.count;\n // console.log(country)\n }\n })\n })\n\n country.targets.countries.forEach(function(target) {\n target.attack_types.forEach(function(attack_type) {\n if ( contains(GeoMenu.getShowAttacks(), attack_type.type_id) ) {\n country.attacked_sb_filter += attack_type.count;\n }\n })\n })\n })\n\n // console.log(data);\n }", "getBattleCount(req, res) {\n model.battle.battleCount((err, count) => {\n if(err) {\n res.status(500).send({error: constant.ERROR_OCCURED}) \n } else {\n res.status(200).json({'total number of battle occurred': count});\n }\n })\n }", "getDataplaneTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllDataplanes()\n const count = entities.items.length\n\n commit('SET_TOTAL_DATAPLANE_COUNT', count)\n }\n\n getItems()\n }", "function count(){\n\t\t\tcallCount++;\n\t\t\t$('#count').text(callCount);\n\t \t\tif(callCount == completionCount){\n\t \t\t\tconsole.log(\"all done\");\n\t \t\t\t$('#loading').remove();\n\n\t\t\t\tfor (var k=0; k<objectives.length; k++){\n\t\t\t\t\tcreateOrganizedDataDetails(objectives[k]);\n\t\t\t\t}\n\n\t\t\t\tif (FLAG=='list'){\n\t\t\t\t\tprintSpecificObjectives();\n\t\t\t\t}else{\n\t \t\t\t\tprintToScreen();\n\t \t\t\t}\n\t \t\t}\n\t\t}", "async count(criteria = {}) {\n\t\tconst count = await this.model.count(criteria)\n\t\treturn count\n\t}", "function countSales(pop){\n\n // it would probably be better if every purchase of a beer got stored in the database as a number\n // then this would go faster\n var counting = []; // array where beer_id and the number of times it has been bought is stored\n var itemlist = []; // array where beer_id is stored so it's possible to use indexOf\n\n\n for (var i = 0; i < pop.length; i++) {\n var if_in_mapp= itemlist.indexOf(pop[i].beer_id);// gives what index an element has or -1 if it's not in the array\n\n if (if_in_mapp==-1){\n var itemBought = {\"beer_id\" :pop[i].beer_id, \"times_bought\": 1};\n counting.push(itemBought); // store the item in counted...\n itemlist.push(pop[i].beer_id);\n\n }\n\n else { // every time loop finds that a beverage has been bought 1 time or more it adds +1 in times it has been bought\n for (var j =0; j < itemlist.length; j++){\n if (pop[i].beer_id==counting[j].beer_id){\n counting[j].times_bought+=1;\n\n }\n\n }\n }\n\n }\n\n return counting;\n}", "function getAllAlarmCount() {\n getAllAlarmByState($scope.allControlPlanes.join('|'), $scope.allClusters.join('|')).then(function(data) {\n var count = [0, 0, 0, 0];\n data.forEach(function(d) {\n switch(d[1]) {\n case \"UNDETERMINED\":\n count[0] += d[0];\n break;\n case \"OK\":\n count[1] += d[0];\n break;\n case \"ALARM\":\n if (d[2] === 'CRITICAL' || d[2] === 'HIGH') {\n count[3] += d[0];\n } else {\n count[2] += d[0];\n }\n break;\n }\n });\n $scope.inventory_cards[$scope.inventory_cards.length - 1].data.unknown.count = count[0];\n $scope.inventory_cards[$scope.inventory_cards.length - 1].data.ok.count = count[1];\n $scope.inventory_cards[$scope.inventory_cards.length - 1].data.warning.count = count[2];\n $scope.inventory_cards[$scope.inventory_cards.length - 1].data.critical.count = count[3];\n });\n }", "get totalDescendents() {\n let counter = 0;\n for (let descendent of this.offspring) {\n counter += descendent.totalDescendents;\n counter++;\n }\n return counter;\n }", "organismCount( org ){\n return this.organismCounts().get( org );\n }", "function getCoffeeCount(response)\r\n{\r\n var coffee_count = 0;\r\n\r\n for (var i=0; i<response.length; i++)\r\n {\r\n var data = response[i]['venue'];\r\n if (data.categories.length !=0 )\r\n {\r\n if (data.categories[0].name.indexOf('Coffee') > -1)\r\n {\r\n coffee_count ++;\r\n }\r\n }\r\n }\r\n return coffee_count;\r\n}", "static getDailyCount(req, res) {\n return Inquiry\n .findAll({\n // where: {\n // intent: {\n // [Op.notLike]: \"\"\n // }\n // },\n attributes: [\n [Sequelize.fn('COUNT', Sequelize.col('intent')), 'count'],\n [Sequelize.fn('LEFT', Sequelize.col('dateOfCreation'), 8), 'doc']\n ],\n order: [\n [Sequelize.fn('LEFT', Sequelize.col('dateOfCreation'), 8)]\n ],\n group: ['doc']\n })\n .then(queries => {\n // if there are no queries in the database error is returned along with\n // 404 - resource not found code\n if(queries != null && queries.length > 0) {\n res.status(200).send({\n success: true,\n message: 'Queries fetched',\n queries\n });\n } else {\n res.status(404).send({\n success: false,\n message: 'There are no queries in the database'\n });\n }\n });\n }", "inFlightCount() {\n let numberPropsInFlight = 0;\n this.list.forEach((prop_) => {\n if (prop_.isInFlight()) {\n ++numberPropsInFlight;\n }\n }, this);\n return numberPropsInFlight;\n }", "function _countAndSend(oRoutes) {\n\t\t//Variables for Notifications\n\t\tvar lvSent = 0,\n\t\t\tlvAcknowledged = 0,\n\t\t\tlvError = 0,\n\t\t\tlvParked = 0,\n\t\t\tlvPosted = 0;\n\n\t\t//Date\n\t\tvar lvDate = new Date();\n\t\tvar lvDateString = lvDate.toISOString().substring(0, 10);\n\n\t\t//Loop at the list of Routes and Perform Counts to Send \n\t\tfor (var i = 0; i < oRoutes.length; i++) {\n\t\t\t//Get Sent Count for Date \n\t\t\tlvSent = parseFloat(_getCount('SENT', oRoutes[i].COMPANY_CODE, lvDateString));\n\t\t\t//Get Acknowledged Count for Date\n\t\t\tlvAcknowledged = _getCount('ACKNOWLEDGED', oRoutes[i].COMPANY_CODE, lvDateString);\n\t\t\t//Get Error Count for Date\n\t\t\tlvError = _getCount('ERROR', oRoutes[i].COMPANY_CODE, lvDateString);\n\t\t\t//Get the Parked Count for Date\n\t\t\tlvParked = _getCount('PARKED', oRoutes[i].COMPANY_CODE, lvDateString);\n\t\t\t//Get the Posted Count for Date\n\t\t\tlvPosted = _getCount('POSTED', oRoutes[i].COMPANY_CODE, lvDateString);\n\n\t\t\t//Call the Function to call HCI Notification Process\n\t\t\t_determineNotifications(oRoutes[i].ODATA_URL, oRoutes[i].CLIENT, lvSent, lvAcknowledged, lvError, lvParked, lvPosted);\n\t\t}\n\t}", "function RepoCount(data){\n\t// alert(data.total_count);\n\treturn data.total_count\n}", "function totalHomeGoals(data) {\nconst totalGoals = data.reduce(function(accumulator,item){\nreturn accumulator + item['Home Team Goals'];\n},0);\nreturn totalGoals;\n}", "getNumberOfTopBillers() {\n let numberOfTopBillers = 0;\n for (let i = 0; i < this.getGobjects().length; i++) {\n if (this.getGobjects()[i].requestsTopBilling) {\n numberOfTopBillers++;\n }\n }\n return numberOfTopBillers;\n }", "function totalMaintenance(statusData){\n var pr = statusData[\"problemReport\"];\n var fb = statusData[\"feedbacks\"];\n var fu = statusData[\"followUps\"];\n\n\n $(\"#badge1\").html(pr['total']);\n $(\"#badge2\").html(pr['resolvedCount']);\n $(\"#badge3\").html(fb['total']);\n $(\"#badge4\").html(fb['rating0']);\n $(\"#badge5\").html(fb['rating1']);\n $(\"#badge6\").html(fb['rating2']);\n $(\"#badge7\").html(fb['rating3']);\n $(\"#badge8\").html(fb['rating4']);\n $(\"#badge9\").html(fb['rating5']);\n $(\"#badge10\").html(fu['total']);\n\n}// End of display maintenance count value", "count_all(req, res) {\n return businesses\n .findAndCountAll({\n where: {\n status: req.params.status,\n }\n })\n .then((result) => res.status(201).send(result))\n .catch((error) => res.status(400).send(error))\n\n }", "countAll() {\n let sqlRequest = \"SELECT COUNT(*) AS count FROM activite\";\n return this.common.findOne(sqlRequest);\n }", "count(req, res){\n const ProxyEngineService = this.app.services.ProxyEngineService\n ProxyEngineService.count('Subscription')\n .then(count => {\n const counts = {\n subscriptions: count\n }\n return res.json(counts)\n })\n .catch(err => {\n return res.serverError(err)\n })\n }", "count(req, res){\n const ProxyEngineService = this.app.services.ProxyEngineService\n ProxyEngineService.count('Subscription')\n .then(count => {\n const counts = {\n subscriptions: count\n }\n return res.json(counts)\n })\n .catch(err => {\n return res.serverError(err)\n })\n }", "function getTotalPassengers(data) {\n\tconsole.log('PASSENGER COUNT',data.length)\n\treturn data.length\n}", "function getActiveCount(data) {\n var totalIsActive = 0;\n for(var i = 0; i < data.length; i++) {\n if(data[i]['isActive'] === true){\n totalIsActive++;\n }\n\n }\n return totalIsActive\n}", "daysBookedAndAutorized(){\n let num = 0;\n this._booking.filter(function(obj){\n if(obj.authorized == true){\n num+=obj.numberOfDays();\n }\n })\n return num;\n }", "function get_total_negotiates(negotiates_array, journey_status){\n let total_negotiates = 0;\n if(journey_status == 'active'){\n for (var n in negotiates_array){\n if(negotiates_array[n].negotiation_status == 'active' && negotiates_array[n].order !=null){\n total_negotiates++;\n }\n }\n\n if (total_negotiates == 1){\n return'<div class=\"journey-details badge badge-info mr-1\">' +\n 'You have 1 negotiatiaton</div>'\n }else if(total_negotiates>1){\n return'<div class=\"journey-details badge badge-info mr-1\">' +\n 'You have '+total_negotiates+' negotiations</div>'\n }else{\n return'<div class=\"journey-details badge badge-info mr-1\">You have no negotiates for this journey</div>'\n }\n }else{\n return '';\n }\n }", "count_category(req, res) {\n return businesses\n .findAndCountAll({\n where: {\n category: req.params.category,\n status: req.params.status,\n }\n })\n .then((result) => res.status(201).send(result))\n .catch((error) => res.status(400).send(error))\n\n }", "function countAdalabers() {\n const howMany = adalabers.length;\n return howMany;\n\n}", "function question6 () {\n let c = 0;\n for (let i = 0; i < n; i++){\n if (data[i].who_made == \"i_did\"){\n c += 1;\n }\n } console.log(`${c} items were made by their sellers`)\n return c;\n}", "function _getCounts(url, trg) { // TODO: refactor to be more abstract\t\t\n\t\t\t_getFacebookLikeCount(\n\t\t\t\turl,\n\t\t\t\tfunction(d) {\n\t\t\t\t\tdata['facebook'] = {};\n\t\t\t\t\tdata['facebook']['count'] = d.likes;\n\t\t\t\t\tdata['facebook']['desc'] = 'Likes';\n\t\t\t\t\t_getTwitterCount(url, \n\t\t\t\t\t\tfunction(d) {\n\t\t\t\t\t\t\tdata['twitter'] = {};\n\t\t\t\t\t\t\tdata['twitter']['count'] = d.count;\n\t\t\t\t\t\t\tdata['twitter']['desc'] = 'Tweets';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Success for both counts.\n\t\t\t\t\t\t\t_setCountDisplayMarkup(_compareCounts(data), trg);\n\t\t\t\t\t\t}, \n\t\t\t\t\t\tfunction(d) { throw(d); }\n\t\t\t\t\t);\n\t\t\t\t}, \n\t\t\t\tfunction(d) {\n\t\t\t\t\t// If FB failed, still call the Twitter count service.\n\t\t\t\t\t_getTwitterCount(url, \n\t\t\t\t\t\tfunction(d) {\n\t\t\t\t\t\t\tdata['twitter'] = {};\n\t\t\t\t\t\t\tdata['twitter']['count'] = d.count;\n\t\t\t\t\t\t\tdata['twitter']['desc'] = 'Tweets';\n\t\t\t\t\t\t\t_setCountDisplayMarkup(_compareCounts(data), trg);\n\t\t\t\t\t\t}, \n\t\t\t\t\t\tfunction(d) { throw(d); }\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t}", "get totalNumberOfDescendants() {\n let n = 0;\n const counter = (vampire) => {\n for (let offspring of vampire.offsprings) {\n n ++;\n counter(offspring);\n }\n };\n\n counter(this);\n return n;\n }", "function getCount(req, res, next) {\n db.query(\"SELECT COUNT(*) FROM entreprises\", function (errors, results, fields) {\n if (errors) {\n console.log(errors)\n res.status(500)\n .json({\n status: \"ko\",\n data: \"error\"\n })\n }\n res.status(200)\n .json({\n status: \"ok\",\n data: results[0]\n })\n });\n}", "static async countParcels(request, response) {\n const { email } = response.locals;\n const userId = response.locals.id;\n const {\n pending,\n transit,\n delivered,\n cancelled,\n } = constants.DEFAULT_STATUS;\n\n const app = new App();\n const isUser = await app.isEmailExist(email, constants.USER);\n\n if (!isUser) {\n response.status(403).json({\n status: 'fail',\n auth: 'invalid',\n message: 'Forbidden, Invalid user authentication key',\n });\n }\n\n const user = new User();\n const all = await user.getParcelNumber(userId);\n const parcelPending = await user.getParcelNumber(userId, pending);\n const parcelInTransit = await user.getParcelNumber(userId, transit);\n const parcelDelivered = await user.getParcelNumber(userId, delivered);\n const parcelCancelled = await user.getParcelNumber(userId, cancelled);\n\n response.status(200).json({\n status: 'success',\n parcel: {\n all,\n pending: parcelPending,\n delivered: parcelDelivered,\n inTransit: parcelInTransit,\n cancelled: parcelCancelled,\n },\n });\n }", "function get_total_negotiator(negotiates_array, order_status){\n let total_negotiator = 0;\n if(order_status == 'awaiting'){\n for (var n in negotiates_array){\n if(negotiates_array[n].negotiation_status== 'active' && negotiates_array[n].journey !=null ){\n total_negotiator++;\n }\n }\n console.log(total_negotiator);\n if(total_negotiator == 1) {\n return '<div class=\"order-details\">You have '+total_negotiator+' negotiator</div>';\n }else if(total_negotiator > 1){\n return '<div class=\"order-details\">You have '+total_negotiator+' negotiators</div>';\n }\n }else{\n return '<div class=\"order-details\">You have no negotiators for this order</div>';\n }\n }", "countFreeList(req, res) {\n // Count the hits\n config.TOTAL_HITS++;\n\n CpfsModel.count({ where: {'blackList': \"free\" }}).then(freeList => {\n return res.status(200).json({cpfAtWhiteList: freeList});\n });\n }", "countRoads(){\n return this.roads.length\n }", "function countMatches(drawData) {\n const { winningNumbers, drawedSets} = drawData;\n const numAmount = winningNumbers.length;\n //console.log(numAmount)\n const matchCount = {}\n \n for (i=0; i<=numAmount; i++) {\n matchCount[`Match${i}`] = 0;\n }\n\n for (set of drawedSets) {\n matchCount[`Match${set.match}`]++\n }\n\n return matchCount;\n}", "getConnectorCounters()\n {\n this.api.getConnectorList(this.botid,'messenger').then(connectors => {\n this.messengerConnectorCount = connectors.length;\n });\n this.api.getConnectorList(this.botid,'telegram').then(connectors => {\n this.telegramConnectorCount = connectors.length;\n });\n this.api.getConnectorList(this.botid,'website').then(connectors => {\n this.websiteConnectorCount = connectors.length;\n });\n\n }", "function resolveCounts(req, res, next) {\n\t\tconst countResolutions = [];\n\t\tconst catchCountQueryError = (countQueryErr) => {\n\t\t\tconst httpErr = httpError.build('internal', { source: 'DATABASE', errorObject: countQueryErr });\n\t\t\treturn Promise.reject(httpErr);\n\t\t};\n\n\t\treq.results.forEach(function(post) {\n\t\t\tif (post.comments === undefined) {\n\t\t\t\tconst resolveCommentCount = Post.count({ parent: post.id }).exec().then(\n\t\t\t\t\tfunction(comments) {\n\t\t\t\t\t\tpost.comments = comments;\n\t\t\t\t\t},\n\t\t\t\t\tcatchCountQueryError,\n\t\t\t\t);\n\n\t\t\t\tcountResolutions.push(resolveCommentCount);\n\t\t\t}\n\t\t\tif (post.stars === undefined) {\n\t\t\t\tconst resolveStarCount = Star.count({ parent: post.id }).exec().then(\n\t\t\t\t\tfunction(stars) {\n\t\t\t\t\t\tpost.stars = stars;\n\t\t\t\t\t},\n\t\t\t\t\tcatchCountQueryError,\n\t\t\t\t);\n\n\t\t\t\tcountResolutions.push(resolveStarCount);\n\t\t\t}\n\t\t});\n\n\t\tPromise.all(countResolutions).then(\n\t\t\tfunction() {\n\t\t\t\tnext();\n\t\t\t},\n\t\t\tnext,\n\t\t);\n\t}", "function countObstacles(){\n\t\tobstacles.find({scored:{$ne:false}}).then((obstacles) => {\n\t\t\tvar obstacleCount = JSON.stringify(obstacles.length)\n\t\t\tprocess.env.totalObstacleCount = obstacleCount\n\t\t\t\t console.log(`There are: ${process.env.totalObstacleCount} obstacles.`)\n\t\t}, (e) => {\n\t console.log('trouble with obstacle count calculation')\n\t });\n\t}", "getCountComparingTwoCategories(category, category2){\n let count = [];\n let counts = []; \n let subcategories = [];\n let types = this.getAllPossible(category);\n let types2 = this.getAllPossible(category2);\n let slot = this.getCategoryNumber(category);\n let slot2 = this.getCategoryNumber(category2);;\n\n types.forEach(() => {\n count.push(0);\n });\n \n types.forEach((type) => {\n subcategories.push(type.value);\n });\n\n counts.push(subcategories);\n\n types2.forEach((subcategory) => {\n mushroom.data.forEach((mushroom) => {\n if (mushroom[slot2] === subcategory.key) {\n types.forEach((type, index) => {\n if (mushroom[slot] === type.key) {\n count[index]++;\n }\n });\n }\n });\n counts.push(count);\n count = [];\n types.forEach(() => {\n count.push(0);\n }); \n });\n\n return counts; \n }", "getTotalCalories(mealFoods) {\n let sumCalories = 0;\n for (let i = 0; i < this.state.activities.length; i++) {\n sumCalories += this.state.activities[i].calories;\n }\n return sumCalories;\n }", "count() {\n let c = 0;\n\n if (this.players.p1 !== undefined) {\n c++;\n }\n if (this.players.p2 !== undefined) {\n c++;\n }\n\n return c;\n }", "function countOnline(usersObj) {\n // Only change code below this line\nvar count = 0\nfor (let propertyName in usersObj) {\n console.log(usersObj[propertyName].online )\n if(usersObj[propertyName].online == true) {\n count++;\n }\n}\n \n \nreturn count\n \n // Only change code above this line\n}", "getFeldCount() {\n const count = { a: 0, b: 0, c: 0 };\n Object.entries(this.fachstunden).forEach((fach) => {\n const feld = c.faecher[fach[0]].feld;\n if (feld === 'a') {\n count.a += 1;\n } else if (feld === 'b') {\n count.b += 1;\n } else if (feld === 'c') {\n count.c += 1;\n }\n });\n return count;\n }", "async networkNewActivityCount() {\n let userId = currentUserId()\n if (!userId) return -1\n let lastFetchedAGid = _.get(this.store.getState(), `network.${userId}.list[0].id`)\n if (!lastFetchedAGid) return -1\n let session = await this.userSession()\n if (!session) return -1\n let feed = await session.feed('timeline_aggregated').get({limit: 50})\n let res = _.get(feed, 'results')\n return _.findIndex(res, r => r.id === lastFetchedAGid)\n }", "get totalDescendents() {\n let totalVamps = 0;\n\n for (let child of this.offspring) {\n totalVamps += child.totalDescendents + 1;\n }\n return totalVamps;\n }", "function getCounters(req, res) {\n var userId = req.user.sub;\n if (req.params.id) {\n userId = req.params.id;\n }\n getCountFollow(userId).then((value) => {\n // if (err) return res.status(200).send({ err });\n return res.status(200).send({ value });\n });\n}", "async getCount() {\n return axios\n .get(UrlBuilder[this.storeType].paths.count, createHeaders())\n .then(response => response.data)\n .catch(error => handleError(error.response))\n }", "reservedSeats(props) {\n var total = 0\n\n var totalfun = function (i) {\n total = total + i.attending.length\n }\n for (var i = 0; i < props.state.items.length; i++) {\n totalfun(props.state.items[i])\n }\n return total\n }", "count() {\n return Object.keys(this.getAll()).length;\n }", "getTrafficRouteTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficRoutes()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_ROUTE_COUNT', count)\n }\n\n getItems()\n }", "count (properties) {\n return this.get(properties).get('count')\n }", "get totalDescendents() {\n let total = 0;\n\n total += this.numberOfOffspring;\n\n for (let offspring of this.offspring) {\n total += offspring.totalDescendents;\n }\n\n return total;\n }", "get totalDescendents() {\n let vampTotal = 0;\n for (let vampChild of this.offspring) {\n vampTotal += vampChild.totalDescendents + 1;\n } \n return vampTotal;\n }", "function countWins(){\n historyData.map(data => {\n if (data.result === \"W\") {\n wincount += 1\n }\n else {\n wincount += 0\n }\n })\n return wincount\n }", "stats() {\n return {\n numComponents: this.Components.length,\n numEntities: this.entities.length\n };\n }", "allSeats(props) {\n var total = 0\n\n var totalfun = function (i) {\n var empty = i.availableSeats - i.attending.length\n total = total + empty\n }\n for (var i = 0; i < props.state.items.length; i++) {\n totalfun(props.state.items[i])\n }\n return total\n }", "analyzeMerchantLoyalty(safetyTally){\n\n if(this.props.route.params.product.firstTranDateRange >= 365){\n safetyTally += 2;\n } \n if(this.props.route.params.product.firstTranDateRange >= 1095){\n safetyTally += 2;\n } \n\n return safetyTally;\n }", "function countOnline(usersObj) {\n // Only change code below this line\n let count = 0\n for (var user in usersObj){\n if (usersObj[user].online ==true){\n count += 1\n }\n }\n\n return count\n // Only change code above this line\n}", "function countCandies(param){\n let totalCandies = 0;\n param.forEach(value => {\n totalCandies += value.candies;\n })\n console.log(`${totalCandies} candies are owned by students altogether.`);\n}", "function accessesingData2() {\n return store2['sale dates']['Banana Bunches'].length;\n}", "countTracked() {\n return(Object.keys(tTracked).length)\n }", "get totalDescendents() {\n \n }", "function getCasualityCount(data) {\n\tconst casualty = data.filter(passenger => passenger.fields.survived === 'No');\n\tconsole.log('DECEASED COUNT', casualty.length)\n\treturn casualty.length\n}", "function ride_request_count() {\n $.ajax({\n type: \"POST\",\n url: \"../helper.php\",\n data: {\n action: \"ride_requests\",\n },\n success: function(response) {\n $(\"th\").css(\"display\", \"none\");\n $(\"td\").css(\"display\", \"none\");\n $(\"#ride_requests_table\").css(\"display\", \"none\");\n let pending_rides_result = JSON.parse(response);\n let pending_rides_count = pending_rides_result.length;\n $(\"#ride_requests h2\").html(pending_rides_count);\n },\n });\n}", "increaseCount() {\n const existing = document.querySelectorAll('.workout').length;\n return existing;\n }", "function getInactiveCount(data) {\n let totalInactive = 0;\n for(let i = 0; i < data.length; i++) {\n if(data[i]['isActive'] === false){\n\n totalInactive++;\n }\n }\n return totalInactive\n}", "function countOnline(usersObj) {\n // Only change code below this line\n let countList = 0;\n for (let user in usersObj){\n if (usersObj[user].online === true){\n countList += 1;\n }\n }return countList\n // Only change code above this line\n }", "function getStationCounts(thisTab) {\n \n staTab = staGeoJSON.features.filter( tabs[thisTab].tabSelect );\n \n tabs[thisTab].tabCountGCN = staTab.filter( \n function(sta) { return sta.properties.gloss_core }\n ).length;\n \n if (thisTab === \"sta_uhslc\") {\n tabs[thisTab].special[0] = staTab.filter( \n function(sta) { \n return sta.properties.gloss_core &&\n Math.abs(sta.geometry.coordinates[1]) < 20;\n }\n ).length;\n tabs[thisTab].special[1] = staGeoJSON.features.filter( \n function(sta) { \n return sta.properties.gloss_core &&\n Math.abs(sta.geometry.coordinates[1]) < 20;\n }\n ).length;\n }\n \n var total = 0;\n tabs[thisTab].group.forEach( function(thisGroup, idx) {\n tabs[thisTab].count[idx] = staTab.filter(\n tabs[thisTab].groupSelect[idx]\n ).length;\n tabs[thisTab].count[idx] -= total; \n tabs[thisTab].group[idx] += \" (\" + tabs[thisTab].count[idx] + \")\";\n total += tabs[thisTab].count[idx];\n });\n \n}", "getHealthCheckTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllHealthChecks()\n const count = entities.items.length\n\n commit('SET_TOTAL_HEALTH_CHECK_COUNT', count)\n }\n\n getItems()\n }", "function num_availHouses(ndx, group) {\n dc.dataCount('.dc-data-count')\n .crossfilter(ndx)\n .groupAll(group)\n .transitionDuration(500);\n}", "function computeCount(foods,methodIndex) {\n\tcals = 0;\n //console.log(\"eater to eat = \"+ foods.length);\n //console.log(\"starting with = \"+ JSON.stringify(methodIndex));\n //console.log(\"eater to bopt = \"+ JSON.stringify(method));\n\t$.each(foods,function(i,v) { cals += countForFood(v,methodIndex); });\n\treturn cals;\n}", "function _getCount(pStatus, pCompanyCode, pDate) {\n\t\tvar lvCount;\n\t\t//Get the Connection to the Database\n\t\tvar oConnection = $.db.getConnection();\n\n\t\t//Build the Query\n\t\tvar lvQuery = 'SELECT COUNT(*) FROM \"' + gvSchemaName + '\".\"' + gvMasterTable + '\"';\n\t\tlvQuery = lvQuery + ' WHERE \"STATUS\" = ' + \"'\" + pStatus + \"'\";\n\t\tlvQuery = lvQuery + ' AND \"DATE\" = ' + \"'\" + pDate + \"'\";\n\t\tlvQuery = lvQuery + ' AND \"COMPANY_CODE\" = ' + \"'\" + pCompanyCode + \"'\";\n\n\t\t//Prepare the SQL Statement to read the entries\n\t\tvar oStatement = oConnection.prepareStatement(lvQuery);\n\n\t\t//Execute the Query\n\t\tvar lsReturn = oStatement.executeQuery();\n\n\t\t//Map and Save the results\n\t\twhile (lsReturn.next()) {\n\t\t\tlvCount = lsReturn.getString(1);\n\t\t}\n\n\t\t//Close the DB Connection\n\t\toStatement.close();\n\t\toConnection.close();\n\n\t\t//Return the records\n\t\treturn lvCount;\n\t}", "function fillArrayAndTakeCount() {\n var userId = _spPageContextInfo.userId;\n var context = new SP.ClientContext.get_current();\n var oList = context.get_web().get_lists().getByTitle('ExpenseSheet');\n var camlQuery = new SP.CamlQuery();\n camlQuery.set_viewXml('<View>' +\n '<Query>' +\n '<Where>' +\n '<And>' +\n '<And>' +\n '<Eq>' +\n '<FieldRef Name=\\'Month\\'/>' +\n '<Value Type=\\'Text\\'>' + month + '</Value>' +\n '</Eq>' +\n '<Eq>' +\n '<FieldRef Name=\\'Year\\'/>' +\n '<Value Type=\\'Text\\'>' + year + '</Value>' +\n '</Eq>' +\n '</And>' +\n '<Eq>' +\n '<FieldRef Name=\\'AssignedTo\\' LookupId=\\'TRUE\\'/>' +\n '<Value Type=\\'User\\'>' + userId + '</Value>' +\n '</Eq>' +\n '</And>' +\n '</Where>' +\n '<OrderBy>' +\n '<FieldRef Name=\\'Title\\' Ascending=\\'TRUE\\' />' +\n '</OrderBy>' +\n '</Query>' +\n '<ViewFields>' +\n '<FieldRef Name=\\'Id\\' />' +\n '<FieldRef Name=\\'Date1\\' />' +\n '<FieldRef Name=\\'Recipient\\' />' +\n '<FieldRef Name=\\'Month\\' />' +\n '<FieldRef Name=\\'Year\\' />' +\n '<FieldRef Name=\\'Description1\\' />' +\n '<FieldRef Name=\\'Province\\' />' +\n '<FieldRef Name=\\'ExpensesType\\' />' +\n '<FieldRef Name=\\'Amount\\' />' +\n '<FieldRef Name=\\'Tip\\' />' +\n '<FieldRef Name=\\'TPS\\' />' +\n '<FieldRef Name=\\'TVQ\\' />' +\n '<FieldRef Name=\\'Total\\' />' +\n '<FieldRef Name=\\'ExchangeRate\\' />' +\n '<FieldRef Name=\\'TotalAfterRate\\' />' +\n '<FieldRef Name=\\'Project\\' />' +\n '</ViewFields>' +\n '</View>');\n window.collListItem = oList.getItems(camlQuery);\n context.load(collListItem, 'Include(Id, Project, Month, Year, Date1, Recipient, Description1, Province, ExpensesType, Amount, Tip, TPS, TVQ, Total, ExchangeRate, TotalAfterRate)');\n context.executeQueryAsync(Function.createDelegate(this, window.onQuerySucceeded),\n Function.createDelegate(this, window.onQueryFailed));\n}", "static favouriteEntriesCount() {\n {\n const favEntriesCount = DummyDataHelpers.findFavouriteEntryCount(dummyEntries);\n if (!favEntriesCount) {\n return this.notFound('No count');\n }\n return this.success('Favourite entry count fetched successfully', favEntriesCount);\n }\n }", "function fetchTotals(fields) {\n var tots = 0;\n var commands = \"\";\n var ctrl = true;\n for (var c = 0; c < fields.length; c++) {\n commands = commands + '&' + fields[c][0] + '=' + fields[c][1];\n }\n $.when(\n $.ajax({\n url:'http://safetrails.herokuapp.com/index.php/cases?count=true' + commands,\n dataType:'string',\n xhrFields: {\n withCredentials: false\n },\n type:'GET',\n success:function(data) {\n // Extract info\n tots = data;\n }\n })\n ).done( function (x) {\n ctrl = false;\n });\n while (ctrl) {\n // Do nothing\n }\n return tots;\n}", "function Main(props) {\n let count = 0;\n console.log(props);\n return (\n <div>\n {!props.leads ? (\n <h2>Loading...</h2>\n ) : (\n <div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-around\",\n fontStyle: \"italic\",\n margin: \"0px\",\n padding: \"0px\",\n }}\n >\n <button onClick={() => props.fetchData()}>Get Data</button>\n <p>\n <strong>isAxiosError:</strong>\n {props.error? props.error.isAxiosError: 'No Error'}\n </p>\n <p>\n <strong>Error :</strong>\n {props.error? props.error.message: 'No Error'}\n </p>\n <p>\n <strong>Data :</strong>\n {props.error? props.error.config.data: 'No Error'}\n </p>\n </div>\n <div\n style={{\n textAlign: \"center\",\n backgroundColor: \"rgb(184, 184, 226)\",\n }}\n className=\"listTitle column\"\n >\n <p>S.N.</p>\n <p>Date</p>\n <p>Name</p>\n <p>Mobile</p>\n <p>Email</p>\n <p>Address</p>\n </div>\n {props.leads.map((lead) => {\n const { SENDERNAME, SENDEREMAIL, DATE_RE, MOB, ENQ_ADDRESS } = lead;\n count = count + 1;\n return (\n <div className=\"listTitle column\">\n <p>{count}</p>\n <p>{DATE_RE}</p>\n <p>{SENDERNAME}</p>\n <p>{MOB}</p>\n <p>{SENDEREMAIL}</p>\n <p>{ENQ_ADDRESS}</p>\n </div>\n );\n })}\n </div>\n )}\n </div>\n );\n}", "function numberOfOpenGames(){\n var num = 0;\n for (var i = 0; i < game_list.length; i++) {\n if (game_list[i].number_slots > 0) num++;\n }\n return num;\n}", "function cntRegHousehold(req, res, next){\n var db = require('../../lib/database')();\n db.query(\"SELECT COUNT(*) AS CNT FROM tbluser WHERE strStatus = 'Registered' AND strType = 'Household Worker' \", function(err, results){\n if (err) return res.send(err);\n req.cntRegHousehold = results[0];\n console.log(results)\n return next();\n })\n}", "function payMeterDailyTallies() {\n arrCounts = [0, 0, 0, 0, 0, 0, 0]\n\n for (var i = 0; i < dataArray.length; i++) {\n var arr = payMeterDailyTally(i)\n for (var j = 0; j < 7; j++) {\n if (arrCounts[j] == null) {\n k = 0\n }\n else arrCounts[j] += arr[j]\n }\n }\n\n return arrCounts\n\n}", "followedCount(types) {\r\n return this.clone(MySocialQuery_1, `followedcount(types=${types})`).get().then(r => {\r\n return r.FollowedCount || r;\r\n });\r\n }", "function calcUserSummary(narratives) {\n if (!narratives) {\n return 0;\n }\n var sharingCount = 0;\n for (var i = 0; i < narratives.length; i++) {\n var nar = narratives[i];\n if (nar.permissions.length > 0) {\n sharingCount++;\n }\n }\n return sharingCount;\n }", "countAll() {\n let sqlRequest = \"SELECT COUNT(*) AS count FROM restaurants\";\n return this.common.findOne(sqlRequest);\n }", "function countOnline(usersObj) {\n // Only change code below this line\n let onlineUsers = [];\n for (let user in usersObj) {\n if (usersObj[user].online) {\n onlineUsers.push(user);\n console.log(onlineUsers.length);\n }\n }\n return onlineUsers.length;\n // Only change code above this line\n}", "getTotalServicesPicked(){\n\t\tlet totalServices = 0;\n\n\t\t//#1 - Iterate each service to get info \n\t\tthis.myServices.forEach((service)=>{\n\t\t\ttotalServices += service.totalPickedItems;\n\t\t})\n return totalServices;\n }", "function countCategories(response) {\n let categ = {};\n\n for (let offer of response.offers) {\n let item = offer.items[0]; // only the first item can have presets\n\n categ[item._tpl] = categ[item._tpl] || 0;\n categ[item._tpl]++;\n }\n // not in search mode, add back non-weapon items\n for (let c in response.categories) {\n if (!categ[c]) {\n categ[c] = 1;\n }\n }\n\n response.categories = categ;\n}" ]
[ "0.6353665", "0.6037318", "0.5961234", "0.5839468", "0.58316606", "0.58018774", "0.57679766", "0.57649976", "0.57395744", "0.5724641", "0.5723641", "0.5709042", "0.57036096", "0.5703531", "0.570331", "0.5692324", "0.5681472", "0.5676365", "0.5651066", "0.56458837", "0.564185", "0.5629237", "0.56217456", "0.5580712", "0.5569338", "0.5568939", "0.5564863", "0.55643296", "0.55267143", "0.5525832", "0.5521412", "0.55200285", "0.55187213", "0.55023503", "0.55023503", "0.54969746", "0.54936826", "0.5470472", "0.54655224", "0.54654926", "0.54529285", "0.5452602", "0.54431516", "0.54398876", "0.5439748", "0.543364", "0.54271644", "0.54268473", "0.5423623", "0.53873885", "0.5385188", "0.5384398", "0.53789896", "0.53761375", "0.53735787", "0.5371161", "0.53675765", "0.53661424", "0.53521484", "0.5344783", "0.5343079", "0.5339809", "0.5339722", "0.53367484", "0.53356266", "0.5330476", "0.5329233", "0.532146", "0.53206825", "0.5319193", "0.53154635", "0.53120804", "0.53120667", "0.5309777", "0.53066874", "0.52986145", "0.52966684", "0.5296129", "0.5294653", "0.52940875", "0.52937216", "0.5292951", "0.52913773", "0.5283807", "0.52824056", "0.5273525", "0.5272962", "0.5264123", "0.5260557", "0.5258995", "0.52566534", "0.5254492", "0.5252107", "0.5252073", "0.525147", "0.5250565", "0.52427334", "0.524156", "0.5240316", "0.52388084" ]
0.6273857
1
This function gives leads details in the pipe drill down
function drillLead() { var hasLeads = false; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); var type = "Lead"; context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var leadTable = document.getElementById("drillTable"); // Remove all nodes from the drillTable <DIV> so we have a clean space to write to while (leadTable.hasChildNodes()) { leadTable.removeChild(leadTable.lastChild); } // Iterate through the Prospects list var listItemEnumerator = listItems.getEnumerator(); var listItem = listItemEnumerator.get_current(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Lead") { // Get information for each Lead var leadTitle = document.createTextNode(listItem.get_fieldValues()["Title"]); var leadPerson = document.createTextNode(listItem.get_fieldValues()["ContactPerson"]); var leadNumber = document.createTextNode(listItem.get_fieldValues()["ContactNumber"]); var leadEmail = document.createTextNode(listItem.get_fieldValues()["Email"]); var leadPotentialAmt = document.createTextNode(listItem.get_fieldValues()["DealAmount"]); drillTable(leadTitle.textContent, leadPerson.textContent, leadNumber.textContent,leadEmail.textContent, leadPotentialAmt.textContent, type, leadAmount.toLocaleString()); } hasLeads = true; } if (!hasLeads) { // Text to display if there are no leads var noLeads = document.createElement("div"); noLeads.appendChild(document.createTextNode("There are no leads. You can add a new lead from here.")); leadTable.appendChild(noLeads); } $('#drillDown').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get Leads. Error: " + args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showDoctors(){\n var j=1;\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n }", "getDetails(){\n return [ this.search,\n this.cost,\n this.state,\n this.children]\n }", "function getDetails() {\n\n}", "function _routerAndpageInfo(to) {\n console.log('%c\\n## 当前跳转页面的相关信息展示 ##\\n', logStyle('3DTest'));\n console.log('%c========================', logStyle('tit'));\n console.log('%c1、跳转页面:', logStyle('info'));\n console.log('%c' + to.name, logStyle('text'));\n console.log('%c2、跳转路径:', logStyle('info'));\n console.log('%c' + to.path, logStyle('text'));\n console.log('%c3、funcId值:', logStyle('info'));\n console.log('%c' + $store.state.Core.funcId, logStyle('text'));\n console.log('%c============', logStyle('line'));\n console.log('%c4、所有页面相关信息列表如下:', logStyle('info'));\n console.log($store.state.PageInfo.pageinfoList);\n console.log('%c========================', logStyle('tit'));\n}", "getDrillData(data) {\n const ret = [];\n\n // Get array of names\n const campuses = [];\n for (let i = 0; i < data.length; i++) {\n campuses[i] = data[i].campus;\n }\n const name = _.uniq(campuses);\n\n // Get array of values\n const buildings = [];\n for (let x = 0; x < name.length; x++) {\n buildings[x] = [];\n for (let i = 0; i < data.length; i++) {\n if (data[i].campus === name[x]) {\n for (let j = 0; j < data[i].bags.length; j++) {\n buildings[x][j] = [data[i].bags[j].type, data[i].bags[j].weight];\n }\n }\n }\n console.log(buildings[x]);\n }\n\n // Return series with drilldown\n for (let i = 0; i < name.length; i++) {\n ret.push({\n name: name[i],\n id: name[i],\n data: buildings[i],\n });\n }\n return ret;\n }", "function directUserFromViewInfo() {\n if (nextStep == \"Departments\") {\n viewDepartments();\n }\n if (nextStep == \"Roles\") {\n viewRoles();\n }\n if (nextStep == \"Employees\") {\n viewEmployees();\n }\n if (nextStep == \"All Information\") {\n viewAll();\n } \n }", "getWalkedRecord() {}", "async viewHistory(ctx,drugName,serialNo){\n try{\n // Create a composite key for the company to get registered in ledger\n const drugID = ctx.stub.createCompositeKey('org.pharma-network.drug',[drugName,serialNo]);\n\n // ctach the iterator returned by the API\n let iterator = await ctx.stub.getHistoryForKey(drugID).catch(err => console.log(err));\n\n // fetch all the required results by passing it to getALLReuslts function\n let results = await this.getAllResults(iterator);\n\n // return the results back to the user\n return results;\n }\n catch(e){\n console.log(\" The error is \",e);\n }\n\n }", "viewListInfo(){\n console.log(`${this.listName} List. Due : ${this.listDue}. Complete : ${this.isListComplete}. Number of tasks : ${this.tasks.length}.`);\n }", "function leadsLink(val){\n\n //debugger;\n return '<li><a href=\"#page\" class=\"dynamic\" id=\"'+key+'\"><h2>' + val.name + '</h2><p>' + val.email + '</p><p class=\"ui-li-aside\"><strong>' + val.date +'</strong></p></a></li>';\n \n }", "function DirectLinkInfo(obj) {\n this.id = obj.tracking_no\n this.state = obj.status\n this.states = obj.states.reverse()\n this.trackerWebsite = directLink.getLink(obj.tracking_no)\n}", "function DrillThroughDialog(parent){/** @hidden */this.indexString=[];this.clonedData=[];this.isUpdated=false;this.gridIndexObjects={};this.gridData=[];this.formatList={};this.drillKeyConfigs={escape:'escape'};this.parent=parent;this.engine=this.parent.dataType==='olap'?this.parent.olapEngineModule:this.parent.engineModule;}", "function viewDepatments() {\n var query = \"SELECT * FROM DEPARTMENTS\";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Name: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "function gotAdasTile(resp)\n{\n if (resp.error != undefined)\n {\n alert(\"Got PDE error response while getting Cornering information. \"+resp.error);\n return;\n }\n\n if (resp.responseCode != undefined)\n {\n alert (resp.message);\n return;\n }\n\n //we want to show the curvature warning if the actual driving speed was greater than the speed at which the vehicle should should \n //be driven otherwise the car will be thrown out of the curve. This driving speed is taken from the given trace points. \n\n for (var r = 0; r < resp.Rows.length; r++)\n {\n var linkId = resp.Rows[r].LINK_ID;\n\n if(pdeManager.getLinkPartOfRoute(linkId)) // this will check the linkid with both positive and negative values\n {\n\n var curvature = resp.Rows[r].CURVATURES;\n var headings = resp.Rows[r].HEADINGS;\n var hpx = resp.Rows[r].HPX;\n var hpy = resp.Rows[r].HPY;\n var refLinkCurvHeads = resp.Rows[r].REFNODE_LINKCURVHEADS;\n var nrefLinkCurvHeads = resp.Rows[r].NREFNODE_LINKCURVHEADS;\n\n var curvatureSplit = curvature.split(',');\n var headingsSplit = headings.split(',');\n var hpxSplit = hpx.split(',');\n var hpySplit = hpy.split(',');\n var refLinkCurvHeadsSplit = refLinkCurvHeads.split(',');\n var nrefLinkCurvHeadsSplit = nrefLinkCurvHeads.split(',');\n\n if(curvatureSplit.length == 1 && curvatureSplit[0] == '')\n {\n curvatureSplit = [];\n }\n if(headingsSplit.length == 1 && headingsSplit[0] == '')\n {\n headingsSplit = [];\n }\n\n // result arrays for curvature and heading\n var resultCurvature = [];\n var resultHeading = [];\n var resultHpx = [];\n var resultHpy = [];\n\n //0. find out if link is driven from or to reference node\n var bLinkIsDrivenFromReferenceNode = pdeManager.getLinkIsDrivenFromReferenceNodeOnRoute(linkId);\n\n //1. handle reference node\n var previousLinkId = pdeManager.getPreviousIdLinkOnRoute(linkId, true);\n\n var bNodePointAdded = false;\n if(previousLinkId != null)\n {\n for(var k = 0; k < refLinkCurvHeadsSplit.length; k++)\n {\n var splitData = refLinkCurvHeadsSplit[k].split(':');\n if(splitData[0] == (Math.abs(previousLinkId) - Math.abs(linkId)))\n {\n resultCurvature.push(parseInt(splitData[1]));\n resultHeading.push(parseInt(splitData[2] / 1000));\n bNodePointAdded = true;\n break;\n }\n }\n }\n\n if(!bNodePointAdded)\n {\n resultCurvature.push(0);\n resultHeading.push(0);\n }\n\n // 2. handle shape curvatures, heading, coordinates\n var lastCoordValueCurvature = 0;\n for(var k = 0; k < curvatureSplit.length; k++)\n {\n lastCoordValueCurvature += parseInt(curvatureSplit[k]);\n resultCurvature.push(lastCoordValueCurvature);\n }\n\n var lastCoordValueHeading = 0;\n for(var k = 0; k < headingsSplit.length; k++)\n {\n lastCoordValueHeading += parseInt(headingsSplit[k]);\n resultHeading.push(parseInt(lastCoordValueHeading / 1000));\n }\n\n var lastCoordValueHpx = 0;\n for(var k = 0; k < hpxSplit.length; k++)\n {\n lastCoordValueHpx += parseInt(hpxSplit[k]);\n resultHpx.push(lastCoordValueHpx);\n }\n\n var lastCoordValueHpy = 0;\n for(var k = 0; k < hpySplit.length; k++)\n {\n lastCoordValueHpy += parseInt(hpySplit[k]);\n resultHpy.push(lastCoordValueHpy);\n }\n\n // 3. handle nonreference node\n var nextLinkId = pdeManager.getNextLinkIdOnRoute(linkId, true);\n\n bNodePointAdded = false;\n if(nextLinkId != null)\n {\n for(var k = 0; k < nrefLinkCurvHeadsSplit.length; k++)\n {\n var splitData = nrefLinkCurvHeadsSplit[k].split(':');\n if(splitData[0] == (Math.abs(nextLinkId) - Math.abs(linkId)))\n {\n resultCurvature.push(parseInt(splitData[1]));\n resultHeading.push(parseInt(splitData[2]) / 1000);\n bNodePointAdded = true;\n break;\n }\n }\n }\n\n if(!bNodePointAdded)\n {\n resultCurvature.push(0);\n resultHeading.push(0);\n }\n\n //linkid can be either negative or positive\n var absLinkId = Math.abs(linkId);\n // at this point we have all curvature and heading data to the link - so we save it\n routeLinkHashMap[absLinkId]._HPX = resultHpx;\n routeLinkHashMap[absLinkId]._HPY = resultHpy;\n routeLinkHashMap[absLinkId]._CURVATURE = resultCurvature;\n routeLinkHashMap[absLinkId]._HEADING = resultHeading;\n routeLinkHashMap[absLinkId]._LINK_DRIVEN_FROM_REV = bLinkIsDrivenFromReferenceNode;\n }\n }\n}", "function next(data) {\n data = getResults(data);\n let ul = document.getElementById(\"drivers-list\");\n var newLI;\n for (const [key, value] of Object.entries(data)) {\n let task = value.Driver.code;\n newLI = document.createElement(\"li\");\n newLI.appendChild(document.createTextNode(task));\n ul.appendChild(newLI);\n\n console.log(value.Driver.code);\n }\n}", "function getOpenedLinkDetails(grid, idValue) {\r\n\tvar linkDetail;\r\n\tif (idValue && idValue.length > 0) {\r\n\t\t$.map(grid.openedLinkDetailsList, function (openedLinkDetails) {\r\n\t\t\tif (openedLinkDetails.doubleClickedItemId == idValue || getRowNumberFromCellId(grid, openedLinkDetails.doubleClickedItemId) == getRowNumberFromCellId(grid, idValue)) {\r\n\t\t\t\tlinkDetail = openedLinkDetails;\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tif (grid.openedLinkDetailsList.length > 0) {\r\n\t\t\tlinkDetail = grid.openedLinkDetailsList[0];\r\n\t\t}\r\n\t}\r\n\r\n\treturn linkDetail;\r\n}", "function getViaWaypoints() {\n return directionsDisplay.directions.routes[0].legs[0].via_waypoints;\n }", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "function getDirections(){\n\tvar waypts = [];\n\tfor(landmark in itinerary){\n\t\tvar point = itinerary[landmark].mapData.geometry.location\n\t\tvar loc = new google.maps.LatLng(point.lat, point.lng);\n\t\twaypts.push({location: loc, stopover: true});\n\t\tconsole.log(itinerary[landmark].yelpData);\n\t}\n\n\tvar request = {\n\t\torigin: origin,\n\t\tdestination: waypts[waypts.length - 1].location,\n\t\twaypoints: waypts.slice(0, waypts.length - 1),\n\t\ttravelMode: google.maps.TravelMode.WALKING\n\t};\n\n\tdirectionsService.route(request, function(response, status) {\n\t\tif (status == google.maps.DirectionsStatus.OK) {\n\t\t\tdirectionsDisplay.setDirections(response);\n\t\t\tvar route = response.routes[0];\n\t\t\trenderDirections(route);\n\t\t}\n\t});\n}", "function fnDisplayVisitedContentDetailsForShowMore(e, args) {\n try {\n\n if ($(args.item).attr('class').indexOf('coveo-result-folding-child-result') > -1) {\n //console.log('fnDisplayVisitedContentDetailsForShowMore -Its show more event');\n\n var elementsCoveoResultLink = $(args.item).find('.CoveoResultLink');\n $(elementsCoveoResultLink).bind('click', fnContentVistedInsertOrUpdateData);\n } else {\n //console.log('fnDisplayVisitedContentDetailsForShowMore -Its not show more event');\n }\n\n } catch (err) {\n console.log('fnDisplayVisitedContentDetailsForShowMore : ' + err.message);\n } finally {\n\n }\n}", "getTravelAlertsNavItemText() {\n return this.travelAlertsNavItem.getText();\n }", "debugEndpointProvider() {\n console.log(this.epProvider.getEndPointByName('allData'));\n console.log(this.epProvider.buildEndPointWithQueryStringFromObject({\n limit: 10,\n sort: 'title',\n page: 1,\n filter: 'marketing-automation,ad-network',\n direction: 1,\n }, '/fetch-all'));\n }", "async function loadDetails() {\r\n try {\r\n setShow(true);\r\n\r\n const response = await api.get(`/etapas/${project._id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n const { data } = response;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err ', err);\r\n setErr(true);\r\n }\r\n }", "show () {\n\t\tlet list = [];\n\t\tlet head = this.head;\n\t\twhile (head) {\n\t\t\tlist.push(head.data);\n\t\t\thead = head.next;\n\t\t}\n\t\treturn list;\n\t}", "printListData(){\n let current = this.head;\n while(current){\n console.log(current.data);\n current = current.next;\n }\n }", "function ampaeDisplayDataTop(val) {\n var r = '<a href=\"'+val.link+'\">'+val.value+'</a>';\n return r + '\\n';\n}", "renderJourney(j, extended) {\n var items = [];\n var count = 0;\n for(var s of j.getSegments()){\n count++;\n var k = s.getIdentifier();\n\n items.push(<SegmentInfo cmodel={this.state.cmodel} segment={s} compare={extended ? true : false} />);\n }\n\n return <ul>{items}</ul>;\n\n }", "function getAPDescription(ap) {\n if(ap.isComposite) {\n return \"(\" +\n ap.childrenAPs.map(function (t) {return getAPDescription(t);}).join(\" & \") +\n \")>\" + ap.nToOnePipe;\n }\n else{\n var pipes = ap.pipes?ap.pipes.join(\" > \"):\"\";\n if(pipes) {\n pipes = \" > \" + pipes;\n }\n\n var options = \"\";\n if(ap.options) {\n for(var p in ap.options) {\n if(options) {\n options += \"; \";\n }\n options += p+\": \"+ap.options[p];\n }\n if(options) {\n options = \"[\" + options + \"]\";\n }\n }\n\n return ap.description+options + pipes;\n }\n }", "printListData() {\n let current = this.head;\n while(current) {\n console.log(current.data);\n current = current.next;\n }\n }", "function displayDoctors() {\n\n // Reading Doctors file.\n var d = readFromJson('doc');\n\n // For loop to run till all the doctor's are printed.\n for (var i = 0; i < d.doctors.length; i++) {\n\n // Printing doctor's id, name & speciality.\n console.log(d.doctors[i].id + \". \" + d.doctors[i].name + \" (\" + d.doctors[i].special + \")\");\n }\n}", "printListData() {\n let current = this.head;\n while (current) {\n console.log(current.data);\n current = current.next;\n }\n }", "function getEventDets(obj) {\n\t// just logging it to the console for now :)\n\tconsole.log(obj);\n}", "function getTodoListInfo(el) {\n const linkToDataControl = $('#' + $(el)[0].settings.linkToDataControl);\n const total = linkToDataControl[0].settings.sourceObject.settings.total;\n var r;\n var selectedItems;\n if (linkToDataControl.hasClass('multiselect-mode')) {\n // Using multi-select checkboxes, so find how many are checked.\n r = {\n total: $(linkToDataControl).find('.multiselect:checked').length,\n totalAsText: $(linkToDataControl).find('.multiselect:checked').length,\n message: indiciaData.lang.recordsMover.recordsMoverDialogMessageSelected,\n ids: []\n };\n selectedItems = $(linkToDataControl).find('.multiselect:checked').closest('tr,.card')\n $.each(selectedItems, function eachRow() {\n const doc = JSON.parse($(this).attr('data-doc-source'));\n r.ids.push(parseInt(doc.id, 10));\n });\n } else {\n // Not using multi-select checkboxes, so return count of all records in filter.\n r = {\n total: total.value,\n totalAsText : (total.relation === 'gte' ? 'at least ' : '') + total.value,\n message: indiciaData.lang.recordsMover.recordsMoverDialogMessageAll\n }\n }\n r.message = r.message.replace('{1}', r.totalAsText);\n return r;\n }", "function reportDetail(filters) {\n return reportDao.reportDetail(filters);\n}", "printLinks() {\n this.links.forEach((link) => console.log(link));\n }", "function printData(data) {\n // console.log(data)\n var show = '';\n data.forEach(function (val) {\n // Store data in variable\n show += `\n <br><br>\n <ul>\n <li><h5>Id:</h5> ${val.id}</li>\n <br>\n <li><h5>Title:</h5> ${val.title}</li>\n <br>\n <li><h5>Source:</h5> ${val.source}</li>\n <br>\n <li><h5>Company:</h5> ${val.company}</li>\n <br>\n <li><h5>Location:</h5> ${val.location}</li>\n <br>\n <li><a href=\"${val.url}\">Click to visit</a></li>\n <br>\n <li><h5>Summary:</h5> ${val.summary}</li>\n </ul>\n <br><hr>\n `\n // console.log(val.id)\n })\n // Showing on UI\n output.innerHTML = show;\n}", "get metaData() {\n console.log(`Type: ${this.type}, Legs: ${this.legs}`);\n }", "function log() {\n console.log(\"portalOpenInstances ----------\");\n console.log(portalOpenInstances.openInstances.length);\n portalOpenInstances.openInstances.forEach(function (p) {\n return console.log(p);\n });\n console.log(\"end portalOpenInstances ----------\");\n}", "function makeDetailHtml(data){\r\n var count = 0;\r\n var i = 0;\r\n var html = '<div style=\"display: none; \" class=\"detail_info\" id=\"detail_info_' + data.index + '\">'\r\n // id\r\n html += '<p class=\"detail_id\">id: DOID:' + data.info.id + '</p>';\r\n // name\r\n html += '<p class=\"detail_name\">name: ' + data.info.name + '</p>';\r\n //def\r\n if (data.info.definition != null){\r\n // html += '<p class=\"detail_def\">def: ' + data.info.definition + '</p>';\r\n var s=data.info.definition;\r\n if(s.match('url')){\r\n var t1=s.substring(s.lastIndexOf('[')+1,s.lastIndexOf(']'));\r\n var t2=s.substring(0,s.lastIndexOf('['));\r\n var txt=t2.substring(1,t2.length-2);\r\n html += '<p class=\"detail_def\">def: '+ txt+'url:';\r\n if(t1.match(',')){\r\n var t=t1.split(',');\r\n count=t.length;\r\n for(i=0;i < count;i++){\r\n if(t[i].match('http')){\r\n html+='<a href=\"'+makeUrl(t[i])+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t[i])+'</a>'+(i==(count-1)? '&nbsp;':'&nbsp;|&nbsp;'); \r\n }\r\n } \r\n }else{\r\n html +='<a href=\"'+makeUrl(t1)+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t1)+'</a>';\r\n }\r\n html+='</p>';\r\n }\r\n } \r\n // alt_id\r\n if (data.info.alt_ids != null){\r\n count = data.info.alt_ids.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_alt_id\">alt_id: DOID:' + data.info.alt_ids[i].alt_id + '</p>';\r\n }\r\n } \r\n // subset\r\n if (data.info.subsets != null){\r\n count = data.info.subsets.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_subset\">subset: ' + data.info.subsets[i].subset + '</p>';\r\n }\r\n }\r\n // synonym\r\n if (data.info.synonyms != null){\r\n count = data.info.synonyms.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_synonym\">synonym: ' + data.info.synonyms[i].synonym + '</p>';\r\n }\r\n } \r\n // xref\r\n if (data.info.xrefs != null){\r\n count = data.info.xrefs.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_xref\">xref: ' + data.info.xrefs[i].xref_name + ':' + data.info.xrefs[i].xref_value + '</p>';\r\n }\r\n } \r\n // relations\r\n if (data.info.relations != null){\r\n count = data.info.relations.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_relation\">' + data.info.relations[i].relation + ': ' + data.info.relations[i].term2_id + '</p>';\r\n }\r\n }\r\n html += '</div>';\r\n return html;\r\n}", "list() {\n for (let i = 0, len = this._healthyGateways.length; i < len; i++) {\n let gtw = this._healthyGateways[i];\n console.log(`${i}: ${gtw.provider}: ${gtw.getUrl()}`);\n }\n \n return this._healthyGateways;\n }", "bindReporting () {\n if (!this.isParent) return;\n ['focus', 'blur'].forEach(eventName => {\n this.on(`hostedField:${eventName}`, ({ type }) => {\n const state = this.hostedFields.state[type];\n let meta = pick(state, ['type', 'valid', 'empty']);\n if (state.brand) meta.brand = state.brand;\n this.report(`hosted-field:${eventName}`, meta);\n });\n });\n }", "async viewHistory(ctx, drugName, serialNo) {\n //Making the key to retrive the details of the drug\n const drugKey = await ctx.stub.createCompositeKey('org.pharma-network.pharmanet.lists.drug', [drugName, serialNo]);\n let historyResult = await ctx.stub.getHistoryForKey(drugKey).catch(err => console.log(err));\n //declaring an empty array\n let array = [];\n //while condtion to iterate over the itertaor\n while (true) {\n var data = await historyResult.next();\n //If iterator has a value\n if (data.value) {\n let historyResultObject = {\n transactionId: data.value.tx_id,\n history: data.value.value.toString('utf8')\n };\n array.push(historyResultObject);\n }\n if (data.done) {\n await historyResult.close();\n //return array\n return array;\n }\n }\n\n }", "get importedTakeInfos() {}", "function get_trail_links_(row_div){\n // extract the link for non-closed trails\n var child_divs = row_div.getElements('div')\n var rval = []\n for(var i = 0; i < child_divs.length; i += 2) {\n if(child_divs[i+1].getElement('a')) {\n rval.push(child_divs[i+1].getElement('a').getAttribute('href').getValue())\n }\n }\n return rval\n}", "function getProcessResults() {\n StatusService.stopWaiting();\n getFlowRows();\n if ( $scope.paramGrid.dissipation) {\n $scope.compositionFlow = CompositionFlowService.get($scope.process.compositionFlowID);\n $scope.paramGrid.dissipation.extractData();\n }\n getLciaResults();\n }", "function listTrainer(props){\n let trainerList =[]\n for (let group of Object.values(pokemon)){\n \n trainerList.push(group.trainer)\n }\n return trainerList\n}", "getBreadcrumbParentPart() {\n let breadcrumb = [];\n let parent_links = this.getParentPaths(this.$route.name, this.$route.path);\n\n for(let item in parent_links) {\n let parent_link = parent_links[item];\n let name = parent_link.url.replace(/^\\/|\\/$/g, \"\").split(\"/\").last;\n let name_1;\n\n if(this.data.parent_instances[parent_link.url]) {\n name_1 = this.data.parent_instances[parent_link.url].getViewFieldValue();\n }\n\n breadcrumb.push({\n name: name_1 || name,\n link: parent_link.url.replace(/\\/$/g, \"\"),\n });\n }\n\n return breadcrumb;\n }", "printListData() {\n let current = this.head;\n\n while (current) {\n console.log(current.data);\n current = current.next;\n }\n }", "function renderABResults(data) {\n\tvar results = data.results.bindings;\n\n\t$(\"#out\").html(\"\");\n\tfor (var i=0; i < results.length; i++) {\n\t\trenderCoreInfo(results[i].s.value, results[i].o.value, function(entityID, element){\n\t\t\tfindAliases(entityID, element);\n\t\t});\n\t\t\n\t}\n\t$(\"#result\").slideDown('200');\n}", "function viewDepts() {\n let query = `SELECT id as ID, name as \"DEPARTMENT NAME\" FROM department;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "async cmd_ad_journey(params) {\n return this.query({\n url: \"/user/watchadviewed/\",\n body: {\n shorten_journey_id: 1,\n },\n })\n }", "getOptionsBreakdown() {\n const { includePhantoms, question: { options, answers } } = this.props;\n const breakdown = { length: answers.length };\n options.forEach((option) => {\n breakdown[option.id] = { count: 0, names: [] };\n });\n answers.forEach((answer) => {\n answer.selected_options.forEach((selectedOption) => {\n if (!includePhantoms && answer.phantom) { return; }\n breakdown[selectedOption].count += 1;\n breakdown[selectedOption].names.push(answer.course_user_name);\n });\n });\n return breakdown;\n }", "function moreInfo() {\n return new Promise(function (resolve, reject) {\n fetch_data(whoisURL)\n .then(function(data) {\n display_whois(ID_whois,data.responseText)\n fetch_data(vtURL)\n .then(function(data) {\n display_vt(ID_vt,data.responseText);\n var elmnt = document.getElementById(ID_scroll);\n elmnt.scrollIntoView();\n resolve();\n }).catch(function(data) {\n console.warn (\"Error showing VirusTotal info\");\n });\n }).catch(function(data) {\n console.warn (\"Error showing Whois info\");\n });\n });\n}", "function calculateDrinkDetails() {\n\n\t//Calculate drinks taken today & set html text\n\tvar drinksToday = getDrinksToday();\n\t\n\t//Calculate time since last drink\n\tvar timeSinceLastDrinkString = getTimeSinceLastDrink();\n\n\t//Calculate duration of drink\n\tvar durationOfDrink= getDurationOfDrink();\n\n\treturn [drinksToday, timeSinceLastDrinkString, durationOfDrink];\n\n}", "aboutVehicle() {\n console.log(`${type}, ${this.manufacturer}, ${this.numWheels}`)\n }", "function getItemListings() {\n\tconsole.log(\"Get Item Listings Button Pressed.\");\n}", "function showDetails(row){\n\tvar controller = View.controllers.get('abGbRptFpSrcCatCtrl');\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClauses(controller.consoleRestriction);\n\tif(typeof(row) == \"object\" && typeof(row) != \"string\" && row != \"total_row\" ){\n\t\tif(valueExistsNotEmpty(row[\"bl.site_id\"])){\n\t\t\trestriction.addClause(\"bl.site_id\", row[\"bl.site_id\"], \"=\", \"AND\", true);\n\t\t}\n\t\tif(valueExistsNotEmpty(row[\"gb_fp_totals.calc_year\"])){\n\t\t\trestriction.addClause(\"gb_fp_totals.calc_year\", row[\"gb_fp_totals.calc_year\"], \"=\", \"AND\", true);\n\t\t}\n\t}\n\tcontroller.abGbRptFpSrcCat_bl.addParameter(\"isGroupPerArea\", controller.isGroupPerArea);\n\tcontroller.abGbRptFpSrcCat_bl.refresh(restriction);\n\tshowReportColumns(controller.abGbRptFpSrcCat_bl);\n\tcontroller.abGbRptFpSrcCat_tabs.selectTab(\"abGbRptFpSrcCat_bl_tab\");\n}", "function getConatinerDetails(containernumber,whLocation)\n{\n\tvar filters = new Array();\t\n\t//filters.push(new nlobjSearchFilter('custrecord_ad_sf_ld_closed', null, 'is', 'F'));\n\tif(containernumber!=null && containernumber!='' && containernumber!='null' && containernumber!='undefined')\n\t\tfilters.push(new nlobjSearchFilter('custrecord_wmsse_appointmenttrailer', null, 'is', containernumber));\n\tif(whLocation!=null && whLocation!='' && whLocation!='null' && whLocation!='undefined')\n\t\tfilters.push(new nlobjSearchFilter('custrecord_wmsse_sitetrailer', null, 'anyof', ['@NONE@',whLocation]));\n\t\n\tfilters.push(new nlobjSearchFilter('isinactive', null, 'is', 'F'));\n\t\n\t/*var vcolumns = new Array();\n\t\tvcolumns.push(new nlobjSearchColumn('custrecord_wmsse_trlnumber',null,'group'));*/\t\n\t\n\tvar ContainerDetails = new nlapiSearchRecord('customrecord_wmsse_trailer',null, filters, null);\n\treturn ContainerDetails;\n}", "function log$1() {\n console.log(\"portalOpenInstances ----------\");\n console.log(portalOpenInstances.openInstances.length);\n portalOpenInstances.openInstances.forEach(function (p) {\n return console.log(p);\n });\n console.log(\"end portalOpenInstances ----------\");\n}", "function displayInfo(raw){\n var info = document.getElementById('info');\n while(info.hasChildNodes()){\n info.removeChild(info.childNodes[0]);\n }\n if(typeof(raw)=='string'){\n info.innerHTML = raw;\n return;\n } \n // Triggers:\n if(raw.house){\n // ID and Label\n var d0 = document.createElement('div');\n d0.innerHTML = `\n <div class='listItem'>Name:&nbsp;${raw.label}</div>\n <div class='listItem'>ID:&nbsp;${raw.id}</div>\n `;\n \n var d1 = document.createElement('details');\n var s1 = document.createElement('summary');\n s1.innerHTML = 'Basic Info';\n d1.appendChild(s1);\n d1.open = true;\n const tags = raw.tags.join(',&nbsp')\n repeatType = raw.repeat==0 ? 'one time OR' : raw.repeat==1 ? 'one time AND' : 'repeating OR' ;\n d1.innerHTML += `\n <div class='listItem'>House: ${raw.house}</div> \n <div class='listItem'>Repeat: ${raw.repeat} (${repeatType})</div>\n <div class='listItem'>Tags: ${tags} </div>`\n if(raw.link.trim() != '<none>'){\n console.log(raw.link);\n d1.innerHTML += `\n <div class='listItem'>Link Trigger: ${raw.link}</div>`\n }\n easy = raw.easy?'green':'red';\n normal = raw.normal?'green':'red';\n hard = raw.hard?'green':'red';\n disabled = raw.disabled?'red':'green';\n d1.innerHTML += `<div class='listItem'>Difficulty:&nbsp;<span class='${easy}'>Easy</span>&nbsp;&nbsp;<span class='${normal}'>Normal</span>&nbsp;&nbsp;<span class='${hard}'>Hard</span></div>`;\n d1.innerHTML += `<div class='listItem'>Disabled:&nbsp;<span class='${disabled}'>${raw.disabled?\"True\":\"False\"}</span></div>`;\n \n // events\n var d2 = document.createElement('details');\n var s2 = document.createElement('summary');\n s2.innerHTML = `Events`;\n d2.appendChild(s2);\n d2.open = true;\n\n for(var i=0;i<raw.events.length;i++){\n var t = raw.events[i].type;\n var d = document.createElement('div');\n d.className = 'listItem';\n d.innerHTML += `Event ${i}: ${events[t].name}`;\n d.title = `${t}: ${events[t].description}`;\n // check if the events type has more than 2 variables in its parameter\n if(events[t].p[0] > 0){\n d.innerHTML += ` ${raw.events[i].p[0]} ${raw.events[i].p[1]}`;\n }else{\n d.innerHTML += ` ${raw.events[i].p[0]}`\n }\n d2.appendChild(d);\n }\n\n //actions\n var d3 = document.createElement('details');\n var s3 = document.createElement('summary');\n s3.innerHTML = `Actions`;\n d3.appendChild(s3);\n d3.open = true;\n for(var i=0;i<raw.actions.length;i++){\n var t = raw.actions[i].type;\n var d = document.createElement('div');\n d.innerHTML += `Action ${i}: ${actions[t].name}`;\n d.className = 'listItem';\n d.title = `${t}: ${actions[t].description}`;\n for(j=0;j<7;j++){\n if(actions[t].p[j]>0){\n if(j!=6) d.innerHTML += ` ${raw.actions[i].p[j]}`;\n else d.innerHTML += ` @${wp(raw.actions[i].p[j])}`;\n }\n }\n d3.appendChild(d);\n }\n info.appendChild(d0);\n info.appendChild(d1);\n info.appendChild(d2);\n info.appendChild(d3);\n /*\n var d4 = document.createElement('details');\n var s4 = document.createElement('summary');\n s4.className = 'collapsible';\n s4.innerHTML = 'Neighbouring Nodes'\n \n d4.appendChild(s4);\n for(var item of raw.neighbour){\n var d = document.createElement('div');\n d.className = 'listItem';\n d.innerHTML = `neighbour: ${item}`;\n d4.appendChild(d);\n }\n info.appendChild(d4);*/\n \n }else{\n info.innerHTML = `\n Variable <br> \n Name:&nbsp;${raw.label}<br>\n ID:&nbsp;${raw.id}<br>\n Initial Value:&nbsp;${raw.initValue}`;\n \n }\n}", "getAll () {\n View.out('----------- Teams -----------' + View.NEWLINE())\n View.out(this.getTeams())\n View.out(View.NEWLINE() + '----------- Games -----------' + View.NEWLINE())\n View.out(this.getGames())\n View.out(View.NEWLINE() + '----------- Canterbury Geams -----------' + View.NEWLINE())\n View.out(this.getCanterburyGames('Canterbury') + View.NEWLINE())\n View.out('----------- Crossover Games -----------' + View.NEWLINE())\n View.out(this.getCrossOverGames())\n }", "print() {\n let current;\n let linkliststr = '';\n if (this.head === null) {\n console.log('List Empty');\n } else {\n current = this.head;\n while (current !== null) {\n linkliststr += `${current.value}->`;\n current = current.next;\n }\n }\n console.log(linkliststr + 'null');\n }", "renderSummaryDetails() {\n\t\tlet imageSection = null;\n\t\tif (this.state.currentSidewalk.lastImage) {\n\t\t\timageSection = (\n\t\t\t\t<div className=\"drawerImageSection\">\n\t\t\t\t\t<img className=\"img-responsive\" alt=\"sidewalk-preview\" src={this.state.currentSidewalk.lastImage.url} />\n\t\t\t\t</div>\n\t\t\t)\n\t\t} else {\n\t\t\timageSection = <h4>There are no uploaded images for this sidewalk.</h4>;\n\t\t}\n\n\t\tlet velocityText;\n\t\tif (this.state.currentSidewalk.averageVelocity > 0) {\n\t\t\tvelocityText = `The average pedestrian velocity on this sidewalk is ${this.state.currentSidewalk.averageVelocity} metres per second.;`;\n\t\t} else {\n\t\t\tvelocityText = \"No data has been recorded for the average pedestrian velocity of this sidewalk.\";\n\t\t}\n\t\t\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h3 className=\"streetNameSection\">\n\t\t\t\t\t{this.state.address}\n\t\t\t\t</h3>\n\t\t\t\t<hr />\n\t\t\t\t\t{imageSection}\n\t\t\t\t<hr />\n\t\t\t\t<h5>\n\t\t\t\t\t{velocityText}\n\t\t\t\t\t<div>\n\t\t\t\t\t\t{this.state.isLoggedIn && this.state.sidewalkHasCSVData && <CSVLink data={this.state.sidewalkCsvFormatted}>\n\t\t\t\t\t\t\t<Button bsStyle=\"primary\" className=\"sidewalkCsvButton\">\n\t\t\t\t\t\t\t\tExport CSV\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</CSVLink>}\n\t\t\t\t\t</div>\n\t\t\t\t</h5>\n\t\t\t</div>\n\t\t);\n\t}", "function getDrinks(event){\n if(document.getElementById(\"menu_drinks\").getAttribute(\"data-status\") === \"active\" && event !== \"filter\"){\n return;\n }\n\n document.getElementById(\"menu_beer\").setAttribute(\"data-status\", \"inactive\");\n document.getElementById(\"menu_wine\").setAttribute(\"data-status\", \"inactive\");\n document.getElementById(\"menu_drinks\").setAttribute(\"data-status\", \"active\");\n\n var str = \"item.itemKind.includes('Lik\\u00c3\\u00b6r') \"; // TODO: sökning efter faktiskt namn.\n var items = fetchFromDb(str);\n clearItems();\n printAllDrinks(items);\n update_view_dictionary();\n}", "async function getOpportunityDetails (req, res) {\n res.send(await service.getOpportunityDetails(req.authUser, req.params.opportunityId))\n}", "function detailFields(model) {\n return channel_1.LEVEL_OF_DETAIL_CHANNELS.reduce(function (details, channel) {\n var encoding = model.encoding;\n if (channel === 'detail' || channel === 'order') {\n var channelDef = encoding[channel];\n if (channelDef) {\n (vega_util_1.isArray(channelDef) ? channelDef : [channelDef]).forEach(function (fieldDef) {\n if (!fieldDef.aggregate) {\n details.push(fielddef_1.field(fieldDef, { binSuffix: 'start' }));\n }\n });\n }\n }\n else {\n var fieldDef = fielddef_1.getFieldDef(encoding[channel]);\n if (fieldDef && !fieldDef.aggregate) {\n details.push(fielddef_1.field(fieldDef, { binSuffix: 'start' }));\n }\n }\n return details;\n }, []);\n}", "helpData() {\n console.log(\"2) finsemble.bootConfig timeout values\");\n console.log(\"\\tstartServiceTimeout value\", this.startServiceTimeout);\n console.log(\"\\tstartComponentTimeout value\", this.startComponentTimeout);\n console.log(\"\\tstartTaskTimeout value\", this.startTaskTimeout);\n console.log(\"\");\n console.log(\"3) Current boot stage:\", this.currentStage);\n console.log(\"\");\n console.log(`4) Lastest/current status of dependencyGraph for ${this.currentStage} stage`, this.dependencyGraphs[this.currentStage].getCurrentStatus());\n console.log(\"\");\n console.log(\"5) Dependency graphs by stage\", this.dependencyGraphs);\n console.log(\"\");\n console.log(\"6) Boot config data by stage\", this.bootConfigs);\n console.log(\"\");\n console.log(\"7) Active Checkpoint Engines\", this.checkpointEngines);\n console.log(\"\");\n console.log(\"8) Registered tasks\", this.registeredTasks);\n console.log(\"\");\n console.log(\"9) List of outstanding start timers\", this.startTimers);\n console.log(\"\");\n console.log(\"10) Dependency graphs display by stage\");\n this.outputDependencyGraphs(this.dependencyGraphs);\n console.log(\"\");\n }", "get linkedServiceDescription() {\n return this.getStringAttribute('linked_service_description');\n }", "function viewDepts(){\n var query = connection.query(\"SELECT Department_ID, Department_Name FROM departments;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n superAsk();\n });\n }", "function pols_get_entrance(){\r\n\tvar links = this.geo_links_get_incoming();\r\n\t\r\n\tfor (var id in links){\r\n\t\tif (links[id].source_type == 'door'){\r\n\t\t\treturn {\r\n\t\t\t\ttsid: links[id].street_tsid,\r\n\t\t\t\tx: links[id].x,\r\n\t\t\t\ty: links[id].y\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn {};\r\n}", "getBuildBetaDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield this.client.get(`${this.apiEndPoint}/iris/v1/buildBetaDetails?filter%5Bbuild%5D=${this.buildId}&limit=28`);\n return response.data.data;\n });\n }", "getTabelasDeBancoDeDadosLinks() {\n let statement = this.statements['tabelasWiki'];\n\n return this._fetchWebApiResults(statement,['query','results'],{},'get', (data) => {\n let results = {'tabelas':[]};\n for (let key in data.query.results) {\n let tabelas = data.query.results[key].printouts['Possui direito de leitura em'];\n tabelas.forEach( (item) => {\n let nomeTabela = item['fulltext'];\n if (!results.tabelas.includes(nomeTabela)) results.tabelas.push(nomeTabela);\n } );\n }\n return results;\n });\n }", "function status(res,type) {\n let dataEntries = []\n // Recursively call Desk until there are no more pages of results\n let i = 1\n function getOpenCases() {\n desk.cases({\n labels:['Priority publisher,SaaS Ads,Direct publisher,Community publisher,Home,Community commenter'], \n status:['new,open'], \n sort_field:'created_at', \n sort_direction: 'asc',\n per_page:100, \n page:i\n }, function(error, data) {\n if (i <= Math.ceil(data.total_entries/100)) {\n dataEntries = dataEntries.concat(data._embedded.entries) \n i++\n getOpenCases()\n } else if (!data) {\n error()\n } else {\n filterSend(dataEntries)\n }\n });\n }\n getOpenCases()\n \n function getResolvedCases() {\n desk.get('cases',{\n labels:['Priority publisher,SaaS Ads,Direct publisher,Community publisher,Home,Community commenter'], \n status:['resolved'], \n sort_field:'created_at', \n sort_direction: 'asc',\n per_page:100\n }, function(error, data) {\n if (!data) {\n error()\n } else {\n }\n });\n }\n \n //getResolvedCases()\n\n function filterSend(dataEntries) {\n createStats(dataEntries)\n slackSend()\n }\n\n // Filter the data into seprate objects that correspond to each Desk filter\n function createStats(dataEntries) {\n var priorityFilter = dataEntries.filter(function(caseObj){\n return caseObj.labels.includes('Priority publisher') && !caseObj.labels.includes('SaaS Ads')\n })\n var saasFilter = dataEntries.filter(function(caseObj){\n return caseObj.labels.includes('SaaS Ads') && !caseObj.labels.includes('Ad Content Report')\n })\n var directFilter = dataEntries.filter(function(caseObj){\n return caseObj.labels.includes('Direct publisher') && !caseObj.labels.includes('Channel commenter') && !caseObj.labels.includes('SaaS Ads')\n })\n var communityFilter = dataEntries.filter(function(caseObj){\n return caseObj.labels.includes('Community publisher') && !caseObj.labels.includes('Priority publisher') && !caseObj.labels.includes('SaaS Ads')\n })\n var channelFilter = dataEntries.filter(function(caseObj){\n return caseObj.labels.includes('Home')\n })\n var commenterFilter = dataEntries.filter(function(caseObj){\n return caseObj.labels.includes('Community commenter')\n })\n\n // New cases stats only for further segments\n var priorityNew = priorityFilter.filter(function(caseObj){\n return caseObj.status.includes('new')\n })\n var saasNew = saasFilter\n .filter(function(caseObj){\n return caseObj.status.includes('new')\n })\n var directNew = directFilter.filter(function(caseObj){\n return caseObj.status.includes('new')\n })\n var communityNew = communityFilter.filter(function(caseObj){\n return caseObj.status.includes('new')\n })\n var channelNew = channelFilter.filter(function(caseObj){\n return caseObj.status.includes('new')\n })\n var commenterNew = commenterFilter.filter(function(caseObj){\n return caseObj.status.includes('new')\n })\n\n // Open cases stats using complicated maths\n var priorityOpen = priorityFilter.length - priorityNew.length\n var saasOpen = saasFilter.length - saasNew.length\n var directOpen = directFilter.length - directNew.length\n var communityOpen = communityFilter.length - communityNew.length\n var channelOpen = channelFilter.length - channelNew.length\n var commenterOpen = commenterFilter.length - commenterNew.length\n\n // Object so we can easily build the slack message\n // Format: {\"Filter Name\": All cases, New cases, Open cases, \"Needs attention\" threshold for each filter}\n stats = {\n Priority:[priorityFilter.length,priorityNew.length,priorityOpen,10],\n \"Saas & Ads\":[saasFilter.length,saasNew.length,saasOpen,30],\n Direct:[directFilter.length,directNew.length,directOpen,30],\n Community:[communityFilter.length,communityNew.length,communityOpen,30],\n Channel:[channelFilter.length,channelNew.length,channelOpen,30],\n Commenter:[commenterFilter.length,commenterNew.length,commenterOpen,60],\n // Twitter: [dmCounter, dmCounter, dmCounter, 3],\n }\n }\n // Build and send the message with data from each filter\n function slackSend() {\n var total = 0\n var attachments = []\n var statusColor\n Object.keys(stats).map(function(objectKey, i) {\n total += stats[objectKey][0]\n if (stats[objectKey][0] > stats[objectKey][3]) {\n statusColor = disqusRed\n statusIcon = \"🔥\"\n } else if (stats[objectKey][0] <= 5) {\n statusColor = disqusGreen\n statusIcon = \":partyporkchop:\"\n } else {\n statusColor = disqusGreen\n statusIcon = \"🆒\"\n }\n attachments.push({\n \"fallback\": stats[objectKey][0] + \" total\" + stats[objectKey][1] + \" new\" + stats[objectKey][2] + \" open\",\n \"color\": statusColor, \n \"title\": statusIcon + \" \" + objectKey + \": \" + stats[objectKey][0],\n \"text\": stats[objectKey][1] + \" new, \" + stats[objectKey][2] + \" open\"\n })\n });\n \n let statusMessage = {\n \"response_type\": \"in_channel\",\n \"text\": total + \" total cases right now.\",\n \"attachments\": attachments\n }\n // depending on request origin, also send the response as webhook for daily notifications\n if (type === 'notification') {\n webhook({text:\"Morning report incoming!\"});\n webhook(statusMessage);\n }\n res.send(statusMessage);\n // TODO Write function that stores this data to database\n //store(stats);\n }\n}", "function showDetails($vp) {\n var state = requests.getState();\n $('#processing').html(Object.keys(state.processingHosts).length);\n $('#queued').html(Object.keys(state.queuedHosts).length);\n $('#processed').html(Object.keys(state.allHops).length);\n\n if (freeze) {\n return;\n }\n\n var toshow, t, table = '<table><tr>', tdata = '', c;\n switch ($('#toView').val()) {\n case 'processing':\n toshow = processing;\n break;\n case 'completed':\n toshow = completed;\n break;\n default:\n toshow = $.extend({}, processing, completed);\n }\n\n $vp.html('');\n for (t in toshow) {\n c = (processing[t] ? 'processing' : 'completed');\n table += '<th class=\"' + c + '\">' + t + '</th>';\n var update = toshow[t];\n tdata += '<td class=\"' + c + '\">' + (\n $('#traceView').val() === 'details' ? summarizeUpdate(update)\n : '<pre>' + update.buffer + '</pre>'\n ) + '</td>';\n }\n $vp.append(table + '</tr><tr>' + tdata + '</tr></table>');\n }", "function GetDetailsVehicle(name, model, price, onRoadPrice, color) {\n\n console.log(`Name : ${name}`)\n console.log(`Model : ${model}`)\n console.log(`price : ${price}`)\n console.log(`onRoadPrice : ${onRoadPrice}`)\n console.log(`Color : ${color}`)\n \n console.log(`Brand : ${this.Brand}`) \n console.log(`Mileage : ${this.Mileage}`) \n console.log(`Fuel Type : ${this.FuelType}`) \n}", "function getDataPipelineStatus(pipelineId,datapipeline,pipelineName,pipelineAction,callback) {\n \n console.log('STATE-STATUS');\n var paramsPS = {\n pipelineIds: [ pipelineId ]\n };\n datapipeline.describePipelines(paramsPS, function(err, data) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n callback(err);\n }\n else { \n console.log(data); // successful response\n var keyName = 'None';\n if (pipelineAction==\"STATE\") {\n keyName = \"@pipelineState\";\n } else {\n keyName = \"@healthStatus\";\n }\n var keyValue = 'None';\n for (var i in data.pipelineDescriptionList){\n for ( var j in data.pipelineDescriptionList[i].fields){\n if (data.pipelineDescriptionList[i].fields[j].key == keyName) {\n keyValue = data.pipelineDescriptionList[i].fields[j].stringValue;\n console.log('Pipeline ' + pipelineAction + ' - ' + keyValue );\n }\n }\n }\n if (keyValue == 'None') {\n callback('Error in getting status'); \n }else {\n var output = {\n result : keyValue\n };\n callback(null, output); \n }\n }\n });\n\n}", "function linkInfo(d) { // Tooltip info for a link data object\n return \"Link:\\nfrom \" + d.from + \" to \" + d.to;\n}", "function getBeers(event){\n if(document.getElementById(\"menu_beer\").getAttribute(\"data-status\") === \"active\" && event !== \"filter\"){\n return;\n }\n\n document.getElementById(\"menu_beer\").setAttribute(\"data-status\", \"active\");\n document.getElementById(\"menu_wine\").setAttribute(\"data-status\", \"inactive\");\n document.getElementById(\"menu_drinks\").setAttribute(\"data-status\", \"inactive\");\n\n var str = \"item.itemKind.includes('') \"; // TODO: sökning efter faktiskt namn.\n var items = fetchFromDb(str);\n clearItems();\n printAllDrinks(items);\n update_view_dictionary();\n}", "function getAdvices(from, to) {\n console.log('getAdvices', from, to);\n\n page = webpage.create();\n page.open('http://www.goodfuckingdesignadvice.com/advice/' + from, function (){\n var data = page.evaluate(function () {\n return {\n id: document.querySelector('.id').innerText.replace(/[^0-9]/g, \"\"),\n text: document.querySelector('h1').innerText,\n html: document.querySelector('h1').innerHTML\n }\n });\n\n var file = fs.open(\"advices.txt\", \"a\");\n file.write(data.id + ' : ' + JSON.stringify(data) + ', \\n');\n file.close();\n\n console.log(JSON.stringify(data));\n\n if(from < to) {\n getAdvices(from+1, to);\n } else {\n phantom.exit();\n }\n });\n}", "gatherData(exchange, context) {\n exchange.filtered = true;\n const pid = context.pid;\n return this.davis.dynatrace.problemDetails(pid)\n .then((ret) => {\n exchange.addContext({ problem: ret });\n });\n }", "function detailer(parent, jsondata) {\n\n\t\t\t\t\tObject.keys(jsondata).map((val, ind, arr) => {\n\t\t\t\t\t\tif (jsondata[val] !== null && val !== \"json_string\" && val !== \"language\" && val !== \"image_url\" && val !== \"url\"){\n\t\t\t\t\t\t\tlet detail = document.createElement(\"li\");\n\t\t\t\t\t\t\tdetail.id = (val + \"-details\");\n\t\t\t\t\t\t\tdetail.innerHTML = (val.toUpperCase() + \": \" + jsondata[val]);\n\t\t\t\t\t\t\tparent.appendChild(detail);\n\t\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\tfunction makeEle(){\n\t\t\t\t\t}\n\t\t\t\t}//detailer", "function groupInfo(adornment) { // takes the tooltip or context menu, not a group node data object\n var g = adornment.adornedPart; // get the Group that the tooltip adorns\n var mems = g.memberParts.count;\n var links = 0;\n g.memberParts.each(function(part) {\n if (part instanceof go.Link) links++;\n });\n return \"Group \" + g.data.key + \": \" + g.data.text + \"\\n\" + mems + \" members including \" + links + \" links\";\n }", "function getAllDirectors(data){\n return data.map(function(el) {\n return el.director\n })\n}", "function getStepsStructure(dataObject){\n\tvar structure = dataObject[\"structure\"];\n\tvar steps = structure[\"steps\"];\n\treturn steps;\n}", "function printTravelLog(rover){\n var coordinates = '';\n rover.travelLog.forEach(function(item, index){\n if (index % 2 === 0){\n coordinates += '(' + item + ',';\n } else if (index % 2 !== 0){\n coordinates += item + ') ';\n }\n });\n console.log(rover.name + ' tracking: ' + coordinates); \n}", "renderDetails() {\r\n console.log(`${this.name}: ${this.role}`);\r\n }", "function getById(){\n var id = $scope.profile._id\n advisor.getById(id).then(function (response){\n if(response.data.success){\n $scope.advisorData = response.data.data\n $scope.advisorData.address = response.data.data.address[0]\n //$scope.advisorData.use_logo = $scope.advisorData.use_logo.toString();\n console.log($scope.advisorData)\n }\n })\n }", "printList() {\n var curr = this.head;\n var str = \"\";\n while (curr) {\n str += curr.data + \"-->\";\n curr = curr.next;\n }\n console.log(str);\n }", "function getSourceDataList(el, response) {\n if (el.settings.sourceObject.settings.aggregation) {\n // Aggregated data so use the buckets.\n return indiciaFns.findValue(response.aggregations, 'buckets');\n }\n // A standard list of records.\n return response.hits.hits;\n }", "getLikedByInformation() {\r\n return this.clone(Item, \"likedByInformation\").expand(\"likedby\").getCore();\r\n }", "function getAllLeadsInfo() {\n \n var urrl = window.location.href; \n var serached = urrl.substr(urrl.search(\"leads\"), urrl.lastIndexOf(\"edit\"));\n // alert(urrl.search(\"leads\"));\n // alert(urrl);\n // alert(urrl.substr(urrl.search(\"leads\"), urrl.lastIndexOf(\"edit\")) );\n // alert(\"done\"+serached.match( numberPattern ));\n return $.ajax({\n method: \"GET\",\n url: \"/leads/edits/\"+serached.match( numberPattern ),\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n },\n success: function (response) {\n let result = JSON.parse(response);\n EditInfo = result['EditLeadInfo'];\n console.log('here get all edit leads info response: ', EditInfo);\n \n },\n error: function () {\n console.log('here get leads info error');\n }\n });\n }", "function extractData(html){\n let searchtool=cheerio.load(html);\n\n let part = searchtool('a[data-hover=\"View All Results\"]');\n let SourceLink=part.attr(\"href\");\n let FullLink=`https://www.espncricinfo.com${SourceLink}`;\n console.log(FullLink);\n\n //Now requesting on FullLink to obtain scorecard link array\n request(FullLink,AllScoreCardcb);\n}", "function getDataFromHarvest(){\n if (count >= ids.length){\n saveReportData();\n }else{\n harvest_options.url = harvestURL_pt1+ ids[count]+harvestURL_pt2;\n count++;\n request(harvest_options, addDataToArray);\n } \n }", "function printTicket(source,destination){\n console.log(travellingMode);\n console.log(source);\n console.log(destination);\n }", "function DeepDive(UrlParamaters){\n var date = formatDate()\n var airline = document.getElementById(\"Airline\").value\n var tail = document.getElementById(\"Tail\").value\n var flightId = document.getElementById(\"FlightId\").value\n var all = \".*\"\n setUserStateCookies(airline, tail, flightId, date)\n var InfoForDeepDiveFPMfast = CreateQueryInfo(\"mongoData\",airline,date,tail,\"FPMfastSES\",all)\n var InfoForFPMfastSESandUDPTraceTailHealth = CreateQueryInfo(\"FPMfastSESandUDPTrace\",airline,all,tail,\"UdpTraceSummary\",flightId)\n var InfoForLanIpGraph = CreateQueryInfo(\"mongoData\",airline,all,tail,\"EnglogEvents\",flightId,LanIpGraphSESOptions)\n var InfoForMonitSummaryTable = CreateQueryInfo(\"mongoData\",airline,all,tail,\"MonitSummary\",flightId, MonitSummaryTableOptions)\n var InfoForAAUGraphSES = CreateQueryInfo(\"mongoData\",airline,all,tail,\"AAUGraphSES\",flightId,AAUGraphSESOptions)\n var InfoForDeepDiveUsage = CreateQueryInfo(\"mongoData\",airline,all,tail,\"UsageSummary\",flightId)\n var InfoForWapData = CreateQueryInfo(\"mongoData\",airline,all,tail,\"WapData\",flightId)\n var InfoForUdpTraceSummary = CreateQueryInfo(\"mongoData\",airline,all,tail,\"UdpTraceSummary\",flightId)\n var InfoForUdpTraceBandwidthDetails = CreateQueryInfo(\"mongoData\",airline,all,tail,\"UDPTraceBandwidthDetails\",flightId,UDPTraceDetailGraphSESOptions)\n var InfoForPortalPlatformHttpStatusResponses = CreateQueryInfo(\"PortalPlatformHttpStatusResponses\",airline,all,tail,\"CVM_ACCESS\",flightId,PPOptions)\n var InfoForPortalPlatformData = CreateQueryInfo(\"PortalPlatformData\",airline,all,tail,\"CVM_ACCESS\",flightId,PPOptions)\n var InfoForPortalPlatformLineGraphData = CreateQueryInfo(\"PortalPlatformMethodGETTimeAndData\",airline,all,tail,\"CVM_ACCESS\",flightId,PPOptions)\n var InfoForPortalPlatformDeleteLineGraphData = CreateQueryInfo(\"PortalPlatformMethodDeleteTimeAndData\",airline,all,tail,\"CVM_ACCESS\",flightId,PPOptions)\n var InfoForPortalPlatformPutLineGraphData = CreateQueryInfo(\"PortalPlatformMethodPUTTimeAndData\",airline,all,tail,\"CVM_ACCESS\",flightId,PPOptions)\n var InfoForPortalPlatformLanIpOccurances = CreateQueryInfo(\"PortalPlatformGetRequestsByLanIp\",airline,all,tail,\"CVM_ACCESS\",flightId,PPOptions)\n var InfoForLogPurchaseCommandFromEnglog = CreateQueryInfo(\"LogPurchaseCommandFromEnglog\",airline,all,tail,\"EnglogEvents\",flightId,PPOptions)\n var InfoForGetEngNotes = CreateQueryInfo(\"EngNotesGet\",airline,date,tail,\"EngNotes\",flightId)\n cleanSfa()\n getTailIds()\n if(document.getElementById(\"Tail\").value){\n getFlightIds()\n }\n\n if(InfoForDeepDiveFPMfast.airline !== \"SPIRIT\"){\n InfoForDeepDiveFPMfast.parser = \"FPMfast\"\n } else {\n getLogPurchaseCommandFromEnglog(InfoForLogPurchaseCommandFromEnglog)\n // getPortalPlatformMethodPutTimeAndData(InfoForPortalPlatformPutLineGraphData)\n // getPortalPlatformMethodDeleteTimeAndData(InfoForPortalPlatformDeleteLineGraphData)\n // getPortalPlatformLanIpOccurances(InfoForPortalPlatformLanIpOccurances)\n // getPortalPlatformMethodGETTimeAndData(InfoForPortalPlatformLineGraphData)\n // getPortalPlatformData(InfoForPortalPlatformData)\n // getPortalPlatformHttpStatusResponses(InfoForPortalPlatformHttpStatusResponses)\n\n getFPMFastUdpTrace(InfoForFPMfastSESandUDPTraceTailHealth,FPMFastUdpTraceStruct,\"fpm_udptrace_table\")\n getDeepDiveDataUdptraceSummary(InfoForUdpTraceSummary)\n InfoForUdpTraceBandwidthDetails.options.chart.subtitle = InfoForUdpTraceBandwidthDetails.flightId\n getDeepDiveDataUdptraceDetails(InfoForUdpTraceBandwidthDetails)\n InfoForAAUGraphSES.options.chart.subtitle = InfoForAAUGraphSES.flightId\n getDeepDiveDataSpecificParserChart(InfoForAAUGraphSES,AAUGraphSESStruct,'aau_graph')\n }\n // getDeepDiveFPMfastSES(InfoForDeepDiveFPMfast)\n // getDeepDiveDataUsageSummary(InfoForDeepDiveUsage)\n getEngNotes(InfoForGetEngNotes)\n getEnglogEvents(InfoForLanIpGraph)\n getMonitSummary(InfoForMonitSummaryTable)\n //getDeepDiveDataSpecificParser has a dependency on the 1st arg having an options element\n /*getDeepDiveDataSpecificParser2(InfoForWapData,WapDataStruct,'wap_data')*/\n}", "async function getActivitiesPage( itcb ) {\n function onRawActivitiesLoaded( err, result ) {\n if( err ) {\n return itcb( err );\n }\n activities = result.result ? result.result : result;\n\n itcb( null );\n }\n\n const readConfig = promisifyArgsCallback( Y.doccirrus.api.incaseconfiguration.readConfig );\n let err, result, incaseconfig;\n\n [err, incaseconfig] = await formatPromiseResult(\n readConfig( {\n user: args.user\n } )\n );\n\n if( err ) {\n Y.log( `getCaseFileLight: Error in looking for incaseconfiguration. ${err.stack || err}`, 'error', NAME );\n return itcb( err );\n }\n\n let hideMedicationPlanMedications = incaseconfig.hideMedicationPlanMedications,\n medicationPlanQuery = Object.assign(\n {actType: {$in: ['MEDICATIONPLAN', 'MEDICATION']}},\n args.query\n ),\n filtered = [];\n\n if( hideMedicationPlanMedications ) {\n [err, result] = await formatPromiseResult(\n Y.doccirrus.mongodb.runDb( {\n user: args.user,\n model: 'activity',\n action: 'get',\n query: medicationPlanQuery,\n options: {\n select: {\n referencedBy: 1,\n activities: 1,\n actType: 1\n }\n }\n } )\n );\n\n if( err ) {\n Y.log( `getCaseFileLight: Error in looking for MEDICATIONPLAN. ${err.stack || err}`, 'error', NAME );\n return itcb( err );\n }\n\n if( result && result.length ) {\n let medicationPans = result.filter( i => 'MEDICATIONPLAN' === i.actType ).map( i => i._id.toString() );\n result.filter( i => 'MEDICATION' === i.actType ).forEach( ( i ) => {\n if( i.referencedBy && i.referencedBy.length ) {\n let isConnected = i.referencedBy.every( j => medicationPans.includes( j ) );\n\n if( isConnected ) {\n filtered.push( i._id.toString() );\n }\n }\n } );\n }\n }\n\n let\n getActivitiesQuery = Object.assign(\n {},\n args.query\n );\n\n if( filtered && filtered.length && hideMedicationPlanMedications ) {\n getActivitiesQuery.$and = [\n {_id: {$nin: filtered}}\n ];\n }\n\n args.options.lean = true;\n\n Y.doccirrus.mongodb.runDb( {\n user: args.user,\n model: 'activity',\n action: 'get',\n query: getActivitiesQuery,\n options: args.options,\n callback: onRawActivitiesLoaded\n } );\n }", "function viewDepartments() {\n connection.query(\"SELECT name FROM department\", (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n });\n // RETURN TO MAIN LIST\n runTracker();\n}", "function getTagsAndRoles(){\n if (!window.reportTagsAndRolesPage) {\n var myCols = [{title: \"Tags\",dataField: \"tags\",sort: \"r.rtag_name\",filtration: {name: \"r.rtag_name\",alias: \"Tags\"}\n\t \t }, {title: \"Roles\",dataField: \"roles\",sort: \"ro.role_name\",filtration: {name: \"ro.role_name\",alias: \"Roles\"}}\n//\t }, {title: \"Access Level\",dataField: function(o){return getAccess(o.accessLevel);},sort: \"rr.access_level\"\n//\t }, {title: \"Email\",dataField: function(o){return getEmail(o.email);},sort: \"rr.send_email\"}\n\t\t];\n if (adminTabInit.report != \"none\") {\n myCols.push({title: \"Edit\",dataField: function(o){return \"<img src=\\\"include/images/Edit-icon-s.png\\\" onclick=\\\"upReportTagsAndRoles(\" + o.id + \");\\\"/>\";}\n\t }, {title: \"Delete\",dataField: function(o){return \"<img src=\\\"include/images/reject16.png\\\" onclick=\\\"invoke('\\delReportTagsAndRoles(\" + o.id + \"\\)');\\\"/>\";}\n\t });\n }\n \n reportTagsAndRolesPage = new SANINCO.Page('__report_tagsAndroles', \"reportTagsAndRolesPage\", {\n sortingField: \"rr.created_timestamp\",\n sortingDirection: \"desc\",\n vo: \"viewReportAdminVO\",\n totalPageUri: actionUri.getReportAdminTagsAndRolesTotalPageNoUri,\n dataUri: actionUri.searchReportAdminTagsAndRolesUri,\n paginationDiv: \"__report_tagsAndroles_page\",\n recPerArray: [10, 15, 20, 30, 40, 50, 80, 100],\n cols: myCols,\n scrollTop: true\n });\n }\n \n reportTagsAndRolesPage.addSuccessEvent(function(data){\n tagsAndRolesDataString = data.data;\n });\n \n filter1 = new SANINCO.Filter();\n filter1.addEditeEvent(function(){\n reportTagsAndRolesPage.start();\n });\n filter1.add('r.rtag_name', 'String');\n filter1.add('ro.role_name', 'String');\n reportTagsAndRolesPage.setFilter(filter1);\n \n reportTagsAndRolesPage.start();\n}", "function getMoreLinks(){\n const moreNodeList = document.querySelectorAll('.link--has-other')[0].nextElementSibling.querySelectorAll('a');\n const temp = [];\n for(var i = 0; i < moreNodeList.length; i++) {\n let tempName = moreNodeList[i].innerText;\n // rename link names\n if(moreNodeList[i].innerText === \"VIP\") tempName = \"VIP Tickets\";\n if(moreNodeList[i].innerText === \"Deals\") tempName = \"Ticket Deals\";\n if(moreNodeList[i].innerText === \"For You\") tempName = \"Just For You\";\n // push them in\n temp.push({\n name: tempName,\n link: moreNodeList[i].href\n });\n }\n moreData.categories.list = temp;\n }", "getInitialChildModelLinks() {\n const listitemPanels = this.listitem\n ? this.listitem.links.getLinksByGroup(\"panel\").all\n : [];\n\n const links = [...super.getInitialChildModelLinks(), ...listitemPanels];\n\n if (this.hasResults) {\n if (this.results) {\n links.push(...this.results.getInitialChildModelLinks());\n }\n if (this.givenAnswers) {\n links.push(...this.givenAnswers.getInitialChildModelLinks());\n }\n }\n\n return links;\n }" ]
[ "0.5266271", "0.52337575", "0.50949556", "0.50354266", "0.50354123", "0.4953867", "0.49201727", "0.49186254", "0.49137583", "0.48746255", "0.4831739", "0.47993863", "0.47959682", "0.47596398", "0.4724484", "0.47126144", "0.4707885", "0.47018892", "0.46931022", "0.4689647", "0.46878603", "0.4680141", "0.4662496", "0.46537963", "0.4648183", "0.46472815", "0.46441674", "0.46413487", "0.46356916", "0.4615374", "0.4614902", "0.46098018", "0.46084496", "0.45928597", "0.4589432", "0.4588616", "0.457348", "0.45697004", "0.45695335", "0.4564168", "0.45628092", "0.45614976", "0.45534372", "0.45501798", "0.4550132", "0.45490035", "0.45488518", "0.4546157", "0.45258144", "0.45194852", "0.45107916", "0.4510723", "0.4510574", "0.4506671", "0.4506659", "0.45048112", "0.45022905", "0.4494906", "0.44923922", "0.44922054", "0.44890702", "0.44865182", "0.44813287", "0.448073", "0.44722927", "0.4471178", "0.44700867", "0.4469353", "0.4466094", "0.4461488", "0.44563994", "0.44551927", "0.44551802", "0.44516164", "0.4448379", "0.44454205", "0.44453782", "0.44452", "0.44412127", "0.4437098", "0.44370624", "0.44364893", "0.44356385", "0.4431289", "0.44268748", "0.44262493", "0.44254452", "0.44249746", "0.4423005", "0.44224906", "0.44219443", "0.44197878", "0.4419156", "0.44190162", "0.44174516", "0.44131258", "0.44127643", "0.44104522", "0.44097367", "0.44057843" ]
0.45172215
50
This function gives opportunity details in the pipe drill down
function drillOpp() { var hasOpp = false; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); var type = "Opportunities"; context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var oppTable = document.getElementById("drillTable"); // Remove all nodes from the drillTable <DIV> so we have a clean space to write to while (oppTable.hasChildNodes()) { oppTable.removeChild(oppTable.lastChild); } // Iterate through the Prospects list var listItemEnumerator = listItems.getEnumerator(); var listItem = listItemEnumerator.get_current(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Opportunity") { // Get information for each Opportunity var oppTitle = document.createTextNode(listItem.get_fieldValues()["Title"]); var oppPerson = document.createTextNode(listItem.get_fieldValues()["ContactPerson"]); var oppNumber = document.createTextNode(listItem.get_fieldValues()["ContactNumber"]); var oppEmail = document.createTextNode(listItem.get_fieldValues()["Email"]); var oppAmt = document.createTextNode(listItem.get_fieldValues()["DealAmount"]); drillTable(oppTitle.textContent, oppPerson.textContent, oppNumber.textContent, oppEmail.textContent, oppAmt.textContent, type, oppAmount); } hasOpp = true; } if (!hasOpp) { // Text to display if there are no Opportunities var noOpps = document.createElement("div"); noOpps.appendChild(document.createTextNode("There are no Opportunities.")); oppTable.appendChild(noOpps); } $('#drillDown').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get Opportunities. Error: " + args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "async function getOpportunityDetails (req, res) {\n res.send(await service.getOpportunityDetails(req.authUser, req.params.opportunityId))\n}", "getDetails(){\n return [ this.search,\n this.cost,\n this.state,\n this.children]\n }", "getPokeDetails(){\n let pokeData = this.props;\n return {\n name: pokeData.name,\n imgData: this.getPokeImgs(pokeData.sprites),\n type: this.getPokeType(pokeData.types),\n hp: pokeData.base_experience\n }\n }", "showDoctors(){\n var j=1;\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n }", "function getAPDescription(ap) {\n if(ap.isComposite) {\n return \"(\" +\n ap.childrenAPs.map(function (t) {return getAPDescription(t);}).join(\" & \") +\n \")>\" + ap.nToOnePipe;\n }\n else{\n var pipes = ap.pipes?ap.pipes.join(\" > \"):\"\";\n if(pipes) {\n pipes = \" > \" + pipes;\n }\n\n var options = \"\";\n if(ap.options) {\n for(var p in ap.options) {\n if(options) {\n options += \"; \";\n }\n options += p+\": \"+ap.options[p];\n }\n if(options) {\n options = \"[\" + options + \"]\";\n }\n }\n\n return ap.description+options + pipes;\n }\n }", "function trapItemDetails() {\n\n console.log(GM_info.script.name + ': trapItemDetails');\n\n //debugger;\n\n let parentDiv = $('div.ReactVirtualized__Grid').get();\n if (!validPointer(parentDiv) || !parentDiv.length) {return;}\n\n let owlItem = $(parentDiv).find('div.info___3-0WL').get();\n if (!owlItem.length || !validPointer(owlItem)) {return;}\n\n let clearfix = $(owlItem).find('div.info-content > div.clearfix.info-wrap')[0];\n if (!validPointer(clearfix)) {return;}\n\n //let pricingUl = $(clearfix).find('ul.info-cont')[0];\n //if (!validPointer(pricingUl)) {return;}\n\n let statsUl = $(clearfix).find('ul.info-cont.list-wrap')[0];\n if (!validPointer(statsUl)) {return;}\n\n let newItem = getNewItem();\n\n //getNameTypeItemInfo(owlItem, newItem);\n //getPricingInfo(pricingUl, newItem);\n getStatInfo(statsUl, newItem);\n\n console.log(GM_info.script.name + ': newItem: ', newItem);\n\n\n }", "function getDetails() {\n\n}", "function showPool(index, pool)\r\n{\r\n\t//TODO : rewrite this\r\n\tconsole.log('Id : ' + pool.index);\r\n\tconsole.log('State : ' + (pool.ended ? (pool.terminated ? (pool.moneySent ? \"money sent\" : \"winner picked\") : \"ended, waiting to pick winner\") : \"open\"));\r\n\tconsole.log('TicketPrice : ' + pool.ticketPrice.toString(10));\r\n\tconsole.log('CurrAmount : ' + pool.currAmount.toString(10));\t\r\n\tconsole.log('StartDate : ' + pool.startDate);\r\n\tconsole.log('Duration : ' + (pool.duration * 15) + ' s');\r\n\tconsole.log('EndDate : ' + pool.endDate);\r\n\tconsole.log('Winner : ' + pool.winner);\r\n}", "getDetails () {\n return {\n isDummy: true,\n turns: this.turns,\n currentTurn: this.currentTurn,\n status: this.status,\n lastRoll: this.lastRoll,\n isDiceRolled: this.isDiceRolled,\n hostId: this.hostId,\n cells: this._cells,\n players: this._players,\n didEatEnemyCoin: this._didEatEnemyCoin,\n coinJustReachedEnd: this._coinJustReachedEnd,\n noSelectionPossible: this._noSelectionPossible\n }\n }", "viewListInfo(){\n console.log(`${this.listName} List. Due : ${this.listDue}. Complete : ${this.isListComplete}. Number of tasks : ${this.tasks.length}.`);\n }", "aboutVehicle() {\n console.log(`${type}, ${this.manufacturer}, ${this.numWheels}`)\n }", "function directUserFromViewInfo() {\n if (nextStep == \"Departments\") {\n viewDepartments();\n }\n if (nextStep == \"Roles\") {\n viewRoles();\n }\n if (nextStep == \"Employees\") {\n viewEmployees();\n }\n if (nextStep == \"All Information\") {\n viewAll();\n } \n }", "printConcertInfo(data, maxEvents = this.maxEvents) {\n // let data = JSON.parse(body);\n // console.log(data);\n\n for (let i = 0; i < data.length && i < maxEvents; i++ ) {\n let element = data[i];\n let venue = element.venue;\n let location = [venue.city, venue.region, venue.country\n ].filter(e => e.length > 0).join(\", \");\n let date = this.moment(element.datetime).format(\"MM/DD/YYYY\");\n\n console.log(\"- \" + (i + 1) + \" -\");\n console.log(`\\tVenue: ${venue.name}`);\n console.log(`\\tLocation: ${location}`);\n console.log(`\\tDate: ${date}`);\n }\n }", "function viewInformation() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n Message: \"WHAT INFORMATION WOULD YOU LIKE TO DISPLAY?\",\n choices: [\"VIEW department\", \"VIEW role\", \"VIEW employee\"],\n })\n //==================IF YOU WANT TO VIEW THE DEPARTMENT===========\n .then(function (answer) {\n switch (answer.action) {\n case \"VIEW department\":\n viewDepartment();\n break;\n //========IF YOU WANT TO VIEW THE ROLE=============\n case \"VIEW role\":\n viewRole();\n break;\n //========IF YOU WANT TO VIEW THE EMPLOYEE===========\n case \"VIEW employee\":\n viewEmployee();\n break;\n }\n });\n}", "function getPlayerDetails() {\r\n\tgetJob();\r\n\tgetLevel();\r\n\tcreateStats(playerDetails.job, playerDetails.level);\r\n\tgetName();\r\n\tgetRace();\r\n\tgetGender();\r\n\tgetDefense();\r\n\tgetExp();\r\n}", "function pokemonAbilities(pokemon){\n\treturn response.abilities.forEach(function(ablilites){\n\t\tconsole.log(abilities.ability.name)\n\t})\n}", "function getDetails(t) {\n console.log('getDetails', t)\n // title content for mouseover\n\n var _dbotype = t.dbotype || \"\";\n var _group = t.group || \"\";\n var _name = t.name || \"\";\n var _label = t.label || _name;\n var _description = t.description || \"\";\n // var _startdate = t.startdate || \"\";\n // var _status = t.status || \"\";\n //var _colour = t.colour || \"\";\n var _color = t.color || \"\";\n var _id = t.id || \"\";\n\n var _preview = \"<h3>\" + _label + \"</h3>\" + \"\\n\\n<p>\" + _description + _color + \"</p>\\n\\n\";\n //console.log('_preview', _preview)\n return _preview\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 extractShowInfo(data) {\n\treturn {\n\t\ttitle: data.title,\n\t\tairday: data.airs.day,\n\t\tairtime: data.airs.time,\n\t\ttimezone: data.airs.timezone,\n\t\truntime: data.runtime,\n overview: data.overview\n\t};\n}", "function findPantryInfo() {\n user.pantry.forEach(item => {\n let itemInfo = ingredientsData.find(ingredient => {\n return ingredient.id === item.ingredient;\n });\n let originalIngredient = pantryInfo.find(ingredient => {\n if (itemInfo) {\n return ingredient.name === itemInfo.name;\n }\n });\n if (itemInfo && originalIngredient) {\n originalIngredient.count += item.amount;\n } else if (itemInfo) {\n pantryInfo.push({name: itemInfo.name, count: item.amount});\n }\n });\n let sortedPantry = pantryInfo.sort((a, b) => a.name.localeCompare(b.name));\n sortedPantry.forEach(ingredient => domUpdates.displayPantryInfo(ingredient))\n}", "function GetHotspot(Prop) {\n var TempText='';\n var HotspotNumber=-1;\n // Build CSV\n while (Hotspots[++HotspotNumber]) TempText=TempText+eval('Hotspots[HotspotNumber].'+Prop)+',';\n // Remove last comma\n return TempText.substring(0, TempText.length - 1);\n}", "presentation() {\n\t\tconsole.log('Le personnage s\\'appelle : ' + this.NAME);\n\t\tconsole.log('current ID : ' + this.ID);\n\t\tconsole.log('IMG : ' + this.IMG);\n\t\tconsole.log('DESC : ' + this.DESC);\n\t\tconsole.log(\"-----------\");\n\t}", "getDescription() {\n return \"Nom : \"+this.nom+\"\\nAge : \"+this.age+\"\\nProfession : \"+this.profession;\n }", "function deductibleDescription() { \n return gapPlanData.description();\n}", "function printTicket(source,destination){\n console.log(travellingMode);\n console.log(source);\n console.log(destination);\n }", "renderSummaryDetails() {\n\t\tlet imageSection = null;\n\t\tif (this.state.currentSidewalk.lastImage) {\n\t\t\timageSection = (\n\t\t\t\t<div className=\"drawerImageSection\">\n\t\t\t\t\t<img className=\"img-responsive\" alt=\"sidewalk-preview\" src={this.state.currentSidewalk.lastImage.url} />\n\t\t\t\t</div>\n\t\t\t)\n\t\t} else {\n\t\t\timageSection = <h4>There are no uploaded images for this sidewalk.</h4>;\n\t\t}\n\n\t\tlet velocityText;\n\t\tif (this.state.currentSidewalk.averageVelocity > 0) {\n\t\t\tvelocityText = `The average pedestrian velocity on this sidewalk is ${this.state.currentSidewalk.averageVelocity} metres per second.;`;\n\t\t} else {\n\t\t\tvelocityText = \"No data has been recorded for the average pedestrian velocity of this sidewalk.\";\n\t\t}\n\t\t\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h3 className=\"streetNameSection\">\n\t\t\t\t\t{this.state.address}\n\t\t\t\t</h3>\n\t\t\t\t<hr />\n\t\t\t\t\t{imageSection}\n\t\t\t\t<hr />\n\t\t\t\t<h5>\n\t\t\t\t\t{velocityText}\n\t\t\t\t\t<div>\n\t\t\t\t\t\t{this.state.isLoggedIn && this.state.sidewalkHasCSVData && <CSVLink data={this.state.sidewalkCsvFormatted}>\n\t\t\t\t\t\t\t<Button bsStyle=\"primary\" className=\"sidewalkCsvButton\">\n\t\t\t\t\t\t\t\tExport CSV\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</CSVLink>}\n\t\t\t\t\t</div>\n\t\t\t\t</h5>\n\t\t\t</div>\n\t\t);\n\t}", "async getShortlistOpportunity(href) {\n if (href in this.state.shortlistOpportunities) {\n return this.state.shortlistOpportunities[href];\n } else {\n let item = await this.itemService.getItem(href);\n this.state.shortlistOpportunities[href] = item;\n return item;\n }\n }", "get importedTakeInfos() {}", "function youAndActivityBreakdown(){\n\n\t//loop that runs through each activty type\n\t\t//loop that runs through each instance within that activty type and ranks the instances from highest to lowest - in an array\n\n\t\t//then chooses the 3 highest and lowest instances and prints the sub-activity and the aliveness level for that instance \n\n}", "async viewDrugCurrentState(ctx,drugName,serialNo){\n // Create a composite key for the company to get registered in ledger\n const drugID = ctx.stub.createCompositeKey('org.pharma-network.drug',[drugName,serialNo]);\n\n // fetch the corresponding drug object from the ledger\n let drugBuf = await ctx.stub\n .getState(drugID)\n .catch(err => console.log(err));\n\n // return the drug object to the user\n return JSON.parse(drugBuf.toString());\n\n }", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', менеджер: ' + this.manager.name ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "async function getOpportunity (req, res) {\n res.send(await service.getOpportunity(req.authUser, req.params.opportunityId))\n}", "function fetchingActiveDriversDetails() {\n return {\n type: FETCHING_ACTIVEDRIVERS_DETAILS\n };\n}", "renderDetails() {\r\n console.log(`${this.name}: ${this.role}`);\r\n }", "function details() {\n let did = dsel.value;\n if (!did) return;\n fetch(base + \"/dispenser/\" + did)\n .then(resp => resp.json()).then(function(json) {\n let perc = Math.ceil(json[\"valor_atual\"]/json[\"vol_max\"]*100);\n curml.innerText = json[\"valor_atual\"] + \" mL (\" + perc + \"%)\";\n curdesc.innerText = json[\"desc\"];\n });\n}", "function status_companyinfo(){\n if(inspectedItem !== \"\"){\n\n var tag = inspectedItem.status;\n let color = \"purple\";\n if (tag.toUpperCase() === 'ACQUIRED') {\n color = 'blue';\n }else if(tag.toUpperCase() === 'CLOSED'){\n color = 'red';\n }else if (tag.toUpperCase() === 'OPERATING'){\n color = 'green'\n }\n\n return (\n <Tag color={color} key={tag}>\n {tag.toUpperCase()}\n </Tag>\n );\n }\n }", "function showDetails(){\n\tView.controllers.get('visitorController')['editTag']=true;\n var grid = View.panels.get('visitorsGrid');\n var selectedRow = grid.rows[grid.selectedRowIndex];\n var visitorId = selectedRow[\"visitors.visitor_id\"];\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"visitors.visitor_id\", visitorId, \"=\");\n View.panels.get('visitorsForm').refresh(restriction,false);\n}", "function experienceFilters() {\n const filtered = pokemon.filter((pexp) => pexp.base_experience > \"100\");\n displaydata(filtered);\n}", "function viewDepts(){\n var query = connection.query(\"SELECT Department_ID, Department_Name FROM departments;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n superAsk();\n });\n }", "getProductDetails() {\n return `Product id: ${this.id}, Product Name: ${this.name}, Product Base Price: ${this.basePrice} `;\n }", "function groupInfo(adornment) { // takes the tooltip or context menu, not a group node data object\n var g = adornment.adornedPart; // get the Group that the tooltip adorns\n var mems = g.memberParts.count;\n var links = 0;\n g.memberParts.each(function(part) {\n if (part instanceof go.Link) links++;\n });\n return \"Group \" + g.data.key + \": \" + g.data.text + \"\\n\" + mems + \" members including \" + links + \" links\";\n }", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "getOptions(val) {\n var list = []\n\n // These clauses identify which types of workouts are included in the day,\n // and push the three levels for each into the return list\n if (this.state.temp.hasOwnProperty('swimWorkout')) {\n list.push({\n title: 'SWIM: Beginner',\n workout: this.state.temp.swimWorkout[0]\n })\n list.push({\n title: 'SWIM: Intermediate',\n workout: this.state.temp.swimWorkout[1]\n })\n list.push({\n title: 'SWIM: Advanced',\n workout: this.state.temp.swimWorkout[2]\n })\n }\n if (this.state.temp.hasOwnProperty('bikeWorkout')) {\n list.push({\n title: 'BIKE: Beginner',\n workout: this.state.temp.bikeWorkout[0]\n })\n list.push({\n title: 'BIKE: Intermediate',\n workout: this.state.temp.bikeWorkout[1]\n })\n list.push({\n title: 'BIKE: Advanced',\n workout: this.state.temp.bikeWorkout[2]\n })\n }\n if (this.state.temp.hasOwnProperty('runWorkout')) {\n list.push({\n title: 'RUN: Beginner',\n workout: this.state.temp.runWorkout[0]}\n )\n list.push({\n title: 'RUN: Intermediate',\n workout: this.state.temp.runWorkout[1]\n })\n list.push({\n title: 'RUN: Advanced',\n workout: this.state.temp.runWorkout[2]\n })\n }\n return list\n }", "function log() {\n console.log(\"portalOpenInstances ----------\");\n console.log(portalOpenInstances.openInstances.length);\n portalOpenInstances.openInstances.forEach(function (p) {\n return console.log(p);\n });\n console.log(\"end portalOpenInstances ----------\");\n}", "get metaData() {\n console.log(`Type: ${this.type}, Legs: ${this.legs}`);\n }", "function extractview(item) {\n var bag = {};\n if (item.properties && Utilities.isArray(item.properties)) {\n item.properties\n .filter(function (el) { return el.direction === 'output' })\n .forEach(function (prop) {\n bag[prop.identifier] = prop.value;\n });\n }\n return bag;\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 }", "async OnGoingProposal(ctx) {\n //Get the ongoing proposal\n let ongoingProp_ID = await ctx.stub.getState('ongoingProposal');\n ongoingProp_ID = 'proposal' + parseInt(ongoingProp_ID);\n const ongoingProp = await ctx.stub.getState(ongoingProp_ID);\n return JSON.parse(ongoingProp);\n }", "function getEventDets(obj) {\n\t// just logging it to the console for now :)\n\tconsole.log(obj);\n}", "function printRole() {\n for (i=0; i<devs.length; i++){\n let name = devs[i].name;\n let tech = devs[i].tech_stack;\n console.log(`${name} specializes is ${tech}.`);\n }\n }", "function getInfo() {\n let tmp = document.getElementById('OpenAirIRnames');\n if (tmp === undefined) {\n return;\n }\n\n const ind = tmp.selectedIndex;\n\n tmp = document.getElementById('tainfo');\n if (tmp === undefined) {\n return;\n }\n let infobj = {};\n\n // ADJUST FOR LIVE TEST: OFF/MIC\n if (ind === 0) {\n infobj.mode = 'OFF';\n } else if (ind === 1) {\n infobj.mode = 'MIC';\n } else {\n infobj = myArr[ind - 2];\n }\n\n const infotxt = formInfo(infobj); // get text from obj\n tmp.innerText = infotxt;\n }", "function benefitOptionText() { \n return gapPlanData.benefitOption();\n}", "getPaylikeOrderStatuses() {\n /** Get order status for capture. */\n cy.get('#PAYLIKE_ORDER_STATUS > option[selected=selected]').then($captureStatus => {\n this.OrderStatusForCapture = $captureStatus.text();\n });\n }", "getOutcome(extraItemData){\n let res = ''\n for(let possibility in extraItemData.outcome){\n if(extraItemData.outcome[possibility]) res += possibility //this could be made to append into a magic string if there's multiple conditions we want to allow\n }\n return res\n }", "function category_companyinfo(){\n if(inspectedItem !== \"\"){\n return inspectedItem.category_groups_list.split(\",\").map(item=>\n {\n return <Tag color={\"red\"} key={item}>{item}</Tag>;\n })}\n }", "function DrillThroughDialog(parent){/** @hidden */this.indexString=[];this.clonedData=[];this.isUpdated=false;this.gridIndexObjects={};this.gridData=[];this.formatList={};this.drillKeyConfigs={escape:'escape'};this.parent=parent;this.engine=this.parent.dataType==='olap'?this.parent.olapEngineModule:this.parent.engineModule;}", "printPlacesLived(){\n\t\t\tconst cityMessage = this.city.map((city) => {\n\t\t\t\t//allows you to tranform each item!!\n\t\t\t\treturn this.name + \" has lived in \" + city;\n\t\t\t});\n\t\t\t// this.city.forEach((city) =>{\n\t\t\t// \tconsole.log(this.name + \" has lived in \" + city);\n\t\t\t// });\n\n\t\t\treturn cityMessage;\n\t\t}", "competencesToView(comps, notAsTree){\n var viewCompetence = {\n competence:'',\n percent: ''\n }\n var sectionIDs = [];\n var rowIDs = [];\n var dataBlob = {};\n\n var _this = this;\n Object.keys(comps).map((k) => {\n if(!comps[k]) return;\n if(!dataBlob[k]){\n sectionIDs.push(k);\n dataBlob[k] = {title:k, index:rowIDs.length, type:comps[k][0].inCourse ? 'course' : 'learningTemplate'};\n //console.log(comps[k]);\n rowIDs[dataBlob[k].index] = comps[k].map((c) => c.name);\n }\n\n comps[k].map((comp) => {\n dataBlob[k + ':' + comp.name] = comp;\n });\n });\n //console.log(dataBlob, sectionIDs, rowIDs);\n return {dataBlob, sectionIDs, rowIDs};\n }", "function viewDepts() {\n let query = `SELECT id as ID, name as \"DEPARTMENT NAME\" FROM department;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function howManyGoals(player) {\n return player.eplGoals; // <== Highlight\n}", "function getInfoMN(PrecinctID) {\n var myData = precinctData[PrecinctID];\n var toReturn = '';\n var statNames = Object.keys(stateSyntax);\n // console.log(statNames);\n // console.log(myData);\n for (var i = 0; i < statNames.length; i++) {\n var statName = statNames[i];\n toReturn += \"<br>\";\n toReturn += \"<b>\" + statName + \"</b>: \";\n toReturn += myData[stateSyntax[statName]];\n }\n toReturn += \"<br><b>District</b>: \" + precinctDistricts[myData[stateSyntax[precinctID_NAME]]];\n return toReturn;\n}", "function GetDetailsVehicle(name, model, price, onRoadPrice, color) {\n\n console.log(`Name : ${name}`)\n console.log(`Model : ${model}`)\n console.log(`price : ${price}`)\n console.log(`onRoadPrice : ${onRoadPrice}`)\n console.log(`Color : ${color}`)\n \n console.log(`Brand : ${this.Brand}`) \n console.log(`Mileage : ${this.Mileage}`) \n console.log(`Fuel Type : ${this.FuelType}`) \n}", "info(choice) {\n try {\n if (choice == undefined || choice == null) throw 'Cannot be undefined or null'\n if (choice == ' ') throw 'Cannot be empty'\n if (isNaN(choice)) throw 'Input should be a number'\n let length = this.data.stock.length;\n if (choice > length) throw 'No share present at that location'\n let i = 0;\n while (i < choice - 1) {\n i++;\n }\n console.log(`Name of Corporation:${this.data.stock[choice - 1].corporation}`);\n console.log(`Number of shares:${this.data.stock[choice - 1].noOfShares}`);\n console.log(`Price per each Share:${this.data.stock[choice - 1].priceOfEach}`);\n }\n catch (e) {\n return e;\n }\n }", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', разработчики: ' + this.getDevelopers() ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "function viewAllDepts() {\n connection.query(\"SELECT d.name AS Department FROM department d ORDER BY d.name;\", function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var deptObj = [res[i].Department];\n tableResults.push(deptObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS AT THIS TIME \\n ------------------------------------\"\n );\n console.table([\"Department\"], tableResults);\n actions();\n });\n}", "function showDetails(row){\n\tvar controller = View.controllers.get('abGbRptFpSrcCatCtrl');\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClauses(controller.consoleRestriction);\n\tif(typeof(row) == \"object\" && typeof(row) != \"string\" && row != \"total_row\" ){\n\t\tif(valueExistsNotEmpty(row[\"bl.site_id\"])){\n\t\t\trestriction.addClause(\"bl.site_id\", row[\"bl.site_id\"], \"=\", \"AND\", true);\n\t\t}\n\t\tif(valueExistsNotEmpty(row[\"gb_fp_totals.calc_year\"])){\n\t\t\trestriction.addClause(\"gb_fp_totals.calc_year\", row[\"gb_fp_totals.calc_year\"], \"=\", \"AND\", true);\n\t\t}\n\t}\n\tcontroller.abGbRptFpSrcCat_bl.addParameter(\"isGroupPerArea\", controller.isGroupPerArea);\n\tcontroller.abGbRptFpSrcCat_bl.refresh(restriction);\n\tshowReportColumns(controller.abGbRptFpSrcCat_bl);\n\tcontroller.abGbRptFpSrcCat_tabs.selectTab(\"abGbRptFpSrcCat_bl_tab\");\n}", "SimilarTypes(event){\n\t\tevent.preventDefault();\n\t\tconsole.log(this.state.pokemonData[this.id - 1]['type']);\n\t}", "function CreateOtherData(ppl_object)\n{\n//name and title\n\tvar string=\"\";\n\tfor ( key in ppl_object)\n\t{\n\t\tstring+=\"<br> <b>\"+ ppl_object[key][\"title\"] + \": </b>\" +ppl_object[ key][\"name\"];\n\t}\n\treturn string;\n}", "function displayItemDetails() {\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\n var meetingSuggestions = item.getEntitiesByType(Office.MailboxEnums.EntityType.MeetingSuggestion);\n var meetingSuggestion = meetingSuggestions[0];\n\n $('#start-time').text(meetingSuggestion.start);\n }", "allAvailablePokemon() {\n const encounterInfo = this.allAvailableShadowPokemon();\n // Handling minions\n this.enemyList.forEach((enemy) => {\n var _a;\n // Handling Pokemon\n if (typeof enemy === 'string' || enemy.hasOwnProperty('pokemon')) {\n let pokemonName;\n if (enemy.hasOwnProperty('pokemon')) {\n // Check if requirements have been met\n if ((_a = enemy.options) === null || _a === void 0 ? void 0 : _a.requirement) {\n if (!enemy.options.requirement.isCompleted()) {\n return;\n }\n }\n pokemonName = enemy.pokemon;\n }\n else {\n pokemonName = enemy;\n }\n encounterInfo.push(pokemonName);\n // Handling Trainers\n }\n else { /* We don't include Trainers */ }\n });\n // Handling Bosses\n this.bossList.forEach((boss) => {\n var _a;\n // Handling Pokemon\n if (boss instanceof DungeonBossPokemon) {\n if ((_a = boss.options) === null || _a === void 0 ? void 0 : _a.requirement) {\n if (!boss.options.requirement.isCompleted()) {\n return;\n }\n }\n const pokemonName = boss.name;\n encounterInfo.push(pokemonName);\n // Handling Trainer\n }\n else { /* We don't include Trainers */ }\n });\n this.getCaughtMimics().forEach((mimic) => encounterInfo.push(mimic));\n return encounterInfo;\n }", "* detailsPrint (request, response) {\n const categories = yield Category.all(),\n result = yield Result.get(request.param('id')),\n user = yield request.auth.getUser(),\n type = request.input('type'),\n date = moment().format('YYYY-mm-DD hh:mm:ss')\n\n result.sortCandidates((a, b) => {\n return result.getJudgesAverage(b.id) - result.getJudgesAverage(a.id)\n })\n\n if (type == 'winner') {\n result.sliceTop(1)\n }\n\n if (type == 'top-5') {\n result.sliceTop(5)\n }\n\n yield response.sendView('dashboard/score/details_print', {\n categories, result, user, date\n })\n }", "function getDataPipelineStatus(pipelineId,datapipeline,pipelineName,pipelineAction,callback) {\n \n console.log('STATE-STATUS');\n var paramsPS = {\n pipelineIds: [ pipelineId ]\n };\n datapipeline.describePipelines(paramsPS, function(err, data) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n callback(err);\n }\n else { \n console.log(data); // successful response\n var keyName = 'None';\n if (pipelineAction==\"STATE\") {\n keyName = \"@pipelineState\";\n } else {\n keyName = \"@healthStatus\";\n }\n var keyValue = 'None';\n for (var i in data.pipelineDescriptionList){\n for ( var j in data.pipelineDescriptionList[i].fields){\n if (data.pipelineDescriptionList[i].fields[j].key == keyName) {\n keyValue = data.pipelineDescriptionList[i].fields[j].stringValue;\n console.log('Pipeline ' + pipelineAction + ' - ' + keyValue );\n }\n }\n }\n if (keyValue == 'None') {\n callback('Error in getting status'); \n }else {\n var output = {\n result : keyValue\n };\n callback(null, output); \n }\n }\n });\n\n}", "function showTournamentID(){\n console.log('Tournament name: ', tournamentID);\n }", "function handleViz( result, idCounter, item ) {\n\n // respective activity\n const actId = '_:viz' + idCounter['activity']++,\n actStartTime = (new Date( item.getData( 'startTime' ) )).toISOString(),\n actEndTime = (new Date( item.getData( 'endTime' ) )).toISOString();\n result['activity'][ actId ] = {\n 'prov:startTime': actStartTime,\n 'prov:endTime': actEndTime,\n 'prov:type': convertType( item.getData( 'type' ) ),\n 'yavaa:params': JSON.stringify( item.getData('params') ),\n 'yavaa:action': item.getData( 'action' ),\n 'yavaa:columns': JSON.stringify( item.getData( 'columns' ) ),\n 'yavaa:prevActivity': []\n };\n\n // add links\n linkToProv( item, actId, null );\n\n return actId;\n\n }", "function printTravelLog(rover){\n var coordinates = '';\n rover.travelLog.forEach(function(item, index){\n if (index % 2 === 0){\n coordinates += '(' + item + ',';\n } else if (index % 2 !== 0){\n coordinates += item + ') ';\n }\n });\n console.log(rover.name + ' tracking: ' + coordinates); \n}", "function getTodoListInfo(el) {\n const linkToDataControl = $('#' + $(el)[0].settings.linkToDataControl);\n const total = linkToDataControl[0].settings.sourceObject.settings.total;\n var r;\n var selectedItems;\n if (linkToDataControl.hasClass('multiselect-mode')) {\n // Using multi-select checkboxes, so find how many are checked.\n r = {\n total: $(linkToDataControl).find('.multiselect:checked').length,\n totalAsText: $(linkToDataControl).find('.multiselect:checked').length,\n message: indiciaData.lang.recordsMover.recordsMoverDialogMessageSelected,\n ids: []\n };\n selectedItems = $(linkToDataControl).find('.multiselect:checked').closest('tr,.card')\n $.each(selectedItems, function eachRow() {\n const doc = JSON.parse($(this).attr('data-doc-source'));\n r.ids.push(parseInt(doc.id, 10));\n });\n } else {\n // Not using multi-select checkboxes, so return count of all records in filter.\n r = {\n total: total.value,\n totalAsText : (total.relation === 'gte' ? 'at least ' : '') + total.value,\n message: indiciaData.lang.recordsMover.recordsMoverDialogMessageAll\n }\n }\n r.message = r.message.replace('{1}', r.totalAsText);\n return r;\n }", "getEventInformation() {\n let eventInformation = this.props.eventObj.name + ' is organizing ' + this.props.eventObj.purpose + '. Please cast your available Dates!!';\n return eventInformation;\n }", "printHousingVector() {\n let pv = this._hv;\n console.log(\"[HousingManager]: Total: \" + this.TotalHouses + \" Occupied: \" + this.OccupiedHouses + \" Indiv: \" + pv[0] + \" \" + pv[1] + \" \" + pv[2] + \" \" + pv[3] + \" \" + pv[4] + \" \" + pv[5] + \" \" + pv[6] + \" \" + pv[7]);\n }", "title() {\n return `Number of live incidents: ${this.liveIncidents}`\n }", "function log$1() {\n console.log(\"portalOpenInstances ----------\");\n console.log(portalOpenInstances.openInstances.length);\n portalOpenInstances.openInstances.forEach(function (p) {\n return console.log(p);\n });\n console.log(\"end portalOpenInstances ----------\");\n}", "function showDetails() {\n // 'this' is the row data object\n var s1 = ('Total room area: ' + this['rm.total_area'] + ' sq.ft.');\n \n // 'this.grid' is the parent grid/mini-console control instance\n var s2 = ('Parent control ID: ' + this.grid.parentElementId);\n \n // you can call mini-console methods\n var s3 = ('Row primary keys: ' + toJSON(this.grid.getPrimaryKeysForRow(this)));\n \n alert(s1 + '\\n' + s2 + '\\n' + s3);\n}", "function showElevators() {\n\tconsole.log('Show elevator status here');\n}", "function getEntities(obj, parent) {\n // decision\n if (obj[\"p:FlowDecision\"] !== undefined) {\n var root_decisions = obj[\"p:FlowDecision\"];\n if (typeof root_decisions === \"object\" && root_decisions.length !== undefined) { // is array objects\n for (var i = 0; i < root_decisions.length; i++) {\n var root_decision = root_decisions[i];\n var isAlias = root_decision[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_decision[\"@sap2010:WorkflowViewState.IdRef\"] : root_decision[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_decision[\"p:FlowDecision.True\"] !== undefined) { // have obj in true connection\n getEntities(root_decision[\"p:FlowDecision.True\"], isAlias);\n }\n if (root_decision[\"p:FlowDecision.False\"] !== undefined) { // have obj in false connection\n getEntities(root_decision[\"p:FlowDecision.False\"], isAlias);\n }\n // get info\n var _decision = new Entity();\n _decision.label = root_decision[\"@DisplayName\"] !== undefined ? root_decision[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Decision\";\n _decision.condition = root_decision[\"@Condition\"] !== undefined ? root_decision[\"@Condition\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_decision[\"@Condition\"].length - 2) : (root_decision[\"p:FlowDecision.Condition\"] !== undefined ? root_decision[\"p:FlowDecision.Condition\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\") : \"\");\n _decision.annotation = root_decision[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_decision[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _decision.type = typeEntity.t_decision;\n _decision.alias = isAlias;\n _decision.parent = parent !== undefined ? parent : '';\n\n mRoot.infoEntities.add(_decision);\n }\n } else { // is object\n var isAlias = root_decisions[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_decisions[\"@sap2010:WorkflowViewState.IdRef\"] : root_decisions[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_decisions[\"p:FlowDecision.True\"] !== undefined) { // have obj in true connection\n getEntities(root_decisions[\"p:FlowDecision.True\"], isAlias);\n }\n if (root_decisions[\"p:FlowDecision.False\"] !== undefined) { // have obj in false connection\n getEntities(root_decisions[\"p:FlowDecision.False\"], isAlias);\n }\n // get info\n var _decision = new Entity();\n _decision.label = root_decisions[\"@DisplayName\"] !== undefined ? root_decisions[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Decision\";\n _decision.condition = root_decisions[\"@Condition\"] !== undefined ? root_decisions[\"@Condition\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_decisions[\"@Condition\"].length - 2) : (root_decisions[\"p:FlowDecision.Condition\"] !== undefined ? root_decisions[\"p:FlowDecision.Condition\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\") : \"\");\n _decision.annotation = root_decisions[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_decisions[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _decision.type = typeEntity.t_decision;\n _decision.alias = isAlias;\n _decision.parent = parent !== undefined ? parent : '';\n mRoot.infoEntities.add(_decision);\n }\n }\n\n // switch\n if (obj[\"p:FlowSwitch\"] !== undefined) {\n var root_switchs = obj[\"p:FlowSwitch\"];\n // have \n if (typeof (root_switchs) === \"object\" && root_switchs.length !== undefined) { // is array object\n for (var i = 0; i < root_switchs.length; i++) {\n var root_switch = root_switchs[i];\n var isAlias = root_switch[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_switch[\"@sap2010:WorkflowViewState.IdRef\"] : root_switch[\"sap2010:WorkflowViewState.IdRef\"];\n // switch connection multi other decision/switch/step\n if (root_switch[\"p:FlowDecision\"] !== undefined || root_switch[\"p:FlowSwitch\"] !== undefined || root_switch[\"p:FlowStep\"]) {\n getEntities(root_switch, isAlias);\n }\n // only exitings a connect default by switch\n if (root_switch[\"p:FlowSwitch.Default\"] !== undefined) { // connect default\n getEntities(root_switch[\"p:FlowSwitch.Default\"], isAlias);\n }\n // get info\n var _switch = new Entity();\n _switch.label = root_switch[\"@DisplayName\"] !== undefined ? root_switch[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Switch\"; // label if existing different default\n _switch.expression = root_switch[\"@Expression\"] !== undefined ? root_switch[\"@Expression\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_switch[\"@Expressionf\"].length - 2) : (root_switch[\"p:FlowSwitch.Expression\"] !== undefined ? root_switch[\"p:FlowSwitch.Expression\"][\"mca:CSharpValue\"][\"#text\"] : \"\");\n _switch.annotation = root_switch[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_switch[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _switch.typeSwitch = root_switch[\"@x:TypeArguments\"].split(\"x:\")[1];\n _switch.type = typeEntity.t_switch;\n _switch.alias = isAlias;\n _switch.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_switch);\n }\n } else { // if object\n var isAlias = root_switchs[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_switchs[\"@sap2010:WorkflowViewState.IdRef\"] : root_switchs[\"sap2010:WorkflowViewState.IdRef\"];\n // only exitings a connect default by switch\n if (root_switchs[\"p:FlowSwitch.Default\"] !== undefined) { // connect default\n getEntities(root_switchs[\"p:FlowSwitch.Default\"], isAlias);\n }\n // switch connection multi other decision/switch/step\n if (root_switchs[\"p:FlowDecision\"] !== undefined || root_switchs[\"p:FlowSwitch\"] !== undefined || root_switchs[\"p:FlowStep\"] !== undefined) {\n getEntities(root_switchs, isAlias);\n }\n\n // get info\n var _switch = new Entity();\n _switch.label = root_switchs[\"@DisplayName\"] !== undefined ? root_switchs[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"Switch\"; // label if existing different default\n _switch.expression = root_switchs[\"@Expression\"] !== undefined ? root_switchs[\"@Expression\"].replaceAll(\"\\\"\", \"&quot;\").substr(1, root_switchs[\"@Expression\"].length - 2) : (root_switchs[\"p:FlowSwitch.Expression\"] !== undefined ? root_switchs[\"p:FlowSwitch.Expression\"][\"mca:CSharpValue\"][\"#text\"] : \"\");\n _switch.annotation = root_switchs[\"@sap2010:Annotation.AnnotationText\"] !== undefined ? root_switchs[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\";\n _switch.typeSwitch = root_switchs[\"@x:TypeArguments\"].split(\"x:\")[1];\n _switch.type = typeEntity.t_switch;\n _switch.alias = isAlias;\n _switch.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_switch);\n }\n }\n\n // step - unknown\n if (obj[\"p:FlowStep\"] !== undefined) {\n var root_steps = obj[\"p:FlowStep\"];\n if (typeof (root_steps) === \"object\" && root_steps.length !== undefined) {\n for (var i = 0; i < root_steps.length; i++) {\n var root_step = root_steps[i];\n // approve\n if (root_step[\"ftwa:ApproveTask\"] !== undefined) {\n var root_approve = root_step[\"ftwa:ApproveTask\"];\n // alias is step's name\n var isAlias = root_step[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_step[\"@sap2010:WorkflowViewState.IdRef\"] : root_step[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_step[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_step[\"p:FlowStep.Next\"], isAlias);\n }\n var _approve = new Entity();\n _approve.label = root_approve[\"@DisplayName\"] != undefined ? root_approve[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"ApproveTask\";\n _approve.annotation = root_approve[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_approve[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_approve[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_approve[\"@AssignResultTo\"] != undefined && root_approve[\"@AssignResultTo\"] === \"{x:Null}\") {\n _approve.AssignResultTo = \"\";\n } else {\n if (root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"] !== undefined) {\n _approve.AssignResultTo = root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _approve.AssignResultTo = \"\";\n }\n }\n _approve.AssignedToUsers = root_approve[\"@AssignedToUsers\"] != undefined ? (root_approve[\"@AssignedToUsers\"] !== \"{x:Null}\" ? root_approve[\"@AssignedToUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.CorrelationId = root_approve[\"@CorrelationId\"] != undefined ? (root_approve[\"@CorrelationId\"] !== \"{x:Null}\" ? root_approve[\"@CorrelationId\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.DefaultResult = root_approve[\"@DefaultResult\"] != undefined ? (root_approve[\"@DefaultResult\"] !== \"{x:Null}\" ? root_approve[\"@DefaultResult\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Description = root_approve[\"@Description\"] != undefined ? (root_approve[\"@Description\"] !== \"{x:Null}\" ? root_approve[\"@Description\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresIn = root_approve[\"@ExpiresIn\"] != undefined ? (root_approve[\"@ExpiresIn\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresIn\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresWhen = root_approve[\"@ExpiresWhen\"] != undefined ? (root_approve[\"@ExpiresWhen\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresWhen\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.HandOverUsers = root_approve[\"@HandOverUsers\"] != undefined ? (root_approve[\"@HandOverUsers\"] !== \"{x:Null}\" ? root_approve[\"@HandOverUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnComplete = root_approve[\"@OnComplete\"] != undefined ? (root_approve[\"@OnComplete\"] !== \"{x:Null}\" ? root_approve[\"@OnComplete\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnInit = root_approve[\"@OnInit\"] != undefined ? (root_approve[\"@OnInit\"] !== \"{x:Null}\" ? root_approve[\"@OnInit\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.TaskCode = root_approve[\"@TaskCode\"] != undefined ? (root_approve[\"@TaskCode\"] !== \"{x:Null}\" ? root_approve[\"@TaskCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Title = root_approve[\"@Title\"] != undefined ? (root_approve[\"@Title\"] !== \"{x:Null}\" ? root_approve[\"@Title\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.UiCode = root_approve[\"@UiCode\"] != undefined ? (root_approve[\"@UiCode\"] !== \"{x:Null}\" ? root_approve[\"@UiCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.type = typeEntity.t_approve;\n _approve.alias = isAlias;\n _approve.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_approve);\n }\n // generic\n if (root_step[\"ftwa:GenericTask\"] !== undefined) {\n // alias is step's name\n var root_generic = root_step[\"ftwa:GenericTask\"];\n var isAlias = root_step[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_step[\"@sap2010:WorkflowViewState.IdRef\"] : root_step[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_step[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_step[\"p:FlowStep.Next\"], isAlias);\n }\n var _generic = new Entity();\n _generic.label = root_generic[\"@DisplayName\"] != undefined ? root_generic[\"@DisplayName\"] : \"GenericTask\";\n _generic.annotation = root_generic[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_generic[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_generic[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _generic.OnRun = root_generic[\"@OnRun\"] != undefined ? (root_generic[\"@OnRun\"] !== \"{x:Null}\" ? root_generic[\"@OnRun\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_generic[\"@TaskCode\"] !== undefined && root_generic[\"@TaskCode\"] === \"{x:Null}\") {\n _generic.TaskCode = \"\";\n } else {\n if (root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"] !== undefined) {\n _generic.TaskCode = root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _generic.TaskCode = \"\";\n }\n }\n _generic.type = typeEntity.t_generic;\n _generic.alias = isAlias;\n _generic.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_generic);\n }\n }\n } else {\n // approve\n if (root_steps[\"ftwa:ApproveTask\"] !== undefined) {\n var root_approve = root_steps[\"ftwa:ApproveTask\"];\n // alias is step's name\n var isAlias = root_steps[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_steps[\"@sap2010:WorkflowViewState.IdRef\"] : root_steps[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_steps[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_steps[\"p:FlowStep.Next\"], isAlias);\n }\n var _approve = new Entity();\n _approve.label = root_approve[\"@DisplayName\"] != undefined ? root_approve[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"ApproveTask\";\n _approve.annotation = root_approve[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_approve[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_approve[\"@sap2010:Annotation.AnnotationText\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_approve[\"@AssignResultTo\"] !== undefined && root_approve[\"@AssignResultTo\"] === \"{x:Null}\") {\n _approve.AssignResultTo = \"\";\n } else {\n if (root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"] !== undefined) {\n _approve.AssignResultTo = root_approve[\"ftwa:ApproveTask.AssignResultTo\"][\"p:OutArgument\"][\"mca:CSharpReference\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _approve.AssignResultTo = \"\";\n }\n }\n _approve.AssignedToUsers = root_approve[\"@AssignedToUsers\"] != undefined ? (root_approve[\"@AssignedToUsers\"] !== \"{x:Null}\" ? root_approve[\"@AssignedToUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.CorrelationId = root_approve[\"@CorrelationId\"] != undefined ? (root_approve[\"@CorrelationId\"] !== \"{x:Null}\" ? root_approve[\"@CorrelationId\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.DefaultResult = root_approve[\"@DefaultResult\"] != undefined ? (root_approve[\"@DefaultResult\"] !== \"{x:Null}\" ? root_approve[\"@DefaultResult\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Description = root_approve[\"@Description\"] != undefined ? (root_approve[\"@Description\"] !== \"{x:Null}\" ? root_approve[\"@Description\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresIn = root_approve[\"@ExpiresIn\"] != undefined ? (root_approve[\"@ExpiresIn\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresIn\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.ExpiresWhen = root_approve[\"@ExpiresWhen\"] != undefined ? (root_approve[\"@ExpiresWhen\"] !== \"{x:Null}\" ? root_approve[\"@ExpiresWhen\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.HandOverUsers = root_approve[\"@HandOverUsers\"] != undefined ? (root_approve[\"@HandOverUsers\"] !== \"{x:Null}\" ? root_approve[\"@HandOverUsers\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnComplete = root_approve[\"@OnComplete\"] != undefined ? (root_approve[\"@OnComplete\"] !== \"{x:Null}\" ? root_approve[\"@OnComplete\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.OnInit = root_approve[\"@OnInit\"] != undefined ? (root_approve[\"@OnInit\"] !== \"{x:Null}\" ? root_approve[\"@OnInit\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.TaskCode = root_approve[\"@TaskCode\"] != undefined ? (root_approve[\"@TaskCode\"] !== \"{x:Null}\" ? root_approve[\"@TaskCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.Title = root_approve[\"@Title\"] != undefined ? (root_approve[\"@Title\"] !== \"{x:Null}\" ? root_approve[\"@Title\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.UiCode = root_approve[\"@UiCode\"] != undefined ? (root_approve[\"@UiCode\"] !== \"{x:Null}\" ? root_approve[\"@UiCode\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n _approve.type = typeEntity.t_approve;\n _approve.alias = isAlias;\n _approve.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_approve);\n }\n // generic\n if (root_steps[\"ftwa:GenericTask\"] !== undefined) {\n var root_generic = root_steps[\"ftwa:GenericTask\"];\n // alias is step's name\n var isAlias = root_steps[\"@sap2010:WorkflowViewState.IdRef\"] != undefined ? root_steps[\"@sap2010:WorkflowViewState.IdRef\"] : root_steps[\"sap2010:WorkflowViewState.IdRef\"];\n if (root_steps[\"p:FlowStep.Next\"] !== undefined) {\n getEntities(root_steps[\"p:FlowStep.Next\"], isAlias);\n }\n var _generic = new Entity();\n _generic.label = root_generic[\"@DisplayName\"] != undefined ? root_generic[\"@DisplayName\"].replaceAll(\"\\\"\", \"&quot;\") : \"GenericTask\";\n _generic.annotation = root_generic[\"@sap2010:Annotation.AnnotationText\"] != undefined ? (root_generic[\"@sap2010:Annotation.AnnotationText\"] !== \"{x:Null}\" ? root_generic[\"@sap2010:Annotation.AnnotationText\"] : \"\") : \"\";\n _generic.OnRun = root_generic[\"@OnRun\"] != undefined ? (root_generic[\"@OnRun\"] !== \"{x:Null}\" ? root_generic[\"@OnRun\"].replaceAll(\"\\\"\", \"&quot;\") : \"\") : \"\";\n // assign result to\n if (root_generic[\"@TaskCode\"] !== undefined && root_generic[\"@TaskCode\"] === \"{x:Null}\") {\n _generic.TaskCode = \"\";\n } else {\n if (root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"] !== undefined) {\n _generic.TaskCode = root_generic[\"ftwa:GenericTask.TaskCode\"][\"p:InArgument\"][\"mca:CSharpValue\"][\"#text\"].replaceAll(\"\\\"\", \"&quot;\");\n } else {\n _generic.TaskCode = \"\";\n }\n }\n _generic.type = typeEntity.t_generic;\n _generic.alias = isAlias;\n _generic.parent = parent !== undefined ? parent : \"\";\n mRoot.infoEntities.add(_generic);\n }\n }\n }\n}", "function viewInfoPrompt () {\n return inquirer.prompt ([\n {\n type: \"list\",\n name: \"itemToView\",\n message: \"What would you like to view?\",\n choices: [\n \"Departments\", \n \"Roles\",\n \"Employees\",\n \"All Information\"\n ]\n }\n ])\n\n }", "function showDetails($vp) {\n var state = requests.getState();\n $('#processing').html(Object.keys(state.processingHosts).length);\n $('#queued').html(Object.keys(state.queuedHosts).length);\n $('#processed').html(Object.keys(state.allHops).length);\n\n if (freeze) {\n return;\n }\n\n var toshow, t, table = '<table><tr>', tdata = '', c;\n switch ($('#toView').val()) {\n case 'processing':\n toshow = processing;\n break;\n case 'completed':\n toshow = completed;\n break;\n default:\n toshow = $.extend({}, processing, completed);\n }\n\n $vp.html('');\n for (t in toshow) {\n c = (processing[t] ? 'processing' : 'completed');\n table += '<th class=\"' + c + '\">' + t + '</th>';\n var update = toshow[t];\n tdata += '<td class=\"' + c + '\">' + (\n $('#traceView').val() === 'details' ? summarizeUpdate(update)\n : '<pre>' + update.buffer + '</pre>'\n ) + '</td>';\n }\n $vp.append(table + '</tr><tr>' + tdata + '</tr></table>');\n }", "constructPdpData() {\n const { productItem } = this.state;\n const { gtmDataLayer } = this.props;\n let enhancedAnalytics = { ...productItem };\n if (productItem.isGiftCard && productItem.gcAmounts && productItem.isGiftCard === 'Y') {\n const price = { ...productItem.price, salePrice: productItem.gcAmounts[0] };\n enhancedAnalytics = { ...productItem, price };\n }\n if (gtmDataLayer) {\n enhancedAnalyticsPDP({ gtmDataLayer, productItem: enhancedAnalytics });\n }\n this.getMixedMediaSetData(productItem);\n this.getAyorterm();\n }", "function packageDetails() {\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let currentOrder = currentCustomer.orders[vm.currentIndices.order];\n let currentShipment = currentOrder.shipments[vm.currentIndices.shipment];\n if (currentShipment !== undefined) {\n let packageInfoElement = document.getElementById(\"PACKAGE_DETAILS\").children;\n packageInfoElement[1].innerText = currentShipment.ship_date;\n let contents = \"\";\n for(let i = 0; i < currentShipment.contents.length; i++){\n contents += currentShipment.contents[i];\n contents += \", \";\n }\n packageInfoElement[4].innerText = contents.substring(0,contents.length-2);\n }\n }", "function listGoals(){\n\tgoals.forEach(function(goal, i){\n\t\t\t// goals.indexOf(goal)\n\n\t\t\tconsole.log('*******');\n\t\t\tconsole.log(i + ': ' + goal);\n\n\t\t});\n\t\tconsole.log('*******');\n\t}", "function logPlanets() {\n console.log(\"Here is the list of planets:\");\n console.log(planets);\n console.log(\"---- ---- ---- ----\");\n }", "function logPlanets() {\n console.log(\"Here is the list of planets:\");\n console.log(planets);\n console.log(\"---- ---- ---- ----\");\n }", "function logPlanets() {\n console.log(\"Here is the list of planets:\");\n console.log(planets);\n console.log(\"---- ---- ---- ----\");\n }", "function logPlanets() {\n console.log(\"Here is the list of planets:\");\n console.log(planets);\n console.log(\"---- ---- ---- ----\");\n }", "async function getOpportunityPhases (req, res) {\n res.send(await service.getOpportunityPhases(req.authUser, req.params.opportunityId))\n}", "getOptionsBreakdown() {\n const { includePhantoms, question: { options, answers } } = this.props;\n const breakdown = { length: answers.length };\n options.forEach((option) => {\n breakdown[option.id] = { count: 0, names: [] };\n });\n answers.forEach((answer) => {\n answer.selected_options.forEach((selectedOption) => {\n if (!includePhantoms && answer.phantom) { return; }\n breakdown[selectedOption].count += 1;\n breakdown[selectedOption].names.push(answer.course_user_name);\n });\n });\n return breakdown;\n }", "elevatorDoorOpen(elevator_id){\n console.log(\"Elevator \", elevator_id, \" door open\");\n }", "function displayData() {\n displayUserInfo();\n displayRecipes();\n console.log(\"before\", chosenPantry)\n}", "printPerson() {\n console.log(`Id ${this.id}, Name ${this.fname}, City ${this.city}`);\n console.log(\"Project \" , this.project);\n }", "getVehicles(context, data) {\n context.commit('getVehicles', data.page)\n }", "function getIntakeInfo() {\n var intakeId = vm.TemplateModelInfo.matterId ? vm.TemplateModelInfo.matterId : vm.TemplateModelInfo.intakeId;\n var dataObj = {\n \"page_number\": 1,\n \"page_size\": 250,\n \"intake_id\": intakeId,\n \"is_migrated\": 2\n };\n var promise = intakeFactory.getMatterList(dataObj);\n promise\n .then(function (response) {\n var matterInfo = response.intakeData[0];\n vm.referredById = utils.isNotEmptyVal(matterInfo.referredBy) ? matterInfo.referredBy : \"\";\n\n // Intake assigned user\n if (utils.isNotEmptyVal(matterInfo.assignedUser)) {\n _.forEach(matterInfo.assignedUser, function (data) {\n vm.assignUsers.push(data);\n });\n }\n }, function (error) {\n });\n }", "function viewDepatments() {\n var query = \"SELECT * FROM DEPARTMENTS\";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Name: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }" ]
[ "0.5502532", "0.54416037", "0.5397782", "0.52958333", "0.52073485", "0.509295", "0.50837195", "0.5044975", "0.50349134", "0.5002779", "0.49955818", "0.49856973", "0.49830937", "0.49719363", "0.49347574", "0.49087036", "0.4902716", "0.49007633", "0.4847376", "0.48454365", "0.4835618", "0.4823173", "0.4821066", "0.4817964", "0.4806971", "0.4806054", "0.48056427", "0.4804622", "0.48044875", "0.47986186", "0.47787872", "0.47722253", "0.4764629", "0.47640952", "0.47576892", "0.47548756", "0.4752603", "0.47518665", "0.47428095", "0.4736009", "0.47334898", "0.47285643", "0.47276434", "0.47263354", "0.47251964", "0.4722807", "0.47180614", "0.47144344", "0.47138613", "0.4713388", "0.47086203", "0.47005144", "0.46961287", "0.4695983", "0.46914196", "0.469121", "0.46908107", "0.46874613", "0.46819904", "0.46799985", "0.46788827", "0.46732277", "0.46716905", "0.46677965", "0.46667764", "0.46650586", "0.4661072", "0.4655449", "0.4654394", "0.46428004", "0.46408013", "0.46334085", "0.46307507", "0.46247908", "0.46246916", "0.46223593", "0.46218377", "0.46148416", "0.46147755", "0.46116358", "0.46064457", "0.46045873", "0.46041456", "0.46039817", "0.46014717", "0.4601352", "0.45984125", "0.45915467", "0.45844674", "0.45834842", "0.45834842", "0.45834842", "0.45834842", "0.45782378", "0.45772547", "0.45716327", "0.45698977", "0.4569446", "0.456668", "0.4566084", "0.45639005" ]
0.0
-1
This function gives sale details in the pipe drill down
function drillSale() { var hasSale = false; list = web.get_lists().getByTitle('Prospects'); var camlQuery = SP.CamlQuery.createAllItemsQuery(); var listItems = list.getItems(camlQuery); var type = "Sale"; context.load(listItems); context.executeQueryAsync( function () { // Success returned from executeQueryAsync var saleTable = document.getElementById("drillTable"); // Remove all nodes from the drillTable <DIV> so we have a clean space to write to while (saleTable.hasChildNodes()) { saleTable.removeChild(saleTable.lastChild); } // Iterate through the Prospects list var listItemEnumerator = listItems.getEnumerator(); var listItem = listItemEnumerator.get_current(); while (listItemEnumerator.moveNext()) { var listItem = listItemEnumerator.get_current(); if (listItem.get_fieldValues()["_Status"] == "Sale") { // Get information for each Sale var saleTitle = document.createTextNode(listItem.get_fieldValues()["Title"]); var salePerson = document.createTextNode(listItem.get_fieldValues()["ContactPerson"]); var saleNumber = document.createTextNode(listItem.get_fieldValues()["ContactNumber"]); var saleEmail = document.createTextNode(listItem.get_fieldValues()["Email"]); var saleAmt = document.createTextNode(listItem.get_fieldValues()["DealAmount"]); drillTable(saleTitle.textContent, salePerson.textContent, saleNumber.textContent, saleEmail.textContent, saleAmt.textContent, type, saleAmount); } hasSale = true; } if (!hasSale) { // Text to display if there are no Sales var noSales = document.createElement("div"); noSales.appendChild(document.createTextNode("There are no Sales.")); saleTable.appendChild(noSales); } $('#drillDown').fadeIn(500, null); }, function (sender, args) { // Failure returned from executeQueryAsync var divMessage = document.createElement("DIV"); divMessage.setAttribute("style", "padding:5px;"); divMessage.appendChild(document.createTextNode("Failed to get Sales. Error: " + args.get_message())); errArea.appendChild(divMessage); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "function totalSale(){\n\n console.log(sale.name);\n}", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function forSale() {\n\t//Select item_id, product_name and price from products table.\n\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(error, results) {\n\t\tif (error) throw error;\n\t\tconsole.log(\"\\n\");\n\t\t//the below code displays the item_id, product_name and the price for all of items that available for sale. \n\t\tfor ( var index = 0; index < results.length; index++) {\n\t\t\tconsole.log(\"Product Id: \" + results[index].item_id + \"\\n\" +\n\t\t\t \"Product Name: \" + results[index].product_name + \"\\n\" +\n\t\t\t \"Price: $\" + results[index].price + \"\\n\" + \"Quantity: \" + results[index].stock_quantity + \"\\n\" + \n\t\t\t \"--------------------------------------------------------------------------\\n\");\n\t\t}// end for loop\n\t\trunSearch();\n\t});// end of query.\n\t\n} // end of forSale function", "function viewSale() {\n // console.log(\"view product....\")\n\n connection.query(\"SELECT * FROM products\", (err, data) => {\n if (err) throw err;\n console.table(data);\n connection.end();\n })\n}", "populateSale(sale) {\n $.each(sale, (key, sala) => {\n $(\".saleTbody\").append('<tr class= \"saleTr\"><td class=\"nomeSala\">' + sala.Nome + '</td><td class=\"nomeEdificio\">' + sala.NomeEdificio + '</td><td class=\"stato\">' + sala.Stato + '</td></tr>');\n $(\".saleTbody\").append('<tr><td class=\"numeroPostiDisponibili\" colspan=\"3\"><h6> Numero posti disponibili: </h6>' + sala.NumeroPostiDisponibili + '</td></tr>');\n });\n $('.saleTr').click(function () {\n $(this).nextUntil('.saleTr').toggleClass('hide');\n }).click();\n }", "function showSale(){ \n // clear the console\n console.log('\\033c');\n // displaying the product list\n console.log(`\\x1b[7m Product Sales By Department \\x1b[0m`);\n // creating the query string\n var query = 'SELECT D.department_id AS \"DeptID\", D.department_name AS \"Department\", D.over_head_costs AS \"OverHeadCosts\", SUM(P.product_sales) AS \"ProductSales\", '; \n query += 'SUM(P.product_sales) - D.over_head_costs AS \"TotalProfit\" FROM departments D INNER JOIN products P ON D.department_name = P.department_name ';\n query += 'GROUP BY D.department_id';\n\n connection.query(\n query,\n function(err, res){\n if (err) throw err;\n\n console.table(\n res.map(rowData => {\n return{ \n \"Dept ID\": rowData.DeptID,\n \"Department Name\": rowData.Department,\n \"Over Head Costs\": rowData.OverHeadCosts,\n \"Product Sales\": rowData.ProductSales,\n \"Total Profit\": rowData.TotalProfit\n }\n })\n );\n endRepeat();\n }\n );\n}", "function salesByProduct(products, lineItems){\n //TODO\n}", "function productsForSale (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "function GetSummary() {\n var YearQuery = '';\n if (FilterList.DashboardFilterYear === '') {\n YearQuery =\n ' business_year = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('YYYY') +\n \"'\";\n } else {\n YearQuery =\n ' business_year = ' + \"'\" + FilterList.DashboardFilterYear + \"'\";\n }\n\n var MonthQuery = '';\n if (FilterList.DashboardFilterMonth === '') {\n MonthQuery =\n ' and business_month = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('MMMM') +\n \"'\";\n } else {\n MonthQuery =\n ' and business_month = ' + \"'\" + FilterList.DashboardFilterMonth + \"'\";\n }\n\n var TeamQuery = '';\n if (\n FilterList.DashboardFilterTeam === '' ||\n FilterList.DashboardFilterTeam === 'ALL'\n ) {\n TeamQuery = ' and team IN ' + global.TeamAccessList;\n } else {\n TeamQuery = ' and team = ' + \"'\" + FilterList.DashboardFilterTeam + \"'\";\n }\n\n var VendorQuery = '';\n if (\n FilterList.DashboardFilterVendor === '' ||\n FilterList.DashboardFilterVendor === 'ALL'\n ) {\n VendorQuery = ' and principal_name like ' + \"'%%' \";\n } else {\n VendorQuery =\n ' and principal_name = ' + \"'\" + FilterList.DashboardFilterVendor + \"'\";\n }\n\n dbperymtsat.transaction((tx) => {\n tx.executeSql(\n 'SELECT SUM(amount) as amount , SUM(target) as target FROM perymtsat_tbl where ' +\n YearQuery +\n MonthQuery +\n TeamQuery +\n VendorQuery +\n ' order by invoice_date asc ',\n [],\n (tx, results) => {\n var len = results.rows.length;\n if (len > 0) {\n // console.log(results.rows.item(0).target);\n //console.log(results.rows.item(0).amount);\n //setTotalSales();\n setTotalTarget(parseInt(results.rows.item(0).target));\n setTotalSales(parseInt(results.rows.item(0).amount));\n settotalSalesAnimation(true);\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n\n // console.log(\n // 'Successfully got summary of ' +\n // FilterList.DashboardFilterMonth +\n // numbro(parseInt(results.rows.item(0).amount)).format({\n // thousandSeparated: true,\n // mantissa: 2,\n // }),\n // );\n }\n },\n SQLerror,\n );\n });\n }", "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function productsForSale() {\n console.log(\"products for sale fxn\");\n connection.query(\"SELECT * FROM products\",function(err, res){\n if (err) throw err;\n for (var i=0; i<res.length;i++) {\n console.log(`Product Name: ${res[i].product_name}`);\n console.log(`Department Name: ${res[i].department_name}`);\n console.log(`Selling Price: $${res[i].price}`);\n console.log(`Quantity in Stock: ${res[i].stock_quantity}`);\n console.log(\"---------------------\");\n }\n });\n connection.end();\n }", "function viewProductsForSale(callback) {\n // Query DB\n connection.query(`SELECT id,\n product_name, \n department_name, \n price,\n stock_quantity\n FROM products`, function (error, results, fields) {\n if (error) throw error;\n\n // Display results\n console.log();\n console.table(results);\n\n if (callback) {\n callback();\n }\n });\n}", "function viewDeptSales() {\n salesByDept();\n}", "function totalSales(products, lineItems){\n //TODO\n\n}", "function viewProductSales() {\n connection.query(\n 'SELECT department_id, departments.department_name, over_head_costs, sum(product_sales) as product_sales, sum(product_sales) - over_head_costs as total_profit FROM products right join departments on products.department_name=departments.department_name group by department_id, products.department_name, over_head_costs',\n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function topSellerByRevenue(products, lineItems){\n //TODO\n}", "function getOutskirtShop()\r\n {\r\n \r\n var outskirtShop = \"Type(?WarehouseShop, Shop), PropertyValue(?WarehouseShop, hasRoad, MotorwayRoad)\";\r\n \r\n new jOWL.SPARQL_DL(outskirtShop).execute({ onComplete : displayOutskirtShops});\r\n \r\n }", "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "function ProductsForSale() {\n console.log(\"Items up for sale\");\n console.log(\"------------------\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | $\" + res[i].price + \" | \" + res[i].quantity);\n console.log(\"------------------\");\n }\n MainMenu();\n });\n }", "function displaySaleItems() {\n var query = \"SELECT p.item_id AS Product_ID, p.product_name AS Item_Name, p.price AS Sale_Price FROM products p;\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n var productList = [];\n var productData = {};\n for (var i = 0; i < res.length; i++) {\n productData = { Product_ID: res[i].Product_ID, Item_Name: res[i].Item_Name, Sale_Price: res[i].Sale_Price };\n productList.push(productData);\n }\n console.log(\"\\r\\n***** PRODUCT LIST *****\\r\\n\")\n console.table(productList, \"\\r\\n\");\n purchaseItems();\n })\n}", "function forSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id + \"; Product: \" + res[i].product_name + \"; Department: \" + res[i].department_name + \"; Price: $\" + res[i].price + \"; Quantity Available: \" + res[i].stock_quantity);\n };\n nextToDo();\n });\n}", "function viewDepartmentSales() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n 2: {\n alignment: 'right'\n },\n 3: {\n alignment: 'right'\n },\n 4: {\n alignment: 'right'\n }\n }\n };\n data[0] = [\"Department ID\".cyan, \"Department Name\".cyan, \"Over Head Cost ($)\".cyan, \"Products Sales ($)\".cyan, \"Total Profit ($)\".cyan];\n let queryStr = \"departments AS d INNER JOIN products AS p ON d.department_id=p.department_id GROUP BY department_id\";\n let columns = \"d.department_id, department_name, over_head_costs, SUM(product_sales) AS sales\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n DEPARTMENTS\".magenta);\n for (let i = 0; i < res.length; i++) {\n let profit = res[i].sales - res[i].over_head_costs;\n data[i + 1] = [res[i].department_id.toString().yellow, res[i].department_name, res[i].over_head_costs.toFixed(2), res[i].sales.toFixed(2), profit.toFixed(2)];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "async function menu_ViewProductsForSale() {\n console.log(`\\n\\tThese are all products for sale.\\n`);\n\n //* Query\n let products;\n try {\n products = (await bamazon.query_ProductsSelectAll(\n ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity']\n )).results;\n } catch(error) {\n if (error.code && error.sqlMessage) {\n // console.log(error);\n return console.log(`Query error: ${error.code}: ${error.sqlMessage}`);\n }\n // else\n throw error;\n }\n // console.log(products);\n\n //* Display Results\n if (Array.isArray(products) && products.length === 0) {\n return console.log(`\\n\\t${colors.red(\"Sorry\")}, there are no such product results.\\n`);\n }\n\n bamazon.displayTable(products, \n [ bamazon.TBL_CONST.PROD_ID, \n bamazon.TBL_CONST.PROD , \n bamazon.TBL_CONST.DEPT , \n bamazon.TBL_CONST.PRICE , \n bamazon.TBL_CONST.STOCK ], \n colors.black.bgGreen, colors.green);\n\n return;\n}", "function loadSaleData() {\n fetch(`https://arnin-web422-ass1.herokuapp.com/api/sales?page=${page}&perPage=${perPage}`)\n .then((response) => {\n return response.json();\n })\n .then((myJson) => {\n saleData = myJson;\n let rows = saleTableTemplate(saleData);\n $(\"#sale-table tbody\").html(rows);\n $(\"#current-page\").html(page);\n })\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "function showDetails(id){ \n\n let productDetails = [];\n let order = \"\";\n\n all_orders.forEach(_order =>{\n if(_order.id == id){\n order = _order;\n }\n })\n \n order.orderProducts.forEach(product =>{\n let details = {\n name: product.product.name,\n quantity: product.quantity\n }\n productDetails.push(details);\n })\n\n auxDetails(productDetails);\n\n}", "getProductDetails() {\n return `Product id: ${this.id}, Product Name: ${this.name}, Product Base Price: ${this.basePrice} `;\n }", "function top_parts_by_quantity(request){\n\n\t\t\t//var searchObj = search.load({id: 'customsearch1428'});\n\t\t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\n\t\t\tvar customer = request.parameters.customer;\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\"; // \"none of 0\" will let to show everything\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\n\t\t\tif(customer==parent){\t// customer is a parent, we need to show all the childs\n\t\t\t\tlogic1=\"anyof\";\t\t\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\t// customer is a child, we need to show only that one child\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\n\t\t\tvar fleet_logic=\"noneof\";\t\t\t\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\n/*\t\t\t\t\t\t\n\t\t\t\t\t[\n\t\t\t\t\t\t[\"type\",\"anyof\",\"CustInvc\"], \n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"account\",\"anyof\",\"54\"], \n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)],\n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"item.pricinggroup\",\"noneof\",\"233\"], \n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"location.custrecord_sales_area\",\"anyof\",\"7\",\"8\"], \n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"custcol_fleet_num.custrecordfl_body_style\",\"anyof\",\"@ALL@\"]\n\t\t\t\t\t\t],\n\t*/\n\t\t\tvar filter=[\n\t\t\t\t[\"type\",\"anyof\",\"CustInvc\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"account\",\"anyof\",\"54\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)],\n\t\t\t\t\"AND\", \n\t\t\t\t[\"item.pricinggroup\",\"noneof\",\"233\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"custcol_fleet_num.custrecordfl_body_style\",\"anyof\",\"@ALL@\"],\n\t\t\t\t\"AND\", \n\t\t\t\t[\"customer.parent\",logic1,parent1],\n\t\t\t\t\"AND\",\n\t\t\t\t[\"entity\",logic2,parent2],\n\t\t\t \"AND\",\n\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet]\n\t\t\t\t];\n\t\t\t\n\t\t\tvar searchObj = search.create({\n\t\t\t\ttype: \"invoice\",\n\t\t\t\tfilters: filter,\n\t\t\t\tcolumns:\n\t\t\t\t\t[\n\t\t\t\t\t\tsearch.createColumn({\n\t\t\t\t\t\t\tname: \"upccode\",\n\t\t\t\t\t\t\tjoin: \"item\",\n\t\t\t\t\t\t\tsummary: \"GROUP\",\n\t\t\t\t\t\t\tlabel: \"Item #\"\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsearch.createColumn({\n\t\t\t\t\t\t\tname: \"salesdescription\",\n\t\t\t\t\t\t\tjoin: \"item\",\n\t\t\t\t\t\t\tsummary: \"GROUP\",\n\t\t\t\t\t\t\tlabel: \"Description\"\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsearch.createColumn({\n\t\t\t\t\t\t\tname: \"quantity\",\n\t\t\t\t\t\t\tsummary: \"SUM\",\n\t\t\t\t\t\t\tsort: search.Sort.DESC,\n\t\t\t\t\t\t\tlabel: \"Quantity\"\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsearch.createColumn({\n\t\t\t\t\t\t\tname: \"formulacurrency\",\n\t\t\t\t\t\t\tsummary: \"SUM\",\n\t\t\t\t\t\t\tformula: \"nvl(({quantity}*{item.cost})+{amount},0)\",\n\t\t\t\t\t\t\tlabel: \"Formula (Currency)\"\n\t\t\t\t\t\t})\n\t\t\t\t\t\t]\n\t\t\t});\n\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t\t\tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t\t\tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t\t\treturn result_array;\n\n\t\t}", "function getDetails() {\n\n}", "function viewProductByDept(){\n //prints the items for sale and their details\n connection.query('SELECT * FROM departments', function(err, res){\n if(err) throw err;\n // cli-table build\n var table = new Table({\n head: [\"Id\", \"Department\", \"Over-Head\" , \"Sales\", \"Profit\"]\n , colWidths: [5, 20, 10, 10, 10]\n });\n \n //push data to table\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].department_id, res[i].department_name, (res[i].over_head_costs).toFixed(2), (res[i].total_sales).toFixed(2), (res[i].total_sales - res[i].over_head_costs).toFixed(2)]\n )\n }\n // displays table\n console.log(table.toString());\n isThatAll();\n })\n}", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function showCustomerSale(customerId,product_id){\n $(\".shopInfo\").css(\"display\", \"block\");\n custModule.queryCustomerRecord(customerId,product_id,function(responseData) {\n var httpResponse = JSON.parse(responseData.response);\n if (responseData.ack == 1 && httpResponse.retcode ==200) {\n var retData = httpResponse.retbody;\n $(\"#sale_dt\").html(common.isNotnull(retData.sale_dt) ? retData.sale_dt : '-');\n $(\"#last_sale_price\").html(common.isNotnull(retData.sale_price) ?'¥'+ retData.sale_price : '-');\n $(\"#last_sale_num\").html(common.isNotnull(retData.sale_num) ? retData.sale_num + retData.unit: '-');\n if(retData.sale_price){\n $(\".product_price\").val(retData.sale_price);\n }\n } else {\n $.toast(\"本地网络连接有误\", 2000, 'error');\n }\n });\n }", "function productsForSale() {\n connection.query('SELECT * FROM products', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity', 'product_sales'],\n colWidths: [10, 25, 20, 10, 18, 15]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].department_name, allProducts[i].price, allProducts[i].stock_quantity, allProducts[i].product_sales]);\n }\n\n console.log(table.toString());\n console.log('\\n');\n managerView();\n });\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n console.log(\"\\n\" + colors.yellow(\"---------------------PRODUCTS FOR SALE---------------------\") + \"\\n\");\n var table = new cliTable({ head: [\"ID\", \"Item\", \"Price\", \"Quantity\"] });\n for (var i = 0; i < results.length; i++) {\n table.push([results[i].id, results[i].productName, results[i].price, results[i].stockQuantity]);\n }\n console.log(table.toString() + \"\\n\");\n actionPrompt();\n });\n}", "function salesReport(req, res) {\n let db = req.app.get('db');\n let limit = req.body.limit || 50;\n let offset = req.body.offset || 0;\n let baseQuery = `SELECT * from items where sold = true`;\n\n // if sortAttr is provided, add sort command to the query\n let sortAttr = req.body.sortAttr;\n let sortOrder = req.body.sortOrder || 'asc';\n if (sortAttr) baseQuery += ` order by ${sortAttr} ${sortOrder}`\n\n // add limit and offset to the query\n baseQuery += ` limit $1 offset $2`\n\n return db.query(baseQuery, [limit, offset])\n .then(items => {\n let numResults = items.length;\n let offsetForNextPage = offset + numResults;\n let offsetForPrevPage = offset - limit;\n if (offsetForPrevPage < 0) offsetForPrevPage = 0;\n // If we dont get a full set of results back, we're at the end of the data\n if (numResults < limit) offsetForNextPage = null;\n let data = {\n items,\n offsetForPrevPage: offsetForPrevPage,\n offsetForNextPage, offsetForNextPage\n }\n return sendSuccess(res, data);\n })\n .catch(e => sendError(res, e, 'salesReport'))\n}", "function viewProductsForSale(runMgrView, cb) {\n\n // console.log(\"Inside viewProductsForSale()\");\n\n let queryString = \"SELECT * FROM products\";\n\n let query = connection.query(queryString, function (err, res) {\n\n if (err) throw err;\n\n console.log(\"\\n\\n\");\n console.log(\"\\t\\t\\t\\t---- Products for sale ---- \\n\");\n\n console.log(\"\\tITEM ID\" + \"\\t\\t|\\t\" + \"ITEM NAME\" + \"\\t\\t|\\t\" + \"ITEM PRICE\" + \"\\t|\\t\" + \"QUANTITY\");\n console.log(\"\\t-------\" + \"\\t\\t|\\t\" + \"---------\" + \"\\t\\t|\\t\" + \"----------\" + \"\\t|\\t\" + \"--------\");\n\n res.forEach(item =>\n console.log(\"\\t\" + item.item_id + \"\\t\\t|\\t\" + item.product_name + \"\\t\\t|\\t\" + item.price.toFixed(2) + \"\\t\\t|\\t\" + item.stock_quantity)\n );\n\n if (runMgrView) {\n //Call manager view\n console.log(\"\\n\\n\");\n bamazonManagerView();\n } else {\n cb();\n }\n\n });\n\n\n}", "getDetails(){\n return [ this.search,\n this.cost,\n this.state,\n this.children]\n }", "function displayItemsForSale() {\n connection.query(\"SELECT item_id, product_name, price, department_name,stock_quantity FROM products\", function (err, result) {\n if (err) throw err;\n\n if (result.length == 0) {\n console.log(\"There are no items for sale.\");\n }\n\n for (var i = 0; i < result.length; i++) {\n console.log(colors.green(\"\\nBook ID: \" + result[i].item_id.toString() + \"\\n\" +\n \"Book Name: \" + result[i].product_name + \"\\n\" +\n \"Book Price: \" + parseInt(result[i].price).toFixed(2) + \"\\n\" +\n \"Department: \" + result[i].department_name + \"\\n\" +\n \"Stock: \" + result[i].stock_quantity));\n }\n chooseMenu();\n });\n}", "cartSaleItems(state){\n return state.cart.filter( item => {\n return (item.head.onSale || item.leftArm.onSale || item.torso.onSale || item.rightArm.onSale || item.base.onSale);\n })\n }", "function total_sales_by_location(request){\n\n \t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar customer = request.parameters.customer;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\n//fleet\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\";\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\n\t\t\tif(customer==parent){\n\t\t\t\tlogic1=\"anyof\";\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\n//fleet variables for fleet number filter\n\t\t\tvar fleet_logic=\"noneof\";\n\t\t\t\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\t\t\t\n/*\t\t\t\t\t\t\n\t\t\tvar filter1=[\n\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t \"AND\", \n\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t \"AND\", \n\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t \"AND\", \n\t\t\t [\"location\",\"anyof\",\"8\",\"9\",\"10\",\"51\",\"52\",\"5\",\"228\",\"225\",\"223\",\"224\",\"222\"], \n\t\t\t \"AND\", \n\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t ];\n\t\t\tvar filter2=[\n\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t \"AND\", \n\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t \"AND\", \n\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t \"AND\", \n\t\t\t [\"entity\",\"is\",customer], \n\t\t\t \"AND\", \n\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t ];\n\t\t\t\n\t\t\tif(customer==848) filter=filter2\n\t\t\telse filter=filter1;\n\t*/\n\t\t\tvar filter=[\n\t\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"customer.parent\",logic1,parent1],\n\t\t\t\t \"AND\",\n\t\t\t\t [\"entity\",logic2,parent2],\n//fleet\t\t\t\t \n\t\t\t\t \"AND\",\n\t\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet],\n\t\t\t\t \"AND\",\n\t\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t\t ];\n\t\t\t\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\n\t\t\tvar searchObj = search.create({\n\t\t\t\t type: \"transaction\",\n\t\t\t\t filters:filter,\n\t\t\t\t columns:\n\t\t\t\t [\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"companyname\",\n\t\t\t\t join: \"customer\",\n\t\t\t\t summary: \"GROUP\",\n\t\t\t\t label: \"Location\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"formulacurrency\",\n\t\t\t\t summary: \"SUM\",\n\t\t\t\t formula: \"CASE WHEN {customer.category} != 'Krone' THEN {netamountnotax} ELSE 0 END\",\n\t\t\t\t label: \"Formula (Currency)\"\n\t\t\t\t })\n\t\t\t\t ]\n\t\t\t\t});\n\t\t\t\t\n\t \t//var searchObj = search.load({id: 'customsearch_sal_sales_by_branch_3_2_3'});\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t \tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t \tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\t\t\t\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t \treturn result_array;\n\t\t}", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "getProductLineItems(shipment) {\n\n }", "function getShops(item){\n\t\t\n\t}", "function saleToggle(event) {\n // console.log(event);\n if (event.target.name === 'sale') {\n currentInventory.beers[event.target.id].toggleSale();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "function viewSaleProducts(callback){\n //create a query to select all the products\n var allprods = connection.query(\n 'select item_id, product_name, department_id, price, stock_qty, product_sales from products', \n function(err, res){\n if(err){\n throw err;\n }\n else{\n console.log('\\n');\n console.table(res);\n //if call back exists call that function\n if(callback){\n callback();\n }\n //else display the products\n else{\n managerMenu();\n }\n }\n });\n}", "function displayForSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n\n if (err) throw err;\n var price;\n items = res.length;\n var sales;\n console.log(\"=====================================================================\");\n var tableArr = [];\n for (var i = 0; i < res.length; i++) {\n sales = parseFloat(res[i].product_sales).toFixed(2);\n price = parseFloat(res[i].price).toFixed(2);\n tableArr.push(\n {\n ID: res[i].item_id,\n PRODUCT: res[i].product_name,\n DEPARTMENT: res[i].department_name,\n PRICE: price,\n ONHAND: res[i].stock_quantity,\n SALES: sales\n }\n )\n }\n console.table(tableArr);\n console.log(\"=====================================================================\");\n promptChoice();\n })\n}", "function getRetailPark()\r\n {\r\n \r\n var retailParkShop = \"Type(?RetailParkShop, Shop), PropertyValue(?RetailParkShop, hasComplex, RetailParkComplex)\";\r\n \r\n new jOWL.SPARQL_DL(retailParkShop).execute({ onComplete : displayRetailParkShops});\r\n \r\n }", "function displayProducts(){\n \n\tconnection.query(sql, function(err, data) {\n\t if (err) {\n\t console.log(err);\n\t }\n\n\t var items = '';\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\titems = '';\n\t\t\t\titems += 'ID: ' + data[i].item_id + ' | ';\n\t\t\t\titems += 'Product: ' + data[i].product_name + ' | ';\n\t\t\t\titems += 'Dept: ' + data[i].department_name + ' | ';\n\t\t\t\titems += '$' + data[i].price + ' | ';\n\t\t\t\titems += 'Quantity: ' + data[i].stock_quantity;\n\t\t console.log(\"------------------------------------------------------------------------\");\n\t console.log(items);\n\t\t\t};\n\n\t\tpurchase();\n\n\t});\n\n}", "function getAllSales() {\n if (!sessionStorage.current_user) {\n window.location.href = \"index.html\";\n }\n var init = {\n method : 'GET',\n headers : header\n \n };\n\n req = new Request(sales_url,init)\n\n fetch(req)\n .then((res)=>{\n console.log(res);\n status = res.status\n return res.json();\n })\n .then((data)=>{\n if (status==401){\n window.location.href = \"index.html\";\n }\n\n rowNum = 1; //the row id\n data['Sales Record'].forEach(sale => {\n\n // save the queried data in a list for ease of retrieving\n\n sales_record[sale['sales_id']] = {\n \"user_id\": sale['user_id'],\n \"product_id\": sale['product_id'],\n \"quantity\": sale['quantity'],\n \"sales_amount\": sale['sales_amount'],\n \"sales_date\": sale['sales_date']\n };\n console.log(sales_record)\n sales_table = document.getElementById('tbl-products')\n let tr = createNode('tr'),\n td = createNode('td');\n \n\n // table data\n t_data=[\n rowNum,sale['product_name'],\n sale['username'],\n sale['sales_date'],\n sale['sales_amount']\n ];\n console.log(t_data)\n\n tr = addTableData(tr,td,t_data);\n console.log(tr);\n\n\n // add the view edit and delete buttons\n td = createNode('td')\n td.innerHTML=` <i id=\"${sale['sales_id']}\" onclick=\"showProductPane(this)\" class=\"fas fa-eye\"> </i>`;\n td.className=\"text-green\";\n appendNode(tr,td);\n console.log(\"here\")\n\n \n \n\n appendNode(sales_table,tr);\n rowNum +=1\n });\n\n });\n}", "function readItems() {\n console.log(\"Getting Items for sale... \\n\");\n query = connection.query(\"Select * FROM products\", function (err, res) {\n if (err) {\n console.log(err);\n }\n console.log(\"<<<<<<<<< STORE >>>>>>>>>>>\");\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"\\nID: \" +\n res[i].item_id +\n \" || ITEM: \" +\n res[i].product_name +\n \" || PRICE: \" +\n res[i].price\n )\n };\n shoppingCart();\n })\n}", "executeSale(amt, hierarchyName, planName){\n const hierarchy = this.hierarchies[hierarchyName];\n const plan = this.plans[planName].percents;\n let commissions = {\n total: 0,\n agentsWithSaleCommission: {},\n saleStrings: [], //this is an easy way to print out information about the commissions\n }\n ;\n if(hierarchy && plan){\n let i = 0; //for tracking percent in the plan\n hierarchy.agentsInOrder.forEach((agentName) => {\n let percent;\n if(i >= plan.length){\n //If the plan has less percents than agents, assume those agents receive nothing.\n percent = 0;\n } else {\n percent = plan[i];\n }\n\n const agent = this.agents[agentName];\n let commission = agent.commissionPercent * percent * amt;\n commission = parseFloat(commission.toFixed(2)); //needed due to float imprecision\n commissions.total += commission;\n commissions.agentsWithSaleCommission[agentName] = commission;\n\n //Generate string\n commissions.saleStrings.push(\n `${i === 0 ? 'Selling Agent':`Super Agent ${i}`} (${agent.name}) gets `+\n `${percent * 100}% of the agent commission % of policy amount = `+\n `${parseFloat((percent * 100).toFixed(2))}% * ${parseFloat((agent.commissionPercent * 100).toFixed(2))}% * ${amt} = ${commission}`\n );\n\n i++;\n })\n } else {\n throw new Error('Unknown Hierarchy or Plan');\n }\n\n return commissions;\n }", "function details() {\n let did = dsel.value;\n if (!did) return;\n fetch(base + \"/dispenser/\" + did)\n .then(resp => resp.json()).then(function(json) {\n let perc = Math.ceil(json[\"valor_atual\"]/json[\"vol_max\"]*100);\n curml.innerText = json[\"valor_atual\"] + \" mL (\" + perc + \"%)\";\n curdesc.innerText = json[\"desc\"];\n });\n}", "function salesByDep() {\n // console.log(\"loading product sales...\");\n\n // join department and products \n // table needs to have depid, depName, overhead, productSales and totalProfits \n\n\nconnection.query(`SELECT departments.department_id AS 'Department ID', \ndepartments.department_name AS 'Department Name', \ndepartments.over_head_costs as 'Overhead Costs', \nSUM(products.product_sales) AS 'Product Sales', \n(SUM(products.product_sales) - departments.over_head_costs) AS 'Total Profit' \nFROM departments\nLEFT JOIN products on products.department_name=departments.department_name\nGROUP BY departments.department_name, departments.department_id, departments.over_head_costs\nORDER BY departments.department_id ASC`, (err, res) => {\n if (err) throw err;\n console.log('\\n ----------------------------------------------------- \\n');\n console.table(res);\n\n startSuper();\n\n });\n\n\n}", "function viewSalesByDept(){\n\n connection.query('SELECT * FROM Departments', function(err, res){\n if(err) throw err;\n\n // Table header\n console.log('\\n' + ' ID | Department Name | OverHead Costs | Product Sales | Total Profit');\n console.log('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -')\n \n // Loop through database and show all items\n for(var i = 0; i < res.length; i++){\n\n //=============================== Add table padding ====================================\n var departmentID = res[i].DepartmentID + ''; // convert to string\n departmentID = padText(\" ID \", departmentID);\n\n var departmentName = res[i].DepartmentName + ''; // convert to string\n departmentName = padText(\" Department Name \", departmentName);\n\n // Profit calculation\n var overHeadCost = res[i].OverHeadCosts.toFixed(2);\n var totalSales = res[i].TotalSales.toFixed(2);\n var totalProfit = (parseFloat(totalSales) - parseFloat(overHeadCost)).toFixed(2);\n\n\n // Add $ signs to values\n overHeadCost = '$' + overHeadCost;\n totalSales = '$' + totalSales;\n totalProfit = '$' + totalProfit;\n\n // Padding for table\n overHeadCost = padText(\" OverHead Costs \", overHeadCost);\n totalSales = padText(\" Product Sales \", totalSales);\n \n // =================================================================================================\n\n console.log(departmentID + '|' + departmentName + '|' + overHeadCost + '|' + totalSales + '| ' + totalProfit);\n }\n connection.end();\n });\n}", "function getTheData() {\n if(totalSale) {\n\tmod1.remove();\n }\n //get the data\n totalSale = d3.select(\"#totalRealSales\")\n .property(\"value\");\n totalTarget = d3.select(\"#totalTargetSales\")\n .property(\"value\");\n //use the function to show the painting\n show(parseInt(totalSale),parseInt(totalTarget));\n}", "function pageInit() {\n\n console.log(nlapiGetFieldValue('zee'));\n\n //Search: MPEX Price Point - Customer List\n var mpexPriceSearch = nlapiLoadSearch('customer', 'customsearch_mpex_price_point_customer');\n\n var addFilterExpression = new nlobjSearchFilter('partner', null, 'anyof', parseInt(nlapiGetFieldValue('zee')));\n mpexPriceSearch.addFilter(addFilterExpression);\n\n var resultSetCustomer = mpexPriceSearch.runSearch();\n\n var count = 0;\n var customer_count = 0;\n\n var dataSet = '{\"data\":[';\n\n resultSetCustomer.forEachResult(function(searchResult) {\n\n var custid = searchResult.getValue(\"internalid\");\n var entityid = searchResult.getValue(\"entityid\");\n var zee_id = searchResult.getValue(\"partner\");\n var companyname = searchResult.getValue(\"companyname\");\n var mpex_1kg = searchResult.getValue(\"custentity_mpex_1kg_price_point\");\n var mpex_3kg = searchResult.getValue(\"custentity_mpex_3kg_price_point\");\n var mpex_5kg = searchResult.getValue(\"custentity_mpex_5kg_price_point\");\n var mpex_500g = searchResult.getValue(\"custentity_mpex_500g_price_point\");\n var mpex_b4 = searchResult.getValue(\"custentity_mpex_b4_price_point\");\n var mpex_c5 = searchResult.getValue(\"custentity_mpex_c5_price_point\");\n var mpex_dl = searchResult.getValue(\"custentity_mpex_dl_price_point\");\n var mpex_1kg_new = searchResult.getValue(\"custentity_mpex_1kg_price_point_new\");\n var mpex_3kg_new = searchResult.getValue(\"custentity_mpex_3kg_price_point_new\");\n var mpex_5kg_new = searchResult.getValue(\"custentity_mpex_5kg_price_point_new\");\n var mpex_500g_new = searchResult.getValue(\"custentity_mpex_500g_price_point_new\");\n var mpex_b4_new = searchResult.getValue(\"custentity_mpex_b4_price_point_new\");\n var mpex_c5_new = searchResult.getValue(\"custentity_mpex_c5_price_point_new\");\n var mpex_dl_new = searchResult.getValue(\"custentity_mpex_dl_price_point_new\");\n var mpex_start_date = searchResult.getValue(\"custentity_mpex_price_point_start_date\");\n\n //Current MPEX Price Points\n if (isNullorEmpty(mpex_1kg)) {\n mpex_1kg = '0';\n }\n if (isNullorEmpty(mpex_3kg)) {\n mpex_3kg = '0';\n }\n if (isNullorEmpty(mpex_5kg)) {\n mpex_5kg = '0';\n }\n if (isNullorEmpty(mpex_500g)) {\n mpex_500g = '0';\n }\n if (isNullorEmpty(mpex_b4)) {\n mpex_b4 = '0';\n }\n if (isNullorEmpty(mpex_c5)) {\n mpex_c5 = '0';\n }\n if (isNullorEmpty(mpex_dl)) {\n mpex_dl = '0';\n }\n\n //New MPEX Price Points\n if (isNullorEmpty(mpex_1kg_new)) {\n mpex_1kg_new = '0';\n }\n if (isNullorEmpty(mpex_3kg_new)) {\n mpex_3kg_new = '0';\n }\n if (isNullorEmpty(mpex_5kg_new)) {\n mpex_5kg_new = '0';\n }\n if (isNullorEmpty(mpex_500g_new)) {\n mpex_500g_new = '0';\n }\n if (isNullorEmpty(mpex_b4_new)) {\n mpex_b4_new = '0';\n }\n if (isNullorEmpty(mpex_c5_new)) {\n mpex_c5_new = '0';\n }\n if (isNullorEmpty(mpex_dl_new)) {\n mpex_dl_new = '0';\n }\n\n //MPEX Price Points Start Date\n if (isNullorEmpty(mpex_start_date)) {\n mpex_start_date = '';\n }\n\n\n //Create data set for each customer\n dataSet += '{\"cust_id\":\"' + custid + '\", \"entityid\":\"' + entityid + '\", \"companyname_text\":\"' + companyname + '\", \"company_name\":\"' + companyname + '\",\"mpex_1kg\": \"' + mpex_1kg + '\",\"mpex_3kg\": \"' + mpex_3kg + '\",\"mpex_5kg\": \"' + mpex_5kg + '\",\"mpex_500g\": \"' + mpex_500g + '\",\"mpex_b4\": \"' + mpex_b4 + '\",\"mpex_c5\": \"' + mpex_c5 + '\",\"mpex_dl\": \"' + mpex_dl + '\",\"mpex_1kg_new\": \"' + mpex_1kg_new + '\",\"mpex_3kg_new\": \"' + mpex_3kg_new + '\",\"mpex_5kg_new\": \"' + mpex_5kg_new + '\",\"mpex_500g_new\": \"' + mpex_500g_new + '\",\"mpex_b4_new\": \"' + mpex_b4_new + '\",\"mpex_c5_new\": \"' + mpex_c5_new + '\",\"mpex_dl_new\": \"' + mpex_dl_new + '\", \"mpex_start_date\": \"' + mpex_start_date + '\"},';\n\n count++;\n return true;\n });\n\n if (count > 0) {\n dataSet = dataSet.substring(0, dataSet.length - \"1\");\n console.log(dataSet);\n dataSet += ']}';\n } else {\n\n dataSet += ']}';\n }\n\n console.log(dataSet);\n var parsedData = JSON.parse(dataSet);\n console.log(parsedData.data);\n\n //JQuery to sort table based on click of header. Attached library \n $(document).ready(function() {\n table = $(\"#customer\").DataTable({\n \"data\": parsedData.data,\n \"columns\": [{\n \"data\": null, //Entity ID\n \"render\": function(data, type, row) {\n return '<p><b>' + data.entityid + '</b><p>';\n }\n }, {\n \"data\": null, //Company Name\n \"render\": function(data, type, row) {\n return '<p><b>' + data.companyname_text + '</b><p><input type=\"hidden\" class=\"form-control customer_id text-center\" value=\"' + data.cust_id + '\">';\n }\n }, {\n \"data\": null,\n \"render\": function(data, type, row) { //MPEX Start Date\n return '<p><b>' + data.mpex_start_date + '</b><p>';\n }\n }, {\n \"data\": null, // MPEX 5Kg Current Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_5kg text-center\" value=\"' + data.mpex_5kg + '\"><select class=\"form-control 5kg text-center\" disabled>';\n if (data.mpex_5kg == '1') {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option>h<option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_5kg == '2') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_5kg == '4') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_5kg == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n },\n\n }, {\n \"data\": null, //MPEX 5Kg New Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_5kg_new text-center\" value=\"' + data.mpex_5kg_new + '\"><select class=\"form-control 5kg_new text-center\" >';\n if (data.mpex_5kg_new == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_5kg_new == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_5kg_new == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_5kg_new == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX 3Kg Current Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_3kg text-center\" value=\"' + data.mpex_3kg + '\"><select class=\"form-control 3kg text-center\" disabled>';\n if (data.mpex_3kg == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_3kg == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_3kg == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_3kg == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX 3Kg New Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_3kg_new text-center\" value=\"' + data.mpex_3kg_new + '\"><select class=\"form-control 3kg_new text-center\">';\n if (data.mpex_3kg_new == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_3kg_new == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_3kg_new == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_3kg == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" >Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX 1Kg Current Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_1kg text-center\" value=\"' + data.mpex_1kg + '\"><select class=\"form-control 1kg text-center\" disabled>';\n if (data.mpex_1kg == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_1kg == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_1kg == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_1kg == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX 1Kg New Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_1kg_new text-center\" value=\"' + data.mpex_1kg_new + '\"><select class=\"form-control 1kg_new text-center\">';\n if (data.mpex_1kg_new == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_1kg_new == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_1kg_new == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_1kg_new == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX 500g Current Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_500g text-center\" value=\"' + data.mpex_500g + '\"><select class=\"form-control 500g text-center\" disabled>';\n if (data.mpex_500g == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_500g == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_500g == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_500g == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n\n },\n }, {\n \"data\": null, //MPEX 500g New Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_500g_new text-center\" value=\"' + data.mpex_500g_new + '\"><select class=\"form-control 500g_new text-center\">';\n if (data.mpex_500g_new == 1) {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option>h<option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_500g_new == 2) {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_500g_new == 4) {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_500g_new == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n },\n\n }, {\n \"data\": null, //MPEX B4 Current Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_b4 text-center\" value=\"' + data.mpex_b4 + '\"><select class=\"form-control b4 text-center\" disabled>';\n if (data.mpex_b4 == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_b4 == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_b4 == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_b4 == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX B4 New Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_b4_new text-center\" value=\"' + data.mpex_b4_new + '\"><select class=\"form-control b4_new text-center\">';\n if (data.mpex_b4_new == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_b4_new == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_b4_new == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option><option value=\"5\">AP Match</option>'\n } else if (data.mpex_b4_new == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" >Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\">AP Match</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX C5 Current Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_c5 text-center\" value=\"' + data.mpex_c5 + '\"><select class=\"form-control c5 text-center\" disabled>';\n if (data.mpex_c5 == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option>'\n } else if (data.mpex_c5 == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option>'\n } else if (data.mpex_c5 == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option>'\n } else if (data.mpex_c5 == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX C5 New Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_c5_new text-center\" value=\"' + data.mpex_c5_new + '\"><select class=\"form-control c5_new text-center\">';\n if (data.mpex_c5_new == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option>'\n } else if (data.mpex_c5_new == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option>'\n } else if (data.mpex_c5_new == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option>'\n } else if (data.mpex_c5_new == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" >Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX DL Current Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_dl text-center\" value=\"' + data.mpex_dl + '\"><select class=\"form-control dl text-center\" disabled>';\n if (data.mpex_dl == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option>'\n } else if (data.mpex_dl == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option>'\n } else if (data.mpex_dl == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option>'\n } else if (data.mpex_dl == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option>'\n }\n column_data += '</select>';\n return column_data;\n\n }\n }, {\n \"data\": null, //MPEX DL New Price\n \"render\": function(data, type, row) {\n var column_data = '<input type=\"hidden\" class=\"form-control old_dl_new text-center\" value=\"' + data.mpex_dl_new + '\"><select class=\"form-control dl_new text-center\">';\n if (data.mpex_dl_new == \"1\") {\n column_data += '<option value=\"0\"></option><option value=\"1\" selected>Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option>'\n } else if (data.mpex_dl_new == \"2\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\" selected>Platinum</option><option value=\"4\">Standard</option>'\n } else if (data.mpex_dl_new == \"4\") {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\" selected>Standard</option>'\n } else if (data.mpex_dl_new == '5') {\n column_data += '<option value=\"0\"></option><option value=\"1\">Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option><option value=\"5\" selected>AP Match</option>'\n } else {\n column_data += '<option value=\"0\"></option><option value=\"1\" >Gold</option><option value=\"2\">Platinum</option><option value=\"4\">Standard</option>'\n }\n column_data += '</select>';\n return column_data;\n\n },\n }],\n \"order\": [\n [1, 'asc']\n ],\n \"pageLength\": 400,\n \"scrollY\": \"1000px\",\n \"fixedHeader\": {\n \"header\": true\n },\n \"createdRow\": function(row, data, index) {\n\n if (data.mpex_5kg == 1) {\n $('td', row).eq(3).css('background-color', '#ecc60b');\n\n } else if (data.mpex_5kg == 2) {\n $('td', row).eq(3).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_5kg == 4) {\n $('td', row).eq(3).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(3).removeAttr(\"style\");\n }\n if (data.mpex_5kg_new == 1) {\n $('td', row).eq(4).css('background-color', '#ecc60b');\n\n } else if (data.mpex_5kg_new == 2) {\n $('td', row).eq(4).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_5kg_new == 4) {\n $('td', row).eq(4).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(4).removeAttr(\"style\");\n }\n if (data.mpex_3kg == 1) {\n $('td', row).eq(5).css('background-color', '#ecc60b');\n\n } else if (data.mpex_3kg == 2) {\n $('td', row).eq(5).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_3kg == 4) {\n $('td', row).eq(5).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(5).removeAttr(\"style\");\n }\n if (data.mpex_3kg_new == 1) {\n $('td', row).eq(6).css('background-color', '#ecc60b');\n\n } else if (data.mpex_3kg_new == 2) {\n $('td', row).eq(6).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_3kg_new == 4) {\n $('td', row).eq(6).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(6).removeAttr(\"style\");\n }\n if (data.mpex_1kg == 1) {\n $('td', row).eq(7).css('background-color', '#ecc60b');\n\n } else if (data.mpex_1kg == 2) {\n $('td', row).eq(7).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_1kg == 4) {\n $('td', row).eq(7).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(7).removeAttr(\"style\");\n }\n if (data.mpex_1kg_new == 1) {\n $('td', row).eq(8).css('background-color', '#ecc60b');\n\n } else if (data.mpex_1kg_new == 2) {\n $('td', row).eq(8).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_1kg_new == 4) {\n $('td', row).eq(8).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(8).removeAttr(\"style\");\n }\n if (data.mpex_500g == 1) {\n $('td', row).eq(9).css('background-color', '#ecc60b');\n\n } else if (data.mpex_500g == 2) {\n $('td', row).eq(9).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_500g == 4) {\n $('td', row).eq(9).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(9).removeAttr(\"style\");\n }\n if (data.mpex_500g_new == 1) {\n $('td', row).eq(10).css('background-color', '#ecc60b');\n\n } else if (data.mpex_500g_new == 2) {\n $('td', row).eq(10).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_500g_new == 4) {\n $('td', row).eq(10).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(10).removeAttr(\"style\");\n }\n if (data.mpex_b4 == 1) {\n $('td', row).eq(11).css('background-color', '#ecc60b');\n\n } else if (data.mpex_b4 == 2) {\n $('td', row).eq(11).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_b4 == 4) {\n $('td', row).eq(11).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(11).removeAttr(\"style\");\n }\n if (data.mpex_b4_new == 1) {\n $('td', row).eq(12).css('background-color', '#ecc60b');\n\n } else if (data.mpex_b4_new == 2) {\n $('td', row).eq(12).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_b4_new == 4) {\n $('td', row).eq(12).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(12).removeAttr(\"style\");\n }\n if (data.mpex_c5 == 1) {\n $('td', row).eq(13).css('background-color', '#ecc60b');\n\n } else if (data.mpex_c5 == 2) {\n $('td', row).eq(13).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_c5 == 4) {\n $('td', row).eq(13).css('background-color', '#7abcf5');\n } else {\n $('td', row).eq(13).removeAttr(\"style\");\n }\n if (data.mpex_c5_new == 1) {\n $('td', row).eq(14).css('background-color', '#ecc60b');\n\n } else if (data.mpex_c5_new == 2) {\n $('td', row).eq(14).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_c5_new == 4) {\n $('td', row).eq(14).css('background-color', '#7abcf5');\n } else {\n $('td', row).eq(14).removeAttr(\"style\");\n }\n if (data.mpex_dl == 1) {\n $('td', row).eq(15).css('background-color', '#ecc60b');\n\n } else if (data.mpex_dl == 2) {\n $('td', row).eq(15).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_dl == 4) {\n $('td', row).eq(15).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(15).removeAttr(\"style\");\n }\n if (data.mpex_dl_new == 1) {\n $('td', row).eq(16).css('background-color', '#ecc60b');\n\n } else if (data.mpex_dl_new == 2) {\n $('td', row).eq(16).css('background-color', '#a7a6a1');\n\n } else if (data.mpex_dl_new == 4) {\n $('td', row).eq(16).css('background-color', '#7abcf5');\n\n } else {\n $('td', row).eq(16).removeAttr(\"style\");\n }\n }\n });\n });\n console.log('after')\n\n var main_table = document.getElementsByClassName(\"uir-outside-fields-table\");\n var main_table2 = document.getElementsByClassName(\"uir-inline-tag\");\n\n\n\n for (var i = 0; i < main_table.length; i++) {\n // main_table[i].style.width = \"50%\";\n }\n\n for (var i = 0; i < main_table2.length; i++) {\n // main_table2[i].style.position = \"absolute\";\n // main_table2[i].style.width = \"75%\";\n main_table2[i].style.top = \"275px\";\n main_table2[i].style.left = \"13%\";\n }\n\n if (role == 1000) {\n $(\"#customer_wrapper\").css({\n \"padding-top\": \"300px\"\n });\n } else {\n // $(\"#customer_wrapper\").css({\n // \t\"padding-top\": \"300px\"\n // });\n $(\".admin_section\").css({\n \"padding-top\": \"300px\"\n });\n }\n\n $(\"#customer_length\").css({\n \"float\": \"right !important\"\n });\n\n $(\"#customer_filter\").css({\n \"float\": \"left !important\"\n });\n\n\n}", "function productsForSale() {\n\tvar query = \"SELECT * FROM products HAVING stock_quantity > 0\";\n\tconnection.query(query, function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n\t\t\tconsole.log(\"-----------------------------\");\n\t\t}\n\trunSearch();\n\t});\n}", "function total_sales_by_location_morrisons(request){\n\n \t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\n\t\t\tvar customer = isnull(request.parameters.customer,0);\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\";\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\t\t\tvar fleet_logic=\"noneof\";\n\t\t\tvar fleet=0;\n\t\t\t\n\t\t\tif(customer==parent){\n\t\t\t\tlogic1=\"anyof\";\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\t\t\t\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\t\t\t\n\t\t\tvar searchObj = search.create({\n\t\t\t\t type: \"transaction\",\n\t\t\t\t filters: [\n\t\t\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"customer.parent\",logic1,parent1],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"entity\",logic2,parent2],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t\t\t ],\n\t\t\t\t columns:\n\t\t\t\t [\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"companyname\",\n\t\t\t\t join: \"customer\",\n\t\t\t\t summary: \"GROUP\",\n\t\t\t\t label: \"Location\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"formulacurrency\",\n\t\t\t\t summary: \"SUM\",\n\t\t\t\t formula: \"CASE WHEN {customer.category} != 'Krone' THEN {netamountnotax} ELSE 0 END\",\n\t\t\t\t label: \"Formula (Currency)\"\n\t\t\t\t })\n\t\t\t\t ]\n\t\t\t\t});\n\n\t\t\t/*\told filter\n\t\t\t[\n\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t \"AND\", \n\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t \"AND\", \n\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t \"AND\", \n\t\t [\"location\",\"anyof\",\"8\",\"9\",\"10\",\"51\",\"52\",\"5\",\"228\",\"225\",\"223\",\"224\",\"222\"], \n\t\t \"AND\", \n\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t ];\n*/\n\t\t\t\n\t \t//var searchObj = search.load({id: 'customsearch_sal_sales_by_branch_3_2_3'});\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t \tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t \tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\t\t\t\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t \treturn result_array;\n\t\t}", "function viewProductsSaleDepartment() {\n console.log(\"======================\")\n console.log(chalk.green(\"View Product Sales by Department\"));\n\n connection.query(\"DROP TABLE bamazon.departments\", function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"CREATE TABLE departments (department_id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(100) NULL, over_head_costs INT(10) NULL,product_sales INT(10) NULL, PRIMARY KEY(department_id));\",\n function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"SELECT * FROM products\", function (err, results) {\n\n for (var i = 0; i < results.length; i++) {\n\n var sale_quantity = results[i].product_sales / results[i].price;\n // console.log(`[${i}] || ${sale_quantity}`);\n var profit = results[i].product_sales * 0.20;\n var overheadcosts = results[i].product_sales - profit;\n // console.log(`[${i}] || ${profit}`);\n\n connection.query(\"INSERT INTO departments SET ?\",\n {\n department_name: results[i].department_name,\n over_head_costs: overheadcosts,\n product_sales: results[i].product_sales\n },\n function (err, res) {\n if (err) throw err;\n // console.log(res.affectedRows + \" product inserted!\\n\");\n\n }\n );\n }\n connection.query(\"SELECT department_name, sum(over_head_costs) as over_head_costs, sum(product_sales) as product_sales FROM Bamazon.departments GROUP BY department_name;\",\n function (err, results) {\n if (err) throw err;\n\n var values = [];\n for (var i = 0; i < results.length; i++) {\n var totalprofit = results[i].product_sales - results[i].over_head_costs;\n // console.log(totalprofit);\n values.push([i + 1, results[i].department_name, results[i].over_head_costs, results[i].product_sales, totalprofit]);\n // console.log([i+1]+\"\\t\"+results[i].department_name + \"\\t\" + results[i].over_head_costs + \"\\t\" + results[i].product_sales + \"\\t\" + totalprofit);\n }\n // console.log(values);\n console.log(\"\\n-------------------------------------------------------------------------\");\n console.table(['ID', 'Department Name', 'Over Head Costs', 'Product Sales', 'Profit'], values);\n\n Start();\n });\n\n console.log(\"===================\");\n // Start();\n });\n\n}", "function details() {\n return transformRawCartData();\n }", "function showItemDetails(){\n\n\tvar symbol = document.getElementsByClassName(\"symbol\")[0].innerHTML;\n\n\tsearchReturnItem(parsedText,symbol);\n\t// var showAsset = document.getElementsByClassName(\"symbol\").innerHTML = asset.price;\n\t// var asset = searchReturnAsset(parsedText,asset);\n\t// return document.getElementsByClassName(\"price\").innerHTML = asset.price;\n\t// return console.log(asset.price);\n}", "function printItem(res) {\n console.log(`ID: #${res.item_id}`);\n console.log(`Description: ${res.product_name}`);\n console.log(`Price: ${formatter.format(res.price)}`);\n}", "function controller() {\n\n var arrShirts = [];\n var dir = 'data';\n var curDate = moment().format('YYYY-MM-DD');\n\n var configMain = {\n repeatItemGroup: '.nav > li',\n dataFormat: {\n URL: {\n selector: 'li > a',\n type: 'attr:href'\n }\n }\n };\n\n getPage(baseURL, configMain).then( function(data) {\n for (var i = 0; i < data.length; i++) {\n if (data[i].URL.search('shirt') !== -1) {\n var url = baseURL + '/' + data[i].URL;\n return url;\n }\n }\n }).then( function(url) {\n var configShirts = {\n repeatItemGroup: '.products > li',\n dataFormat: {\n ImageURL: {\n selector: 'li > a > img',\n type: 'attr:src'\n },\n URL: {\n selector: 'li > a',\n type: 'attr:href'\n },\n Time: moment().format('LTS')\n }\n };\n return getPage(url, configShirts);\n }).then( function(data) {\n arrShirts = data;\n var configDetails = {\n repeatItemGroup: '.shirt-details',\n dataFormat: {\n Title: {\n selector: '.shirt-details > h1',\n type: 'text'\n },\n Price: {\n selector: '.price',\n type: 'text'\n }\n }\n };\n return (getDetailPage(data, configDetails));\n }).then( function(data) {\n\n /** Combine two objects into one and remove price from title string and */\n for( var i = 0; i < arrShirts.length; i++) {\n /** data is an array of objects, where each object is stored as an array. Odd, I know. */\n arrShirts[i] = (merge(data[i][0], arrShirts[i]));\n arrShirts[i].Title = arrShirts[i].Title.replace(/\\$\\d+/g, '').trim();\n }\n\n /** convert JSON to csv to prepare for writing to file */\n var csv = baby.unparse(arrShirts);\n\n /** Create data directory if one does not exist */\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir);\n }\n\n /** Write to file */\n var file = dir + '/' + curDate + '.csv';\n fs.writeFile(file, csv, (err) => {\n if (err) throw err;\n var msg = 'Data saved to file: ' + file + '.';\n logger.log(msg);\n });\n\n }).catch(function(e) {\n var msg = '';\n /** Create message to append to error log */ \n if (e.message.startsWith('getaddrinfo ENOTFOUND')) {\n msg = '-- Page couldn\\'t be accessed: ';\n } else {\n msg = '-- Something went wrong: ';\n }\n msg = moment().format('dddd, MMM Do, YYYY, h:mm:ss a') + msg + e.message + '\\n';\n fs.appendFile('scraper.error.log', msg, (err) => {\n if (err) throw err;\n logger.log(msg);\n });\n });\n}", "function customerView () {\n common.openConnection(connection);\n let querySQL = 'SELECT item_id, product_name, stock_quantity, price FROM products where stock_quantity > 0'; // exclude from \"where\" to premit out-of-stock items\n connection.query(querySQL, (error, result) => {\n if (error) throw error;\n let msg = ''; \n let title = 'LIST OF PRODUCTS FOR SALE';\n common.displayProductTable(title, result) // pass title and queryset to function that will print out information\n console.log('\\n');\n customerSelect();\n });\n \n}", "function querySaleProducts() {\n\tinquirer\n\t.prompt({\n\t\tname: \"customer_name\",\n\t\ttype: \"input\",\n\t\tmessage: \"Dear Customer, please enter your name.\"\n\t})\n\t.then(function(answer) {\n\t\tconsole.log(\"Welcome to Bamazon, \" + answer.customer_name + \":) Here is our special sales for you!\");\n\n\t\tvar query = \"SELECT * FROM products WHERE stock_quantity <> 0\";\n\n\t\tconnection.query(query, function(err, res) {\n\t\t\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Item ID: \" + res[i].item_id + \" | \" + res[i].department_name + \": \" + res[i].product_name + \" for $\" + numberWithCommas(res[i].price));\n\t\t}\n\n\t\tqueryOrder();\n\t\t});\t\n\t});\n}", "function showProducts() {\n connection.query('SELECT * FROM products', function (error, res) {\n for (var i = 0; i < res.length; i++) {\n console.log('\\n Beer brand: ' + res[i].product_name + \" | \" + 'Department: ' + res[i].department_name + \" | \" + 'Price (6-pack): ' + res[i].price.toString() + \" | \" + 'Stock: ' + res[i].stock_quantity.toString());\n } \n console.log(\"----------------\");\n productDetails();\n });\n\n}", "function filterSalesRecords(event) {\n\t\n\t//construct empty retrieve JSON object\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"retrieve\"\n\t\t\t}\n\t\t]\n\t};\n\t\n\t//console.log(json);\n\t\n\treturn sendAPIRequest(json, event, displaySalesRecords);\n}", "function moreOutfits() {\n getLooks();\n }", "function getInputData() {\n //Dynamically create Saved Search to grab all eligible Sales orders to invoice\n //In this example, we are grabbing all main level data where sales order status are \n //any of Pending Billing or Pending Billing/Partially Fulfilled\n return search.create({\n type: \"salesorder\",\n filters:\n [\n [\"shipmethod\", \"anyof\", \"37\"],\n \"AND\",\n [\"type\", \"anyof\", \"SalesOrd\"],\n \"AND\",\n [\"status\", \"anyof\", \"SalesOrd:A\"],\n \"AND\",\n [\"memorized\", \"is\", \"F\"],\n \"AND\",\n [\"mainline\", \"is\", \"T\"],\n \"AND\", \n [\"amount\",\"greaterthan\",\"0.00\"], \n \"AND\", \n [\"custbody1\",\"anyof\",\"4926\"]\n ],\n columns:\n [\n search.createColumn({ name: \"tranid\", label: \"Document Number\" })\n ]\n });\n }", "function displayProducts() {\n \n // query/get info from linked sql database/table\n let query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n // map the data response in a format I like, and make it show the info I need it show\n // show the customer the price\n let data = res.map(res => [` ID: ${res.id}\\n`, ` ${res.product_name}\\n`, ` Price: $${res.price} \\n`]);\n console.log(`This is what we have for sale \\n\\n${data}`);\n console.log(\"-----------------\");\n\n userItemChoice();\n quitShopping();\n\n });\n}", "function getSaleLinesData(shopObj, endPoint, clear){\n var objSheet = shopObj.saleLineSheetName;\n var ssID = shopObj.ID;\nlogSales(\"Shop Object\",shopObj.saleLineSheetName)\nvar ss = SpreadsheetApp.openById(ssID);\n var sheet = ss.getSheetByName(objSheet);\n sheet.activate();\n var saleOffset = getCurrentSaleLineID(sheet,ssID); \n if(UIONOFF){ ss.toast(\"Sale Line Off set ID =\"+saleOffset);}\n var headerRows = 1;\n var offset = 0;\n // == -- Specify the type of call needed -- == \\\\ \n var type = \"GET\";\n // == -- Build the URL with any offsets -- == \\\\\n var url = shopObj.saleLine;\n // == -- adjust process for updating info or replacing info -- == \\\\ \n if(!clear && saleOffset){ \n // logSales(\"sales object\",shopObj);\n url = url+\"&saleLineID=%3E,\"+saleOffset;\n// logSales(\"log Url\",url);\n updateSaleID(shopObj.name,saleOffset)\n } else {\n clearSheet(headerRows, sheet);\n saleOffset = 0;\n }\n \n// logSales(\"url\",url);\n // == -- Initiate the OAuth / Api Call with the given variables -- == \\\\ \n var data = getData(offset,url,endPoint,type);\n if(data.length>=0 ){\n for(var i = 0; i<data.length; i++){\n var row = data[i];\n// logSales(\"Data Row\",row);\n getNames(row);\n// fixItems(row);\n fixDates(row);\n }}\n // == -- Make the call to insert the rows needed for the new data and insert the data -- == \\\\ \n insertData(sheet,data);\n}", "getAllSalesList() {\n fetch(process.env.REACT_APP_API_URL+\"/sales\")\n .then(res => res.json())\n .then(\n result => {\n this.setState({\n isLoaded: true,\n salesList: result,\n });\n },\n error => {\n this.setState({\n isLoaded: true,\n error: error\n });\n }\n );\n }", "function convertToSale(itemID) {\n $('#AllOpps').hide();\n $('#OppDetails').hide();\n clearEditOppForm();\n\n currentItem.set_item(\"_Status\", \"Sale\");\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditOppForm();\n showSales();\n }\n ,\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n}", "function printStoreDetails() {\n console.log(\"\\n\");\n console.log(chalk.white.bgBlack.bold(\"Days opened: \" + store.days));\n console.log(chalk.white.bgBlack.bold(\"Money: $\" + store.money));\n console.log(\"\\n\");\n}", "display() {\n for (let i = 0; i < this.data.stock.length; i++) {\n console.log(i + 1 + \". \" + this.data.stock[i].corporation);\n }\n }", "function viewProducts(){\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n \n managerAsk();\n });\n }", "function showDetails({bookTitle, price}){\n console.log(`Name: ${bookTitle}, price: ${price} `)\n }", "function getProducts(){\n return catalog;\n }", "function catalogFind(){\n var catalog=returnCatalog(\"item\");\n // console.log(catalog);\n if(catalog != null){\n productArray = processArray(catalog,1);\n nowArray = productArray;\n // console.log(productArray);\n getSortMethod(nowArray);\n updateBrandAmount();\n changeDisplayAmount(displayType,1);\n }\n}", "function trapItemDetails() {\n\n console.log(GM_info.script.name + ': trapItemDetails');\n\n //debugger;\n\n let parentDiv = $('div.ReactVirtualized__Grid').get();\n if (!validPointer(parentDiv) || !parentDiv.length) {return;}\n\n let owlItem = $(parentDiv).find('div.info___3-0WL').get();\n if (!owlItem.length || !validPointer(owlItem)) {return;}\n\n let clearfix = $(owlItem).find('div.info-content > div.clearfix.info-wrap')[0];\n if (!validPointer(clearfix)) {return;}\n\n //let pricingUl = $(clearfix).find('ul.info-cont')[0];\n //if (!validPointer(pricingUl)) {return;}\n\n let statsUl = $(clearfix).find('ul.info-cont.list-wrap')[0];\n if (!validPointer(statsUl)) {return;}\n\n let newItem = getNewItem();\n\n //getNameTypeItemInfo(owlItem, newItem);\n //getPricingInfo(pricingUl, newItem);\n getStatInfo(statsUl, newItem);\n\n console.log(GM_info.script.name + ': newItem: ', newItem);\n\n\n }", "function displayInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n console.log(\"-----------------------------------\");\n });\n }", "function getRecords(datain)\n{\n var filters = new Array();\n var daterange = 'daysAgo90';\n var projectedamount = 0;\n var probability = 0;\n if (datain.daterange) {\n daterange = datain.daterange;\n }\n if (datain.projectedamount) {\n projectedamount = datain.projectedamount;\n }\n if (datain.probability) {\n probability = datain.probability;\n }\n \n filters[0] = new nlobjSearchFilter( 'trandate', null, 'onOrAfter', daterange ); // like daysAgo90\n filters[1] = new nlobjSearchFilter( 'projectedamount', null, 'greaterthanorequalto', projectedamount);\n filters[2] = new nlobjSearchFilter( 'probability', null, 'greaterthanorequalto', probability );\n \n // Define search columns\n var columns = new Array();\n columns[0] = new nlobjSearchColumn( 'salesrep' );\n columns[1] = new nlobjSearchColumn( 'expectedclosedate' );\n columns[2] = new nlobjSearchColumn( 'entity' );\n columns[3] = new nlobjSearchColumn( 'projectedamount' );\n columns[4] = new nlobjSearchColumn( 'probability' );\n columns[5] = new nlobjSearchColumn( 'email', 'customer' );\n columns[6] = new nlobjSearchColumn( 'email', 'salesrep' );\n columns[7] = new nlobjSearchColumn( 'title' );\n \n // Execute the search and return results\n \n var opps = new Array();\n var searchresults = nlapiSearchRecord( 'opportunity', null, filters, columns );\n \n // Loop through all search results. When the results are returned, use methods\n // on the nlobjSearchResult object to get values for specific fields.\n for ( var i = 0; searchresults != null && i < searchresults.length; i++ )\n {\n var searchresult = searchresults[ i ];\n var record = searchresult.getId( );\n var salesrep = searchresult.getValue( 'salesrep' );\n var salesrep_display = searchresult.getText( 'salesrep' );\n var salesrep_email = searchresult.getValue( 'email', 'salesrep' );\n var customer = searchresult.getValue( 'entity' );\n var customer_display = searchresult.getText( 'entity' );\n var customer_email = searchresult.getValue( 'email', 'customer' );\n var expectedclose = searchresult.getValue( 'expectedclosedate' );\n var projectedamount = searchresult.getValue( 'projectedamount' );\n var probability = searchresult.getValue( 'probability' );\n var title = searchresult.getValue( 'title' );\n \n opps[opps.length++] = new opportunity( record,\n title,\n probability,\n projectedamount,\n customer_display,\n salesrep_display);\n }\n \n var returnme = new Object();\n returnme.nssearchresult = opps;\n return returnme;\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nInventory\", res);\n returnToMenu();\n });\n}", "function display () {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.log(\"Welcome to Bamazon! Here's what we have for sale:\")\n // for loop to loop through each item in the sql file for display\n for (var i=0; i < res.length; i++) {\n console.log(\"Item ID: \" + res[i].id + ' ' + res[i].product_name + ' $' + res[i].price);\n }\n purchase();\n })\n}", "function forSale() {\n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n table(res);\n shop();\n });\n}", "function getAndDisplaySellList() {\n getSellList();\n console.log('getAndDisplaySellList works');\n}", "function showItems() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n var resultsArr = [];\n for (i = 0; i < results.length; i++) {\n resultsArr.push(\"\\nITEM ID: \" + results[i].item_id + \" || ITEM: \" + results[i].product_name + \" || PRICE: \" + results[i].price + \" || QUANTITY: \" + results[i].stock_quantity + \"\\n\\n--------------------------------------------------------------------------\");\n }\n console.log(\"\\nITEMS FOR SALE:\\n\" + resultsArr.join(\"\\n\"));\n userPurchase();\n });\n}", "function getCount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n\n var leadCount = 0;\n var oppCount = 0;\n var saleCount = 0;\n var lostSaleCount = 0;\n var allCount = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all counts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadCount = parseInt(leadCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppCount = parseInt(oppCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleCount = parseInt(saleCount) + 1;\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleCount = parseInt(lostSaleCount) + 1;\n }\n if (listItem.get_fieldValues()) {\n allCount = parseInt(allCount) + 1;\n }\n var current = allCount - lostSaleCount;\n }\n showLeadCount(leadCount);\n showOppCount(oppCount);\n showSaleCount(saleCount);\n showLostSaleCount(lostSaleCount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allCount, leadCount, oppCount, saleCount, current, lostSaleCount);\n\n }, function () { alert(\"failure in getCount\"); });\n}", "function getPricing(trigger) {\n var url = \"https://api.myjson.com/bins/47axv\";\n return getData(url, displayPricing, trigger);\n}", "function getDetails (selectedPackage) {\r\n return {\r\n type: GET_DETAILS,\r\n selectedPackage\r\n }\r\n}", "get productTextDetail() { return $('.inventory_details_name') }", "function getItems()\r\n{\r\n\t//Declaring the local variables\r\n\tvar itemFilters = new Array();\r\n\tvar itemTypes = new Array();\t\t//version 1.0.1\r\n\r\n\ttry\r\n\t{\r\n\t\t//version 1.0.1\r\n\t\titemTypes[0] = 'InvtPart';\r\n\t\titemTypes[1] = 'Kit';\r\n\t\titemTypes[2] = 'NonInvtPart';\r\n\t\titemTypes[3] = 'OthCharge';\r\n\t\titemTypes[4] = 'Payment';\r\n\r\n\r\n\t\t//Adding filters \r\n\t\titemFilters[0] = new nlobjSearchFilter('isinactive',null, 'is','F');\t\t\t\t\t\t\t\t\t\t//filtering by active Items\r\n\t\titemFilters[1] = new nlobjSearchFilter('custitem_itemprice_lastupdated',null, 'notonorafter',dateLimit);\t//filtering by date limit\r\n\t\titemFilters[2] = new nlobjSearchFilter('type',null, 'anyof',itemTypes);\t\t\t\t\t\t\t\t\t\t//filtering by item type\tversion 1.0.1\r\n\r\n\t\t//Getting particular columns in item search results \r\n\t\titemColumns[0] = new nlobjSearchColumn('internalid');\t\t\t\t\t\t//Getting Item's Internal ID\r\n\t\titemColumns[1] = new nlobjSearchColumn('baseprice');\t\t\t\t\t\t//Getting Item's base price\r\n\t\titemColumns[2] = new nlobjSearchColumn('name');\t\t\t\t\t\t\t\t//Getting Item's name\r\n\t\titemColumns[3] = new nlobjSearchColumn('averagecost');\t\t\t\t\t\t//getting the average cost of the item\r\n\t\titemColumns[4] = new nlobjSearchColumn('custitem_volumetricweight');\t\t//getting volumetric weight\r\n\t\titemColumns[5] = new nlobjSearchColumn('custitem_kitpackavgcost');\t\t\t//getting average cost of the kit/pacckage\r\n\t\titemColumns[6] = new nlobjSearchColumn('custitem_dimension1');\t\t\t\t//getting Item's dimension1\r\n\t\titemColumns[7] = new nlobjSearchColumn('custitem_dimension2');\t\t\t\t//getting Item's dimension2\r\n\t\titemColumns[8] = new nlobjSearchColumn('custitem_dimension3');\t\t\t\t//getting Item's dimension3\r\n\r\n\t\t//Searching the items using filters and columns \r\n\t\titemRecords = nlapiSearchRecord('item', null, itemFilters, itemColumns);\t\t\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(\"getItems : \" , e);\r\n\t} \r\n}", "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n //organizes the collumns i wish to display for each item\n for (var i = 0; i < res.length; i++) {\n console.log(`ID: ${res[i].id} || Name: ${res[i].product_name} || Department: ${res[i].department_name} || Price: $${res[i].price}`)\n }\n shopping();\n })\n}", "function getAllProductsForSaleByStore() {\n return datacontext.get('Product/GetAllProductsForSaleByStore');\n }", "function viewProducts(){\n console.log(\"\\nView Every Avalailable Product in format:\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"'ItemID-->Product Description-->Department Name-->Price-->Product Quantity'\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Item# \" + res[i].item_id + \"-->\" + res[i].product_name \n + \"-->\" + res[i].department_name + \"-->\" + res[i].price \n + \"-->\" + res[i].stock_quantity);\n }\n // console.table(\"\\nProducts Available:\",[\n // res\n // ])\n })\n setTimeout(function() { startManager(); }, 200);\n}" ]
[ "0.65242743", "0.6435476", "0.640648", "0.63659734", "0.60214293", "0.6010571", "0.5927727", "0.5880507", "0.5830779", "0.58215594", "0.58188033", "0.576814", "0.5763571", "0.57349867", "0.569134", "0.56725425", "0.56581235", "0.56543934", "0.5641388", "0.5631957", "0.5568955", "0.55655456", "0.5551714", "0.5539557", "0.55321", "0.55229133", "0.55068177", "0.55004835", "0.5492167", "0.5444719", "0.5418643", "0.54156643", "0.5415479", "0.54135334", "0.5402776", "0.5398459", "0.53922343", "0.53882474", "0.5382095", "0.53677934", "0.5366405", "0.53493106", "0.5345516", "0.532499", "0.53206885", "0.53169376", "0.5311134", "0.5300592", "0.52967435", "0.5286072", "0.5279581", "0.52706647", "0.5265202", "0.5248174", "0.5247521", "0.5231521", "0.52084035", "0.5198547", "0.5188095", "0.5169836", "0.51629215", "0.5161152", "0.5157368", "0.5153727", "0.5151375", "0.51497066", "0.51491743", "0.5139992", "0.513872", "0.5133225", "0.51329213", "0.5128536", "0.5126719", "0.51208735", "0.51184106", "0.51142704", "0.5111566", "0.5108806", "0.51069164", "0.51063013", "0.5105189", "0.5098033", "0.5095084", "0.5091463", "0.50854355", "0.5083213", "0.5069107", "0.5064138", "0.5054981", "0.5045378", "0.5044955", "0.5044853", "0.50405127", "0.50381845", "0.5036921", "0.5032087", "0.5025351", "0.5024011", "0.50184816", "0.501541" ]
0.5310062
47